Closed Bug 1811526 Opened 2 years ago Closed 2 years ago

[wpt-sync] Sync PR 38085 - FontFallbackList::CompositeKey should take current_family->FamilyIsGeneric() into account

Categories

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

task

Tracking

()

RESOLVED FIXED
111 Branch
Tracking Status
firefox111 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Frédéric Wang <fwang@igalia.com> wrote:

FontFallbackList::CompositeKey should take current_family->FamilyIsGeneric() into account

FontFallBackList::GetShapeCache calculates the key of a FontDescription
via FontFallbackList::CompositeKey as follows:

  1. Initialize the key's data/hash in FallbackListCompositeKey's
    contructor. This ignores FontDescription::family_list_ but takes
    into account FontDescription::generic_family_ via BitmapFields() and
    AuxiliaryBitmapFields().

  2. Update key's data/hash via FallbackListCompositeKey::Add and
    FontDescripion::CacheKey for each item of
    FontDescription::family_list_

As a consequence, this calculation is not sufficient to distinguish
FontDescription created from things like font-family: "system-ui"
(quoted) and font-family: system-ui (unquoted) [1] [2]. The
ShapeCache is still used in canvas and so it is possible to tweak
WPT test css/css-fonts/generic-family-keywords-001.html in order to
exhibit that issue.

This CL modifies FontFallbackList::CompositeKey to ensure that
FamilyIsGeneric() is taken into account for each item of
FontDescription::family_list_. It also adds the canvas version of
the corresponding WPT test mentioned above.

[1] The latter specifies a generic font family but the former does not.
See https://drafts.csswg.org/css-fonts-4/#family-name-syntax
[2] For generic family listed in FontDescription::GenericFamilyType,
it is necessary to add another generic family to the font-family
so that they use the same FontDescription::generic_family_.
For details, see https://docs.google.com/document/d/1nYJzL-MWQrTmf9Z-KscTWuM_5n6-IVdJeEllJ3Appro/edit

Bug: 1408485
Change-Id: Iac95ccf0fd345352cce963f77a60818060a40dc7
Reviewed-on: https://chromium-review.googlesource.com/4176920
WPT-Export-Revision: 53ec8bcbcf5927d00ded6ee5986341f528ac5df2

Component: web-platform-tests → Layout: Text and Fonts
Product: Testing → Core
Whiteboard: [wptsync downstream] → [wptsync downstream error]
Whiteboard: [wptsync downstream error] → [wptsync downstream]
Test result changes from PR not available.
Test result changes from PR not available.
Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/fdff471795f6 [wpt PR 38085] - FontFallbackList::CompositeKey should take current_family->FamilyIsGeneric() into account, a=testonly https://hg.mozilla.org/integration/autoland/rev/2f7f65cb8508 [wpt PR 38085] - Update wpt metadata, a=testonly
Test result changes from PR not available.
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 111 Branch
You need to log in before you can comment on or make changes to this bug.