This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 24978 - Section 10.3.1 doesn't specify the exact color format to which implementation should transform style
Summary: Section 10.3.1 doesn't specify the exact color format to which implementation...
Status: RESOLVED FIXED
Alias: None
Product: Browser Test/Tools WG
Classification: Unclassified
Component: WebDriver (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Browser Testing and Tools WG
QA Contact: Browser Testing and Tools WG
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 20860
  Show dependency treegraph
 
Reported: 2014-03-09 12:53 UTC by Andrey Botalov
Modified: 2014-05-11 12:49 UTC (History)
4 users (show)

See Also:


Attachments

Description Andrey Botalov 2014-03-09 12:53:56 UTC
Section 10.6.3 says:
Color property values must be standardized to rgba format, matching the regular expression: rgba(\d+,\s*\d+,\s*\d+\s*(,\s*(1|0(\.\d+)?)))

There are a number of issues with regexp above:
1. ( and ) should be escaped
2. It doesn't specify amount of spaces using which numerical values should be separated.
3. It doesn't define which format should be returned:
rgba(255, 0, 0, 1.0000)
rgba(255, 0, 0, 1.000)
rgba(255, 0, 0, 1.00)
rgba(255, 0, 0, 1.0)
rgba(255, 0, 0, 1)

I think spec should specify format strictly so there won't be driver incompatibilities.

What about?
rgba\(\d+, \d+, \d+, (?:1|0)\.\d+\)

but it doesn't fully solve issue 3 from the list above
Comment 1 David Burns :automatedtester 2014-05-08 22:58:49 UTC
Fixed in https://dvcs.w3.org/hg/webdriver/rev/91659493b7b3
Comment 2 Andrey Botalov 2014-05-09 06:51:04 UTC
I think it would be better to specify format in a more strict way, i.e. if integers or percentages should be used. And if whitespaces should be present after commas.
Comment 3 David Burns :automatedtester 2014-05-09 13:57:12 UTC
If there is a specification describing that we should use that, which CSS3-Color does. Not using that will cause a lot of work in user agents to describe something that already has been done and implemented. 

Since we have a standard as well implementors of local ends also know what to expect and can change according to the updates of the spec.
Comment 4 Andreas Tolfsen 2014-05-11 12:49:00 UTC
I believe it's defined in http://www.w3.org/TR/css3-color/#rgb-color.  The spec says:

“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 ‘)’. The integer value 255 corresponds to 100%, and to F or FF in the hexadecimal notation: rgb(255,255,255) = rgb(100%,100%,100%) = #FFF. White space characters are allowed around the numerical values.”

And goes on about normalizing the values:

“All RGB colors are specified in the sRGB color space (see [SRGB]). User agents may vary in the fidelity with which they represent these colors, but using sRGB provides an unambiguous and objectively measurable definition of what the color should be, which can be related to international standards (see [COLORIMETRY]).”

I suspect we will need an exhaustive tests for this.