mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
36 lines
1.1 KiB
HTML
36 lines
1.1 KiB
HTML
<!DOCTYPE html>
|
|
<html class=reftest-wait>
|
|
<title>View transitions: ensures view-transition-name is tracked on element added by script</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>
|
|
#first {
|
|
width: 100px;
|
|
height: 100px;
|
|
background: blue;
|
|
view-transition-name: first;
|
|
}
|
|
</style>
|
|
<body>
|
|
<div>
|
|
<div id=first></div>
|
|
</div>
|
|
</body>
|
|
<script>
|
|
promise_test(async t => {
|
|
return new Promise((resolve, reject) => {
|
|
// Remove and add an uncontained element. Even though this element doesn't
|
|
// create a stacking context its verified during the transition.
|
|
const element = document.getElementById("first");
|
|
element.remove();
|
|
document.body.appendChild(element);
|
|
|
|
let transition = document.startViewTransition();
|
|
transition.ready.then(reject, resolve);
|
|
});
|
|
}, "view-transition-name on an element added by script should be visited when discovering named elements");
|
|
</script>
|