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

Re: Placing elements in the HTML namespace

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Thu, 15 Jan 2009 11:20:51 -0500
Message-ID: <496F6263.6010705@mit.edu>
To: Simon Pieters <simonp@opera.com>
CC: Anne van Kesteren <annevk@opera.com>, HTML WG <public-html@w3.org>

Simon Pieters wrote:
>> 1)  frames/iframes.  For XHTML we use the id attribute value as the
>>      window name, for HTML we use the name attribute value.  Should this
>>      be based on the document type instead?  Or something else?
> You should always use name='', per HTML5, I think.

Could be.  As I said, the last time I looked at this predates HTML5.

>> 2)  Serializing XML -- for XHTML we set shorthand attrs to be
>>      |foo="foo"| while for HTML we set them to just be |foo|.
>>      This only affects people calling the XML serializer on a DOM coming
>>      from text/html, but that sounds like something HTML5 wants to
>>      support.
> Not sure what you mean here. Are you saying that the XML serializer 
> isn't serializing as XML for HTML elements?

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.

Received on Thursday, 15 January 2009 16:21:53 UTC

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