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

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

Issue 2823873002: Fixed the paint supression to track only render-blocking stylesheets
Patch Set: Fixed stylesheet check 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/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index e59fd92e24388367e640533f8a3d9c6eeb3d1eb2..affb98ed814979d8bd4f74d2fe9767d444e92c17 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -2289,8 +2289,7 @@ void Document::LayoutUpdated() {
// beginFrame? This will catch the first layout in a page that does lots
// of layout thrashing even though that layout might not be followed by
// a paint for many seconds.
- if (IsRenderingReady() && body() &&
- !GetStyleEngine().HasPendingScriptBlockingSheets()) {
+ if (IsRenderingReady() && body() && !HasPendingRenderBlockingSheets()) {
if (!document_timing_.FirstLayout())
document_timing_.MarkFirstLayout();
}
@@ -2319,7 +2318,7 @@ void Document::ClearFocusedElementTimerFired(TimerBase*) {
void Document::UpdateStyleAndLayoutTreeIgnorePendingStylesheets() {
StyleEngine::IgnoringPendingStylesheet ignoring(GetStyleEngine());
- if (GetStyleEngine().HasPendingScriptBlockingSheets()) {
+ if (HasPendingRenderBlockingSheets()) {
// FIXME: We are willing to attempt to suppress painting with outdated style
// info only once. Our assumption is that it would be dangerous to try to
// stop it a second time, after page content has already been loaded and
@@ -4055,8 +4054,7 @@ void Document::StyleResolverMayHaveChanged() {
StyleChangeReason::kCleanupPlaceholderStyles));
}
- if (DidLayoutWithPendingStylesheets() &&
- !GetStyleEngine().HasPendingScriptBlockingSheets()) {
+ if (DidLayoutWithPendingStylesheets() && !HasPendingRenderBlockingSheets()) {
// We need to manually repaint because we avoid doing all repaints in layout
// or style recalc while sheets are still loading to avoid FOUC.
pending_sheet_layout_ = kIgnoreLayoutWithPendingSheets;
@@ -6435,6 +6433,12 @@ void Document::UpdateHoverActiveState(const HitTestRequest& request,
}
}
+bool Document::HasPendingRenderBlockingSheets() const {
+ if (RuntimeEnabledFeatures::cssInBodyDoesNotBlockPaintEnabled())
+ return style_engine_->HasPendingRenderBlockingSheets();
+ return style_engine_->HasPendingScriptBlockingSheets();
+}
+
bool Document::HaveScriptBlockingStylesheetsLoaded() const {
return style_engine_->HaveScriptBlockingStylesheetsLoaded();
}
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.h ('k') | third_party/WebKit/Source/web/tests/WebMeaningfulLayoutsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698