Skip to content

Instantly share code, notes, and snippets.

@ccprog
Last active Nov 14, 2017
Embed
What would you like to do?
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Test case: SVG-in-HTML use from external file</title>
<style type="text/css">
svg {
float: left;
margin-right: 15px;
margin-bottom: 15px;
}
div {
clear: left;
}
#black-circle, #red-use {
fill: none;
stroke: red;
}
</style>
</head>
<body>
<div>
<svg id="red-use" width="100px" height="100px" viewBox="0 0 100 100">
<use xlink:href="resource.svg#black-circle"/>
</svg>
<p>1. Not styled in resource.svg, style in text.html targets use element.</p>
<p>Expected: Styling inherited inside shadow tree: red circle</p>
</div>
<div>
<svg width="100px" height="100px" viewBox="0 0 100 100">
<use xlink:href="resource.svg#red-ring"/>
</svg>
<p>2. Styled in resource.svg, not styled in text.html.</p>
<p>Expected: Styling applied and copied to shadow tree: red circle</p>
</div>
<div>
<svg width="100px" height="100px" viewBox="0 0 100 100">
<use xlink:href="resource.svg#black-circle"/>
</svg>
<p>3. Not styled in resource.svg, style in text.html targets element instance in the shatow tree.</p>
<p>Expected: no styling applied inside shadow tree: black disk</p>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment