Changeset 96168 in webkit
- Timestamp:
- Sep 27, 2011 4:24:53 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r96166 r96168 1 2011-09-27 Luke Macpherson <macpherson@chromium.org> 2 3 Slightly improve performance of CSSStyleApplyProperty handler lookup. 4 https://bugs.webkit.org/show_bug.cgi?id=68868 5 6 Reviewed by Eric Seidel. 7 8 No new tests as no functionality changed. 9 10 * css/CSSStyleApplyProperty.h: 11 (WebCore::CSSStyleApplyProperty::propertyHandler): 12 Make propertyHandler() public and remove redirecting functions. 13 * css/CSSStyleSelector.cpp: 14 (WebCore::CSSStyleSelector::applyProperty): 15 Perform property handler lookup once and reuse the result. 16 1 17 2011-09-27 Kent Tamura <tkent@chromium.org> 2 18 -
trunk/Source/WebCore/css/CSSStyleApplyProperty.h
r95901 r96168 50 50 static const CSSStyleApplyProperty& sharedCSSStyleApplyProperty(); 51 51 52 void applyInheritValue(CSSPropertyID property, CSSStyleSelector* selector) const52 ApplyPropertyBase* propertyHandler(CSSPropertyID property) const 53 53 { 54 ASSERT( implements(property));55 propertyHandler(property)->applyInheritValue(selector);54 ASSERT(valid(property)); 55 return m_propertyMap[index(property)]; 56 56 } 57 58 void applyInitialValue(CSSPropertyID property, CSSStyleSelector* selector) const59 {60 ASSERT(implements(property));61 propertyHandler(property)->applyInitialValue(selector);62 }63 64 void applyValue(CSSPropertyID property, CSSStyleSelector* selector, CSSValue* value) const65 {66 ASSERT(implements(property));67 propertyHandler(property)->applyValue(selector, value);68 }69 70 bool implements(CSSPropertyID property) const71 {72 return propertyHandler(property);73 }74 75 57 private: 76 58 CSSStyleApplyProperty(); … … 101 83 } 102 84 103 ApplyPropertyBase* propertyHandler(CSSPropertyID property) const104 {105 ASSERT(valid(property));106 return m_propertyMap[index(property)];107 }108 109 85 ApplyPropertyBase* m_propertyMap[numCSSProperties]; 110 86 }; -
trunk/Source/WebCore/css/CSSStyleSelector.cpp
r96122 r96168 2372 2372 2373 2373 // check lookup table for implementations and use when available 2374 if ( m_applyProperty.implements(property)) {2374 if (ApplyPropertyBase* handler = m_applyProperty.propertyHandler(property)) { 2375 2375 if (isInherit) 2376 m_applyProperty.applyInheritValue(property,this);2376 handler->applyInheritValue(this); 2377 2377 else if (isInitial) 2378 m_applyProperty.applyInitialValue(property,this);2378 handler->applyInitialValue(this); 2379 2379 else 2380 m_applyProperty.applyValue(property,this, value);2380 handler->applyValue(this, value); 2381 2381 return; 2382 2382 }
Note: See TracChangeset
for help on using the changeset viewer.