| 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();
|
| }
|
|
|