Changeset 101934 in webkit
- Timestamp:
- Dec 3, 2011, 1:45:35 PM (14 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r101932 r101934 1 2011-12-03 Andreas Kling <kling@webkit.org> 2 3 Keep CSSInheritedValue in the CSS value pool. 4 <http://webkit.org/b/73747> 5 6 Reviewed by Antti Koivisto. 7 8 We only need one CSSInheritedValue instance per document, so cache it 9 in CSSValuePool and have the parser create it through there. 10 11 * css/CSSParser.cpp: 12 (WebCore::CSSParser::parseValue): 13 * css/CSSValuePool.cpp: 14 (WebCore::CSSValuePool::CSSValuePool): 15 (WebCore::CSSValuePool::createInheritedValue): 16 * css/CSSValuePool.h: 17 1 18 2011-12-03 Andreas Kling <kling@webkit.org> 2 19 -
trunk/Source/WebCore/css/CSSParser.cpp
r101932 r101934 845 845 if (num != 1) 846 846 return false; 847 addProperty(propId, CSSInheritedValue::create(), important);847 addProperty(propId, cssValuePool()->createInheritedValue(), important); 848 848 return true; 849 849 } -
trunk/Source/WebCore/css/CSSValuePool.cpp
r101932 r101934 31 31 32 32 CSSValuePool::CSSValuePool() 33 : m_colorTransparent(CSSPrimitiveValue::createColor(Color::transparent)) 33 : m_inheritedValue(CSSInheritedValue::create()) 34 , m_colorTransparent(CSSPrimitiveValue::createColor(Color::transparent)) 34 35 , m_colorWhite(CSSPrimitiveValue::createColor(Color::white)) 35 36 , m_colorBlack(CSSPrimitiveValue::createColor(Color::black)) … … 42 43 CSSValuePool::~CSSValuePool() 43 44 { 45 } 46 47 PassRefPtr<CSSInheritedValue> CSSValuePool::createInheritedValue() 48 { 49 return m_inheritedValue; 44 50 } 45 51 -
trunk/Source/WebCore/css/CSSValuePool.h
r101932 r101934 27 27 #define CSSValuePool_h 28 28 29 #include "CSSInheritedValue.h" 29 30 #include "CSSPrimitiveValue.h" 30 31 #include <wtf/HashMap.h> … … 38 39 ~CSSValuePool(); 39 40 41 PassRefPtr<CSSInheritedValue> createInheritedValue(); 40 42 PassRefPtr<CSSPrimitiveValue> createIdentifierValue(int identifier); 41 43 PassRefPtr<CSSPrimitiveValue> createColorValue(unsigned rgbValue); … … 46 48 private: 47 49 CSSValuePool(); 50 51 RefPtr<CSSInheritedValue> m_inheritedValue; 48 52 49 53 typedef HashMap<int, RefPtr<CSSPrimitiveValue> > IdentifierValueCache;
Note:
See TracChangeset
for help on using the changeset viewer.