I have an HTML page with a <base>
tag, also containing SVG. Same-document references such as the below within the SVG then fail:
<html>
<head>
<base href="http://my/server/basedir">
</head>
<body>
<svg>
<g>
<path d="M100,100 L150,150" id="path"/>
<text>
<textpath xlink:href="#path"/>
</text>
</g>
</svg>
</body>
</html>
The xlink:href="#path"
reference fails to resolve. This works fine without the HTML base
element. It also works if I replace the href
attribute on the textpath
element with an absolute IRI followed by the fragment identifier.
It seems to me that SVG should treat same-document IRI's differently and independent of the HTML base
. In http://www.w3.org/TR/xmlbase/#same-document it says "Dereferencing of same-document references is handled specially.", although granted that's in the context of xml:base
. By the way, I played with putting an xml:base
on the svg
element in hopes of overriding the HTML base
setting for couldn't figure out how to make that work.
xml:base
is deprecated bugs.chromium.org/p/chromium/issues/detail?id=341854 – Cheryl