always canonicalise colors, not only for non-keywords

NEW
Unassigned

Status

()

Core
DOM: CSS Object Model
15 years ago
6 years ago

People

(Reporter: Hixie (not reading bugmail), Unassigned)

Tracking

Trunk
x86
Windows 2000
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

15 years ago
At the moment, we canonicalise most color values. For instance:

   If the sheets says...       In the DOM we return...
    #00F                         rgb(0, 0, 255)
    #0000FF                      rgb(0, 0, 255)
    rgb(0,0,255)                 rgb(0, 0, 255)
    rgb(0%, 0%, 100%)            rgb(0, 0, 255)

However, if the sheet says:

   color: red

...then we return 'red' as the value in the DOM.

We should fix this since according to bz, it would speed up style resolution (at 
the moment the color name is converted to the RGB triple on every style resolve 
instead of being converted at parse time). It would also ensure interoperability 
with Opera, which will be standardising on the rgb() canonicalisation.

Testcase: http://www.hixie.ch/tests/adhoc/dom/css/canonicalization/001.html
Our spec: http://www.damowmow.com/playground/canon.txt

This broke out of bug 110762.
Note that the speedup for style resolution will be pretty small (and not
measurable with our tools, really), since the table lookup involved is pretty fast.
Assignee: general → nobody
QA Contact: ian → general
QA Contact: general → style-system
You need to log in before you can comment on or make changes to this bug.