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

Unified Diff: Source/core/dom/shadow/ShadowRoot.cpp

Issue 809343002: ScopedStyleResolver should be cleared when ShadowRoot is removed from document. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Imported test from https://codereview.chromium.org/808333002/ Created 6 years 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
« no previous file with comments | « Source/core/css/resolver/StyleResolver.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/shadow/ShadowRoot.cpp
diff --git a/Source/core/dom/shadow/ShadowRoot.cpp b/Source/core/dom/shadow/ShadowRoot.cpp
index 23674072ddfd184b8478d2c43e28ccc187f9b7d1..ab6dda319fb21d4ceabaae6e1641ef33151d5444 100644
--- a/Source/core/dom/shadow/ShadowRoot.cpp
+++ b/Source/core/dom/shadow/ShadowRoot.cpp
@@ -175,13 +175,16 @@ Node::InsertionNotificationRequest ShadowRoot::insertedInto(ContainerNode* inser
void ShadowRoot::removedFrom(ContainerNode* insertionPoint)
{
- if (insertionPoint->inDocument() && m_registeredWithParentShadowRoot) {
- ShadowRoot* root = host()->containingShadowRoot();
- if (!root)
- root = insertionPoint->containingShadowRoot();
- if (root)
- root->removeChildShadowRoot();
- m_registeredWithParentShadowRoot = false;
+ if (insertionPoint->inDocument()) {
+ clearScopedStyleResolver();
+ if (m_registeredWithParentShadowRoot) {
+ ShadowRoot* root = host()->containingShadowRoot();
+ if (!root)
+ root = insertionPoint->containingShadowRoot();
+ if (root)
+ root->removeChildShadowRoot();
+ m_registeredWithParentShadowRoot = false;
+ }
}
DocumentFragment::removedFrom(insertionPoint);
« no previous file with comments | « Source/core/css/resolver/StyleResolver.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698