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

Unified Diff: third_party/WebKit/Source/core/dom/shadow/InsertionPoint.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/shadow/InsertionPoint.cpp
diff --git a/third_party/WebKit/Source/core/dom/shadow/InsertionPoint.cpp b/third_party/WebKit/Source/core/dom/shadow/InsertionPoint.cpp
index 547c347e944e71b7dc9e5455d27c47c575dcf186..0c07782b4795e466bfe2ce58a9d0b1cfec97efe4 100644
--- a/third_party/WebKit/Source/core/dom/shadow/InsertionPoint.cpp
+++ b/third_party/WebKit/Source/core/dom/shadow/InsertionPoint.cpp
@@ -36,6 +36,7 @@
#include "core/dom/QualifiedName.h"
#include "core/dom/StaticNodeList.h"
#include "core/dom/StyleChangeReason.h"
+#include "core/dom/StyleEngine.h"
#include "core/dom/shadow/ElementShadow.h"
namespace blink {
@@ -188,8 +189,11 @@ void InsertionPoint::childrenChanged(const ChildrenChange& change)
{
HTMLElement::childrenChanged(change);
if (ShadowRoot* root = containingShadowRoot()) {
- if (ElementShadow* rootOwner = root->owner())
+ if (ElementShadow* rootOwner = root->owner()) {
rootOwner->setNeedsDistributionRecalc();
+ if (document().shadowCascadeOrder() == ShadowCascadeOrder::ShadowCascadeV1)
+ document().updateAssignment();
+ }
}
}
@@ -199,6 +203,8 @@ Node::InsertionNotificationRequest InsertionPoint::insertedInto(ContainerNode* i
if (ShadowRoot* root = containingShadowRoot()) {
if (ElementShadow* rootOwner = root->owner()) {
rootOwner->setNeedsDistributionRecalc();
+ if (document().shadowCascadeOrder() == ShadowCascadeOrder::ShadowCascadeV1)
+ document().updateAssignment();
if (canBeActive() && !m_registeredWithShadowRoot && insertionPoint->treeScope().rootNode() == root) {
m_registeredWithShadowRoot = true;
root->didAddInsertionPoint(this);
@@ -222,8 +228,11 @@ void InsertionPoint::removedFrom(ContainerNode* insertionPoint)
root = insertionPoint->containingShadowRoot();
if (root) {
- if (ElementShadow* rootOwner = root->owner())
+ if (ElementShadow* rootOwner = root->owner()) {
rootOwner->setNeedsDistributionRecalc();
+ if (document().shadowCascadeOrder() == ShadowCascadeOrder::ShadowCascadeV1)
+ document().updateAssignment();
+ }
}
// host can be null when removedFrom() is called from ElementShadow destructor.

Powered by Google App Engine
This is Rietveld 408576698