W3C home > Mailing lists > Public > whatwg@whatwg.org > October 2008

[whatwg] Color attributes

From: Simon Pieters <simonp@opera.com>
Date: Fri, 17 Oct 2008 10:58:27 +0200
Message-ID: <op.ui5u7pboidj3kv@zcorpandell.linkoping.osa>
On Fri, 17 Oct 2008 00:01:02 +0200, Andy Lyttle <whatwg at phroggy.com> wrote:

> "While the first item's length in segments is greater than 2 and the  
> first character in each item in segments is a U+0030 DIGIT ZERO  
> character, remove the first character from each item in segments."
>
> Does this mean, if the length of the first item in segments is greater  
> than 2 then loop through each item in segments, and if the first  
> character is 0 then remove it?
>
> Or does it mean, if the length of the first item in segments is greater  
> than 2 and the first character of every item in segments is 0, then loop  
> through each item and delete the first character, but if the first  
> character of any item is not 0 then leave the whole thing alone?
>
> I'm assuming you meant #1, but your wording isn't perfectly clear.

I meant #2. Reworded.


> Has it occurred to you that while your algorithm makes the string "foo"  
> return an error, the string "l33tsp34k" is converted to a dark purple?

Yes. I thought it matched webkit. But further testing shows that it does  
not. :-(

999 -> #000999
aaa -> #aaaaaa
aax -> #000000
#999 -> #999999
#aax -> #000000

I've made the algorithm return input if it's correct "#rgb" and otherwise  
continue the algorithm (which will instead match IE).

So the above would instead be:

999 -> #090909
aaa -> #0a0a0a
aax -> #0a0a00
#999 -> #999999
#aax -> #0a0a00


Thanks!

-- 
Simon Pieters
Opera Software
Received on Friday, 17 October 2008 01:58:27 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:06 UTC