W3C home > Mailing lists > Public > public-html@w3.org > August 2007

Re: Serialize U+00A0 as   in HTML? (detailed review of Serializing HTML fragments)

From: Simon Pieters <simonp@opera.com>
Date: Mon, 27 Aug 2007 19:04:05 +0200
To: "Julian Reschke" <julian.reschke@gmx.de>
Cc: public-html <public-html@w3.org>
Message-ID: <op.txp9o3xuidj3kv@hp-a0a83fcd39d2.palace.opera.no>

On Mon, 27 Aug 2007 18:40:49 +0200, Julian Reschke <julian.reschke@gmx.de>  
wrote:

>
> Simon Pieters wrote:
>>  (This is part of my detailed review of the Serializing HTML fragments  
>> section.)
>>  IE7 and Firefox serialize U+00A0 characters in data and attribute  
>> values as "&nbsp;" when getting innerHTML. Safari and Opera don't.  
>> Should the spec be aligned with IE7 and Firefox here?
>>      
>> http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E%0D%0A%3Cscript%3Ewindow.onload%3Dfunction%28%29%7Bw%28document.body.innerHTML%29%7D%3C/script%3E%3Cp%20title%3D%22x%A0x%22%3Ex%A0x
>
> Why would it matter, as long as the serialization is valid?

I'm not sure which definition of the word "valid" you're using here. (The  
serializing algorithm does not ensure that the output is valid HTML, or  
even that it will parse into the original DOM when parsed.)

Anyway, serializing as &nbsp; is probably nicer for copy and paste, since  
otherwise non-breaking spaces are generally converted to normal spaces.

-- 
Simon Pieters
Opera Software
Received on Monday, 27 August 2007 17:04:21 UTC

This archive was generated by hypermail 2.3.1 : Monday, 29 September 2014 09:38:48 UTC