Open Bug 1993164 Opened 7 months ago Updated 6 months ago

::selection on text

Categories

(Core :: SVG, defect)

Firefox 145
defect

Tracking

()

Tracking Status
firefox145 --- affected

People

(Reporter: karlcow, Unassigned, NeedInfo)

References

Details

Attachments

(1 file)

After noticing that there was a difference of implementation for Firefox on one side and Safari/Chrome on the other side for the following WPT.
https://wpt.fyi/results/css/css-pseudo/svg-text-selection-002.html

I went onto exploring testing a bit more.
See https://github.com/w3c/svgwg/issues/894#issuecomment-3354860239 and followup comments
That was also discussed on the SVG WG (and continue to be discussed).

The tests are

Columns: Safari, Firefox, Chrome
Rows:

We can notice that:

  1. Firefox doesn't know about fill, stroke and stroke-width at all, but happily applies color (while it would not work on the text element alone).
  2. Chrome and Safari have the same behavior mostly, except that Chrome shows a selection background per default once you apply a change of style. color has no effect for Chrome and Safari.

https://searchfox.org/firefox-main/source/layout/generic/nsTextPaintStyle.cpp#386

What do you want the logic to be? We use -webkit-text-fill-color for the text (I expect color works as some kind of fallback for that), and background-color for the background.

Flags: needinfo?(karl+moz)
Severity: -- → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: