Commit 5081dc0c authored by Dominik Röttsches's avatar Dominik Röttsches Committed by Chromium LUCI CQ

Non-auto thickness makes underline non-simple

Upgrade underline to non-simple when a thickness is set. Without this
change, only modifying the text-decoration-thickness property was
disregarded when no other properties are set, as the
hasSimpleUnderline() optimization was used in this case in
ComputedStyle.

Add a non-match type WPT test to ensure that a difference is seen when
two different thicknesses are set.

Fixed: 1154537
Change-Id: Id0413fc3f44e154b509e21b5f857f13f8d80a8f4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2577457Reviewed-by: default avatarAnders Hartvoll Ruud <andruud@chromium.org>
Reviewed-by: default avatarRune Lillesveen <futhark@chromium.org>
Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: Dominik Röttsches <drott@chromium.org>
Auto-Submit: Dominik Röttsches <drott@chromium.org>
Cr-Commit-Position: refs/heads/master@{#834208}
parent ea39f67d
......@@ -2074,7 +2074,8 @@ void ComputedStyle::ApplyTextDecorations(
bool is_simple_underline = decoration_lines == TextDecoration::kUnderline &&
decoration_style == ETextDecorationStyle::kSolid &&
TextDecorationColor().IsCurrentColor() &&
TextUnderlineOffset().IsAuto();
TextUnderlineOffset().IsAuto() &&
GetTextDecorationThickness().IsAuto();
if (is_simple_underline && !AppliedTextDecorationsInternal()) {
SetHasSimpleUnderlineInternal(true);
return;
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Non-reference case for text-decoration-thickness</title>
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<style>
div span {
font: 20px/1 Ahem;
padding-right: 1em;
text-decoration: underline;
text-decoration-thickness: 20px;
}
</style>
</head>
<body>
<p>Test passes if the underline thickness is 10px thick.</p>
<div><span>XXXX</span></div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Test case for text-decoration-thickness</title>
<meta name="assert" content="text-decoration-thickness: only using the thickness property should change painted result">
<link rel="author" title="Dominik Röttsches" href="mailto:drott@chromium.org">
<link rel="help" href="https://drafts.csswg.org/css-text-decor-4/#text-decoration-width-property">
<link rel="mismatch" href="reference/text-decoration-thickness-single-notref.html">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<style>
div span {
font: 20px/1 Ahem;
padding-right: 1em;
text-decoration: underline;
text-decoration-thickness: 10px;
}
</style>
</head>
<body>
<p>Test passes if the underline thickness is 10px thick.</p>
<div><span>XXXX</span></div>
</body>
</html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment