Title: [291103] trunk
Revision
291103
Author
[email protected]
Date
2022-03-10 04:44:52 -0800 (Thu, 10 Mar 2022)

Log Message

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

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):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::setFontFamilies):
(WebCore::RenderStyle::setFontSynthesis):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::fontSynthesis const):

Modified Paths

Diff

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


--- trunk/LayoutTests/imported/w3c/ChangeLog	2022-03-10 12:04:51 UTC (rev 291102)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2022-03-10 12:44:52 UTC (rev 291103)
@@ -1,3 +1,15 @@
+2022-03-10  Antoine Quint  <[email protected]>
+
+        [web-animations] font-synthesis should support discrete animation
+        https://bugs.webkit.org/show_bug.cgi?id=237650
+
+        Reviewed by Myles C. Maxfield.
+
+        * 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:
+
 2022-03-09  Antoine Quint  <[email protected]>
 
         [web-animations] fill-rule should support discrete animation

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt (291102 => 291103)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt	2022-03-10 12:04:51 UTC (rev 291102)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt	2022-03-10 12:44:52 UTC (rev 291103)
@@ -7,7 +7,7 @@
 FAIL Animation of font-size-adjust in ::marker assert_true: font-size-adjust doesn't seem to be supported in the computed style expected true got false
 PASS Animation of font-stretch in ::marker
 PASS Animation of font-style in ::marker
-FAIL Animation of font-synthesis in ::marker assert_equals: expected "none" but got "weight style small-caps"
+PASS Animation of font-synthesis in ::marker
 FAIL Animation of font-synthesis-small-caps in ::marker assert_true: font-synthesis-small-caps doesn't seem to be supported in the computed style expected true got false
 FAIL Animation of font-synthesis-style in ::marker assert_true: font-synthesis-style doesn't seem to be supported in the computed style expected true got false
 FAIL Animation of font-synthesis-weight in ::marker assert_true: font-synthesis-weight doesn't seem to be supported in the computed style expected true got false

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


--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-001-expected.txt	2022-03-10 12:04:51 UTC (rev 291102)
+++ 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)
@@ -251,6 +251,9 @@
 PASS font-kerning (type: discrete) has testAccumulation function
 PASS font-kerning: "normal" onto "auto"
 PASS font-kerning: "auto" onto "normal"
+PASS font-synthesis (type: discrete) has testAccumulation function
+PASS font-synthesis: "weight style" onto "none"
+PASS font-synthesis: "none" onto "weight style"
 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 (291102 => 291103)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-001-expected.txt	2022-03-10 12:04:51 UTC (rev 291102)
+++ 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)
@@ -251,6 +251,9 @@
 PASS font-kerning (type: discrete) has testAddition function
 PASS font-kerning: "normal" onto "auto"
 PASS font-kerning: "auto" onto "normal"
+PASS font-synthesis (type: discrete) has testAddition function
+PASS font-synthesis: "weight style" onto "none"
+PASS font-synthesis: "none" onto "weight style"
 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 (291102 => 291103)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-001-expected.txt	2022-03-10 12:04:51 UTC (rev 291102)
+++ 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)
@@ -305,6 +305,10 @@
 PASS font-kerning uses discrete animation when animating between "auto" and "normal" with linear easing
 PASS font-kerning uses discrete animation when animating between "auto" and "normal" with effect easing
 PASS font-kerning uses discrete animation when animating between "auto" and "normal" with keyframe easing
+PASS font-synthesis (type: discrete) has testInterpolation function
+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-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 (291102 => 291103)


--- trunk/Source/WebCore/ChangeLog	2022-03-10 12:04:51 UTC (rev 291102)
+++ trunk/Source/WebCore/ChangeLog	2022-03-10 12:44:52 UTC (rev 291103)
@@ -1,3 +1,18 @@
+2022-03-10  Antoine Quint  <[email protected]>
+
+        [web-animations] font-synthesis should support discrete animation
+        https://bugs.webkit.org/show_bug.cgi?id=237650
+
+        Reviewed by Myles C. Maxfield.
+
+        * animation/CSSPropertyAnimation.cpp:
+        (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
+        * rendering/style/RenderStyle.cpp:
+        (WebCore::RenderStyle::setFontFamilies):
+        (WebCore::RenderStyle::setFontSynthesis):
+        * rendering/style/RenderStyle.h:
+        (WebCore::RenderStyle::fontSynthesis const):
+
 2022-03-10  Enrique Ocaña González  <[email protected]>
 
         [MSE][SourceBuffer] Fix creating float PTS/DTS when dividing sample

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


--- trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp	2022-03-10 12:04:51 UTC (rev 291102)
+++ trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp	2022-03-10 12:44:52 UTC (rev 291103)
@@ -2926,7 +2926,8 @@
         new DiscretePropertyWrapper<DominantBaseline>(CSSPropertyDominantBaseline, &RenderStyle::dominantBaseline, &RenderStyle::setDominantBaseline),
         new CounterWrapper(CSSPropertyCounterIncrement),
         new CounterWrapper(CSSPropertyCounterReset),
-        new DiscretePropertyWrapper<WindRule>(CSSPropertyFillRule, &RenderStyle::fillRule, &RenderStyle::setFillRule)
+        new DiscretePropertyWrapper<WindRule>(CSSPropertyFillRule, &RenderStyle::fillRule, &RenderStyle::setFillRule),
+        new DiscretePropertyWrapper<FontSynthesis>(CSSPropertyFontSynthesis, &RenderStyle::fontSynthesis, &RenderStyle::setFontSynthesis)
     };
     const unsigned animatableLonghandPropertiesCount = WTF_ARRAY_LENGTH(animatableLonghandPropertyWrappers);
 

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


--- trunk/Source/WebCore/rendering/style/RenderStyle.cpp	2022-03-10 12:04:51 UTC (rev 291102)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.cpp	2022-03-10 12:44:52 UTC (rev 291103)
@@ -2054,6 +2054,16 @@
     fontCascade().update(currentFontSelector);
 }
 
+void RenderStyle::setFontSynthesis(FontSynthesis value)
+{
+    FontSelector* currentFontSelector = fontCascade().fontSelector();
+    auto description = fontDescription();
+    description.setFontSynthesis(value);
+
+    setFontDescription(WTFMove(description));
+    fontCascade().update(currentFontSelector);
+}
+
 LayoutBoxExtent RenderStyle::shadowExtent(const ShadowData* shadow)
 {
     LayoutUnit top;

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


--- trunk/Source/WebCore/rendering/style/RenderStyle.h	2022-03-10 12:04:51 UTC (rev 291102)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h	2022-03-10 12:44:52 UTC (rev 291103)
@@ -373,6 +373,7 @@
     Kerning fontKerning() const { return fontDescription().kerning(); }
     FontFeatureSettings fontFeatureSettings() const { return fontDescription().featureSettings(); }
     RefCountedFixedVector<AtomString>& fontFamilies() const { return fontDescription().families(); }
+    FontSynthesis fontSynthesis() const { return fontDescription().fontSynthesis(); }
 
     const Length& textIndent() const { return m_rareInheritedData->indent; }
     TextAlignMode textAlign() const { return static_cast<TextAlignMode>(m_inheritedFlags.textAlign); }
@@ -997,6 +998,7 @@
     void setFontKerning(Kerning);
     void setFontFeatureSettings(FontFeatureSettings);
     void setFontFamilies(RefCountedFixedVector<AtomString>&);
+    void setFontSynthesis(FontSynthesis);
 
     void setColor(const Color&);
     void setTextIndent(Length&& length) { SET_VAR(m_rareInheritedData, indent, WTFMove(length)); }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to