layout/reftests/svg/dynamic-mask-01.svg

Thu, 15 Jan 2015 15:59:08 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:59:08 +0100
branch
TOR_BUG_9701
changeset 10
ac0c01689b40
permissions
-rw-r--r--

Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

michael@0 1 <!--
michael@0 2 Any copyright is dedicated to the Public Domain.
michael@0 3 http://creativecommons.org/publicdomain/zero/1.0/
michael@0 4 -->
michael@0 5 <svg xmlns="http://www.w3.org/2000/svg" version="1.1"
michael@0 6 class="reftest-wait"
michael@0 7 onload="startTest()"
michael@0 8 xmlns:xlink="http://www.w3.org/1999/xlink">
michael@0 9 <title>Testing that dynamic changes to mask attributes are reflected in the mask</title>
michael@0 10
michael@0 11 <defs>
michael@0 12 <mask id="mask1" width="1" height="1">
michael@0 13 <rect width="1" height="1" fill="white"/>
michael@0 14 </mask>
michael@0 15 <mask id="mask2" width="1" height="1">
michael@0 16 <rect width="1" height="1" fill="white"/>
michael@0 17 </mask>
michael@0 18 <mask id="mask3" width="1" height="1">
michael@0 19 <rect width="1" height="1" fill="white"/>
michael@0 20 </mask>
michael@0 21 </defs>
michael@0 22
michael@0 23 <rect width="100%" height="100%" fill="lime"/>
michael@0 24
michael@0 25 <g transform="scale(500)">
michael@0 26 <rect x=".2" y=".2" width=".2" height=".2" fill="red" mask="url(#mask1)"/>
michael@0 27 <rect x=".4" y=".2" width=".2" height=".2" fill="red" mask="url(#mask2)"/>
michael@0 28 <rect x=".2" y=".4" width=".2" height=".2" fill="red" mask="url(#mask3)" />
michael@0 29 </g>
michael@0 30
michael@0 31 <script>
michael@0 32 function startTest() {
michael@0 33 document.addEventListener("MozReftestInvalidate", doTest, false);
michael@0 34 setTimeout(doTest, 4000); // fallback for running outside reftest
michael@0 35 }
michael@0 36
michael@0 37 function doTest() {
michael@0 38 var mask1 = document.getElementById("mask1");
michael@0 39 mask1.width.baseVal.value = 0;
michael@0 40 var mask2 = document.getElementById("mask2");
michael@0 41 mask2.height.baseVal.value = 0;
michael@0 42 var mask3 = document.getElementById("mask3");
michael@0 43 mask3.maskUnits.baseVal = SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE;
michael@0 44
michael@0 45 document.documentElement.removeAttribute("class");
michael@0 46 }
michael@0 47 </script>
michael@0 48 </svg>

mercurial