Closed Bug 1144977 Opened 5 years ago Closed 5 years ago

FontFace objects should not be included in more than one loadingdone/loadingerror event's fontfaces list

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla39
Tracking Status
firefox39 --- fixed

People

(Reporter: heycam, Assigned: heycam)

References

Details

Attachments

(3 files)

When a FontFaceSet finishes loading, it should dispatch loadingdone/loadingerror events listing only the FontFace objects that finished loading since the last loadingdone/loadingerror events were dispatched.
Attached file test
This test should output:

adding first font
loadingdone: 1 FontFace objects
adding second font
loadingdone: 1 FontFace objects

but instead currently outputs:

adding first font
loadingdone: 1 FontFace objects
adding second font
loadingdone: 2 FontFace objects
Assignee: nobody → cam
Status: NEW → ASSIGNED
Attachment #8580231 - Flags: review?(jdaggett)
Attached patch Part 2: Tests.Splinter Review
Attachment #8580232 - Flags: review?(jdaggett)
Comment on attachment 8580231 [details] [diff] [review]
Part 1: Don't include FontFace objects in more than one loadingdone/loadingerror event.

Review of attachment 8580231 [details] [diff] [review]:
-----------------------------------------------------------------

r+ with small nit fixed.

::: layout/style/FontFaceSet.h
@@ +225,5 @@
>    void DispatchLoadingFinishedEvent(
>                                  const nsAString& aType,
>                                  const nsTArray<FontFace*>& aFontFaces);
>  
> +  // Note: if you add new cycle collected objects to FaceRecord,

hmmm, this doesn't seem to make sense
Attachment #8580231 - Flags: review?(jdaggett) → review+
Comment on attachment 8580232 [details] [diff] [review]
Part 2: Tests.

Looks good.
Attachment #8580232 - Flags: review?(jdaggett) → review+
https://hg.mozilla.org/mozilla-central/rev/cfe959cdfb21
https://hg.mozilla.org/mozilla-central/rev/7a7b97047c76
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
You need to log in before you can comment on or make changes to this bug.