W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2011

Re: [DOMCore] Can you create an HTML document with createDocument()?

From: Olli Pettay <Olli.Pettay@helsinki.fi>
Date: Fri, 03 Jun 2011 13:12:10 +0300
Message-ID: <4DE8B37A.2070807@helsinki.fi>
To: Ms2ger <ms2ger@gmail.com>
CC: David Flanagan <dflanagan@mozilla.com>, www-dom@w3.org
On 06/03/2011 11:26 AM, Ms2ger wrote:
> On 06/03/2011 02:33 AM, David Flanagan wrote:
>> ยง5.5:
>>> A |Document
>>> <http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#document>|
>>> node is assumed to be an XML document unless it is flagged as being an
>>> HTML document. Whether a document is an HTML document
>>> <http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#html-document>
>>> or an XML document
>>> <http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#xml-document>
>>> affects
>>> the behavior of certain APIs.
>> createHTMLDocument() explicity flags the new document as an HTML
>> document.
>> createDocument() is silent about this, which would mean that it is not
>> possible to create an HTML document with createDocument(), even if you
>> provide a proper namespace and property doctype object.
> Correct.
>> Firefox 4 allows me to create an HTML document with createDocument(), if
>> I set the namespace and doctype correctly, so I'm wondering if this
>> restriction in the spec is intentional or not.
> AFAICT, Chrome and Opera don't support this.
You can create HTML Document at least in Opera, and based on
source code also in webkit.


> I'd rather not add this to
> the specification, as it is rather magic, and createHTMLDocument serves
> the same use cases without having to figure out the doctypes that
> trigger this code path.
> I haven't changed the spec.
> Ms2ger
Received on Friday, 3 June 2011 10:12:40 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:50:40 UTC