mirror of
https://github.com/servo/servo.git
synced 2025-08-18 11:55:39 +01:00
Update web-platform-tests to revision b'bcf4a27c0a9dbb07d974a880acb26eb289a85c7e'
This commit is contained in:
parent
293c8623fa
commit
61b963c73e
183 changed files with 3880 additions and 1012 deletions
|
@ -5,47 +5,86 @@
|
|||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/web-animations/testcommon.js"></script>
|
||||
<style>
|
||||
#scroller {
|
||||
overflow: scroll;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
#contents {
|
||||
height: 200px;
|
||||
}
|
||||
@keyframes expand {
|
||||
from { width: 100px; }
|
||||
to { width: 200px; }
|
||||
}
|
||||
#element {
|
||||
width: 0px;
|
||||
animation: expand 10s linear paused;
|
||||
animation-timeline: timeline;
|
||||
.scroller {
|
||||
overflow: scroll;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
</style>
|
||||
<div id="container">
|
||||
<div id=element></div>
|
||||
</div>
|
||||
<main id=main></main>
|
||||
<script>
|
||||
|
||||
promise_test(async (t) => {
|
||||
let div = document.createElement('div');
|
||||
div.setAttribute('id', 'scroller');
|
||||
div.style.scrollTimeline = 'timeline';
|
||||
div.innerHTML = '<div id=contents></div>';
|
||||
try {
|
||||
container.insertBefore(div, element);
|
||||
|
||||
// The source has no layout box at the time the scroll timeline is created.
|
||||
assert_equals(getComputedStyle(element).width, '0px');
|
||||
scroller.offsetTop; // Ensure a layout box for the scroller.
|
||||
// Wait for an update to the timeline state:
|
||||
await waitForNextFrame();
|
||||
// The timeline should now be active, and the animation should apply:
|
||||
assert_equals(getComputedStyle(element).width, '100px');
|
||||
} finally {
|
||||
div.remove();
|
||||
function inflate(t, template) {
|
||||
t.add_cleanup(() => main.replaceChildren());
|
||||
main.append(template.content.cloneNode(true));
|
||||
main.offsetTop;
|
||||
}
|
||||
}, 'Animation does not apply when timeline is initially inactive');
|
||||
|
||||
</script>
|
||||
|
||||
<template id=basic>
|
||||
<style>
|
||||
#timeline {
|
||||
scroll-timeline: timeline;
|
||||
}
|
||||
#element {
|
||||
width: 0px;
|
||||
animation: expand 10s linear paused;
|
||||
animation-timeline: timeline;
|
||||
}
|
||||
</style>
|
||||
<div id="container">
|
||||
<div id=timeline class=scroller><div>
|
||||
<div id=element></div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
promise_test(async (t) => {
|
||||
inflate(t, basic);
|
||||
await waitForNextFrame();
|
||||
assert_equals(getComputedStyle(element).width, '0px');
|
||||
}, 'Animation does not apply when the timeline is inactive because there is ' +
|
||||
'not scroll range');
|
||||
</script>
|
||||
|
||||
<template id=dynamically_change_range>
|
||||
<style>
|
||||
#contents {
|
||||
height: 200px;
|
||||
}
|
||||
#element {
|
||||
width: 0px;
|
||||
animation: expand 10s linear paused;
|
||||
animation-timeline: timeline;
|
||||
}
|
||||
</style>
|
||||
<div id="container">
|
||||
<div id=element></div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
promise_test(async (t) => {
|
||||
inflate(t, dynamically_change_range);
|
||||
await waitForNextFrame();
|
||||
|
||||
let div = document.createElement('div');
|
||||
div.setAttribute('class', 'scroller');
|
||||
div.style.scrollTimeline = 'timeline';
|
||||
div.innerHTML = '<div id=contents></div>';
|
||||
try {
|
||||
container.insertBefore(div, element);
|
||||
|
||||
// The source has no layout box at the time the scroll timeline is created.
|
||||
assert_equals(getComputedStyle(element).width, '0px');
|
||||
scroller.offsetTop; // Ensure a layout box for the scroller.
|
||||
// Wait for an update to the timeline state:
|
||||
await waitForNextFrame();
|
||||
// The timeline should now be active, and the animation should apply:
|
||||
assert_equals(getComputedStyle(element).width, '100px');
|
||||
} finally {
|
||||
div.remove();
|
||||
}
|
||||
}, 'Animation does not apply when timeline is initially inactive');
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue