Summary: | CSS: Fast path for 'px' lengths should be case-insensitive. | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Andreas Kling <kling> | ||||
Component: | CSS | Assignee: | Andreas Kling <kling> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | ian | ||||
Priority: | P2 | Keywords: | Performance | ||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
Andreas Kling
2011-05-12 09:14:14 PDT
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> |