Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(202)

Unified Diff: third_party/WebKit/Source/core/dom/Node.cpp

Issue 1899653002: Support slotchange event (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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())

Powered by Google App Engine
This is Rietveld 408576698