mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Update web-platform-tests to revision b'e0214318249f1b6ea09b837db6eac7b0facd1b52'
This commit is contained in:
parent
3429e8fe3b
commit
febcb80385
141 changed files with 2568 additions and 986 deletions
|
@ -338,4 +338,114 @@ test_with_at_property({
|
|||
});
|
||||
}, 'Registered properties referencing animated properties update correctly.');
|
||||
|
||||
test_with_at_property({
|
||||
syntax: '"<length>"',
|
||||
inherits: false,
|
||||
initialValue: '0px'
|
||||
}, (name) => {
|
||||
with_style_node(`
|
||||
@keyframes test {
|
||||
from { ${name}: inherit; }
|
||||
to { ${name}: 300px; }
|
||||
}
|
||||
#outer {
|
||||
${name}: 100px;
|
||||
}
|
||||
#div {
|
||||
animation: test 100s -50s linear paused;
|
||||
}
|
||||
`, () => {
|
||||
assert_equals(getComputedStyle(div).getPropertyValue(name), '200px');
|
||||
|
||||
outer.style.setProperty(name, '200px');
|
||||
assert_equals(getComputedStyle(div).getPropertyValue(name), '250px');
|
||||
|
||||
outer.style.setProperty(name, '0px');
|
||||
assert_equals(getComputedStyle(div).getPropertyValue(name), '150px');
|
||||
|
||||
outer.style.removeProperty(name);
|
||||
});
|
||||
}, 'CSS animation setting "inherit" for a custom property on a keyframe is responsive to changing that custom property on the parent.');
|
||||
|
||||
test_with_at_property({
|
||||
syntax: '"<length>"',
|
||||
inherits: false,
|
||||
initialValue: '0px'
|
||||
}, (name) => {
|
||||
with_style_node(`
|
||||
#outer {
|
||||
${name}: 100px;
|
||||
}
|
||||
`, () => {
|
||||
const animation = div.animate({ [name]: ["inherit", "300px"]}, 1000);
|
||||
animation.currentTime = 500;
|
||||
animation.pause();
|
||||
|
||||
assert_equals(getComputedStyle(div).getPropertyValue(name), '200px');
|
||||
|
||||
outer.style.setProperty(name, '200px');
|
||||
assert_equals(getComputedStyle(div).getPropertyValue(name), '250px');
|
||||
|
||||
outer.style.setProperty(name, '0px');
|
||||
assert_equals(getComputedStyle(div).getPropertyValue(name), '150px');
|
||||
|
||||
outer.style.removeProperty(name);
|
||||
});
|
||||
}, 'JS-originated animation setting "inherit" for a custom property on a keyframe is responsive to changing that custom property on the parent.');
|
||||
|
||||
test_with_at_property({
|
||||
syntax: '"<color>"',
|
||||
inherits: false,
|
||||
initialValue: 'black'
|
||||
}, (name) => {
|
||||
with_style_node(`
|
||||
@keyframes test {
|
||||
from { ${name}: currentcolor; }
|
||||
to { ${name}: rgb(200, 200, 200); }
|
||||
}
|
||||
#outer {
|
||||
color: rgb(100, 100, 100);
|
||||
}
|
||||
#div {
|
||||
animation: test 100s -50s linear paused;
|
||||
}
|
||||
`, (style) => {
|
||||
assert_equals(getComputedStyle(div).getPropertyValue(name), 'rgb(150, 150, 150)');
|
||||
|
||||
outer.style.color = 'rgb(50, 50, 50)';
|
||||
assert_equals(getComputedStyle(div).getPropertyValue(name), 'rgb(125, 125, 125)');
|
||||
|
||||
outer.style.color = 'rgb(150, 150, 150)';
|
||||
assert_equals(getComputedStyle(div).getPropertyValue(name), 'rgb(175, 175, 175)');
|
||||
|
||||
outer.style.removeProperty("color");
|
||||
});
|
||||
}, 'CSS animation setting "currentColor" for a custom property on a keyframe is responsive to changing "color" on the parent.');
|
||||
|
||||
test_with_at_property({
|
||||
syntax: '"<color>"',
|
||||
inherits: false,
|
||||
initialValue: 'black'
|
||||
}, (name) => {
|
||||
with_style_node(`
|
||||
#outer {
|
||||
color: rgb(100, 100, 100);
|
||||
}
|
||||
`, () => {
|
||||
const animation = div.animate({ [name]: ["currentcolor", "rgb(200, 200, 200)"]}, 1000);
|
||||
animation.currentTime = 500;
|
||||
animation.pause();
|
||||
|
||||
assert_equals(getComputedStyle(div).getPropertyValue(name), 'rgb(150, 150, 150)');
|
||||
|
||||
outer.style.color = 'rgb(50, 50, 50)';
|
||||
assert_equals(getComputedStyle(div).getPropertyValue(name), 'rgb(125, 125, 125)');
|
||||
|
||||
outer.style.color = 'rgb(150, 150, 150)';
|
||||
assert_equals(getComputedStyle(div).getPropertyValue(name), 'rgb(175, 175, 175)');
|
||||
|
||||
outer.style.removeProperty("color");
|
||||
});
|
||||
}, 'JS-originated animation setting "currentColor" for a custom property on a keyframe is responsive to changing "color" on the parent.');
|
||||
|
||||
</script>
|
||||
|
|
|
@ -58,6 +58,13 @@ test(function(){
|
|||
assert_equals(getComputedStyle(inner).getPropertyValue('--initial-length-2'), '0px');
|
||||
}, "Explicitly inheriting from a parent with no value results in initial value.");
|
||||
|
||||
test(function(){
|
||||
CSS.registerProperty({name: '--initial-length-3', syntax: '<length>', initialValue: '0px', inherits: false});
|
||||
outer.style = '--initial-length-3: 100px';
|
||||
inner.style = '--initial-length-3: inherit';
|
||||
assert_equals(getComputedStyle(inner).getPropertyValue('--initial-length-3'), '100px');
|
||||
}, "Explicitly inheriting from a parent with a value results in that value.");
|
||||
|
||||
test(function(){
|
||||
CSS.registerProperty({name: '--inherited-length-4', syntax: '<length>', initialValue: '0px', inherits: true});
|
||||
outer.style = '--inherited-length-4: 42px';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue