mirror of
https://github.com/servo/servo.git
synced 2025-08-18 03:45:33 +01:00
Update web-platform-tests to revision b'b7c1d80f991820c17aaae0477052c30d7f699eba'
This commit is contained in:
parent
189236862a
commit
274846e69e
217 changed files with 7520 additions and 2797 deletions
|
@ -0,0 +1,153 @@
|
|||
<!DOCTYPE html>
|
||||
<html class=reftest-wait>
|
||||
<title>View transitions: ensure :only-child is supported on view-transition-old</title>
|
||||
<link rel="help" href="https://github.com/WICG/view-transitions">
|
||||
<link rel="author" href="mailto:khushalsagar@chromium.org">
|
||||
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
|
||||
<style>
|
||||
::view-transition-old(root) {
|
||||
background-color: blue;
|
||||
}
|
||||
::view-transition-old(target) {
|
||||
background-color: blue;
|
||||
}
|
||||
::view-transition-old(*) {
|
||||
color: blue;
|
||||
}
|
||||
|
||||
::view-transition-old(root):only-child {
|
||||
background-color: red;
|
||||
}
|
||||
::view-transition-old(target):only-child {
|
||||
background-color: red;
|
||||
}
|
||||
::view-transition-old(*):only-child {
|
||||
color: red;
|
||||
}
|
||||
|
||||
#target {
|
||||
contain: layout;
|
||||
}
|
||||
|
||||
</style>
|
||||
<div id="target"></div>
|
||||
|
||||
<script>
|
||||
let matchedColor = "rgb(255, 0, 0)";
|
||||
let notMatchedColor = "rgb(0, 0, 255)";
|
||||
|
||||
promise_test(() => {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
document.documentElement.style.viewTransitionName = "root";
|
||||
target.style.viewTransitionName = "none";
|
||||
let transition = document.startViewTransition(() => {
|
||||
document.documentElement.style.viewTransitionName = "none";
|
||||
});
|
||||
|
||||
transition.ready.then(() => {
|
||||
let style = getComputedStyle(
|
||||
document.documentElement, ":view-transition-old(root)");
|
||||
if (style.backgroundColor == matchedColor && style.color == matchedColor)
|
||||
resolve();
|
||||
else
|
||||
reject(style.backgroundColor + " and " + style.color);
|
||||
});
|
||||
});
|
||||
}, ":only-child should match because ::view-transition-new is not generated (root to none)");
|
||||
|
||||
promise_test(() => {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
document.documentElement.style.viewTransitionName = "root";
|
||||
target.style.viewTransitionName = "none";
|
||||
let transition = document.startViewTransition();
|
||||
|
||||
transition.ready.then(() => {
|
||||
let style = getComputedStyle(
|
||||
document.documentElement, ":view-transition-old(root)");
|
||||
if (style.backgroundColor == notMatchedColor && style.color == notMatchedColor)
|
||||
resolve();
|
||||
else
|
||||
reject(style.backgroundColor + " and " + style.color);
|
||||
});
|
||||
});
|
||||
}, ":only-child should not match because ::view-transition-new is generated (root to root)");
|
||||
|
||||
promise_test(() => {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
document.documentElement.style.viewTransitionName = "root";
|
||||
target.style.viewTransitionName = "none";
|
||||
let transition = document.startViewTransition(() => {
|
||||
document.documentElement.style.viewTransitionName = "none";
|
||||
target.style.viewTransitionName = "root";
|
||||
});
|
||||
|
||||
transition.ready.then(() => {
|
||||
let style = getComputedStyle(
|
||||
document.documentElement, ":view-transition-old(root)");
|
||||
if (style.backgroundColor == notMatchedColor && style.color == notMatchedColor)
|
||||
resolve();
|
||||
else
|
||||
reject(style.backgroundColor + " and " + style.color);
|
||||
});
|
||||
});
|
||||
}, ":only-child should not match because ::view-transition-new is generated (root to element)");
|
||||
|
||||
promise_test(() => {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
target.style.viewTransitionName = "target";
|
||||
document.documentElement.style.viewTransitionName = "none";
|
||||
let transition = document.startViewTransition(() => {
|
||||
target.style.viewTransitionName = "none";
|
||||
});
|
||||
|
||||
transition.ready.then(() => {
|
||||
let style = getComputedStyle(
|
||||
document.documentElement, ":view-transition-old(target)");
|
||||
if (style.backgroundColor == matchedColor && style.color == matchedColor)
|
||||
resolve();
|
||||
else
|
||||
reject(style.backgroundColor + " and " + style.color);
|
||||
});
|
||||
});
|
||||
}, ":only-child should match because ::view-transition-new is not generated (element to none)");
|
||||
|
||||
promise_test(() => {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
target.style.viewTransitionName = "root";
|
||||
document.documentElement.style.viewTransitionName = "none";
|
||||
let transition = document.startViewTransition(() => {
|
||||
document.documentElement.style.viewTransitionName = "root";
|
||||
target.style.viewTransitionName = "none";
|
||||
});
|
||||
|
||||
transition.ready.then(() => {
|
||||
let style = getComputedStyle(
|
||||
document.documentElement, ":view-transition-old(root)");
|
||||
if (style.backgroundColor == notMatchedColor && style.color == notMatchedColor)
|
||||
resolve();
|
||||
else
|
||||
reject(style.backgroundColor + " and " + style.color);
|
||||
});
|
||||
});
|
||||
}, ":only-child should not match because ::view-transition-new is generated (element to root)");
|
||||
|
||||
promise_test(() => {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
target.style.viewTransitionName = "target";
|
||||
document.documentElement.style.viewTransitionName = "none";
|
||||
let transition = document.startViewTransition();
|
||||
|
||||
transition.ready.then(() => {
|
||||
let style = getComputedStyle(
|
||||
document.documentElement, ":view-transition-old(target)");
|
||||
if (style.backgroundColor == notMatchedColor && style.color == notMatchedColor)
|
||||
resolve();
|
||||
else
|
||||
reject(style.backgroundColor + " and " + style.color);
|
||||
});
|
||||
});
|
||||
}, ":only-child should not match because ::view-transition-new is generated (element to element)");
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue