layout/reftests/svg/stroke-width-percentage-03.xhtml

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

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

mercurial