Skip to content
  • benjamin@webkit.org's avatar
    Share the StringImpl the CSS property names · 5ab707f4
    benjamin@webkit.org authored
    https://bugs.webkit.org/show_bug.cgi?id=94187
    
    Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-08-17
    Reviewed by Alexey Proskuryakov.
    
    Previously, we would instanciate a new String every time a CSS property name was needed.
    
    This patches moves the creation of the AtomicString to CSSPropertyNames and reuse that
    StringImpl whenever needed.
    
    With the patch, accessing CSS property names from JavaScript gets about 2.1 times faster.
    
    * css/CSSComputedStyleDeclaration.cpp:
    (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
    (WebCore::CSSComputedStyleDeclaration::item):
    * css/CSSPrimitiveValue.cpp:
    (WebCore::valueOrPropertyName):
    * css/CSSProperty.cpp:
    (WebCore::CSSProperty::cssName):
    * css/PropertySetCSSStyleDeclaration.cpp:
    (WebCore::PropertySetCSSStyleDeclaration::item):
    (WebCore::PropertySetCSSStyleDeclaration::getPropertyShorthand):
    * css/makeprop.pl:
    * inspector/InspectorCSSAgent.cpp:
    (WebCore::InspectorCSSAgent::getSupportedCSSProperties):
    * inspector/InspectorStyleSheet.cpp:
    (WebCore::InspectorStyle::styleWithProperties):
    * page/animation/ImplicitAnimation.cpp:
    (WebCore::ImplicitAnimation::sendTransitionEvent):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125934 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    5ab707f4