mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Update web-platform-tests to revision ac3d096a5972dea5ecca1c43e324086895db7c6f
This commit is contained in:
parent
1c74a80e28
commit
db54f176d0
47 changed files with 860 additions and 246 deletions
|
@ -3,13 +3,21 @@
|
|||
(function() {
|
||||
|
||||
function assert_initial(property, initial) {
|
||||
let initialDesc = initial;
|
||||
if (Array.isArray(initial))
|
||||
initialDesc = '[' + initial.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");
|
||||
target.style[property] = 'initial';
|
||||
assert_equals(getComputedStyle(target)[property], initial);
|
||||
if (Array.isArray(initial)) {
|
||||
assert_in_array(getComputedStyle(target)[property], initial);
|
||||
} else {
|
||||
assert_equals(getComputedStyle(target)[property], initial);
|
||||
}
|
||||
target.style[property] = '';
|
||||
}, 'Property ' + property + ' has initial value ' + initial);
|
||||
}, 'Property ' + property + ' has initial value ' + initialDesc);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -17,10 +25,12 @@ function assert_initial(property, initial) {
|
|||
*
|
||||
* The current document must have an element #target within element #container.
|
||||
*
|
||||
* @param {string} property The name of the CSS property being tested.
|
||||
* @param {string} initial The computed value for 'initial'.
|
||||
* @param {string} other An arbitrary value for the property that round
|
||||
* trips and is distinct from the initial value.
|
||||
* @param {string} property The name of the CSS property being tested.
|
||||
* @param {string|array} initial The computed value for 'initial' or a list
|
||||
* of acceptable computed value serializations.
|
||||
* @param {string} other An arbitrary value for the property that
|
||||
* round trips and is distinct from the initial
|
||||
* value.
|
||||
*/
|
||||
function assert_inherited(property, initial, other) {
|
||||
assert_initial(property, initial);
|
||||
|
@ -52,10 +62,12 @@ function assert_inherited(property, initial, other) {
|
|||
*
|
||||
* The current document must have an element #target within element #container.
|
||||
*
|
||||
* @param {string} property The name of the CSS property being tested.
|
||||
* @param {string} initial The computed value for 'initial'.
|
||||
* @param {string} other An arbitrary value for the property that round
|
||||
* trips and is distinct from the initial value.
|
||||
* @param {string} property The name of the CSS property being tested.
|
||||
* @param {string|array} initial The computed value for 'initial' or a list
|
||||
* of acceptable computed value serializations.
|
||||
* @param {string} other An arbitrary value for the property that
|
||||
* round trips and is distinct from the initial
|
||||
* value.
|
||||
*/
|
||||
function assert_not_inherited(property, initial, other) {
|
||||
assert_initial(property, initial);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue