Closed Bug 1860377 Opened 8 months ago Closed 8 months ago

Paint overlapping selections

Categories

(Core :: Layout, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
121 Branch
Tracking Status
firefox121 --- fixed

People

(Reporter: jjaschke, Assigned: jjaschke)

References

(Regressed 1 open bug)

Details

Attachments

(1 file)

New features such as Custom Highlight API or Text Fragments internally use new selection types for displaying ranges. This leads to situations where a text range is part of multiple selections. If these selections are not opaque, the colors should be mixed.

Currently, the selection painting mechanism in nsTextFrame only considers the selection with the highest priority for each text section and paints it.
This can be solved by painting each selection in a loop.

Since features such as Custom Highlight API or ::target-text are implemented
as a selection, multiple selections can be present on a section of text.

This patch paints all selections ordered by their priority instead of only painting the top-priority one,
so that colors will be combined if selections are not opaque.

Pushed by jjaschke@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5e91ccb036dc
Allow selections of different kind to overlap visually. r=emilio
Status: ASSIGNED → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → 121 Branch
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/42819 for changes under testing/web-platform/tests
Upstream PR was closed without merging
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: