[html5] r8406 - [e] (0) Rearrange how Document objects are initialized and created to make thing [...]

whatwg at whatwg.org whatwg at whatwg.org
Fri Jan 17 10:05:47 PST 2014


Author: ianh
Date: 2014-01-17 10:05:45 -0800 (Fri, 17 Jan 2014)
New Revision: 8406

Modified:
   complete.html
   index
   source
Log:
[e] (0) Rearrange how Document objects are initialized and created to make things a little clearer
Affected topics: HTML, HTML Syntax and Parsing

Modified: complete.html
===================================================================
--- complete.html	2014-01-17 08:12:26 UTC (rev 8405)
+++ complete.html	2014-01-17 18:05:45 UTC (rev 8406)
@@ -67153,10 +67153,11 @@
    (even if it is empty), then <a href=#scroll-to-fragid title=navigate-fragid>navigate to that fragment
    identifier</a> and abort these steps.</li>
 
+<!--CLEANUP-->
    <li><p>If <var title="">gone async</var> is false, cancel any preexisting but not yet <a href=#concept-navigate-mature title=concept-navigate-mature>mature</a> attempt to navigate the <a href=#browsing-context>browsing
    context</a>, including canceling any instances of the <a href=#fetch>fetch</a> algorithm started by
-   those attempts. If one of those attempts has already <a href=#create-a-document-object title="create a document
-   object">created a new <code>Document</code> object</a>, <a href=#abort-a-document title="abort a
+   those attempts. If one of those attempts has already created and <a href=#initialize-the-document-object title="initialize the document
+   object">initialized a new <code>Document</code> object</a>, <a href=#abort-a-document title="abort a
    document">abort</a> that <code><a href=#document>Document</a></code> also. (Navigation attempts that have <a href=#concept-navigate-mature title=concept-navigate-mature>matured</a> already have session history entries, and are
    therefore handled during the <a href=#update-the-session-history-with-the-new-page>update the session history with the new page</a> algorithm,
    later.)</li>
@@ -67427,8 +67428,9 @@
     The user agent may indicate to the user that the original page load failed, and that the page
     used was a previously cached resource.</p>
 
+<!--CLEANUP-->
     <p class=note>This does not affect the <i>address of the resource from which Request-URIs are
-    obtained</i>, as used to set <a href="#the-document's-referrer">the document's referrer</a> in the <a href=#create-a-document-object>create a Document
+    obtained</i>, as used to set <a href="#the-document's-referrer">the document's referrer</a> in the <a href=#initialize-the-document-object>initialize the <code>Document</code>
     object</a> steps below; they still use the value as computed by the original
     <a href=#fetch>fetch</a> algorithm.</p>
 
@@ -67461,8 +67463,9 @@
     failed, that the page used was a fallback resource, and what the URL of the fallback resource
     actually is.</p>
 
+<!--CLEANUP-->
     <p class=note>This does not affect the <i>address of the resource from which Request-URIs are
-    obtained</i>, as used to set <a href="#the-document's-referrer">the document's referrer</a> in the <a href=#create-a-document-object>create a Document
+    obtained</i>, as used to set <a href="#the-document's-referrer">the document's referrer</a> in the <a href=#initialize-the-document-object>initialize the <code>Document</code>
     object</a> steps below; they still use the value as computed by the original
     <a href=#fetch>fetch</a> algorithm.</p>
 
@@ -67572,9 +67575,9 @@
     <p class=note>An <a href=#override-url title="override URL">override URL</a> is set when <a href=#javascript-protocol title="javascript protocol">dereferencing a <code>javascript:</code> URL</a> and when
     performing <a href=#an-overridden-reload>an overridden reload</a>.</p>
 
-    <p><dfn id=create-a-document-object title="create a Document object">Creating a new <code>Document</code> object</dfn>: when
-    a <code><a href=#document>Document</a></code> is created as part of the above steps, the user agent must additionally
-    run the following algorithm as part of creating the new object:</p>
+    <p><dfn id=initialize-the-document-object title="initialize the Document object">Initializing a new <code>Document</code>
+    object</dfn>: when a <code><a href=#document>Document</a></code> is created as part of the above steps, the user agent
+    will be required to additionally run the following algorithm after creating the new object:</p>
 
     <ol><li><p>Create a new <code><a href=#window>Window</a></code> object, and associate it with the
      <code><a href=#document>Document</a></code>, with one exception: if the <a href=#browsing-context>browsing context</a>'s only entry in
@@ -67714,10 +67717,12 @@
 
   <h4 id=read-html><span class=secno>6.6.2 </span><dfn title=navigate-html>Page load processing model for HTML files</dfn></h4>
 
+<!--CLEANUP-->
   <p>When an HTML document is to be loaded in a <a href=#browsing-context>browsing context</a>, the user agent must
-  <a href=#queue-a-task>queue a task</a> to <a href=#create-a-document-object>create a <code>Document</code> object</a>, mark it as being
+  <a href=#queue-a-task>queue a task</a> to create a <code><a href=#document>Document</a></code> object, mark it as being
   an <a href=#html-documents title="HTML documents">HTML document</a>, set its <a href=#concept-document-content-type title=concept-document-content-type>content type</a> to "<code title="">text/html</code>",
-  create an <a href=#html-parser>HTML parser</a>, and associate it with the document. Each <a href=#concept-task title=concept-task>task</a> that the <a href=#networking-task-source>networking task source</a> places on the
+  <a href=#initialize-the-document-object>initialize the <code>Document</code> object</a>, and finally
+  create an <a href=#html-parser>HTML parser</a> and associate it with the <code><a href=#document>Document</a></code>. Each <a href=#concept-task title=concept-task>task</a> that the <a href=#networking-task-source>networking task source</a> places on the
   <a href=#task-queue>task queue</a> while the <a href=#fetch title=fetch>fetching algorithm</a> runs must then
   fill the parser's <a href=#the-input-byte-stream>input byte stream</a> with the fetched bytes and cause the <a href=#html-parser>HTML
   parser</a> to perform the appropriate processing of the input stream.</p>
@@ -67745,10 +67750,17 @@
 
   <h4 id=read-xml><span class=secno>6.6.3 </span><dfn title=navigate-xml>Page load processing model for XML files</dfn></h4>
 
-  <p>When faced with displaying an XML file inline, user agents must first <a href=#create-a-document-object>create a
-  <code>Document</code> object</a>, following the requirements of the XML and Namespaces in XML
-  recommendations, RFC 3023, DOM, and other relevant specifications. <a href=#refsXML>[XML]</a> <a href=#refsXMLNS>[XMLNS]</a> <a href=#refsRFC3023>[RFC3023]</a> <a href=#refsDOM>[DOM]</a></p>
+<!--CLEANUP-->
+  <p>When faced with displaying an XML file inline, user agents must follow the requirements defined
+  in the XML and Namespaces in XML recommendations, RFC 3023, DOM, and other relevant specifications
+  to create a <code><a href=#document>Document</a></code> object and a corresponding <a href=#xml-parser>XML parser</a>. <a href=#refsXML>[XML]</a> <a href=#refsXMLNS>[XMLNS]</a> <a href=#refsRFC3023>[RFC3023]</a> <a href=#refsDOM>[DOM]</a></p>
 
+  <p class=note>At the time of writing, the XML specification community had not actually yet
+  specified how XML and the DOM interact.</p> <!--XMLPARSE-->
+
+  <p>After the <code><a href=#document>Document</a></code> is created, the user agent must <a href=#initialize-the-document-object>initialize the
+  <code>Document</code> object</a>.</p>
+
   <p>The actual HTTP headers and other metadata, not the headers as mutated or implied by the
   algorithms given in this specification, are the ones that must be used when determining the
   character encoding according to the rules given in the above specifications. Once the character
@@ -67789,10 +67801,12 @@
 
   <h4 id=read-text><span class=secno>6.6.4 </span><dfn title=navigate-text>Page load processing model for text files</dfn></h4>
 
+<!--CLEANUP-->
   <p>When a plain text document is to be loaded in a <a href=#browsing-context>browsing context</a>, the user agent
-  must <a href=#queue-a-task>queue a task</a> to <a href=#create-a-document-object>create a <code>Document</code> object</a>, mark it as
+  must <a href=#queue-a-task>queue a task</a> to create a <code><a href=#document>Document</a></code> object, mark it as
   being an <a href=#html-documents title="HTML documents">HTML document</a>, set its <a href=#concept-document-content-type title=concept-document-content-type>content type</a> to "<code title="">text/plain</code>",
-  create an <a href=#html-parser>HTML parser</a>, associate it with the document, act as if the tokenizer had
+  <a href=#initialize-the-document-object>initialize the <code>Document</code> object</a>,
+  create an <a href=#html-parser>HTML parser</a>, associate it with the <code><a href=#document>Document</a></code>, act as if the tokenizer had
   emitted a start tag token with the tag name "pre" followed by a single U+000A LINE FEED (LF)
   character<!-- to get eaten, so that a leading LF in the text/plain stream doesn't get eaten
   itself-->, and switch the <a href=#html-parser>HTML parser</a>'s tokenizer to the <a href=#plaintext-state>PLAINTEXT
@@ -67841,10 +67855,11 @@
   <a href=#browsing-context>browsing context</a>, the user agent must parse the resource using the rules for
   multipart types. <a href=#refsRFC2046>[RFC2046]</a></p>
 
+<!--CLEANUP-->
   <p>For each body part obtained from the resource, the user agent must run a new instance of the
   <a href=#navigate>navigate</a> algorithm, starting from the <i>resource handling</i> step, using the new
   body part as the resource being navigated, with <a href=#replacement-enabled>replacement enabled</a> if a previous
-  body part from the same resource resulted in a <code><a href=#document>Document</a></code> object being <a href=#create-a-document-object title="create a document object">created</a>, and otherwise using the same setup as the
+  body part from the same resource resulted in a <code><a href=#document>Document</a></code> object being created and <a href=#initialize-the-document-object title="initialize the document object">initialized</a>, and otherwise using the same setup as the
   <a href=#navigate>navigate</a> attempt that caused this section to be invoked in the first place.</p>
 
   <p>For the purposes of algorithms processing these body parts as if they were complete stand-alone
@@ -67856,9 +67871,11 @@
 
   <h4 id=read-media><span class=secno>6.6.6 </span><dfn title=navigate-media>Page load processing model for media</dfn></h4>
 
+<!--CLEANUP-->
   <p>When an image, video, or audio resource is to be loaded in a <a href=#browsing-context>browsing context</a>, the
-  user agent should <a href=#create-a-document-object>create a <code>Document</code> object</a>, mark it as being an <a href=#html-documents title="HTML documents">HTML document</a>, set its <a href=#concept-document-content-type title=concept-document-content-type>content type</a> to the sniffed MIME type of the resource
-  (<var title="">type</var> in the <a href=#navigate>navigate</a> algorithm), append an <code><a href=#the-html-element>html</a></code>
+  user agent should create a <code><a href=#document>Document</a></code> object, mark it as being an <a href=#html-documents title="HTML documents">HTML document</a>, set its <a href=#concept-document-content-type title=concept-document-content-type>content type</a> to the sniffed MIME type of the resource
+  (<var title="">type</var> in the <a href=#navigate>navigate</a> algorithm), <a href=#initialize-the-document-object>initialize the
+  <code>Document</code> object</a>, append an <code><a href=#the-html-element>html</a></code>
   element to the <code><a href=#document>Document</a></code>, append a <code><a href=#the-head-element>head</a></code> element and a <code><a href=#the-body-element>body</a></code>
   element to the <code><a href=#the-html-element>html</a></code> element, append an element <var title="">host element</var> for
   the media, as described below, to the <code><a href=#the-body-element>body</a></code> element, and set the appropriate attribute
@@ -67898,12 +67915,14 @@
 
   <h4 id=read-plugin><span class=secno>6.6.7 </span><dfn title=navigate-plugin>Page load processing model for content that uses plugins</dfn></h4>
 
+<!--CLEANUP-->
   <p>When a resource that requires an external resource to be rendered is to be loaded in a
-  <a href=#browsing-context>browsing context</a>, the user agent should <a href=#create-a-document-object>create a <code>Document</code>
-  object</a>, mark it as being an <a href=#html-documents title="HTML documents">HTML document</a> and mark it
+  <a href=#browsing-context>browsing context</a>, the user agent should create a <code><a href=#document>Document</a></code>
+  object, mark it as being an <a href=#html-documents title="HTML documents">HTML document</a> and mark it
   as being a <dfn id=plugin-document>plugin document</dfn>, set its <a href=#concept-document-content-type title=concept-document-content-type>content
   type</a> to the sniffed MIME type of the resource (<var title="">type</var> in the
-  <a href=#navigate>navigate</a> algorithm), append an <code><a href=#the-html-element>html</a></code> element to the
+  <a href=#navigate>navigate</a> algorithm),
+  <a href=#initialize-the-document-object>initialize the <code>Document</code> object</a>, append an <code><a href=#the-html-element>html</a></code> element to the
   <code><a href=#document>Document</a></code>, append a <code><a href=#the-head-element>head</a></code> element and a <code><a href=#the-body-element>body</a></code> element to the
   <code><a href=#the-html-element>html</a></code> element, append an <code><a href=#the-embed-element>embed</a></code> to the <code><a href=#the-body-element>body</a></code> element, and set
   the <code title=attr-embed-src><a href=#attr-embed-src>src</a></code> attribute of the <code><a href=#the-embed-element>embed</a></code> element to the
@@ -67937,9 +67956,11 @@
   <h4 id=read-ua-inline><span class=secno>6.6.8 </span><dfn title=navigate-ua-inline>Page load processing model for inline
   content that doesn't have a DOM</dfn></h4>
 
+<!--CLEANUP-->
   <p>When the user agent is to display a user agent page inline in a <a href=#browsing-context>browsing context</a>,
-  the user agent should <a href=#create-a-document-object>create a <code>Document</code> object</a>, mark it as being an
+  the user agent should create a <code><a href=#document>Document</a></code> object, mark it as being an
   <a href=#html-documents title="HTML documents">HTML document</a>, set its <a href=#concept-document-content-type title=concept-document-content-type>content type</a> to "<code title="">text/html</code>",
+  <a href=#initialize-the-document-object>initialize the <code>Document</code> object</a>,
   and then either associate that <code><a href=#document>Document</a></code> with a custom rendering that is not rendered
   using the normal <code><a href=#document>Document</a></code> rendering rules, or mutate that <code><a href=#document>Document</a></code> until
   it represents the content the user agent wants to render.</p>
@@ -93196,7 +93217,7 @@
   the rules given in the XML specification to map a string of bytes or characters into a
   <code><a href=#document>Document</a></code> object.</p>
 
-  <p class=note>At the time of writing, no such rules actually exist.</p>
+  <p class=note>At the time of writing, no such rules actually exist.</p><!--XMLPARSE-->
 
   <p>An <a href=#xml-parser>XML parser</a> is either associated with a <code><a href=#document>Document</a></code> object when it is
   created, or creates one implicitly.</p>

Modified: index
===================================================================
--- index	2014-01-17 08:12:26 UTC (rev 8405)
+++ index	2014-01-17 18:05:45 UTC (rev 8406)
@@ -67153,10 +67153,11 @@
    (even if it is empty), then <a href=#scroll-to-fragid title=navigate-fragid>navigate to that fragment
    identifier</a> and abort these steps.</li>
 
+<!--CLEANUP-->
    <li><p>If <var title="">gone async</var> is false, cancel any preexisting but not yet <a href=#concept-navigate-mature title=concept-navigate-mature>mature</a> attempt to navigate the <a href=#browsing-context>browsing
    context</a>, including canceling any instances of the <a href=#fetch>fetch</a> algorithm started by
-   those attempts. If one of those attempts has already <a href=#create-a-document-object title="create a document
-   object">created a new <code>Document</code> object</a>, <a href=#abort-a-document title="abort a
+   those attempts. If one of those attempts has already created and <a href=#initialize-the-document-object title="initialize the document
+   object">initialized a new <code>Document</code> object</a>, <a href=#abort-a-document title="abort a
    document">abort</a> that <code><a href=#document>Document</a></code> also. (Navigation attempts that have <a href=#concept-navigate-mature title=concept-navigate-mature>matured</a> already have session history entries, and are
    therefore handled during the <a href=#update-the-session-history-with-the-new-page>update the session history with the new page</a> algorithm,
    later.)</li>
@@ -67427,8 +67428,9 @@
     The user agent may indicate to the user that the original page load failed, and that the page
     used was a previously cached resource.</p>
 
+<!--CLEANUP-->
     <p class=note>This does not affect the <i>address of the resource from which Request-URIs are
-    obtained</i>, as used to set <a href="#the-document's-referrer">the document's referrer</a> in the <a href=#create-a-document-object>create a Document
+    obtained</i>, as used to set <a href="#the-document's-referrer">the document's referrer</a> in the <a href=#initialize-the-document-object>initialize the <code>Document</code>
     object</a> steps below; they still use the value as computed by the original
     <a href=#fetch>fetch</a> algorithm.</p>
 
@@ -67461,8 +67463,9 @@
     failed, that the page used was a fallback resource, and what the URL of the fallback resource
     actually is.</p>
 
+<!--CLEANUP-->
     <p class=note>This does not affect the <i>address of the resource from which Request-URIs are
-    obtained</i>, as used to set <a href="#the-document's-referrer">the document's referrer</a> in the <a href=#create-a-document-object>create a Document
+    obtained</i>, as used to set <a href="#the-document's-referrer">the document's referrer</a> in the <a href=#initialize-the-document-object>initialize the <code>Document</code>
     object</a> steps below; they still use the value as computed by the original
     <a href=#fetch>fetch</a> algorithm.</p>
 
@@ -67572,9 +67575,9 @@
     <p class=note>An <a href=#override-url title="override URL">override URL</a> is set when <a href=#javascript-protocol title="javascript protocol">dereferencing a <code>javascript:</code> URL</a> and when
     performing <a href=#an-overridden-reload>an overridden reload</a>.</p>
 
-    <p><dfn id=create-a-document-object title="create a Document object">Creating a new <code>Document</code> object</dfn>: when
-    a <code><a href=#document>Document</a></code> is created as part of the above steps, the user agent must additionally
-    run the following algorithm as part of creating the new object:</p>
+    <p><dfn id=initialize-the-document-object title="initialize the Document object">Initializing a new <code>Document</code>
+    object</dfn>: when a <code><a href=#document>Document</a></code> is created as part of the above steps, the user agent
+    will be required to additionally run the following algorithm after creating the new object:</p>
 
     <ol><li><p>Create a new <code><a href=#window>Window</a></code> object, and associate it with the
      <code><a href=#document>Document</a></code>, with one exception: if the <a href=#browsing-context>browsing context</a>'s only entry in
@@ -67714,10 +67717,12 @@
 
   <h4 id=read-html><span class=secno>6.6.2 </span><dfn title=navigate-html>Page load processing model for HTML files</dfn></h4>
 
+<!--CLEANUP-->
   <p>When an HTML document is to be loaded in a <a href=#browsing-context>browsing context</a>, the user agent must
-  <a href=#queue-a-task>queue a task</a> to <a href=#create-a-document-object>create a <code>Document</code> object</a>, mark it as being
+  <a href=#queue-a-task>queue a task</a> to create a <code><a href=#document>Document</a></code> object, mark it as being
   an <a href=#html-documents title="HTML documents">HTML document</a>, set its <a href=#concept-document-content-type title=concept-document-content-type>content type</a> to "<code title="">text/html</code>",
-  create an <a href=#html-parser>HTML parser</a>, and associate it with the document. Each <a href=#concept-task title=concept-task>task</a> that the <a href=#networking-task-source>networking task source</a> places on the
+  <a href=#initialize-the-document-object>initialize the <code>Document</code> object</a>, and finally
+  create an <a href=#html-parser>HTML parser</a> and associate it with the <code><a href=#document>Document</a></code>. Each <a href=#concept-task title=concept-task>task</a> that the <a href=#networking-task-source>networking task source</a> places on the
   <a href=#task-queue>task queue</a> while the <a href=#fetch title=fetch>fetching algorithm</a> runs must then
   fill the parser's <a href=#the-input-byte-stream>input byte stream</a> with the fetched bytes and cause the <a href=#html-parser>HTML
   parser</a> to perform the appropriate processing of the input stream.</p>
@@ -67745,10 +67750,17 @@
 
   <h4 id=read-xml><span class=secno>6.6.3 </span><dfn title=navigate-xml>Page load processing model for XML files</dfn></h4>
 
-  <p>When faced with displaying an XML file inline, user agents must first <a href=#create-a-document-object>create a
-  <code>Document</code> object</a>, following the requirements of the XML and Namespaces in XML
-  recommendations, RFC 3023, DOM, and other relevant specifications. <a href=#refsXML>[XML]</a> <a href=#refsXMLNS>[XMLNS]</a> <a href=#refsRFC3023>[RFC3023]</a> <a href=#refsDOM>[DOM]</a></p>
+<!--CLEANUP-->
+  <p>When faced with displaying an XML file inline, user agents must follow the requirements defined
+  in the XML and Namespaces in XML recommendations, RFC 3023, DOM, and other relevant specifications
+  to create a <code><a href=#document>Document</a></code> object and a corresponding <a href=#xml-parser>XML parser</a>. <a href=#refsXML>[XML]</a> <a href=#refsXMLNS>[XMLNS]</a> <a href=#refsRFC3023>[RFC3023]</a> <a href=#refsDOM>[DOM]</a></p>
 
+  <p class=note>At the time of writing, the XML specification community had not actually yet
+  specified how XML and the DOM interact.</p> <!--XMLPARSE-->
+
+  <p>After the <code><a href=#document>Document</a></code> is created, the user agent must <a href=#initialize-the-document-object>initialize the
+  <code>Document</code> object</a>.</p>
+
   <p>The actual HTTP headers and other metadata, not the headers as mutated or implied by the
   algorithms given in this specification, are the ones that must be used when determining the
   character encoding according to the rules given in the above specifications. Once the character
@@ -67789,10 +67801,12 @@
 
   <h4 id=read-text><span class=secno>6.6.4 </span><dfn title=navigate-text>Page load processing model for text files</dfn></h4>
 
+<!--CLEANUP-->
   <p>When a plain text document is to be loaded in a <a href=#browsing-context>browsing context</a>, the user agent
-  must <a href=#queue-a-task>queue a task</a> to <a href=#create-a-document-object>create a <code>Document</code> object</a>, mark it as
+  must <a href=#queue-a-task>queue a task</a> to create a <code><a href=#document>Document</a></code> object, mark it as
   being an <a href=#html-documents title="HTML documents">HTML document</a>, set its <a href=#concept-document-content-type title=concept-document-content-type>content type</a> to "<code title="">text/plain</code>",
-  create an <a href=#html-parser>HTML parser</a>, associate it with the document, act as if the tokenizer had
+  <a href=#initialize-the-document-object>initialize the <code>Document</code> object</a>,
+  create an <a href=#html-parser>HTML parser</a>, associate it with the <code><a href=#document>Document</a></code>, act as if the tokenizer had
   emitted a start tag token with the tag name "pre" followed by a single U+000A LINE FEED (LF)
   character<!-- to get eaten, so that a leading LF in the text/plain stream doesn't get eaten
   itself-->, and switch the <a href=#html-parser>HTML parser</a>'s tokenizer to the <a href=#plaintext-state>PLAINTEXT
@@ -67841,10 +67855,11 @@
   <a href=#browsing-context>browsing context</a>, the user agent must parse the resource using the rules for
   multipart types. <a href=#refsRFC2046>[RFC2046]</a></p>
 
+<!--CLEANUP-->
   <p>For each body part obtained from the resource, the user agent must run a new instance of the
   <a href=#navigate>navigate</a> algorithm, starting from the <i>resource handling</i> step, using the new
   body part as the resource being navigated, with <a href=#replacement-enabled>replacement enabled</a> if a previous
-  body part from the same resource resulted in a <code><a href=#document>Document</a></code> object being <a href=#create-a-document-object title="create a document object">created</a>, and otherwise using the same setup as the
+  body part from the same resource resulted in a <code><a href=#document>Document</a></code> object being created and <a href=#initialize-the-document-object title="initialize the document object">initialized</a>, and otherwise using the same setup as the
   <a href=#navigate>navigate</a> attempt that caused this section to be invoked in the first place.</p>
 
   <p>For the purposes of algorithms processing these body parts as if they were complete stand-alone
@@ -67856,9 +67871,11 @@
 
   <h4 id=read-media><span class=secno>6.6.6 </span><dfn title=navigate-media>Page load processing model for media</dfn></h4>
 
+<!--CLEANUP-->
   <p>When an image, video, or audio resource is to be loaded in a <a href=#browsing-context>browsing context</a>, the
-  user agent should <a href=#create-a-document-object>create a <code>Document</code> object</a>, mark it as being an <a href=#html-documents title="HTML documents">HTML document</a>, set its <a href=#concept-document-content-type title=concept-document-content-type>content type</a> to the sniffed MIME type of the resource
-  (<var title="">type</var> in the <a href=#navigate>navigate</a> algorithm), append an <code><a href=#the-html-element>html</a></code>
+  user agent should create a <code><a href=#document>Document</a></code> object, mark it as being an <a href=#html-documents title="HTML documents">HTML document</a>, set its <a href=#concept-document-content-type title=concept-document-content-type>content type</a> to the sniffed MIME type of the resource
+  (<var title="">type</var> in the <a href=#navigate>navigate</a> algorithm), <a href=#initialize-the-document-object>initialize the
+  <code>Document</code> object</a>, append an <code><a href=#the-html-element>html</a></code>
   element to the <code><a href=#document>Document</a></code>, append a <code><a href=#the-head-element>head</a></code> element and a <code><a href=#the-body-element>body</a></code>
   element to the <code><a href=#the-html-element>html</a></code> element, append an element <var title="">host element</var> for
   the media, as described below, to the <code><a href=#the-body-element>body</a></code> element, and set the appropriate attribute
@@ -67898,12 +67915,14 @@
 
   <h4 id=read-plugin><span class=secno>6.6.7 </span><dfn title=navigate-plugin>Page load processing model for content that uses plugins</dfn></h4>
 
+<!--CLEANUP-->
   <p>When a resource that requires an external resource to be rendered is to be loaded in a
-  <a href=#browsing-context>browsing context</a>, the user agent should <a href=#create-a-document-object>create a <code>Document</code>
-  object</a>, mark it as being an <a href=#html-documents title="HTML documents">HTML document</a> and mark it
+  <a href=#browsing-context>browsing context</a>, the user agent should create a <code><a href=#document>Document</a></code>
+  object, mark it as being an <a href=#html-documents title="HTML documents">HTML document</a> and mark it
   as being a <dfn id=plugin-document>plugin document</dfn>, set its <a href=#concept-document-content-type title=concept-document-content-type>content
   type</a> to the sniffed MIME type of the resource (<var title="">type</var> in the
-  <a href=#navigate>navigate</a> algorithm), append an <code><a href=#the-html-element>html</a></code> element to the
+  <a href=#navigate>navigate</a> algorithm),
+  <a href=#initialize-the-document-object>initialize the <code>Document</code> object</a>, append an <code><a href=#the-html-element>html</a></code> element to the
   <code><a href=#document>Document</a></code>, append a <code><a href=#the-head-element>head</a></code> element and a <code><a href=#the-body-element>body</a></code> element to the
   <code><a href=#the-html-element>html</a></code> element, append an <code><a href=#the-embed-element>embed</a></code> to the <code><a href=#the-body-element>body</a></code> element, and set
   the <code title=attr-embed-src><a href=#attr-embed-src>src</a></code> attribute of the <code><a href=#the-embed-element>embed</a></code> element to the
@@ -67937,9 +67956,11 @@
   <h4 id=read-ua-inline><span class=secno>6.6.8 </span><dfn title=navigate-ua-inline>Page load processing model for inline
   content that doesn't have a DOM</dfn></h4>
 
+<!--CLEANUP-->
   <p>When the user agent is to display a user agent page inline in a <a href=#browsing-context>browsing context</a>,
-  the user agent should <a href=#create-a-document-object>create a <code>Document</code> object</a>, mark it as being an
+  the user agent should create a <code><a href=#document>Document</a></code> object, mark it as being an
   <a href=#html-documents title="HTML documents">HTML document</a>, set its <a href=#concept-document-content-type title=concept-document-content-type>content type</a> to "<code title="">text/html</code>",
+  <a href=#initialize-the-document-object>initialize the <code>Document</code> object</a>,
   and then either associate that <code><a href=#document>Document</a></code> with a custom rendering that is not rendered
   using the normal <code><a href=#document>Document</a></code> rendering rules, or mutate that <code><a href=#document>Document</a></code> until
   it represents the content the user agent wants to render.</p>
@@ -93196,7 +93217,7 @@
   the rules given in the XML specification to map a string of bytes or characters into a
   <code><a href=#document>Document</a></code> object.</p>
 
-  <p class=note>At the time of writing, no such rules actually exist.</p>
+  <p class=note>At the time of writing, no such rules actually exist.</p><!--XMLPARSE-->
 
   <p>An <a href=#xml-parser>XML parser</a> is either associated with a <code><a href=#document>Document</a></code> object when it is
   created, or creates one implicitly.</p>

Modified: source
===================================================================
--- source	2014-01-17 08:12:26 UTC (rev 8405)
+++ source	2014-01-17 18:05:45 UTC (rev 8406)
@@ -74860,11 +74860,12 @@
    (even if it is empty), then <span data-x="navigate-fragid">navigate to that fragment
    identifier</span> and abort these steps.</p></li>
 
+<!--CLEANUP-->
    <li><p>If <var data-x="">gone async</var> is false, cancel any preexisting but not yet <span
    data-x="concept-navigate-mature">mature</span> attempt to navigate the <span>browsing
    context</span>, including canceling any instances of the <span>fetch</span> algorithm started by
-   those attempts. If one of those attempts has already <span data-x="create a document
-   object">created a new <code>Document</code> object</span>, <span data-x="abort a
+   those attempts. If one of those attempts has already created and <span data-x="initialize the document
+   object">initialized a new <code>Document</code> object</span>, <span data-x="abort a
    document">abort</span> that <code>Document</code> also. (Navigation attempts that have <span
    data-x="concept-navigate-mature">matured</span> already have session history entries, and are
    therefore handled during the <span>update the session history with the new page</span> algorithm,
@@ -75165,8 +75166,9 @@
     The user agent may indicate to the user that the original page load failed, and that the page
     used was a previously cached resource.</p>
 
+<!--CLEANUP-->
     <p class="note">This does not affect the <i>address of the resource from which Request-URIs are
-    obtained</i>, as used to set <span>the document's referrer</span> in the <span>create a Document
+    obtained</i>, as used to set <span>the document's referrer</span> in the <span>initialize the <code>Document</code>
     object</span> steps below; they still use the value as computed by the original
     <span>fetch</span> algorithm.</p>
 
@@ -75203,8 +75205,9 @@
     failed, that the page used was a fallback resource, and what the URL of the fallback resource
     actually is.</p>
 
+<!--CLEANUP-->
     <p class="note">This does not affect the <i>address of the resource from which Request-URIs are
-    obtained</i>, as used to set <span>the document's referrer</span> in the <span>create a Document
+    obtained</i>, as used to set <span>the document's referrer</span> in the <span>initialize the <code>Document</code>
     object</span> steps below; they still use the value as computed by the original
     <span>fetch</span> algorithm.</p>
 
@@ -75326,9 +75329,9 @@
     data-x="javascript protocol">dereferencing a <code>javascript:</code> URL</span> and when
     performing <span>an overridden reload</span>.</p>
 
-    <p><dfn data-x="create a Document object">Creating a new <code>Document</code> object</dfn>: when
-    a <code>Document</code> is created as part of the above steps, the user agent must additionally
-    run the following algorithm as part of creating the new object:</p>
+    <p><dfn data-x="initialize the Document object">Initializing a new <code>Document</code>
+    object</dfn>: when a <code>Document</code> is created as part of the above steps, the user agent
+    will be required to additionally run the following algorithm after creating the new object:</p>
 
     <ol>
 
@@ -75494,11 +75497,13 @@
 
   <h4 id="read-html"><dfn data-x="navigate-html">Page load processing model for HTML files</dfn></h4>
 
+<!--CLEANUP-->
   <p>When an HTML document is to be loaded in a <span>browsing context</span>, the user agent must
-  <span>queue a task</span> to <span>create a <code>Document</code> object</span>, mark it as being
+  <span>queue a task</span> to create a <code>Document</code> object, mark it as being
   an <span data-x="HTML documents">HTML document</span>, set its <span
   data-x="concept-document-content-type">content type</span> to "<code data-x="">text/html</code>",
-  create an <span>HTML parser</span>, and associate it with the document. Each <span
+  <span>initialize the <code>Document</code> object</span>, and finally
+  create an <span>HTML parser</span> and associate it with the <code>Document</code>. Each <span
   data-x="concept-task">task</span> that the <span>networking task source</span> places on the
   <span>task queue</span> while the <span data-x="fetch">fetching algorithm</span> runs must then
   fill the parser's <span>input byte stream</span> with the fetched bytes and cause the <span>HTML
@@ -75529,12 +75534,19 @@
 
   <h4 id="read-xml"><dfn data-x="navigate-xml">Page load processing model for XML files</dfn></h4>
 
-  <p>When faced with displaying an XML file inline, user agents must first <span>create a
-  <code>Document</code> object</span>, following the requirements of the XML and Namespaces in XML
-  recommendations, RFC 3023, DOM, and other relevant specifications. <a href="#refsXML">[XML]</a> <a
-  href="#refsXMLNS">[XMLNS]</a> <a href="#refsRFC3023">[RFC3023]</a> <a
+<!--CLEANUP-->
+  <p>When faced with displaying an XML file inline, user agents must follow the requirements defined
+  in the XML and Namespaces in XML recommendations, RFC 3023, DOM, and other relevant specifications
+  to create a <code>Document</code> object and a corresponding <span>XML parser</span>. <a
+  href="#refsXML">[XML]</a> <a href="#refsXMLNS">[XMLNS]</a> <a href="#refsRFC3023">[RFC3023]</a> <a
   href="#refsDOM">[DOM]</a></p>
 
+  <p class="note">At the time of writing, the XML specification community had not actually yet
+  specified how XML and the DOM interact.</p> <!--XMLPARSE-->
+
+  <p>After the <code>Document</code> is created, the user agent must <span>initialize the
+  <code>Document</code> object</span>.</p>
+
   <p>The actual HTTP headers and other metadata, not the headers as mutated or implied by the
   algorithms given in this specification, are the ones that must be used when determining the
   character encoding according to the rules given in the above specifications. Once the character
@@ -75580,11 +75592,13 @@
 
   <h4 id="read-text"><dfn data-x="navigate-text">Page load processing model for text files</dfn></h4>
 
+<!--CLEANUP-->
   <p>When a plain text document is to be loaded in a <span>browsing context</span>, the user agent
-  must <span>queue a task</span> to <span>create a <code>Document</code> object</span>, mark it as
+  must <span>queue a task</span> to create a <code>Document</code> object, mark it as
   being an <span data-x="HTML documents">HTML document</span>, set its <span
   data-x="concept-document-content-type">content type</span> to "<code data-x="">text/plain</code>",
-  create an <span>HTML parser</span>, associate it with the document, act as if the tokenizer had
+  <span>initialize the <code>Document</code> object</span>,
+  create an <span>HTML parser</span>, associate it with the <code>Document</code>, act as if the tokenizer had
   emitted a start tag token with the tag name "pre" followed by a single U+000A LINE FEED (LF)
   character<!-- to get eaten, so that a leading LF in the text/plain stream doesn't get eaten
   itself-->, and switch the <span>HTML parser</span>'s tokenizer to the <span>PLAINTEXT
@@ -75636,11 +75650,12 @@
   <span>browsing context</span>, the user agent must parse the resource using the rules for
   multipart types. <a href="#refsRFC2046">[RFC2046]</a></p>
 
+<!--CLEANUP-->
   <p>For each body part obtained from the resource, the user agent must run a new instance of the
   <span>navigate</span> algorithm, starting from the <i>resource handling</i> step, using the new
   body part as the resource being navigated, with <span>replacement enabled</span> if a previous
-  body part from the same resource resulted in a <code>Document</code> object being <span
-  data-x="create a document object">created</span>, and otherwise using the same setup as the
+  body part from the same resource resulted in a <code>Document</code> object being created and <span
+  data-x="initialize the document object">initialized</span>, and otherwise using the same setup as the
   <span>navigate</span> attempt that caused this section to be invoked in the first place.</p>
 
   <p>For the purposes of algorithms processing these body parts as if they were complete stand-alone
@@ -75653,11 +75668,13 @@
 
   <h4 id="read-media"><dfn data-x="navigate-media">Page load processing model for media</dfn></h4>
 
+<!--CLEANUP-->
   <p>When an image, video, or audio resource is to be loaded in a <span>browsing context</span>, the
-  user agent should <span>create a <code>Document</code> object</span>, mark it as being an <span
+  user agent should create a <code>Document</code> object, mark it as being an <span
   data-x="HTML documents">HTML document</span>, set its <span
   data-x="concept-document-content-type">content type</span> to the sniffed MIME type of the resource
-  (<var data-x="">type</var> in the <span>navigate</span> algorithm), append an <code>html</code>
+  (<var data-x="">type</var> in the <span>navigate</span> algorithm), <span>initialize the
+  <code>Document</code> object</span>, append an <code>html</code>
   element to the <code>Document</code>, append a <code>head</code> element and a <code>body</code>
   element to the <code>html</code> element, append an element <var data-x="">host element</var> for
   the media, as described below, to the <code>body</code> element, and set the appropriate attribute
@@ -75704,12 +75721,14 @@
 
   <h4 id="read-plugin"><dfn data-x="navigate-plugin">Page load processing model for content that uses plugins</dfn></h4>
 
+<!--CLEANUP-->
   <p>When a resource that requires an external resource to be rendered is to be loaded in a
-  <span>browsing context</span>, the user agent should <span>create a <code>Document</code>
-  object</span>, mark it as being an <span data-x="HTML documents">HTML document</span> and mark it
+  <span>browsing context</span>, the user agent should create a <code>Document</code>
+  object, mark it as being an <span data-x="HTML documents">HTML document</span> and mark it
   as being a <dfn>plugin document</dfn>, set its <span data-x="concept-document-content-type">content
   type</span> to the sniffed MIME type of the resource (<var data-x="">type</var> in the
-  <span>navigate</span> algorithm), append an <code>html</code> element to the
+  <span>navigate</span> algorithm),
+  <span>initialize the <code>Document</code> object</span>, append an <code>html</code> element to the
   <code>Document</code>, append a <code>head</code> element and a <code>body</code> element to the
   <code>html</code> element, append an <code>embed</code> to the <code>body</code> element, and set
   the <code data-x="attr-embed-src">src</code> attribute of the <code>embed</code> element to the
@@ -75744,10 +75763,12 @@
   <h4 id="read-ua-inline"><dfn data-x="navigate-ua-inline">Page load processing model for inline
   content that doesn't have a DOM</dfn></h4>
 
+<!--CLEANUP-->
   <p>When the user agent is to display a user agent page inline in a <span>browsing context</span>,
-  the user agent should <span>create a <code>Document</code> object</span>, mark it as being an
+  the user agent should create a <code>Document</code> object, mark it as being an
   <span data-x="HTML documents">HTML document</span>, set its <span
   data-x="concept-document-content-type">content type</span> to "<code data-x="">text/html</code>",
+  <span>initialize the <code>Document</code> object</span>,
   and then either associate that <code>Document</code> with a custom rendering that is not rendered
   using the normal <code>Document</code> rendering rules, or mutate that <code>Document</code> until
   it represents the content the user agent wants to render.</p>
@@ -103939,7 +103960,7 @@
   the rules given in the XML specification to map a string of bytes or characters into a
   <code>Document</code> object.</p>
 
-  <p class="note">At the time of writing, no such rules actually exist.</p>
+  <p class="note">At the time of writing, no such rules actually exist.</p><!--XMLPARSE-->
 
   <p>An <span>XML parser</span> is either associated with a <code>Document</code> object when it is
   created, or creates one implicitly.</p>




More information about the Commit-Watchers mailing list