Skip to content

Commit

Permalink
CSSTransitionDiscrete: Rename transition-animation-type to transition…
Browse files Browse the repository at this point in the history
…-behavior

This patch also renames the "discrete" value to "allow-discrete"
This was resolved in the csswg:
w3c/csswg-drafts#8857 (comment)

Bug: 1453112
Change-Id: I9b9aad124376d5e7bf532d891b7a0e25b651ce2d
  • Loading branch information
josepharhar authored and chromium-wpt-export-bot committed Jul 28, 2023
1 parent 4b2a0c0 commit 7b84d89
Show file tree
Hide file tree
Showing 19 changed files with 86 additions and 86 deletions.
8 changes: 4 additions & 4 deletions css/css-animations/display-interpolation.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

test_interpolation({
property: 'display',
animationType: 'discrete',
behavior: 'allow-discrete',
from: 'block',
to: 'none',
}, [
Expand All @@ -43,7 +43,7 @@
// can be worked around by using @initial.
test_interpolation({
property: 'display',
animationType: 'discrete',
behavior: 'allow-discrete',
from: 'none',
to: 'block',
'CSS Transitions with transition: all': alwaysBlock,
Expand All @@ -65,14 +65,14 @@

test_interpolation({
property: 'display',
animationType: 'discrete',
behavior: 'allow-discrete',
from: 'block',
to: 'block'
}, alwaysBlock);

test_interpolation({
property: 'display',
animationType: 'discrete',
behavior: 'allow-discrete',
from: 'none',
to: 'none'
}, alwaysNone);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

test_interpolation({
property: 'content-visibility',
animationType: 'discrete',
behavior: 'allow-discrete',
from: 'visible',
to: 'hidden',
}, [
Expand All @@ -40,7 +40,7 @@

test_interpolation({
property: 'content-visibility',
animationType: 'discrete',
behavior: 'allow-discrete',
from: 'hidden',
to: 'visible',
}, [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
transition-delay: 2s;
transition-property: overlay;
transition-duration: 2s;
transition-animation-type: discrete;
transition-behavior: allow-discrete;
}
[popover]::backdrop {
background-color: blue;
Expand Down
2 changes: 1 addition & 1 deletion css/css-position/overlay/overlay-transition-backdrop.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
display: block;
visibility: hidden;
transition: overlay 60s step-end;
transition-animation-type: discrete;
transition-behavior: allow-discrete;
}
[popover]::backdrop {
background-color: green;
Expand Down
2 changes: 1 addition & 1 deletion css/css-position/overlay/overlay-transition-finished.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
}
#transition-in {
transition: overlay 0.1s step-end;
transition-animation-type: discrete;
transition-behavior: allow-discrete;
background-color: green;
}
</style>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
}
#transition-in {
transition: overlay 60s step-end;
transition-animation-type: discrete;
transition-behavior: allow-discrete;
background-color: red;
}
</style>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
}
#green.transition-enabled {
transition: overlay 60s step-end;
transition-animation-type: discrete;
transition-behavior: allow-discrete;
}
</style>
<div id="red" popover="manual"></div>
Expand Down
2 changes: 1 addition & 1 deletion css/css-position/overlay/overlay-transition.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}
.enable-transitions :is(#transition-in, #transition-out) {
transition: overlay 60s step-end;
transition-animation-type: discrete;
transition-behavior: allow-discrete;
}
</style>
<div id="container">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from: "from",
to: "to",
expected: "to",
animationType: "discrete",
behavior: "allow-discrete",
}, 'A custom property of type <custom-ident> can yield a discrete CSS Transition');

</script>
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from: 'url("https://example.com/from")',
to: 'url("https://example.com/to")',
expected: 'url("https://example.com/to")',
animationType: 'discrete',
behavior: 'allow-discrete',
}, 'A custom property of type <image> can yield a CSS Transition');

</script>
Original file line number Diff line number Diff line change
Expand Up @@ -11,191 +11,191 @@
from: '100deg, 200deg',
to: '300deg',
expected: '300deg',
animationType: 'discrete',
behavior: 'allow-discrete',
}, 'A custom property of type <angle># yields a discrete CSS Transition if the lists do not contain the same number of values');

transition_test({
syntax: "<angle>+",
from: '100deg 200deg',
to: '300deg',
expected: '300deg',
animationType: 'discrete',
behavior: 'allow-discrete',
}, 'A custom property of type <angle>+ yields a discrete CSS Transition if the lists do not contain the same number of values');

transition_test({
syntax: "<color>#",
from: 'rgb(100, 100, 100), rgb(150, 150, 150)',
to: 'rgb(200, 200, 200)',
expected: 'rgb(200, 200, 200)',
animationType: 'discrete',
behavior: 'allow-discrete',
}, 'A custom property of type <color># yields a discrete CSS Transition if the lists do not contain the same number of values');

transition_test({
syntax: "<color>+",
from: 'rgb(100, 100, 100) rgb(150, 150, 150)',
to: 'rgb(200, 200, 200)',
expected: 'rgb(200, 200, 200)',
animationType: 'discrete',
behavior: 'allow-discrete',
}, 'A custom property of type <color>+ yields a discrete CSS Transition if the lists do not contain the same number of values');

transition_test({
syntax: "<custom-ident>#",
from: 'foo, bar',
to: 'baz',
expected: 'baz',
animationType: 'discrete',
behavior: 'allow-discrete',
}, 'A custom property of type <custom-ident># yields a discrete CSS Transition if the lists do not contain the same number of values');

transition_test({
syntax: "<custom-ident>+",
from: 'foo bar',
to: 'baz',
expected: 'baz',
animationType: 'discrete',
behavior: 'allow-discrete',
}, 'A custom property of type <custom-ident>+ yields a discrete CSS Transition if the lists do not contain the same number of values');

transition_test({
syntax: "<image>#",
from: 'url("https://example.com/foo"), url("https://example.com/bar")',
to: 'url("https://example.com/to")',
expected: 'url("https://example.com/to")',
animationType: 'discrete',
behavior: 'allow-discrete',
}, 'A custom property of type <image># yields a discrete CSS Transition if the lists do not contain the same number of values');

transition_test({
syntax: "<image>+",
from: 'url("https://example.com/foo") url("https://example.com/bar")',
to: 'url("https://example.com/to")',
expected: 'url("https://example.com/to")',
animationType: 'discrete',
behavior: 'allow-discrete',
}, 'A custom property of type <image>+ yields a discrete CSS Transition if the lists do not contain the same number of values');

transition_test({
syntax: "<integer>#",
from: '100, 200',
to: '300',
expected: '300',
animationType: 'discrete',
behavior: 'allow-discrete',
}, 'A custom property of type <integer># yields a discrete CSS Transition if the lists do not contain the same number of values');

transition_test({
syntax: "<integer>+",
from: '100 200',
to: '300',
expected: '300',
animationType: 'discrete',
behavior: 'allow-discrete',
}, 'A custom property of type <integer>+ yields a discrete CSS Transition if the lists do not contain the same number of values');

transition_test({
syntax: "<length-percentage>#",
from: '100px, 200px',
to: '300%',
expected: '300%',
animationType: 'discrete',
behavior: 'allow-discrete',
}, 'A custom property of type <length-percentage># yields a discrete CSS Transition if the lists do not contain the same number of values');

transition_test({
syntax: "<length-percentage>+",
from: '100px 200px',
to: '300%',
expected: '300%',
animationType: 'discrete',
behavior: 'allow-discrete',
}, 'A custom property of type <length-percentage>+ yields a discrete CSS Transition if the lists do not contain the same number of values');

transition_test({
syntax: "<length>#",
from: '100px, 200px',
to: '300px',
expected: '300px',
animationType: 'discrete',
behavior: 'allow-discrete',
}, 'A custom property of type <length># yields a discrete CSS Transition if the lists do not contain the same number of values');

transition_test({
syntax: "<length>+",
from: '100px 200px',
to: '300px',
expected: '300px',
animationType: 'discrete',
behavior: 'allow-discrete',
}, 'A custom property of type <length>+ yields a discrete CSS Transition if the lists do not contain the same number of values');

transition_test({
syntax: "<number>#",
from: '100, 200',
to: '300',
expected: '300',
animationType: 'discrete',
behavior: 'allow-discrete',
}, 'A custom property of type <number># yields a discrete CSS Transition if the lists do not contain the same number of values');

transition_test({
syntax: "<number>+",
from: '100 200',
to: '300',
expected: '300',
animationType: 'discrete',
behavior: 'allow-discrete',
}, 'A custom property of type <number>+ yields a discrete CSS Transition if the lists do not contain the same number of values');

transition_test({
syntax: "<percentage>#",
from: '100%, 200%',
to: '300%',
expected: '300%',
animationType: 'discrete',
behavior: 'allow-discrete',
}, 'A custom property of type <percentage># yields a discrete CSS Transition if the lists do not contain the same number of values');

transition_test({
syntax: "<percentage>+",
from: '100% 200%',
to: '300%',
expected: '300%',
animationType: 'discrete',
behavior: 'allow-discrete',
}, 'A custom property of type <percentage>+ yields a discrete CSS Transition if the lists do not contain the same number of values');

transition_test({
syntax: "<resolution>#",
from: '100dppx, 200dppx',
to: '300dppx',
expected: '300dppx',
animationType: 'discrete',
behavior: 'allow-discrete',
}, 'A custom property of type <resolution># yields a discrete CSS Transition if the lists do not contain the same number of values');

transition_test({
syntax: "<resolution>+",
from: '100dppx 200dppx',
to: '300dppx',
expected: '300dppx',
animationType: 'discrete',
behavior: 'allow-discrete',
}, 'A custom property of type <resolution>+ yields a discrete CSS Transition if the lists do not contain the same number of values');

transition_test({
syntax: "<time>#",
from: '100s, 200s',
to: '300s',
expected: '300s',
animationType: 'discrete',
behavior: 'allow-discrete',
}, 'A custom property of type <time># yields a discrete CSS Transition if the lists do not contain the same number of values');

transition_test({
syntax: "<time>+",
from: '100s 200s',
to: '300s',
expected: '300s',
animationType: 'discrete',
behavior: 'allow-discrete',
}, 'A custom property of type <time>+ yields a discrete CSS Transition if the lists do not contain the same number of values');

transition_test({
syntax: "<url>#",
from: 'url("https://example.com/foo"), url("https://example.com/bar")',
to: 'url("https://example.com/to")',
expected: 'url("https://example.com/to")',
animationType: 'discrete',
behavior: 'allow-discrete',
}, 'A custom property of type <url># yields a discrete CSS Transition if the lists do not contain the same number of values');

transition_test({
syntax: "<url>+",
from: 'url("https://example.com/foo") url("https://example.com/bar")',
to: 'url("https://example.com/to")',
expected: 'url("https://example.com/to")',
animationType: 'discrete',
behavior: 'allow-discrete',
}, 'A custom property of type <url>+ yields a discrete CSS Transition if the lists do not contain the same number of values');

</script>
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from: "translateX(100px)",
to: "translateX(200px)",
expected: "translateX(150px)",
animationType: 'discrete',
behavior: 'allow-discrete',
}, 'A custom property of type <transform-function> can yield a CSS Transition');

</script>
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from: "translateX(100px) scale(2)",
to: "translateX(200px) scale(4)",
expected: "translateX(150px) scale(3)",
animationType: 'discrete',
behavior: 'allow-discrete',
}, 'A custom property of type <transform-list> can yield a CSS Transition');

</script>
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from: 'url("https://example.com/from")',
to: 'url("https://example.com/to")',
expected: 'url("https://example.com/to")',
animationType: 'discrete',
behavior: 'allow-discrete',
}, 'A custom property of type <url> can yield a discrete CSS Transition');

</script>
4 changes: 2 additions & 2 deletions css/css-properties-values-api/resources/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ function transition_test(options, description) {
});

target.style.transition = `${options.transitionProperty} 1s -500ms linear`;
if (options.animationType) {
target.style.transitionAnimationType = options.animationType;
if (options.behavior) {
target.style.transitionBehavior = options.behavior;
}
target.style.setProperty(customProperty, options.to);

Expand Down
4 changes: 2 additions & 2 deletions css/css-transitions/all-with-discrete.tentative.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
width: 100px;
height: 100px;
transition: all 1s;
transition-animation-type: discrete;
transition-behavior: allow-discrete;
}
#target.animated {
float: right;
Expand All @@ -30,5 +30,5 @@
target.classList.add('animated');
await waitForAnimationFrames(1);
assert_true(transitionstartFired);
}, 'transition:all with transition-animation-type:discrete should animate discrete properties.');
}, 'transition:all with transition-behavior:allow-discrete should animate discrete properties.');
</script>
Loading

0 comments on commit 7b84d89

Please sign in to comment.