Changeset 143114 in webkit
- Timestamp:
- Feb 16, 2013 3:34:22 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r143112 r143114 1 2013-02-16 Andreas Kling <akling@apple.com> 2 3 Element: Devirtualize attribute synchronization functions. 4 <http://webkit.org/b/110033> 5 6 Reviewed by Darin Adler. 7 8 Devirtualize the functions that perform re-serialization of lazy attributes and give 9 them "synchronize"-style names: 10 11 - SVGElement::synchronizeAnimatedSVGAttribute() 12 - StyledElement::synchronizeStyleAttributeInternal() 13 14 * dom/Element.cpp: 15 (WebCore::Element::synchronizeAllAttributes): 16 (WebCore::Element::synchronizeAttribute): 17 * dom/Element.h: 18 * dom/StyledElement.cpp: 19 (WebCore::StyledElement::synchronizeStyleAttribute): 20 * dom/StyledElement.h: 21 (StyledElement): 22 * rendering/svg/RenderSVGResourceGradient.cpp: 23 (WebCore::RenderSVGResourceGradient::applyResource): 24 * rendering/svg/RenderSVGResourcePattern.cpp: 25 (WebCore::RenderSVGResourcePattern::buildPattern): 26 * svg/SVGElement.cpp: 27 (WebCore::SVGElement::synchronizeAnimatedSVGAttribute): 28 * svg/SVGElement.h: 29 (SVGElement): 30 1 31 2013-02-16 Andreas Kling <akling@apple.com> 2 32 -
trunk/Source/WebCore/dom/Element.cpp
r143112 r143114 341 341 if (!elementData()) 342 342 return; 343 if (elementData()->m_styleAttributeIsDirty) 344 updateStyleAttribute(); 343 if (elementData()->m_styleAttributeIsDirty) { 344 ASSERT(isStyledElement()); 345 static_cast<const StyledElement*>(this)->synchronizeStyleAttributeInternal(); 346 } 345 347 #if ENABLE(SVG) 346 if (elementData()->m_animatedSVGAttributesAreDirty) 347 updateAnimatedSVGAttribute(anyQName()); 348 if (elementData()->m_animatedSVGAttributesAreDirty) { 349 ASSERT(isSVGElement()); 350 static_cast<const SVGElement*>(this)->synchronizeAnimatedSVGAttribute(anyQName()); 351 } 348 352 #endif 349 353 } … … 354 358 return; 355 359 if (UNLIKELY(name == styleAttr && elementData()->m_styleAttributeIsDirty)) { 356 updateStyleAttribute(); 360 ASSERT(isStyledElement()); 361 static_cast<const StyledElement*>(this)->synchronizeStyleAttributeInternal(); 357 362 return; 358 363 } 359 364 #if ENABLE(SVG) 360 if (UNLIKELY(elementData()->m_animatedSVGAttributesAreDirty)) 361 updateAnimatedSVGAttribute(name); 365 if (UNLIKELY(elementData()->m_animatedSVGAttributesAreDirty)) { 366 ASSERT(isSVGElement()); 367 static_cast<const SVGElement*>(this)->synchronizeAnimatedSVGAttribute(name); 368 } 362 369 #endif 363 370 } … … 370 377 return; 371 378 if (elementData()->m_styleAttributeIsDirty && equalPossiblyIgnoringCase(localName, styleAttr.localName(), shouldIgnoreAttributeCase(this))) { 372 updateStyleAttribute(); 379 ASSERT(isStyledElement()); 380 static_cast<const StyledElement*>(this)->synchronizeStyleAttributeInternal(); 373 381 return; 374 382 } … … 376 384 if (elementData()->m_animatedSVGAttributesAreDirty) { 377 385 // We're not passing a namespace argument on purpose. SVGNames::*Attr are defined w/o namespaces as well. 378 updateAnimatedSVGAttribute(QualifiedName(nullAtom, localName, nullAtom)); 386 ASSERT(isSVGElement()); 387 static_cast<const SVGElement*>(this)->synchronizeAnimatedSVGAttribute(QualifiedName(nullAtom, localName, nullAtom)); 379 388 } 380 389 #endif -
trunk/Source/WebCore/dom/Element.h
r143112 r143114 667 667 bool pseudoStyleCacheIsInvalid(const RenderStyle* currentStyle, RenderStyle* newStyle); 668 668 669 virtual void updateStyleAttribute() const { }670 671 #if ENABLE(SVG)672 virtual void updateAnimatedSVGAttribute(const QualifiedName&) const { }673 #endif674 675 669 void cancelFocusAppearanceUpdate(); 676 670 -
trunk/Source/WebCore/dom/StyledElement.cpp
r142826 r143114 127 127 } 128 128 129 void StyledElement:: updateStyleAttribute() const129 void StyledElement::synchronizeStyleAttributeInternal() const 130 130 { 131 131 ASSERT(elementData()); -
trunk/Source/WebCore/dom/StyledElement.h
r142791 r143114 50 50 bool removeInlineStyleProperty(CSSPropertyID); 51 51 void removeAllInlineStyleProperties(); 52 53 void synchronizeStyleAttributeInternal() const; 52 54 53 55 virtual CSSStyleDeclaration* style() OVERRIDE; … … 76 78 void styleAttributeChanged(const AtomicString& newStyleString); 77 79 78 virtual void updateStyleAttribute() const;79 80 void inlineStyleChanged(); 80 81 PropertySetCSSStyleDeclaration* inlineStyleCSSOMWrapper(); -
trunk/Source/WebCore/rendering/svg/RenderSVGResourceGradient.cpp
r130612 r143114 128 128 129 129 if (m_shouldCollectGradientAttributes) { 130 gradientElement-> updateAnimatedSVGAttribute(anyQName());130 gradientElement->synchronizeAnimatedSVGAttribute(anyQName()); 131 131 if (!collectGradientAttributes(gradientElement)) 132 132 return false; -
trunk/Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp
r136250 r143114 67 67 68 68 if (m_shouldCollectPatternAttributes) { 69 patternElement-> updateAnimatedSVGAttribute(anyQName());69 patternElement->synchronizeAnimatedSVGAttribute(anyQName()); 70 70 71 71 m_attributes = PatternAttributes(); -
trunk/Source/WebCore/svg/SVGElement.cpp
r143089 r143114 543 543 } 544 544 545 void SVGElement:: updateAnimatedSVGAttribute(const QualifiedName& name) const545 void SVGElement::synchronizeAnimatedSVGAttribute(const QualifiedName& name) const 546 546 { 547 547 if (!elementData() || !elementData()->m_animatedSVGAttributesAreDirty) -
trunk/Source/WebCore/svg/SVGElement.h
r142791 r143114 94 94 void setCorrespondingElement(SVGElement*); 95 95 96 v irtual void updateAnimatedSVGAttribute(const QualifiedName&) const;96 void synchronizeAnimatedSVGAttribute(const QualifiedName&) const; 97 97 98 98 virtual PassRefPtr<RenderStyle> customStyleForRenderer() OVERRIDE;
Note: See TracChangeset
for help on using the changeset viewer.