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

Unified Diff: Source/core/dom/StyleEngine.cpp

Issue 27537009: Avoid always style recalc when removing stylesheets. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 months 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: Source/core/dom/StyleEngine.cpp
diff --git a/Source/core/dom/StyleEngine.cpp b/Source/core/dom/StyleEngine.cpp
index 8d902cd52e21c44170e669d15f4a279d8e1a9cfc..25f033737f28e93a14dc0368016b6865301dddad 100644
--- a/Source/core/dom/StyleEngine.cpp
+++ b/Source/core/dom/StyleEngine.cpp
@@ -288,6 +288,25 @@ void StyleEngine::removePendingSheet(Node* styleSheetCandidateNode, RemovePendin
m_document.didRemoveAllPendingStylesheet();
}
+void StyleEngine::modifiedStyleSheet(StyleSheet* sheet)
+{
+ if (!sheet)
+ return;
+
+ Node* node = sheet->ownerNode();
+ if (!node || !node->inDocument())
+ return;
+
+ TreeScope& treeScope = isHTMLStyleElement(node) ? node->treeScope() : m_document;
+ ASSERT(isHTMLStyleElement(node) || treeScope == m_document);
+
+ if (treeScope == m_document) {
+ m_needsDocumentStyleSheetsUpdate = true;
+ return;
+ }
+ m_dirtyTreeScopes.add(&treeScope);
+}
+
void StyleEngine::addStyleSheetCandidateNode(Node* node, bool createdByParser)
{
if (!node->inDocument())

Powered by Google App Engine
This is Rietveld 408576698