Skip to content

Commit

Permalink
Bug 1857373 [wpt PR 42379] - form-sizing: Change the keywords: auto|n…
Browse files Browse the repository at this point in the history
…ormal -> fixed|content, a=testonly

Automatic update from web-platform-tests
form-sizing: Change the keywords: auto|normal -> fixed|content

See w3c/csswg-drafts#7542 (comment)

Bug: 1447058
Change-Id: I21226d8216ae42254d4dc50d17e173884afd4e87
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4918050
Auto-Submit: Kent Tamura <tkent@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1206161}

--

wpt-commits: 8a78be2625618f180b71e6b79d540637ac5c3866
wpt-pr: 42379
  • Loading branch information
tkent-google authored and moz-wptsync-bot committed Oct 26, 2023
1 parent 2b9243c commit e1c9e23
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<body>
<div id="target"></div>
<script>
test_computed_value('form-sizing', 'auto');
test_computed_value('form-sizing', 'normal');
test_computed_value('form-sizing', 'fixed');
test_computed_value('form-sizing', 'content');
</script>
</body>
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<script>
test_invalid_value('form-sizing', 'none');
test_invalid_value('form-sizing', 'legacy');
test_invalid_value('form-sizing', 'auto');
test_invalid_value('form-sizing', 'normal');
test_invalid_value('form-sizing', 'normal auto');
test_invalid_value('form-sizing', '100%');
test_invalid_value('form-sizing', '10px');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<script src="/css/support/parsing-testcommon.js"></script>
<body>
<script>
test_valid_value('form-sizing', 'auto');
test_valid_value('form-sizing', 'normal');
test_valid_value('form-sizing', 'fixed');
test_valid_value('form-sizing', 'content');
</script>
</body>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<script src="/resources/testharnessreport.js"></script>
<style>
.disable-default {
form-sizing: normal;
form-sizing: content;
}

.small-placeholder {
Expand Down Expand Up @@ -51,7 +51,7 @@
test(() => {
let pair = addElements(`<input type=${type}>`);
// A text <input> has approximately 20ch width by default.
// A text <input> with form-sizing:normal must be shorter than the default.
// A text <input> with form-sizing:content must be shorter than the default.
assert_less_than(pair.content.offsetWidth, pair.fixed.offsetWidth);
assert_equals(pair.content.offsetHeight, pair.fixed.offsetHeight);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<script src="/resources/testharnessreport.js"></script>
<style>
.disable-default {
form-sizing: normal;
form-sizing: content;
}

.small-placeholder {
Expand Down Expand Up @@ -50,7 +50,7 @@
test(() => {
let pair = addElements(`<input type=${type}>`);
// A text <input> has approximately 20ch width by default.
// A text <input> with form-sizing:normal must be shorter than the default.
// A text <input> with form-sizing:content must be shorter than the default.
assert_less_than(pair.content.offsetWidth, pair.fixed.offsetWidth);
assert_equals(pair.content.offsetHeight, pair.fixed.offsetHeight);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<body>
<style>
.disable-default {
form-sizing: normal;
form-sizing: content;
}
</style>
<div id="container"></div>
Expand All @@ -18,7 +18,7 @@
test(() => {
const s = '<select>><option>1<option>quick brown<option>fox</select>';
container.innerHTML = s + s;
container.lastElementChild.style.formSizing = 'normal';
container.lastElementChild.style.formSizing = 'content';
const widthForContent1 = container.lastElementChild.offsetWidth;
assert_greater_than(container.firstElementChild.offsetWidth,
widthForContent1);
Expand All @@ -31,9 +31,9 @@
container.innerHTML = '<select><option>foo<option>quick brown fox</select>';
const select = container.firstElementChild;
const initialWidth = select.offsetWidth;
select.style.formSizing = 'normal';
select.style.formSizing = 'content';
assert_less_than(select.offsetWidth, initialWidth);
select.style.formSizing = 'auto';
select.style.formSizing = 'fixed';
assert_equals(select.offsetWidth, initialWidth);
}, 'dropdown: Change the form-sizing value dynamically');

Expand Down Expand Up @@ -76,9 +76,9 @@
container.innerHTML = '<select multiple><option>foo<option>quick brown fox</select>';
const select = container.firstElementChild;
const initialHeight = select.offsetHeight;
select.style.formSizing = 'normal';
select.style.formSizing = 'content';
assert_less_than(select.offsetHeight, initialHeight);
select.style.formSizing = 'auto';
select.style.formSizing = 'fixed';
assert_equals(select.offsetHeight, initialHeight);
}, 'listbox: Change the form-sizing value dynamically');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<script src="/resources/testharnessreport.js"></script>
<style>
.disable-default {
form-sizing: normal;
form-sizing: content;
}

.small-placeholder {
Expand Down Expand Up @@ -49,7 +49,7 @@
test(() => {
let pair = addElements('<textarea></textarea>');
// Historically a <textarea> has approximately 20ch x 2lh size by default.
// A <textarea> with form-sizing:normal must be samller than the default.
// A <textarea> with form-sizing:content must be samller than the default.
assert_less_than(pair.content.offsetWidth, pair.fixed.offsetWidth);
assert_less_than(pair.content.offsetHeight, pair.fixed.offsetHeight);

Expand Down

0 comments on commit e1c9e23

Please sign in to comment.