Skip to content

"Any other end tag" #6788

Description

@stevecheckoway

https://html.spec.whatwg.org/multipage/parsing.html#scriptForeignEndTag

Any other end tag

I think there might be a spec bug here. html5lib-tests added tree-building tests of the form <math></p><foo>. That test in particular agrees with how Safari, Firefox, and Chrome parse that bit of HTML. The Gumbo and html5ever parsers disagree. My reading of the spec agrees with Gumbo and html5ever.

Essentially, should the </p><foo>

  1. cause the math element to be closed and HTML p and foo elements to be inserted as children of the body element; or
  2. insert an HTML p element and a MathML foo element as children of the math element?

If 1 (what the browsers do), where does (or should) the specification specify that?

Activity

  1. bathos commented on Jun 19, 2021

    @bathos

    I posted this response to your comments in the html5lib repo, but I'd meant to do it here:

    See also #5113 and #6736

    I believe your reading is correct - and that it was pointed out that this created a dangerous loophole for exploiting sanitizer round tripping. I'm not certain but I think maybe due to the nature of the problem vendors and some libraries may have addressed it before the spec was actually updated to reflect the necessary change.

    The open PR addresses it by making </p> pop open elements until an HTML element / HTML integration point element is the current node.

  2. stevecheckoway commented on Jun 20, 2021

    @stevecheckoway
    Author

    Thanks @bathos! That makes a lot of sense. I'm closing this as its a duplicate of #5113.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions