Bug 1612231 [wpt PR 21507] - Partial style recalc after font loading, a=testonly
commit10d4b688bfd38f0c19487eea40b9d7e052e61883
authorXiaocheng Hu <xiaochengh@chromium.org>
Wed, 12 Feb 2020 11:17:35 +0000 (12 11:17 +0000)
committermoz-wptsync-bot <wptsync@mozilla.com>
Fri, 14 Feb 2020 19:08:47 +0000 (14 19:08 +0000)
treecf1e5c499ae2531e260d31b0c40c0e20a05d0d65
parentdadc32c1aee38654f6c07f55aadf5d5011e8eba7
Bug 1612231 [wpt PR 21507] - Partial style recalc after font loading, a=testonly

Automatic update from web-platform-tests
Partial style recalc after font loading

This patch reduces style recalc after loading a web font, by:

1. Allowing a Font object to be reused after loading a web font, by
calling FontFallbackList::Invalidate() when accessing a FontFallbackList
after font updates.

2. On the style and layout update after font loading:

   a. Traverses the document, and invalidates styles on nodes where
      font metrics are required for style computation: when length
      units 'ch' and 'ex' are used, or when 'font-size-adjust'
      property is set.

   b. Stops using IsLoadingCustomFont() related checks for style or
      layout invalidation.

   c. Traverses the layout tree to manually invalidate layout, since
      font changes are no longer reflected in ComputedStyle differences.

Bug: 441925
Change-Id: I932b733e71a6de936f95bdff435ce177997820ff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1952189
Reviewed-by: Dominik Röttsches <drott@chromium.org>
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#738710}

--

wpt-commits: 3f8358844a35a0e066d5a406e77a1669f8682d8a
wpt-pr: 21507
testing/web-platform/tests/css/css-values/ch-empty-pseudo-recalc-on-font-load.html [new file with mode: 0644]