W3C home > Mailing lists > Public > public-html@w3.org > January 2009

Re: Placing elements in the HTML namespace

From: Simon Pieters <simonp@opera.com>
Date: Fri, 16 Jan 2009 09:42:02 +0100
To: "Boris Zbarsky" <bzbarsky@mit.edu>, "Simon Pieters" <simonp@opera.com>
Cc: "Anne van Kesteren" <annevk@opera.com>, "HTML WG" <public-html@w3.org>
Message-ID: <op.unuc4csfidj3kv@hp-a0a83fcd39d2>

On Thu, 15 Jan 2009 17:20:51 +0100, Boris Zbarsky <bzbarsky@mit.edu> wrote:

> Sorry for being unclear (and worse yet, not quite correct).  If the XML  
> serializer in Gecko is serializing an element in the XHTML namespace,  
> and the element has an attribute which is in a list of "shorthand"  
> attributes, and the value of the attribute is "" in the DOM, then the  
> value will be serialized as equal to the name.  For example, if you take  
> an <xhtml:option selected=""> and round-trip it through the parser and  
> serializer you will get out <xhtml:option selected="selected">.
> The behavior is limited to the XHTML namespace, so if you were to take  
> <option selected>, parse it with the HTML parser (creating an attribute  
> with an empty value in Gecko) and then serialize it with the XML  
> serializer, you would get <option selected="">.
> In both cases, valid XML is produced, but the "same" (in terms of all  
> being HTML elements) DOM is serialized differently depending on the  
> actual namespace of the node.

Ah. I see. FWIW, both selected="" and selected="selected" are valid XHTML5 so you could remove some code here if you want. :-)

Simon Pieters
Opera Software
Received on Friday, 16 January 2009 08:43:55 UTC

This archive was generated by hypermail 2.4.0 : Saturday, 9 October 2021 18:44:41 UTC