dom/smil/test/test_smilSyncTransform.xhtml

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

michael@0 1 <html xmlns="http://www.w3.org/1999/xhtml">
michael@0 2 <head>
michael@0 3 <title>Test for SMIL sync behaviour for transform types</title>
michael@0 4 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
michael@0 5 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
michael@0 6 </head>
michael@0 7 <body>
michael@0 8 <p id="display"></p>
michael@0 9 <div id="content" style="display: none">
michael@0 10 <svg id="svg" xmlns="http://www.w3.org/2000/svg" width="120px" height="120px">
michael@0 11 <circle cx="20" cy="20" r="15" fill="blue">
michael@0 12 <animateTransform attributeName="transform" type="rotate"
michael@0 13 from="90" to="180" begin="0s" dur="2s" fill="freeze"
michael@0 14 additive="sum" id="anim1"/>
michael@0 15 </circle>
michael@0 16 <circle cx="20" cy="20" r="15" fill="blue">
michael@0 17 <animateTransform attributeName="transform" type="scale"
michael@0 18 from="1" to="2" begin="2s" dur="2s" id="anim2"/>
michael@0 19 </circle>
michael@0 20 </svg>
michael@0 21 </div>
michael@0 22 <pre id="test">
michael@0 23 <script class="testbody" type="text/javascript">
michael@0 24 <![CDATA[
michael@0 25 /** Test for SMIL sync behavior for transform types **/
michael@0 26
michael@0 27 /* Global Variables */
michael@0 28 var svg = document.getElementById("svg");
michael@0 29
michael@0 30 SimpleTest.waitForExplicitFinish();
michael@0 31
michael@0 32 function main() {
michael@0 33 testChangeBaseVal(document.getElementById("anim1"));
michael@0 34 SimpleTest.finish();
michael@0 35 }
michael@0 36
michael@0 37 function testChangeBaseVal(anim) {
michael@0 38 // Check that a change to the base value is updated even after animation is
michael@0 39 // frozen
michael@0 40
michael@0 41 var target = anim.targetElement;
michael@0 42
michael@0 43 var baseList = target.transform.baseVal;
michael@0 44 var animList = target.transform.animVal;
michael@0 45
michael@0 46 // make sure element has ended
michael@0 47 svg.setCurrentTime(anim.getSimpleDuration());
michael@0 48
michael@0 49 // check frozen value is applied
michael@0 50 is(baseList.numberOfItems, 0);
michael@0 51 is(animList.numberOfItems, 1);
michael@0 52
michael@0 53 // change base val and re-check
michael@0 54 var newTransform = svg.createSVGTransform();
michael@0 55 newTransform.setScale(1,2);
michael@0 56 baseList.appendItem(newTransform);
michael@0 57 is(baseList.numberOfItems, 1);
michael@0 58 is(animList.numberOfItems, 2);
michael@0 59 }
michael@0 60
michael@0 61 window.addEventListener("load", main, false);
michael@0 62 ]]>
michael@0 63 </script>
michael@0 64 </pre>
michael@0 65 </body>
michael@0 66 </html>

mercurial