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

CDATA section in SVG title is handled differently in browsers #4016

Open
zcorpan opened this issue Sep 7, 2018 · 5 comments

Comments

3 participants
@zcorpan
Copy link
Member

commented Sep 7, 2018

Test case http://software.hixie.ch/utilities/js/live-dom-viewer/saved/6207

Edge and Firefox support the CDATA section. Safari and Chrome insert a comment.

I think Edge and Firefox match the spec,

https://html.spec.whatwg.org/multipage/parsing.html#markup-declaration-open-state

"If there is an adjusted current node and it is not an element in the HTML namespace, then switch to the CDATA section state."

FYI @whatwg/html-parser

I think the spec can probably stay as-is, but we should make sure there is a test and file bugs.

@gsnedders

This comment has been minimized.

Copy link

commented Sep 7, 2018

I'd agree the spec is right here.

@zcorpan

This comment has been minimized.

Copy link
Member Author

commented Sep 7, 2018

Hmm it seems like CDATA sections are just not at all supported in Safari and Chrome.

data:text/html,<svg><!|CDATA[ ><p>FAIL

Edit: made a typo.

@zcorpan

This comment has been minimized.

Copy link
Member Author

commented Sep 7, 2018

https://github.com/html5lib/html5lib-tests/blob/515dc09aaa25d48a72f0d4c1a890507022b36e09/tree-construction/tests21.dat has tests for CDATA in svg/math, could add more tests to make sure it's supported in SVG title, but not in HTML span in SVG title.

@scshepard

This comment has been minimized.

Copy link

commented Sep 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.