Diff
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (291038 => 291039)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2022-03-09 12:43:36 UTC (rev 291038)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2022-03-09 12:45:26 UTC (rev 291039)
@@ -1,5 +1,17 @@
2022-03-08 Antoine Quint <[email protected]>
+ [web-animations] font-feature-settings should support discrete animation
+ https://bugs.webkit.org/show_bug.cgi?id=237587
+
+ Reviewed by Antti Koivisto.
+
+ * 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-08 Antoine Quint <[email protected]>
+
[web-animations] font-kerning should supporting discrete animation
https://bugs.webkit.org/show_bug.cgi?id=237585
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt (291038 => 291039)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt 2022-03-09 12:43:36 UTC (rev 291038)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt 2022-03-09 12:45:26 UTC (rev 291039)
@@ -1,7 +1,7 @@
FAIL 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"]
FAIL Animation of font-family in ::marker assert_equals: expected "Ahem" but got "-webkit-standard"
-FAIL Animation of font-feature-settings in ::marker assert_equals: expected "\"smcp\"" but got "normal"
+PASS Animation of font-feature-settings in ::marker
PASS Animation of font-kerning in ::marker
PASS Animation of font-size in ::marker
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
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-001-expected.txt (291038 => 291039)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-001-expected.txt 2022-03-09 12:43:36 UTC (rev 291038)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-001-expected.txt 2022-03-09 12:45:26 UTC (rev 291039)
@@ -221,6 +221,9 @@
PASS float (type: discrete) has testAccumulation function
PASS float: "right" onto "left"
PASS float: "left" onto "right"
+PASS font-feature-settings (type: discrete) has testAccumulation function
+PASS font-feature-settings: "normal" onto ""liga" 5"
+PASS font-feature-settings: ""liga" 5" onto "normal"
PASS font-kerning (type: discrete) has testAccumulation function
PASS font-kerning: "normal" onto "auto"
PASS font-kerning: "auto" onto "normal"
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-001-expected.txt (291038 => 291039)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-001-expected.txt 2022-03-09 12:43:36 UTC (rev 291038)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-001-expected.txt 2022-03-09 12:45:26 UTC (rev 291039)
@@ -221,6 +221,9 @@
PASS float (type: discrete) has testAddition function
PASS float: "right" onto "left"
PASS float: "left" onto "right"
+PASS font-feature-settings (type: discrete) has testAddition function
+PASS font-feature-settings: "normal" onto ""liga" 5"
+PASS font-feature-settings: ""liga" 5" onto "normal"
PASS font-kerning (type: discrete) has testAddition function
PASS font-kerning: "normal" onto "auto"
PASS font-kerning: "auto" onto "normal"
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-001-expected.txt (291038 => 291039)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-001-expected.txt 2022-03-09 12:43:36 UTC (rev 291038)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-001-expected.txt 2022-03-09 12:45:26 UTC (rev 291039)
@@ -265,6 +265,10 @@
PASS float uses discrete animation when animating between "left" and "right" with linear easing
PASS float uses discrete animation when animating between "left" and "right" with effect easing
PASS float uses discrete animation when animating between "left" and "right" with keyframe easing
+PASS font-feature-settings (type: discrete) has testInterpolation function
+PASS font-feature-settings uses discrete animation when animating between ""liga" 5" and "normal" with linear easing
+PASS font-feature-settings uses discrete animation when animating between ""liga" 5" and "normal" with effect easing
+PASS font-feature-settings uses discrete animation when animating between ""liga" 5" and "normal" with keyframe easing
PASS font-kerning (type: discrete) has testInterpolation function
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
Modified: trunk/Source/WebCore/ChangeLog (291038 => 291039)
--- trunk/Source/WebCore/ChangeLog 2022-03-09 12:43:36 UTC (rev 291038)
+++ trunk/Source/WebCore/ChangeLog 2022-03-09 12:45:26 UTC (rev 291039)
@@ -1,5 +1,23 @@
2022-03-08 Antoine Quint <[email protected]>
+ [web-animations] font-feature-settings should support discrete animation
+ https://bugs.webkit.org/show_bug.cgi?id=237587
+
+ Reviewed by Antti Koivisto.
+
+ * 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):
+
+2022-03-08 Antoine Quint <[email protected]>
+
[web-animations] font-kerning should supporting discrete animation
https://bugs.webkit.org/show_bug.cgi?id=237585
Modified: trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp (291038 => 291039)
--- trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp 2022-03-09 12:43:36 UTC (rev 291038)
+++ trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp 2022-03-09 12:45:26 UTC (rev 291039)
@@ -2809,7 +2809,8 @@
new OffsetRotatePropertyWrapper(CSSPropertyOffsetRotate, &RenderStyle::offsetRotate, &RenderStyle::setOffsetRotate),
new DiscretePropertyWrapper<TextDecorationSkipInk>(CSSPropertyTextDecorationSkipInk, &RenderStyle::textDecorationSkipInk, &RenderStyle::setTextDecorationSkipInk),
new DiscretePropertyWrapper<ColorInterpolation>(CSSPropertyColorInterpolation, &RenderStyle::colorInterpolation, &RenderStyle::setColorInterpolation),
- new DiscretePropertyWrapper<Kerning>(CSSPropertyFontKerning, &RenderStyle::fontKerning, &RenderStyle::setFontKerning)
+ new DiscretePropertyWrapper<Kerning>(CSSPropertyFontKerning, &RenderStyle::fontKerning, &RenderStyle::setFontKerning),
+ new DiscretePropertyWrapper<FontFeatureSettings>(CSSPropertyFontFeatureSettings, &RenderStyle::fontFeatureSettings, &RenderStyle::setFontFeatureSettings)
};
const unsigned animatableLonghandPropertiesCount = WTF_ARRAY_LENGTH(animatableLonghandPropertyWrappers);
Modified: trunk/Source/WebCore/platform/graphics/FontTaggedSettings.cpp (291038 => 291039)
--- trunk/Source/WebCore/platform/graphics/FontTaggedSettings.cpp 2022-03-09 12:43:36 UTC (rev 291038)
+++ trunk/Source/WebCore/platform/graphics/FontTaggedSettings.cpp 2022-03-09 12:45:26 UTC (rev 291039)
@@ -31,6 +31,20 @@
namespace WebCore {
+TextStream& operator<<(TextStream& ts, const FontTaggedSettings<int>& item)
+{
+ for (unsigned i = 0; i < item.size(); ++i) {
+ auto& variation = item.at(i);
+ StringBuilder s;
+ s.append(variation.tag()[0]);
+ s.append(variation.tag()[1]);
+ s.append(variation.tag()[2]);
+ s.append(variation.tag()[3]);
+ ts.dumpProperty(s.toString(), item.at(i).value());
+ }
+ return ts;
+}
+
TextStream& operator<<(TextStream& ts, const FontTaggedSettings<float>& item)
{
for (unsigned i = 0; i < item.size(); ++i) {
Modified: trunk/Source/WebCore/platform/graphics/FontTaggedSettings.h (291038 => 291039)
--- trunk/Source/WebCore/platform/graphics/FontTaggedSettings.h 2022-03-09 12:43:36 UTC (rev 291038)
+++ trunk/Source/WebCore/platform/graphics/FontTaggedSettings.h 2022-03-09 12:45:26 UTC (rev 291039)
@@ -219,6 +219,7 @@
using FontFeatureSettings = FontTaggedSettings<int>;
using FontVariationSettings = FontTaggedSettings<float>;
+TextStream& operator<<(TextStream&, const FontTaggedSettings<int>&);
TextStream& operator<<(TextStream&, const FontTaggedSettings<float>&);
}
Modified: trunk/Source/WebCore/rendering/style/RenderStyle.cpp (291038 => 291039)
--- trunk/Source/WebCore/rendering/style/RenderStyle.cpp 2022-03-09 12:43:36 UTC (rev 291038)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.cpp 2022-03-09 12:45:26 UTC (rev 291039)
@@ -2034,6 +2034,16 @@
fontCascade().update(currentFontSelector);
}
+void RenderStyle::setFontFeatureSettings(FontFeatureSettings settings)
+{
+ FontSelector* currentFontSelector = fontCascade().fontSelector();
+ auto description = fontDescription();
+ description.setFeatureSettings(WTFMove(settings));
+
+ setFontDescription(WTFMove(description));
+ fontCascade().update(currentFontSelector);
+}
+
LayoutBoxExtent RenderStyle::shadowExtent(const ShadowData* shadow)
{
LayoutUnit top;
Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (291038 => 291039)
--- trunk/Source/WebCore/rendering/style/RenderStyle.h 2022-03-09 12:43:36 UTC (rev 291038)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h 2022-03-09 12:45:26 UTC (rev 291039)
@@ -371,6 +371,7 @@
std::optional<FontSelectionValue> fontItalic() const { return fontDescription().italic(); }
FontPalette fontPalette() const { return fontDescription().fontPalette(); }
Kerning fontKerning() const { return fontDescription().kerning(); }
+ FontFeatureSettings fontFeatureSettings() const { return fontDescription().featureSettings(); }
const Length& textIndent() const { return m_rareInheritedData->indent; }
TextAlignMode textAlign() const { return static_cast<TextAlignMode>(m_inheritedFlags.textAlign); }
@@ -991,6 +992,7 @@
void setFontItalic(std::optional<FontSelectionValue>);
void setFontPalette(FontPalette);
void setFontKerning(Kerning);
+ void setFontFeatureSettings(FontFeatureSettings);
void setColor(const Color&);
void setTextIndent(Length&& length) { SET_VAR(m_rareInheritedData, indent, WTFMove(length)); }