layout/reftests/svg/smil/container/promoted-tree-1.xhtml

Wed, 31 Dec 2014 13:27:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 13:27:57 +0100
branch
TOR_BUG_3246
changeset 6
8bccb770b82d
permissions
-rw-r--r--

Ignore runtime configuration files generated during quality assurance.

michael@0 1 <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
michael@0 2 <html xmlns="http://www.w3.org/1999/xhtml" class="reftest-wait">
michael@0 3 <head>
michael@0 4 <title>Promoted subtree</title>
michael@0 5 <!--
michael@0 6 PURPOSE: As timing containers are defined according to the outermost SVG
michael@0 7 document fragment, this case tests when a nested <svg> element is removed
michael@0 8 and added as the outermost svg fragment, that is, promoted.
michael@0 9
michael@0 10 OPERATION: There is one animation containing two circles that move to the
michael@0 11 right. The second circle is contained in a nested <svg> element. This nested
michael@0 12 <svg> is removed from the outer <svg> element and then appended to
michael@0 13 the parent <p> element.
michael@0 14
michael@0 15 EXPECTED RESULTS: After removing the inner <svg> and making it a child of
michael@0 16 the <p> it becomes an outermost <svg> and therefore a new time container and
michael@0 17 so the animation resets. This behaviour is the same in Opera and we believe
michael@0 18 it to be correct.
michael@0 19 -->
michael@0 20 <script>
michael@0 21 function moveAndSplit()
michael@0 22 {
michael@0 23 var svg = document.getElementById('outer');
michael@0 24 svg.pauseAnimations();
michael@0 25 svg.setCurrentTime(0.5);
michael@0 26 split();
michael@0 27 svg = document.getElementById('nested');
michael@0 28 svg.pauseAnimations();
michael@0 29 var svgs = document.getElementsByTagName('svg');
michael@0 30 for (var i = 0; i &lt; svgs.length; i++) {
michael@0 31 var svg = svgs[i];
michael@0 32 svg.setCurrentTime(svg.getCurrentTime() + 0.5);
michael@0 33 }
michael@0 34 setTimeout('document.documentElement.removeAttribute("class")', 0);
michael@0 35 }
michael@0 36
michael@0 37 function split()
michael@0 38 {
michael@0 39 var nested = document.getElementById('nested');
michael@0 40 nested.parentNode.removeChild(nested);
michael@0 41 var container = document.getElementById('container');
michael@0 42 container.appendChild(nested);
michael@0 43 }
michael@0 44 </script>
michael@0 45 </head>
michael@0 46
michael@0 47 <body onload="moveAndSplit()">
michael@0 48 <p id="container">
michael@0 49 <svg xmlns="http://www.w3.org/2000/svg" width="200px" height="200px"
michael@0 50 id="outer">
michael@0 51 <rect x="0" y="0" width="199" height="199"
michael@0 52 style="fill: none; stroke: black"/>
michael@0 53 <circle cx="0" cy="50" r="15" fill="skyblue" stroke="black"
michael@0 54 stroke-width="1">
michael@0 55 <animate attributeName="cx" from="0" to="200" begin="0s" dur="2s"
michael@0 56 fill="freeze"/>
michael@0 57 </circle>
michael@0 58 <!-- nested svg fragment -->
michael@0 59 <svg width="200px" height="200px" id="nested">
michael@0 60 <rect x="0" y="0" width="199" height="199"
michael@0 61 style="fill: none; stroke: black"/>
michael@0 62 <circle cx="0" cy="110" r="15" fill="greenyellow" stroke="black"
michael@0 63 stroke-width="1">
michael@0 64 <animate attributeName="cx" from="0" to="200" begin="0s" dur="2s"
michael@0 65 fill="freeze"/>
michael@0 66 </circle>
michael@0 67 </svg>
michael@0 68 </svg>
michael@0 69 </p>
michael@0 70 </body>
michael@0 71 </html>

mercurial