Title: [274383] trunk
Revision
274383
Author
[email protected]
Date
2021-03-13 02:57:21 -0800 (Sat, 13 Mar 2021)

Log Message

Fix interpolation of orphans and widows CSS properties
https://bugs.webkit.org/show_bug.cgi?id=223124

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Import interpolation tests for orphans and widows. These tests pass completely
weith 44 PASS results compared to prior to the source changes.

* web-platform-tests/css/css-break/animation/orphans-interpolation-expected.txt: Added.
* web-platform-tests/css/css-break/animation/orphans-interpolation.html: Added.
* web-platform-tests/css/css-break/animation/widows-interpolation-expected.txt: Added.
* web-platform-tests/css/css-break/animation/widows-interpolation.html: Added.

Source/WebCore:

The orphans and widows properties must be positive integers, so we add a dedicated
wrapper for these properties.

Tests: imported/w3c/web-platform-tests/css/css-break/animation/orphans-interpolation.html
       imported/w3c/web-platform-tests/css/css-break/animation/widows-interpolation.html

* animation/CSSPropertyAnimation.cpp:
(WebCore::PositivePropertyWrapper::PositivePropertyWrapper):
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (274382 => 274383)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2021-03-13 09:36:04 UTC (rev 274382)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2021-03-13 10:57:21 UTC (rev 274383)
@@ -1,3 +1,18 @@
+2021-03-12  Antoine Quint  <[email protected]>
+
+        Fix interpolation of orphans and widows CSS properties
+        https://bugs.webkit.org/show_bug.cgi?id=223124
+
+        Reviewed by Darin Adler.
+
+        Import interpolation tests for orphans and widows. These tests pass completely
+        weith 44 PASS results compared to prior to the source changes.
+
+        * web-platform-tests/css/css-break/animation/orphans-interpolation-expected.txt: Added.
+        * web-platform-tests/css/css-break/animation/orphans-interpolation.html: Added.
+        * web-platform-tests/css/css-break/animation/widows-interpolation-expected.txt: Added.
+        * web-platform-tests/css/css-break/animation/widows-interpolation.html: Added.
+
 2021-03-13  Alexey Shvayka  <[email protected]>
 
         Cache cross-origin methods / accessors of Window and Location per lexical global object

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-break/animation/orphans-interpolation-expected.txt (0 => 274383)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-break/animation/orphans-interpolation-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-break/animation/orphans-interpolation-expected.txt	2021-03-13 10:57:21 UTC (rev 274383)
@@ -0,0 +1,122 @@
+
+PASS CSS Transitions: property <orphans> from neutral to [20] at (-0.5) should be [5]
+PASS CSS Transitions: property <orphans> from neutral to [20] at (0) should be [10]
+PASS CSS Transitions: property <orphans> from neutral to [20] at (0.3) should be [13]
+PASS CSS Transitions: property <orphans> from neutral to [20] at (0.7) should be [17]
+PASS CSS Transitions: property <orphans> from neutral to [20] at (1) should be [20]
+PASS CSS Transitions: property <orphans> from neutral to [20] at (1.5) should be [25]
+PASS CSS Transitions with transition: all: property <orphans> from neutral to [20] at (-0.5) should be [5]
+PASS CSS Transitions with transition: all: property <orphans> from neutral to [20] at (0) should be [10]
+PASS CSS Transitions with transition: all: property <orphans> from neutral to [20] at (0.3) should be [13]
+PASS CSS Transitions with transition: all: property <orphans> from neutral to [20] at (0.7) should be [17]
+PASS CSS Transitions with transition: all: property <orphans> from neutral to [20] at (1) should be [20]
+PASS CSS Transitions with transition: all: property <orphans> from neutral to [20] at (1.5) should be [25]
+PASS CSS Animations: property <orphans> from neutral to [20] at (-0.5) should be [5]
+PASS CSS Animations: property <orphans> from neutral to [20] at (0) should be [10]
+PASS CSS Animations: property <orphans> from neutral to [20] at (0.3) should be [13]
+PASS CSS Animations: property <orphans> from neutral to [20] at (0.7) should be [17]
+PASS CSS Animations: property <orphans> from neutral to [20] at (1) should be [20]
+PASS CSS Animations: property <orphans> from neutral to [20] at (1.5) should be [25]
+PASS Web Animations: property <orphans> from neutral to [20] at (-0.5) should be [5]
+PASS Web Animations: property <orphans> from neutral to [20] at (0) should be [10]
+PASS Web Animations: property <orphans> from neutral to [20] at (0.3) should be [13]
+PASS Web Animations: property <orphans> from neutral to [20] at (0.7) should be [17]
+PASS Web Animations: property <orphans> from neutral to [20] at (1) should be [20]
+PASS Web Animations: property <orphans> from neutral to [20] at (1.5) should be [25]
+PASS CSS Transitions: property <orphans> from [initial] to [20] at (-0.5) should be [1]
+PASS CSS Transitions: property <orphans> from [initial] to [20] at (0) should be [2]
+PASS CSS Transitions: property <orphans> from [initial] to [20] at (0.3) should be [7]
+PASS CSS Transitions: property <orphans> from [initial] to [20] at (0.7) should be [15]
+PASS CSS Transitions: property <orphans> from [initial] to [20] at (1) should be [20]
+PASS CSS Transitions: property <orphans> from [initial] to [20] at (1.5) should be [29]
+PASS CSS Transitions with transition: all: property <orphans> from [initial] to [20] at (-0.5) should be [1]
+PASS CSS Transitions with transition: all: property <orphans> from [initial] to [20] at (0) should be [2]
+PASS CSS Transitions with transition: all: property <orphans> from [initial] to [20] at (0.3) should be [7]
+PASS CSS Transitions with transition: all: property <orphans> from [initial] to [20] at (0.7) should be [15]
+PASS CSS Transitions with transition: all: property <orphans> from [initial] to [20] at (1) should be [20]
+PASS CSS Transitions with transition: all: property <orphans> from [initial] to [20] at (1.5) should be [29]
+PASS CSS Animations: property <orphans> from [initial] to [20] at (-0.5) should be [1]
+PASS CSS Animations: property <orphans> from [initial] to [20] at (0) should be [2]
+PASS CSS Animations: property <orphans> from [initial] to [20] at (0.3) should be [7]
+PASS CSS Animations: property <orphans> from [initial] to [20] at (0.7) should be [15]
+PASS CSS Animations: property <orphans> from [initial] to [20] at (1) should be [20]
+PASS CSS Animations: property <orphans> from [initial] to [20] at (1.5) should be [29]
+PASS Web Animations: property <orphans> from [initial] to [20] at (-0.5) should be [1]
+PASS Web Animations: property <orphans> from [initial] to [20] at (0) should be [2]
+PASS Web Animations: property <orphans> from [initial] to [20] at (0.3) should be [7]
+PASS Web Animations: property <orphans> from [initial] to [20] at (0.7) should be [15]
+PASS Web Animations: property <orphans> from [initial] to [20] at (1) should be [20]
+PASS Web Animations: property <orphans> from [initial] to [20] at (1.5) should be [29]
+PASS CSS Transitions: property <orphans> from [inherit] to [20] at (-0.5) should be [35]
+PASS CSS Transitions: property <orphans> from [inherit] to [20] at (0) should be [30]
+PASS CSS Transitions: property <orphans> from [inherit] to [20] at (0.3) should be [27]
+PASS CSS Transitions: property <orphans> from [inherit] to [20] at (0.7) should be [23]
+PASS CSS Transitions: property <orphans> from [inherit] to [20] at (1) should be [20]
+PASS CSS Transitions: property <orphans> from [inherit] to [20] at (1.5) should be [15]
+PASS CSS Transitions with transition: all: property <orphans> from [inherit] to [20] at (-0.5) should be [35]
+PASS CSS Transitions with transition: all: property <orphans> from [inherit] to [20] at (0) should be [30]
+PASS CSS Transitions with transition: all: property <orphans> from [inherit] to [20] at (0.3) should be [27]
+PASS CSS Transitions with transition: all: property <orphans> from [inherit] to [20] at (0.7) should be [23]
+PASS CSS Transitions with transition: all: property <orphans> from [inherit] to [20] at (1) should be [20]
+PASS CSS Transitions with transition: all: property <orphans> from [inherit] to [20] at (1.5) should be [15]
+PASS CSS Animations: property <orphans> from [inherit] to [20] at (-0.5) should be [35]
+PASS CSS Animations: property <orphans> from [inherit] to [20] at (0) should be [30]
+PASS CSS Animations: property <orphans> from [inherit] to [20] at (0.3) should be [27]
+PASS CSS Animations: property <orphans> from [inherit] to [20] at (0.7) should be [23]
+PASS CSS Animations: property <orphans> from [inherit] to [20] at (1) should be [20]
+PASS CSS Animations: property <orphans> from [inherit] to [20] at (1.5) should be [15]
+PASS Web Animations: property <orphans> from [inherit] to [20] at (-0.5) should be [35]
+PASS Web Animations: property <orphans> from [inherit] to [20] at (0) should be [30]
+PASS Web Animations: property <orphans> from [inherit] to [20] at (0.3) should be [27]
+PASS Web Animations: property <orphans> from [inherit] to [20] at (0.7) should be [23]
+PASS Web Animations: property <orphans> from [inherit] to [20] at (1) should be [20]
+PASS Web Animations: property <orphans> from [inherit] to [20] at (1.5) should be [15]
+PASS CSS Transitions: property <orphans> from [unset] to [20] at (-0.5) should be [35]
+PASS CSS Transitions: property <orphans> from [unset] to [20] at (0) should be [30]
+PASS CSS Transitions: property <orphans> from [unset] to [20] at (0.3) should be [27]
+PASS CSS Transitions: property <orphans> from [unset] to [20] at (0.7) should be [23]
+PASS CSS Transitions: property <orphans> from [unset] to [20] at (1) should be [20]
+PASS CSS Transitions: property <orphans> from [unset] to [20] at (1.5) should be [15]
+PASS CSS Transitions with transition: all: property <orphans> from [unset] to [20] at (-0.5) should be [35]
+PASS CSS Transitions with transition: all: property <orphans> from [unset] to [20] at (0) should be [30]
+PASS CSS Transitions with transition: all: property <orphans> from [unset] to [20] at (0.3) should be [27]
+PASS CSS Transitions with transition: all: property <orphans> from [unset] to [20] at (0.7) should be [23]
+PASS CSS Transitions with transition: all: property <orphans> from [unset] to [20] at (1) should be [20]
+PASS CSS Transitions with transition: all: property <orphans> from [unset] to [20] at (1.5) should be [15]
+PASS CSS Animations: property <orphans> from [unset] to [20] at (-0.5) should be [35]
+PASS CSS Animations: property <orphans> from [unset] to [20] at (0) should be [30]
+PASS CSS Animations: property <orphans> from [unset] to [20] at (0.3) should be [27]
+PASS CSS Animations: property <orphans> from [unset] to [20] at (0.7) should be [23]
+PASS CSS Animations: property <orphans> from [unset] to [20] at (1) should be [20]
+PASS CSS Animations: property <orphans> from [unset] to [20] at (1.5) should be [15]
+PASS Web Animations: property <orphans> from [unset] to [20] at (-0.5) should be [35]
+PASS Web Animations: property <orphans> from [unset] to [20] at (0) should be [30]
+PASS Web Animations: property <orphans> from [unset] to [20] at (0.3) should be [27]
+PASS Web Animations: property <orphans> from [unset] to [20] at (0.7) should be [23]
+PASS Web Animations: property <orphans> from [unset] to [20] at (1) should be [20]
+PASS Web Animations: property <orphans> from [unset] to [20] at (1.5) should be [15]
+PASS CSS Transitions: property <orphans> from [10] to [1] at (-0.5) should be [15]
+PASS CSS Transitions: property <orphans> from [10] to [1] at (0) should be [10]
+PASS CSS Transitions: property <orphans> from [10] to [1] at (0.3) should be [7]
+PASS CSS Transitions: property <orphans> from [10] to [1] at (0.7) should be [4]
+PASS CSS Transitions: property <orphans> from [10] to [1] at (1) should be [1]
+PASS CSS Transitions: property <orphans> from [10] to [1] at (1.5) should be [1]
+PASS CSS Transitions with transition: all: property <orphans> from [10] to [1] at (-0.5) should be [15]
+PASS CSS Transitions with transition: all: property <orphans> from [10] to [1] at (0) should be [10]
+PASS CSS Transitions with transition: all: property <orphans> from [10] to [1] at (0.3) should be [7]
+PASS CSS Transitions with transition: all: property <orphans> from [10] to [1] at (0.7) should be [4]
+PASS CSS Transitions with transition: all: property <orphans> from [10] to [1] at (1) should be [1]
+PASS CSS Transitions with transition: all: property <orphans> from [10] to [1] at (1.5) should be [1]
+PASS CSS Animations: property <orphans> from [10] to [1] at (-0.5) should be [15]
+PASS CSS Animations: property <orphans> from [10] to [1] at (0) should be [10]
+PASS CSS Animations: property <orphans> from [10] to [1] at (0.3) should be [7]
+PASS CSS Animations: property <orphans> from [10] to [1] at (0.7) should be [4]
+PASS CSS Animations: property <orphans> from [10] to [1] at (1) should be [1]
+PASS CSS Animations: property <orphans> from [10] to [1] at (1.5) should be [1]
+PASS Web Animations: property <orphans> from [10] to [1] at (-0.5) should be [15]
+PASS Web Animations: property <orphans> from [10] to [1] at (0) should be [10]
+PASS Web Animations: property <orphans> from [10] to [1] at (0.3) should be [7]
+PASS Web Animations: property <orphans> from [10] to [1] at (0.7) should be [4]
+PASS Web Animations: property <orphans> from [10] to [1] at (1) should be [1]
+PASS Web Animations: property <orphans> from [10] to [1] at (1.5) should be [1]
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-break/animation/orphans-interpolation.html (0 => 274383)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-break/animation/orphans-interpolation.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-break/animation/orphans-interpolation.html	2021-03-13 10:57:21 UTC (rev 274383)
@@ -0,0 +1,88 @@
+<!DOCTYPE html>
+<meta charset="UTF-8">
+<title>orphans interpolation</title>
+<link rel="help" href=""
+<meta name="assert" content="orphans supports animation by computed value type">
+
+<script src=""
+<script src=""
+<script src=""
+
+<style>
+.parent {
+  orphans: 30;
+}
+.target {
+  orphans: 10;
+}
+</style>
+
+<body></body>
+
+<script>
+test_interpolation({
+  property: 'orphans',
+  from: neutralKeyframe,
+  to: '20',
+}, [
+  {at: -0.5, expect: '5'},
+  {at: 0, expect: '10'},
+  {at: 0.3, expect: '13'},
+  {at: 0.7, expect: '17'},
+  {at: 1, expect: '20'},
+  {at: 1.5, expect: '25'},
+]);
+
+test_interpolation({
+  property: 'orphans',
+  from: 'initial',
+  to: '20',
+}, [
+  {at: -0.5, expect: '1'},
+  {at: 0, expect: '2'},
+  {at: 0.3, expect: '7'},
+  {at: 0.7, expect: '15'},
+  {at: 1, expect: '20'},
+  {at: 1.5, expect: '29'},
+]);
+
+test_interpolation({
+  property: 'orphans',
+  from: 'inherit',
+  to: '20',
+}, [
+  {at: -0.5, expect: '35'},
+  {at: 0, expect: '30'},
+  {at: 0.3, expect: '27'},
+  {at: 0.7, expect: '23'},
+  {at: 1, expect: '20'},
+  {at: 1.5, expect: '15'},
+]);
+
+test_interpolation({
+  property: 'orphans',
+  from: 'unset',
+  to: '20',
+}, [
+  {at: -0.5, expect: '35'},
+  {at: 0, expect: '30'},
+  {at: 0.3, expect: '27'},
+  {at: 0.7, expect: '23'},
+  {at: 1, expect: '20'},
+  {at: 1.5, expect: '15'},
+]);
+
+test_interpolation({
+  property: 'orphans',
+  from: '10',
+  to: '1'
+}, [
+  {at: -0.5, expect: '15'},
+  {at: 0, expect: '10'},
+  {at: 0.3, expect: '7'},
+  {at: 0.7, expect: '4'},
+  // Only positive integers are valid
+  {at: 1, expect: '1'},
+  {at: 1.5, expect: '1'}
+]);
+</script>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-break/animation/widows-interpolation-expected.txt (0 => 274383)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-break/animation/widows-interpolation-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-break/animation/widows-interpolation-expected.txt	2021-03-13 10:57:21 UTC (rev 274383)
@@ -0,0 +1,194 @@
+
+PASS CSS Transitions: property <widows> from neutral to [20] at (-3) should be [1]
+PASS CSS Transitions: property <widows> from neutral to [20] at (-2.5) should be [1]
+PASS CSS Transitions: property <widows> from neutral to [20] at (-0.5) should be [5]
+PASS CSS Transitions: property <widows> from neutral to [20] at (0) should be [10]
+PASS CSS Transitions: property <widows> from neutral to [20] at (0.3) should be [13]
+PASS CSS Transitions: property <widows> from neutral to [20] at (0.6) should be [16]
+PASS CSS Transitions: property <widows> from neutral to [20] at (1) should be [20]
+PASS CSS Transitions: property <widows> from neutral to [20] at (1.5) should be [25]
+PASS CSS Transitions with transition: all: property <widows> from neutral to [20] at (-3) should be [1]
+PASS CSS Transitions with transition: all: property <widows> from neutral to [20] at (-2.5) should be [1]
+PASS CSS Transitions with transition: all: property <widows> from neutral to [20] at (-0.5) should be [5]
+PASS CSS Transitions with transition: all: property <widows> from neutral to [20] at (0) should be [10]
+PASS CSS Transitions with transition: all: property <widows> from neutral to [20] at (0.3) should be [13]
+PASS CSS Transitions with transition: all: property <widows> from neutral to [20] at (0.6) should be [16]
+PASS CSS Transitions with transition: all: property <widows> from neutral to [20] at (1) should be [20]
+PASS CSS Transitions with transition: all: property <widows> from neutral to [20] at (1.5) should be [25]
+PASS CSS Animations: property <widows> from neutral to [20] at (-3) should be [1]
+PASS CSS Animations: property <widows> from neutral to [20] at (-2.5) should be [1]
+PASS CSS Animations: property <widows> from neutral to [20] at (-0.5) should be [5]
+PASS CSS Animations: property <widows> from neutral to [20] at (0) should be [10]
+PASS CSS Animations: property <widows> from neutral to [20] at (0.3) should be [13]
+PASS CSS Animations: property <widows> from neutral to [20] at (0.6) should be [16]
+PASS CSS Animations: property <widows> from neutral to [20] at (1) should be [20]
+PASS CSS Animations: property <widows> from neutral to [20] at (1.5) should be [25]
+PASS Web Animations: property <widows> from neutral to [20] at (-3) should be [1]
+PASS Web Animations: property <widows> from neutral to [20] at (-2.5) should be [1]
+PASS Web Animations: property <widows> from neutral to [20] at (-0.5) should be [5]
+PASS Web Animations: property <widows> from neutral to [20] at (0) should be [10]
+PASS Web Animations: property <widows> from neutral to [20] at (0.3) should be [13]
+PASS Web Animations: property <widows> from neutral to [20] at (0.6) should be [16]
+PASS Web Animations: property <widows> from neutral to [20] at (1) should be [20]
+PASS Web Animations: property <widows> from neutral to [20] at (1.5) should be [25]
+PASS CSS Transitions: property <widows> from [initial] to [20] at (-3) should be [1]
+PASS CSS Transitions: property <widows> from [initial] to [20] at (-2.5) should be [1]
+PASS CSS Transitions: property <widows> from [initial] to [20] at (-0.5) should be [1]
+PASS CSS Transitions: property <widows> from [initial] to [20] at (0) should be [2]
+PASS CSS Transitions: property <widows> from [initial] to [20] at (0.3) should be [7]
+PASS CSS Transitions: property <widows> from [initial] to [20] at (0.6) should be [13]
+PASS CSS Transitions: property <widows> from [initial] to [20] at (1) should be [20]
+PASS CSS Transitions: property <widows> from [initial] to [20] at (1.5) should be [29]
+PASS CSS Transitions with transition: all: property <widows> from [initial] to [20] at (-3) should be [1]
+PASS CSS Transitions with transition: all: property <widows> from [initial] to [20] at (-2.5) should be [1]
+PASS CSS Transitions with transition: all: property <widows> from [initial] to [20] at (-0.5) should be [1]
+PASS CSS Transitions with transition: all: property <widows> from [initial] to [20] at (0) should be [2]
+PASS CSS Transitions with transition: all: property <widows> from [initial] to [20] at (0.3) should be [7]
+PASS CSS Transitions with transition: all: property <widows> from [initial] to [20] at (0.6) should be [13]
+PASS CSS Transitions with transition: all: property <widows> from [initial] to [20] at (1) should be [20]
+PASS CSS Transitions with transition: all: property <widows> from [initial] to [20] at (1.5) should be [29]
+PASS CSS Animations: property <widows> from [initial] to [20] at (-3) should be [1]
+PASS CSS Animations: property <widows> from [initial] to [20] at (-2.5) should be [1]
+PASS CSS Animations: property <widows> from [initial] to [20] at (-0.5) should be [1]
+PASS CSS Animations: property <widows> from [initial] to [20] at (0) should be [2]
+PASS CSS Animations: property <widows> from [initial] to [20] at (0.3) should be [7]
+PASS CSS Animations: property <widows> from [initial] to [20] at (0.6) should be [13]
+PASS CSS Animations: property <widows> from [initial] to [20] at (1) should be [20]
+PASS CSS Animations: property <widows> from [initial] to [20] at (1.5) should be [29]
+PASS Web Animations: property <widows> from [initial] to [20] at (-3) should be [1]
+PASS Web Animations: property <widows> from [initial] to [20] at (-2.5) should be [1]
+PASS Web Animations: property <widows> from [initial] to [20] at (-0.5) should be [1]
+PASS Web Animations: property <widows> from [initial] to [20] at (0) should be [2]
+PASS Web Animations: property <widows> from [initial] to [20] at (0.3) should be [7]
+PASS Web Animations: property <widows> from [initial] to [20] at (0.6) should be [13]
+PASS Web Animations: property <widows> from [initial] to [20] at (1) should be [20]
+PASS Web Animations: property <widows> from [initial] to [20] at (1.5) should be [29]
+PASS CSS Transitions: property <widows> from [inherit] to [20] at (-3) should be [60]
+PASS CSS Transitions: property <widows> from [inherit] to [20] at (-2.5) should be [55]
+PASS CSS Transitions: property <widows> from [inherit] to [20] at (-0.5) should be [35]
+PASS CSS Transitions: property <widows> from [inherit] to [20] at (0) should be [30]
+PASS CSS Transitions: property <widows> from [inherit] to [20] at (0.3) should be [27]
+PASS CSS Transitions: property <widows> from [inherit] to [20] at (0.6) should be [24]
+PASS CSS Transitions: property <widows> from [inherit] to [20] at (1) should be [20]
+PASS CSS Transitions: property <widows> from [inherit] to [20] at (1.5) should be [15]
+PASS CSS Transitions with transition: all: property <widows> from [inherit] to [20] at (-3) should be [60]
+PASS CSS Transitions with transition: all: property <widows> from [inherit] to [20] at (-2.5) should be [55]
+PASS CSS Transitions with transition: all: property <widows> from [inherit] to [20] at (-0.5) should be [35]
+PASS CSS Transitions with transition: all: property <widows> from [inherit] to [20] at (0) should be [30]
+PASS CSS Transitions with transition: all: property <widows> from [inherit] to [20] at (0.3) should be [27]
+PASS CSS Transitions with transition: all: property <widows> from [inherit] to [20] at (0.6) should be [24]
+PASS CSS Transitions with transition: all: property <widows> from [inherit] to [20] at (1) should be [20]
+PASS CSS Transitions with transition: all: property <widows> from [inherit] to [20] at (1.5) should be [15]
+PASS CSS Animations: property <widows> from [inherit] to [20] at (-3) should be [60]
+PASS CSS Animations: property <widows> from [inherit] to [20] at (-2.5) should be [55]
+PASS CSS Animations: property <widows> from [inherit] to [20] at (-0.5) should be [35]
+PASS CSS Animations: property <widows> from [inherit] to [20] at (0) should be [30]
+PASS CSS Animations: property <widows> from [inherit] to [20] at (0.3) should be [27]
+PASS CSS Animations: property <widows> from [inherit] to [20] at (0.6) should be [24]
+PASS CSS Animations: property <widows> from [inherit] to [20] at (1) should be [20]
+PASS CSS Animations: property <widows> from [inherit] to [20] at (1.5) should be [15]
+PASS Web Animations: property <widows> from [inherit] to [20] at (-3) should be [60]
+PASS Web Animations: property <widows> from [inherit] to [20] at (-2.5) should be [55]
+PASS Web Animations: property <widows> from [inherit] to [20] at (-0.5) should be [35]
+PASS Web Animations: property <widows> from [inherit] to [20] at (0) should be [30]
+PASS Web Animations: property <widows> from [inherit] to [20] at (0.3) should be [27]
+PASS Web Animations: property <widows> from [inherit] to [20] at (0.6) should be [24]
+PASS Web Animations: property <widows> from [inherit] to [20] at (1) should be [20]
+PASS Web Animations: property <widows> from [inherit] to [20] at (1.5) should be [15]
+PASS CSS Transitions: property <widows> from [unset] to [20] at (-3) should be [60]
+PASS CSS Transitions: property <widows> from [unset] to [20] at (-2.5) should be [55]
+PASS CSS Transitions: property <widows> from [unset] to [20] at (-0.5) should be [35]
+PASS CSS Transitions: property <widows> from [unset] to [20] at (0) should be [30]
+PASS CSS Transitions: property <widows> from [unset] to [20] at (0.3) should be [27]
+PASS CSS Transitions: property <widows> from [unset] to [20] at (0.6) should be [24]
+PASS CSS Transitions: property <widows> from [unset] to [20] at (1) should be [20]
+PASS CSS Transitions: property <widows> from [unset] to [20] at (1.5) should be [15]
+PASS CSS Transitions with transition: all: property <widows> from [unset] to [20] at (-3) should be [60]
+PASS CSS Transitions with transition: all: property <widows> from [unset] to [20] at (-2.5) should be [55]
+PASS CSS Transitions with transition: all: property <widows> from [unset] to [20] at (-0.5) should be [35]
+PASS CSS Transitions with transition: all: property <widows> from [unset] to [20] at (0) should be [30]
+PASS CSS Transitions with transition: all: property <widows> from [unset] to [20] at (0.3) should be [27]
+PASS CSS Transitions with transition: all: property <widows> from [unset] to [20] at (0.6) should be [24]
+PASS CSS Transitions with transition: all: property <widows> from [unset] to [20] at (1) should be [20]
+PASS CSS Transitions with transition: all: property <widows> from [unset] to [20] at (1.5) should be [15]
+PASS CSS Animations: property <widows> from [unset] to [20] at (-3) should be [60]
+PASS CSS Animations: property <widows> from [unset] to [20] at (-2.5) should be [55]
+PASS CSS Animations: property <widows> from [unset] to [20] at (-0.5) should be [35]
+PASS CSS Animations: property <widows> from [unset] to [20] at (0) should be [30]
+PASS CSS Animations: property <widows> from [unset] to [20] at (0.3) should be [27]
+PASS CSS Animations: property <widows> from [unset] to [20] at (0.6) should be [24]
+PASS CSS Animations: property <widows> from [unset] to [20] at (1) should be [20]
+PASS CSS Animations: property <widows> from [unset] to [20] at (1.5) should be [15]
+PASS Web Animations: property <widows> from [unset] to [20] at (-3) should be [60]
+PASS Web Animations: property <widows> from [unset] to [20] at (-2.5) should be [55]
+PASS Web Animations: property <widows> from [unset] to [20] at (-0.5) should be [35]
+PASS Web Animations: property <widows> from [unset] to [20] at (0) should be [30]
+PASS Web Animations: property <widows> from [unset] to [20] at (0.3) should be [27]
+PASS Web Animations: property <widows> from [unset] to [20] at (0.6) should be [24]
+PASS Web Animations: property <widows> from [unset] to [20] at (1) should be [20]
+PASS Web Animations: property <widows> from [unset] to [20] at (1.5) should be [15]
+PASS CSS Transitions: property <widows> from [10] to [20] at (-3) should be [1]
+PASS CSS Transitions: property <widows> from [10] to [20] at (-2.5) should be [1]
+PASS CSS Transitions: property <widows> from [10] to [20] at (-0.5) should be [5]
+PASS CSS Transitions: property <widows> from [10] to [20] at (0) should be [10]
+PASS CSS Transitions: property <widows> from [10] to [20] at (0.3) should be [13]
+PASS CSS Transitions: property <widows> from [10] to [20] at (0.6) should be [16]
+PASS CSS Transitions: property <widows> from [10] to [20] at (1) should be [20]
+PASS CSS Transitions: property <widows> from [10] to [20] at (1.5) should be [25]
+PASS CSS Transitions with transition: all: property <widows> from [10] to [20] at (-3) should be [1]
+PASS CSS Transitions with transition: all: property <widows> from [10] to [20] at (-2.5) should be [1]
+PASS CSS Transitions with transition: all: property <widows> from [10] to [20] at (-0.5) should be [5]
+PASS CSS Transitions with transition: all: property <widows> from [10] to [20] at (0) should be [10]
+PASS CSS Transitions with transition: all: property <widows> from [10] to [20] at (0.3) should be [13]
+PASS CSS Transitions with transition: all: property <widows> from [10] to [20] at (0.6) should be [16]
+PASS CSS Transitions with transition: all: property <widows> from [10] to [20] at (1) should be [20]
+PASS CSS Transitions with transition: all: property <widows> from [10] to [20] at (1.5) should be [25]
+PASS CSS Animations: property <widows> from [10] to [20] at (-3) should be [1]
+PASS CSS Animations: property <widows> from [10] to [20] at (-2.5) should be [1]
+PASS CSS Animations: property <widows> from [10] to [20] at (-0.5) should be [5]
+PASS CSS Animations: property <widows> from [10] to [20] at (0) should be [10]
+PASS CSS Animations: property <widows> from [10] to [20] at (0.3) should be [13]
+PASS CSS Animations: property <widows> from [10] to [20] at (0.6) should be [16]
+PASS CSS Animations: property <widows> from [10] to [20] at (1) should be [20]
+PASS CSS Animations: property <widows> from [10] to [20] at (1.5) should be [25]
+PASS Web Animations: property <widows> from [10] to [20] at (-3) should be [1]
+PASS Web Animations: property <widows> from [10] to [20] at (-2.5) should be [1]
+PASS Web Animations: property <widows> from [10] to [20] at (-0.5) should be [5]
+PASS Web Animations: property <widows> from [10] to [20] at (0) should be [10]
+PASS Web Animations: property <widows> from [10] to [20] at (0.3) should be [13]
+PASS Web Animations: property <widows> from [10] to [20] at (0.6) should be [16]
+PASS Web Animations: property <widows> from [10] to [20] at (1) should be [20]
+PASS Web Animations: property <widows> from [10] to [20] at (1.5) should be [25]
+PASS CSS Transitions: property <widows> from [2] to [4] at (-3) should be [1]
+PASS CSS Transitions: property <widows> from [2] to [4] at (-2.5) should be [1]
+PASS CSS Transitions: property <widows> from [2] to [4] at (-0.5) should be [1]
+PASS CSS Transitions: property <widows> from [2] to [4] at (0) should be [2]
+PASS CSS Transitions: property <widows> from [2] to [4] at (0.3) should be [3]
+PASS CSS Transitions: property <widows> from [2] to [4] at (0.6) should be [3]
+PASS CSS Transitions: property <widows> from [2] to [4] at (1) should be [4]
+PASS CSS Transitions: property <widows> from [2] to [4] at (1.5) should be [5]
+PASS CSS Transitions with transition: all: property <widows> from [2] to [4] at (-3) should be [1]
+PASS CSS Transitions with transition: all: property <widows> from [2] to [4] at (-2.5) should be [1]
+PASS CSS Transitions with transition: all: property <widows> from [2] to [4] at (-0.5) should be [1]
+PASS CSS Transitions with transition: all: property <widows> from [2] to [4] at (0) should be [2]
+PASS CSS Transitions with transition: all: property <widows> from [2] to [4] at (0.3) should be [3]
+PASS CSS Transitions with transition: all: property <widows> from [2] to [4] at (0.6) should be [3]
+PASS CSS Transitions with transition: all: property <widows> from [2] to [4] at (1) should be [4]
+PASS CSS Transitions with transition: all: property <widows> from [2] to [4] at (1.5) should be [5]
+PASS CSS Animations: property <widows> from [2] to [4] at (-3) should be [1]
+PASS CSS Animations: property <widows> from [2] to [4] at (-2.5) should be [1]
+PASS CSS Animations: property <widows> from [2] to [4] at (-0.5) should be [1]
+PASS CSS Animations: property <widows> from [2] to [4] at (0) should be [2]
+PASS CSS Animations: property <widows> from [2] to [4] at (0.3) should be [3]
+PASS CSS Animations: property <widows> from [2] to [4] at (0.6) should be [3]
+PASS CSS Animations: property <widows> from [2] to [4] at (1) should be [4]
+PASS CSS Animations: property <widows> from [2] to [4] at (1.5) should be [5]
+PASS Web Animations: property <widows> from [2] to [4] at (-3) should be [1]
+PASS Web Animations: property <widows> from [2] to [4] at (-2.5) should be [1]
+PASS Web Animations: property <widows> from [2] to [4] at (-0.5) should be [1]
+PASS Web Animations: property <widows> from [2] to [4] at (0) should be [2]
+PASS Web Animations: property <widows> from [2] to [4] at (0.3) should be [3]
+PASS Web Animations: property <widows> from [2] to [4] at (0.6) should be [3]
+PASS Web Animations: property <widows> from [2] to [4] at (1) should be [4]
+PASS Web Animations: property <widows> from [2] to [4] at (1.5) should be [5]
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-break/animation/widows-interpolation.html (0 => 274383)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-break/animation/widows-interpolation.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-break/animation/widows-interpolation.html	2021-03-13 10:57:21 UTC (rev 274383)
@@ -0,0 +1,112 @@
+<!DOCTYPE html>
+<meta charset="UTF-8">
+<title>widows interpolation</title>
+<link rel="help" href=""
+<meta name="assert" content="widows supports animation by computed value type">
+
+<script src=""
+<script src=""
+<script src=""
+
+<style>
+.parent {
+  widows: 30;
+}
+.target {
+  widows: 10;
+}
+</style>
+
+<body></body>
+
+<script>
+test_interpolation({
+  property: 'widows',
+  from: neutralKeyframe,
+  to: '20',
+}, [
+  {at: -3, expect: '1'},
+  {at: -2.5, expect: '1'},
+  {at: -0.5, expect: '5'},
+  {at: 0, expect: '10'},
+  {at: 0.3, expect: '13'},
+  {at: 0.6, expect: '16'},
+  {at: 1, expect: '20'},
+  {at: 1.5, expect: '25'},
+]);
+
+test_interpolation({
+  property: 'widows',
+  from: 'initial',
+  to: '20',
+}, [
+  {at: -3, expect: '1'},
+  {at: -2.5, expect: '1'},
+  {at: -0.5, expect: '1'},
+  {at: 0, expect: '2'},
+  {at: 0.3, expect: '7'},
+  {at: 0.6, expect: '13'},
+  {at: 1, expect: '20'},
+  {at: 1.5, expect: '29'},
+]);
+
+test_interpolation({
+  property: 'widows',
+  from: 'inherit',
+  to: '20',
+}, [
+  {at: -3, expect: '60'},
+  {at: -2.5, expect: '55'},
+  {at: -0.5, expect: '35'},
+  {at: 0, expect: '30'},
+  {at: 0.3, expect: '27'},
+  {at: 0.6, expect: '24'},
+  {at: 1, expect: '20'},
+  {at: 1.5, expect: '15'},
+]);
+
+test_interpolation({
+  property: 'widows',
+  from: 'unset',
+  to: '20',
+}, [
+  {at: -3, expect: '60'},
+  {at: -2.5, expect: '55'},
+  {at: -0.5, expect: '35'},
+  {at: 0, expect: '30'},
+  {at: 0.3, expect: '27'},
+  {at: 0.6, expect: '24'},
+  {at: 1, expect: '20'},
+  {at: 1.5, expect: '15'},
+]);
+
+test_interpolation({
+  property: 'widows',
+  from: '10',
+  to: '20'
+}, [
+  {at: -3.0, expect: '1'},
+  {at: -2.5, expect: '1'},
+  {at: -0.5, expect: '5'},
+  {at: 0, expect: '10'},
+  {at: 0.3, expect: '13'},
+  {at: 0.6, expect: '16'},
+  {at: 1, expect: '20'},
+  {at: 1.5, expect: '25'}
+]);
+
+test_interpolation({
+  property: 'widows',
+  from: '2',
+  to: '4'
+}, [
+  {at: -3.0, expect: '1'},
+  {at: -2.5, expect: '1'},
+  {at: -0.5, expect: '1'},
+  {at: 0, expect: '2'},
+  {at: 0.3, expect: '3'},
+  {at: 0.6, expect: '3'},
+  {at: 1, expect: '4'},
+  {at: 1.5, expect: '5'}
+]);
+</script>

Modified: trunk/Source/WebCore/ChangeLog (274382 => 274383)


--- trunk/Source/WebCore/ChangeLog	2021-03-13 09:36:04 UTC (rev 274382)
+++ trunk/Source/WebCore/ChangeLog	2021-03-13 10:57:21 UTC (rev 274383)
@@ -1,3 +1,20 @@
+2021-03-12  Antoine Quint  <[email protected]>
+
+        Fix interpolation of orphans and widows CSS properties
+        https://bugs.webkit.org/show_bug.cgi?id=223124
+
+        Reviewed by Darin Adler.
+
+        The orphans and widows properties must be positive integers, so we add a dedicated
+        wrapper for these properties.
+
+        Tests: imported/w3c/web-platform-tests/css/css-break/animation/orphans-interpolation.html
+               imported/w3c/web-platform-tests/css/css-break/animation/widows-interpolation.html
+
+        * animation/CSSPropertyAnimation.cpp:
+        (WebCore::PositivePropertyWrapper::PositivePropertyWrapper):
+        (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
+
 2021-03-13  Fujii Hironori  <[email protected]>
 
         Non-unified builds can't compile JSWebGLRenderingContext.cpp: error: member access into incomplete type 'WebCore::WebGLSampler'

Modified: trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp (274382 => 274383)


--- trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp	2021-03-13 09:36:04 UTC (rev 274382)
+++ trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp	2021-03-13 10:57:21 UTC (rev 274383)
@@ -639,6 +639,24 @@
 };
 
 template <typename T>
