Bug 271621 - [serialization] color functions such as lab() etc do not handle calc(NaN) and calc(0 / 0) properly
Summary: [serialization] color functions such as lab() etc do not handle calc(NaN) and...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: Safari 17
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL: https://wpt.fyi/results/css/css-color...
Keywords: BrowserCompat, InRadar, WPTImpact
Depends on:
Blocks:
 
Reported: 2024-03-24 21:21 PDT by Karl Dubost
Modified: 2024-03-24 21:23 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Karl Dubost 2024-03-24 21:21:05 PDT
Matthieu,

https://wpt.fyi/results/css/css-color/parsing/color-valid-lab.html
http://wpt.live/css/css-color/parsing/color-valid-lab.html


The tests pass in Firefox and Chrome.

Set 
   div.style["color"] = "rgb(calc(NaN) 30 30)"
Then 
   div.style.getPropertyValue('color')
Returns (as it should)
   "rgb(0, 30, 30)"

It has clamped the value to 0,
while it should have returned:


   "rgb(calc(NaN), 30, 30)"

The same is happening for 
   div.style["color"] = "rgb(calc(0 / 0) 30 30)"
where it should return
   "rgb(calc(NaN), 30, 30)"


See the rationales in https://github.com/w3c/csswg-drafts/issues/8629
This should fix some tests here and there
Comment 1 Radar WebKit Bug Importer 2024-03-24 21:21:19 PDT
<rdar://problem/125333997>
Comment 2 Karl Dubost 2024-03-24 21:23:56 PDT
s,rgb(,lab(, in my first comment.