Skip to content

Commit ababf6c

Browse files
committed
HTML: test display and box-sizing UA style for form controls
Follows whatwg/html#4840 Remove redundant test
1 parent ac39068 commit ababf6c

File tree

3 files changed

+33
-21
lines changed

3 files changed

+33
-21
lines changed

html/rendering/non-replaced-elements/form-controls/button-style.html

Lines changed: 0 additions & 20 deletions
This file was deleted.

html/rendering/non-replaced-elements/form-controls/resets.html

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,29 @@
3434
input[type=reset i], input[type=button i], input[type=submit i], button {
3535
text-align: center;
3636
}
37+
input[type=radio i], input[type=checkbox i], input[type=reset i], input[type=button i],
38+
input[type=submit i], input[type=color i], input[type=search i], select, button {
39+
box-sizing: border-box;
40+
}
41+
input, button {
42+
display: inline-block;
43+
}
44+
/* in spec prose: */ select, textarea, meter, progress {
45+
display: inline-block;
46+
}
47+
input[type=hidden i] { display: none !important; }
3748
marquee {
3849
text-align: initial;
3950
}
51+
table { display: table; }
52+
caption { display: table-caption; }
53+
colgroup, colgroup[hidden] { display: table-column-group; }
54+
col, col[hidden] { display: table-column; }
55+
thead, thead[hidden] { display: table-header-group; }
56+
tbody, tbody[hidden] { display: table-row-group; }
57+
tfoot, tfoot[hidden] { display: table-footer-group; }
58+
tr, tr[hidden] { display: table-row; }
59+
td, th { display: table-cell; }
4060
table {
4161
text-indent: initial;
4262
}
@@ -84,7 +104,9 @@
84104
'text-transform',
85105
'text-indent',
86106
'text-shadow',
87-
'text-align'];
107+
'text-align',
108+
'display',
109+
'box-sizing'];
88110
runUAStyleTests(props);
89111

90112
</script>

html/rendering/support/test-ua-stylesheet.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@ function runUAStyleTests(props) {
1616
const testStyle = getComputedStyle(testEl);
1717
const refStyle = getComputedStyle(refEl);
1818
for (const prop of props) {
19+
// Don't test display for some elements.
20+
// TODO(zcorpan): https://github.com/whatwg/html/issues/4093
21+
// TODO(zcorpan): https://github.com/whatwg/html/issues/5063
22+
if (prop === 'display' &&
23+
(testEl.localName === 'optgroup' ||
24+
testEl.localName === 'option' ||
25+
testEl.localName === 'marquee')
26+
) {
27+
continue;
28+
}
1929
test(() => {
2030
assert_equals(testStyle.getPropertyValue(prop), refStyle.getPropertyValue(prop));
2131
}, `${testNameContext(testEl)} - ${prop}`);

0 commit comments

Comments
 (0)