Closed Bug 1625278 Opened 6 years ago Closed 6 years ago

styling the selection pseudo element of contenteditable elements using css

Categories

(Core :: CSS Parsing and Computation, defect)

74 Branch
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX
Tracking Status
firefox74 --- wontfix
firefox75 --- wontfix
firefox76 --- wontfix

People

(Reporter: thomas, Unassigned)

Details

Attachments

(4 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36

Steps to reproduce:

I add the following to the style sheets div::selection{}.

Note: I am adding only the selector to the stylesheets. I am not applying any styling to the selection pseudo element. The mere presence of the ::selection selector in the stylesheets of an element already causes this bug.

Actual results:

In all contenteditable divs when you select something like a part of the text the selection isn't highlighted anymore. It gets selected. It's just not highlighted.

Expected results:

The selected part of the text should be highlighted. Just like it works when you don't add a ::selection selector to the stylesheets for contenteditable elements.

If there is something in the selection{}, it works.

You are right! Although you need to specify the background-color specifically. So adding only font-weight:bold doesn't fix it.

Status: UNCONFIRMED → NEW
Component: Untriaged → CSS Parsing and Computation
Ever confirmed: true
OS: Unspecified → All
Product: Firefox → Core
Hardware: Unspecified → All
Version: 76 Branch → 74 Branch

This behaves the same in other browsers except for the empty case (which is just a bogus optimization in other browsers). This came up recently in https://github.com/w3c/csswg-drafts/issues/4720, and this behavior may or may not change, but until then it's expected.

So I think this is wontfix? If you style the selection I think you should specify at least background-color, and probably color as well. It's also not specific to contenteditable.

Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: