mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
style: Test a few more properties, and update expectations.
This commit is contained in:
parent
35496c8ae1
commit
37d8ee9037
3 changed files with 16 additions and 25 deletions
|
@ -1,13 +1,5 @@
|
||||||
[serialize-values.html]
|
[serialize-values.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
[border-spacing: 0px]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[border-spacing: 1px]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[border-spacing: .1em]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[content: url("http://localhost/")]
|
[content: url("http://localhost/")]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
|
@ -1,14 +1,3 @@
|
||||||
[calc.html]
|
[calc.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
[calc for border-width]
|
prefs: [layout.column-count.enabled:true,layout.column-width.enabled:true,layout.column-gap.enabled:true]
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[calc for column-width]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[calc for column-gap]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[calc for column-count]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,10 @@
|
||||||
#outer {
|
#outer {
|
||||||
width: 1000px;
|
width: 1000px;
|
||||||
}
|
}
|
||||||
|
#inner {
|
||||||
|
border-style: solid; /* So used border == computed border */
|
||||||
|
outline-style: solid; /* So used outline-width == computed outline-width */
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
@ -76,7 +80,9 @@ var lengthProperties = [
|
||||||
lengthProperties.forEach(function(prop) {
|
lengthProperties.forEach(function(prop) {
|
||||||
test(function() {
|
test(function() {
|
||||||
div.style.setProperty(prop, 'calc(1px)');
|
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);
|
}, 'calc for ' + prop);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -112,12 +118,14 @@ var timeProperties = [
|
||||||
timeProperties.forEach(function(prop) {
|
timeProperties.forEach(function(prop) {
|
||||||
test(function() {
|
test(function() {
|
||||||
div.style.setProperty(prop, 'calc(1s)');
|
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);
|
}, 'calc for ' + prop);
|
||||||
});
|
});
|
||||||
|
|
||||||
var numberProperties = [
|
var numberProperties = [
|
||||||
'z-index',
|
'z-index',
|
||||||
|
'order',
|
||||||
'column-count',
|
'column-count',
|
||||||
'opacity',
|
'opacity',
|
||||||
];
|
];
|
||||||
|
@ -126,12 +134,13 @@ numberProperties.forEach(function(prop) {
|
||||||
test(function() {
|
test(function() {
|
||||||
div.style.setProperty(prop, 'calc(1)');
|
div.style.setProperty(prop, 'calc(1)');
|
||||||
assert_equals(div.style.getPropertyValue(prop), 'calc(1)');
|
assert_equals(div.style.getPropertyValue(prop), 'calc(1)');
|
||||||
|
assert_equals(getComputedStyle(div).getPropertyValue(prop), '1');
|
||||||
}, 'calc for ' + prop);
|
}, 'calc for ' + prop);
|
||||||
});
|
});
|
||||||
|
|
||||||
var otherProperties = [
|
var otherProperties = [
|
||||||
['border-width', 'calc(1px)', '1px 1px 1px 1px'],
|
['border-width', 'calc(1px)', 'calc(1px)'],
|
||||||
['border-spacing', 'calc(1px)', 'calc(1px) calc(1px)'],
|
['border-spacing', 'calc(1px)', 'calc(1px)'],
|
||||||
['transform-origin', 'calc(1px + 0%)', 'calc(1px + 0%) 50% 0px'],
|
['transform-origin', 'calc(1px + 0%)', 'calc(1px + 0%) 50% 0px'],
|
||||||
['perspective-origin', 'calc(1px + 0%)', 'calc(1px + 0%) 50%'],
|
['perspective-origin', 'calc(1px + 0%)', 'calc(1px + 0%) 50%'],
|
||||||
['background-size', 'calc(1px + 0%)', 'calc(1px + 0%) auto'],
|
['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-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-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%)'],
|
['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) {
|
otherProperties.forEach(function(testcase) {
|
||||||
|
@ -150,7 +160,7 @@ otherProperties.forEach(function(testcase) {
|
||||||
});
|
});
|
||||||
|
|
||||||
/* TODO: test these:
|
/* TODO: test these:
|
||||||
counter-increment, counter-reset,
|
counter-reset,
|
||||||
color, box-shadow, clip, text-shadow, transform
|
color, box-shadow, clip, text-shadow, transform
|
||||||
transition-timing-function
|
transition-timing-function
|
||||||
angles
|
angles
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue