Re: [whatwg] CSS2 system colors in legacy color values

2010-08-04 Thread Darin Adler
On Aug 3, 2010, at 6:33 PM, Ian Hickson wrote:

 We're talking about body bgcolor=Highlight here, not about the colour of 
 selected text.

I see. And I can reproduce the bug you’re talking about. I’ll probably fix it, 
but point taken.

-- Darin



Re: [whatwg] CSS2 system colors in legacy color values

2010-08-03 Thread Ian Hickson
On Sat, 22 May 2010, L. David Baron wrote:

 The rules for parsing a legacy color value in 
 http://www.whatwg.org/specs/web-apps/current-work/complete/common-microsyntaxes.html#rules-for-parsing-a-legacy-color-value
  
 specify that CSS2 system colors should be accepted, and that they should 
 be converted to a simple color.
 
 It seems like a substantial amount of work to get dynamic change 
 handling correct for this case, since system colors can change 
 dynamically when the user changes system appearance.  I'd really like to 
 avoid having to add dynamic change handling for this, and I'd also like 
 to avoid having to make system colors dynamic in CSS but static in HTML.
 
 What was the motivation for adding support for CSS2 system colors (which 
 I would note are deprecated in css3-color) to legacy HTML color values?

On Sun, 23 May 2010, Simon Pieters wrote:

 IE compat.

On Sat, 22 May 2010, L. David Baron wrote:

 What implementations support them...

On Sun, 23 May 2010, Simon Pieters wrote:
 
 I think WebKit and IE.

On Sat, 22 May 2010, L. David Baron wrote:

 and do they respond to dynamic changes properly?

WebKit on Mac responds to changes to the color Highlight by changing the 
colour to the default blue the next time it resolves style (as far as I 
can tell). Not exactly a success story. (Highlight is the only colour over 
which the user seems to have control on Mac.)

IE8 on Windows XP apparently updates automatically (thanks to wirepair on 
#whatwg for testing that).


On Sun, 23 May 2010, Simon Pieters wrote:
 
 It appears that Opera and Gecko don't support system colors. I wouldn't 
 mind not supporting them, but it could be interesting to research how 
 many pages it affects.

I don't have such research, unfortunately.

I've removed the support for it for now.


On Mon, 31 May 2010, Roger Hågensen wrote:
 
 I'm kinda surprised that there is no support for floating point colors though.
 Althought I guess that rgb(x%, x%, x%) An RGB percentage value (e.g.
 rgb(100%,0%,0%))
 is as close as you get to that... Does percentage rgb color support things
 like 85.41% though?
 I hope so as only rgb(x%, x%, x%) is tentatively gamut independent.

The legacy color values are just that, legacy, the less we support there 
the better.

-- 
Ian Hickson   U+1047E)\._.,--,'``.fL
http://ln.hixie.ch/   U+263A/,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Re: [whatwg] CSS2 system colors in legacy color values

2010-08-03 Thread Darin Adler
On Aug 3, 2010, at 5:55 PM, Ian Hickson wrote:

 WebKit on Mac responds to changes to the color Highlight by changing the 
 colour to the default blue the next time it resolves style (as far as I can 
 tell). Not exactly a success story. (Highlight is the only colour over which 
 the user seems to have control on Mac.)

I just tested this and it works perfectly. When I change the Highlight color 
using the Appearance pane of the Mac OS X System Preferences the color of 
highlighted text in Safari is immediately the right color as soon as I switch 
back to Safari.

Your comment, “[WebKit changes] the colour to the default blue the next time it 
resolves style” makes it sound like the code doesn’t work, but it works well 
and it is a success story!

-- Darin



Re: [whatwg] CSS2 system colors in legacy color values

