Changeset 291114 in webkit


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

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

Reviewed by Myles C. Maxfield.

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):

Location:
trunk
Files:
7 edited

Legend:

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

    r291109 r291114  
     12022-03-10  Antoine Quint  <graouts@webkit.org>
     2
     3        [web-animations] font-variant-ligatures should support discrete animation
     4        https://bugs.webkit.org/show_bug.cgi?id=237667
     5
     6        Reviewed by Myles C. Maxfield.
     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-10  Antoine Quint  <graouts@webkit.org>
    214
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt

    r291109 r291114  
    1515FAIL Animation of font-variant-caps in ::marker assert_equals: expected "small-caps" but got "normal"
    1616PASS Animation of font-variant-east-asian in ::marker
    17 FAIL Animation of font-variant-ligatures in ::marker assert_equals: expected "historical-ligatures" but got "normal"
     17PASS Animation of font-variant-ligatures in ::marker
    1818FAIL Animation of font-variant-numeric in ::marker assert_equals: expected "slashed-zero" but got "tabular-nums"
    1919FAIL Animation of font-variant-position in ::marker assert_equals: expected "sub" but got "normal"
  • trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-001-expected.txt

    r291109 r291114  
    261261PASS font-variant-east-asian: "proportional-width" onto "full-width"
    262262PASS font-variant-east-asian: "full-width" onto "proportional-width"
     263PASS font-variant-ligatures (type: discrete) has testAccumulation function
     264PASS font-variant-ligatures: "no-common-ligatures" onto "common-ligatures"
     265PASS font-variant-ligatures: "common-ligatures" onto "no-common-ligatures"
    263266PASS font-variation-settings (type: fontVariationSettings) has testAccumulation function
    264267FAIL 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

    r291109 r291114  
    261261PASS font-variant-east-asian: "proportional-width" onto "full-width"
    262262PASS font-variant-east-asian: "full-width" onto "proportional-width"
     263PASS font-variant-ligatures (type: discrete) has testAddition function
     264PASS font-variant-ligatures: "no-common-ligatures" onto "common-ligatures"
     265PASS font-variant-ligatures: "common-ligatures" onto "no-common-ligatures"
    263266PASS font-variation-settings (type: fontVariationSettings) has testAddition function
    264267FAIL 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

    r291109 r291114  
    318318PASS font-variant-east-asian uses discrete animation when animating between "full-width" and "proportional-width" with effect easing
    319319PASS font-variant-east-asian uses discrete animation when animating between "full-width" and "proportional-width" with keyframe easing
     320PASS font-variant-ligatures (type: discrete) has testInterpolation function
     321PASS font-variant-ligatures uses discrete animation when animating between "common-ligatures" and "no-common-ligatures" with linear easing
     322PASS font-variant-ligatures uses discrete animation when animating between "common-ligatures" and "no-common-ligatures" with effect easing
     323PASS font-variant-ligatures uses discrete animation when animating between "common-ligatures" and "no-common-ligatures" with keyframe easing
    320324PASS font-variation-settings (type: fontVariationSettings) has testInterpolation function
    321325PASS font-variation-settings supports animation as float
  • trunk/Source/WebCore/ChangeLog

    r291113 r291114  
     12022-03-10  Antoine Quint  <graouts@webkit.org>
     2
     3        [web-animations] font-variant-ligatures should support discrete animation
     4        https://bugs.webkit.org/show_bug.cgi?id=237667
     5
     6        Reviewed by Myles C. Maxfield.
     7
     8        * animation/CSSPropertyAnimation.cpp:
     9        (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
     10
    1112022-03-10  Lauro Moura  <lmoura@igalia.com>
    212
  • trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp

    r291109 r291114  
    26232623        description.setVariantEastAsianWidth(sourceFontDescription.variantEastAsianWidth());
    26242624        description.setVariantEastAsianRuby(sourceFontDescription.variantEastAsianRuby());
     2625        destination.setFontDescription(WTFMove(description));
     2626        destination.fontCascade().update(currentFontSelector);
     2627    }
     2628
     2629#if !LOG_DISABLED
     2630    void logBlend(const RenderStyle&, const RenderStyle&, const RenderStyle&, double) const override
     2631    {
     2632    }
     2633#endif
     2634};
     2635
     2636class FontVariantLigaturesWrapper final : public AnimationPropertyWrapperBase {
     2637    WTF_MAKE_FAST_ALLOCATED;
     2638public:
     2639    FontVariantLigaturesWrapper()
     2640        : AnimationPropertyWrapperBase(CSSPropertyFontVariantLigatures)
     2641    {
     2642    }
     2643
     2644private:
     2645    bool canInterpolate(const RenderStyle&, const RenderStyle&, CompositeOperation) const override { return false; }
     2646
     2647    bool equals(const RenderStyle& a, const RenderStyle& b) const override
     2648    {
     2649        auto& aFontDescription = a.fontDescription();
     2650        auto& bFontDescription = b.fontDescription();
     2651        return aFontDescription.variantCommonLigatures() == bFontDescription.variantCommonLigatures()
     2652            && aFontDescription.variantDiscretionaryLigatures() == bFontDescription.variantDiscretionaryLigatures()
     2653            && aFontDescription.variantHistoricalLigatures() == bFontDescription.variantHistoricalLigatures()
     2654            && aFontDescription.variantContextualAlternates() == bFontDescription.variantContextualAlternates();
     2655    }
     2656
     2657    void blend(RenderStyle& destination, const RenderStyle& from, const RenderStyle& to, const CSSPropertyBlendingContext& context) const override
     2658    {
     2659        ASSERT(!context.progress || context.progress == 1.0);
     2660        auto& sourceFontDescription = (context.progress ? to : from).fontDescription();
     2661
     2662        FontSelector* currentFontSelector = destination.fontCascade().fontSelector();
     2663        auto description = destination.fontDescription();
     2664        description.setVariantCommonLigatures(sourceFontDescription.variantCommonLigatures());
     2665        description.setVariantDiscretionaryLigatures(sourceFontDescription.variantDiscretionaryLigatures());
     2666        description.setVariantHistoricalLigatures(sourceFontDescription.variantHistoricalLigatures());
     2667        description.setVariantContextualAlternates(sourceFontDescription.variantContextualAlternates());
    26252668        destination.setFontDescription(WTFMove(description));
    26262669        destination.fontCascade().update(currentFontSelector);
     
    29713014        new DiscretePropertyWrapper<FontSynthesis>(CSSPropertyFontSynthesis, &RenderStyle::fontSynthesis, &RenderStyle::setFontSynthesis),
    29723015        new DiscretePropertyWrapper<FontVariantAlternates>(CSSPropertyFontVariantAlternates, &RenderStyle::fontVariantAlternates, &RenderStyle::setFontVariantAlternates),
    2973         new FontVariantEastAsianWrapper
     3016        new FontVariantEastAsianWrapper,
     3017        new FontVariantLigaturesWrapper
    29743018    };
    29753019    const unsigned animatableLonghandPropertiesCount = WTF_ARRAY_LENGTH(animatableLonghandPropertyWrappers);
Note: See TracChangeset for help on using the changeset viewer.