Closed
Bug 1145506
Opened 10 years ago
Closed 10 years ago
uninitialized FontFace objects added to the FontFaceSet do not start loading due to font matching
Categories
(Core :: CSS Parsing and Computation, defect)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
mozilla39
Tracking | Status | |
---|---|---|
firefox39 | --- | fixed |
People
(Reporter: heycam, Assigned: heycam)
References
Details
Attachments
(1 file, 1 obsolete file)
STR:
1. Create a new FontFace object and immediately add it to the FontFaceSet.
2. Add some text to the document that should cause the FontFace to load.
3. Flush layout.
4. Expect the FontFace to have status "loading", but it is "unloaded".
Because we haven't gone around the event loop yet, the FontFace object is still uninitialized (which means we haven't parsed its src). So when we flush layout, we skip creating and adding a user font entry for the FontFace.
I think to simplify things, we should create user font entries even for FontFace objects that aren't initialized yet. This will need some tracking in the gfxUserFontEntry to ensure that we update the src list once the FontFace is initialized, but that shouldn't be too hard. This will also let us remove the mShouldLoadWhenInitialized handling in FontFace, since calling Load() on an uninitialized FontFace will now have a user font entry to start loading.
Assignee | ||
Comment 1•10 years ago
|
||
Comment 2•10 years ago
|
||
Comment on attachment 8581105 [details] [diff] [review]
Create user font entries for uninitialized FontFaces and update their src lists once they are initialized.
I think the complicated uninitialized/pending/invalid state changes for source types is unnecessary. But I think they follow from the spec wording, so the spec wording should probably change.
I posted that src parsing for strings should follow the behavior of family/descriptor parsing -- if invalid, set status to "error" and simply reject with a syntax error. No need to queue tasks and deal with odd intermediate states.
https://lists.w3.org/Archives/Public/www-style/2015Mar/0493.html
I should also note that what I'm suggesting here is exactly what the current Chrome implementation does. Yay, interop...
Attachment #8581105 -
Flags: review?(jdaggett) → review-
Assignee | ||
Comment 3•10 years ago
|
||
This simplifies a lot!
Attachment #8581105 -
Attachment is obsolete: true
Attachment #8584285 -
Flags: review?(jdaggett)
Assignee | ||
Comment 4•10 years ago
|
||
Comment 5•10 years ago
|
||
Comment on attachment 8584285 [details] [diff] [review]
Make FontFace constructor fail on invalid src strings but otherwise create user font entries immediately.
Review of attachment 8584285 [details] [diff] [review]:
-----------------------------------------------------------------
Looks great!
Attachment #8584285 -
Flags: review?(jdaggett) → review+
Assignee | ||
Comment 6•10 years ago
|
||
Comment 7•10 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
status-firefox39:
--- → fixed
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
You need to log in
before you can comment on or make changes to this bug.
Description
•