Skip to content

Commit

Permalink
Bug 1877927 [wpt PR 44346] - html: Tests for field-sizing, a=testonly
Browse files Browse the repository at this point in the history
Automatic update from web-platform-tests
html: Tests for field-sizing (#44346)

This includes tests to confirm size/cols/rows are not presentational hints.

Issue: whatwg/html#6807
--

wpt-commits: df6595ec7e75fdf8fb524a039c32a030fc1075e9
wpt-pr: 44346
  • Loading branch information
tkent-google authored and moz-wptsync-bot committed Feb 13, 2024
1 parent 7eb662c commit 5bf803b
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<input id="size20" size="20">
<input id="size21" size="21">
<input id="computed" style="border:none; padding:0;" size="19">
<input id="computedNone" style="display:none" size="17">

<script>
test(() => {
Expand All @@ -34,6 +35,11 @@
const computedString = getComputedStyle(computed).width;
assert_equals(computed.offsetWidth,
parseInt(computedString.substring(0, computedString.length - 2)));
}, 'Size attribute value affects computed style');
}, 'Size attribute value affects layout-dependent computed style');

test(() => {
const computedString = getComputedStyle(computedNone).width;
assert_equals(computedString, 'auto');
}, 'Size attribute value is not a presentational hint');
</script>

Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<textarea id="missing"></textarea>
<textarea id="invalid" cols="-1" rows="-1"></textarea>
<textarea id="computed" style="border:none; padding:0;" cols="19" rows="5"></textarea>
<textarea id="computedNone" style="display:none" cols="17" rows="7"></textarea>

<textarea id="cols0" cols="0"></textarea>
<textarea id="cols1" cols="1"></textarea>
Expand Down Expand Up @@ -52,6 +53,12 @@
const computedHeight = getComputedStyle(computed).height;
assert_equals(computed.offsetHeight,
parseInt(computedHeight.substring(0, computedHeight.length - 2)));
}, 'Cols/rows attribute values affect computed style');
}, 'Cols/rows attribute values affect layout-dependent computed style');

test(() => {
const computedNoneStyle = getComputedStyle(computedNone);
assert_equals(computedNoneStyle.width, 'auto');
assert_equals(computedNoneStyle.height, 'auto');
}, 'Cols/rows attribute values are not presentational hints');
</script>

0 comments on commit 5bf803b

Please sign in to comment.