From 9fa51570245af8fd0619fc0af39169ab6d8fcdb1 Mon Sep 17 00:00:00 2001 From: Zirro Date: Thu, 13 Dec 2018 09:57:44 +0100 Subject: [PATCH 1/4] Serialize the children of void elements as the empty string This is consistent with the current implementations in Chrome and Safari. --- source | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/source b/source index 4f422ad497a..e9f3ecd53a5 100644 --- a/source +++ b/source @@ -110561,6 +110561,13 @@ document.body.appendChild(text);
  • Let s be a string, and initialize it to the empty string.

  • +
  • If the node is an area, base, + basefont, bgsound, br, col, + embed, frame, hr, img, + input, keygen, link, meta, + param, source, track or wbr element, then return s.

  • + +
  • If the node is a template element, then let the node instead be the template element's template contents (a DocumentFragment node).

  • @@ -110746,7 +110753,7 @@ document.body.appendChild(text); -
  • The result of the algorithm is the string s.

  • +
  • Return s.

  • From f12c4e325814b03ff09b5c7ef4951b4a196a3623 Mon Sep 17 00:00:00 2001 From: Zirro Date: Sat, 15 Dec 2018 17:15:10 +0100 Subject: [PATCH 2/4] Move the void elements superset to a variable --- source | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/source b/source index e9f3ecd53a5..a5345c14e16 100644 --- a/source +++ b/source @@ -110561,13 +110561,17 @@ document.body.appendChild(text);
  • Let s be a string, and initialize it to the empty string.

  • -
  • If the node is an area, base, - basefont, bgsound, br, col, - embed, frame, hr, img, - input, keygen, link, meta, - param, source, track or wbr element, then return s.

  • +
  • Let void elements superset be a list of element types containing + area, base, basefont, bgsound, + br, col, embed, frame, + hr, img, input, keygen, + link, meta, param, source, + track and wbr.

  • +
  • If the node is one of the element types in + void elements superset, then return s.

  • +
  • If the node is a template element, then let the node instead be the template element's template contents (a DocumentFragment node).

  • @@ -110670,13 +110674,8 @@ document.body.appendChild(text);

    Append a U+003E GREATER-THAN SIGN character (>).

    -

    If current node is an area, base, - basefont, bgsound, br, col, - embed, frame, hr, img, - input, keygen, link, meta, - param, source, track or wbr element, +

    If current node is one of the element types in void elements superset, then continue on to the next child node at this point.

    - From a16c191d2a918474387f779b94fd21308ba0c78e Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Tue, 18 Dec 2018 17:30:39 -0500 Subject: [PATCH 3/4] Editorial tweaks --- source | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/source b/source index a5345c14e16..8bd8a72d1ac 100644 --- a/source +++ b/source @@ -110549,6 +110549,10 @@ document.body.appendChild(text);

    Serializing HTML fragments

    +

    For the purposes of the following algorithm, an element serializes as void if its + element type is one of the void elements, or is basefont, + bgsound, frame, or keygen.

    +

    The following steps form the HTML fragment serialization algorithm. The algorithm takes as input a DOM Element, Document, or DocumentFragment referred to as @@ -110559,18 +110563,10 @@ document.body.appendChild(text);

      -
    1. Let s be a string, and initialize it to the empty string.

    2. - -
    3. Let void elements superset be a list of element types containing - area, base, basefont, bgsound, - br, col, embed, frame, - hr, img, input, keygen, - link, meta, param, source, - track and wbr.

    4. - +
    5. If the node serializes as void, then return the empty + string.

    6. -
    7. If the node is one of the element types in - void elements superset, then return s.

    8. +
    9. Let s be a string, and initialize it to the empty string.

    10. If the node is a template element, then let the node instead be the template element's template contents (a DocumentFragment node).

    11. @@ -110674,10 +110670,8 @@ document.body.appendChild(text);

      Append a U+003E GREATER-THAN SIGN character (>).

      -

      If current node is one of the element types in void elements superset, - then continue on to the next child node at this point.

      - +

      If current node serializes as void, then continue on to the next + child node at this point.

      Append the value of running the HTML fragment serialization algorithm on the current node element (thus recursing into this algorithm for that From b064dbe84cd277c8973e14a0c91e47cf0bb4af1c Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Tue, 18 Dec 2018 21:14:49 -0500 Subject: [PATCH 4/4] No need for that comment indeed --- source | 1 - 1 file changed, 1 deletion(-) diff --git a/source b/source index 8bd8a72d1ac..a0863de3f25 100644 --- a/source +++ b/source @@ -99935,7 +99935,6 @@ dictionary StorageEventInit : EventInit {

      area, base, br, col, embed, hr, img, input, link, meta, param, source, track, wbr
      -