mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Update web-platform-tests to revision 1aaada4bbc936024441fe7995b77c21a2c554da1
This commit is contained in:
parent
1e1eca07ed
commit
5e9d150c07
140 changed files with 3413 additions and 553 deletions
|
@ -0,0 +1,54 @@
|
|||
'use strict';
|
||||
|
||||
function assert_initial(property, initial) {
|
||||
test(() => {
|
||||
if (!getComputedStyle(target)[property])
|
||||
return;
|
||||
target.style[property] = 'initial';
|
||||
assert_equals(getComputedStyle(target)[property], initial);
|
||||
target.style[property] = '';
|
||||
}, 'Property ' + property + ' has initial value ' + initial);
|
||||
}
|
||||
|
||||
function assert_inherited(property, initial, other) {
|
||||
assert_initial(property, initial);
|
||||
|
||||
test(() => {
|
||||
if (!getComputedStyle(target)[property])
|
||||
return;
|
||||
container.style[property] = 'initial';
|
||||
target.style[property] = 'unset';
|
||||
assert_not_equals(getComputedStyle(container)[property], other);
|
||||
assert_not_equals(getComputedStyle(target)[property], other);
|
||||
container.style[property] = other;
|
||||
assert_equals(getComputedStyle(container)[property], other);
|
||||
assert_equals(getComputedStyle(target)[property], other);
|
||||
target.style[property] = 'initial';
|
||||
assert_not_equals(getComputedStyle(container)[property], other);
|
||||
assert_not_equals(getComputedStyle(target)[property], other);
|
||||
target.style[property] = 'inherit';
|
||||
assert_equals(getComputedStyle(container)[property], other);
|
||||
container.style[property] = '';
|
||||
target.style[property] = '';
|
||||
}, 'Property ' + property + ' inherits');
|
||||
}
|
||||
|
||||
function assert_not_inherited(property, initial, other) {
|
||||
assert_initial(property, initial);
|
||||
|
||||
test(() => {
|
||||
if (!getComputedStyle(target)[property])
|
||||
return;
|
||||
container.style[property] = 'initial';
|
||||
target.style[property] = 'unset';
|
||||
assert_not_equals(getComputedStyle(container)[property], other);
|
||||
assert_not_equals(getComputedStyle(target)[property], other);
|
||||
container.style[property] = other;
|
||||
assert_equals(getComputedStyle(container)[property], other);
|
||||
assert_not_equals(getComputedStyle(target)[property], other);
|
||||
target.style[property] = 'inherit';
|
||||
assert_equals(getComputedStyle(target)[property], other);
|
||||
container.style[property] = '';
|
||||
target.style[property] = '';
|
||||
}, 'Property ' + property + ' does not inherit');
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue