Title: [291037] trunk
Revision
291037
Author
grao...@webkit.org
Date
2022-03-09 04:37:00 -0800 (Wed, 09 Mar 2022)

Log Message

[web-animations] font-kerning should supporting discrete animation
https://bugs.webkit.org/show_bug.cgi?id=237585

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

* web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-expected.txt:
* 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:

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* platform/text/TextFlags.cpp: Added.
(WebCore::operator<<):
* platform/text/TextFlags.h:
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::setFontPalette):
(WebCore::RenderStyle::setFontKerning):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::fontKerning const):
* style/PropertyAllowlist.cpp:
(WebCore::Style::isValidMarkerStyleProperty):

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (291036 => 291037)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2022-03-09 11:38:19 UTC (rev 291036)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2022-03-09 12:37:00 UTC (rev 291037)
@@ -1,3 +1,16 @@
+2022-03-08  Antoine Quint  <grao...@webkit.org>
+
+        [web-animations] font-kerning should supporting discrete animation
+        https://bugs.webkit.org/show_bug.cgi?id=237585
+
+        Reviewed by Antti Koivisto.
+
+        * web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-expected.txt:
+        * 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  Antti Koivisto  <an...@apple.com>
 
         [CSS Container Queries] Import updated WPTs

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


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-expected.txt	2022-03-09 11:38:19 UTC (rev 291036)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-expected.txt	2022-03-09 12:37:00 UTC (rev 291037)
@@ -2,7 +2,7 @@
 PASS Property font value 'italic small-caps 900 expanded 25px / 50px Ahem' in ::marker
 PASS Property font-family value 'Ahem' in ::marker
 PASS Property font-feature-settings value '"smcp"' in ::marker
-FAIL Property font-kerning value 'none' in ::marker assert_equals: expected "none" but got "auto"
+PASS Property font-kerning value 'none' in ::marker
 PASS Property font-size value '25px' in ::marker
 FAIL Property font-size-adjust value '1' in ::marker assert_true: font-size-adjust doesn't seem to be supported in the computed style expected true got false
 PASS Property font-stretch value 'expanded' in ::marker

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


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt	2022-03-09 11:38:19 UTC (rev 291036)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt	2022-03-09 12:37:00 UTC (rev 291037)
@@ -2,7 +2,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"
-FAIL Animation of font-kerning in ::marker assert_equals: expected "none" but got "auto"
+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
 PASS Animation of font-stretch in ::marker
@@ -49,7 +49,7 @@
 PASS Transition of font in ::marker
 PASS Transition of font-family in ::marker
 PASS Transition of font-feature-settings in ::marker
-FAIL Transition of font-kerning in ::marker assert_equals: expected "none" but got "auto"
+PASS Transition of font-kerning in ::marker
 PASS Transition of font-size in ::marker
 FAIL Transition 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 Transition of font-stretch in ::marker

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


--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-001-expected.txt	2022-03-09 11:38:19 UTC (rev 291036)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-001-expected.txt	2022-03-09 12:37:00 UTC (rev 291037)
@@ -221,6 +221,9 @@
 PASS float (type: discrete) has testAccumulation function
 PASS float: "right" onto "left"
 PASS float: "left" onto "right"
+PASS font-kerning (type: discrete) has testAccumulation function
+PASS font-kerning: "normal" onto "auto"
+PASS font-kerning: "auto" onto "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 (291036 => 291037)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-001-expected.txt	2022-03-09 11:38:19 UTC (rev 291036)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-001-expected.txt	2022-03-09 12:37:00 UTC (rev 291037)
@@ -221,6 +221,9 @@
 PASS float (type: discrete) has testAddition function
 PASS float: "right" onto "left"
 PASS float: "left" onto "right"
+PASS font-kerning (type: discrete) has testAddition function
+PASS font-kerning: "normal" onto "auto"
+PASS font-kerning: "auto" onto "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 (291036 => 291037)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-001-expected.txt	2022-03-09 11:38:19 UTC (rev 291036)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-001-expected.txt	2022-03-09 12:37:00 UTC (rev 291037)
@@ -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-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
+PASS font-kerning uses discrete animation when animating between "auto" and "normal" 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 (291036 => 291037)


--- trunk/Source/WebCore/ChangeLog	2022-03-09 11:38:19 UTC (rev 291036)
+++ trunk/Source/WebCore/ChangeLog	2022-03-09 12:37:00 UTC (rev 291037)
@@ -1,3 +1,25 @@
+2022-03-08  Antoine Quint  <grao...@webkit.org>
+
+        [web-animations] font-kerning should supporting discrete animation
+        https://bugs.webkit.org/show_bug.cgi?id=237585
+
+        Reviewed by Antti Koivisto.
+
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * animation/CSSPropertyAnimation.cpp:
+        (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
+        * platform/text/TextFlags.cpp: Added.
+        (WebCore::operator<<):
+        * platform/text/TextFlags.h:
+        * rendering/style/RenderStyle.cpp:
+        (WebCore::RenderStyle::setFontPalette):
+        (WebCore::RenderStyle::setFontKerning):
+        * rendering/style/RenderStyle.h:
+        (WebCore::RenderStyle::fontKerning const):
+        * style/PropertyAllowlist.cpp:
+        (WebCore::Style::isValidMarkerStyleProperty):
+
 2022-03-09  Kimmo Kinnunen  <kkinnu...@apple.com>
 
         GraphicsContextGLCocoa manages EGL native displays manually

Modified: trunk/Source/WebCore/Sources.txt (291036 => 291037)


--- trunk/Source/WebCore/Sources.txt	2022-03-09 11:38:19 UTC (rev 291036)
+++ trunk/Source/WebCore/Sources.txt	2022-03-09 12:37:00 UTC (rev 291037)
@@ -2263,6 +2263,7 @@
 platform/text/QuotedPrintable.cpp
 platform/text/SegmentedString.cpp
 platform/text/TextBoundaries.cpp
+platform/text/TextFlags.cpp
 platform/xr/openxr/OpenXRInput.cpp
 platform/xr/openxr/OpenXRInputSource.cpp
 platform/xr/openxr/OpenXRInstance.cpp

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (291036 => 291037)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2022-03-09 11:38:19 UTC (rev 291036)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2022-03-09 12:37:00 UTC (rev 291037)
@@ -1243,6 +1243,7 @@
 		4358E87D1360A2EE00E4748C /* JSSVGFEDropShadowElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 4358E87B1360A2EE00E4748C /* JSSVGFEDropShadowElement.h */; };
 		4358E8811360A31700E4748C /* FEDropShadow.h in Headers */ = {isa = PBXBuildFile; fileRef = 4358E87F1360A31700E4748C /* FEDropShadow.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		4358E8861360A33B00E4748C /* SVGFEDropShadowElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 4358E8831360A33B00E4748C /* SVGFEDropShadowElement.h */; };
+		436707E724C9CA4B10044234 /* RenderSVGTransformableContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = 436718BB12D9CA4B00042234 /* RenderSVGTransformableContainer.h */; };
 		436708C112D9CA4B00044234 /* RenderSVGBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = 4367088212D9CA4A00044234 /* RenderSVGBlock.h */; };
 		436708C312D9CA4B00044234 /* LegacyRenderSVGContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = 4367088412D9CA4A00044234 /* LegacyRenderSVGContainer.h */; };
 		436708C433F8CA4C10044234 /* RenderSVGContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = 4367077412D9BC4A00044234 /* RenderSVGContainer.h */; };
@@ -1264,7 +1265,6 @@
 		436708E312D9CA4B00044234 /* RenderSVGResourceSolidColor.h in Headers */ = {isa = PBXBuildFile; fileRef = 436708A412D9CA4B00044234 /* RenderSVGResourceSolidColor.h */; };
 		436708E512D9CA4B00044234 /* LegacyRenderSVGRoot.h in Headers */ = {isa = PBXBuildFile; fileRef = 436708A612D9CA4B00044234 /* LegacyRenderSVGRoot.h */; };
 		436708E512D9DB4B00044234 /* RenderSVGRoot.h in Headers */ = {isa = PBXBuildFile; fileRef = 436708A612D9DB4B00044234 /* RenderSVGRoot.h */; };
-		436707E724C9CA4B10044234 /* RenderSVGTransformableContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = 436718BB12D9CA4B00042234 /* RenderSVGTransformableContainer.h */; };
 		436708E912D9CA4B00044234 /* LegacyRenderSVGTransformableContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = 436708AA12D9CA4B00044234 /* LegacyRenderSVGTransformableContainer.h */; };
 		436708EB12D9CA4B00044234 /* RenderSVGViewportContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = 436708AC12D9CA4B00044234 /* RenderSVGViewportContainer.h */; };
 		436708EE12D9CA4B00044234 /* SVGMarkerData.h in Headers */ = {isa = PBXBuildFile; fileRef = 436708AF12D9CA4B00044234 /* SVGMarkerData.h */; };
@@ -9098,9 +9098,7 @@
 		436708A512D9CA5C00044234 /* RenderSVGRoot.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGRoot.cpp; sourceTree = "<group>"; };
 		436708A612D9CA4B00044234 /* LegacyRenderSVGRoot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyRenderSVGRoot.h; sourceTree = "<group>"; };
 		436708A612D9DB4B00044234 /* RenderSVGRoot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGRoot.h; sourceTree = "<group>"; };
-		436708B812C9CA4C00011434 /* RenderSVGTransformableContainer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGTransformableContainer.cpp; sourceTree = "<group>"; };
 		436708A912D9CA4B00044234 /* LegacyRenderSVGTransformableContainer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LegacyRenderSVGTransformableContainer.cpp; sourceTree = "<group>"; };
-		436718BB12D9CA4B00042234 /* RenderSVGTransformableContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGTransformableContainer.h; sourceTree = "<group>"; };
 		436708AA12D9CA4B00044234 /* LegacyRenderSVGTransformableContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyRenderSVGTransformableContainer.h; sourceTree = "<group>"; };
 		436708AB12D9CA4B00044234 /* RenderSVGViewportContainer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGViewportContainer.cpp; sourceTree = "<group>"; };
 		436708AC12D9CA4B00044234 /* RenderSVGViewportContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGViewportContainer.h; sourceTree = "<group>"; };
@@ -9111,11 +9109,13 @@
 		436708B512D9CA4B00044234 /* SVGRenderTreeAsText.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGRenderTreeAsText.h; sourceTree = "<group>"; };
 		436708B612D9CA4B00044234 /* SVGResources.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGResources.cpp; sourceTree = "<group>"; };
 		436708B712D9CA4B00044234 /* SVGResources.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGResources.h; sourceTree = "<group>"; };
+		436708B812C9CA4C00011434 /* RenderSVGTransformableContainer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGTransformableContainer.cpp; sourceTree = "<group>"; };
 		436708B812D9CA4B00044234 /* SVGResourcesCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGResourcesCache.cpp; sourceTree = "<group>"; };
 		436708B912D9CA4B00044234 /* SVGResourcesCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGResourcesCache.h; sourceTree = "<group>"; };
 		436708BA12D9CA4B00044234 /* SVGResourcesCycleSolver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGResourcesCycleSolver.cpp; sourceTree = "<group>"; };
 		436708BB12D9CA4B00044234 /* SVGResourcesCycleSolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGResourcesCycleSolver.h; sourceTree = "<group>"; };
 		436708FD12D9CA4A00032114 /* RenderSVGModelObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGModelObject.h; sourceTree = "<group>"; };
+		436718BB12D9CA4B00042234 /* RenderSVGTransformableContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGTransformableContainer.h; sourceTree = "<group>"; };
 		439046C312DA25E800AF80A2 /* RenderMathMLBlock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMathMLBlock.cpp; sourceTree = "<group>"; };
 		439046C412DA25E800AF80A2 /* RenderMathMLBlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMathMLBlock.h; sourceTree = "<group>"; };
 		439046C512DA25E800AF80A2 /* RenderMathMLFenced.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMathMLFenced.cpp; sourceTree = "<group>"; };
@@ -11298,6 +11298,7 @@
 		71D474A22462E834002F0106 /* PlayCircle.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = PlayCircle.pdf; sourceTree = "<group>"; };
 		71D474A32462E834002F0106 /* InvalidCircle.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = InvalidCircle.pdf; sourceTree = "<group>"; };
 		71D474A42462E834002F0106 /* spinnerspr...@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "spinnerspr...@2x.png"; sourceTree = "<group>"; };
+		71D475A627D741FC00644599 /* TextFlags.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextFlags.cpp; sourceTree = "<group>"; };
 		71D6AA711DA4EAF700B23969 /* airplay-plac...@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "airplay-plac...@1x.png"; sourceTree = "<group>"; };
 		71D6AA721DA4EAF700B23969 /* airplay-plac...@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "airplay-plac...@2x.png"; sourceTree = "<group>"; };
 		71D6AA731DA4EAF700B23969 /* airplay-plac...@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "airplay-plac...@3x.png"; sourceTree = "<group>"; };
@@ -29246,6 +29247,7 @@
 				C105DA610F3AA68F001DD44F /* TextEncodingDetectorICU.cpp */,
 				B2C3DA180D006C1D00EF6F26 /* TextEncodingRegistry.cpp */,
 				B2C3DA190D006C1D00EF6F26 /* TextEncodingRegistry.h */,
+				71D475A627D741FC00644599 /* TextFlags.cpp */,
 				B2C3DA150D006C1D00EF6F26 /* TextFlags.h */,
 				A863E2001343412000274926 /* UnicodeBidi.h */,
 				14476AA715DC4BB100305DB2 /* WritingMode.h */,

Modified: trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp (291036 => 291037)


--- trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp	2022-03-09 11:38:19 UTC (rev 291036)
+++ trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp	2022-03-09 12:37:00 UTC (rev 291037)
@@ -2808,7 +2808,8 @@
         new PropertyWrapperContent,
         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<ColorInterpolation>(CSSPropertyColorInterpolation, &RenderStyle::colorInterpolation, &RenderStyle::setColorInterpolation),
+        new DiscretePropertyWrapper<Kerning>(CSSPropertyFontKerning, &RenderStyle::fontKerning, &RenderStyle::setFontKerning)
     };
     const unsigned animatableLonghandPropertiesCount = WTF_ARRAY_LENGTH(animatableLonghandPropertyWrappers);
 

Added: trunk/Source/WebCore/platform/text/TextFlags.cpp (0 => 291037)


--- trunk/Source/WebCore/platform/text/TextFlags.cpp	                        (rev 0)
+++ trunk/Source/WebCore/platform/text/TextFlags.cpp	2022-03-09 12:37:00 UTC (rev 291037)
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2022 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "TextFlags.h"
+
+#include <wtf/text/TextStream.h>
+
+namespace WebCore {
+
+WTF::TextStream& operator<<(TextStream& ts, Kerning kerning)
+{
+    switch (kerning) {
+    case Kerning::Auto: ts << "auto"; break;
+    case Kerning::Normal: ts << "normal"; break;
+    case Kerning::NoShift: ts << "no-shift"; break;
+    }
+    return ts;
+}
+
+} // namespace WebCore

Modified: trunk/Source/WebCore/platform/text/TextFlags.h (291036 => 291037)


--- trunk/Source/WebCore/platform/text/TextFlags.h	2022-03-09 11:38:19 UTC (rev 291036)
+++ trunk/Source/WebCore/platform/text/TextFlags.h	2022-03-09 12:37:00 UTC (rev 291037)
@@ -28,6 +28,10 @@
 #include <optional>
 #include <wtf/EnumTraits.h>
 
+namespace WTF {
+class TextStream;
+}
+
 namespace WebCore {
 
 enum class TextRenderingMode : uint8_t {
@@ -580,6 +584,8 @@
     NoShift
 };
 
+WTF::TextStream& operator<<(WTF::TextStream&, Kerning);
+
 enum class FontOpticalSizing : uint8_t {
     Enabled,
     Disabled

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.cpp (291036 => 291037)


--- trunk/Source/WebCore/rendering/style/RenderStyle.cpp	2022-03-09 11:38:19 UTC (rev 291036)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.cpp	2022-03-09 12:37:00 UTC (rev 291037)
@@ -2024,6 +2024,16 @@
     fontCascade().update(currentFontSelector);
 }
 
+void RenderStyle::setFontKerning(Kerning kerning)
+{
+    FontSelector* currentFontSelector = fontCascade().fontSelector();
+    auto description = fontDescription();
+    description.setKerning(kerning);
+
+    setFontDescription(WTFMove(description));
+    fontCascade().update(currentFontSelector);
+}
+
 LayoutBoxExtent RenderStyle::shadowExtent(const ShadowData* shadow)
 {
     LayoutUnit top;

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (291036 => 291037)


--- trunk/Source/WebCore/rendering/style/RenderStyle.h	2022-03-09 11:38:19 UTC (rev 291036)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h	2022-03-09 12:37:00 UTC (rev 291037)
@@ -370,6 +370,7 @@
     FontSelectionValue fontStretch() const { return fontDescription().stretch(); }
     std::optional<FontSelectionValue> fontItalic() const { return fontDescription().italic(); }
     FontPalette fontPalette() const { return fontDescription().fontPalette(); }
+    Kerning fontKerning() const { return fontDescription().kerning(); }
 
     const Length& textIndent() const { return m_rareInheritedData->indent; }
     TextAlignMode textAlign() const { return static_cast<TextAlignMode>(m_inheritedFlags.textAlign); }
@@ -989,6 +990,7 @@
     void setFontStretch(FontSelectionValue);
     void setFontItalic(std::optional<FontSelectionValue>);
     void setFontPalette(FontPalette);
+    void setFontKerning(Kerning);
 
     void setColor(const Color&);
     void setTextIndent(Length&& length) { SET_VAR(m_rareInheritedData, indent, WTFMove(length)); }

Modified: trunk/Source/WebCore/style/PropertyAllowlist.cpp (291036 => 291037)


--- trunk/Source/WebCore/style/PropertyAllowlist.cpp	2022-03-09 11:38:19 UTC (rev 291036)
+++ trunk/Source/WebCore/style/PropertyAllowlist.cpp	2022-03-09 12:37:00 UTC (rev 291037)
@@ -47,6 +47,7 @@
     case CSSPropertyFont:
     case CSSPropertyFontFamily:
     case CSSPropertyFontFeatureSettings:
+    case CSSPropertyFontKerning:
     case CSSPropertyFontSize:
     case CSSPropertyFontStretch:
     case CSSPropertyFontStyle:
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to