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

Unified Diff: third_party/WebKit/Source/core/dom/StyleEngine.h

Issue 1903803002: Do not block painting for in-body CSS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed premature script execution Created 4 years, 8 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/StyleEngine.h
diff --git a/third_party/WebKit/Source/core/dom/StyleEngine.h b/third_party/WebKit/Source/core/dom/StyleEngine.h
index 9bbe68d60b05f9e550f298c1696f370b1bc3d51e..9641319b549bb692059349b34481ed1831d5c831 100644
--- a/third_party/WebKit/Source/core/dom/StyleEngine.h
+++ b/third_party/WebKit/Source/core/dom/StyleEngine.h
@@ -98,11 +98,13 @@ public:
void setSelectedStylesheetSetName(const String&);
void setHttpDefaultStyle(const String&);
- void addPendingSheet();
- void removePendingSheet(Node* styleSheetCandidateNode);
+ void addPendingSheet(bool isBeforeBody);
+ void removePendingSheet(Node* styleSheetCandidateNode, bool isBeforeBody);
bool hasPendingSheets() const { return m_pendingStylesheets > 0; }
+ bool hasPendingRenderBlockingSheets() const { return m_pendingRenderBlockingStylesheets > 0; }
bool haveStylesheetsLoaded() const { return !hasPendingSheets() || m_ignorePendingStylesheets; }
+ bool haveRenderBlockingStylesheetsLoaded() const { return !hasPendingRenderBlockingSheets() || m_ignorePendingStylesheets; }
bool ignoringPendingStylesheets() const { return m_ignorePendingStylesheets; }
unsigned maxDirectAdjacentSelectors() const { return m_maxDirectAdjacentSelectors; }
@@ -152,7 +154,7 @@ public:
bool shouldClearResolver() const;
void resolverChanged(StyleResolverUpdateMode);
- CSSStyleSheet* createSheet(Element*, const String& text, TextPosition startPosition);
+ CSSStyleSheet* createSheet(Element*, const String& text, TextPosition startPosition, bool isBeforeBody);
void removeSheet(StyleSheetContents*);
void collectScopedStyleFeaturesTo(RuleFeatureSet&) const;
@@ -223,6 +225,7 @@ private:
// We use this count of pending sheets to detect when we can begin attaching
// elements and when it is safe to execute scripts.
int m_pendingStylesheets = 0;
+ int m_pendingRenderBlockingStylesheets = 0;
HeapVector<Member<CSSStyleSheet>> m_injectedAuthorStyleSheets;

Powered by Google App Engine
This is Rietveld 408576698