From 412c23b8eca0dd8dc10dd6ffb558ed9415f8e1ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Thu, 21 Dec 2023 21:33:31 +0000 Subject: [PATCH] Make magic clip not magic. This implements the proposal in: https://github.com/whatwg/html/issues/9976 MANUAL PUSH: see bug 1871425 Differential Revision: https://phabricator.services.mozilla.com/D195419 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1800077 gecko-commit: 6a14f603289807a62753cc8ceaa35d9ba09cbf61 gecko-reviewers: jwatt, zcorpan --- .../widgets/button-layout/computed-style.html | 18 +++++++++++++++++- .../input-type-button-clip-ref.html | 9 +++++++++ .../button-layout/input-type-button-clip.html | 15 +++++++++++++++ 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 html/rendering/widgets/button-layout/input-type-button-clip-ref.html create mode 100644 html/rendering/widgets/button-layout/input-type-button-clip.html diff --git a/html/rendering/widgets/button-layout/computed-style.html b/html/rendering/widgets/button-layout/computed-style.html index 764e0844069af0..d18e5d365d824e 100644 --- a/html/rendering/widgets/button-layout/computed-style.html +++ b/html/rendering/widgets/button-layout/computed-style.html @@ -7,6 +7,7 @@ + \ No newline at end of file + +for (let input of document.querySelectorAll("input")) { + test(() => { + if (input.type == "image") { + assert_equals(getComputedStyle(input).overflow, "visible", "Should not be clip by default"); + return; + } + assert_equals(getComputedStyle(input).overflow, "clip", "Should be clip by default"); + assert_equals(getComputedStyle(input).overflowClipMargin, "0px", "Should use 0 margin"); + input.style.overflow = "visible"; + input.style.overflowClipMargin = "10px"; + assert_equals(getComputedStyle(input).overflow, "clip", "Clip be !important"); + assert_equals(getComputedStyle(input).overflowClipMargin, "0px", "Clip margin should be !important too"); + }, ` overflow/overflow-clip-margin`); +} + diff --git a/html/rendering/widgets/button-layout/input-type-button-clip-ref.html b/html/rendering/widgets/button-layout/input-type-button-clip-ref.html new file mode 100644 index 00000000000000..8f956d36f56b4f --- /dev/null +++ b/html/rendering/widgets/button-layout/input-type-button-clip-ref.html @@ -0,0 +1,9 @@ + + + diff --git a/html/rendering/widgets/button-layout/input-type-button-clip.html b/html/rendering/widgets/button-layout/input-type-button-clip.html new file mode 100644 index 00000000000000..db1ad35cce5b88 --- /dev/null +++ b/html/rendering/widgets/button-layout/input-type-button-clip.html @@ -0,0 +1,15 @@ + + +button input is clipped by default, and text-overflow: ellipsis works + + + + + + +