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