Make input element display-inside always flow-root (#35908)

Signed-off-by: Kenzie Raditya Tirtarahardja <kenzieradityatirtarahardja.18@gmail.com>
Co-authored-by: Kenzie Raditya Tirtarahardja <kenzieradityatirtarahardja.18@gmail.com>
This commit is contained in:
Kenzie Raditya Tirtarahardja 2025-03-23 08:45:59 +08:00 committed by GitHub
parent 8dda64f14b
commit 40270cb626
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 136 additions and 16 deletions

View file

@ -347578,6 +347578,19 @@
{}
]
],
"text-control-flow-root.html": [
"54f7612da34262e9f804d5fcc6af0e71dafd3af8",
[
null,
[
[
"/html/rendering/widgets/text-control-flow-root-ref.html",
"=="
]
],
{}
]
],
"the-select-element": {
"option-add-label-quirks.html": [
"2c3c8093e253250f11a7e84a7ba89f3535d2eb20",
@ -473527,6 +473540,10 @@
"938d2659a8a8c02230c92db5b575818a5d056809",
[]
],
"text-control-flow-root-ref.html": [
"df2783540d87462a6c0f99c7d2e6bf6e7fd657a1",
[]
],
"the-select-element": {
"option-checked-styling-ref.html": [
"92504a47b5961a7fa64b98b9382327b7be8e3c83",
@ -717904,6 +717921,13 @@
{}
]
],
"text-control-client-width.html": [
"cfded6804dba6d5cc82472cae2cc276a7092741a",
[
null,
{}
]
],
"textarea-cols-rows.html": [
"5d02a4653ef77fbaab8b1c7aa8df933a8eabcd47",
[

View file

@ -0,0 +1,19 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>text control with `display: inline` must not have 0 client width</title>
<link rel="help" href="https://html.spec.whatwg.org/multipage/rendering.html#form-controls">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<input id="input" style="display: inline;">
<textarea id="textarea" style="display: inline;"></textarea>
<script>
test(() => {
assert_greater_than(document.querySelector("#input").clientWidth, 0);
}, "Input with `display: inline` should have positive client width");
test(() => {
assert_greater_than(document.querySelector("#textarea").clientWidth, 0);
}, "Textarea with `display: inline` should have positive client width");
</script>

View file

@ -0,0 +1,14 @@
<!DOCTYPE html>
<meta charset="UTF-8">
<input id="input1">
<br>
<input style="transform: scale(0.5);">
<br>
aaa<input>aaa
<br>
<textarea></textarea>
<br>
<textarea style="transform: scale(0.5);"></textarea>
<br>
aa<textarea style="transform: scale(0.5);">aa</textarea>aa

View file

@ -0,0 +1,17 @@
<!DOCTYPE html>
<meta charset="UTF-8">
<title>display inside of text control should always be flow-root</title>
<link rel="help" href="https://html.spec.whatwg.org/multipage/rendering.html#form-controls">
<link rel=match href="text-control-flow-root-ref.html">
<input id="input1" style="display: inline;">
<br>
<input style="display: inline; transform: scale(0.5);">
<br>
aaa<input style="display: inline;">aaa
<br>
<textarea style="display: inline;"></textarea>
<br>
<textarea style="display: inline; transform: scale(0.5);"></textarea>
<br>
aa<textarea style="display: inline; transform: scale(0.5);">aa</textarea>aa