Changeset 291104 in webkit


Ignore:
Timestamp:
Mar 10, 2022 4:50:00 AM (4 months ago)
Author:
graouts@webkit.org
Message:

[web-animations] font-variant-alternates should support discrete animation
https://bugs.webkit.org/show_bug.cgi?id=237661

Reviewed by Myles C. Maxfield.

LayoutTests/imported/w3c:

While we now run the font-variant-alternates tests, we don't support all values for this property so we fail
those tests.

  • web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-001-expected.txt:
  • web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-001-expected.txt:
  • web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-001-expected.txt:

Source/WebCore:

  • animation/CSSPropertyAnimation.cpp:

(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):

  • platform/text/TextFlags.cpp:

(WebCore::operator<<):

  • platform/text/TextFlags.h:
  • rendering/style/RenderStyle.cpp:

(WebCore::RenderStyle::setFontFamilies):
(WebCore::RenderStyle::setFontVariantAlternates):

  • rendering/style/RenderStyle.h:

(WebCore::RenderStyle::fontVariantAlternates const):

Location:
trunk
Files:
10 edited

Legend:

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

    r291103 r291104  
     12022-03-09  Antoine Quint  <graouts@webkit.org>
     2
     3        [web-animations] font-variant-alternates should support discrete animation
     4        https://bugs.webkit.org/show_bug.cgi?id=237661
     5
     6        Reviewed by Myles C. Maxfield.
     7
     8        While we now run the font-variant-alternates tests, we don't support all values for this property so we fail
     9        those tests.
     10
     11        * web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-001-expected.txt:
     12        * web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-001-expected.txt:
     13        * web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-001-expected.txt:
     14
    1152022-03-10  Antoine Quint  <graouts@webkit.org>
    216
  • trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-001-expected.txt

    r291103 r291104  
    255255PASS font-synthesis: "weight style" onto "none"
    256256PASS font-synthesis: "none" onto "weight style"
     257PASS font-variant-alternates (type: discrete) has testAccumulation function
     258FAIL font-variant-alternates: "stylistic(unknown)" onto "swash(unknown)" assert_equals: The value should be stylistic(unknown) at 0ms expected "stylistic(unknown)" but got "normal"
     259FAIL font-variant-alternates: "swash(unknown)" onto "stylistic(unknown)" assert_equals: The value should be swash(unknown) at 0ms expected "swash(unknown)" but got "normal"
    257260PASS font-variation-settings (type: fontVariationSettings) has testAccumulation function
    258261FAIL font-variation-settings with composite type accumulate assert_equals: The value should be "wght" 2.2 at 250ms expected "\"wght\" 2.2" but got "\"wght\" 1.2"
  • trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-001-expected.txt

    r291103 r291104  
    255255PASS font-synthesis: "weight style" onto "none"
    256256PASS font-synthesis: "none" onto "weight style"
     257PASS font-variant-alternates (type: discrete) has testAddition function
     258FAIL font-variant-alternates: "stylistic(unknown)" onto "swash(unknown)" assert_equals: The value should be stylistic(unknown) at 0ms expected "stylistic(unknown)" but got "normal"
     259FAIL font-variant-alternates: "swash(unknown)" onto "stylistic(unknown)" assert_equals: The value should be swash(unknown) at 0ms expected "swash(unknown)" but got "normal"
    257260PASS font-variation-settings (type: fontVariationSettings) has testAddition function
    258261FAIL font-variation-settings with composite type add assert_equals: The value should be "wght" 2.2 at 250ms expected "\"wght\" 2.2" but got "\"wght\" 1.2"
  • trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-001-expected.txt

    r291103 r291104  
    310310PASS font-synthesis uses discrete animation when animating between "none" and "weight style" with effect easing
    311311PASS font-synthesis uses discrete animation when animating between "none" and "weight style" with keyframe easing
     312PASS font-variant-alternates (type: discrete) has testInterpolation function
     313FAIL font-variant-alternates uses discrete animation when animating between "swash(unknown)" and "stylistic(unknown)" with linear easing assert_equals: The value should be swash(unknown) at 0ms expected "swash(unknown)" but got "normal"
     314FAIL font-variant-alternates uses discrete animation when animating between "swash(unknown)" and "stylistic(unknown)" with effect easing assert_equals: The value should be swash(unknown) at 0ms expected "swash(unknown)" but got "normal"
     315FAIL font-variant-alternates uses discrete animation when animating between "swash(unknown)" and "stylistic(unknown)" with keyframe easing assert_equals: The value should be swash(unknown) at 0ms expected "swash(unknown)" but got "normal"
    312316PASS font-variation-settings (type: fontVariationSettings) has testInterpolation function
    313317PASS font-variation-settings supports animation as float
  • trunk/Source/WebCore/ChangeLog

    r291103 r291104  
     12022-03-09  Antoine Quint  <graouts@webkit.org>
     2
     3        [web-animations] font-variant-alternates should support discrete animation
     4        https://bugs.webkit.org/show_bug.cgi?id=237661
     5
     6        Reviewed by Myles C. Maxfield.
     7
     8        * animation/CSSPropertyAnimation.cpp:
     9        (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
     10        * platform/text/TextFlags.cpp:
     11        (WebCore::operator<<):
     12        * platform/text/TextFlags.h:
     13        * rendering/style/RenderStyle.cpp:
     14        (WebCore::RenderStyle::setFontFamilies):
     15        (WebCore::RenderStyle::setFontVariantAlternates):
     16        * rendering/style/RenderStyle.h:
     17        (WebCore::RenderStyle::fontVariantAlternates const):
     18
    1192022-03-10  Antoine Quint  <graouts@webkit.org>
    220
  • trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp

    r291103 r291104  
    29282928        new CounterWrapper(CSSPropertyCounterReset),
    29292929        new DiscretePropertyWrapper<WindRule>(CSSPropertyFillRule, &RenderStyle::fillRule, &RenderStyle::setFillRule),
    2930         new DiscretePropertyWrapper<FontSynthesis>(CSSPropertyFontSynthesis, &RenderStyle::fontSynthesis, &RenderStyle::setFontSynthesis)
     2930        new DiscretePropertyWrapper<FontSynthesis>(CSSPropertyFontSynthesis, &RenderStyle::fontSynthesis, &RenderStyle::setFontSynthesis),
     2931        new DiscretePropertyWrapper<FontVariantAlternates>(CSSPropertyFontVariantAlternates, &RenderStyle::fontVariantAlternates, &RenderStyle::setFontVariantAlternates)
    29312932    };
    29322933    const unsigned animatableLonghandPropertiesCount = WTF_ARRAY_LENGTH(animatableLonghandPropertyWrappers);
  • trunk/Source/WebCore/platform/text/TextFlags.cpp

    r291037 r291104  
    4141}
    4242
     43WTF::TextStream& operator<<(TextStream& ts, FontVariantAlternates alternates)
     44{
     45    switch (alternates) {
     46    case FontVariantAlternates::Normal: ts << "normal"; break;
     47    case FontVariantAlternates::HistoricalForms: ts << "historical-forms"; break;
     48    }
     49    return ts;
     50}
     51
    4352} // namespace WebCore
  • trunk/Source/WebCore/platform/text/TextFlags.h

    r291037 r291104  
    118118enum class FontVariantNumericSlashedZero : bool { Normal, Yes };
    119119enum class FontVariantAlternates : bool { Normal, HistoricalForms };
     120
     121WTF::TextStream& operator<<(WTF::TextStream&, FontVariantAlternates);
    120122
    121123enum class FontVariantEastAsianVariant : uint8_t {
  • trunk/Source/WebCore/rendering/style/RenderStyle.cpp

    r291103 r291104  
    20602060    auto description = fontDescription();
    20612061    description.setFontSynthesis(value);
     2062
     2063    setFontDescription(WTFMove(description));
     2064    fontCascade().update(currentFontSelector);
     2065}
     2066
     2067void RenderStyle::setFontVariantAlternates(FontVariantAlternates value)
     2068{
     2069    FontSelector* currentFontSelector = fontCascade().fontSelector();
     2070    auto description = fontDescription();
     2071    description.setVariantAlternates(value);
    20622072
    20632073    setFontDescription(WTFMove(description));
  • trunk/Source/WebCore/rendering/style/RenderStyle.h

    r291103 r291104  
    375375    RefCountedFixedVector<AtomString>& fontFamilies() const { return fontDescription().families(); }
    376376    FontSynthesis fontSynthesis() const { return fontDescription().fontSynthesis(); }
     377    FontVariantAlternates fontVariantAlternates() const { return fontDescription().variantAlternates(); }
    377378
    378379    const Length& textIndent() const { return m_rareInheritedData->indent; }
     
    10001001    void setFontFamilies(RefCountedFixedVector<AtomString>&);
    10011002    void setFontSynthesis(FontSynthesis);
     1003    void setFontVariantAlternates(FontVariantAlternates);
    10021004
    10031005    void setColor(const Color&);
Note: See TracChangeset for help on using the changeset viewer.