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

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

Issue 2546393002: Make setNeedsActiveStyleUpdate mark treescope dirty only. (Closed)
Patch Set: Created 4 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
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 22f54058887bfb7bcd0ec787de00e013d728a910..8806930173e39c56ce5c442c7962e22ed731e4f7 100644
--- a/third_party/WebKit/Source/core/dom/StyleElement.cpp
+++ b/third_party/WebKit/Source/core/dom/StyleElement.cpp
@@ -86,13 +86,15 @@ 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()) {
+ document.styleEngine().setNeedsActiveStyleUpdate(element.treeScope());
+ // 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) {

Powered by Google App Engine
This is Rietveld 408576698