Update web-platform-tests to revision cd44958a002b1ad494168e0290554644de84526e

This commit is contained in:
WPT Sync Bot 2018-11-07 21:06:07 -05:00
parent 2ed23ce4c9
commit 4443426308
103 changed files with 1740 additions and 1138 deletions

View file

@ -1,7 +1,10 @@
'use strict';
(function() {
function assert_initial(property, initial) {
test(() => {
const target = document.getElementById('target');
if (!getComputedStyle(target)[property])
return;
target.style[property] = 'initial';
@ -13,6 +16,8 @@ function assert_initial(property, initial) {
/**
* Create tests that a CSS property inherits and has the given initial value.
*
* 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
@ -22,6 +27,8 @@ function assert_inherited(property, initial, other) {
assert_initial(property, initial);
test(() => {
const container = document.getElementById('container');
const target = document.getElementById('target');
if (!getComputedStyle(target)[property])
return;
container.style[property] = 'initial';
@ -45,6 +52,8 @@ function assert_inherited(property, initial, other) {
* Create tests that a CSS property does not inherit, and that it has the
* given initial value.
*
* 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
@ -54,6 +63,8 @@ function assert_not_inherited(property, initial, other) {
assert_initial(property, initial);
test(() => {
const container = document.getElementById('container');
const target = document.getElementById('target');
if (!getComputedStyle(target)[property])
return;
container.style[property] = 'initial';
@ -69,3 +80,7 @@ function assert_not_inherited(property, initial, other) {
target.style[property] = '';
}, 'Property ' + property + ' does not inherit');
}
window.assert_inherited = assert_inherited;
window.assert_not_inherited = assert_not_inherited;
})();