Title: [160928] trunk/Source/WebCore
Revision
160928
Author
ander...@apple.com
Date
2013-12-20 14:34:31 -0800 (Fri, 20 Dec 2013)

Log Message

Move scheduleSetNeedsStyleRecalc to HTMLFrameOwnerElement
https://bugs.webkit.org/show_bug.cgi?id=126083

Reviewed by Antti Koivisto.

scheduleSetNeedsStyleRecalc is only ever called on HTMLFrameOwnerElement, so
move it there, remove the Node implementation and make it non-virtual.

* dom/ContainerNode.cpp:
* dom/ContainerNode.h:
* dom/Node.h:
* html/HTMLFrameOwnerElement.cpp:
(WebCore::needsStyleRecalcCallback):
(WebCore::HTMLFrameOwnerElement::scheduleSetNeedsStyleRecalc):
* html/HTMLFrameOwnerElement.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (160927 => 160928)


--- trunk/Source/WebCore/ChangeLog	2013-12-20 22:19:28 UTC (rev 160927)
+++ trunk/Source/WebCore/ChangeLog	2013-12-20 22:34:31 UTC (rev 160928)
@@ -1,3 +1,21 @@
+2013-12-20  Anders Carlsson  <ander...@apple.com>
+
+        Move scheduleSetNeedsStyleRecalc to HTMLFrameOwnerElement
+        https://bugs.webkit.org/show_bug.cgi?id=126083
+
+        Reviewed by Antti Koivisto.
+
+        scheduleSetNeedsStyleRecalc is only ever called on HTMLFrameOwnerElement, so
+        move it there, remove the Node implementation and make it non-virtual.
+
+        * dom/ContainerNode.cpp:
+        * dom/ContainerNode.h:
+        * dom/Node.h:
+        * html/HTMLFrameOwnerElement.cpp:
+        (WebCore::needsStyleRecalcCallback):
+        (WebCore::HTMLFrameOwnerElement::scheduleSetNeedsStyleRecalc):
+        * html/HTMLFrameOwnerElement.h:
+
 2013-12-20  Andy Estes  <aes...@apple.com>
 
         Remove an unneeded include of WebCoreSystemInterface.h.

Modified: trunk/Source/WebCore/dom/ContainerNode.cpp (160927 => 160928)


--- trunk/Source/WebCore/dom/ContainerNode.cpp	2013-12-20 22:19:28 UTC (rev 160927)
+++ trunk/Source/WebCore/dom/ContainerNode.cpp	2013-12-20 22:34:31 UTC (rev 160928)
@@ -824,19 +824,6 @@
     s_postAttachCallbackQueue->clear();
 }
 
-static void needsStyleRecalcCallback(Node& node, unsigned data)
-{
-    node.setNeedsStyleRecalc(static_cast<StyleChangeType>(data));
-}
-
-void ContainerNode::scheduleSetNeedsStyleRecalc(StyleChangeType changeType)
-{
-    if (postAttachCallbacksAreSuspended())
-        queuePostAttachCallback(needsStyleRecalcCallback, *this, static_cast<unsigned>(changeType));
-    else
-        setNeedsStyleRecalc(changeType);
-}
-
 void ContainerNode::childrenChanged(const ChildChange& change)
 {
     document().incDOMTreeVersion();

Modified: trunk/Source/WebCore/dom/ContainerNode.h (160927 => 160928)


--- trunk/Source/WebCore/dom/ContainerNode.h	2013-12-20 22:19:28 UTC (rev 160927)
+++ trunk/Source/WebCore/dom/ContainerNode.h	2013-12-20 22:34:31 UTC (rev 160928)
@@ -108,7 +108,6 @@
     void cloneChildNodes(ContainerNode* clone);
 
     virtual LayoutRect boundingBox() const OVERRIDE;
-    virtual void scheduleSetNeedsStyleRecalc(StyleChangeType = FullStyleChange) OVERRIDE FINAL;
 
     enum ChildChangeType { ElementInserted, ElementRemoved, TextInserted, TextRemoved, TextChanged, AllChildrenRemoved, NonContentsChildChanged };
     enum ChildChangeSource { ChildChangeSourceParser, ChildChangeSourceAPI };

Modified: trunk/Source/WebCore/dom/Node.h (160927 => 160928)


--- trunk/Source/WebCore/dom/Node.h	2013-12-20 22:19:28 UTC (rev 160927)
+++ trunk/Source/WebCore/dom/Node.h	2013-12-20 22:34:31 UTC (rev 160928)
@@ -321,7 +321,6 @@
 
     void setNeedsStyleRecalc(StyleChangeType changeType = FullStyleChange);
     void clearNeedsStyleRecalc() { m_nodeFlags &= ~StyleChangeMask; }
-    virtual void scheduleSetNeedsStyleRecalc(StyleChangeType changeType = FullStyleChange) { setNeedsStyleRecalc(changeType); }
 
     void setIsLink(bool f) { setFlag(f, IsLinkFlag); }
     void setIsLink() { setFlag(IsLinkFlag); }

Modified: trunk/Source/WebCore/html/HTMLFrameOwnerElement.cpp (160927 => 160928)


--- trunk/Source/WebCore/html/HTMLFrameOwnerElement.cpp	2013-12-20 22:19:28 UTC (rev 160927)
+++ trunk/Source/WebCore/html/HTMLFrameOwnerElement.cpp	2013-12-20 22:34:31 UTC (rev 160928)
@@ -126,6 +126,19 @@
 }
 #endif
 
+static void needsStyleRecalcCallback(Node& node, unsigned data)
+{
+    node.setNeedsStyleRecalc(static_cast<StyleChangeType>(data));
+}
+
+void HTMLFrameOwnerElement::scheduleSetNeedsStyleRecalc(StyleChangeType changeType)
+{
+    if (postAttachCallbacksAreSuspended())
+        queuePostAttachCallback(needsStyleRecalcCallback, *this, static_cast<unsigned>(changeType));
+    else
+        setNeedsStyleRecalc(changeType);
+}
+
 bool SubframeLoadingDisabler::canLoadFrame(HTMLFrameOwnerElement& owner)
 {
     for (ContainerNode* node = &owner; node; node = node->parentOrShadowHostNode()) {

Modified: trunk/Source/WebCore/html/HTMLFrameOwnerElement.h (160927 => 160928)


--- trunk/Source/WebCore/html/HTMLFrameOwnerElement.h	2013-12-20 22:19:28 UTC (rev 160927)
+++ trunk/Source/WebCore/html/HTMLFrameOwnerElement.h	2013-12-20 22:34:31 UTC (rev 160928)
@@ -56,6 +56,8 @@
 
     SandboxFlags sandboxFlags() const { return m_sandboxFlags; }
 
+    void scheduleSetNeedsStyleRecalc(StyleChangeType = FullStyleChange);
+
 protected:
     HTMLFrameOwnerElement(const QualifiedName& tagName, Document&);
     void setSandboxFlags(SandboxFlags);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to