Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /svg/linking/reftests/svgview-escaped-semicolon.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<title>SVG fragment identifier: a semicolon in svgView() may be percent-encoded</title>
<link rel="help" href="https://w3c.github.io/svgwg/svg2-draft/linking.html#SVGFragmentIdentifiersDefinitions">
<link rel="match" href="svgview-teal-100x50-ref.html">
<meta name="assert" content="Fragment identifiers may be url-escaped, and a semicolon separating svgView() attributes may therefore be written %3B. The escaped form must render identically to the literal semicolon.">
<!--
support/squares.svg is 200x200 with four solid quadrants:
#d46847 terracotta | #2a9d8f teal
#264653 indigo | #e9c46a sand
Same fragment as svgview-preserveaspectratio.html with the separating semicolon
written %3B, and the same reference. The specification calls this form out
explicitly, because an unescaped semicolon would otherwise be read as a list
separator in a context such as an animated list of URLs.
FIXME: this file covers the escaping mechanism, not the situation that motivates
it. In an img src there is no list separator, so an unescaped semicolon works here
too and this test would pass either way. The case the specification describes is a
semicolon-separated list of URLs being animated, where the list is split on the
semicolon before the fragment is ever parsed: only %3B survives that split. No
test anywhere exercises it, and a search of this suite for a values attribute
containing a URL returns nothing.
Writing it needs a deliberate design rather than an extension of this file,
because animation timing makes a reftest unreliable: the animation should be
driven to a fixed point with setCurrentTime from script instead of relying on
wall-clock progress. Sketch: an SVG image element whose href is animated with
values holding one URL that contains an escaped semicolon inside svgView(), the
document time set past the animation's start, and the reference being the view
that URL names. If the semicolon were unescaped the list would split into two
malformed URLs and neither view would be selected.
-->
<style>
body { margin: 0; }
img { display: block; border: none; }
</style>
<img src="support/squares.svg#svgView(viewBox(100,0,100,100)%3BpreserveAspectRatio(none))" width="100" height="50" alt="">