mirror of
https://github.com/servo/servo.git
synced 2025-08-09 23:45:35 +01:00
Update web-platform-tests to revision b'c9946198c9ee19db3b4974a388fae45da844a94a'
This commit is contained in:
parent
8dfd613aa1
commit
06e9d5a631
366 changed files with 8783 additions and 2336 deletions
|
@ -62,6 +62,7 @@
|
|||
promise_test(async t => {
|
||||
target.classList.add('anim-1');
|
||||
const anim = target.getAnimations()[0];
|
||||
await anim.ready;
|
||||
t.add_cleanup(() => {
|
||||
target.classList.remove('anim-1');
|
||||
});
|
||||
|
@ -92,6 +93,8 @@
|
|||
promise_test(async t => {
|
||||
target.classList.add('anim-2');
|
||||
const anim = target.getAnimations()[0];
|
||||
await anim.ready;
|
||||
|
||||
t.add_cleanup(() => {
|
||||
target.classList.remove('anim-2');
|
||||
});
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
<!DOCTYPE html>
|
||||
<title>Reference for default scroll() timeline</title>
|
||||
<style>
|
||||
html {
|
||||
min-height: 100%;
|
||||
padding-bottom: 100px;
|
||||
}
|
||||
|
||||
#box {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
background-color: green;
|
||||
}
|
||||
|
||||
* {
|
||||
margin-top: 0px;
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="box"></div>
|
|
@ -4,7 +4,7 @@
|
|||
<link rel="help" href="https://drafts.csswg.org/scroll-animations-1/#scroll-notation">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-animations-2/#animation-timeline">
|
||||
<meta name="assert" content="CSS animation correctly updates values when using the default scroll() timeline">
|
||||
<link rel="match" href="../scroll-timeline-default-ref.html">
|
||||
<link rel="match" href="scroll-timeline-default-print-ref.html">
|
||||
|
||||
<style>
|
||||
@keyframes update {
|
||||
|
@ -25,12 +25,6 @@
|
|||
animation-timeline: scroll();
|
||||
}
|
||||
|
||||
#covered {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
background-color: red;
|
||||
}
|
||||
|
||||
* {
|
||||
margin-top: 0px;
|
||||
margin-bottom: 0px;
|
||||
|
@ -38,7 +32,6 @@
|
|||
</style>
|
||||
|
||||
<div id="box"></div>
|
||||
<div id="covered"></div>
|
||||
<script src="/web-animations/testcommon.js"></script>
|
||||
<script>
|
||||
document.documentElement.addEventListener('TestRendered', async () => {
|
||||
|
@ -51,6 +44,10 @@
|
|||
await waitForCompositorReady();
|
||||
|
||||
// Move the scroller to the halfway point.
|
||||
// When printing, a timeline associated with the document's scrolling
|
||||
// element will become inactive. The root scroller is considered to be
|
||||
// fully in view with a scroll range of zero.
|
||||
// https://github.com/w3c/csswg-drafts/issues/8226
|
||||
const maxScroll = scroller.scrollHeight - scroller.clientHeight;
|
||||
scroller.scrollTop = 0.5 * maxScroll;
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
main {
|
||||
height: 0px;
|
||||
overflow: hidden;
|
||||
scroll-timeline: timeline1 defer, timeline2 defer;
|
||||
}
|
||||
.scroller {
|
||||
height: 100px;
|
||||
|
@ -49,7 +50,7 @@
|
|||
function insertScroller(timeline_name) {
|
||||
let scroller = document.createElement('div');
|
||||
scroller.classList.add('scroller');
|
||||
scroller.style.scrollTimeline = timeline_name;
|
||||
scroller.style.scrollTimeline = `${timeline_name} ancestor`;
|
||||
scroller.append(document.createElement('div'));
|
||||
main.insertBefore(scroller, element1);
|
||||
}
|
||||
|
|
|
@ -23,6 +23,8 @@ test_valid_value('scroll-timeline', 'horizontal block', 'horizontal');
|
|||
test_valid_value('scroll-timeline', 'a, b, c');
|
||||
test_valid_value('scroll-timeline', 'a inline, b block, c vertical', 'a inline, b, c vertical');
|
||||
test_valid_value('scroll-timeline', 'auto');
|
||||
test_valid_value('scroll-timeline', 'abc defer vertical', 'abc vertical defer');
|
||||
test_valid_value('scroll-timeline', 'abc vertical defer');
|
||||
|
||||
test_invalid_value('scroll-timeline', '');
|
||||
test_invalid_value('scroll-timeline', 'abc abc');
|
||||
|
@ -44,6 +46,8 @@ test_computed_value('scroll-timeline', 'vertical block', 'vertical');
|
|||
test_computed_value('scroll-timeline', 'horizontal block', 'horizontal');
|
||||
test_computed_value('scroll-timeline', 'a, b, c');
|
||||
test_computed_value('scroll-timeline', 'a inline, b block, c vertical', 'a inline, b, c vertical');
|
||||
test_computed_value('scroll-timeline', 'abc defer vertical', 'abc vertical defer');
|
||||
test_computed_value('scroll-timeline', 'abc vertical defer');
|
||||
|
||||
test_shorthand_value('scroll-timeline', 'abc vertical local',
|
||||
{
|
||||
|
|
|
@ -22,7 +22,9 @@
|
|||
margin-right: 0px;
|
||||
}
|
||||
}
|
||||
|
||||
#scroller {
|
||||
scroll-timeline-attachment: defer t1;
|
||||
border: 10px solid lightgray;
|
||||
overflow-y: scroll;
|
||||
overflow-x: hidden;
|
||||
|
@ -30,6 +32,7 @@
|
|||
height: 200px;
|
||||
}
|
||||
#block {
|
||||
scroll-timeline-attachment: ancestor;
|
||||
margin-top: 800px;
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
|
@ -64,7 +67,7 @@
|
|||
await waitForNextFrame();
|
||||
const anims = document.getAnimations();
|
||||
assert_equals(anims.length, 1,
|
||||
"Should have one animation attatched to the view-timeline");
|
||||
"Should have one animation attached to the view-timeline");
|
||||
const anim = anims[0];
|
||||
await anim.ready;
|
||||
await waitForNextFrame();
|
||||
|
@ -88,7 +91,7 @@
|
|||
'Initial keyframes with active view-timeline');
|
||||
|
||||
block.style.display = 'none';
|
||||
// View-timeline becomes invalid. Keyframes with timeline offsets must be
|
||||
// View-timeline becomes inactive. Keyframes with timeline offsets must be
|
||||
// ignored.
|
||||
frames = anim.effect.getKeyframes();
|
||||
let expected_unresolved_offsets = [
|
||||
|
@ -109,6 +112,9 @@
|
|||
'Keyframes with invalid view timeline');
|
||||
|
||||
block.style.display = 'block';
|
||||
// Timeline remains inactive until next frame.
|
||||
await waitForNextFrame();
|
||||
|
||||
// Ensure that keyframes with timeline-offsets are restored.
|
||||
frames = anim.effect.getKeyframes();
|
||||
|
||||
|
|
|
@ -87,9 +87,12 @@
|
|||
container.scrollTop = 400;
|
||||
await waitForNextFrame();
|
||||
assert_equals(getComputedStyle(subject).opacity, '1',
|
||||
'Effect at entry 100% (post resize)');
|
||||
'Effect at entry 100%');
|
||||
|
||||
// Reducing the viewport by 100px, shifts the keyframe offsets.
|
||||
// The entry range shifts from [200px, 400px] to [300px, 500px].
|
||||
container.style.height = '300px';
|
||||
|
||||
await waitForNextFrame();
|
||||
assert_equals(getComputedStyle(subject).opacity, '0.5',
|
||||
'Effect at entry 50% (post resize)');
|
||||
|
|
|
@ -22,6 +22,8 @@ test_valid_value('view-timeline', 'horizontal block', 'horizontal');
|
|||
test_valid_value('view-timeline', 'a, b, c');
|
||||
test_valid_value('view-timeline', 'a inline, b block, c vertical', 'a inline, b, c vertical');
|
||||
test_valid_value('view-timeline', 'auto');
|
||||
test_valid_value('view-timeline', 'abc defer vertical', 'abc vertical defer');
|
||||
test_valid_value('view-timeline', 'abc vertical defer');
|
||||
|
||||
test_invalid_value('view-timeline', 'abc abc');
|
||||
test_invalid_value('view-timeline', 'block none');
|
||||
|
@ -39,6 +41,8 @@ test_computed_value('view-timeline', 'vertical block', 'vertical');
|
|||
test_computed_value('view-timeline', 'horizontal block', 'horizontal');
|
||||
test_computed_value('view-timeline', 'a, b, c');
|
||||
test_computed_value('view-timeline', 'a inline, b block, c vertical', 'a inline, b, c vertical');
|
||||
test_computed_value('view-timeline', 'abc defer vertical', 'abc vertical defer');
|
||||
test_computed_value('view-timeline', 'abc vertical defer');
|
||||
|
||||
test_shorthand_value('view-timeline', 'abc vertical',
|
||||
{
|
||||
|
|
|
@ -0,0 +1,71 @@
|
|||
<!DOCTYPE html>
|
||||
<html class="reftest-wait">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Update subject bounds refTest</title>
|
||||
<link rel="help" src="https://github.com/w3c/csswg-drafts/issues/8694">
|
||||
<link rel="match"
|
||||
href="./animation-update-ref.html?translate=100px&scroll=800">
|
||||
<script src="/web-animations/testcommon.js"></script>
|
||||
</head>
|
||||
<style type="text/css">
|
||||
@keyframes anim {
|
||||
from { transform: translateX(100px) }
|
||||
to { transform: translateX(0px) }
|
||||
}
|
||||
#scroller {
|
||||
border: 1px solid black;
|
||||
overflow: hidden;
|
||||
width: 300px;
|
||||
height: 200px;
|
||||
}
|
||||
#target {
|
||||
margin-bottom: 800px;
|
||||
margin-top: 700px;
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
width: 100px;
|
||||
height: 200px;
|
||||
z-index: -1;
|
||||
background-color: green;
|
||||
animation: anim auto both linear;
|
||||
animation-timeline: timeline;
|
||||
view-timeline: timeline;
|
||||
animation-range: exit;
|
||||
}
|
||||
#target.bounds-update {
|
||||
height: 100px;
|
||||
/* Keep the scroll range the same. */
|
||||
margin-top: 800px;
|
||||
}
|
||||
</style>
|
||||
<body>
|
||||
<div id="scroller">
|
||||
<div id="target"></div>
|
||||
</div>
|
||||
</body>
|
||||
<script type="text/javascript">
|
||||
document.documentElement.addEventListener('TestRendered', async () => {
|
||||
runTest();
|
||||
}, { once: true });
|
||||
|
||||
async function runTest() {
|
||||
await waitForCompositorReady();
|
||||
|
||||
const anim = target.getAnimations()[0];
|
||||
|
||||
// Scroll to exit 50%.
|
||||
scroller.scrollTop = 800;
|
||||
await waitForNextFrame();
|
||||
|
||||
// After the update to the animation range, the positioning is exit 0%
|
||||
target.classList.add('bounds-update');
|
||||
await waitForNextFrame();
|
||||
|
||||
// Make sure change to animation range was properly picked up.
|
||||
document.documentElement.classList.remove("reftest-wait");
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue