New issue
Advanced search Search tips

Issue 621832 link

Starred by 3 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Jun 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

::selection displays wrong color

Reported by samuelbe...@gmail.com, Jun 21 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36

Example URL:

Steps to reproduce the problem:
1. Make an simple HTML site.
2. Define a ::selection style with the background-color: #b2173a
3. Inspect it with the the Dev-Tools.

What is the expected behavior?
The highlighted text should be shown with the #b2173a background-color.

What went wrong?
The highlighted text has the wrong background-color: #af3137

Does it occur on multiple sites: Yes

Is it a problem with a plugin? No 

Did this work before? N/A 

Does this work in other browsers? No Safari Version 9.0.1 (11601.2.7.2)

Chrome version: 51.0.2704.103  Channel: stable
OS Version: OS X 10.11.1
Flash Version: Shockwave Flash 22.0 r0

It works fine in firefox with the property ::-moz-selection
 
Bildschirmfoto 2016-06-21 um 10.19.36.png
858 KB View Download
Looks like this is an intended behaviour before blink forked from webkit.

data:text/html,<style>::-moz-selection{background:red;color:red}::selection{background:red;color:red}</style>you can see this text after slection in Chrome
Screen Shot 2016-06-21 at 5.29.53 PM.png
129 KB View Download

Comment 3 by pdr@chromium.org, Jun 23 2016

Cc: pdr@chromium.org
Components: -Blink Blink>Paint
Status: WontFix (was: Unconfirmed)
I think this is an intended UI choice to improve how selection looks.

You can add a little opacity to workaround this:
data:text/html,<style>::-moz-selection{background:red;color:red}::selection{background:rgba(255,0,0,0.99);color:red}</style>you can see this text after selection in Chrome

Sign in to add a comment