+class PositivePropertyWrapper final : public PropertyWrapper<T> {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    PositivePropertyWrapper(CSSPropertyID property, T (RenderStyle::*getter)() const, void (RenderStyle::*setter)(T))
+        : PropertyWrapper<T>(property, getter, setter)
+    {
+    }
+
+private:
+
+    void blend(const CSSPropertyBlendingClient* client, RenderStyle* destination, const RenderStyle* from, const RenderStyle* to, double progress) const final
+    {
+        auto blendedValue = blendFunc(client, this->value(from), this->value(to), progress);
+        (destination->*this->m_setter)(blendedValue > 1 ? blendedValue : 1);
+    }
+};
+
+template <typename T>
 class DiscretePropertyWrapper : public PropertyWrapperGetter<T> {
     WTF_MAKE_FAST_ALLOCATED;
 public:
@@ -1946,8 +1964,8 @@
         new PropertyWrapper<float>(CSSPropertyWebkitBorderHorizontalSpacing, &RenderStyle::horizontalBorderSpacing, &RenderStyle::setHorizontalBorderSpacing),
         new PropertyWrapper<float>(CSSPropertyWebkitBorderVerticalSpacing, &RenderStyle::verticalBorderSpacing, &RenderStyle::setVerticalBorderSpacing),
         new AutoPropertyWrapper<int>(CSSPropertyZIndex, &RenderStyle::specifiedZIndex, &RenderStyle::setSpecifiedZIndex, &RenderStyle::hasAutoSpecifiedZIndex, &RenderStyle::setHasAutoSpecifiedZIndex),
-        new PropertyWrapper<unsigned short>(CSSPropertyOrphans, &RenderStyle::orphans, &RenderStyle::setOrphans),
-        new PropertyWrapper<unsigned short>(CSSPropertyWidows, &RenderStyle::widows, &RenderStyle::setWidows),
+        new PositivePropertyWrapper<unsigned short>(CSSPropertyOrphans, &RenderStyle::orphans, &RenderStyle::setOrphans),
+        new PositivePropertyWrapper<unsigned short>(CSSPropertyWidows, &RenderStyle::widows, &RenderStyle::setWidows),
         new LengthPropertyWrapper(CSSPropertyLineHeight, &RenderStyle::specifiedLineHeight, &RenderStyle::setLineHeight),
         new PropertyWrapper<float>(CSSPropertyOutlineOffset, &RenderStyle::outlineOffset, &RenderStyle::setOutlineOffset),
         new NonNegativeFloatPropertyWrapper(CSSPropertyOutlineWidth, &RenderStyle::outlineWidth, &RenderStyle::setOutlineWidth),
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to