style: Test a few more properties, and update expectations.

This commit is contained in:
Emilio Cobos Álvarez 2017-03-27 03:54:27 +02:00
parent 35496c8ae1
commit 37d8ee9037
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
3 changed files with 16 additions and 25 deletions

View file

@ -1,13 +1,5 @@
[serialize-values.html]
type: testharness
[border-spacing: 0px]
expected: FAIL
[border-spacing: 1px]
expected: FAIL
[border-spacing: .1em]
expected: FAIL
[content: url("http://localhost/")]
expected: FAIL

View file

@ -1,14 +1,3 @@
[calc.html]
type: testharness
[calc for border-width]
expected: FAIL
[calc for column-width]
expected: FAIL
[calc for column-gap]
expected: FAIL
[calc for column-count]
expected: FAIL
prefs: [layout.column-count.enabled:true,layout.column-width.enabled:true,layout.column-gap.enabled:true]

View file

@ -6,6 +6,10 @@
#outer {
width: 1000px;
}
#inner {
border-style: solid; /* So used border == computed border */
outline-style: solid; /* So used outline-width == computed outline-width */
}
</style>
</head>
<body>
@ -76,7 +80,9 @@ var lengthProperties = [
lengthProperties.forEach(function(prop) {
test(function() {
div.style.setProperty(prop, 'calc(1px)');
assert_equals(div.style.getPropertyValue(prop), 'calc(1px)');
assert_equals(div.style.getPropertyValue(prop), 'calc(1px)', div.style.getPropertyValue(prop));
let computed = getComputedStyle(div).getPropertyValue(prop);
assert_equals(computed, '1px', prop + ': expected 1px, got ' + computed);
}, 'calc for ' + prop);
});
@ -112,12 +118,14 @@ var timeProperties = [
timeProperties.forEach(function(prop) {
test(function() {
div.style.setProperty(prop, 'calc(1s)');
assert_equals(div.style.getPropertyValue(prop), '1s');
assert_equals(div.style.getPropertyValue(prop), 'calc(1s)');
assert_equals(getComputedStyle(div).getPropertyValue(prop), '1s');
}, 'calc for ' + prop);
});
var numberProperties = [
'z-index',
'order',
'column-count',
'opacity',
];
@ -126,12 +134,13 @@ numberProperties.forEach(function(prop) {
test(function() {
div.style.setProperty(prop, 'calc(1)');
assert_equals(div.style.getPropertyValue(prop), 'calc(1)');
assert_equals(getComputedStyle(div).getPropertyValue(prop), '1');
}, 'calc for ' + prop);
});
var otherProperties = [
['border-width', 'calc(1px)', '1px 1px 1px 1px'],
['border-spacing', 'calc(1px)', 'calc(1px) calc(1px)'],
['border-width', 'calc(1px)', 'calc(1px)'],
['border-spacing', 'calc(1px)', 'calc(1px)'],
['transform-origin', 'calc(1px + 0%)', 'calc(1px + 0%) 50% 0px'],
['perspective-origin', 'calc(1px + 0%)', 'calc(1px + 0%) 50%'],
['background-size', 'calc(1px + 0%)', 'calc(1px + 0%) auto'],
@ -140,6 +149,7 @@ var otherProperties = [
['border-bottom-left-radius', 'calc(1px + 0%)', 'calc(1px + 0%) calc(1px + 0%)'],
['border-top-right-radius', 'calc(1px + 0%)', 'calc(1px + 0%) calc(1px + 0%)'],
['border-bottom-right-radius', 'calc(1px + 0%)', 'calc(1px + 0%) calc(1px + 0%)'],
['counter-increment', 'foo calc(1 + 1)', 'foo calc(2)'],
];
otherProperties.forEach(function(testcase) {
@ -150,7 +160,7 @@ otherProperties.forEach(function(testcase) {
});
/* TODO: test these:
counter-increment, counter-reset,
counter-reset,
color, box-shadow, clip, text-shadow, transform
transition-timing-function
angles