mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Update web-platform-tests to revision b'79fa4cf76e0d39e3fc1b7ead85e067b0a064b892'
This commit is contained in:
parent
4a46a476d7
commit
31f9c69336
83 changed files with 2200 additions and 954 deletions
|
@ -4,7 +4,7 @@
|
|||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
function register_length(name, inherits=true) {
|
||||
function register_length(name, inherits=false) {
|
||||
CSS.registerProperty({
|
||||
name: name,
|
||||
syntax: '<length>',
|
||||
|
@ -96,19 +96,19 @@
|
|||
test(function() {
|
||||
target.style = 'font-size: var(--font-size-em);';
|
||||
assert_property_equals('font-size', unsetFontSize);
|
||||
assert_property_equals('--font-size-em', '');
|
||||
assert_property_equals('--font-size-em', '0px');
|
||||
}, 'Lengths with em units may not be referenced from font-size');
|
||||
|
||||
test(function() {
|
||||
target.style = 'font-size: var(--font-size-ex);';
|
||||
assert_property_equals('font-size', unsetFontSize);
|
||||
assert_property_equals('--font-size-ex', '');
|
||||
assert_property_equals('--font-size-ex', '0px');
|
||||
}, 'Lengths with ex units may not be referenced from font-size');
|
||||
|
||||
test(function() {
|
||||
target.style = 'font-size: var(--font-size-ch);';
|
||||
assert_property_equals('font-size', unsetFontSize);
|
||||
assert_property_equals('--font-size-ch', '');
|
||||
assert_property_equals('--font-size-ch', '0px');
|
||||
}, 'Lengths with ch units may not be referenced from font-size');
|
||||
|
||||
test(function() {
|
||||
|
@ -122,7 +122,7 @@
|
|||
let root = document.documentElement;
|
||||
root.style = 'font-size: var(--font-size-rem);';
|
||||
assert_property_equals('font-size', unsetFontSize, root);
|
||||
assert_property_equals('--font-size-rem', '', root);
|
||||
assert_property_equals('--font-size-rem', '0px', root);
|
||||
}, 'Lengths with rem units may not be referenced from font-size on root element');
|
||||
|
||||
test(function() {
|
||||
|
@ -155,26 +155,26 @@
|
|||
test(function() {
|
||||
target.style = 'font-size: var(--font-size-em-via-var);';
|
||||
assert_property_equals('font-size', unsetFontSize);
|
||||
assert_property_equals('--font-size-em-via-var', '');
|
||||
assert_property_equals('--font-size-em-via-var', '0px');
|
||||
}, 'Lengths with em units are detected via var references');
|
||||
|
||||
test(function() {
|
||||
target.style = 'font-size: var(--font-size-ex-via-var);';
|
||||
assert_property_equals('font-size', unsetFontSize);
|
||||
assert_property_equals('--font-size-ex-via-var', '');
|
||||
assert_property_equals('--font-size-ex-via-var', '0px');
|
||||
}, 'Lengths with ex units are detected via var references');
|
||||
|
||||
test(function() {
|
||||
target.style = 'font-size: var(--font-size-ch-via-var);';
|
||||
assert_property_equals('font-size', unsetFontSize);
|
||||
assert_property_equals('--font-size-ch-via-var', '');
|
||||
assert_property_equals('--font-size-ch-via-var', '0px');
|
||||
}, 'Lengths with ch units are detected via var references');
|
||||
|
||||
test(function() {
|
||||
let root = document.documentElement;
|
||||
root.style = 'font-size: var(--font-size-rem-via-var);';
|
||||
assert_property_equals('font-size', unsetFontSize, root);
|
||||
assert_property_equals('--font-size-rem-via-var', '', root);
|
||||
assert_property_equals('--font-size-rem-via-var', '0px', root);
|
||||
root.style = 'font-size: unset';
|
||||
}, 'Lengths with rem units are detected via var references');
|
||||
|
||||
|
|
|
@ -25,13 +25,13 @@ test(function() {
|
|||
CSS.registerProperty({name: '--registered-1-d', syntax: '<length>', initialValue: '4px', inherits: false});
|
||||
|
||||
computedStyle = getComputedStyle(test1);
|
||||
assert_equals(computedStyle.getPropertyValue('--registered-1-a'), '');
|
||||
assert_equals(computedStyle.getPropertyValue('--registered-1-b'), '');
|
||||
assert_equals(computedStyle.getPropertyValue('--registered-1-c'), '30px');
|
||||
assert_equals(computedStyle.getPropertyValue('--registered-1-d'), '4px');
|
||||
assert_equals(computedStyle.getPropertyValue('--unregistered-1-a'), '');
|
||||
assert_equals(computedStyle.left, '50px');
|
||||
assert_equals(computedStyle.top, '60px');
|
||||
assert_equals(computedStyle.getPropertyValue('--registered-1-a'), '1px');
|
||||
assert_equals(computedStyle.getPropertyValue('--registered-1-b'), '2px');
|
||||
assert_equals(computedStyle.getPropertyValue('--registered-1-c'), '2px');
|
||||
assert_equals(computedStyle.getPropertyValue('--registered-1-d'), '2px');
|
||||
assert_equals(computedStyle.getPropertyValue('--unregistered-1-a'), '1px');
|
||||
assert_equals(computedStyle.left, '1px');
|
||||
assert_equals(computedStyle.top, '2px');
|
||||
}, "A var() cycle between two registered properties is handled correctly.");
|
||||
</script>
|
||||
|
||||
|
@ -62,18 +62,18 @@ test(function() {
|
|||
CSS.registerProperty({name: '--registered-2-e', syntax: '<length>', initialValue: '5px', inherits: false});
|
||||
|
||||
computedStyle = getComputedStyle(test2);
|
||||
assert_equals(computedStyle.getPropertyValue('--registered-2-a'), '');
|
||||
assert_equals(computedStyle.getPropertyValue('--registered-2-a'), '1px');
|
||||
assert_equals(computedStyle.getPropertyValue('--unregistered-2-a'), '');
|
||||
|
||||
assert_equals(computedStyle.getPropertyValue('--registered-2-b'), '30px');
|
||||
assert_equals(computedStyle.getPropertyValue('--registered-2-c'), '3px');
|
||||
assert_equals(computedStyle.getPropertyValue('--registered-2-b'), '1px');
|
||||
assert_equals(computedStyle.getPropertyValue('--registered-2-c'), '1px');
|
||||
assert_equals(computedStyle.getPropertyValue('--registered-2-d'), '40px');
|
||||
assert_equals(computedStyle.getPropertyValue('--registered-2-e'), '5px');
|
||||
assert_equals(computedStyle.getPropertyValue('--unregistered-2-b'), '50px');
|
||||
assert_equals(computedStyle.getPropertyValue('--unregistered-2-c'), '');
|
||||
assert_equals(computedStyle.getPropertyValue('--unregistered-2-b'), '1px');
|
||||
assert_equals(computedStyle.getPropertyValue('--unregistered-2-c'), '1px');
|
||||
assert_equals(computedStyle.getPropertyValue('--unregistered-2-d'), '60px');
|
||||
assert_equals(computedStyle.getPropertyValue('--unregistered-2-e'), '');
|
||||
assert_equals(computedStyle.left, '70px');
|
||||
assert_equals(computedStyle.left, '1px');
|
||||
assert_equals(computedStyle.top, '80px');
|
||||
}, "A var() cycle between a registered properties and an unregistered property is handled correctly.");
|
||||
</script>
|
||||
|
@ -136,7 +136,7 @@ test(function() {
|
|||
assert_equals(computedStyle.getPropertyValue('--unregistered-4-a'), '');
|
||||
|
||||
assert_equals(computedStyle.getPropertyValue('--registered-4-b'), 'meow');
|
||||
assert_equals(computedStyle.getPropertyValue('--registered-4-c'), 'circle');
|
||||
assert_equals(computedStyle.getPropertyValue('--registered-4-c'), '');
|
||||
assert_equals(computedStyle.getPropertyValue('--unregistered-4-b'), 'woof');
|
||||
assert_equals(computedStyle.getPropertyValue('--unregistered-4-c'), '');
|
||||
assert_equals(computedStyle.transitionProperty, 'water');
|
||||
|
@ -174,9 +174,10 @@ test(function() {
|
|||
let computedStyle = getComputedStyle(test5);
|
||||
assert_equals(computedStyle.getPropertyValue('--registered-5-a'), '');
|
||||
assert_equals(computedStyle.getPropertyValue('--registered-5-b'), '');
|
||||
assert_equals(computedStyle.getPropertyValue('--registered-5-c'), 'foo');
|
||||
assert_equals(computedStyle.getPropertyValue('--registered-5-d'), 'bar');
|
||||
assert_equals(computedStyle.getPropertyValue('--registered-5-e'), 'baz');
|
||||
assert_equals(computedStyle.getPropertyValue('--registered-5-c'), '');
|
||||
assert_equals(computedStyle.getPropertyValue('--registered-5-d'), '');
|
||||
assert_equals(computedStyle.getPropertyValue('--registered-5-e'), '');
|
||||
assert_equals(computedStyle.getPropertyValue('color'), 'rgb(0, 128, 0)');
|
||||
}, "Invalid at computed-value time triggers 'unset' behavior");
|
||||
}, "Custom properties with universal syntax become guaranteed-invalid when " +
|
||||
"invalid at computed-value time");
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue