Open JamesMGreene opened 11 years ago
e.g. for { "color": "red" }
"red" === "#FF0000" === "#F00" === "#FF0000FF" === "rgb(255, 0, 0)"
More Notes:
transparent
(rgb(0, 0, 0, 0)
) and currentcolor
(weird).Newer browsers also support new color functions like hsl
, hsla
, rgba
, device-cmyk
, etc.:
<color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> |
<hwb()> | <gray()> | <device-cmyk()> | <color()> |
<hex-color> | <named-color> | currentcolor | transparent
Suggestion: I am thinking any work on this should be implemented as an optional "module" that can be optionally included (namely just for IE<9, I guess), e.g.
QUnit.assert.html.color = function normalizeColor(val, prop, el) {
/* Normalize color values here */
/* `el` and `prop` would be needed to support `currentcolor`, otherwise they are unnecessary */
};
TL;DR: This addon currently does not normalize certain CSS style properties (e.g. color values) in IE < 9.
IE9+ and other browsers normalize the value the user sets. IE8- leaves the value as exactly what the user specified, even if error correction behavior handles it differently. For a little more info, see jquery/qunit#368.
Implementation notes for fixing: