Closed Bug 1803261 Opened 3 years ago Closed 3 years ago

[wpt-sync] Sync PR 37245 - Don't reallow optional fonts after resetting FontFace

Categories

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

task

Tracking

()

RESOLVED INVALID

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

PR: https://github.com/web-platform-tests/wpt/pull/37245
Details from upstream follow.

Xiaocheng Hu <xiaochengh@chromium.org> wrote:

Don't reallow optional fonts after resetting FontFace

Currently, whether an optional font has reached the failure period
depends on info solely stored on RemoteFontFaceSource. If the FontFace
is reset, the the info is reset, and the optional font can swap in and
cause layout shifts. Due to crbug.com/347460, this may occur even when
there's no change to the CSS @font-face rule itself.

This patch:

  • Also stores the paint_requested_while_pending flag to FontResource,
    so that a RemoveFontFaceSource can restore the flag value after being
    reset
  • Simplifies failure criteria for optional fonts: it should enter the
    failure period if and only if it has been requested while pending,
    since this is the same as whether the font will cause layout shifting

Fixed: 1385790
Change-Id: Ife80a17b478e9a1683534ebd053a03b3c9878848
Reviewed-on: https://chromium-review.googlesource.com/4064932
WPT-Export-Revision: 7a6f5067edd65a5fd2da509e356a632547487a36

Component: web-platform-tests → Layout: Text and Fonts
Product: Testing → Core
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.