

Changeset 285567 – WebKit
source link: https://trac.webkit.org/changeset/285567/webkit
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Changeset 285567 in webkit
Wavy decorations don't cover the whole line length
https://bugs.webkit.org/show_bug.cgi?id=232663
Reviewed by Myles C. Maxfield.
LayoutTests/imported/w3c:
Import WPT tests from https://github.com/web-platform-tests/wpt/pull/31540.
- web-platform-tests/css/css-text-decor/text-decoration-line-through-wavy-covers-whole-line-length-001-expected-mismatch.html: Added.
- web-platform-tests/css/css-text-decor/text-decoration-line-through-wavy-covers-whole-line-length-001.html: Added.
- web-platform-tests/css/css-text-decor/text-decoration-overline-wavy-covers-whole-line-length-001-expected-mismatch.html: Added.
- web-platform-tests/css/css-text-decor/text-decoration-overline-wavy-covers-whole-line-length-001.html: Added.
- web-platform-tests/css/css-text-decor/text-decoration-underline-wavy-covers-whole-line-length-001-expected-mismatch.html: Added.
- web-platform-tests/css/css-text-decor/text-decoration-underline-wavy-covers-whole-line-length-001.html: Added.
- web-platform-tests/css/css-text-decor/w3c-import.log:
Source/WebCore:
We have a problem with wavy decorations, because we are only painting
whole waves. Which means that, sometimes, the last part of the line
is not covered by the wavy decorations.
To fix this we're modifying strokeWavyTextDecoration() method.
We paint 2 extra waves before and after the line width,
and we clip the wavy text decoration to match the line's width.
This patch also removes adjustStepToDecorationLength() as the method
was wrong (e.g. passing 40px length and 10px step, it'd modify the step
to be 10.75px which makes no sense).
Apart from that, as we're now clipping the wave to the text line,
this adjustment is no longer needed.
Tests: imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-line-through-wavy-covers-whole-line-length-001.html
imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-overline-wavy-covers-whole-line-length-001.html
imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-underline-wavy-covers-whole-line-length-001.html
- rendering/TextDecorationPainter.cpp:
(WebCore::strokeWavyTextDecoration):
(WebCore::adjustStepToDecorationLength): Deleted.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK