Title: [291104] trunk
Revision
291104
Author
grao...@webkit.org
Date
2022-03-10 04:50:00 -0800 (Thu, 10 Mar 2022)

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

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (291103 => 291104)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2022-03-10 12:44:52 UTC (rev 291103)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2022-03-10 12:50:00 UTC (rev 291104)
@@ -1,3 +1,17 @@
+2022-03-09  Antoine Quint  <grao...@webkit.org>
+
+        [web-animations] font-variant-alternates should support discrete animation
+        https://bugs.webkit.org/show_bug.cgi?id=237661
+
+        Reviewed by Myles C. Maxfield.
+
+        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:
+
 2022-03-10  Antoine Quint  <grao...@webkit.org>
 
         [web-animations] font-synthesis should support discrete animation

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-001-expected.txt (291103 => 291104)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-001-expected.txt	2022-03-10 12:44:52 UTC (rev 291103)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-001-expected.txt	2022-03-10 12:50:00 UTC (rev 291104)
@@ -254,6 +254,9 @@
 PASS font-synthesis (type: discrete) has testAccumulation function
 PASS font-synthesis: "weight style" onto "none"
 PASS font-synthesis: "none" onto "weight style"
+PASS font-variant-alternates (type: discrete) has testAccumulation function
+FAIL font-variant-alternates: "stylistic(unknown)" onto "swash(unknown)" assert_equals: The value should be stylistic(unknown) at 0ms expected "stylistic(unknown)" but got "normal"
+FAIL font-variant-alternates: "swash(unknown)" onto "stylistic(unknown)" assert_equals: The value should be swash(unknown) at 0ms expected "swash(unknown)" but got "normal"
 PASS font-variation-settings (type: fontVariationSettings) has testAccumulation function
 FAIL 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"
 PASS font-variation-settings (type: discrete) has testAccumulation function

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-001-expected.txt (291103 => 291104)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-001-expected.txt	2022-03-10 12:44:52 UTC (rev 291103)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-001-expected.txt	2022-03-10 12:50:00 UTC (rev 291104)
@@ -254,6 +254,9 @@
 PASS font-synthesis (type: discrete) has testAddition function
 PASS font-synthesis: "weight style" onto "none"
 PASS font-synthesis: "none" onto "weight style"
+PASS font-variant-alternates (type: discrete) has testAddition function
+FAIL font-variant-alternates: "stylistic(unknown)" onto "swash(unknown)" assert_equals: The value should be stylistic(unknown) at 0ms expected "stylistic(unknown)" but got "normal"
+FAIL font-variant-alternates: "swash(unknown)" onto "stylistic(unknown)" assert_equals: The value should be swash(unknown) at 0ms expected "swash(unknown)" but got "normal"
 PASS font-variation-settings (type: fontVariationSettings) has testAddition function
 FAIL 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"
 PASS font-variation-settings (type: discrete) has testAddition function

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-001-expected.txt (291103 => 291104)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-001-expected.txt	2022-03-10 12:44:52 UTC (rev 291103)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-001-expected.txt	2022-03-10 12:50:00 UTC (rev 291104)
@@ -309,6 +309,10 @@
 PASS font-synthesis uses discrete animation when animating between "none" and "weight style" with linear easing
 PASS font-synthesis uses discrete animation when animating between "none" and "weight style" with effect easing
 PASS font-synthesis uses discrete animation when animating between "none" and "weight style" with keyframe easing
+PASS font-variant-alternates (type: discrete) has testInterpolation function
+FAIL 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"
+FAIL 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"
+FAIL 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"
 PASS font-variation-settings (type: fontVariationSettings) has testInterpolation function
 PASS font-variation-settings supports animation as float
 PASS font-variation-settings supports animation as float with multiple tags

Modified: trunk/Source/WebCore/ChangeLog (291103 => 291104)


--- trunk/Source/WebCore/ChangeLog	2022-03-10 12:44:52 UTC (rev 291103)
+++ trunk/Source/WebCore/ChangeLog	2022-03-10 12:50:00 UTC (rev 291104)
@@ -1,3 +1,21 @@
+2022-03-09  Antoine Quint  <grao...@webkit.org>
+
+        [web-animations] font-variant-alternates should support discrete animation
+        https://bugs.webkit.org/show_bug.cgi?id=237661
+
+        Reviewed by Myles C. Maxfield.
+
+        * 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):
+
 2022-03-10  Antoine Quint  <grao...@webkit.org>
 
         [web-animations] font-synthesis should support discrete animation

Modified: trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp (291103 => 291104)


--- trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp	2022-03-10 12:44:52 UTC (rev 291103)
+++ trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp	2022-03-10 12:50:00 UTC (rev 291104)
@@ -2927,7 +2927,8 @@
         new CounterWrapper(CSSPropertyCounterIncrement),
         new CounterWrapper(CSSPropertyCounterReset),
         new DiscretePropertyWrapper<WindRule>(CSSPropertyFillRule, &RenderStyle::fillRule, &RenderStyle::setFillRule),
-        new DiscretePropertyWrapper<FontSynthesis>(CSSPropertyFontSynthesis, &RenderStyle::fontSynthesis, &RenderStyle::setFontSynthesis)
+        new DiscretePropertyWrapper<FontSynthesis>(CSSPropertyFontSynthesis, &RenderStyle::fontSynthesis, &RenderStyle::setFontSynthesis),
+        new DiscretePropertyWrapper<FontVariantAlternates>(CSSPropertyFontVariantAlternates, &RenderStyle::fontVariantAlternates, &RenderStyle::setFontVariantAlternates)
     };
     const unsigned animatableLonghandPropertiesCount = WTF_ARRAY_LENGTH(animatableLonghandPropertyWrappers);
 

Modified: trunk/Source/WebCore/platform/text/TextFlags.cpp (291103 => 291104)


--- trunk/Source/WebCore/platform/text/TextFlags.cpp	2022-03-10 12:44:52 UTC (rev 291103)
+++ trunk/Source/WebCore/platform/text/TextFlags.cpp	2022-03-10 12:50:00 UTC (rev 291104)
@@ -40,4 +40,13 @@
     return ts;
 }
 
+WTF::TextStream& operator<<(TextStream& ts, FontVariantAlternates alternates)
+{
+    switch (alternates) {
+    case FontVariantAlternates::Normal: ts << "normal"; break;
+    case FontVariantAlternates::HistoricalForms: ts << "historical-forms"; break;
+    }
+    return ts;
+}
+
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/text/TextFlags.h (291103 => 291104)


--- trunk/Source/WebCore/platform/text/TextFlags.h	2022-03-10 12:44:52 UTC (rev 291103)
+++ trunk/Source/WebCore/platform/text/TextFlags.h	2022-03-10 12:50:00 UTC (rev 291104)
@@ -118,6 +118,8 @@
 enum class FontVariantNumericSlashedZero : bool { Normal, Yes };
 enum class FontVariantAlternates : bool { Normal, HistoricalForms };
 
+WTF::TextStream& operator<<(WTF::TextStream&, FontVariantAlternates);
+
 enum class FontVariantEastAsianVariant : uint8_t {
     Normal,
     Jis78,

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.cpp (291103 => 291104)


--- trunk/Source/WebCore/rendering/style/RenderStyle.cpp	2022-03-10 12:44:52 UTC (rev 291103)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.cpp	2022-03-10 12:50:00 UTC (rev 291104)
@@ -2064,6 +2064,16 @@
     fontCascade().update(currentFontSelector);
 }
 
+void RenderStyle::setFontVariantAlternates(FontVariantAlternates value)
+{
+    FontSelector* currentFontSelector = fontCascade().fontSelector();
+    auto description = fontDescription();
+    description.setVariantAlternates(value);
+
+    setFontDescription(WTFMove(description));
+    fontCascade().update(currentFontSelector);
+}
+
 LayoutBoxExtent RenderStyle::shadowExtent(const ShadowData* shadow)
 {
     LayoutUnit top;

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (291103 => 291104)


--- trunk/Source/WebCore/rendering/style/RenderStyle.h	2022-03-10 12:44:52 UTC (rev 291103)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h	2022-03-10 12:50:00 UTC (rev 291104)
@@ -374,6 +374,7 @@
     FontFeatureSettings fontFeatureSettings() const { return fontDescription().featureSettings(); }
     RefCountedFixedVector<AtomString>& fontFamilies() const { return fontDescription().families(); }
     FontSynthesis fontSynthesis() const { return fontDescription().fontSynthesis(); }
+    FontVariantAlternates fontVariantAlternates() const { return fontDescription().variantAlternates(); }
 
     const Length& textIndent() const { return m_rareInheritedData->indent; }
     TextAlignMode textAlign() const { return static_cast<TextAlignMode>(m_inheritedFlags.textAlign); }
@@ -999,6 +1000,7 @@
     void setFontFeatureSettings(FontFeatureSettings);
     void setFontFamilies(RefCountedFixedVector<AtomString>&);
     void setFontSynthesis(FontSynthesis);
+    void setFontVariantAlternates(FontVariantAlternates);
 
     void setColor(const Color&);
     void setTextIndent(Length&& length) { SET_VAR(m_rareInheritedData, indent, WTFMove(length)); }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to