Ignore:
Timestamp:
12/03/11 13:53:29 (3 years ago)
Author:
kling@webkit.org
Message:

Cache CSSInitialValue instances per-document.
<http://webkit.org/b/73745>

Reviewed by Oliver Hunt.

Source/WebCore:

Test: http/tests/security/cross-origin-css-primitive.html

Have CSSValuePool manage the caching of CSSInitialValue objects.

  • css/CSSInitialValue.h:

(WebCore::CSSInitialValue::createExplicit):
(WebCore::CSSInitialValue::createImplicit):
(WebCore::CSSInitialValue::CSSInitialValue):

  • css/CSSParser.cpp:

(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseFillShorthand):
(WebCore::CSSParser::parseAnimationShorthand):
(WebCore::CSSParser::parseTransitionShorthand):
(WebCore::CSSParser::parseShorthand):

  • css/CSSValuePool.cpp:

(WebCore::CSSValuePool::CSSValuePool):
(WebCore::CSSValuePool::createImplicitInitialValue):
(WebCore::CSSValuePool::createExplicitInitialValue):

  • css/CSSValuePool.h:

LayoutTests:

Test that 'initial' and 'inherit' values are cached per-document.

  • http/tests/security/cross-origin-css-primitive-expected.txt:
  • http/tests/security/cross-origin-css-primitive.html:
  • http/tests/security/resources/cross-origin-css-primitive-iframe.html:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/css/CSSValuePool.cpp

    r101934 r101935  
    3232CSSValuePool::CSSValuePool() 
    3333    : m_inheritedValue(CSSInheritedValue::create()) 
     34    , m_implicitInitialValue(CSSInitialValue::createImplicit()) 
     35    , m_explicitInitialValue(CSSInitialValue::createExplicit()) 
    3436    , m_colorTransparent(CSSPrimitiveValue::createColor(Color::transparent)) 
    3537    , m_colorWhite(CSSPrimitiveValue::createColor(Color::white)) 
     
    4850{ 
    4951    return m_inheritedValue; 
     52} 
     53 
     54PassRefPtr<CSSInitialValue> CSSValuePool::createImplicitInitialValue() 
     55{ 
     56    return m_implicitInitialValue; 
     57} 
     58 
     59PassRefPtr<CSSInitialValue> CSSValuePool::createExplicitInitialValue() 
     60{ 
     61    return m_explicitInitialValue; 
    5062} 
    5163 
Note: See TracChangeset for help on using the changeset viewer.