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

Unified Diff: third_party/WebKit/Source/core/dom/Element.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/Element.cpp
diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp
index fe8f945943988dc2dfd501ec228d51f66d6d92c7..1a5accb21ff73fceb930953ceea1b22bb6fe2b1a 100644
--- a/third_party/WebKit/Source/core/dom/Element.cpp
+++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -1140,8 +1140,10 @@ void Element::attributeChanged(const QualifiedName& name, const AtomicString& ol
if (shouldInvalidateDistributionWhenAttributeChanged(parentElementShadow, name, newValue))
parentElementShadow->setNeedsDistributionRecalc();
}
- if (name == HTMLNames::slotAttr && isChildOfV1ShadowHost())
+ if (name == HTMLNames::slotAttr && isChildOfV1ShadowHost()) {
parentElementShadow()->setNeedsDistributionRecalc();
+ document().updateAssignment();
+ }
parseAttribute(name, oldValue, newValue);
@@ -2069,8 +2071,13 @@ void Element::childrenChanged(const ChildrenChange& change)
if (!change.byParser && change.isChildElementChange())
checkForSiblingStyleChanges(change.type == ElementRemoved ? SiblingElementRemoved : SiblingElementInserted, change.siblingBeforeChange, change.siblingAfterChange);
- if (ElementShadow* shadow = this->shadow())
+ if (ElementShadow* shadow = this->shadow()) {
shadow->setNeedsDistributionRecalc();
+ if (document().shadowCascadeOrder() == ShadowCascadeOrder::ShadowCascadeV1) {
+ if ((isShadowHost(*this) && shadowRoot()->isV1()) || isHTMLSlotElement(*this))
+ document().updateAssignment();
+ }
+ }
}
void Element::finishParsingChildren()

Powered by Google App Engine
This is Rietveld 408576698