Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Any other end tag" #6788

Closed
stevecheckoway opened this issue Jun 19, 2021 · 2 comments
Closed

"Any other end tag" #6788

stevecheckoway opened this issue Jun 19, 2021 · 2 comments

Comments

@stevecheckoway
Copy link

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?

@bathos
Copy link

bathos commented Jun 19, 2021

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.

@stevecheckoway
Copy link
Author

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

@annevk annevk closed this as completed Jun 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants