HasCustomWillOrDidRecalcStyleFlag and family should live in a bit.
authormorrita@google.com <morrita@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 May 2012 09:32:02 +0000 (09:32 +0000)
committermorrita@google.com <morrita@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 May 2012 09:32:02 +0000 (09:32 +0000)
https://bugs.webkit.org/show_bug.cgi?id=86175

Reviewed by Ryosuke Niwa.

This change unifies following flags into one HasCustomCallbacksFlag.
- HasCustomWillOrDidRecalcStyleFlag
- HasCustomStyleForRendererFlag
- IsFrameOwnerElementFlag

By this change, some callbacks can be called even if there are no override.
So all custom callbacks should just pass these invocations.

No new tests. No behavior change.

* dom/ContainerNodeAlgorithms.h:
(WebCore::ChildFrameDisconnector::collectDescendant):
* dom/Element.cpp:
(WebCore::Element::styleForRenderer):
(WebCore::Element::recalcStyle):
(WebCore::Element::willRecalcStyle):
(WebCore):
(WebCore::Element::didRecalcStyle):
(WebCore::Element::customStyleForRenderer):
* dom/Element.h:
(Element):
* dom/Node.h:
(WebCore::Node::isFrameOwnerElement):
(WebCore::Node::hasCustomCallbacks):
(WebCore::Node::setHasCustomCallbacks):
* dom/Text.cpp:
(WebCore::Text::recalcTextStyle):
(WebCore::Text::willRecalcTextStyle):
(WebCore):
* dom/Text.h:
(Text):
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::HTMLFormControlElement):
* html/HTMLFrameOwnerElement.cpp:
(WebCore::HTMLFrameOwnerElement::disconnectContentFrame):
* html/HTMLFrameOwnerElement.h:
* html/HTMLFrameSetElement.cpp:
(WebCore::HTMLFrameSetElement::HTMLFrameSetElement):
* html/HTMLIFrameElement.cpp:
(WebCore::HTMLIFrameElement::HTMLIFrameElement):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement):
(WebCore::HTMLPlugInImageElement::documentWillSuspendForPageCache):
(WebCore::HTMLPlugInImageElement::documentDidResumeFromPageCache):
(WebCore::HTMLPlugInImageElement::customStyleForRenderer):
* html/HTMLPlugInImageElement.h:
(HTMLPlugInImageElement):
* html/shadow/TextControlInnerElements.cpp:
(WebCore::TextControlInnerElement::TextControlInnerElement):
(WebCore::TextControlInnerElement::customStyleForRenderer):
(WebCore::TextControlInnerTextElement::TextControlInnerTextElement):
(WebCore::TextControlInnerTextElement::customStyleForRenderer):
* html/shadow/TextControlInnerElements.h:
(TextControlInnerElement):
(TextControlInnerTextElement):
* html/shadow/TextFieldDecorationElement.cpp:
(WebCore::TextFieldDecorationElement::TextFieldDecorationElement):
(WebCore::TextFieldDecorationElement::customStyleForRenderer):
* html/shadow/TextFieldDecorationElement.h:
(TextFieldDecorationElement):
* svg/SVGElement.cpp:
(WebCore::SVGElement::SVGElement):
(WebCore::SVGElement::customStyleForRenderer):
* svg/SVGElement.h:
(SVGElement):
* svg/SVGTRefElement.cpp:
(WebCore::SVGShadowText::SVGShadowText):
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::SVGUseElement):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@117242 268f45cc-cd09-0410-ab3c-d52691b4dbfc

22 files changed:
Source/WebCore/ChangeLog
Source/WebCore/dom/ContainerNodeAlgorithms.h
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/Element.h
Source/WebCore/dom/Node.h
Source/WebCore/dom/Text.cpp
Source/WebCore/dom/Text.h
Source/WebCore/html/HTMLFormControlElement.cpp
Source/WebCore/html/HTMLFormControlElement.h
Source/WebCore/html/HTMLFrameOwnerElement.cpp
Source/WebCore/html/HTMLFrameOwnerElement.h
Source/WebCore/html/HTMLFrameSetElement.cpp
Source/WebCore/html/HTMLIFrameElement.cpp
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLPlugInImageElement.cpp
Source/WebCore/html/shadow/TextControlInnerElements.cpp
Source/WebCore/html/shadow/TextControlInnerElements.h
Source/WebCore/html/shadow/TextFieldDecorationElement.cpp
Source/WebCore/svg/SVGElement.cpp
Source/WebCore/svg/SVGElement.h
Source/WebCore/svg/SVGTRefElement.cpp
Source/WebCore/svg/SVGUseElement.cpp

index ed7167c..c9ac282 100644 (file)
@@ -1,3 +1,82 @@
+2012-05-16  MORITA Hajime  <morrita@google.com>
+
+        HasCustomWillOrDidRecalcStyleFlag and family should live in a bit.
+        https://bugs.webkit.org/show_bug.cgi?id=86175
+
+        Reviewed by Ryosuke Niwa.
+
+        This change unifies following flags into one HasCustomCallbacksFlag.
+        - HasCustomWillOrDidRecalcStyleFlag
+        - HasCustomStyleForRendererFlag
+        - IsFrameOwnerElementFlag
+
+        By this change, some callbacks can be called even if there are no override.
+        So all custom callbacks should just pass these invocations.
+
+        No new tests. No behavior change.
+
+        * dom/ContainerNodeAlgorithms.h:
+        (WebCore::ChildFrameDisconnector::collectDescendant):
+        * dom/Element.cpp:
+        (WebCore::Element::styleForRenderer):
+        (WebCore::Element::recalcStyle):
+        (WebCore::Element::willRecalcStyle):
+        (WebCore):
+        (WebCore::Element::didRecalcStyle):
+        (WebCore::Element::customStyleForRenderer):
+        * dom/Element.h:
+        (Element):
+        * dom/Node.h:
+        (WebCore::Node::isFrameOwnerElement):
+        (WebCore::Node::hasCustomCallbacks):
+        (WebCore::Node::setHasCustomCallbacks):
+        * dom/Text.cpp:
+        (WebCore::Text::recalcTextStyle):
+        (WebCore::Text::willRecalcTextStyle):
+        (WebCore):
+        * dom/Text.h:
+        (Text):
+        * html/HTMLFormControlElement.cpp:
+        (WebCore::HTMLFormControlElement::HTMLFormControlElement):
+        * html/HTMLFrameOwnerElement.cpp:
+        (WebCore::HTMLFrameOwnerElement::disconnectContentFrame):
+        * html/HTMLFrameOwnerElement.h:
+        * html/HTMLFrameSetElement.cpp:
+        (WebCore::HTMLFrameSetElement::HTMLFrameSetElement):
+        * html/HTMLIFrameElement.cpp:
+        (WebCore::HTMLIFrameElement::HTMLIFrameElement):
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::HTMLMediaElement):
+        * html/HTMLPlugInImageElement.cpp:
+        (WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement):
+        (WebCore::HTMLPlugInImageElement::documentWillSuspendForPageCache):
+        (WebCore::HTMLPlugInImageElement::documentDidResumeFromPageCache):
+        (WebCore::HTMLPlugInImageElement::customStyleForRenderer):
+        * html/HTMLPlugInImageElement.h:
+        (HTMLPlugInImageElement):
+        * html/shadow/TextControlInnerElements.cpp:
+        (WebCore::TextControlInnerElement::TextControlInnerElement):
+        (WebCore::TextControlInnerElement::customStyleForRenderer):
+        (WebCore::TextControlInnerTextElement::TextControlInnerTextElement):
+        (WebCore::TextControlInnerTextElement::customStyleForRenderer):
+        * html/shadow/TextControlInnerElements.h:
+        (TextControlInnerElement):
+        (TextControlInnerTextElement):
+        * html/shadow/TextFieldDecorationElement.cpp:
+        (WebCore::TextFieldDecorationElement::TextFieldDecorationElement):
+        (WebCore::TextFieldDecorationElement::customStyleForRenderer):
+        * html/shadow/TextFieldDecorationElement.h:
+        (TextFieldDecorationElement):
+        * svg/SVGElement.cpp:
+        (WebCore::SVGElement::SVGElement):
+        (WebCore::SVGElement::customStyleForRenderer):
+        * svg/SVGElement.h:
+        (SVGElement):
+        * svg/SVGTRefElement.cpp:
+        (WebCore::SVGShadowText::SVGShadowText):
+        * svg/SVGUseElement.cpp:
+        (WebCore::SVGUseElement::SVGUseElement):
+
 2012-05-16  Yury Semikhatsky  <yurys@chromium.org>
 
         Web Inspector: exception when switching to heap profiler comparison view
index fccb5ee..a3ce88e 100644 (file)
@@ -303,7 +303,7 @@ inline void ChildFrameDisconnector::collectDescendant(Node* root)
         if (!node->isElementNode())
             continue;
         Element* element = toElement(node);
-        if (element->isFrameOwnerElement())
+        if (element->hasCustomCallbacks() && element->isFrameOwnerElement())
             m_list.append(node);
         if (ElementShadow* shadow = element->shadow())
             collectDescendant(shadow);
index 6af4cf2..cab7b64 100644 (file)
@@ -1040,22 +1040,19 @@ bool Element::pseudoStyleCacheIsInvalid(const RenderStyle* currentStyle, RenderS
     return false;
 }
 
-PassRefPtr<RenderStyle> Element::customStyleForRenderer()
-{
-    ASSERT_NOT_REACHED(); 
-    return 0; 
-}
-
 PassRefPtr<RenderStyle> Element::styleForRenderer()
 {
-    if (hasCustomStyleForRenderer())
-        return customStyleForRenderer();
-    return document()->styleResolver()->styleForElement(static_cast<Element*>(this));
+    if (hasCustomCallbacks()) {
+        if (RefPtr<RenderStyle> style = customStyleForRenderer())
+            return style.release();
+    }
+
+    return document()->styleResolver()->styleForElement(this);
 }
 
 void Element::recalcStyle(StyleChange change)
 {
-    if (hasCustomWillOrDidRecalcStyle()) {
+    if (hasCustomCallbacks()) {
         if (!willRecalcStyle(change))
             return;
     }
@@ -1083,7 +1080,7 @@ void Element::recalcStyle(StyleChange change)
             clearNeedsStyleRecalc();
             clearChildNeedsStyleRecalc();
 
-            if (hasCustomWillOrDidRecalcStyle())
+            if (hasCustomCallbacks())
                 didRecalcStyle(change);
             return;
         }
@@ -1173,7 +1170,7 @@ void Element::recalcStyle(StyleChange change)
     clearNeedsStyleRecalc();
     clearChildNeedsStyleRecalc();
     
-    if (hasCustomWillOrDidRecalcStyle())
+    if (hasCustomCallbacks())
         didRecalcStyle(change);
 }
 
@@ -2101,4 +2098,23 @@ PassRefPtr<Attr> Element::ensureAttr(const QualifiedName& name)
     return attributeData()->ensureAttr(this, name);
 }
 
+bool Element::willRecalcStyle(StyleChange)
+{
+    ASSERT(hasCustomCallbacks());
+    return true;
+}
+
+void Element::didRecalcStyle(StyleChange)
+{
+    ASSERT(hasCustomCallbacks());
+}
+
+
+PassRefPtr<RenderStyle> Element::customStyleForRenderer()
+{
+    ASSERT(hasCustomCallbacks());
+    return 0;
+}
+
+
 } // namespace WebCore
index 48a7f00..03f4424 100644 (file)
@@ -422,8 +422,9 @@ protected:
     virtual InsertionNotificationRequest insertedInto(Node*) OVERRIDE;
     virtual void removedFrom(Node*) OVERRIDE;
     virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
-    virtual bool willRecalcStyle(StyleChange) { return true; }
-    virtual void didRecalcStyle(StyleChange) { }
+
+    virtual bool willRecalcStyle(StyleChange);
+    virtual void didRecalcStyle(StyleChange);
     virtual PassRefPtr<RenderStyle> customStyleForRenderer();
 
     virtual bool shouldRegisterAsNamedItem() const { return false; }
index f38d849..2a46851 100644 (file)
@@ -214,11 +214,12 @@ public:
     bool isStyledElement() const { return getFlag(IsStyledElementFlag); }
     virtual bool isAttributeNode() const { return false; }
     virtual bool isCharacterDataNode() const { return false; }
+    virtual bool isFrameOwnerElement() const { return false; }
     bool isDocumentNode() const;
     bool isShadowRoot() const { return getFlag(IsShadowRootFlag); }
     bool inNamedFlow() const { return getFlag(InNamedFlowFlag); }
     bool hasAttrList() const { return getFlag(HasAttrListFlag); }
-    bool isFrameOwnerElement() const { return getFlag(IsFrameOwnerElementFlag); }
+    bool hasCustomCallbacks() const { return getFlag(HasCustomCallbacksFlag); }
 
     Node* shadowAncestorNode() const;
     ShadowRoot* shadowRoot() const;
@@ -686,24 +687,22 @@ private:
         StyleChangeMask = 1 << nodeStyleChangeShift | 1 << (nodeStyleChangeShift + 1),
 
         SelfOrAncestorHasDirAutoFlag = 1 << 22,
-        HasCustomWillOrDidRecalcStyleFlag = 1 << 23,
-        HasCustomStyleForRendererFlag = 1 << 24,
 
-        HasNameFlag = 1 << 25,
+        HasNameFlag = 1 << 23,
 
-        AttributeStyleDirtyFlag = 1 << 26,
+        AttributeStyleDirtyFlag = 1 << 24,
 
 #if ENABLE(SVG)
         DefaultNodeFlags = IsParsingChildrenFinishedFlag | IsStyleAttributeValidFlag | AreSVGAttributesValidFlag,
 #else
         DefaultNodeFlags = IsParsingChildrenFinishedFlag | IsStyleAttributeValidFlag,
 #endif
-        InNamedFlowFlag = 1 << 28,
-        HasAttrListFlag = 1 << 29,
-        IsFrameOwnerElementFlag = 1 << 30
+        InNamedFlowFlag = 1 << 26,
+        HasAttrListFlag = 1 << 27,
+        HasCustomCallbacksFlag = 1 << 28
     };
 
-    // 2 bits remaining
+    // 4 bits remaining
 
     bool getFlag(NodeFlags mask) const { return m_nodeFlags & mask; }
     void setFlag(bool f, NodeFlags mask) const { m_nodeFlags = (m_nodeFlags & ~mask) | (-(int32_t)f & mask); } 
@@ -719,7 +718,7 @@ protected:
         CreateShadowRoot = CreateContainer | IsShadowRootFlag,
         CreateStyledElement = CreateElement | IsStyledElementFlag, 
         CreateHTMLElement = CreateStyledElement | IsHTMLFlag, 
-        CreateFrameOwnerElement = CreateHTMLElement | IsFrameOwnerElementFlag,
+        CreateFrameOwnerElement = CreateHTMLElement | HasCustomCallbacksFlag,
         CreateSVGElement = CreateStyledElement | IsSVGFlag,
         CreateDocument = CreateContainer | InDocumentFlag
     };
@@ -737,12 +736,7 @@ protected:
     NodeRareData* ensureRareData();
     void clearRareData();
 
-    bool hasCustomWillOrDidRecalcStyle() const { return getFlag(HasCustomWillOrDidRecalcStyleFlag); }
-    void setHasCustomWillOrDidRecalcStyle() { setFlag(true, HasCustomWillOrDidRecalcStyleFlag); }
-    
-    bool hasCustomStyleForRenderer() const { return getFlag(HasCustomStyleForRendererFlag); }
-    void setHasCustomStyleForRenderer() { setFlag(true, HasCustomStyleForRendererFlag); }
-    void clearHasCustomStyleForRenderer() { clearFlag(HasCustomStyleForRendererFlag); }
+    void setHasCustomCallbacks() { setFlag(true, HasCustomCallbacksFlag); }
 
 private:
     // These API should be only used for a tree scope migration.
