Skip to content

Commit

Permalink
form-sizing: Change the keywords: auto|normal -> fixed|content
Browse files Browse the repository at this point in the history
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}
  • Loading branch information
tkent-google authored and Lightning00Blade committed Dec 11, 2023
1 parent 636b5c8 commit 61dc6f2
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 16 deletions.
4 changes: 2 additions & 2 deletions css/css-ui/parsing/form-sizing-computed.html
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>
2 changes: 2 additions & 0 deletions css/css-ui/parsing/form-sizing-invalid.html
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
4 changes: 2 additions & 2 deletions css/css-ui/parsing/form-sizing-valid.html
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
4 changes: 2 additions & 2 deletions html/rendering/widgets/form-sizing-input-text.tentative.html
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
12 changes: 6 additions & 6 deletions html/rendering/widgets/form-sizing-select.tentative.html
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
4 changes: 2 additions & 2 deletions html/rendering/widgets/form-sizing-textarea.tentative.html
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 61dc6f2

Please sign in to comment.