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

Unified Diff: third_party/WebKit/Source/core/html/HTMLLinkElement.cpp

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/html/HTMLLinkElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp b/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
index 1b3522c8253f293e26488f4f24af88eb155cfbf4..e14947e1e14d2aec02625d1e0dcd069e8f13f5d1 100644
--- a/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
@@ -481,6 +481,7 @@ LinkStyle::LinkStyle(HTMLLinkElement* owner)
, m_firedLoad(false)
, m_loadedSheet(false)
, m_fetchFollowingCORS(false)
+ , m_beforeBody(false)
{
}
@@ -622,7 +623,8 @@ void LinkStyle::addPendingSheet(PendingSheetType type)
if (m_pendingSheetType == NonBlocking)
return;
- m_owner->document().styleEngine().addPendingSheet();
+ m_beforeBody = m_beforeBody || !m_owner->document().body();
+ m_owner->document().styleEngine().addPendingSheet(m_beforeBody);
}
void LinkStyle::removePendingSheet()
@@ -638,7 +640,7 @@ void LinkStyle::removePendingSheet()
return;
}
- m_owner->document().styleEngine().removePendingSheet(m_owner);
+ m_owner->document().styleEngine().removePendingSheet(m_owner, m_beforeBody);
}
void LinkStyle::setDisabledState(bool disabled)

Powered by Google App Engine
This is Rietveld 408576698