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

Unified Diff: third_party/WebKit/Source/core/css/StyleSheetContents.cpp

Issue 2474483002: [LazyParseCSS] Ensure UseCounting has parity with strict parsing (Closed)
Patch Set: s/!/!!/ 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/css/StyleSheetContents.cpp
diff --git a/third_party/WebKit/Source/core/css/StyleSheetContents.cpp b/third_party/WebKit/Source/core/css/StyleSheetContents.cpp
index be7d917df767513bc75e55fef728e24855593542..1403ca2372c1bee0095f3b9f4729b0a62146f8ee 100644
--- a/third_party/WebKit/Source/core/css/StyleSheetContents.cpp
+++ b/third_party/WebKit/Source/core/css/StyleSheetContents.cpp
@@ -491,6 +491,10 @@ Document* StyleSheetContents::singleOwnerDocument() const {
return root->clientSingleOwnerDocument();
}
+Document* StyleSheetContents::anyOwnerDocument() const {
+ return rootStyleSheet()->clientAnyOwnerDocument();
+}
+
static bool childRulesHaveFailedOrCanceledSubresources(
const HeapVector<Member<StyleRuleBase>>& rules) {
for (unsigned i = 0; i < rules.size(); ++i) {
@@ -531,15 +535,18 @@ bool StyleSheetContents::hasFailedOrCanceledSubresources() const {
return childRulesHaveFailedOrCanceledSubresources(m_childRules);
}
-Document* StyleSheetContents::clientSingleOwnerDocument() const {
- if (!m_hasSingleOwnerDocument || clientSize() <= 0)
+Document* StyleSheetContents::clientAnyOwnerDocument() const {
+ if (clientSize() <= 0)
return nullptr;
-
if (m_loadingClients.size())
return (*m_loadingClients.begin())->ownerDocument();
return (*m_completedClients.begin())->ownerDocument();
}
+Document* StyleSheetContents::clientSingleOwnerDocument() const {
+ return m_hasSingleOwnerDocument ? clientAnyOwnerDocument() : nullptr;
+}
+
StyleSheetContents* StyleSheetContents::parentStyleSheet() const {
return m_ownerRule ? m_ownerRule->parentStyleSheet() : nullptr;
}

Powered by Google App Engine
This is Rietveld 408576698