Skip to content

Commit 6be98ae

Browse files
committed
text-decoration-thickness property doesn't always trigger repaint when changed
https://bugs.webkit.org/show_bug.cgi?id=224483 rdar://76895249 Reviewed by Darin Adler. RenderStyle::changeRequiresRepaintIfText() should return true when text-decoration-thickness changes. GOV.UK bug tracker: alphagov/reported-bugs#60 * LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/invalidation/text-decoration-thickness-expected.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/invalidation/text-decoration-thickness-ref.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/invalidation/text-decoration-thickness.html: Added. * LayoutTests/platform/ios/TestExpectations: * Source/WebCore/rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::changeRequiresRepaintIfText const): Canonical link: https://commits.webkit.org/258641@main
1 parent 5b3f94a commit 6be98ae

File tree

5 files changed

+65
-1
lines changed

5 files changed

+65
-1
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<meta charset="utf-8">
4+
<title>text-decoration-thickness invalidation reference</title>
5+
<style>
6+
:link {
7+
text-decoration: underline;
8+
text-decoration-thickness: 3px;
9+
}
10+
</style>
11+
<div style="font-size: 28px;">
12+
<a href="#" id="link">Hover over this link, and check if the text-decoration-thickness increases.</a>
13+
</div>
14+
</html>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<meta charset="utf-8">
4+
<title>text-decoration-thickness invalidation reference</title>
5+
<style>
6+
:link {
7+
text-decoration: underline;
8+
text-decoration-thickness: 3px;
9+
}
10+
</style>
11+
<div style="font-size: 28px;">
12+
<a href="#" id="link">Hover over this link, and check if the text-decoration-thickness increases.</a>
13+
</div>
14+
</html>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<!DOCTYPE html>
2+
<html class="reftest-wait">
3+
<meta charset="utf-8">
4+
<title>text-decoration-thickness invalidation</title>
5+
<link rel="author" title="Tim Nguyen" href="https://github.com/nt1m">
6+
<link rel="help" href="https://drafts.csswg.org/selectors/#the-hover-pseudo">
7+
<link rel="help" href="https://drafts.csswg.org/css-text-decor-4/#text-decoration-thickness-property">
8+
<link rel="match" href="text-decoration-thickness-ref.html">
9+
<style>
10+
:link {
11+
text-decoration: underline;
12+
text-decoration-thickness: 1px;
13+
}
14+
:link:hover {
15+
text-decoration-thickness: 3px;
16+
}
17+
</style>
18+
<div style="font-size: 28px;">
19+
<a href="#" id="link">Hover over this link, and check if the text-decoration-thickness increases.</a>
20+
</div>
21+
<script src="/resources/testdriver.js"></script>
22+
<script src="/resources/testdriver-actions.js"></script>
23+
<script src="/resources/testdriver-vendor.js"></script>
24+
<script>
25+
window.addEventListener("load", async () => {
26+
// Hover the link
27+
await new test_driver.Actions().pointerMove(0, 0, { origin: link }).send();
28+
29+
document.documentElement.classList.remove("reftest-wait");
30+
});
31+
</script>
32+
</html>

LayoutTests/platform/ios/TestExpectations

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3193,7 +3193,10 @@ webkit.org/b/209734 imported/w3c/web-platform-tests/css/selectors/focus-visible-
31933193
webkit.org/b/209734 imported/w3c/web-platform-tests/css/selectors/focus-visible-script-focus-017.tentative.html [ Skip ]
31943194
webkit.org/b/209734 imported/w3c/web-platform-tests/css/selectors/focus-visible-script-focus-018.html [ Skip ]
31953195
webkit.org/b/209734 imported/w3c/web-platform-tests/css/selectors/focus-visible-script-focus-019.html [ Skip ]
3196-
webkit.org/b/209734 imported/w3c/web-platform-tests/css/selectors/hover-002.html [ Skip ]
3196+
3197+
# :hover simulation not working on iOS
3198+
imported/w3c/web-platform-tests/css/selectors/hover-002.html [ Skip ]
3199+
imported/w3c/web-platform-tests/css/css-text-decor/invalidation/text-decoration-thickness.html [ Skip ]
31973200

31983201
# Certain versions of iOS use different text security characters.
31993202
webkit.org/b/209692 platform/ios/fast/text/text-security-disc-bullet-pua-ios-new.html [ Pass ]

Source/WebCore/rendering/style/RenderStyle.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,6 +1242,7 @@ bool RenderStyle::changeRequiresRepaintIfText(const RenderStyle& other, OptionSe
12421242
|| m_visualData->textDecorationLine != other.m_visualData->textDecorationLine
12431243
|| m_rareNonInheritedData->textDecorationStyle != other.m_rareNonInheritedData->textDecorationStyle
12441244
|| m_rareNonInheritedData->textDecorationColor != other.m_rareNonInheritedData->textDecorationColor
1245+
|| m_rareNonInheritedData->textDecorationThickness != other.m_rareNonInheritedData->textDecorationThickness
12451246
|| m_rareInheritedData->textDecorationSkipInk != other.m_rareInheritedData->textDecorationSkipInk
12461247
|| m_rareInheritedData->textFillColor != other.m_rareInheritedData->textFillColor
12471248
|| m_rareInheritedData->textStrokeColor != other.m_rareInheritedData->textStrokeColor

0 commit comments

Comments
 (0)