forked from web-platform-tests/wpt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reland #2 "Implement CSSTransitionDiscrete which enables transitions …
…on discrete properties." Original patch: https://crrev.com/c/4219315 Revert 1: https://crrev.com/c/4305045 Reland 1: https://crrev.com/c/4304846 Revert 2: https://crrev.com/c/4307944 Despite the most relaxed value in TestExpectations for discrete-no-interpolation.tentative.html, some bots are still breaking for reasons I don't understand. I am going to remove the test completely until it stops crashing or failing. This patch will still be useful despite the lack of tests because other people are doing prototyping work that builds on this change. Bug: 1399631, 1413556 Change-Id: Ic08f16d6436e37acc8947a94ca699c1735fe221f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4308075 Commit-Queue: Joey Arhar <jarhar@chromium.org> Reviewed-by: Mason Freed <masonf@chromium.org> Auto-Submit: Joey Arhar <jarhar@chromium.org> Cr-Commit-Position: refs/heads/main@{#1114026}
- Loading branch information
1 parent
5d5a731
commit 268250b
Showing
4 changed files
with
86 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<!DOCTYPE html> | ||
<link rel=author href="mailto:jarhar@chromium.org"> | ||
<link rel=help href="https://github.com/w3c/csswg-drafts/issues/4441"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
|
||
<div id=target1 class=target>hello</div> | ||
<div id=target2 class=target>hello</div> | ||
|
||
<style> | ||
.target { | ||
float: left; | ||
width: 100px; | ||
height: 100px; | ||
} | ||
.target.animated { | ||
float: right; | ||
} | ||
|
||
#target1 { | ||
transition: all 1s, float 1s; | ||
} | ||
|
||
#target2 { | ||
transition: all 1s; | ||
} | ||
</style> | ||
|
||
<script> | ||
promise_test(async () => { | ||
let transitionstartFired = false; | ||
target1.addEventListener('transitionstart', () => { | ||
transitionstartFired = true; | ||
}); | ||
await new Promise(resolve => requestAnimationFrame(resolve)); | ||
target1.classList.add('animated'); | ||
await new Promise(resolve => requestAnimationFrame(resolve)); | ||
assert_true(transitionstartFired); | ||
}, 'all with an explicit discrete property should animate.'); | ||
|
||
promise_test(async () => { | ||
let transitionstartFired = false; | ||
target2.addEventListener('transitionstart', () => { | ||
transitionstartFired = true; | ||
}); | ||
await new Promise(resolve => requestAnimationFrame(resolve)); | ||
target2.classList.add('animated'); | ||
await new Promise(resolve => requestAnimationFrame(resolve)); | ||
assert_false(transitionstartFired); | ||
}, 'all without an explicit discrete property should not animate.'); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!DOCTYPE html> | ||
<link rel=help href="mailto:jarhar@chromium.org"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
|
||
<div id=target>target</div> | ||
<style> | ||
#target { | ||
display: none; | ||
transition: 1s; | ||
color: red; | ||
} | ||
#target.animated { | ||
transition: 1s; | ||
color: green; | ||
} | ||
</style> | ||
|
||
<script> | ||
test(() => { | ||
target.addEventListener('transitionstart', () => { | ||
assert_unreached('transitionstart should not be fired.'); | ||
}); | ||
target.classList.add('animated'); | ||
assert_equals(target.getAnimations().length, 0, | ||
'There should not be any animations running.'); | ||
}, 'Transitions and animations should not occur on display:none elements.'); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters