Title: [118131] trunk/Source/WebCore
Revision
118131
Author
morr...@google.com
Date
2012-05-22 23:48:14 -0700 (Tue, 22 May 2012)

Log Message

[Refactoring] ElementShadow::m_needsRedistributing  should be on ContentDistributor
https://bugs.webkit.org/show_bug.cgi?id=87216

Reviewed by Kentaro Hara.

Moved ElementShadow::m_needsRedistributing to ContentDistributor::m_needsRedistributing

No new tests. No behavior change.

* dom/ElementShadow.cpp:
(WebCore::ElementShadow::recalcStyle):
(WebCore::ElementShadow::needsRedistributing):
(WebCore::ElementShadow::setNeedsRedistributing):
* dom/ElementShadow.h:
(ElementShadow):
* dom/ShadowRoot.h: Removed outdated declarations.
* html/shadow/ContentDistributor.cpp:
(WebCore::ContentDistributor::ContentDistributor):
* html/shadow/ContentDistributor.h:
(WebCore::ContentDistributor::needsRedistributing):
(WebCore::ContentDistributor::setNeedsRedistributing):
(WebCore::ContentDistributor::clearNeedsRedistributing):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (118130 => 118131)


--- trunk/Source/WebCore/ChangeLog	2012-05-23 06:42:34 UTC (rev 118130)
+++ trunk/Source/WebCore/ChangeLog	2012-05-23 06:48:14 UTC (rev 118131)
@@ -1,3 +1,28 @@
+2012-05-22  MORITA Hajime  <morr...@google.com>
+
+        [Refactoring] ElementShadow::m_needsRedistributing  should be on ContentDistributor
+        https://bugs.webkit.org/show_bug.cgi?id=87216
+
+        Reviewed by Kentaro Hara.
+
+        Moved ElementShadow::m_needsRedistributing to ContentDistributor::m_needsRedistributing
+
+        No new tests. No behavior change.
+
+        * dom/ElementShadow.cpp:
+        (WebCore::ElementShadow::recalcStyle):
+        (WebCore::ElementShadow::needsRedistributing):
+        (WebCore::ElementShadow::setNeedsRedistributing):
+        * dom/ElementShadow.h:
+        (ElementShadow):
+        * dom/ShadowRoot.h: Removed outdated declarations.
+        * html/shadow/ContentDistributor.cpp:
+        (WebCore::ContentDistributor::ContentDistributor):
+        * html/shadow/ContentDistributor.h:
+        (WebCore::ContentDistributor::needsRedistributing):
+        (WebCore::ContentDistributor::setNeedsRedistributing):
+        (WebCore::ContentDistributor::clearNeedsRedistributing):
+
 2012-05-22  Kentaro Hara  <hara...@chromium.org>
 
         [V8] Pass Isolate to v8::Null() in CodeGeneratorV8.pm

Modified: trunk/Source/WebCore/dom/ElementShadow.cpp (118130 => 118131)


--- trunk/Source/WebCore/dom/ElementShadow.cpp	2012-05-23 06:42:34 UTC (rev 118130)
+++ trunk/Source/WebCore/dom/ElementShadow.cpp	2012-05-23 06:48:14 UTC (rev 118131)
@@ -39,7 +39,6 @@
 namespace WebCore {
 
 ElementShadow::ElementShadow()
-    : m_needsRedistributing(false)
 {
 }
 
@@ -207,7 +206,7 @@
         styleResolver->popParentShadowRoot(youngest);
     }
 
-    clearNeedsRedistributing();
+    m_distributor.clearNeedsRedistributing();
     for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadowRoot()) {
         root->clearNeedsStyleRecalc();
         root->clearChildNeedsStyleRecalc();
@@ -216,7 +215,7 @@
 
 bool ElementShadow::needsRedistributing()
 {
-    return m_needsRedistributing || (youngestShadowRoot() && youngestShadowRoot()->hasInsertionPoint());
+    return m_distributor.needsRedistributing() || (youngestShadowRoot() && youngestShadowRoot()->hasInsertionPoint());
 }
 
 void ElementShadow::hostChildrenChanged()
@@ -232,8 +231,7 @@
 
 void ElementShadow::setNeedsRedistributing()
 {
-    m_needsRedistributing = true;
-
+    m_distributor.setNeedsRedistributing();
     host()->setNeedsStyleRecalc();
 }
 

Modified: trunk/Source/WebCore/dom/ElementShadow.h (118130 => 118131)


--- trunk/Source/WebCore/dom/ElementShadow.h	2012-05-23 06:42:34 UTC (rev 118130)
+++ trunk/Source/WebCore/dom/ElementShadow.h	2012-05-23 06:48:14 UTC (rev 118131)
@@ -64,7 +64,6 @@
     bool needsStyleRecalc();
     void recalcStyle(Node::StyleChange);
     void setNeedsRedistributing();
-    void clearNeedsRedistributing();
     bool needsRedistributing();
     void hostChildrenChanged();
 
@@ -79,7 +78,6 @@
 
     DoublyLinkedList<ShadowRoot> m_shadowRoots;
     ContentDistributor m_distributor;
-    bool m_needsRedistributing : 1;
     WTF_MAKE_NONCOPYABLE(ElementShadow);
 };
 
@@ -103,11 +101,6 @@
     return m_distributor;
 }
 
-inline void ElementShadow::clearNeedsRedistributing()
-{
-    m_needsRedistributing = false;
-}
-
 inline Element* ElementShadow::host() const
 {
     ASSERT(!m_shadowRoots.isEmpty());

Modified: trunk/Source/WebCore/dom/ShadowRoot.h (118130 => 118131)


--- trunk/Source/WebCore/dom/ShadowRoot.h	2012-05-23 06:42:34 UTC (rev 118130)
+++ trunk/Source/WebCore/dom/ShadowRoot.h	2012-05-23 06:48:14 UTC (rev 118131)
@@ -59,10 +59,6 @@
 
     void recalcShadowTreeStyle(StyleChange);
 
-    void setNeedsRedistributing();
-    void clearNeedsRedistributing();
-    bool needsRedistributing();
-
     InsertionPoint* insertionPointFor(Node*) const;
     void hostChildrenChanged();
 

Modified: trunk/Source/WebCore/html/shadow/ContentDistributor.cpp (118130 => 118131)


--- trunk/Source/WebCore/html/shadow/ContentDistributor.cpp	2012-05-23 06:42:34 UTC (rev 118130)
+++ trunk/Source/WebCore/html/shadow/ContentDistributor.cpp	2012-05-23 06:48:14 UTC (rev 118131)
@@ -36,6 +36,7 @@
 
 ContentDistributor::ContentDistributor()
     : m_phase(Prevented)
+    , m_needsRedistributing(false)
 {
 }
 

Modified: trunk/Source/WebCore/html/shadow/ContentDistributor.h (118130 => 118131)


--- trunk/Source/WebCore/html/shadow/ContentDistributor.h	2012-05-23 06:42:34 UTC (rev 118130)
+++ trunk/Source/WebCore/html/shadow/ContentDistributor.h	2012-05-23 06:48:14 UTC (rev 118131)
@@ -61,7 +61,9 @@
 
     void preparePoolFor(Element* shadowHost);
     bool poolIsReady() const;
-
+    bool needsRedistributing() const { return m_needsRedistributing; }
+    void setNeedsRedistributing() { m_needsRedistributing = true; }
+    void clearNeedsRedistributing() { m_needsRedistributing = false; }
 private:
     enum DistributionPhase {
         Prevented,
@@ -72,6 +74,7 @@
     Vector<RefPtr<Node> > m_pool;
     DistributionPhase m_phase;
     HashMap<const Node*, InsertionPoint*> m_nodeToInsertionPoint;
+    bool m_needsRedistributing : 1;
 };
 
 inline bool ContentDistributor::inDistribution() const
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to