Skip to content

Commit

Permalink
style: Test a few more properties, and update expectations.
Browse files Browse the repository at this point in the history
  • Loading branch information
emilio committed Mar 27, 2017
1 parent 35496c8 commit 37d8ee9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 25 deletions.
8 changes: 0 additions & 8 deletions tests/wpt/metadata/cssom/serialize-values.html.ini
@@ -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
Expand Down
13 changes: 1 addition & 12 deletions tests/wpt/mozilla/meta/mozilla/calc.html.ini
@@ -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]
20 changes: 15 additions & 5 deletions tests/wpt/mozilla/tests/mozilla/calc.html
Expand Up @@ -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>
Expand Down Expand Up @@ -76,7 +80,9 @@
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);
});

Expand Down Expand Up @@ -112,12 +118,14 @@
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',
];
Expand All @@ -126,12 +134,13 @@
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'],
Expand All @@ -140,6 +149,7 @@
['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) {
Expand All @@ -150,7 +160,7 @@
});

/* TODO: test these:
counter-increment, counter-reset,
counter-reset,
color, box-shadow, clip, text-shadow, transform
transition-timing-function
angles
Expand Down

0 comments on commit 37d8ee9

Please sign in to comment.