aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKenzie Raditya Tirtarahardja <kenzieradityatirtarahardja18@gmail.com>2025-03-23 08:45:59 +0800
committerGitHub <noreply@github.com>2025-03-23 00:45:59 +0000
commit40270cb6269f3f2d054bcfe51c69c8c545447f9a (patch)
tree9992a0aa8a6f1eac75ff97d1c0b11ca1cf4281a6 /tests
parent8dda64f14bb0214f773e0135dc7df190f7a04e1b (diff)
downloadservo-40270cb6269f3f2d054bcfe51c69c8c545447f9a.tar.gz
servo-40270cb6269f3f2d054bcfe51c69c8c545447f9a.zip
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>
Diffstat (limited to 'tests')
-rw-r--r--tests/wpt/meta/MANIFEST.json24
-rw-r--r--tests/wpt/tests/html/rendering/widgets/text-control-client-width.html19
-rw-r--r--tests/wpt/tests/html/rendering/widgets/text-control-flow-root-ref.html14
-rw-r--r--tests/wpt/tests/html/rendering/widgets/text-control-flow-root.html17
4 files changed, 74 insertions, 0 deletions
diff --git a/tests/wpt/meta/MANIFEST.json b/tests/wpt/meta/MANIFEST.json
index 642d038d314..117f1af832b 100644
--- a/tests/wpt/meta/MANIFEST.json
+++ b/tests/wpt/meta/MANIFEST.json
@@ -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",
[
diff --git a/tests/wpt/tests/html/rendering/widgets/text-control-client-width.html b/tests/wpt/tests/html/rendering/widgets/text-control-client-width.html
new file mode 100644
index 00000000000..cfded6804db
--- /dev/null
+++ b/tests/wpt/tests/html/rendering/widgets/text-control-client-width.html
@@ -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>
diff --git a/tests/wpt/tests/html/rendering/widgets/text-control-flow-root-ref.html b/tests/wpt/tests/html/rendering/widgets/text-control-flow-root-ref.html
new file mode 100644
index 00000000000..df2783540d8
--- /dev/null
+++ b/tests/wpt/tests/html/rendering/widgets/text-control-flow-root-ref.html
@@ -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
diff --git a/tests/wpt/tests/html/rendering/widgets/text-control-flow-root.html b/tests/wpt/tests/html/rendering/widgets/text-control-flow-root.html
new file mode 100644
index 00000000000..54f7612da34
--- /dev/null
+++ b/tests/wpt/tests/html/rendering/widgets/text-control-flow-root.html
@@ -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