Re: several messages about serialising HTML and related subjects

On Fri, 29 Feb 2008 03:23:03 +0100, Ian Hickson <ian@hixie.ch> wrote:

>> The spec says:
>>
>>    Other nodes types (e.g. Attr) cannot occur as children of elements.  
>> If
>>    they do, this algorithm must raise an INVALID_STATE_ERR exception.
>>
>> s/elements/elements or documents/ as the algorithm can be used for  
>> documents
>> as well.
>>
>> What about PIs? They can occur as children of elements or documents.
>
> How?

Same way as CDATA sections. :-) DOM Core doesn't allow CDATA sections or  
PIs in HTML documents, but Opera allows them and it's not clear to me it  
makes sense to ban them from the DOM in HTML. (I'm planning to do a  
rewrite of DOM Core that doesn't have unnecessary differences between HTML  
and XML.)


>> Consider the following document:
>>
>>    <h:p xmlns:h="http://www.w3.org/1999/xhtml"><x/></h:p>
>>
>> When getting innerHTML on the root element, should the serialization
>> declare the no namespace explicitly as in <x xmlns=""/>? (I think it
>> should because setting innerHTML will imply namespace declarations so it
>> might change meaning if you insert it somewhere else with innerHTML.)
>
> I've added this:
>
> | If any of the elements in the serialisation are in the null namespace,
> | the default namespace in scope for those elements must be explicitly
> | declared as the empty string.
>
> Is that ok?

Yes, thanks.

-- 
Simon Pieters
Opera Software

Received on Friday, 29 February 2008 16:28:05 UTC