Title: [143114] trunk/Source/WebCore
Revision
143114
Author
[email protected]
Date
2013-02-16 15:34:22 -0800 (Sat, 16 Feb 2013)

Log 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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (143113 => 143114)


--- trunk/Source/WebCore/ChangeLog	2013-02-16 23:02:08 UTC (rev 143113)
+++ trunk/Source/WebCore/ChangeLog	2013-02-16 23:34:22 UTC (rev 143114)
@@ -1,5 +1,35 @@
 2013-02-16  Andreas Kling  <[email protected]>
 
+        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):
+
+2013-02-16  Andreas Kling  <[email protected]>
+
         Element: Avoid unrelated attribute synchronization on other attribute access.
         <http://webkit.org/b/110025>
 

Modified: trunk/Source/WebCore/dom/Element.cpp (143113 => 143114)


--- trunk/Source/WebCore/dom/Element.cpp	2013-02-16 23:02:08 UTC (rev 143113)
+++ trunk/Source/WebCore/dom/Element.cpp	2013-02-16 23:34:22 UTC (rev 143114)
@@ -340,11 +340,15 @@
 {
     if (!elementData())
         return;
-    if (elementData()->m_styleAttributeIsDirty)
-        updateStyleAttribute();
+    if (elementData()->m_styleAttributeIsDirty) {
+        ASSERT(isStyledElement());
+        static_cast<const StyledElement*>(this)->synchronizeStyleAttributeInternal();
+    }
 #if ENABLE(SVG)
-    if (elementData()->m_animatedSVGAttributesAreDirty)
-        updateAnimatedSVGAttribute(anyQName());
+    if (elementData()->m_animatedSVGAttributesAreDirty) {
+        ASSERT(isSVGElement());
+        static_cast<const SVGElement*>(this)->synchronizeAnimatedSVGAttribute(anyQName());
+    }
 #endif
 }
 
@@ -353,12 +357,15 @@
     if (!elementData())
         return;
     if (UNLIKELY(name == styleAttr && elementData()->m_styleAttributeIsDirty)) {
-        updateStyleAttribute();
+        ASSERT(isStyledElement());
+        static_cast<const StyledElement*>(this)->synchronizeStyleAttributeInternal();
         return;
     }
 #if ENABLE(SVG)
-    if (UNLIKELY(elementData()->m_animatedSVGAttributesAreDirty))
-        updateAnimatedSVGAttribute(name);
+    if (UNLIKELY(elementData()->m_animatedSVGAttributesAreDirty)) {
+        ASSERT(isSVGElement());
+        static_cast<const SVGElement*>(this)->synchronizeAnimatedSVGAttribute(name);
+    }
 #endif
 }
 
@@ -369,13 +376,15 @@
     if (!elementData())
         return;
     if (elementData()->m_styleAttributeIsDirty && equalPossiblyIgnoringCase(localName, styleAttr.localName(), shouldIgnoreAttributeCase(this))) {
-        updateStyleAttribute();
+        ASSERT(isStyledElement());
+        static_cast<const StyledElement*>(this)->synchronizeStyleAttributeInternal();
         return;
     }
 #if ENABLE(SVG)
     if (elementData()->m_animatedSVGAttributesAreDirty) {
         // We're not passing a namespace argument on purpose. SVGNames::*Attr are defined w/o namespaces as well.
-        updateAnimatedSVGAttribute(QualifiedName(nullAtom, localName, nullAtom));
+        ASSERT(isSVGElement());
+        static_cast<const SVGElement*>(this)->synchronizeAnimatedSVGAttribute(QualifiedName(nullAtom, localName, nullAtom));
     }
 #endif
 }

Modified: trunk/Source/WebCore/dom/Element.h (143113 => 143114)


--- trunk/Source/WebCore/dom/Element.h	2013-02-16 23:02:08 UTC (rev 143113)
+++ trunk/Source/WebCore/dom/Element.h	2013-02-16 23:34:22 UTC (rev 143114)
@@ -666,12 +666,6 @@
 
     bool pseudoStyleCacheIsInvalid(const RenderStyle* currentStyle, RenderStyle* newStyle);
 
-    virtual void updateStyleAttribute() const { }
-
-#if ENABLE(SVG)
-    virtual void updateAnimatedSVGAttribute(const QualifiedName&) const { }
-#endif
-
     void cancelFocusAppearanceUpdate();
 
     virtual const AtomicString& virtualPrefix() const { return prefix(); }

