RESOLVED FIXED60703
CSS: Fast path for 'px' lengths should be case-insensitive.
https://bugs.webkit.org/show_bug.cgi?id=60703
Summary CSS: Fast path for 'px' lengths should be case-insensitive.
Andreas Kling
Reported 2011-05-12 09:14:14 PDT
The fast-path for 'px' lengths added on bug 57964 only handles 'px' when in lowercase. 1px, 1PX, 1Px, etc are all valid CSS lengths, and we can easily support them in the fast-path.
Attachments
Proposed patch (1.41 KB, patch)
2011-05-12 09:18 PDT, Andreas Kling
darin: review+
Andreas Kling
Comment 1 2011-05-12 09:18:33 PDT
Created attachment 93293 [details] Proposed patch
Darin Adler
Comment 2 2011-05-12 09:59:26 PDT
Comment on attachment 93293 [details] Proposed patch View in context: https://bugs.webkit.org/attachment.cgi?id=93293&action=review > Source/WebCore/css/CSSParser.cpp:380 > + && (characters[length - 2] == 'p' || characters[length - 2] == 'P') > + && (characters[length - 1] == 'x' || characters[length - 1] == 'X')) { Another version would be: if (length > 2 && (characters[length - 2] | 0x20) == 'p' && (characters[length - 1] | 0x20) == 'x') { This is more efficient on platforms where branches are expensive. We use this idiom elsewhere in CSSParser.cpp for rgb and we even have a function for it in KURL.cpp (isLetterMatchIgnoringCase) and LinkHash.cpp (matchLetter).
Andreas Kling
Comment 3 2011-05-16 05:42:54 PDT
Note You need to log in before you can comment on or make changes to this bug.