::selection displays wrong color
Reported by
samuelbe...@gmail.com,
Jun 21 2016
|
||
Issue descriptionUserAgent: 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
,
Jun 21 2016
Maybe caused by this blendWithWhite()? https://chromium.googlesource.com/chromium/blink/+/master/Source/core/layout/LayoutObject.cpp#1632
,
Jun 23 2016
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 |
||
Comment 1 by l446240525@gmail.com
, Jun 21 2016Looks 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 Chrome129 KB
129 KB View Download