mirror of
https://github.com/servo/servo.git
synced 2025-08-09 07:25:35 +01:00
Update web-platform-tests to revision fa41b43ac93bc2fdc2427a4378dc3754d483cdda
This commit is contained in:
parent
03a47c803c
commit
20d165ac2c
474 changed files with 6971 additions and 1378 deletions
|
@ -10,14 +10,10 @@
|
|||
* or an array of permitted computed value.
|
||||
* If omitted, defaults to specified.
|
||||
*/
|
||||
function test_computed_value(property, specified, computed) {
|
||||
function test_computed_value(property, specified, computed, titleExtra) {
|
||||
if (!computed)
|
||||
computed = specified;
|
||||
|
||||
let computedDesc = "'" + computed + "'";
|
||||
if (Array.isArray(computed))
|
||||
computedDesc = '[' + computed.map(e => "'" + e + "'").join(' or ') + ']';
|
||||
|
||||
test(() => {
|
||||
const target = document.getElementById('target');
|
||||
assert_true(property in getComputedStyle(target), property + " doesn't seem to be supported in the computed style");
|
||||
|
@ -37,18 +33,13 @@ function test_computed_value(property, specified, computed) {
|
|||
assert_equals(getComputedStyle(target)[property], readValue,
|
||||
'computed value should round-trip');
|
||||
}
|
||||
}, "Property " + property + " value '" + specified + "' computes to " +
|
||||
computedDesc);
|
||||
}, `Property ${property} value '${specified}'${titleExtra ? ' ' + titleExtra : ''}`);
|
||||
}
|
||||
|
||||
function test_pseudo_computed_value(pseudo, property, specified, computed) {
|
||||
function test_pseudo_computed_value(pseudo, property, specified, computed, titleExtra) {
|
||||
if (!computed)
|
||||
computed = specified;
|
||||
|
||||
let computedDesc = "'" + computed + "'";
|
||||
if (Array.isArray(computed))
|
||||
computedDesc = '[' + computed.map(e => "'" + e + "'").join(' or ') + ']';
|
||||
|
||||
test(() => {
|
||||
assert_true(/^::\w+$/.test(pseudo), pseudo + " doesn't seem to be a pseudo-element");
|
||||
const styleElement = document.createElement("style");
|
||||
|
@ -78,6 +69,5 @@ function test_pseudo_computed_value(pseudo, property, specified, computed) {
|
|||
} finally {
|
||||
document.documentElement.removeChild(styleElement);
|
||||
}
|
||||
}, "Property " + property + " value '" + specified + "' computes to " +
|
||||
computedDesc + " in " + pseudo);
|
||||
}, `Property ${property} value '${specified}' in ${pseudo}${titleExtra ? ' ' + titleExtra : ''}`);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue