Skip to content

Commit

Permalink
HTML: test display and box-sizing UA style for form controls
Browse files Browse the repository at this point in the history
Follows whatwg/html#4840

Remove redundant test
  • Loading branch information
zcorpan committed Sep 16, 2021
1 parent 0286e80 commit 36b6813
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 21 deletions.

This file was deleted.

24 changes: 23 additions & 1 deletion html/rendering/non-replaced-elements/form-controls/resets.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,29 @@
input[type=reset i], input[type=button i], input[type=submit i], button {
text-align: center;
}
input[type=radio i], input[type=checkbox i], input[type=reset i], input[type=button i],
input[type=submit i], input[type=color i], input[type=search i], select, button {
box-sizing: border-box;
}
input, button {
display: inline-block;
}
/* in spec prose: */ select, textarea, meter, progress {
display: inline-block;
}
input[type=hidden i] { display: none !important; }
marquee {
text-align: initial;
}
table { display: table; }
caption { display: table-caption; }
colgroup, colgroup[hidden] { display: table-column-group; }
col, col[hidden] { display: table-column; }
thead, thead[hidden] { display: table-header-group; }
tbody, tbody[hidden] { display: table-row-group; }
tfoot, tfoot[hidden] { display: table-footer-group; }
tr, tr[hidden] { display: table-row; }
td, th { display: table-cell; }
table {
text-indent: initial;
}
Expand Down Expand Up @@ -84,7 +104,9 @@
'text-transform',
'text-indent',
'text-shadow',
'text-align'];
'text-align',
'display',
'box-sizing'];
runUAStyleTests(props);

</script>
10 changes: 10 additions & 0 deletions html/rendering/support/test-ua-stylesheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ function runUAStyleTests(props) {
const testStyle = getComputedStyle(testEl);
const refStyle = getComputedStyle(refEl);
for (const prop of props) {
// Don't test display for some elements.
// TODO(zcorpan): https://github.com/whatwg/html/issues/4093
// TODO(zcorpan): https://github.com/whatwg/html/issues/5063
if (prop === 'display' &&
(testEl.localName === 'optgroup' ||
testEl.localName === 'option' ||
testEl.localName === 'marquee')
) {
continue;
}
test(() => {
assert_equals(testStyle.getPropertyValue(prop), refStyle.getPropertyValue(prop));
}, `${testNameContext(testEl)} - ${prop}`);
Expand Down

0 comments on commit 36b6813

Please sign in to comment.