RESOLVED FIXED Bug 68981
REGRESSION(r93858): Can't type anything into input elements when maxlength is greater than 2^31
https://bugs.webkit.org/show_bug.cgi?id=68981
Summary REGRESSION(r93858): Can't type anything into input elements when maxlength is...
Kent Tamura
Reported 2011-09-28 00:36:04 PDT
http://code.google.com/p/chromium/issues/detail?id=98117 We use parseHTMLInteger() since r93858. However parseHTMLInteger() doesn't fail by overflow.
Attachments
Patch (4.82 KB, patch)
2011-09-28 01:11 PDT, Kent Tamura
no flags
Kent Tamura
Comment 1 2011-09-28 01:11:12 PDT
Darin Adler
Comment 2 2011-09-28 09:30:03 PDT
Comment on attachment 108981 [details] Patch Is this enough test coverage? What about all the other places that use the HTML parser? Do any of them change behavior based on this? Can we make tests covering them?
Kent Tamura
Comment 3 2011-09-28 18:32:47 PDT
(In reply to comment #2) > (From update of attachment 108981 [details]) > Is this enough test coverage? What about all the other places that use the HTML parser? Do any of them change behavior based on this? Can we make tests covering them? parseHTMLNonNegativeInteger() is used only for border attribute parsing. http://trac.webkit.org/browser/trunk/Source/WebCore/html/HTMLElement.cpp#L146 parseHTMLInteger() is used for tabindex attribute parsing, and maxlength attribute parsing. http://trac.webkit.org/browser/trunk/Source/WebCore/html/HTMLElement.cpp#L180 I'll add tests for them.
Kent Tamura
Comment 4 2011-09-28 18:44:18 PDT
(In reply to comment #3) > (In reply to comment #2) > > (From update of attachment 108981 [details] [details]) > > Is this enough test coverage? What about all the other places that use the HTML parser? Do any of them change behavior based on this? Can we make tests covering them? > > parseHTMLNonNegativeInteger() is used only for border attribute parsing. > http://trac.webkit.org/browser/trunk/Source/WebCore/html/HTMLElement.cpp#L146 > > parseHTMLInteger() is used for tabindex attribute parsing, and maxlength attribute parsing. > http://trac.webkit.org/browser/trunk/Source/WebCore/html/HTMLElement.cpp#L180 > > I'll add tests for them. Filed https://bugs.webkit.org/show_bug.cgi?id=69055 and https://bugs.webkit.org/show_bug.cgi?id=69056.
WebKit Review Bot
Comment 5 2011-09-28 19:48:53 PDT
Comment on attachment 108981 [details] Patch Clearing flags on attachment: 108981 Committed r96290: <http://trac.webkit.org/changeset/96290>
WebKit Review Bot
Comment 6 2011-09-28 19:48:58 PDT
All reviewed patches have been landed. Closing bug.
Mounir Lamouri
Comment 7 2011-10-16 10:46:36 PDT
When maxlength value isn't parsed correctly as a non-negative integer, maxlength shouldn't apply. Currently, it seems that Webkit is using 0 as the default value isntead of -1. It seems that fixing that would have fix this bug.
Kent Tamura
Comment 8 2011-10-16 17:49:32 PDT
(In reply to comment #7) > When maxlength value isn't parsed correctly as a non-negative integer, maxlength shouldn't apply. Currently, it seems that Webkit is using 0 as the default value isntead of -1. It seems that fixing that would have fix this bug. Do you mean this bug is not fixed yet? What revision of WebKit are you using?
Mounir Lamouri
Comment 9 2011-10-17 05:37:58 PDT
Hmm, I just realized that some information related to this bug where actually in the Chromium bug tracker. I thought the parsing was failing because of the overflow and 0 was used as a default value in that case. Looks like the parsing algorithm was returning 0 instead of failing. Things make a bit more sense now. Ignore my previous comment then. Though, Webkit should probably consider using -1 as the default maxlength value instead of 524288 as it appears to do in my build.
Kent Tamura
Comment 10 2011-10-17 06:07:36 PDT
(In reply to comment #9) > Hmm, I just realized that some information related to this bug where actually in the Chromium bug tracker. I thought the parsing was failing because of the overflow and 0 was used as a default value in that case. Looks like the parsing algorithm was returning 0 instead of failing. Things make a bit more sense now. Yeah, the number parsing code returns an error, instead of 0, now. > Ignore my previous comment then. Though, Webkit should probably consider using -1 as the default maxlength value instead of 524288 as it appears to do in my build. This issue is tracked in Bug 44883.
Note You need to log in before you can comment on or make changes to this bug.