HTML elements within SVG <title>/<desc> cause the HTML parser to stop handling CDATA sections correctly
Reported by
amelia.b...@gmail.com,
Jul 1 2017
|
|||||||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36 Example URL: https://codepen.io/AmeliaBR/pen/RgMZJN/ Steps to reproduce the problem: 1. Create an inline SVG within a non-XML HTML file. 2. Use HTML markup inside a <title> or <desc> in that SVG (this is valid, and is still parsed fine). 3. Add a <script> or <style> section later in the SVG, using <![CDATA[...]]> around the content (which is valid within SVG in HTML, and is parsed fine in other cases). What is the expected behavior? The HTML parser should accept the CDATA notation within inline SVG, dropping it from the text passed to the CSS parser / JS interpreter. See https://html.spec.whatwg.org/multipage/syntax.html#cdata-sections What went wrong? The CDATA bits are treated as plain text, and cause the CSS/JS to break. But only if there had been previous HTML-in-SVG-metadata in the document. Does it occur on multiple sites: Yes Is it a problem with a plugin? N/A Did this work before? N/A Does this work in other browsers? Yes Chrome version: 59.0.3071.115 Channel: stable OS Version: 10.0 Flash Version: PS. HTML elements in an SVG <foreignObject> don't seem to cause the same problem.
,
Jul 3 2017
This is suspiciously similar to issue 722376 , so not unlikely to be a dupe.
,
Jul 3 2017
That definitely looks like a different symptom of the same parser problem. I was searching specifically for CDATA, so didn't see that.
,
Jul 6 2017
Tested the issue on windows 10 & 7 , amc os 10.12.5 using chrome m59 #59.0.3071.115 and M61 #61.0.3150 and issue is seen . Attached screencast for reference. @amelia.bellamy.royds-- Could you please check attached screencast and confirm us if this is the issue and also confirm us the expected result , as the video consists of fireofx behavior too. Thanks!
,
Jul 6 2017
Meh, I forgot to confirm this before...
,
Jul 6 2017
,
Jul 6 2017
,
Jul 6 2017
Yes, thank you. That (#4) matches what I'm getting.
,
Jul 7 2017
,
Jul 15 2017
,
Jul 16
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Jul 17
Looks https://codepen.io/AmeliaBR/pen/RgMZJN/ works well with Chrome 67. |
|||||||||
►
Sign in to add a comment |
|||||||||
Comment 1 by kochi@chromium.org
, Jul 3 2017