Skip to content

Commit

Permalink
Modified text decoration thickness test to pass on all platforms
Browse files Browse the repository at this point in the history
The lowercase 'g' descends through the underline,
which is rendered with dilation
(gap between the underline and the descending g).

Due to different anti-aliasing settings on different test platforms,
the font metrics are calculated slightly differently,
causing a 1 px difference between the from-font in the reference and
the manually set length in the test on at least one platform,
depending on the set font size.

To avoid dilation issues, the proposed work around is to change the
lowercase 'g' in the test text to uppercase 'G'.

Fixed: 1068947

Change-Id: Id2be1fb3e56f9faab8a9698522b21cc42b57f5d1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3689109
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Traian Captan <tcaptan@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1014580}
  • Loading branch information
tcaptan-cr authored and chromium-wpt-export-bot committed Jun 15, 2022
1 parent cd59733 commit cc2c9af
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

.test {
text-underline-position: from-font;
font-size: 62px;
font-size: 64px;
line-height: 1.8;
}

Expand All @@ -38,9 +38,9 @@
</head>
<body>
<p>Test passes if underlines are thin, thick, thin, thick in this order and match the reference rendering.</p>
<div class="test"><span class="thin_underline">aagaa</span></div>
<div class="test"><span class="thick_underline">aagaa</span></div>
<div class="test"><span class="thin_underline">aagaa</span></div>
<div class="test"><span class="thick_underline">aagaa</span></div>
<div class="test"><span class="thin_underline">aaGaa</span></div>
<div class="test"><span class="thick_underline">aaGaa</span></div>
<div class="test"><span class="thin_underline">aaGaa</span></div>
<div class="test"><span class="thick_underline">aaGaa</span></div>
</body>
</html>
12 changes: 6 additions & 6 deletions css/css-text-decor/text-decoration-thickness-fixed.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

.test {
text-underline-position: from-font;
font-size: 62px;
font-size: 64px;
line-height: 1.8;
}

Expand All @@ -28,7 +28,7 @@
.thick_underline {
font-family: underline-variable;
text-decoration: underline;
text-decoration-thickness: 6.2px;
text-decoration-thickness: 6.4px;
}

.thin_underline_percent {
Expand All @@ -46,9 +46,9 @@
</head>
<body>
<p>Test passes if underlines are thin, thick, thin, thick in this order and match the reference rendering.</p>
<div class="test"><span class="thin_underline">aagaa</span></div>
<div class="test"><span class="thick_underline">aagaa</span></div>
<div class="test"><span class="thin_underline_percent">aagaa</span></div>
<div class="test"><span class="thick_underline_percent">aagaa</span></div>
<div class="test"><span class="thin_underline">aaGaa</span></div>
<div class="test"><span class="thick_underline">aaGaa</span></div>
<div class="test"><span class="thin_underline_percent">aaGaa</span></div>
<div class="test"><span class="thick_underline_percent">aaGaa</span></div>
</body>
</html>

0 comments on commit cc2c9af

Please sign in to comment.