Discussion:
Issue 204 in html5lib: Premature closure of <svg> tag
h***@public.gmane.org
2012-05-12 15:48:41 UTC
Permalink
Status: New
Owner: ----

New issue 204 by infe...-F7+***@public.gmane.org: Premature closure of <svg> tag
http://code.google.com/p/html5lib/issues/detail?id=204

Testcase.svg

<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<d:SVGTestCase
xmlns:d="http://www.w3.org/2000/02/svg/testsuite/description/">
<d:testDescription xmlns="http://www.w3.org/1999/xhtml"
href="http://www.w3.org/TR/SVG11/text.html#Introduction">
<p>
Run the test. No interaction required.
</p>
</d:testDescription>
</d:SVGTestCase>
<defs>
<font-face font-family="SVGFreeSansASCII" unicode-range="U+0-7F">
<font-face-src>
<font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/>
</font-face-src>
</font-face>
</defs>
</svg>

When i use html5lib to parse this, and later serialize it, i get

<html><head></head><body><svg xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg">
<d:svgtestcase
xmlnsU0003Ad="http://www.w3.org/2000/02/svg/testsuite/description/">
<d:testdescription
href="http://www.w3.org/TR/SVG11/text.html#Introduction"
xmlns="http://www.w3.org/1999/xhtml">
</d:testdescription></d:svgtestcase></svg><p>
Run the test. No interaction required.
</p>


<defs>
<font-face font-family="SVGFreeSansASCII" unicode-range="U+0-7F">
<font-face-src>
<font-face-uri xlinkU0003Ahref="../resources/SVGFreeSans.svg#ascii">
</font-face-uri></font-face-src>
</font-face>
</defs>

</body></html>

The svg tag is prematurely closed. This causes some issues when i am
writing my security fuzzer that needs to understand tag context and
namespace. e.g. font-face tag is incorrectly judged as
http://www.w3.org/1999/xhtml namespace.
--
You received this message because you are subscribed to the Google Groups "html5lib-discuss" group.
To post to this group, send an email to html5lib-discuss-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to html5lib-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit this group at http://groups.google.com/group/html5lib-discuss?hl=en-GB.
h***@public.gmane.org
2012-05-13 08:53:15 UTC
Permalink
Updates:
Status: Invalid

Comment #1 on issue 204 by ja...-***@public.gmane.org: Premature closure of
<svg> tag
http://code.google.com/p/html5lib/issues/detail?id=204

This behaviour is per-spec (compare to browsers:
http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1526 ) The <p>
element not in <foreignObject> breaks out of the SVG mode, because the HTML
parser intentionally doesn't do full namespace-aware processing.
--
You received this message because you are subscribed to the Google Groups "html5lib-discuss" group.
To post to this group, send an email to html5lib-discuss-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to html5lib-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit this group at http://groups.google.com/group/html5lib-discuss?hl=en-GB.
Loading...