Closed
Bug 1466431
Opened 6 years ago
Closed 6 years ago
Fix resolving of the document.fonts.ready Promise for documents that never load fonts
Categories
(Core :: Layout, enhancement, P2)
Core
Layout
Tracking
()
RESOLVED
FIXED
mozilla62
Tracking | Status | |
---|---|---|
firefox62 | --- | fixed |
People
(Reporter: jwatt, Assigned: jwatt)
References
Details
Attachments
(1 file)
1.08 KB,
patch
|
heycam
:
review+
|
Details | Diff | Splinter Review |
Bug 1465983 changes the document.fonts.ready Promise so that it is no longer resolved as soon as it's created. Currently our code in FontFaceSet::CheckLoadingFinished() -- the code that resolves the Promise -- checks for |mStatus == FontFaceSetLoadStatus::Loaded| to see if we've already resolved the Promise. That's fine if we load a (any) FontFace, since doing so switches mStatus from the initial value Loaded to Loading. However, if a document never loads a font, the Promise will be left pending for ever, because mStatus will never be anything except Loaded, and CheckLoadingFinished will think it has resolved the Promise and return early. Basically it's wrong to be equating |mStatus == FontFaceSetLoadStatus::Loaded| with "the Promise is resolved". mStatus is an indication of whether any FontFaces are in the process of being downloaded. Whether the Promise is resolved or not depends on more than just that though. Specifically, it cannot be resolved while style sheets are "stuck on the environment" in spec parlance. I.e. while style sheets are loading/parsing, or layout is pending. We need to change this |mStatus == FontFaceSetLoadStatus::Loaded| check to an explicit check for the state of the Promise.
Assignee | ||
Comment 1•6 years ago
|
||
Attachment #8982941 -
Flags: review?(cam)
Comment 2•6 years ago
|
||
Comment on attachment 8982941 [details] [diff] [review] patch Review of attachment 8982941 [details] [diff] [review]: ----------------------------------------------------------------- Test? :)
Attachment #8982941 -
Flags: review?(cam) → review+
Assignee | ||
Comment 3•6 years ago
|
||
(In reply to Cameron McCormack (:heycam) from comment #2) > Test? :) Many tests in layout/style/test/test_font_loading_api.html fail without this.
Pushed by jwatt@jwatt.org: https://hg.mozilla.org/integration/mozilla-inbound/rev/19de16bae96c Fix resolving of the document.fonts.ready Promise for documents that never load fonts. r=heycam
Assignee | ||
Updated•6 years ago
|
Priority: -- → P2
Comment 5•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/19de16bae96c
Status: NEW → RESOLVED
Closed: 6 years ago
status-firefox62:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla62
You need to log in
before you can comment on or make changes to this bug.
Description
•