tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

stroke-width-percentage-03.xhtml (1401B)


      1 <?xml version="1.0" encoding="UTF-8"?>
      2 <!--
      3     Any copyright is dedicated to the Public Domain.
      4     http://creativecommons.org/publicdomain/zero/1.0/
      5 -->
      6 <!-- From https://bugzilla.mozilla.org/show_bug.cgi?id=875069 -->
      7 <!--
      8    This test checks that when the content area of the window resizes without
      9    any style change that we reflow stroked SVG elements that have
     10    'vector-effect' set to 'non-scaling-stroke' and that are under a
     11    transformed ancestor. We use an iframe to allow us to resize the content
     12    area of the embedded document without changing its style.
     13 
     14    This test should end up rendering a blue square, 100px by 50px.
     15 -->
     16 <html xmlns="http://www.w3.org/1999/xhtml"
     17      class="reftest-wait">
     18  <head>
     19    <style>
     20 
     21 #frame {
     22  /* width and height are given the same value since percentage stroke resolves
     23     as sqrt(width^2 + height^2).
     24  */
     25  width: 50px;
     26  height: 50px;
     27  border: 0;
     28 }
     29 
     30    </style>
     31    <script>
     32 
     33 function doTest() {
     34  document.getElementById("frame").style.width = "100px";
     35  document.getElementById("frame").style.height = "100px";
     36  document.documentElement.removeAttribute("class");
     37 }
     38 
     39 window.addEventListener("MozReftestInvalidate", doTest, false);
     40 setTimeout(doTest, 4000); // fallback for running outside reftest
     41 
     42    </script>
     43  </head>
     44  <body>
     45    <iframe id="frame" src="stroke-width-percentage-03-iframe.svg"></iframe>
     46  </body>
     47 </html>