Commit d2c37b68 authored by Majid Valipour's avatar Majid Valipour Committed by Commit Bot

[web-animation] Make contain/will-change/writing modes props not animatable

Match the recent CSSWG resolutions:
https://github.com/w3c/csswg-drafts/issues/2737#issuecomment-402574750
https://github.com/w3c/csswg-drafts/issues/2751#issuecomment-402604609


Make following properties none animatable:

* contain
* direction
* display
* text-orientation
* unicode-bidi
* will-change
* writing-mode


Note that wpt tests have already been updated for direction and writing-mode
here [1]

[1] https://github.com/web-platform-tests/wpt/commit/41f4ab65b239a5a9e9eeedadc2cae3d1fe0234c0

Bug: 860359
Change-Id: I3e7296e3c28ff494eddbc6f011621dd29ba7d2aa
Reviewed-on: https://chromium-review.googlesource.com/1127062
Commit-Queue: Majid Valipour <majidvp@chromium.org>
Reviewed-by: default avatarEric Willigers <ericwilligers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#573509}
parent cc982189
This is a testharness.js-based test.
Found 578 tests; 401 PASS, 177 FAIL, 0 TIMEOUT, 0 NOTRUN.
Found 566 tests; 389 PASS, 177 FAIL, 0 TIMEOUT, 0 NOTRUN.
PASS Setup
PASS align-content (type: discrete) has testAccumulation function
PASS align-content: "flex-end" onto "flex-start"
......@@ -185,9 +185,6 @@ FAIL column-width: length of rem assert_equals: The value should be 20px at 0ms
PASS column-width (type: discrete) has testAccumulation function
PASS column-width: "1px" onto "auto"
PASS column-width: "auto" onto "1px"
PASS contain (type: discrete) has testAccumulation function
PASS contain: "none" onto "strict"
PASS contain: "strict" onto "none"
PASS content (type: discrete) has testAccumulation function
PASS content: ""b"" onto ""a""
PASS content: ""a"" onto ""b""
......@@ -495,9 +492,6 @@ PASS text-decoration-line: "underline" onto "overline"
PASS text-decoration-style (type: discrete) has testAccumulation function
PASS text-decoration-style: "dotted" onto "solid"
PASS text-decoration-style: "solid" onto "dotted"
PASS text-orientation (type: discrete) has testAccumulation function
PASS text-orientation: "sideways" onto "upright"
PASS text-orientation: "upright" onto "sideways"
PASS text-overflow (type: discrete) has testAccumulation function
PASS text-overflow: "ellipsis" onto "clip"
PASS text-overflow: "clip" onto "ellipsis"
......@@ -548,9 +542,6 @@ PASS scale (type: scaleList) has testAccumulation function
FAIL scale with two unspecified values assert_equals: The value should be -2 at 0ms expected "-2" but got "-3 1"
FAIL scale with one unspecified value assert_equals: The value should be -2 -2 at 0ms expected "-2 -2" but got "-3 -3"
FAIL scale assert_equals: The value should be 0 -1 -2 at 0ms expected "0 -1 -2" but got "-1 -2 -3"
PASS unicode-bidi (type: discrete) has testAccumulation function
PASS unicode-bidi: "bidi-override" onto "embed"
PASS unicode-bidi: "embed" onto "bidi-override"
PASS vector-effect (type: discrete) has testAccumulation function
PASS vector-effect: "non-scaling-stroke" onto "none"
PASS vector-effect: "none" onto "non-scaling-stroke"
......@@ -575,8 +566,5 @@ FAIL word-spacing: units "rem" onto "em" assert_equals: The value should be 40px
FAIL word-spacing: units "em" onto "rem" assert_equals: The value should be 40px at 0ms expected "40px" but got "20px"
FAIL word-spacing: units "calc" onto "px" assert_equals: The value should be calc(30px + 20%) at 0ms expected "calc(30px + 20%)" but got "10px"
FAIL word-spacing: calc assert_equals: The value should be calc(30px + 30%) at 0ms expected "calc(30px + 30%)" but got "0px"
PASS will-change (type: discrete) has testAccumulation function
PASS will-change: "contents" onto "scroll-position"
PASS will-change: "scroll-position" onto "contents"
Harness: the test ran to completion.
This is a testharness.js-based test.
Found 574 tests; 533 PASS, 41 FAIL, 0 TIMEOUT, 0 NOTRUN.
Found 562 tests; 521 PASS, 41 FAIL, 0 TIMEOUT, 0 NOTRUN.
PASS Setup
PASS align-content (type: discrete) has testAddition function
PASS align-content: "flex-end" onto "flex-start"
......@@ -185,9 +185,6 @@ PASS column-width: length of rem
PASS column-width (type: discrete) has testAddition function
PASS column-width: "1px" onto "auto"
PASS column-width: "auto" onto "1px"
PASS contain (type: discrete) has testAddition function
PASS contain: "none" onto "strict"
PASS contain: "strict" onto "none"
PASS content (type: discrete) has testAddition function
PASS content: ""b"" onto ""a""
PASS content: ""a"" onto ""b""
......@@ -495,9 +492,6 @@ PASS text-decoration-line: "underline" onto "overline"
PASS text-decoration-style (type: discrete) has testAddition function
PASS text-decoration-style: "dotted" onto "solid"
PASS text-decoration-style: "solid" onto "dotted"
PASS text-orientation (type: discrete) has testAddition function
PASS text-orientation: "sideways" onto "upright"
PASS text-orientation: "upright" onto "sideways"
PASS text-overflow (type: discrete) has testAddition function
PASS text-overflow: "ellipsis" onto "clip"
PASS text-overflow: "clip" onto "ellipsis"
......@@ -544,9 +538,6 @@ PASS scale (type: scaleList) has testAddition function
FAIL scale with two unspecified values assert_equals: The value should be -6 at 0ms expected "-6" but got "-6 2"
PASS scale with one unspecified value
PASS scale
PASS unicode-bidi (type: discrete) has testAddition function
PASS unicode-bidi: "bidi-override" onto "embed"
PASS unicode-bidi: "embed" onto "bidi-override"
PASS vector-effect (type: discrete) has testAddition function
PASS vector-effect: "non-scaling-stroke" onto "none"
PASS vector-effect: "none" onto "non-scaling-stroke"
......@@ -571,8 +562,5 @@ PASS word-spacing: units "rem" onto "em"
PASS word-spacing: units "em" onto "rem"
FAIL word-spacing: units "calc" onto "px" assert_equals: The value should be calc(30px + 20%) at 0ms expected "calc(30px + 20%)" but got "10px"
FAIL word-spacing: calc assert_equals: The value should be calc(30px + 30%) at 0ms expected "calc(30px + 30%)" but got "0px"
PASS will-change (type: discrete) has testAddition function
PASS will-change: "contents" onto "scroll-position"
PASS will-change: "scroll-position" onto "contents"
Harness: the test ran to completion.
This is a testharness.js-based test.
Found 716 tests; 642 PASS, 74 FAIL, 0 TIMEOUT, 0 NOTRUN.
Found 700 tests; 626 PASS, 74 FAIL, 0 TIMEOUT, 0 NOTRUN.
PASS Setup
PASS align-content (type: discrete) has testInterpolation function
PASS align-content uses discrete animation when animating between "flex-start" and "flex-end" with linear easing
......@@ -224,10 +224,6 @@ PASS column-width (type: discrete) has testInterpolation function
PASS column-width uses discrete animation when animating between "auto" and "1px" with linear easing
PASS column-width uses discrete animation when animating between "auto" and "1px" with effect easing
PASS column-width uses discrete animation when animating between "auto" and "1px" with keyframe easing
PASS contain (type: discrete) has testInterpolation function
PASS contain uses discrete animation when animating between "strict" and "none" with linear easing
PASS contain uses discrete animation when animating between "strict" and "none" with effect easing
PASS contain uses discrete animation when animating between "strict" and "none" with keyframe easing
PASS content (type: discrete) has testInterpolation function
PASS content uses discrete animation when animating between ""a"" and ""b"" with linear easing
PASS content uses discrete animation when animating between ""a"" and ""b"" with effect easing
......@@ -614,10 +610,6 @@ PASS text-decoration-style (type: discrete) has testInterpolation function
PASS text-decoration-style uses discrete animation when animating between "solid" and "dotted" with linear easing
PASS text-decoration-style uses discrete animation when animating between "solid" and "dotted" with effect easing
PASS text-decoration-style uses discrete animation when animating between "solid" and "dotted" with keyframe easing
PASS text-orientation (type: discrete) has testInterpolation function
PASS text-orientation uses discrete animation when animating between "upright" and "sideways" with linear easing
PASS text-orientation uses discrete animation when animating between "upright" and "sideways" with effect easing
PASS text-orientation uses discrete animation when animating between "upright" and "sideways" with keyframe easing
PASS text-overflow (type: discrete) has testInterpolation function
PASS text-overflow uses discrete animation when animating between "clip" and "ellipsis" with linear easing
PASS text-overflow uses discrete animation when animating between "clip" and "ellipsis" with effect easing
......@@ -682,10 +674,6 @@ PASS scale (type: scaleList) has testInterpolation function
FAIL scale with two unspecified values assert_equals: The value should be 4 at 500ms expected "4" but got "4 1"
PASS scale with one unspecified value
PASS scale
PASS unicode-bidi (type: discrete) has testInterpolation function
PASS unicode-bidi uses discrete animation when animating between "embed" and "bidi-override" with linear easing
PASS unicode-bidi uses discrete animation when animating between "embed" and "bidi-override" with effect easing
PASS unicode-bidi uses discrete animation when animating between "embed" and "bidi-override" with keyframe easing
PASS vector-effect (type: discrete) has testInterpolation function
PASS vector-effect uses discrete animation when animating between "none" and "non-scaling-stroke" with linear easing
PASS vector-effect uses discrete animation when animating between "none" and "non-scaling-stroke" with effect easing
......@@ -712,9 +700,5 @@ FAIL word-spacing supports animating as combination units "%" and "em" assert_eq
PASS word-spacing supports animating as combination units "em" and "rem"
FAIL word-spacing supports animating as combination units "px" and "calc" assert_equals: The value should be calc(10px + 10%) at 500ms expected "calc(10px + 10%)" but got "5px"
FAIL word-spacing supports animating as a calc assert_equals: The value should be calc(15px + 15%) at 500ms expected "calc(15px + 15%)" but got "0px"
PASS will-change (type: discrete) has testInterpolation function
PASS will-change uses discrete animation when animating between "scroll-position" and "contents" with linear easing
PASS will-change uses discrete animation when animating between "scroll-position" and "contents" with effect easing
PASS will-change uses discrete animation when animating between "scroll-position" and "contents" with keyframe easing
Harness: the test ran to completion.
......@@ -413,12 +413,6 @@ const gCSSProperties = {
{ type: 'discrete', options: [ [ 'auto', '1px' ] ] }
]
},
'contain': {
// https://drafts.csswg.org/css-containment/#propdef-contain
types: [
{ type: 'discrete', options: [ [ 'strict', 'none' ] ] }
]
},
'content': {
// https://drafts.csswg.org/css-content-3/#propdef-content
types: [
......@@ -1334,12 +1328,6 @@ const gCSSProperties = {
types: [
]
},
'text-orientation': {
// https://drafts.csswg.org/css-writing-modes-3/#propdef-text-orientation
types: [
{ type: 'discrete', options: [ [ 'upright', 'sideways' ] ] }
]
},
'text-overflow': {
// https://drafts.csswg.org/css-ui/#propdef-text-overflow
types: [
......@@ -1418,12 +1406,6 @@ const gCSSProperties = {
// https://drafts.csswg.org/css-transforms-2/#individual-transforms
types: [ 'scaleList' ]
},
'unicode-bidi': {
// https://drafts.csswg.org/css-writing-modes-3/#propdef-unicode-bidi
types: [
{ type: 'discrete', options: [ [ 'embed', 'bidi-override' ] ] },
]
},
'vector-effect': {
// https://svgwg.org/svg2-draft/coords.html#VectorEffectProperty
types: [
......@@ -1460,12 +1442,6 @@ const gCSSProperties = {
// https://drafts.csswg.org/css-text-3/#propdef-word-spacing
types: [ 'lengthPercentageOrCalc' ]
},
'will-change': {
// http://dev.w3.org/csswg/css-will-change/#propdef-will-change
types: [
{ type: 'discrete', options: [ [ 'scroll-position', 'contents' ] ] }
]
},
'z-index': {
// https://drafts.csswg.org/css-position/#propdef-z-index
types: [
......
This is a testharness.js-based test.
Found 60 tests; 56 PASS, 4 FAIL, 0 TIMEOUT, 0 NOTRUN.
PASS non-animatable property 'animation' is not accessed when using a property-indexed keyframe object
PASS non-animatable property 'animationDelay' is not accessed when using a property-indexed keyframe object
PASS non-animatable property 'animationDirection' is not accessed when using a property-indexed keyframe object
PASS non-animatable property 'animationDuration' is not accessed when using a property-indexed keyframe object
PASS non-animatable property 'animationFillMode' is not accessed when using a property-indexed keyframe object
PASS non-animatable property 'animationIterationCount' is not accessed when using a property-indexed keyframe object
PASS non-animatable property 'animationName' is not accessed when using a property-indexed keyframe object
PASS non-animatable property 'animationPlayState' is not accessed when using a property-indexed keyframe object
PASS non-animatable property 'animationTimingFunction' is not accessed when using a property-indexed keyframe object
PASS non-animatable property 'transition' is not accessed when using a property-indexed keyframe object
PASS non-animatable property 'transitionDelay' is not accessed when using a property-indexed keyframe object
PASS non-animatable property 'transitionDuration' is not accessed when using a property-indexed keyframe object
PASS non-animatable property 'transitionProperty' is not accessed when using a property-indexed keyframe object
PASS non-animatable property 'transitionTimingFunction' is not accessed when using a property-indexed keyframe object
PASS non-animatable property 'display' is not accessed when using a property-indexed keyframe object
FAIL non-animatable property 'direction' is not accessed when using a property-indexed keyframe object assert_equals: Accessor not called expected 0 but got 1
PASS non-animatable property 'unsupportedProperty' is not accessed when using a property-indexed keyframe object
FAIL non-animatable property 'writingMode' is not accessed when using a property-indexed keyframe object assert_equals: Accessor not called expected 0 but got 1
PASS non-animatable property 'font-size' is not accessed when using a property-indexed keyframe object
PASS non-animatable property 'animation' is not accessed when using a keyframe sequence
PASS non-animatable property 'animationDelay' is not accessed when using a keyframe sequence
PASS non-animatable property 'animationDirection' is not accessed when using a keyframe sequence
PASS non-animatable property 'animationDuration' is not accessed when using a keyframe sequence
PASS non-animatable property 'animationFillMode' is not accessed when using a keyframe sequence
PASS non-animatable property 'animationIterationCount' is not accessed when using a keyframe sequence
PASS non-animatable property 'animationName' is not accessed when using a keyframe sequence
PASS non-animatable property 'animationPlayState' is not accessed when using a keyframe sequence
PASS non-animatable property 'animationTimingFunction' is not accessed when using a keyframe sequence
PASS non-animatable property 'transition' is not accessed when using a keyframe sequence
PASS non-animatable property 'transitionDelay' is not accessed when using a keyframe sequence
PASS non-animatable property 'transitionDuration' is not accessed when using a keyframe sequence
PASS non-animatable property 'transitionProperty' is not accessed when using a keyframe sequence
PASS non-animatable property 'transitionTimingFunction' is not accessed when using a keyframe sequence
PASS non-animatable property 'display' is not accessed when using a keyframe sequence
FAIL non-animatable property 'direction' is not accessed when using a keyframe sequence assert_equals: Accessor not called expected 0 but got 1
PASS non-animatable property 'unsupportedProperty' is not accessed when using a keyframe sequence
FAIL non-animatable property 'writingMode' is not accessed when using a keyframe sequence assert_equals: Accessor not called expected 0 but got 1
PASS non-animatable property 'font-size' is not accessed when using a keyframe sequence
PASS Equivalent property-indexed and sequenced keyframes: two properties with one value
PASS Equivalent property-indexed and sequenced keyframes: two properties with three values
PASS Equivalent property-indexed and sequenced keyframes: two properties with different numbers of values
PASS Equivalent property-indexed and sequenced keyframes: same easing applied to all keyframes
PASS Equivalent property-indexed and sequenced keyframes: same composite applied to all keyframes
PASS Keyframes are read from a custom iterator
PASS 'easing' and 'offset' are ignored on iterable objects
PASS Keyframes are read from a custom iterator with multiple properties specified
PASS Keyframes are read from a custom iterator with where an offset is specified
PASS If a keyframe throws for an animatable property, that exception should be propagated
PASS Reading from a custom iterator that returns a non-object keyframe should throw
PASS An undefined keyframe returned from a custom iterator should be treated as a default keyframe
PASS A null keyframe returned from a custom iterator should be treated as a default keyframe
PASS A list of values returned from a custom iterator should be ignored
PASS If a custom iterator throws from next(), the exception should be rethrown
PASS Accessing a Symbol.iterator property that throws should rethrow
PASS A non-object returned from the Symbol.iterator property should cause a TypeError to be thrown
PASS Only enumerable properties on keyframes are read
PASS Only properties defined directly on keyframes are read
PASS Only enumerable properties on property-indexed keyframes are read
PASS Only properties defined directly on property-indexed keyframes are read
PASS Properties are read in ascending order by Unicode codepoint
Harness: the test ran to completion.
......@@ -35,10 +35,16 @@ const gNonAnimatableProps = [
'transitionDuration',
'transitionProperty',
'transitionTimingFunction',
'display',
'contain',
'direction',
'unsupportedProperty',
'display',
'textOrientation',
'unicodeBidi',
'willChange',
'writingMode',
'unsupportedProperty',
'font-size', // Supported property that uses dashes
];
......
......@@ -1245,12 +1245,18 @@ bool CSSAnimations::IsAnimationAffectingProperty(const CSSProperty& property) {
case CSSPropertyAnimationName:
case CSSPropertyAnimationPlayState:
case CSSPropertyAnimationTimingFunction:
case CSSPropertyContain:
case CSSPropertyDirection:
case CSSPropertyDisplay:
case CSSPropertyTextOrientation:
case CSSPropertyTransition:
case CSSPropertyTransitionDelay:
case CSSPropertyTransitionDuration:
case CSSPropertyTransitionProperty:
case CSSPropertyTransitionTimingFunction:
case CSSPropertyUnicodeBidi:
case CSSPropertyWillChange:
case CSSPropertyWritingMode:
return true;
default:
return false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment