Closed Bug 1420362 Opened 7 years ago Closed 6 years ago

<iframe> is causing a flash of unstyled content (FOUC) issue

Categories

(Core :: Layout, defect, P3)

defect

Tracking

()

RESOLVED DUPLICATE of bug 687441
Tracking Status
firefox57 --- affected
firefox58 --- affected
firefox59 --- affected
firefox65 --- affected

People

(Reporter: bmo, Unassigned)

References

Details

Attachments

(1 file, 2 obsolete files)

This is a follow-up from bug 1404468 comment 18. STR: Load https://codepen.io/pen/ and sometimes FOUC happens. To make it easier to reproduce, you can add the pref `nglayout.initialpaint.delay` to `0` and throttle network speed to GPRS. Expected Result: No FOUC before external stylesheet is loaded. I'll submit a simplified test case later.
Attached file iframe-fouc.html (obsolete) —
As there is an external stylesheet with <head> and followed by a <script> tag, content should not be rendered before stylesheet is loaded. By inserting an iframe in <body>, it will change the render flow and cause FOUC.
Attached file iframe-fouc.html (obsolete) —
update mime
Attached file iframe-fouc.html
Attachment #8931611 - Attachment is obsolete: true
Attachment #8931612 - Attachment is obsolete: true
See Also: → 1404468
Priority: -- → P3
Boris told me he *loves* FOUC bugs and wants to CC'd on all of them.
Flags: needinfo?(bzbarsky)
So this is rather annoying. The rlevant stack looks like this: frame #1: 0x0000000102e3e107 XUL`nsContentSink::StartLayout(this=0x0000000122c68800, aIgnorePendingSheets=true) at nsContentSink.cpp:1288 frame #2: 0x00000001021e06b5 XUL`nsHtml5TreeOpExecutor::FlushPendingNotifications(this=0x0000000122c68800, aType=Layout) at nsHtml5TreeOpExecutor.cpp:245 frame #3: 0x00000001021e06e6 XUL`non-virtual thunk to nsHtml5TreeOpExecutor::FlushPendingNotifications(this=0x0000000122c68800, aType=Layout) at nsHtml5TreeOpExecutor.cpp:0 frame #4: 0x0000000102e9b3de XUL`nsDocument::FlushPendingNotifications(this=0x000000011fb04000, aType=Layout, aTarget=Normal) at nsDocument.cpp:8530 frame #5: 0x0000000102e9b4e7 XUL`nsDocument::FlushPendingNotifications(this=0x00000001248ff000, aType=Style, aTarget=Normal) at nsDocument.cpp:8554 frame #6: 0x00000001020ce598 XUL`nsDocLoader::DocLoaderIsEmpty(this=0x0000000140c8d800, aFlushLayout=true) at nsDocLoader.cpp:704 frame #7: 0x00000001020cf90f XUL`nsDocLoader::OnStopRequest(this=0x0000000140c8d800, aRequest=0x000000011fb4fea0, aCtxt=0x0000000000000000, aStatus=NS_OK) at nsDocLoader.cpp:633 So we go to maybe fire the load event on the subframe, that means we need to get styles up to date so we know the various background images and whatnot, but due to media queries that means we need up-to-date layout in the parent, so we flush layout on the parent and that kicks off layout even if there are pending sheets. One option here would be to bail out of DocLoaderIsEmpty if our parent is not ready to start layout, then have it notify us when it is so we can fire the load event. Another option is to just give up on all this and go back to having stylesheets block the parser...
Flags: needinfo?(bzbarsky)

Looks like I filed this long ago, with some possible thoughts on fixing...

Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: