Closed Bug 292566 Opened 21 years ago Closed 17 years ago

::selection/::-moz-selection pseudo-element ignored on form controls

Categories

(Core :: Layout: Form Controls, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 183646

People

(Reporter: pete_a90, Unassigned)

Details

Attachments

(1 file)

916 bytes, text/html
Details
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8b2) Gecko/20050430 Firefox/1.0+ Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8b2) Gecko/20050430 Firefox/1.0+ It's ignored, but not quite really though. If you put something like this: ::-moz-selection { background-color:#EB0 !important; color:#fff !important; } in userContent.css, it uses these colors instead of the system colors except for SELECT element, where selected text still uses the system colors. Reproducible: Always Steps to Reproduce:
Attached file testcase —
ugly looking testcase, but it shows that you can replace colors, bg-colors, and borders except for the selection color on form controls.
That's not a bug, IMHO; the select element's selection is not a text selection, it's an item selection, and is therefore not covered by ::selection.
Oops, you're right, authors should use option[selected] to style it. The rest of the bug report still applies though.
Could you specify what behaviour you think should change for this bug report to be considered fixed? I don't understand what there is here other than the <select> case.
On my machine, viewing this testcase, ::-moz-selection isn't being applied to the textarea or type="text" input box when you highlight its text.
The only reason it works in userContent.css is because that applies to anonymous content. From a page's point of view, the text in a text input doesn't exist -- the text input is a replaced element. So CSS doesn't apply to it. I don't think we should change that.
However, CSS3 explicitly say: "This also applies, for example, to selected text within an editable text field." http://www.w3.org/TR/2001/CR-css3-selectors-20011113/#UIfragments
That requirement cannot be fulfilled, in general.
Not working in html:textarea is bug 183646.
Status: UNCONFIRMED → RESOLVED
Closed: 17 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: