Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normalize CSS colors for IE6-8 #2

Open
JamesMGreene opened this issue Feb 14, 2013 · 3 comments
Open

Normalize CSS colors for IE6-8 #2

JamesMGreene opened this issue Feb 14, 2013 · 3 comments

Comments

@JamesMGreene
Copy link
Owner

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 qunitjs/qunit#368.

Implementation notes for fixing:

@JamesMGreene
Copy link
Owner Author

e.g. for { "color": "red" }

"red" === "#FF0000" === "#F00" === "#FF0000FF" === "rgb(255, 0, 0)"

@JamesMGreene
Copy link
Owner Author

More Notes:

  • There are currently 148 named colors: http://dev.w3.org/csswg/css-color/#named-colors

  • There are also a few special keywords like 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
    

@JamesMGreene
Copy link
Owner Author

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 */
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant