RESOLVED FIXED89569
pattern="" should only accept the empty string
https://bugs.webkit.org/show_bug.cgi?id=89569
Summary pattern="" should only accept the empty string
Jacob Rask
Reported 2012-06-20 06:59:48 PDT
Setting pattern to "" makes any value valid. http://jsfiddle.net/z7tb9/
Attachments
Patch (5.16 KB, patch)
2012-06-26 17:08 PDT, Pablo Flouret
no flags
Patch (5.13 KB, patch)
2012-06-27 17:22 PDT, Pablo Flouret
no flags
Kent Tamura
Comment 1 2012-06-20 13:37:27 PDT
Confirmed.
Pablo Flouret
Comment 2 2012-06-26 17:08:42 PDT
Darin Adler
Comment 3 2012-06-26 17:57:42 PDT
Comment on attachment 149638 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=149638&action=review Good fix. Need to do it slightly differently, though. > Source/WebCore/html/BaseTextInputType.cpp:44 > - if (rawPattern.isEmpty() || value.isEmpty()) > + if (!element()->fastHasAttribute(patternAttr) || value.isEmpty()) The correct way to check this is: if (rawPattern.isNull() || value.isEmpty()) There’s no need for a fastHasAttribute call, which will do another attribute hash table lookup.
Pablo Flouret
Comment 4 2012-06-27 17:22:57 PDT
Created attachment 149830 [details] Patch Fixed the test condition per Darin's helpful comments.
Kent Tamura
Comment 5 2012-06-27 20:40:35 PDT
Comment on attachment 149830 [details] Patch Looks nice. Thank you!
WebKit Review Bot
Comment 6 2012-06-27 20:58:17 PDT
Comment on attachment 149830 [details] Patch Clearing flags on attachment: 149830 Committed r121401: <http://trac.webkit.org/changeset/121401>
WebKit Review Bot
Comment 7 2012-06-27 20:58:22 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.