2010-08-03 Thread Ian Hickson
On Tue, 3 Aug 2010, Darin Adler wrote:
 On Aug 3, 2010, at 5:55 PM, Ian Hickson wrote:
 
  WebKit on Mac responds to changes to the color Highlight by changing 
  the colour to the default blue the next time it resolves style (as far 
  as I can tell). Not exactly a success story. (Highlight is the only 
  colour over which the user seems to have control on Mac.)
 
 I just tested this and it works perfectly. When I change the Highlight 
 color using the Appearance pane of the Mac OS X System Preferences the 
 color of highlighted text in Safari is immediately the right color as 
 soon as I switch back to Safari.
 
 Your comment, “[WebKit changes] the colour to the default blue the next 
 time it resolves style” makes it sound like the code doesn’t work, but 
 it works well and it is a success story!

We're talking about body bgcolor=Highlight here, not about the colour of 
selected text.

-- 
Ian Hickson   U+1047E)\._.,--,'``.fL
http://ln.hixie.ch/   U+263A/,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Re: [whatwg] CSS2 system colors in legacy color values

2010-05-31 Thread Roger Hågensen

On 2010-05-23 23:49, Simon Pieters wrote:
On Sat, 22 May 2010 21:06:53 +0200, L. David Baron dba...@dbaron.org 
wrote:

The rules for parsing a legacy color value in
http://www.whatwg.org/specs/web-apps/current-work/complete/common-microsyntaxes.html#rules-for-parsing-a-legacy-color-value 


specify that CSS2 system colors should be accepted, and that they
should be converted to a simple color.
...
What was the motivation for adding support for CSS2 system colors

IE compat.

(which I would note are deprecated in css3-color) to legacy HTML
color values?  What implementations support them,

I think WebKit and IE.

and do they respond to dynamic changes properly?

I don't know.

It appears that Opera and Gecko don't support system colors. I 
wouldn't mind not supporting them, but it could be interesting to 
research how many pages it affects.


Interesting to know!

I'm kinda surprised that there is no support for floating point colors 
though.
Althought I guess that rgb(x%, x%, x%) An RGB percentage value (e.g. 
rgb(100%,0%,0%))
is as close as you get to that... Does percentage rgb color support 
things like 85.41% though?

I hope so as only rgb(x%, x%, x%) is tentatively gamut independent.

--
Roger Rescator Hågensen.
Freelancer - http://EmSai.net/



Re: [whatwg] CSS2 system colors in legacy color values

2010-05-31 Thread Roger Hågensen

On 2010-05-31 09:57, Roger Hågensen wrote:

On 2010-05-23 23:49, Simon Pieters wrote:
On Sat, 22 May 2010 21:06:53 +0200, L. David Baron 
dba...@dbaron.org wrote:

The rules for parsing a legacy color value in
http://www.whatwg.org/specs/web-apps/current-work/complete/common-microsyntaxes.html#rules-for-parsing-a-legacy-color-value 


specify that CSS2 system colors should be accepted, and that they
should be converted to a simple color.
...
What was the motivation for adding support for CSS2 system colors

IE compat.

(which I would note are deprecated in css3-color) to legacy HTML
color values?  What implementations support them,

I think WebKit and IE.

and do they respond to dynamic changes properly?

I don't know.

It appears that Opera and Gecko don't support system colors. I 
wouldn't mind not supporting them, but it could be interesting to 
research how many pages it affects.


Interesting to know!

I'm kinda surprised that there is no support for floating point colors 
though.
Althought I guess that rgb(x%, x%, x%) An RGB percentage value (e.g. 
rgb(100%,0%,0%))
is as close as you get to that... Does percentage rgb color support 
things like 85.41% though?

I hope so as only rgb(x%, x%, x%) is tentatively gamut independent.



Just did some tests! It seems that the latest Firefox, Opera, IE, and 
Chrome at least supports fractional percentages.

