mirror of
https://github.com/servo/servo.git
synced 2025-07-23 15:23:42 +01:00
Add test for #12749
This commit is contained in:
parent
0e3d4ab407
commit
a3d1457809
2 changed files with 46 additions and 0 deletions
|
@ -6168,6 +6168,12 @@
|
|||
"url": "/_mozilla/css/animations/basic-transition.html"
|
||||
}
|
||||
],
|
||||
"css/animations/transition-raf.html": [
|
||||
{
|
||||
"path": "css/animations/transition-raf.html",
|
||||
"url": "/_mozilla/css/animations/transition-raf.html"
|
||||
}
|
||||
],
|
||||
"css/empty-keyframes.html": [
|
||||
{
|
||||
"path": "css/empty-keyframes.html",
|
||||
|
|
40
tests/wpt/mozilla/tests/css/animations/transition-raf.html
Normal file
40
tests/wpt/mozilla/tests/css/animations/transition-raf.html
Normal file
|
@ -0,0 +1,40 @@
|
|||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<title></title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<style>
|
||||
#box {
|
||||
width: 100px;
|
||||
height: 200px;
|
||||
background: red;
|
||||
transition: width 1s linear;
|
||||
}
|
||||
|
||||
#box.expose {
|
||||
width: 200px;
|
||||
}
|
||||
</style>
|
||||
<div id="box"></div>
|
||||
<script>
|
||||
var box = document.getElementById('box');
|
||||
var test = new window.TestBinding();
|
||||
async_test(function(t) {
|
||||
// Dummy RAF loop.
|
||||
(function onFrame() {
|
||||
var style = getComputedStyle(box).getPropertyValue('width');
|
||||
if (style === '150px') {
|
||||
t.done();
|
||||
} else {
|
||||
window.requestAnimationFrame(onFrame);
|
||||
}
|
||||
}());
|
||||
|
||||
window.addEventListener('load', function() {
|
||||
assert_equals(getComputedStyle(box).getPropertyValue('width'), '100px');
|
||||
box.className = "expose";
|
||||
// Let the first restyle run at zero, then advance the clock.
|
||||
setTimeout(function() { test.advanceClock(500, false) }, 0);
|
||||
});
|
||||
}, "Transitions should work during RAF loop")
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue