Hacker News new | past | comments | ask | show | jobs | submit login

http://www.whatwg.org/specs/web-apps/current-work/multipage/...

  = ”red” 
  = 0red0 (" is not ascii so make 0)
  = 00ed0 (r is not hex so make 0)
  = 00ed00 (pad)



Sorry, this isn't correct. Red is a perfectly valid color value. This is not about property expansion.

This is because the source uses curly quotes, which are not recognized as a parameter bracketing, and so the curly quotes are trying to be interpreted as part of the value.

Change the quotes to actual quotes and it starts working as expected.


No, the OP is correct. You're right that <red> is a valid CSS color keyword, but <”red”> is not. Because of this, the CSS spec treats it as a "legacy color value" and attempts to interpret it as a string of characters (including the quotes) rather than a keyword.


yeap


The quotes in my explanation are the 'curly' quotes. They just display differently on HN.


Oh, nice explanation

http://jsfiddle.net/pPCmG/


And also explains why, "blue" is actually blue

= "blue" = 0blue0 = 0b00e0


"blue" is actually supposed to be blue. Like "yellow" or "green" or "black"

it's ”blue” that is interesting.


I prefer ”orange” to your ”blue” actually... much easier on the eyes.


This neatly explains why `red` also becomes green.


#FF0000 also became green (with these quotes)


  = ”#FF0000”
  = 0#FF00000 (rule 10)
  = 00FF00000 (rule 10)
  = 00F F00 000 (rule 12)
  = 00 F0 00 (rule 15)
  = #00F000 (rule 16)
edit: fixed, was previously erroneously applying rule 14 which gave a result of #0FF000


That makes a great lot of sense, well explained! This should be on top of the comments.

Edit: Heh


What's the point of having different quotation marks that are not ascii? Sounds like a formatting nightmare.


Typography, duh.


superb




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: