Open Bug 1520328 Opened 5 years ago Updated 9 days ago

FOUC caused by a hidden input in the <head> tag

Categories

(Core :: Layout, defect, P3)

defect

Tracking

()

Tracking Status
firefox66 --- affected

People

(Reporter: twisniewski, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Attached file test.html

It appears that in the attached test-case, a FOUC (flash of unstyled content) is being caused by the <input type=hidden> in the <head> of the document. The delay is more noticeable if the stylesheet takes longer to download, but doesn't seem to be tied to the specific stylesheet I've used in the test-case (I tried a stylesheet from the BBC site, among others, and they all caused a flash relative to the time it took to fetch the remote CSS file).

Well, the <input> causes the <head> to end and the <body> to begin, so the <link> after that is in the body, which doesn't block layout IIRC.

Boris, do you have any opinion on what to do about this? You were involved in the discussion in:

https://groups.google.com/a/chromium.org/d/msg/blink-dev/QC5iefctcag/kkoBNliBAgAJ

Which seems relevant to this and looks like it'd regress this in Chromium.

Flags: needinfo?(bzbarsky)

Yes to all of comment 1.

Note that <input> is not allowed in <head> in valid HTML, by the way, not that anyone really cares about HTML validity...

Boris, do you have any opinion on what to do about this?

Is this being a problem on real-world sites?

Flags: needinfo?(bzbarsky)

OK, so specifically this has been seen on https://watchmyparcel.com/hm only (the other link in that issue does not have this pattern).

Priority: -- → P3
Webcompat Priority: --- → ?

Tom, you wanted to check if this has a lot of instances and maybe should be a P2 instead of a P3.

Webcompat Priority: ? → P3
Flags: needinfo?(twisniewski)

I don't see any hard evidence that this is impacting a lot of sites in a bad way, so since there's a listed workaround on a related chromestatus page I think this can remain a P3 for now:

Firefox .. does not pause the parser so that content after the external sheet is painted using the existing styles until the external sheet loads. Parser pausing can be achieved in Firefox by placing an empty script tag after the relevant sheets.

Flags: needinfo?(twisniewski)
Severity: normal → S3

I've rechecked https://webcompat.com/issues/20307 and the issue is no longer reproducible (they moved <input name="__RequestVerificationToken> inside the body tag). Unsetting webcompat priority for now

Webcompat Priority: P3 → ---
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: