Unify invalidation code paths for font-face rule changes and font loading
Currently, there are two different invalidation code paths for font-face related changes: 1. Via FontSelector::FontFaceInvalidated(). This is called when: - The loading status of a font changes - A FontFace is changed via the JavaScript API This code path also allows partial style invalidation when the feature CSSReducedFontLoadingInvalidations is enabled; Otherwise, it marks the full document's style as dirty. 2. Via StyleEngine::InvalidateForRuleSetChanges(). This is called when StyleEngine identifies changes in the active @font-face rules. It marks the full document's style as dirty. This patch makes (2) to also use FontSelector::FontFaceInvalidated() to update style and layout, instead of directly marking full document style dirty. As a result: - When the feature is enabled, @font-face rule changes don't need full document style recalc - We no longer need to compare FontSelector versions in style diff. This is required by partial layout recalc for font loading - There is no essential behavioral change when the feature is disabled, since in that case both code paths mark style dirty on the full doc Note: there's also a renaming to certain variables & functions to make code more readable, since what they actually rebuild is FontFaceCache instead of FontCache. Bug: 441925 Change-Id: I5207e99fdb7e610bcdedc4c7b3615b0c13b69c6b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2147687Reviewed-by:Rune Lillesveen <futhark@chromium.org> Reviewed-by:
Koji Ishii <kojii@chromium.org> Commit-Queue: Koji Ishii <kojii@chromium.org> Cr-Commit-Position: refs/heads/master@{#759124}
Showing
Please register or sign in to comment