mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
46 lines
1.2 KiB
HTML
46 lines
1.2 KiB
HTML
<!DOCTYPE html>
|
|
<html class=reftest-wait>
|
|
<title>View transitions: transition skipped if no containment on new element</title>
|
|
<link rel="help" href="https://www.w3.org/TR/css-view-transitions-1/">
|
|
<link rel="author" href="mailto:khushalsagar@chromium.org">
|
|
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
|
|
<style>
|
|
div {
|
|
width: 100px;
|
|
height: 100px;
|
|
background: blue;
|
|
view-transition-name: target;
|
|
contain: paint;
|
|
}
|
|
</style>
|
|
|
|
<div id=first></div>
|
|
|
|
<script>
|
|
promise_test(async t => {
|
|
return new Promise(async (resolve, reject) => {
|
|
let transition = document.startViewTransition(() => {
|
|
first.style.contain = "none";
|
|
});
|
|
|
|
let readyRejected = false;
|
|
transition.ready.then(reject, () => { readyRejected = true; });
|
|
|
|
let domUpdated = false;
|
|
transition.domUpdated.then(() => { domUpdated = true; }, reject);
|
|
transition.finished.then(() => {
|
|
assert_true(readyRejected, "ready not rejected");
|
|
assert_true(domUpdated, "dom not updated");
|
|
|
|
if (window.getComputedStyle(first).contain == "none")
|
|
resolve();
|
|
else
|
|
reject("dom update callback did not run");
|
|
|
|
}, reject);
|
|
});
|
|
}, "uncontained new element should skip the transition");
|
|
</script>
|