-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
view-transitions: Update behaviour of finished promise.
The finished promise should reflect the status of domUpdated if the transition is skipped before animations could finish. See resolution at w3c/csswg-drafts#7956. Change-Id: If340d63587d87237587fc3aa3de98f742d46218e
- Loading branch information
1 parent
c5b10ac
commit 79f1ebe
Showing
2 changed files
with
64 additions
and
14 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
css/css-view-transitions/duplicate_tag_rejects_capture.html
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,47 @@ | ||
<!DOCTYPE html> | ||
<html class=reftest-wait> | ||
<title>Shared transitions: root tag is reserved</title> | ||
<link rel="help" href="https://github.com/WICG/view-transitions"> | ||
<link rel="author" href="mailto:[email protected]"> | ||
|
||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
|
||
<style> | ||
div { | ||
width: 100px; | ||
height: 100px; | ||
background: blue; | ||
contain: paint; | ||
} | ||
</style> | ||
|
||
<div id=first></div> | ||
<div id=second></div> | ||
|
||
<script> | ||
promise_test(async t => { | ||
return new Promise((resolve, reject) => { | ||
first.style = "view-transition-name: target"; | ||
second.style = "view-transition-name: target"; | ||
let transition = document.startViewTransition(); | ||
|
||
// Ready rejected first since invoking the dom callback is an async task. | ||
let readyRejected = false; | ||
transition.ready.then(reject, () => {readyRejected = true;}); | ||
|
||
// The domUpdate promise resolves (since there is no callback). | ||
let domUpdatedResolved = false; | ||
transition.domUpdated.then(() => { | ||
assert_true(readyRejected, "ready not rejected before domUpdated"); | ||
domUpdatedResolved = true; | ||
}, reject); | ||
|
||
// Finally finish resolves. | ||
transition.finished.then(() => { | ||
assert_true(domUpdatedResolved, "domUpdated not resolved before finish"); | ||
resolve(); | ||
}, reject); | ||
}); | ||
}, "Two different elements with the same tag rejects capture"); | ||
</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