Changeset 143114 in webkit


Ignore:
Timestamp:
Feb 16, 2013 3:34:22 PM (11 years ago)
Author:
akling@apple.com
Message:

Element: Devirtualize attribute synchronization functions.
<http://webkit.org/b/110033>

Reviewed by Darin Adler.

Devirtualize the functions that perform re-serialization of lazy attributes and give
them "synchronize"-style names:

  • SVGElement::synchronizeAnimatedSVGAttribute()
  • StyledElement::synchronizeStyleAttributeInternal()
  • dom/Element.cpp:

(WebCore::Element::synchronizeAllAttributes):
(WebCore::Element::synchronizeAttribute):

  • dom/Element.h:
  • dom/StyledElement.cpp:

(WebCore::StyledElement::synchronizeStyleAttribute):

  • dom/StyledElement.h:

(StyledElement):

  • rendering/svg/RenderSVGResourceGradient.cpp:

(WebCore::RenderSVGResourceGradient::applyResource):

  • rendering/svg/RenderSVGResourcePattern.cpp:

(WebCore::RenderSVGResourcePattern::buildPattern):

  • svg/SVGElement.cpp:

(WebCore::SVGElement::synchronizeAnimatedSVGAttribute):

  • svg/SVGElement.h:

(SVGElement):

Location:
trunk/Source/WebCore
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r143112 r143114  
     12013-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
    1312013-02-16  Andreas Kling  <akling@apple.com>
    232
  • trunk/Source/WebCore/dom/Element.cpp

    r143112 r143114  
    341341    if (!elementData())
    342342        return;
    343     if (elementData()->m_styleAttributeIsDirty)
    344         updateStyleAttribute();
     343    if (elementData()->m_styleAttributeIsDirty) {
     344        ASSERT(isStyledElement());
     345        static_cast<const StyledElement*>(this)->synchronizeStyleAttributeInternal();
     346    }
    345347#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    }
    348352#endif
    349353}
     
    354358        return;
    355359    if (UNLIKELY(name == styleAttr && elementData()->m_styleAttributeIsDirty)) {
    356         updateStyleAttribute();
     360        ASSERT(isStyledElement());
     361        static_cast<const StyledElement*>(this)->synchronizeStyleAttributeInternal();
    357362        return;
    358363    }
    359364#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    }
    362369#endif
    363370}
     
    370377        return;
    371378    if (elementData()->m_styleAttributeIsDirty && equalPossiblyIgnoringCase(localName, styleAttr.localName(), shouldIgnoreAttributeCase(this))) {
    372         updateStyleAttribute();
     379        ASSERT(isStyledElement());
     380        static_cast<const StyledElement*>(this)->synchronizeStyleAttributeInternal();
    373381        return;
    374382    }
     
    376384    if (elementData()->m_animatedSVGAttributesAreDirty) {
    377385        // 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));
    379388    }
    380389#endif
  • trunk/Source/WebCore/dom/Element.h

    r143112 r143114  
    667667    bool pseudoStyleCacheIsInvalid(const RenderStyle* currentStyle, RenderStyle* newStyle);
    668668
    669     virtual void updateStyleAttribute() const { }
    670 
    671 #if ENABLE(SVG)
    672     virtual void updateAnimatedSVGAttribute(const QualifiedName&) const { }
    673 #endif
    674 
    675669    void cancelFocusAppearanceUpdate();
    676670
  • trunk/Source/WebCore/dom/StyledElement.cpp

    r142826 r143114  
    127127}
    128128
    129 void StyledElement::updateStyleAttribute() const
     129void StyledElement::synchronizeStyleAttributeInternal() const
    130130{
    131131    ASSERT(elementData());
  • trunk/Source/WebCore/dom/StyledElement.h

    r142791 r143114  
    5050    bool removeInlineStyleProperty(CSSPropertyID);
    5151    void removeAllInlineStyleProperties();
     52
     53    void synchronizeStyleAttributeInternal() const;
    5254   
    5355    virtual CSSStyleDeclaration* style() OVERRIDE;
     
    7678    void styleAttributeChanged(const AtomicString& newStyleString);
    7779
    78     virtual void updateStyleAttribute() const;
    7980    void inlineStyleChanged();
    8081    PropertySetCSSStyleDeclaration* inlineStyleCSSOMWrapper();
  • trunk/Source/WebCore/rendering/svg/RenderSVGResourceGradient.cpp

    r130612 r143114  
    128128
    129129    if (m_shouldCollectGradientAttributes) {
    130         gradientElement->updateAnimatedSVGAttribute(anyQName());
     130        gradientElement->synchronizeAnimatedSVGAttribute(anyQName());
    131131        if (!collectGradientAttributes(gradientElement))
    132132            return false;
  • trunk/Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp

    r136250 r143114  
    6767
    6868    if (m_shouldCollectPatternAttributes) {
    69         patternElement->updateAnimatedSVGAttribute(anyQName());
     69        patternElement->synchronizeAnimatedSVGAttribute(anyQName());
    7070
    7171        m_attributes = PatternAttributes();
  • trunk/Source/WebCore/svg/SVGElement.cpp

    r143089 r143114  
    543543}
    544544
    545 void SVGElement::updateAnimatedSVGAttribute(const QualifiedName& name) const
     545void SVGElement::synchronizeAnimatedSVGAttribute(const QualifiedName& name) const
    546546{
    547547    if (!elementData() || !elementData()->m_animatedSVGAttributesAreDirty)
  • trunk/Source/WebCore/svg/SVGElement.h

    r142791 r143114  
    9494    void setCorrespondingElement(SVGElement*);
    9595
    96     virtual void updateAnimatedSVGAttribute(const QualifiedName&) const;
     96    void synchronizeAnimatedSVGAttribute(const QualifiedName&) const;
    9797 
    9898    virtual PassRefPtr<RenderStyle> customStyleForRenderer() OVERRIDE;
Note: See TracChangeset for help on using the changeset viewer.