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

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

Issue 2882983002: Avoid synchronous stylesheet update on html import loaded. (Closed)
Patch Set: Created 3 years, 7 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: third_party/WebKit/Source/core/dom/TreeScopeStyleSheetCollection.cpp
diff --git a/third_party/WebKit/Source/core/dom/TreeScopeStyleSheetCollection.cpp b/third_party/WebKit/Source/core/dom/TreeScopeStyleSheetCollection.cpp
index 5380b66c510d8a021290426381865f7826458fc9..cfff0c100a87c1ba436ba985e4855b3e9541c43f 100644
--- a/third_party/WebKit/Source/core/dom/TreeScopeStyleSheetCollection.cpp
+++ b/third_party/WebKit/Source/core/dom/TreeScopeStyleSheetCollection.cpp
@@ -35,6 +35,7 @@
#include "core/css/resolver/StyleResolver.h"
#include "core/dom/Element.h"
#include "core/dom/StyleEngine.h"
+#include "core/dom/StyleSheetCandidate.h"
#include "core/html/HTMLLinkElement.h"
#include "core/html/HTMLStyleElement.h"
@@ -69,6 +70,15 @@ void TreeScopeStyleSheetCollection::ApplyActiveStyleSheetChanges(
new_collection.Swap(*this);
}
+bool TreeScopeStyleSheetCollection::HasStyleSheets() const {
+ for (Node* node : style_sheet_candidate_nodes_) {
+ StyleSheetCandidate candidate(*node);
+ if (candidate.Sheet() || candidate.IsEnabledAndLoading())
+ return true;
+ }
+ return false;
+}
+
DEFINE_TRACE(TreeScopeStyleSheetCollection) {
visitor->Trace(tree_scope_);
visitor->Trace(style_sheet_candidate_nodes_);

Powered by Google App Engine
This is Rietveld 408576698