mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-22 20:16:54 +03:00
Update to use latest libdom. Fixes handling of text input with no maxlength set.
This commit is contained in:
parent
ba7fba824d
commit
3e549fde3e
@ -200,9 +200,6 @@ struct form_control *form_new_control(void *node, form_control_type type)
|
||||
control->node = node;
|
||||
control->type = type;
|
||||
|
||||
/* Default max length of input to something insane */
|
||||
control->maxlength = UINT_MAX;
|
||||
|
||||
return control;
|
||||
}
|
||||
|
||||
|
@ -332,10 +332,21 @@ parse_input_element(struct form *forms, dom_html_input_element *input)
|
||||
|
||||
if (control->type == GADGET_PASSWORD ||
|
||||
control->type == GADGET_TEXTBOX) {
|
||||
unsigned long maxlength;
|
||||
long maxlength;
|
||||
if (dom_html_input_element_get_max_length(
|
||||
input, &maxlength) == DOM_NO_ERR) {
|
||||
input, &maxlength) != DOM_NO_ERR) {
|
||||
maxlength = -1;
|
||||
}
|
||||
|
||||
if (maxlength >= 0) {
|
||||
/* Got valid maxlength */
|
||||
control->maxlength = maxlength;
|
||||
} else {
|
||||
/* Input has no maxlength attr, or
|
||||
* dom_html_input_element_get_max_length failed.
|
||||
*
|
||||
* Set it to something insane. */
|
||||
control->maxlength = UINT_MAX;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user