| 1 |
<svg id="svg-root" width="100%" height="100%" viewBox="0 0 480 360" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> |
| 2 |
<!--======================================================================--> |
| 3 |
<!--= Copyright 2008 World Wide Web Consortium, (Massachusetts =--> |
| 4 |
<!--= Institute of Technology, European Research Consortium for =--> |
| 5 |
<!--= Informatics and Mathematics (ERCIM), Keio University). =--> |
| 6 |
<!--= All Rights Reserved. =--> |
| 7 |
<!--= See http://www.w3.org/Consortium/Legal/. =--> |
| 8 |
<!--======================================================================--> |
| 9 |
<d:SVGTestCase xmlns:d="http://www.w3.org/2000/02/svg/testsuite/description/" template-version="1.4" reviewer="ED" author="Microsoft" status="accepted" version="$Revision: 1.3 $" testname="$RCSfile: struct-use-13-f.svg,v $"> |
| 10 |
<d:testDescription xmlns="http://www.w3.org/1999/xhtml" href="http://dev.w3.org/SVG/profiles/1.1F2/publish/struct.html#UseElement"> |
| 11 |
<p> |
| 12 |
Test that 'use' elements are synchronized at run time with the elements they reference. |
| 13 |
</p> |
| 14 |
<p> |
| 15 |
This test verifies visual synchronization during run time between 'use' instances and the elements they reference. A 'g' element containing |
| 16 |
two 'rect' elements is referenced via 'use'. One 'rect' is red and the other has no fill specified. DOM synchronization is verified visually |
| 17 |
by removing the red 'rect'. Presentation attribute synchronization is verified visually by setting the other rect's 'fill' attribute to 'lime'. |
| 18 |
The 'g' that is referenced is inside of a 'defs' tag so only the 'use' instance is visible. |
| 19 |
</p> |
| 20 |
</d:testDescription> |
| 21 |
<d:operatorScript xmlns="http://www.w3.org/1999/xhtml"> |
| 22 |
<p> |
| 23 |
Run the test. No interaction required. |
| 24 |
</p> |
| 25 |
</d:operatorScript> |
| 26 |
<d:passCriteria xmlns="http://www.w3.org/1999/xhtml"> |
| 27 |
<p> |
| 28 |
The test is passed if there is a green square visible on the page, and no red. |
| 29 |
</p> |
| 30 |
</d:passCriteria> |
| 31 |
</d:SVGTestCase> |
| 32 |
<title id="test-title">$RCSfile: struct-use-13-f.svg,v $</title> |
| 33 |
<defs> |
| 34 |
<font-face |
| 35 |
font-family="SVGFreeSansASCII" |
| 36 |
unicode-range="U+0-7F"> |
| 37 |
<font-face-src> |
| 38 |
<font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/> |
| 39 |
</font-face-src> |
| 40 |
</font-face> |
| 41 |
</defs> |
| 42 |
<g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18"> |
| 43 |
<defs> |
| 44 |
<g id="testG"> |
| 45 |
<rect width="96" height="96" id="testRect1"/> |
| 46 |
<rect x="96" width="96" height="96" fill="red" id="testRect2"/> |
| 47 |
</g> |
| 48 |
</defs> |
| 49 |
<use xlink:href="#testG"/> |
| 50 |
<script> |
| 51 |
try |
| 52 |
{ |
| 53 |
var testG = document.getElementById("testG"); |
| 54 |
var testRect1 = document.getElementById("testRect1"); |
| 55 |
var testRect2 = document.getElementById("testRect2"); |
| 56 |
|
| 57 |
testRect1.setAttribute("fill", "lime"); |
| 58 |
testG.removeChild(testRect2); |
| 59 |
} |
| 60 |
catch(ex) |
| 61 |
{ |
| 62 |
//alert('ERROR: ' + ex.message); |
| 63 |
} |
| 64 |
</script> |
| 65 |
</g> |
| 66 |
<g font-family="SVGFreeSansASCII,sans-serif" font-size="32"> |
| 67 |
<text id="revision" x="10" y="340" stroke="none" |
| 68 |
fill="black">$Revision: 1.3 $</text> |
| 69 |
</g> |
| 70 |
<rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000"/> |
| 71 |
<!-- comment out this watermark once the test is approved --> |
| 72 |
<!--<g id="draft-watermark"> |
| 73 |
<rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/> |
| 74 |
<text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240" |
| 75 |
text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text> |
| 76 |
</g>--> |
| 77 |
</svg> |