Changeset 83118 in webkit


Ignore:
Timestamp:
Apr 6, 2011 4:19:20 PM (13 years ago)
Author:
Simon Fraser
Message:

2011-04-06 Ian Henderson <ianh@apple.com>

Reviewed by Antti Koivisto.

Unnecessary string allocation in CSSStyleDeclaration::setProperty
https://bugs.webkit.org/show_bug.cgi?id=57995

Pass the bool representing the property's importance directly instead
of constructing a string.

  • css/CSSStyleDeclaration.cpp: (WebCore::CSSStyleDeclaration::setProperty):
Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r83115 r83118  
     12011-04-06  Ian Henderson  <ianh@apple.com>
     2
     3        Reviewed by Antti Koivisto.
     4
     5        Unnecessary string allocation in CSSStyleDeclaration::setProperty
     6        https://bugs.webkit.org/show_bug.cgi?id=57995
     7
     8        Pass the bool representing the property's importance directly instead
     9        of constructing a string.
     10
     11        * css/CSSStyleDeclaration.cpp:
     12        (WebCore::CSSStyleDeclaration::setProperty):
     13
    1142011-04-06  Leandro Gracia Gil  <leandrogracia@chromium.org>
    215
  • trunk/Source/WebCore/css/CSSStyleDeclaration.cpp

    r79985 r83118  
    108108{
    109109    size_t important = value.find("!important", 0, false);
     110    int propertyID = cssPropertyID(propertyName);
     111    if (!propertyID)
     112        return;
    110113    if (important == notFound)
    111         setProperty(propertyName, value, "", ec);
     114        setProperty(propertyID, value, false, ec);
    112115    else
    113         setProperty(propertyName, value.left(important - 1), "important", ec);
     116        setProperty(propertyID, value.left(important - 1), true, ec);
    114117}
    115118
Note: See TracChangeset for help on using the changeset viewer.