Bug 254691

Summary: [CSS4 Color] [CSS4 Pseudo] getSelection() color and background color should match system color highlights
Product: WebKit Reporter: Gérard Talbot (no longer involved) <browserbugs2>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, karlcow, simon.fraser, webkit-bug-importer, wenson_hsieh, zalan
Priority: P2 Keywords: BrowserCompat, HasReduction, InRadar, W3CTest
Version: WebKit Local Build   
Hardware: PC   
OS: Linux   
URL: http://www.gtalbot.org/BrowserBugsSection/CSS4Color/system-color-hightlights-vs-getSelection-001.html
Attachments:
Description Flags
rendering in safari, firefox, chrome none

Description Gérard Talbot (no longer involved) 2023-03-29 14:30:53 PDT
Test:
http://www.gtalbot.org/BrowserBugsSection/CSS4Color/system-color-hightlights-vs-getSelection-001.html

Reference file:
http://www.gtalbot.org/BrowserBugsSection/CSS4Color/reference/system-color-hightlights-vs-getSelection-001-ref.html


CSS4 Color specification states:

  Highlight
      Background of item(s) selected in a control.
  https://www.w3.org/TR/css-color-4/#valdef-system-color-highlight

  HighlightText
      Text of item(s) selected in a control.
  https://www.w3.org/TR/css-color-4/#valdef-system-color-highlighttext

Firefox 102.9.0 ESR passes this test.

Epiphany 3.38.2 using WebKitGTK 2.38.5 fails this test.

Right now, there is no WPT test checking specifically this.

Chromium (Blink) equivalent bug report:
https://bugs.chromium.org/p/chromium/issues/detail?id=1429019
Comment 1 Karl Dubost 2023-03-29 19:09:05 PDT
Created attachment 465671 [details]
rendering in safari, firefox, chrome

Rendering with the reference and test in 3 browsers.
Comment 2 Gérard Talbot (no longer involved) 2023-03-30 05:06:41 PDT
Karl,

Your screenshot is very useful and interesting. I can see many differences; some are small but nevertheless there are differences.

Firefox under Linux (I can upload a screenshot if needed, if requested) renders the test quite differently from Firefox under Mac; it's not just colors but also line spacing (white areas) and height of background painting.  

Chrome under Mac and Chrome under Linux will select the <br> element; Safari and Firefox under Linux and Mac do not do that.
Comment 3 Radar WebKit Bug Importer 2023-04-05 14:31:15 PDT
<rdar://problem/107678370>
Comment 4 Gérard Talbot (no longer involved) 2023-04-12 15:54:38 PDT
WPT test result:
https://wpt.fyi/results/css/css-color/system-color-hightlights-vs-getSelection-001.html
Comment 5 Gérard Talbot (no longer involved) 2023-08-14 08:06:08 PDT
The original test has been split into 2 separate, distinct tests. Apparently, Safari 175 Technological Preview on macOS 13.5 passes both tests:

https://wpt.fyi/results/css/css-color/system-color-hightlights-vs-getSelection-001.html?label=experimental&label=master&aligned

https://wpt.fyi/results/css/css-color/system-color-hightlights-vs-getSelection-002.html?label=experimental&label=master&aligned

Therefore

Resolving as FIXED