Index: third_party/WebKit/Source/core/dom/Node.cpp |
diff --git a/third_party/WebKit/Source/core/dom/Node.cpp b/third_party/WebKit/Source/core/dom/Node.cpp |
index 7ff26433da8eeb4b6d0e1727615d10484e84f811..69772ebcaa39dc19f2aef6f549855975134344fc 100644 |
--- a/third_party/WebKit/Source/core/dom/Node.cpp |
+++ b/third_party/WebKit/Source/core/dom/Node.cpp |
@@ -552,6 +552,12 @@ bool Node::needsDistributionRecalc() const |
} |
#endif |
+void Node::updateAssignment() |
+{ |
+ Node& root = shadowIncludingRoot(); |
+ root.recalcAssignment(); |
+} |
+ |
void Node::updateDistribution() |
{ |
// Extra early out to avoid spamming traces. |
@@ -564,6 +570,24 @@ void Node::updateDistribution() |
root.recalcDistribution(); |
} |
+void Node::recalcAssignment() |
hayato
2016/04/18 07:16:31
We do not want to call recalcAssignment recursivel
yuzuchan
2016/04/18 09:43:27
Thanks for the feedback! Done.
|
+{ |
+ if (isElementNode()) { |
+ if (ElementShadow* shadow = toElement(this)->shadow()) { |
+ if (shadow->isV1()) |
+ shadow->youngestShadowRoot().assignV1(); |
+ } |
+ } |
+ |
+ for (Node* child = firstChild(); child; child = child->nextSibling()) { |
+ child->recalcAssignment(); |
+ } |
+ |
+ for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadowRoot()) { |
+ root->recalcAssignment(); |
+ } |
+} |
+ |
void Node::recalcDistribution() |
{ |
DCHECK(childNeedsDistributionRecalc()); |
@@ -947,6 +971,11 @@ bool Node::isChildOfV0ShadowHost() const |
return parentShadow && !parentShadow->isV1(); |
} |
+bool Node::isChildOfSlot() const |
+{ |
+ return parentElement() && isHTMLSlotElement(parentElement()); |
+} |
+ |
Element* Node::shadowHost() const |
{ |
if (ShadowRoot* root = containingShadowRoot()) |