Modified: trunk/Source/WebCore/dom/StyledElement.cpp (143113 => 143114)


--- trunk/Source/WebCore/dom/StyledElement.cpp	2013-02-16 23:02:08 UTC (rev 143113)
+++ trunk/Source/WebCore/dom/StyledElement.cpp	2013-02-16 23:34:22 UTC (rev 143114)
@@ -126,7 +126,7 @@
     return cleaner;
 }
 
-void StyledElement::updateStyleAttribute() const
+void StyledElement::synchronizeStyleAttributeInternal() const
 {
     ASSERT(elementData());
     ASSERT(elementData()->m_styleAttributeIsDirty);

Modified: trunk/Source/WebCore/dom/StyledElement.h (143113 => 143114)


--- trunk/Source/WebCore/dom/StyledElement.h	2013-02-16 23:02:08 UTC (rev 143113)
+++ trunk/Source/WebCore/dom/StyledElement.h	2013-02-16 23:34:22 UTC (rev 143114)
@@ -49,6 +49,8 @@
     bool setInlineStyleProperty(CSSPropertyID, const String& value, bool important = false);
     bool removeInlineStyleProperty(CSSPropertyID);
     void removeAllInlineStyleProperties();
+
+    void synchronizeStyleAttributeInternal() const;
     
     virtual CSSStyleDeclaration* style() OVERRIDE;
 
@@ -75,7 +77,6 @@
 private:
     void styleAttributeChanged(const AtomicString& newStyleString);
 
-    virtual void updateStyleAttribute() const;
     void inlineStyleChanged();
     PropertySetCSSStyleDeclaration* inlineStyleCSSOMWrapper();
     void setInlineStyleFromString(const AtomicString&);

Modified: trunk/Source/WebCore/rendering/svg/RenderSVGResourceGradient.cpp (143113 => 143114)


--- trunk/Source/WebCore/rendering/svg/RenderSVGResourceGradient.cpp	2013-02-16 23:02:08 UTC (rev 143113)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGResourceGradient.cpp	2013-02-16 23:34:22 UTC (rev 143114)
@@ -127,7 +127,7 @@
         return false;
 
     if (m_shouldCollectGradientAttributes) {
-        gradientElement->updateAnimatedSVGAttribute(anyQName());
+        gradientElement->synchronizeAnimatedSVGAttribute(anyQName());
         if (!collectGradientAttributes(gradientElement))
             return false;
 

Modified: trunk/Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp (143113 => 143114)


--- trunk/Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp	2013-02-16 23:02:08 UTC (rev 143113)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp	2013-02-16 23:34:22 UTC (rev 143114)
@@ -66,7 +66,7 @@
         return 0;
 
     if (m_shouldCollectPatternAttributes) {
-        patternElement->updateAnimatedSVGAttribute(anyQName());
+        patternElement->synchronizeAnimatedSVGAttribute(anyQName());
 
         m_attributes = PatternAttributes();
         patternElement->collectPatternAttributes(m_attributes);

Modified: trunk/Source/WebCore/svg/SVGElement.cpp (143113 => 143114)


--- trunk/Source/WebCore/svg/SVGElement.cpp	2013-02-16 23:02:08 UTC (rev 143113)
+++ trunk/Source/WebCore/svg/SVGElement.cpp	2013-02-16 23:34:22 UTC (rev 143114)
@@ -542,7 +542,7 @@
         svgAttributeChanged(name);
 }
 
-void SVGElement::updateAnimatedSVGAttribute(const QualifiedName& name) const
+void SVGElement::synchronizeAnimatedSVGAttribute(const QualifiedName& name) const
 {
     if (!elementData() || !elementData()->m_animatedSVGAttributesAreDirty)
         return;

Modified: trunk/Source/WebCore/svg/SVGElement.h (143113 => 143114)


--- trunk/Source/WebCore/svg/SVGElement.h	2013-02-16 23:02:08 UTC (rev 143113)
+++ trunk/Source/WebCore/svg/SVGElement.h	2013-02-16 23:34:22 UTC (rev 143114)
@@ -93,7 +93,7 @@
     SVGElement* correspondingElement();
     void setCorrespondingElement(SVGElement*);
 
-    virtual void updateAnimatedSVGAttribute(const QualifiedName&) const;
+    void synchronizeAnimatedSVGAttribute(const QualifiedName&) const;
  
     virtual PassRefPtr<RenderStyle> customStyleForRenderer() OVERRIDE;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to