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

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

Issue 2472613004: Remove ShadowRoot::numberOfStyles(). (Closed)
Patch Set: Rebased Created 4 years, 1 month 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/StyleElement.cpp
diff --git a/third_party/WebKit/Source/core/dom/StyleElement.cpp b/third_party/WebKit/Source/core/dom/StyleElement.cpp
index 3bc9afe70b38b5255a0858e0f0017cd49f312fa9..22f54058887bfb7bcd0ec787de00e013d728a910 100644
--- a/third_party/WebKit/Source/core/dom/StyleElement.cpp
+++ b/third_party/WebKit/Source/core/dom/StyleElement.cpp
@@ -70,28 +70,17 @@ StyleElement::ProcessingResult StyleElement::processStyleSheet(
return process(element);
}
-void StyleElement::insertedInto(const Element& element,
- ContainerNode* insertionPoint) {
- if (!insertionPoint->isConnected() || !element.isInShadowTree())
- return;
- if (ShadowRoot* scope = element.containingShadowRoot())
- scope->registerScopedHTMLStyleChild();
-}
-
void StyleElement::removedFrom(Element& element,
ContainerNode* insertionPoint) {
if (!insertionPoint->isConnected())
return;
- ShadowRoot* shadowRoot = element.containingShadowRoot();
- if (!shadowRoot)
- shadowRoot = insertionPoint->containingShadowRoot();
-
- if (shadowRoot)
- shadowRoot->unregisterScopedHTMLStyleChild();
-
Document& document = element.document();
if (m_registeredAsCandidate) {
+ ShadowRoot* shadowRoot = element.containingShadowRoot();
+ if (!shadowRoot)
+ shadowRoot = insertionPoint->containingShadowRoot();
+
document.styleEngine().removeStyleSheetCandidateNode(
element, shadowRoot ? *toTreeScope(shadowRoot) : toTreeScope(document));
m_registeredAsCandidate = false;
« no previous file with comments | « third_party/WebKit/Source/core/dom/StyleElement.h ('k') | third_party/WebKit/Source/core/dom/shadow/ShadowRoot.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698