commit 17f2e2a68ec680ecf71ff3ae7177392ad8e1899b
parent ae7b60bdf4834f6054416e49bed61486b2c68cb8
Author: Tim Nguyen <nt1m@users.noreply.github.com>
Date: Thu, 6 Nov 2025 21:35:16 +0000
Bug 1997743 [wpt PR 55814] - WebKit export of https://bugs.webkit.org/show_bug.cgi?id=300406, a=testonly
Automatic update from web-platform-tests
WebKit export: [CSS Zoom] Apply zoom factor to text indent (#55814)
https://bugs.webkit.org/show_bug.cgi?id=300406
Co-authored-by: Vitor Roriz <vitor.roriz@apple.com>
--
wpt-commits: a169963e0818324ee837fbded7fc84c158231524
wpt-pr: 55814
Diffstat:
3 files changed, 80 insertions(+), 0 deletions(-)
diff --git a/testing/web-platform/tests/css/css-viewport/zoom/reference/text-indent-svg-ref.html b/testing/web-platform/tests/css/css-viewport/zoom/reference/text-indent-svg-ref.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<style>
+html {
+ --scale: 1;
+}
+.indent {
+ text-indent: calc(1rem * var(--scale));
+}
+.zoom {
+ --scale: 2;
+}
+</style>
+
+<svg width="150" height="30">
+ <text class="indent" x="0" y="20">unzoomed</text>
+</svg>
+
+<div class="zoom">
+ <svg width="300" height="60">
+ <text style="font-size: calc(1rem * var(--scale))" class="indent" x="0" y="40">zoomed</text>
+ </svg>
+</div>
diff --git a/testing/web-platform/tests/css/css-viewport/zoom/text-indent-computed.html b/testing/web-platform/tests/css/css-viewport/zoom/text-indent-computed.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Text: text-indent computed values under zoom</title>
+<link rel="help" href="https://www.w3.org/TR/CSS22/text.html#indentation-prop">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#text-indent-property">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/css/support/computed-testcommon.js"></script>
+</head>
+<body>
+<div style="text-indent: 2rem;">
+ <p id="target">Test paragraph</p>
+</div>
+<script>
+const target = document.getElementById("target");
+
+test_computed_value("text-indent", "1px", "1px", "single value no zoom");
+test_computed_value("text-indent", "1rem", "16px", "rem value no zoom");
+test_computed_value("text-indent", "inherit", "32px", "inherit no zoom");
+test_computed_value("text-indent", "5px", "5px", "explicit px value no zoom");
+test_computed_value("text-indent", "0", "0px", "zero value no zoom");
+
+const parent = target.parentElement;
+parent.style.zoom = "2";
+
+test_computed_value("text-indent", "1px", "1px", "single value with zoom: 2");
+test_computed_value("text-indent", "1rem", "16px", "rem value with zoom: 2");
+test_computed_value("text-indent", "inherit", "32px", "inherit with zoom: 2");
+test_computed_value("text-indent", "5px", "5px", "explicit px value with zoom: 2");
+test_computed_value("text-indent", "0", "0px", "zero value with zoom: 2");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-viewport/zoom/text-indent-svg.html b/testing/web-platform/tests/css/css-viewport/zoom/text-indent-svg.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<title>CSS zoom does not apply to text-indent on SVG primitives when specified and inherited</title>
+<link rel="help" href="https://drafts.csswg.org/css-viewport/">
+<link rel="match" href="reference/text-indent-svg-ref.html">
+
+<style>
+.indent {
+ text-indent: 1rem;
+}
+.zoom {
+ zoom: 2;
+}
+</style>
+
+<svg width="150" height="30">
+ <text class="indent" x="0" y="20">unzoomed</text>
+</svg>
+
+<div class="zoom">
+ <svg width="150" height="30">
+ <text class="indent" x="0" y="20">zoomed</text>
+ </svg>
+</div>