Open
Bug 1993164
Opened 7 months ago
Updated 6 months ago
::selection on text
Categories
(Core :: SVG, defect)
Tracking
()
NEW
| Tracking | Status | |
|---|---|---|
| firefox145 | --- | affected |
People
(Reporter: karlcow, Unassigned, NeedInfo)
References
Details
Attachments
(1 file)
|
545.65 KB,
image/png
|
Details |
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:
text::selection {color: green}https://codepen.io/webcompat/full/EaPmYdmtext::selection {fill: green}https://codepen.io/webcompat/full/gbPWYQZtext::selection {stroke: blue}https://codepen.io/webcompat/full/xbZdKMXtext::selection {stroke: blue; stroke-width: 2px;}https://codepen.io/webcompat/full/RNrVbde
We can notice that:
- Firefox doesn't know about
fill,strokeandstroke-widthat all, but happily applies color (while it would not work on thetextelement alone). - Chrome and Safari have the same behavior mostly, except that Chrome shows a selection background per default once you apply a change of style.
colorhas no effect for Chrome and Safari.
Comment 1•7 months ago
|
||
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)
Updated•6 months ago
|
Severity: -- → S3
See Also: → https://github.com/w3c/svgwg/issues/894
You need to log in
before you can comment on or make changes to this bug.
Description
•