From 5a93e81a6f50db97f103a6fb27ff90f8d3ba24bd Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Thu, 10 Sep 2015 04:58:22 +0200 Subject: [PATCH] Support rb and rtc elements in the parser (ruby) Ruby parsing got forked in two directions. This aligns the parser with the majority of implementations. Remaining implementations have agreed to make these changes as well, hopefully leading us back to fully interoperable HTML parsing. This does not make either rb or rtc elements conforming. It also does not change any rendering rules. That is separately discussed in #121. --- source | 97 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 48 insertions(+), 49 deletions(-) diff --git a/source b/source index 0812bbfdf6d..6b38e3b0242 100644 --- a/source +++ b/source @@ -103826,9 +103826,10 @@ document.body.appendChild(text);

When the steps below require the UA to generate implied end tags, then, while the current node is a dd element, a dt element, an - li element, an option element, an optgroup element, a - p element, an rp element, or an rt element, the UA must pop - the current node off the stack of open elements.

+ li element, an optgroup element, an option element, a + p element, an rb element, an rp element, an rt + element, or an rtc element, the UA must pop the current node off the + stack of open elements.

If a step requires the UA to generate implied end tags but lists an element to exclude from the process, then the UA must perform the above steps as if that element was not in the above @@ -103837,11 +103838,12 @@ document.body.appendChild(text);

When the steps below require the UA to generate all implied end tags thoroughly, then, while the current node is a caption element, a colgroup element, a dd element, a dt element, an - li element, an option element, an optgroup element, a - p element, an rp element, an rt element, a - tbody element, a td element, a tfoot element, a - th element, a thead element, or a tr element, the UA must - pop the current node off the stack of open elements.

+ li element, an optgroup element, an option element, a + p element, an rb element, an rp element, an rt + element, an rtc element, a tbody element, a td element, a + tfoot element, a th element, a thead element, or a + tr element, the UA must pop the current node off the + stack of open elements.

@@ -104749,11 +104751,11 @@ document.body.appendChild(text);
  • If there is a node in the stack of open elements that is not either a dd element, a dt element, an li element, an optgroup element, an option element, a p element, an - rp element, an rt element, a tbody element, a - td element, a tfoot element, a th element, a - thead element, a tr element, the body element, or the - html element, then this is a parse error.

  • + rb element, an rp element, an rt element, an + rtc element, a tbody element, a td element, a + tfoot element, a th element, a thead element, a + tr element, the body element, or the html element, then + this is a parse error.

  • Stop parsing.

  • @@ -104773,12 +104775,13 @@ document.body.appendChild(text);

    Otherwise, if there is a node in the stack of open elements that is not either a dd element, a dt element, an li element, an optgroup element, an option element, a p element, an - rp element, an rt element, a tbody element, a - td element, a tfoot element, a th element, a - thead element, a tr element, the body element, or the - html element, then this is a parse error.

    + rb element, an rp element, an rt element, an + rtc element, a tbody element, a td element, a + tfoot element, a th element, a thead element, a + tr element, the body element, or the html element, then + this is a parse error.

    @@ -104801,12 +104804,13 @@ document.body.appendChild(text);

    Otherwise, if there is a node in the stack of open elements that is not either a dd element, a dt element, an li element, an optgroup element, an option element, a p element, an - rp element, an rt element, a tbody element, a - td element, a tfoot element, a th element, a - thead element, a tr element, the body element, or the - html element, then this is a parse error.

    + rb element, an rp element, an rt element, an + rtc element, a tbody element, a td element, a + tfoot element, a th element, a thead element, a + tr element, the body element, or the html element, then + this is a parse error.

    @@ -105652,32 +105656,25 @@ document.body.appendChild(text); -
    A start tag whose tag name is one of: "rp", "rt"
    +
    A start tag whose tag name is one of: "rb", "rtc"
    - +
    A start tag whose tag name is one of: "rp", "rt"
    +

    If the stack of open elements has a - ruby element in scope, then generate implied end tags. If the - current node is not then a ruby element, this is a parse - error.

    + ruby element in scope, then generate implied end tags, except + for rtc elements. If the current node is not now a rtc + element or a ruby element, this is a parse error.

    Insert an HTML element for the token.

    @@ -111991,7 +111988,9 @@ if (s = prompt('What is your name?')) {

    Use the "text/plain" MIME type instead.

    rb
    -

    Providing the ruby base directly inside the ruby element is sufficient; the rb element is unnecessary. Omit it altogether.

    +
    rtc
    +

    Providing the ruby base directly inside the ruby element or using nested + ruby elements is sufficient.

    strike

    Use del instead if the element is marking an edit, otherwise use s instead.

    @@ -113396,10 +113395,10 @@ if (s = prompt('What is your name?')) {

    The blink, bgsound, isindex, multicol, - nextid, rb, and spacer elements must use the - HTMLUnknownElement interface.

    + nextid, and spacer elements must use the HTMLUnknownElement + interface.