Changeset 86561 in webkit


Ignore:
Timestamp:
May 16, 2011 5:42:32 AM (13 years ago)
Author:
andreas.kling@nokia.com
Message:

2011-05-16 Andreas Kling <kling@webkit.org>

Reviewed by Darin Adler.

CSS: Fast path for 'px' lengths should be case-insensitive.
https://bugs.webkit.org/show_bug.cgi?id=60703

No new tests, this is an optimization that avoids creating
a full CSSParser to parse the value.

  • css/CSSParser.cpp: (WebCore::parseSimpleLengthValue):
Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r86557 r86561  
     12011-05-16  Andreas Kling  <kling@webkit.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        CSS: Fast path for 'px' lengths should be case-insensitive.
     6        https://bugs.webkit.org/show_bug.cgi?id=60703
     7
     8        No new tests, this is an optimization that avoids creating
     9        a full CSSParser to parse the value.
     10
     11        * css/CSSParser.cpp:
     12        (WebCore::parseSimpleLengthValue):
     13
    1142011-05-16  Naiem Shaik  <naiem.shaik@gmail.com>
    215
  • trunk/Source/WebCore/css/CSSParser.cpp

    r86500 r86561  
    376376
    377377    CSSPrimitiveValue::UnitTypes unit = CSSPrimitiveValue::CSS_NUMBER;
    378     if (length > 2 && characters[length - 2] == 'p' && characters[length - 1] == 'x') {
     378    if (length > 2 && (characters[length - 2] | 0x20) == 'p' && (characters[length - 1] | 0x20) == 'x') {
    379379        length -= 2;
    380380        unit = CSSPrimitiveValue::CSS_PX;
Note: See TracChangeset for help on using the changeset viewer.