mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Update web-platform-tests to revision 10adbd6b133f1ccf77a27ed51ffd3e7a00a499ee
This commit is contained in:
parent
ecef8994e0
commit
1d6ba62c8f
119 changed files with 4676 additions and 523 deletions
|
@ -0,0 +1,75 @@
|
|||
<!DOCTYPE html>
|
||||
<title>Test that non-animated style is responsive to animated properties</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-animations/">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<style>
|
||||
@keyframes font_size_animation {
|
||||
from { font-size: 10px; }
|
||||
to { font-size: 20px; }
|
||||
}
|
||||
@keyframes var_animation {
|
||||
from { --x: 10px; }
|
||||
to { --x: 20px; }
|
||||
}
|
||||
#targets > div {
|
||||
animation-duration: 1000s;
|
||||
animation-delay: -500s;
|
||||
animation-timing-function: steps(2, end);
|
||||
}
|
||||
|
||||
#target1 {
|
||||
animation-name: font_size_animation;
|
||||
font-size: 1px;
|
||||
width: 1em;
|
||||
}
|
||||
#ref1 {
|
||||
width: 15px;
|
||||
}
|
||||
|
||||
#target2 {
|
||||
animation-name: font_size_animation;
|
||||
font-size: 1px;
|
||||
width: 1ex;
|
||||
}
|
||||
#ref2 {
|
||||
font-size: 15px;
|
||||
width: 1ex;
|
||||
}
|
||||
|
||||
#target3 {
|
||||
animation-name: var_animation;
|
||||
--x: 0px;
|
||||
width: var(--x);
|
||||
}
|
||||
#ref3 {
|
||||
width: 20px;
|
||||
}
|
||||
</style>
|
||||
<div id="targets">
|
||||
<div id="target1"></div>
|
||||
<div id="target2"></div>
|
||||
<div id="target3"></div>
|
||||
</div>
|
||||
<div id="refs">
|
||||
<div id="ref1"></div>
|
||||
<div id="ref2"></div>
|
||||
<div id="ref3"></div>
|
||||
</div>
|
||||
<script>
|
||||
|
||||
// Test that the computed value of the given property is equal on
|
||||
// 'target' and 'ref'.
|
||||
function test_ref(target, ref, property, description) {
|
||||
test(() => {
|
||||
let actual = getComputedStyle(target).getPropertyValue(property);
|
||||
let expected = getComputedStyle(ref).getPropertyValue(property);
|
||||
assert_equals(actual, expected);
|
||||
}, description);
|
||||
}
|
||||
|
||||
test_ref(target1, ref1, 'width', 'em units respond to font-size animation');
|
||||
test_ref(target2, ref2, 'width', 'ex units respond to font-size animation');
|
||||
test_ref(target3, ref3, 'width', 'var() references respond to custom property animation');
|
||||
|
||||
</script>
|
|
@ -0,0 +1,25 @@
|
|||
<!DOCTYPE html>
|
||||
<title>Test that rem units are responsive to animated font-size on root</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-animations/">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<style>
|
||||
@keyframes font_size_animation {
|
||||
from { font-size: 10px; }
|
||||
to { font-size: 20px; }
|
||||
}
|
||||
:root {
|
||||
font-size: 1px;
|
||||
animation: font_size_animation steps(2, end) 1000s -500s;
|
||||
}
|
||||
|
||||
#target1 {
|
||||
width: 1rem;
|
||||
}
|
||||
</style>
|
||||
<div id="target1"></div>
|
||||
<script>
|
||||
test(() => {
|
||||
assert_equals(getComputedStyle(target1).getPropertyValue('width'), '15px');
|
||||
}, 'Animated font-size on root affects rem units');
|
||||
</script>
|
|
@ -0,0 +1,72 @@
|
|||
<!DOCTYPE html>
|
||||
<title>Test !important declarations vs. animation effects</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-cascade/#cascade-origin">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<style>
|
||||
@keyframes bgcolor_animation {
|
||||
from { background-color: rgb(10, 10, 10); }
|
||||
to { background-color: rgb(20, 20, 20); }
|
||||
}
|
||||
@keyframes color_and_bg_animation {
|
||||
from { background-color: rgb(10, 10, 10); color: rgb(10, 10, 10); }
|
||||
to { background-color: rgb(20, 20, 20); color: rgb(20, 20, 20); }
|
||||
}
|
||||
a, div, ::before{
|
||||
animation-duration: 1000s;
|
||||
animation-delay: -500s;
|
||||
animation-timing-function: steps(2, end);
|
||||
}
|
||||
#target1 {
|
||||
animation-name: bgcolor_animation;
|
||||
}
|
||||
#target2 {
|
||||
background-color: rgb(0, 128, 0) !important;
|
||||
animation-name: bgcolor_animation;
|
||||
}
|
||||
#target3 {
|
||||
color: rgb(0, 128, 0) !important;
|
||||
animation-name: color_and_bg_animation;
|
||||
}
|
||||
#target4::before {
|
||||
color: rgb(0, 128, 0) !important;
|
||||
animation-name: color_and_bg_animation;
|
||||
content: " ";
|
||||
}
|
||||
#target5 {
|
||||
animation-name: color_and_bg_animation;
|
||||
}
|
||||
#target5:visited {
|
||||
color: rgb(0, 128, 0) !important;
|
||||
}
|
||||
</style>
|
||||
<div id="target1"></div>
|
||||
<div id="target2"></div>
|
||||
<div id="target3"></div>
|
||||
<div id="target4"></div>
|
||||
<a href="" id="target5"></a>
|
||||
<script>
|
||||
test(() => {
|
||||
assert_equals(getComputedStyle(target1).backgroundColor, 'rgb(15, 15, 15)');
|
||||
}, 'Interpolated value is observable');
|
||||
|
||||
test(() => {
|
||||
assert_equals(getComputedStyle(target2).backgroundColor, 'rgb(0, 128, 0)');
|
||||
}, 'Important rules override animations');
|
||||
|
||||
test(() => {
|
||||
assert_equals(getComputedStyle(target3).color, 'rgb(0, 128, 0)');
|
||||
assert_equals(getComputedStyle(target3).backgroundColor, 'rgb(15, 15, 15)');
|
||||
}, 'Non-overriden interpolations are observable');
|
||||
|
||||
test(() => {
|
||||
assert_equals(getComputedStyle(target4, '::before').color, 'rgb(0, 128, 0)');
|
||||
assert_equals(getComputedStyle(target4, '::before').backgroundColor, 'rgb(15, 15, 15)');
|
||||
}, 'Important rules override animations (::before)');
|
||||
|
||||
test(() => {
|
||||
assert_equals(getComputedStyle(target5).color, 'rgb(15, 15, 15)');
|
||||
assert_equals(getComputedStyle(target5).backgroundColor, 'rgb(15, 15, 15)');
|
||||
}, 'Important rules do not override animations on :visited as seen from JS');
|
||||
|
||||
</script>
|
|
@ -0,0 +1,9 @@
|
|||
<!DOCTYPE html>
|
||||
<style>
|
||||
a {
|
||||
text-decoration: underline;
|
||||
background-color: rgb(0, 150, 0);
|
||||
}
|
||||
</style>
|
||||
<a style="color: rgb(150, 0, 0)">Unvisited</a>
|
||||
<a style="color: white">Visited</a>
|
|
@ -0,0 +1,21 @@
|
|||
<!DOCTYPE html>
|
||||
<title>Test that animated properties on :visited are overridden by !important</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-cascade/#cascade-origin">
|
||||
<link rel="match" href="animation-important-002-ref.html">
|
||||
<style>
|
||||
@keyframes color_and_bg_animation {
|
||||
from { background-color: rgb(0, 100, 0); color: rgb(100, 0, 0); }
|
||||
to { background-color: rgb(0, 200, 0); color: rgb(200, 0, 0); }
|
||||
}
|
||||
a {
|
||||
animation-name: color_and_bg_animation;
|
||||
animation-duration: 1000s;
|
||||
animation-delay: -500s;
|
||||
animation-timing-function: steps(2, end);
|
||||
}
|
||||
a:visited {
|
||||
color: white !important;
|
||||
}
|
||||
</style>
|
||||
<a href="#unvisited">Unvisited</a>
|
||||
<a href="">Visited</a>
|
Loading…
Add table
Add a link
Reference in a new issue