Bug 1728740 - Create WPT reftest for the zero-position of text-underline-offset. r=layout-reviewers,mats
authorJonathan Kew <jkew@mozilla.com>
Thu, 02 Sep 2021 18:12:18 +0000
changeset 590869 e03a563a24f619900e687f0475c95e15c8afef5f
parent 590868 2a0c302799e3daad3a15b6fb1d5d817dc63ff7ac
child 590870 69bd8bc9c5111eb06e38baf16f78bd06e2206e53
push id149108
push userjkew@mozilla.com
push dateThu, 02 Sep 2021 19:47:27 +0000
treeherderautoland@e03a563a24f6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslayout-reviewers, mats
bugs1728740
milestone93.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1728740 - Create WPT reftest for the zero-position of text-underline-offset. r=layout-reviewers,mats Differential Revision: https://phabricator.services.mozilla.com/D124321
testing/web-platform/tests/css/css-text-decor/reference/text-underline-offset-zero-position-ref.html
testing/web-platform/tests/css/css-text-decor/text-underline-offset-zero-position.html
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text-decor/reference/text-underline-offset-zero-position-ref.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="utf-8">
+    <title>text-underline-offset test case - reference</title>
+    <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+    <style>
+        .green {
+            color: green;
+        }
+        .red {
+            color: red;
+        }
+        #test {
+            font: 100px Ahem;
+            color: green;
+        }
+    </style>
+</head>
+<body>
+    <p class="instructions">Test passes if there is a <span class=green>green</span> line and <span class=red>no red</span>.</p>
+    <div id="test">
+        <u>ppp</u>
+    </div>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text-decor/text-underline-offset-zero-position.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="utf-8">
+    <title>text-underline-offset test case</title>
+    <meta name="assert" content="zero-position for text-underline-offset is at the alphabetic baseline">
+    <link rel="author" title="Jonathan Kew" href="mailto:jkew@mozilla.com">
+    <link rel="help" href="https://drafts.csswg.org/css-text-decor-4/#line-offset-zero">
+    <link rel="match" href="reference/text-underline-offset-zero-position-ref.html">
+    <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+    <style>
+        .green {
+            color: green;
+        }
+        .red {
+            color: red;
+        }
+        #test {
+            font: 100px Ahem;
+            color: green;
+            -webkit-text-decoration-skip: none;
+            text-decoration-skip-ink: none;
+        }
+        u {
+            text-decoration: underline;
+            text-decoration-color: red;
+            text-decoration-thickness: 20px;
+            text-underline-position: auto;
+            text-underline-offset: 0px;  /* at the alphabetic baseline, per spec */
+        }
+    </style>
+</head>
+<body>
+    <p class="instructions">Test passes if there is a <span class=green>green</span> line and <span class=red>no red</span>.</p>
+    <div id="test">
+        <!-- At 100px, the "p" in Ahem will be a box with its top at the baseline,
+             and its bottom 20px (0.2em) below the baseline. -->
+        <u>ppp</u>
+    </div>
+</body>
+</html>