So rgb(0%,0%,80.00% equals 0,0,204
and rgb(0%,0%,80.99% equals 0,0,207
and rgb(0%,0%,80.50% equals 0,0,205

I wonder why the specs don't mention this support though,
and I guess that a value of 200% (what, like infared?) would mean twice 
as red as SRGB red (100%),

and in the case of these browsers they clamp anything higher to 255.

PS! To any Chrome folks here, seems like Chrome has a slight rounding 
bug compared to the other 3 browsers.


Example code:
html
head
titlePercentage Fraction color test/title
style type=text/css
  li {
color: white;
background: rgb(0%,0%,80.00%);
margin: 12px 12px 12px 12px;
padding: 12px 0px 12px 12px;
list-style: none
  }
  li.fraction {
color: white;
background: rgb(0%,0%,80.50%);
margin: 12px 12px 12px 12px;
padding: 12px 0px 12px 12px;
list-style: none
  }
/style
script
function getStyle(el)
{
if (el.currentStyle)
{
return el.currentStyle.backgroundColor;
}
if (document.defaultView)
{
return document.defaultView.getComputedStyle(el, 
'').getPropertyValue(background-color);

}
return Don't know how to get color;
}
/script
/head
body
ul
li id=blue1This should be RGB 0,0,204 (#cc) and it is: 
scriptdocument.write(getStyle(document.getElementById('blue1')));/script/li
li id=blue2 class=fractionThis should be RGB 0,0,205 (#cd) and 
it is: 
scriptdocument.write(getStyle(document.getElementById('blue2')))/script/li

/ul
/body
/html

--
Roger Rescator Hågensen.
Freelancer - http://EmSai.net/



Re: [whatwg] CSS2 system colors in legacy color values

2010-05-31 Thread Tab Atkins Jr.
On Mon, May 31, 2010 at 2:51 AM, Roger Hågensen resca...@emsai.net wrote:
 Just did some tests! It seems that the latest Firefox, Opera, IE, and Chrome
 at least supports fractional percentages.
 So rgb(0%,0%,80.00% equals 0,0,204
 and rgb(0%,0%,80.99% equals 0,0,207
 and rgb(0%,0%,80.50% equals 0,0,205

 I wonder why the specs don't mention this support though,
 and I guess that a value of 200% (what, like infared?) would mean twice as
 red as SRGB red (100%),
 and in the case of these browsers they clamp anything higher to 255.

What spec should mention it?  CSS already does, in the CSS3 Values and
Units spec.  A percentage is a number followed by a '%' character,
and a number is a float.

~TJ


Re: [whatwg] CSS2 system colors in legacy color values

2010-05-23 Thread Simon Pieters
On Sat, 22 May 2010 21:06:53 +0200, L. David Baron dba...@dbaron.org  
wrote:



The rules for parsing a legacy color value in
http://www.whatwg.org/specs/web-apps/current-work/complete/common-microsyntaxes.html#rules-for-parsing-a-legacy-color-value
specify that CSS2 system colors should be accepted, and that they
should be converted to a simple color.

It seems like a substantial amount of work to get dynamic change
handling correct for this case, since system colors can change
dynamically when the user changes system appearance.  I'd really
like to avoid having to add dynamic change handling for this, and
I'd also like to avoid having to make system colors dynamic in CSS
but static in HTML.

What was the motivation for adding support for CSS2 system colors


IE compat.



(which I would note are deprecated in css3-color) to legacy HTML
color values?  What implementations support them,


I think WebKit and IE.



and do they
respond to dynamic changes properly?


I don't know.

It appears that Opera and Gecko don't support system colors. I wouldn't  
mind not supporting them, but it could be interesting to research how many  
pages it affects.


--
Simon Pieters
Opera Software


[whatwg] CSS2 system colors in legacy color values

2010-05-22 Thread L. David Baron
The rules for parsing a legacy color value in
http://www.whatwg.org/specs/web-apps/current-work/complete/common-microsyntaxes.html#rules-for-parsing-a-legacy-color-value
specify that CSS2 system colors should be accepted, and that they
should be converted to a simple color.

It seems like a substantial amount of work to get dynamic change
handling correct for this case, since system colors can change
dynamically when the user changes system appearance.  I'd really
like to avoid having to add dynamic change handling for this, and
I'd also like to avoid having to make system colors dynamic in CSS
but static in HTML.

What was the motivation for adding support for CSS2 system colors
(which I would note are deprecated in css3-color) to legacy HTML
color values?  What implementations support them, and do they
respond to dynamic changes properly?

-David

-- 
L. David Baron http://dbaron.org/
Mozilla Corporation   http://www.mozilla.com/