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.
Created attachment 93293 [details] Proposed patch
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).
Committed r86561: <http://trac.webkit.org/changeset/86561>