NodeRenderingContext should have ShadowRootList instead of ShadowRoot.
authorshinyak@chromium.org <shinyak@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Feb 2012 05:43:13 +0000 (05:43 +0000)
committershinyak@chromium.org <shinyak@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Feb 2012 05:43:13 +0000 (05:43 +0000)
https://bugs.webkit.org/show_bug.cgi?id=79079

Reviewed by Dimitri Glazkov.

Apparently NodeRenderingContext should have ShadowRootList instead of ShadowRoot.
This patch changes it.

No new tests. Simple refactoring.

* dom/NodeRenderingContext.cpp:
(WebCore::NodeRenderingContext::NodeRenderingContext):
(WebCore::NodeRenderingContext::hostChildrenChanged):
(WebCore::NodeRenderingContext::shouldCreateRenderer):
* dom/NodeRenderingContext.h:
(WebCore):

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

Source/WebCore/ChangeLog
Source/WebCore/dom/NodeRenderingContext.cpp
Source/WebCore/dom/NodeRenderingContext.h

index 879df0e..502ae66 100644 (file)
@@ -1,3 +1,22 @@
+2012-02-23  Shinya Kawanaka  <shinyak@chromium.org>
+
+        NodeRenderingContext should have ShadowRootList instead of ShadowRoot.
+        https://bugs.webkit.org/show_bug.cgi?id=79079
+
+        Reviewed by Dimitri Glazkov.
+
+        Apparently NodeRenderingContext should have ShadowRootList instead of ShadowRoot.
+        This patch changes it.
+
+        No new tests. Simple refactoring.
+
+        * dom/NodeRenderingContext.cpp:
+        (WebCore::NodeRenderingContext::NodeRenderingContext):
+        (WebCore::NodeRenderingContext::hostChildrenChanged):
+        (WebCore::NodeRenderingContext::shouldCreateRenderer):
+        * dom/NodeRenderingContext.h:
+        (WebCore):
+
 2012-02-23  Ian Vollick  <vollick@chromium.org>
 
         [chromium] Implement keyframed animations for the cc thread.
index 2627601..663d55f 100644 (file)
@@ -47,7 +47,7 @@ NodeRenderingContext::NodeRenderingContext(Node* node)
     : m_phase(AttachingNotInTree)
     , m_node(node)
     , m_parentNodeForRenderingAndStyle(0)
-    , m_visualParentShadowRoot(0)
+    , m_visualParentShadowRootList(0)
     , m_insertionPoint(0)
     , m_style(0)
     , m_parentFlowRenderer(0)
@@ -63,13 +63,10 @@ NodeRenderingContext::NodeRenderingContext(Node* node)
     }
 
     if (parent->isElementNode()) {
-        if (toElement(parent)->hasShadowRoot())
-            m_visualParentShadowRoot = toElement(parent)->shadowRootList()->youngestShadowRoot();
-
-        if (m_visualParentShadowRoot) {
-            ShadowRootList* shadowRootList = m_visualParentShadowRoot->host()->shadowRootList();
-            if ((m_insertionPoint = shadowRootList->insertionPointFor(m_node))
-                && shadowRootList->isSelectorActive()) {
+        if (toElement(parent)->hasShadowRoot()) {
+            m_visualParentShadowRootList = toElement(parent)->shadowRootList();
+            if ((m_insertionPoint = m_visualParentShadowRootList->insertionPointFor(m_node))
+                && m_visualParentShadowRootList->isSelectorActive()) {
                 m_phase = AttachingDistributed;
                 m_parentNodeForRenderingAndStyle = NodeRenderingContext(m_insertionPoint).parentNodeForRenderingAndStyle();
                 return;
@@ -98,7 +95,7 @@ NodeRenderingContext::NodeRenderingContext(Node* node, RenderStyle* style)
     : m_phase(Calculating)
     , m_node(node)
     , m_parentNodeForRenderingAndStyle(0)
-    , m_visualParentShadowRoot(0)
+    , m_visualParentShadowRootList(0)
     , m_insertionPoint(0)
     , m_style(style)
     , m_parentFlowRenderer(0)
@@ -264,7 +261,7 @@ RenderObject* NodeRenderingContext::parentRenderer() const
 void NodeRenderingContext::hostChildrenChanged()
 {
     if (m_phase == AttachingNotDistributed)
-        m_visualParentShadowRoot->host()->shadowRootList()->hostChildrenChanged();
+        m_visualParentShadowRootList->hostChildrenChanged();
 }
 
 bool NodeRenderingContext::shouldCreateRenderer() const
@@ -285,7 +282,7 @@ bool NodeRenderingContext::shouldCreateRenderer() const
         if (!parentRenderer->canHaveChildren())
             return false;
 
-        if (m_visualParentShadowRoot)
+        if (m_visualParentShadowRootList)
             return false;
     }
 
index ee5a003..4373e2f 100644 (file)
@@ -39,7 +39,7 @@ class Node;
 class RenderFlowThread;
 class RenderObject;
 class RenderStyle;
-class ShadowRoot;
+class ShadowRootList;
 
 class NodeRenderingContext {
 public:
@@ -81,7 +81,7 @@ private:
     AttachingPhase m_phase;
     Node* m_node;
     ContainerNode* m_parentNodeForRenderingAndStyle;
-    ShadowRoot* m_visualParentShadowRoot;
+    ShadowRootList* m_visualParentShadowRootList;
     InsertionPoint* m_insertionPoint;
     RefPtr<RenderStyle> m_style;
     RenderFlowThread* m_parentFlowRenderer;