| 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;
|
|
|