Closed Bug 1657173 Opened 4 years ago Closed 4 years ago

[rel=preload] stylesheets that are only preloaded with <link rel=preload> must not block document's onload

Categories

(Core :: CSS Parsing and Computation, defect)

defect

Tracking

()

RESOLVED FIXED
81 Branch
Tracking Status
firefox81 --- fixed

People

(Reporter: mayhemer, Assigned: emilio)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Loader::PostLoadEvent calls IncrementOngoingLoadCount and Loader::NotifyObservers calls DecrementOngoingLoadCount regardless if the css load is a link-preload only or not.

This will probably not be that simple to solve. In case we find the stylesheet actually used we need to increase the blocker count and then decrease when this coalesced and used load is done.

Please triage

Flags: needinfo?(honzab.moz)

(In reply to Honza Bambas (:mayhemer) from comment #0)

This will probably not be that simple to solve.

Actually I think it'd be as simple as that. We call that before looking at the cache, so if we use the sheet we enter that (and NotifyObservers) twice, once for the preload and once for the link.

Emilio, would you be willing to work on this for this release? (81)

Flags: needinfo?(honzab.moz) → needinfo?(emilio)

And fix the only WPT for this while at it which was using the wrong URL
(and thus would always pass).

This actually makes me a bit uncomfortable given the amount of times
I've seen the pattern:

<link href="important.css" rel="preload" as="style" onload="this.rel = 'stylesheet'">

As that means that important.css won't block the load event. But let's
try.

Assignee: nobody → emilio
Status: NEW → ASSIGNED

Sure, why not.

Flags: needinfo?(emilio)

[Triage: I'm guessing this is S3, and emilio can adjust if that seems off.]

Severity: -- → S3
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d1e2ee395d42 Make <link rel=preload as=style> not block onload incorrectly. r=mayhemer
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/24950 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 81 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: