[wpt-sync] Sync PR 35417 - HighlightOverlayPainting: fix ‘text-decoration-skip-ink’
Categories
(Core :: Layout: Generated Content, Lists, and Counters, task, P4)
Tracking
()
Tracking | Status | |
---|---|---|
firefox106 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
(Depends on 1 open bug, )
Details
(Whiteboard: [wptsync downstream])
Sync web-platform-tests PR 35417 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/35417
Details from upstream follow.
Delan Azabani <dazabani@igalia.com> wrote:
HighlightOverlayPainting: fix ‘text-decoration-skip-ink’
Underlines skip descenders when ‘text-decoration-skip-ink’ is ‘auto’,
but this relies on NGTextPainter having the correct range to compute
the text intercepts over. NGTextPainter is stateful, with a mutable
NGTextFragmentPaintInfo that affects things like the calculation of
text intercepts for skip ink.This is generally not a problem, but for highlight painting we break
the text fragment into parts, often painting text for one range then
decorations for another. This means we might compute text intercepts
for the wrong range.This patch fixes that bug by eliminating the NGTextFragmentPaintInfo
field, making functions that need one take it as an argument.To make it easier to safely slice NGTextFragmentPaintInfo, we add
methods to do that while checking that the new range is a subrange of
the old range. That way, any guarantees the caller wants to make about
the StringView and/or ShapeResultView in the old instance remain true
for the new instance (for example, some callers don’t care if there’s
a valid ShapeResultView, and sometimes it’s nullptr).To avoid messy template member functions, we duplicate a small method
(PaintDecorationUnderOrOverLine) for legacy, and move two others from
TextPainterBase into a new NGTextPainterBase, which contains LayoutNG-
specific code shared between NGTextPainter and NGTextCombinePainter.Fixed: 1350469
Change-Id: Ic51ff58da4e2a80bae2527f7ea90b57b9e361000Reviewed-on: https://chromium-review.googlesource.com/3820621
WPT-Export-Revision: b75a2fa06b12c21c222f231e9ba39049209a8fea
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 1•2 years ago
|
||
Comment 3•2 years ago
|
||
bugherder |
Description
•