<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>22960</bug_id>
          
          <creation_ts>2013-08-14 16:46:55 +0000</creation_ts>
          <short_desc>Document, XMLDocument, HTMLDocument, oh my</short_desc>
          <delta_ts>2016-08-16 08:58:43 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>DOM</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>MOVED</resolution>
          
          <see_also>https://bugzilla.mozilla.org/show_bug.cgi?id=897815</see_also>
    
    <see_also>http://code.google.com/p/chromium/issues/detail?id=238368</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=110772</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>blocked on implementers removing cruft</status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Erik Arvidsson">erik.arvidsson</reporter>
          <assigned_to name="Anne">annevk</assigned_to>
          <cc>bzbarsky</cc>
    
    <cc>chris</cc>
    
    <cc>eoconnor</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>philipj</cc>
    
    <cc>robin</cc>
    
    <cc>VYV03354</cc>
    
    <cc>www-dom</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>92051</commentid>
    <comment_count>0</comment_count>
    <who name="Erik Arvidsson">erik.arvidsson</who>
    <bug_when>2013-08-14 16:46:55 +0000</bug_when>
    <thetext>The html and dom specs only have Document and XMLDocument. This does not match reality where we actually have HTMLDocument as well.

WebKit/Blink:

XMLDocument === Document // true
HTMLDocument.prototype.__proto__ === Document.prototype  // true
SVGDocument.prototype.__proto__ === Document.prototype  // true

document.implementation.createDocument(null, &apos;root&apos;, null)  // Document
document.implementation.createDocument(&apos;http://www.w3.org/1999/xhtml/&apos;, &apos;html&apos;, null)  // Document
document.implementation.createDocument(&apos;http://www.w3.org/2000/svg&apos;, &apos;svg&apos;, null)  // SVGDocument
document.implementation.createHTMLDocument(&apos;title&apos;)  //  HTMLDocument

Gecko:

XMLDocument.prototype.__proto__ === Document.prototype  // true
HTMLDocument.prototype.__proto__ === Document.prototype  // true
SVGDocument.prototype.__proto__ === Document.prototype  // true

document.implementation.createDocument(null, &apos;root&apos;, null)  // XMLDocument
document.implementation.createDocument(&apos;http://www.w3.org/1999/xhtml/&apos;, &apos;html&apos;, null)  // XMLDocument
document.implementation.createDocument(&apos;http://www.w3.org/2000/svg&apos;, &apos;svg&apos;, null)  // XMLDocument
document.implementation.createHTMLDocument(&apos;title&apos;)  //  HTMLDocument

IE10:

typeof XMLDocument  // &apos;undefined&apos;
typeof HTMLDocument  // &apos;undefined&apos;
typeof SVGDocument  // &apos;undefined&apos;

document.implementation.createDocument(null, &apos;root&apos;, null)  // Document
document.implementation.createDocument(&apos;http://www.w3.org/1999/xhtml/&apos;, &apos;html&apos;, null)  // Document
document.implementation.createDocument(&apos;http://www.w3.org/2000/svg&apos;, &apos;svg&apos;, null)  // Document
document.implementation.createHTMLDocument(&apos;title&apos;)  //  Document

IE11:

XMLDocument.prototype.__proto__ === Document.prototype  // true
HTMLDocument.prototype.__proto__ === Document.prototype  // true
typeof SVGDocument  // &apos;undefined&apos;

document.implementation.createDocument(null, &apos;root&apos;, null)  // XMLDocument
document.implementation.createDocument(&apos;http://www.w3.org/1999/xhtml/&apos;, &apos;html&apos;, null)  // XMLDocument
document.implementation.createDocument(&apos;http://www.w3.org/2000/svg&apos;, &apos;svg&apos;, null)  // XMLDocument
document.implementation.createHTMLDocument(&apos;title&apos;)  //  HTMLDocument

It is unclear if there is a way to create an SVGDocument in IE and Gecko.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92356</commentid>
    <comment_count>1</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-08-20 17:15:06 +0000</bug_when>
    <thetext>The solution here is for the browsers to align with the specs.

It doesn&apos;t make sense to have separate SVGDocument and HTMLDocument objects. You can have HTML in SVG and SVG in HTML.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92704</commentid>
    <comment_count>2</comment_count>
    <who name="Masatoshi Kimura">VYV03354</who>
    <bug_when>2013-08-29 15:13:46 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; The solution here is for the browsers to align with the specs.

Virtually all browser vendors disagree with merging:
https://bugzilla.mozilla.org/show_bug.cgi?id=897815
https://code.google.com/p/chromium/issues/detail?id=238368
https://bugs.webkit.org/show_bug.cgi?id=110772
In particular, IE11 reversed the behavior.

&gt; It doesn&apos;t make sense to have separate SVGDocument and HTMLDocument objects.
&gt; You can have HTML in SVG and SVG in HTML.

Unfortunately, it&apos;s common that browsers are doing something totally nonsensical and the spec will have to document the nonsense.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94504</commentid>
    <comment_count>3</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-10-09 19:41:46 +0000</bug_when>
    <thetext>&gt; Virtually all browser vendors disagree with merging:
&gt; https://bugzilla.mozilla.org/show_bug.cgi?id=897815
&gt; https://code.google.com/p/chromium/issues/detail?id=238368
&gt; https://bugs.webkit.org/show_bug.cgi?id=110772

Those bugs are still open. I wouldn&apos;t characterise that as disagreeing, just being cautious, as they should with something this drastic. This is the same thing we went through (correctly and appropriately) with the HTML parser.


&gt; &gt; It doesn&apos;t make sense to have separate SVGDocument and HTMLDocument objects.
&gt; &gt; You can have HTML in SVG and SVG in HTML.
&gt; 
&gt; Unfortunately, it&apos;s common that browsers are doing something totally
&gt; nonsensical and the spec will have to document the nonsense.

Sure, but that&apos;s not the only choice. Here in particular it doesn&apos;t seem to be the right choice, even.

There&apos;s maybe work to do — for see this thread:
   http://lists.w3.org/Archives/Public/public-whatwg-archive/2013Oct/0062.html

But just sticking with the old solution of separate SVGDocumetn and HTMLDocument objects just doesn&apos;t work.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106433</commentid>
    <comment_count>4</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-05-20 09:57:36 +0000</bug_when>
    <thetext>*** Bug 25028 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106436</commentid>
    <comment_count>5</comment_count>
    <who name="Chris Dumez">chris</who>
    <bug_when>2014-05-20 12:15:24 +0000</bug_when>
    <thetext>(In reply to Ian &apos;Hixie&apos; Hickson from comment #3)
&gt; &gt; Virtually all browser vendors disagree with merging:
&gt; &gt; https://bugzilla.mozilla.org/show_bug.cgi?id=897815
&gt; &gt; https://code.google.com/p/chromium/issues/detail?id=238368
&gt; &gt; https://bugs.webkit.org/show_bug.cgi?id=110772
&gt; 
&gt; Those bugs are still open. I wouldn&apos;t characterise that as disagreeing, just
&gt; being cautious, as they should with something this drastic. This is the same
&gt; thing we went through (correctly and appropriately) with the HTML parser.

FYI, Blink has already merged SVGDocument into Document:
http://src.chromium.org/viewvc/blink?view=revision&amp;revision=166179

We also started moving attributes from HTMLDocument to Document (even though HTMLDocument still exists for now):
https://code.google.com/p/chromium/issues/detail?id=362955
http://src.chromium.org/viewvc/blink?view=rev&amp;rev=165515</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>116663</commentid>
    <comment_count>6</comment_count>
    <who name="Robin Berjon">robin</who>
    <bug_when>2014-12-23 12:51:11 +0000</bug_when>
    <thetext>*** Bug 27684 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>127140</commentid>
    <comment_count>7</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2016-08-16 08:58:43 +0000</bug_when>
    <thetext>https://github.com/whatwg/dom/issues/221
https://github.com/whatwg/dom/issues/278

It seems engines are slowly merging these. At the end of that process we might have to do some additional cleanup, but that&apos;ll be filed as follow up issues.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>