Closed Bug 1462850 Opened 2 years ago Closed 2 years ago

[wpt-sync] Sync PR 11082 - [css-fonts] Avoid race condition


(Core :: Layout: Text and Fonts, enhancement, P4)




Tracking Status
firefox63 --- fixed


(Reporter: wptsync, Unassigned)




(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 11082 into mozilla-central (this bug is closed when the sync is complete).

Details from upstream follow.

Mike Pennisi <> wrote:
>  [css-fonts] Avoid race condition
>  @gsnedders @Ms2ger I'm not certain that my rationale is sound, so I've over-explained a bit to help you show me if/where I've gone wrong.
>  ---
>  The modified test primes the document's font source by declaring a
>  `font-face` rule and deferring tests until the font has been loaded. The
>  sub-tests are expressed in terms of a FontFace which is dynamically
>  generated via a `<style>` tag but which shares the same URL.
>  Prior to this patch, the test assumed that the declaration of the second
>  FontFace would be reflected in a synchronously-triggered reflow (via
>  access of the `offsetWidth` property). This is not guaranteed because
>  each parse of a `<style>` element creates a new FontFace object [1] which
>  must be loaded [2] with the potentially CORS-enabled fetch method of the
>  HTML specification [3].
>  Practically speaking, this caused the Firefox and Chrome browsers to
>  consistently fail the sub-tests.
>  Update the test to define a unique FontFace for every subtest and to
>  explicitly wait for it to be available for rendering. Annotate the test
>  as "long" to accomodate the additional time spent waiting.
>  [1] > A CSS @font-face rule automatically defines a corresponding
>      > FontFace object, which is automatically placed in the document’s
>      > font source when the rule is parsed.
>  [2] > When a user-agent needs to load a font face, it must do so by
>      > calling the load() method of the corresponding FontFace object.
>  [3] > For font loads, user agents must use the potentially CORS-enabled
>      > fetch method defined by the [HTML5] specification for URL's
>      > defined within @font-face rules.
Component: web-platform-tests → Layout: Text
Product: Testing → Core
Whiteboard: [wptsync downstream] → [wptsync downstream error]
Whiteboard: [wptsync downstream error] → [wptsync downstream]
Whiteboard: [wptsync downstream] → [wptsync downstream error]
Whiteboard: [wptsync downstream error] → [wptsync downstream]
Failed to get results from try push
Pushed by
[wpt PR 11082] - [css-fonts] Avoid race condition, a=testonly
[wpt PR 11082] - Update wpt metadata, a=testonly
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in before you can comment on or make changes to this bug.