New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 645289 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Not on Chrome anymore
Closed: Sep 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

rgb() and rgba() color functions don't accept fractional r/g/b values

Reported by aga...@gmail.com, Sep 8 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2850.0 Safari/537.36

Example URL:
https://jsfiddle.net/Serator/phbkLyfk/

Steps to reproduce the problem:
1. Set `red` value to `background-color` CSS-property.
2. Set `rgb(calc(1.0 * 0), 128, 0)` value to second `background-color` CSS-property.

What is the expected behavior?
`background-color` must be green color.

What went wrong?
`background-color` of red color.

Does it occur on multiple sites: N/A

Is it a problem with a plugin? No 

Did this work before? No 

Does this work in other browsers? N/A 

Chrome version: 55.0.2850.0  Channel: canary
OS Version: 10.0
Flash Version: Shockwave Flash 23.0 r0
 
Screenshot_3.png
209 KB View Download

Comment 1 by tkent@chromium.org, Sep 9 2016

Components: Blink>CSS
Cc: rnimmagadda@chromium.org
Labels: -Type-Compat M-55 OS-Linux OS-Mac Type-Bug
Status: Untriaged (was: Unconfirmed)
Able to repro this issue on Windows 7, MAC (10.11.6) & Ubuntu Trusty (14.04) for Google Chrome Canary Version - 55.0.2854.2

This is a Non-Regression issue existing from M30 - # 30.0.1549.0
645289.mov
3.2 MB Download
Status: Available (was: Untriaged)
rgb(calc(1.0 * 0), 128, 0):
Chrome, Edge, Firefox, Safari: Red background shown instead.

rgb(calc(1 * 0), 128, 0):
Chrome, Safari: Background changes to green.
Edge, Firefox: Red background still shown.

https://drafts.csswg.org/css-values-3/#calc-type-checking
"At *, check that at least one side is <number>. If both sides are <integer>, resolve to <integer>. Otherwise, resolve to the type of the other side."

So calc(1.0 * 0) is a <number>, while calc(1 * 0) is an <integer>.


The underlying issue is that Chrome (and Edge, Firefox, Safari) has an rgb function that accepts only <integer>, not <number>.

https://drafts.csswg.org/css-color/#rgb-functions
rgb() = ... | rgb( <number>{3} [ / <alpha-value> ]? )

Comment 4 by timloh@chromium.org, Sep 12 2016

Labels: -OS-Linux -OS-Windows -Arch-x86_64 -OS-Mac OS-All
Summary: rgb() and rgba() color functions don't accept fractional r/g/b values (was: CSS Calc function do not work with fractional values in rgb(a) / hsl(a) functions.)
This is unrelated to calc (e.g. 0.0 won't be accepted). Also hsl() accepts <number> for the first argument already.

css-color-3 only allowed <integer> for the r/g/b components of rgb()/rgba().

Comment 5 by nainar@chromium.org, Sep 14 2016

Owner: nainar@chromium.org
Status: WontFix (was: Available)
Backing up what #4 said, here is the quotation from the spec:
"The format of an RGB value in the functional notation is ‘rgb(’ followed by a comma-separated list of three numerical values (either three integer values or three percentage values) followed by ‘)’."


This then sounds like a WontFix to me. Marking as such please change the status or comment here if this is incorrect.

Sign in to add a comment