From afc4a66d0c74204bef9dfa09907949e4e2d56e05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Wed, 4 Dec 2019 22:33:32 +0000 Subject: [PATCH] Bug 687441 - Make iframes not cause a FOUC on parent document. r=bzbarsky This makes subframes not start layout on the parent document when flushing, which fixes the FOUC issue. It does mean that some resource loads triggered by viewport-dependent media queries might not block onload of the frame, but other style-triggered loads, fonts, and such would. This makes same-origin frames act the same way as cross-origin iframes in this regard if there are stylesheet loads present. I think the trade-off is worth it here, and this is green on try. Differential Revision: https://phabricator.services.mozilla.com/D55860 --HG-- extra : moz-landing-system : lando --- dom/base/Document.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dom/base/Document.cpp b/dom/base/Document.cpp index af80d21d4c41..d7b660531f91 100644 --- a/dom/base/Document.cpp +++ b/dom/base/Document.cpp @@ -9793,7 +9793,7 @@ void Document::FlushPendingNotifications(mozilla::ChangesToFlush aFlush) { // layout flush on our parent, since we need our container to be the // correct size to determine the correct style. if (StyleOrLayoutObservablyDependsOnParentDocumentLayout() && - IsSafeToFlush()) { + mParentDocument->MayStartLayout() && IsSafeToFlush()) { mozilla::ChangesToFlush parentFlush = aFlush; if (flushType >= FlushType::Style) { parentFlush.mFlushType = std::max(FlushType::Layout, flushType);