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 88164e2fe64cae286488f553ce3dbbd125a969f9..b403f52b69c664e658dfd09c45ae2089d7fc2a9e 100644 |
--- a/third_party/WebKit/Source/core/dom/StyleElement.cpp |
+++ b/third_party/WebKit/Source/core/dom/StyleElement.cpp |
@@ -82,13 +82,14 @@ void StyleElement::removedFrom(Element& element, |
m_registeredAsCandidate = false; |
} |
- StyleSheet* removedSheet = m_sheet.get(); |
- |
- if (m_sheet) |
+ if (m_sheet) { |
clearSheet(element); |
- if (removedSheet) |
- document.styleEngine().setNeedsActiveStyleUpdate(removedSheet, |
- AnalyzedStyleUpdate); |
+ if (element.isConnected()) { |
+ // TODO(rune@opera.com): resolverChanged() can be removed once stylesheet |
+ // updates are async. https://crbug.com/567021 |
+ document.styleEngine().resolverChanged(AnalyzedStyleUpdate); |
+ } |
+ } |
} |
StyleElement::ProcessingResult StyleElement::childrenChanged(Element& element) { |