mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Update web-platform-tests to revision 04cd5eb8e5c47e4fe341f2fb541d39fa2346f464
This commit is contained in:
parent
0ab2c3f8a3
commit
1d0624b343
226 changed files with 4495 additions and 903 deletions
|
@ -2,6 +2,7 @@
|
|||
<link rel="help" href="https://drafts.css-houdini.org/css-properties-values-api/#dom-css-registerproperty" />
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="./resources/utils.js"></script>
|
||||
<style>
|
||||
div {
|
||||
--registered-length-1: 10px;
|
||||
|
@ -135,4 +136,38 @@ test(function(){
|
|||
element.style = '';
|
||||
}, 'Lists with relative units are absolutized when substituting');
|
||||
|
||||
function test_valid_fallback(syntax, value, fallback) {
|
||||
test(function(){
|
||||
let name = generate_property(syntax);
|
||||
try {
|
||||
element.style = `${name}: ${value}; --x:var(${name},${fallback})`;
|
||||
let computedStyle = getComputedStyle(element);
|
||||
assert_equals(computedStyle.getPropertyValue('--x'), value);
|
||||
} finally {
|
||||
element.style = '';
|
||||
}
|
||||
}, `Valid fallback does not invalidate var()-reference [${syntax}, ${fallback}]`);
|
||||
}
|
||||
|
||||
function test_invalid_fallback(syntax, value, fallback) {
|
||||
test(function(){
|
||||
let name = generate_property(syntax);
|
||||
try {
|
||||
element.style = `${name}: ${value}; --x:var(${name},${fallback})`;
|
||||
let computedStyle = getComputedStyle(element);
|
||||
assert_equals(computedStyle.getPropertyValue('--x'), '');
|
||||
} finally {
|
||||
element.style = '';
|
||||
}
|
||||
}, `Invalid fallback invalidates var()-reference [${syntax}, ${fallback}]`);
|
||||
}
|
||||
|
||||
test_valid_fallback('<length>', '40px', '10px');
|
||||
test_valid_fallback('<length> | <color>', '40px', 'red');
|
||||
test_valid_fallback('<length> | none', '40px', 'none');
|
||||
|
||||
test_invalid_fallback('<length>', '40px', 'red');
|
||||
test_invalid_fallback('<length> | none', '40px', 'nolength');
|
||||
test_invalid_fallback('<length>', '40px', 'var(--novar)');
|
||||
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue