rgb() and rgba() color functions don't accept fractional r/g/b values
Reported by
aga...@gmail.com,
Sep 8 2016
|
|||||
Issue descriptionUserAgent: 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
,
Sep 9 2016
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
,
Sep 11 2016
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> ]? )
,
Sep 12 2016
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().
,
Sep 14 2016
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 |
|||||
Comment 1 by tkent@chromium.org
, Sep 9 2016