Changeset 282204 in webkit


Ignore:
Timestamp:
Sep 9, 2021 2:38:41 AM (10 months ago)
Author:
mmaxfield@apple.com
Message:

FontFaceSet.has() needs to react to style changes
https://bugs.webkit.org/show_bug.cgi?id=229848

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

This test was landed upstream in https://github.com/web-platform-tests/wpt/pull/30322

  • web-platform-tests/css/css-font-loading/fontfaceset-has-expected.txt: Added.
  • web-platform-tests/css/css-font-loading/fontfaceset-has.html: Added.

Source/WebCore:

When content says "document.fonts.has(...)", the ".has(...)" part needs to
update style instead of the "document.fonts" part. This is because it's
totally legal for content to say:

var f = document.fonts;
Modify style here
... f.has(...) ... <=== This needs to reflect the style changes.

Test: imported/w3c/web-platform-tests/css/css-font-loading/fontfaceset-has.html

  • css/FontFaceSet.cpp:

(WebCore::FontFaceSet::has const):

Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r282203 r282204  
     12021-09-09  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        FontFaceSet.has() needs to react to style changes
     4        https://bugs.webkit.org/show_bug.cgi?id=229848
     5
     6        Reviewed by Antti Koivisto.
     7
     8        This test was landed upstream in https://github.com/web-platform-tests/wpt/pull/30322
     9
     10        * web-platform-tests/css/css-font-loading/fontfaceset-has-expected.txt: Added.
     11        * web-platform-tests/css/css-font-loading/fontfaceset-has.html: Added.
     12
    1132021-09-09  Cameron McCormack  <heycam@apple.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r282202 r282204  
     12021-09-09  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        FontFaceSet.has() needs to react to style changes
     4        https://bugs.webkit.org/show_bug.cgi?id=229848
     5
     6        Reviewed by Antti Koivisto.
     7
     8        When content says "document.fonts.has(...)", the ".has(...)" part needs to
     9        update style instead of the "document.fonts" part. This is because it's
     10        totally legal for content to say:
     11
     12        var f = document.fonts;
     13        // Modify style here
     14        ... f.has(...) ... <=== This needs to reflect the style changes.
     15
     16        Test: imported/w3c/web-platform-tests/css/css-font-loading/fontfaceset-has.html
     17
     18        * css/FontFaceSet.cpp:
     19        (WebCore::FontFaceSet::has const):
     20
    1212021-09-09  Antti Koivisto  <antti@apple.com>
    222
  • trunk/Source/WebCore/css/FontFaceSet.cpp

    r282049 r282204  
    108108bool FontFaceSet::has(FontFace& face) const
    109109{
     110    if (face.backing().cssConnection())
     111        m_backing->updateStyleIfNeeded();
    110112    return m_backing->hasFace(face.backing());
    111113}
Note: See TracChangeset for help on using the changeset viewer.