From aaed93a6fd5588fbf13f73677b0ca2daa280390c Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Mon, 18 Apr 2016 14:02:46 -0400 Subject: [PATCH] Use "create an element" in createHTMLDocument Takes care of part of #212. (cherry picked from commit 7b42a54ee5876a1767d0a6007f2b9dc32b0034e3) # Conflicts: # dom.bs # dom.html --- dom.bs | 36 ++++++++++++++++++------------------ dom.html | 38 ++++++++++++++++++++++++++------------ 2 files changed, 44 insertions(+), 30 deletions(-) diff --git a/dom.bs b/dom.bs index 45e8694c6..ad01938e3 100644 --- a/dom.bs +++ b/dom.bs @@ -5081,39 +5081,39 @@ The method, when invoked, must run these steps:
    -
  1. Let doc be a new document that is an HTML document. +
  2. Let doc be a new document that is an HTML document. -

  3. Set doc's content type to "text/html". +
  4. Set doc's content type to "text/html". -

  5. Append a new doctype, with "html" as its +
  6. Append a new doctype, with "html" as its name and with its node document set to doc, to doc. -

  7. Append a new <{html}> element in the HTML namespace, to - doc. +
  8. Append the result of creating an element given doc, <{html}>, and + the HTML namespace, to doc. -

  9. Append a new <{head}> element in the HTML namespace, to the - <{html}> element created earlier. +
  10. Append the result of creating an element given doc, <{head}>, and + the HTML namespace, to the <{html}> element created earlier.

  11. - If the title argument is not omitted: +

    If title is given:

      -
    1. Append a new <{title}> element in the HTML namespace, to the <{head}> - element created earlier. +
    2. Append the result of creating an element given doc, <{title}>, + and the HTML namespace, to the <{head}> element created earlier. -

    3. Append a new {{Text}} node, with its data set to - title (which could be the empty string), to the <{title}> element created - earlier. +
    4. Append a new {{Text}} node, with its data set to + title (which could be the empty string) and its node document set to + doc, to the <{title}> element created earlier.

    -
  12. Append a new <{body}> element in the HTML namespace, to the <{html}> - element created earlier. +
  13. Append the result of creating an element given doc, <{body}>, and + the HTML namespace, to the <{html}> element created earlier.

  14. -
  15. doc's origin is the origin of the context object's associated - document. [[!HTML]] +
  16. doc's origin is the origin of the context object's + associated document. [[!HTML]] -

  17. Return doc. +
  18. Return doc.

The hasFeature() method, when diff --git a/dom.html b/dom.html index 9c4595937..1cb180aed 100644 --- a/dom.html +++ b/dom.html @@ -2838,21 +2838,35 @@

The createHTMLDocument(title) method, when invoked, must run these steps:

    -
  1. Let doc be a new document that is an HTML document. -
  2. Set doc’s content type to "text/html". -
  3. Append a new doctype, with "html" as its name and with its node document set to doc, to doc. -
  4. Append a new html element in the HTML namespace, to doc. -
  5. Append a new head element in the HTML namespace, to the html element created earlier.
  6. - If the title argument is not omitted: +

    Let doc be a new document that is an HTML document.

    +
  7. +

    Set doc’s content type to "text/html".

    +
  8. +

    Append a new doctype, with "html" as its name and with its node document set to doc, to doc.

    +
  9. +

    Append the result of creating an element given doc, html, and + the HTML namespace, to doc.

    +
  10. +

    Append the result of creating an element given doc, head, and + the HTML namespace, to the html element created earlier.

    +
  11. +

    If title is given:

      -
    1. Append a new title element in the HTML namespace, to the head element created earlier. -
    2. Append a new Text node, with its data set to title (which could be the empty string), to the title element created - earlier. +
    3. +

      Append the result of creating an element given doc, title, + and the HTML namespace, to the head element created earlier.

      +
    4. +

      Append a new Text node, with its data set to title (which could be the empty string) and its node document set to doc, to the title element created earlier.

    -
  12. Append a new body element in the HTML namespace, to the html element created earlier. -
  13. doc’s origin is the origin of the context object’s associated document. [HTML] -
  14. Return doc. +
  15. +

    Append the result of creating an element given doc, body, and + the HTML namespace, to the html element created earlier.

    +
  16. +

    doc’s origin is the origin of the context object’s + associated document. [HTML]

    +
  17. +

    Return doc.

The hasFeature() method, when invoked, must return true.