Re: Whitespace in attribute values

On Sat, 24 May 2008, Andrew Sidwell wrote:
> 
> http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%0A%3Ca%20href%3D%22%20%20%20http%3A%2F%2Fgoogle.com%2Fsearch%3Fq%3Dhello%20%20world%20%20%20%20%20%22%20class%3D%22%20%20%20raga%20taga%20%20%20%20%22%20new%3D%22%20%20%20raga%20%20haga%20%20%22%3Emeow%3C%2Fa%3E%0A
> 
> <!DOCTYPE html>
> <a href="   http://google.com/search?q=hello  world     "
>    class="   raga taga    " new="   raga  haga  ">meow</a>
> 
> I can't find anywhere in the spec which defines how to deal with 
> whitespace in attribute values.  Special handling seems to be in 
> browsers for the "href" and "class" attributes, and more general 
> handling in others. [...]
> 
> This isn't much of an interoperability issue except in the case of the 
> href attribute.  When following the href attribute, all browsers remove 
> at least any leading or trailing whitespace and URL-encode the rest, 
> even if the DOM has some leading/trailing whitespace.  Behaviour in this 
> case should be defined.

This should not be pretty well-defined.

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

Received on Friday, 27 June 2008 23:59:58 UTC