Changeset 282015 in webkit


Ignore:
Timestamp:
Sep 3, 2021 1:03:18 PM (11 months ago)
Author:
mmaxfield@apple.com
Message:

FontFaceSet.status needs to react to style changes
https://bugs.webkit.org/show_bug.cgi?id=229839

Reviewed by Sam Weinig.

Source/WebCore:

When content says "document.fonts.status", the ".status" 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.status ... <=== This needs to reflect the style changes.

Test: fast/text/FontFaceSet-status-after-style-update.html

  • css/FontFaceSet.cpp:

(WebCore::FontFaceSet::status const):

LayoutTests:

This is not a WPT test because it requires internals.invalidateFontCache().

  • fast/text/FontFaceSet-status-after-style-update-expected.txt: Added.
  • fast/text/FontFaceSet-status-after-style-update.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r282008 r282015  
     12021-09-03  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        FontFaceSet.status needs to react to style changes
     4        https://bugs.webkit.org/show_bug.cgi?id=229839
     5
     6        Reviewed by Sam Weinig.
     7
     8        This is not a WPT test because it requires internals.invalidateFontCache().
     9
     10        * fast/text/FontFaceSet-status-after-style-update-expected.txt: Added.
     11        * fast/text/FontFaceSet-status-after-style-update.html: Added.
     12
    1132021-09-03  Ziran Sun  <zsun@igalia.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r282008 r282015  
     12021-09-03  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        FontFaceSet.status needs to react to style changes
     4        https://bugs.webkit.org/show_bug.cgi?id=229839
     5
     6        Reviewed by Sam Weinig.
     7
     8        When content says "document.fonts.status", the ".status" 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.status ... <=== This needs to reflect the style changes.
     15
     16        Test: fast/text/FontFaceSet-status-after-style-update.html
     17
     18        * css/FontFaceSet.cpp:
     19        (WebCore::FontFaceSet::status const):
     20
    1212021-09-03  Ziran Sun  <zsun@igalia.com>
    222
  • trunk/Source/WebCore/css/FontFaceSet.cpp

    r281975 r282015  
    194194auto FontFaceSet::status() const -> LoadStatus
    195195{
    196     switch (m_backing->status()) {
     196    Ref protect = m_backing;
     197    protect->updateStyleIfNeeded();
     198
     199    switch (protect->status()) {
    197200    case CSSFontFaceSet::Status::Loading:
    198201        return LoadStatus::Loading;
Note: See TracChangeset for help on using the changeset viewer.