index 1bcabae..f173fca 100644 (file)
@@ -252,7 +252,7 @@ void Text::attach()
 
 void Text::recalcTextStyle(StyleChange change)
 {
-    if (hasCustomWillOrDidRecalcStyle())
+    if (hasCustomCallbacks())
         willRecalcTextStyle(change);
 
     if (change != NoChange && parentNode() && parentNode()->renderer()) {
@@ -292,6 +292,11 @@ PassRefPtr<Text> Text::createWithLengthLimit(Document* document, const String& d
     return result;
 }
 
+void Text::willRecalcTextStyle(StyleChange)
+{
+    ASSERT_NOT_REACHED();
+}
+
 #ifndef NDEBUG
 void Text::formatForDebugger(char *buffer, unsigned length) const
 {
index deb18a5..daf3822 100644 (file)
@@ -53,7 +53,7 @@ protected:
     {
     }
 
-    virtual void willRecalcTextStyle(StyleChange) { ASSERT_NOT_REACHED(); }
+    virtual void willRecalcTextStyle(StyleChange);
 
 private:
     virtual String nodeName() const;
index 9560d88..f195ec0 100644 (file)
@@ -63,7 +63,7 @@ HTMLFormControlElement::HTMLFormControlElement(const QualifiedName& tagName, Doc
     , m_hasAutofocused(false)
 {
     setForm(form ? form : findFormAncestor());
-    setHasCustomWillOrDidRecalcStyle();
+    setHasCustomCallbacks();
 }
 
 HTMLFormControlElement::~HTMLFormControlElement()
index b6da7d3..d4bdd67 100644 (file)
@@ -127,7 +127,7 @@ protected:
     virtual bool isKeyboardFocusable(KeyboardEvent*) const;
     virtual bool isMouseFocusable() const;
 
-    virtual void didRecalcStyle(StyleChange);
+    virtual void didRecalcStyle(StyleChange) OVERRIDE;
 
     virtual void dispatchBlurEvent(PassRefPtr<Node> newFocusedNode);
     virtual void detach();
index 58f385b..6b70660 100644 (file)
@@ -51,6 +51,7 @@ RenderPart* HTMLFrameOwnerElement::renderPart() const
 
 void HTMLFrameOwnerElement::disconnectContentFrame()
 {
+    ASSERT(hasCustomCallbacks());
     // This causes an unload event thus cannot be a part of removedFrom().
     if (Frame* frame = contentFrame()) {
         RefPtr<Frame> protect(frame);
index 227622f..5e2426a 100644 (file)
@@ -64,6 +64,7 @@ private:
     friend class Frame;
 
     virtual bool isKeyboardFocusable(KeyboardEvent*) const;
+    virtual bool isFrameOwnerElement() const OVERRIDE { return true; }
 
     Frame* m_contentFrame;
     SandboxFlags m_sandboxFlags;
index 92ae9b9..c51ecc3 100644 (file)
@@ -56,7 +56,7 @@ HTMLFrameSetElement::HTMLFrameSetElement(const QualifiedName& tagName, Document*
 {
     ASSERT(hasTagName(framesetTag));
     
-    setHasCustomWillOrDidRecalcStyle();
+    setHasCustomCallbacks();
 }
 
 PassRefPtr<HTMLFrameSetElement> HTMLFrameSetElement::create(const QualifiedName& tagName, Document* document)
index 78d9136..0be7053 100644 (file)
@@ -41,7 +41,7 @@ inline HTMLIFrameElement::HTMLIFrameElement(const QualifiedName& tagName, Docume
     : HTMLFrameElementBase(tagName, document)
 {
     ASSERT(hasTagName(iframeTag));
-    setHasCustomWillOrDidRecalcStyle();
+    setHasCustomCallbacks();
 }
 
 PassRefPtr<HTMLIFrameElement> HTMLIFrameElement::create(const QualifiedName& tagName, Document* document)
index 78ffecf..33e1205 100644 (file)
@@ -279,7 +279,7 @@ HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, Document* docum
     m_mediaSourceURL.setPath(createCanonicalUUIDString());
 #endif
 
-    setHasCustomWillOrDidRecalcStyle();
+    setHasCustomCallbacks();
     addElementToDocumentMap(this, document);
 }
 
index 4471c63..4954e36 100644 (file)
@@ -32,6 +32,7 @@
 #include "RenderEmbeddedObject.h"
 #include "RenderImage.h"
 #include "SecurityOrigin.h"
+#include "StyleResolver.h"
 
 namespace WebCore {
 
@@ -45,7 +46,7 @@ HTMLPlugInImageElement::HTMLPlugInImageElement(const QualifiedName& tagName, Doc
     , m_shouldPreferPlugInsForImages(preferPlugInsForImagesOption == ShouldPreferPlugInsForImages)
     , m_needsDocumentActivationCallbacks(false)
 {
-    setHasCustomWillOrDidRecalcStyle();
+    setHasCustomCallbacks();
 }
 
 HTMLPlugInImageElement::~HTMLPlugInImageElement()
@@ -224,8 +225,6 @@ void HTMLPlugInImageElement::documentWillSuspendForPageCache()
     if (RenderStyle* renderStyle = this->renderStyle()) {
         m_customStyleForPageCache = RenderStyle::clone(renderStyle);
         m_customStyleForPageCache->setDisplay(NONE);
-        setHasCustomStyleForRenderer();
-
         recalcStyle(Force);
     }
 
@@ -236,8 +235,6 @@ void HTMLPlugInImageElement::documentDidResumeFromPageCache()
 {
     if (m_customStyleForPageCache) {
         m_customStyleForPageCache = 0;
-        clearHasCustomStyleForRenderer();
-
         recalcStyle(Force);
     }
     
@@ -246,7 +243,8 @@ void HTMLPlugInImageElement::documentDidResumeFromPageCache()
 
 PassRefPtr<RenderStyle> HTMLPlugInImageElement::customStyleForRenderer()
 {
-    ASSERT(m_customStyleForPageCache);
+    if (!m_customStyleForPageCache)
+        return document()->styleResolver()->styleForElement(this);
     return m_customStyleForPageCache;
 }
 
index ab318ea..100daeb 100644 (file)
@@ -53,7 +53,7 @@ using namespace HTMLNames;
 TextControlInnerElement::TextControlInnerElement(Document* document)
     : HTMLDivElement(divTag, document)
 {
-    setHasCustomStyleForRenderer();
+    setHasCustomCallbacks();
 }
 
 PassRefPtr<TextControlInnerElement> TextControlInnerElement::create(Document* document)
@@ -72,7 +72,7 @@ PassRefPtr<RenderStyle> TextControlInnerElement::customStyleForRenderer()
 inline TextControlInnerTextElement::TextControlInnerTextElement(Document* document)
     : HTMLDivElement(divTag, document)
 {
-    setHasCustomStyleForRenderer();
+    setHasCustomCallbacks();
 }
 
 PassRefPtr<TextControlInnerTextElement> TextControlInnerTextElement::create(Document* document)
index c231f88..c2280f1 100644 (file)
@@ -42,7 +42,7 @@ public:
 
 protected:
     TextControlInnerElement(Document*);
-    virtual PassRefPtr<RenderStyle> customStyleForRenderer();
+    virtual PassRefPtr<RenderStyle> customStyleForRenderer() OVERRIDE;
 
 private:
     virtual bool isMouseFocusable() const { return false; }
@@ -57,7 +57,7 @@ public:
 private:
     TextControlInnerTextElement(Document*);
     virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
-    virtual PassRefPtr<RenderStyle> customStyleForRenderer();
+    virtual PassRefPtr<RenderStyle> customStyleForRenderer() OVERRIDE;
     virtual bool isMouseFocusable() const { return false; }
 };
 
index 580ebad..ca1c7c9 100644 (file)
@@ -58,7 +58,7 @@ TextFieldDecorationElement::TextFieldDecorationElement(Document* document, TextF
     , m_textFieldDecorator(decorator)
 {
     ASSERT(decorator);
-    setHasCustomStyleForRenderer();
+    setHasCustomCallbacks();
 }
 
 PassRefPtr<TextFieldDecorationElement> TextFieldDecorationElement::create(Document* document, TextFieldDecorator* decorator)
index 3814906..1d351d9 100644 (file)
@@ -51,8 +51,7 @@ using namespace HTMLNames;
 SVGElement::SVGElement(const QualifiedName& tagName, Document* document, ConstructionType constructionType)
     : StyledElement(tagName, document, constructionType)
 {
-    setHasCustomStyleForRenderer();
-    setHasCustomWillOrDidRecalcStyle();
+    setHasCustomCallbacks();
 }
 
 PassRefPtr<SVGElement> SVGElement::create(const QualifiedName& tagName, Document* document)
index c0f6a97..085fc19 100644 (file)
@@ -91,7 +91,7 @@ public:
 
     virtual void updateAnimatedSVGAttribute(const QualifiedName&) const;
  
-    virtual PassRefPtr<RenderStyle> customStyleForRenderer();
+    virtual PassRefPtr<RenderStyle> customStyleForRenderer() OVERRIDE;
 
     static void synchronizeRequiredFeatures(void* contextElement);
     static void synchronizeRequiredExtensions(void* contextElement);
index 27282fe..6b858f3 100644 (file)
@@ -129,7 +129,7 @@ private:
     SVGShadowText(Document* document, const String& data)
         : Text(document, data)
     {
-         setHasCustomWillOrDidRecalcStyle();
+        setHasCustomCallbacks();
     }
     virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
     virtual void willRecalcTextStyle(StyleChange);
index 98a113a..1155147 100755 (executable)
@@ -90,10 +90,9 @@ inline SVGUseElement::SVGUseElement(const QualifiedName& tagName, Document* docu
     , m_haveFiredLoadEvent(false)
     , m_needsShadowTreeRecreation(false)
 {
+    ASSERT(hasCustomCallbacks());
     ASSERT(hasTagName(SVGNames::useTag));
     registerAnimatedPropertiesForSVGUseElement();
-
-    setHasCustomWillOrDidRecalcStyle();
 }
 
 PassRefPtr<SVGUseElement> SVGUseElement::create(const QualifiedName& tagName, Document* document, bool wasInsertedByParser)