Changeset 291039 in webkit


Ignore:
Timestamp:
Mar 9, 2022 4:45:26 AM (4 months ago)
Author:
graouts@webkit.org
Message:

[web-animations] font-feature-settings should support discrete animation
https://bugs.webkit.org/show_bug.cgi?id=237587

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

  • web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt:
  • 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/graphics/FontTaggedSettings.cpp:

(WebCore::operator<<):

  • platform/graphics/FontTaggedSettings.h:
  • rendering/style/RenderStyle.cpp:

(WebCore::RenderStyle::setFontPalette):
(WebCore::RenderStyle::setFontFeatureSettings):

  • rendering/style/RenderStyle.h:

(WebCore::RenderStyle::fontFeatureSettings const):

Location:
trunk
Files:
11 edited

Legend:

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

    r291037 r291039  
     12022-03-08  Antoine Quint  <graouts@webkit.org>
     2
     3        [web-animations] font-feature-settings should support discrete animation
     4        https://bugs.webkit.org/show_bug.cgi?id=237587
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt:
     9        * web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-001-expected.txt:
     10        * web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-001-expected.txt:
     11        * web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-001-expected.txt:
     12
    1132022-03-08  Antoine Quint  <graouts@webkit.org>
    214
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt

    r291037 r291039  
    22FAIL Animation of font in ::marker assert_in_array: value "italic normal 500 expanded 15px/35px -webkit-standard" not in array ["italic small-caps 500 expanded 15px / 35px Ahem", "italic small-caps 500 expanded 15px/35px Ahem"]
    33FAIL Animation of font-family in ::marker assert_equals: expected "Ahem" but got "-webkit-standard"
    4 FAIL Animation of font-feature-settings in ::marker assert_equals: expected "\"smcp\"" but got "normal"
     4PASS Animation of font-feature-settings in ::marker
    55PASS Animation of font-kerning in ::marker
    66PASS Animation of font-size in ::marker
  • trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-001-expected.txt

    r291037 r291039  
    222222PASS float: "right" onto "left"
    223223PASS float: "left" onto "right"
     224PASS font-feature-settings (type: discrete) has testAccumulation function
     225PASS font-feature-settings: "normal" onto ""liga" 5"
     226PASS font-feature-settings: ""liga" 5" onto "normal"
    224227PASS font-kerning (type: discrete) has testAccumulation function
    225228PASS font-kerning: "normal" onto "auto"
  • trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-001-expected.txt

    r291037 r291039  
    222222PASS float: "right" onto "left"
    223223PASS float: "left" onto "right"
     224PASS font-feature-settings (type: discrete) has testAddition function
     225PASS font-feature-settings: "normal" onto ""liga" 5"
     226PASS font-feature-settings: ""liga" 5" onto "normal"
    224227PASS font-kerning (type: discrete) has testAddition function
    225228PASS font-kerning: "normal" onto "auto"
  • trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-001-expected.txt

    r291037 r291039  
    266266PASS float uses discrete animation when animating between "left" and "right" with effect easing
    267267PASS float uses discrete animation when animating between "left" and "right" with keyframe easing
     268PASS font-feature-settings (type: discrete) has testInterpolation function
     269PASS font-feature-settings uses discrete animation when animating between ""liga" 5" and "normal" with linear easing
     270PASS font-feature-settings uses discrete animation when animating between ""liga" 5" and "normal" with effect easing
     271PASS font-feature-settings uses discrete animation when animating between ""liga" 5" and "normal" with keyframe easing
    268272PASS font-kerning (type: discrete) has testInterpolation function
    269273PASS font-kerning uses discrete animation when animating between "auto" and "normal" with linear easing
  • trunk/Source/WebCore/ChangeLog

    r291037 r291039  
     12022-03-08  Antoine Quint  <graouts@webkit.org>
     2
     3        [web-animations] font-feature-settings should support discrete animation
     4        https://bugs.webkit.org/show_bug.cgi?id=237587
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * animation/CSSPropertyAnimation.cpp:
     9        (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
     10        * platform/graphics/FontTaggedSettings.cpp:
     11        (WebCore::operator<<):
     12        * platform/graphics/FontTaggedSettings.h:
     13        * rendering/style/RenderStyle.cpp:
     14        (WebCore::RenderStyle::setFontPalette):
     15        (WebCore::RenderStyle::setFontFeatureSettings):
     16        * rendering/style/RenderStyle.h:
     17        (WebCore::RenderStyle::fontFeatureSettings const):
     18
    1192022-03-08  Antoine Quint  <graouts@webkit.org>
    220
  • trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp

    r291037 r291039  
    28102810        new DiscretePropertyWrapper<TextDecorationSkipInk>(CSSPropertyTextDecorationSkipInk, &RenderStyle::textDecorationSkipInk, &RenderStyle::setTextDecorationSkipInk),
    28112811        new DiscretePropertyWrapper<ColorInterpolation>(CSSPropertyColorInterpolation, &RenderStyle::colorInterpolation, &RenderStyle::setColorInterpolation),
    2812         new DiscretePropertyWrapper<Kerning>(CSSPropertyFontKerning, &RenderStyle::fontKerning, &RenderStyle::setFontKerning)
     2812        new DiscretePropertyWrapper<Kerning>(CSSPropertyFontKerning, &RenderStyle::fontKerning, &RenderStyle::setFontKerning),
     2813        new DiscretePropertyWrapper<FontFeatureSettings>(CSSPropertyFontFeatureSettings, &RenderStyle::fontFeatureSettings, &RenderStyle::setFontFeatureSettings)
    28132814    };
    28142815    const unsigned animatableLonghandPropertiesCount = WTF_ARRAY_LENGTH(animatableLonghandPropertyWrappers);
  • trunk/Source/WebCore/platform/graphics/FontTaggedSettings.cpp

    r275650 r291039  
    3232namespace WebCore {
    3333
     34TextStream& operator<<(TextStream& ts, const FontTaggedSettings<int>& item)
     35{
     36    for (unsigned i = 0; i < item.size(); ++i) {
     37        auto& variation = item.at(i);
     38        StringBuilder s;
     39        s.append(variation.tag()[0]);
     40        s.append(variation.tag()[1]);
     41        s.append(variation.tag()[2]);
     42        s.append(variation.tag()[3]);
     43        ts.dumpProperty(s.toString(), item.at(i).value());
     44    }
     45    return ts;
     46}
     47
    3448TextStream& operator<<(TextStream& ts, const FontTaggedSettings<float>& item)
    3549{
  • trunk/Source/WebCore/platform/graphics/FontTaggedSettings.h

    r278253 r291039  
    220220using FontVariationSettings = FontTaggedSettings<float>;
    221221
     222TextStream& operator<<(TextStream&, const FontTaggedSettings<int>&);
    222223TextStream& operator<<(TextStream&, const FontTaggedSettings<float>&);
    223224
  • trunk/Source/WebCore/rendering/style/RenderStyle.cpp

    r291037 r291039  
    20302030    auto description = fontDescription();
    20312031    description.setKerning(kerning);
     2032
     2033    setFontDescription(WTFMove(description));
     2034    fontCascade().update(currentFontSelector);
     2035}
     2036
     2037void RenderStyle::setFontFeatureSettings(FontFeatureSettings settings)
     2038{
     2039    FontSelector* currentFontSelector = fontCascade().fontSelector();
     2040    auto description = fontDescription();
     2041    description.setFeatureSettings(WTFMove(settings));
    20322042
    20332043    setFontDescription(WTFMove(description));
  • trunk/Source/WebCore/rendering/style/RenderStyle.h

    r291037 r291039  
    372372    FontPalette fontPalette() const { return fontDescription().fontPalette(); }
    373373    Kerning fontKerning() const { return fontDescription().kerning(); }
     374    FontFeatureSettings fontFeatureSettings() const { return fontDescription().featureSettings(); }
    374375
    375376    const Length& textIndent() const { return m_rareInheritedData->indent; }
     
    992993    void setFontPalette(FontPalette);
    993994    void setFontKerning(Kerning);
     995    void setFontFeatureSettings(FontFeatureSettings);
    994996
    995997    void setColor(const Color&);
Note: See TracChangeset for help on using the changeset viewer.