layout/style/test/test_bug874919.html

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     1 <!DOCTYPE HTML>
     2 <html>
     3 <!--
     4 https://bugzilla.mozilla.org/show_bug.cgi?id=874919
     5 -->
     6 <head>
     7   <title>Test for Bug 874919</title>
     8   <script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
     9   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    10   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
    11 </head>
    12 <body>
    13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=874919">Mozilla Bug 874919</a>
    14 <p id="display"></p>
    15 <div id="content" style="width: 150px">
    16     <svg id="outer_SVG" style="display: inline; width: 100%">
    17         <circle cx="120" cy="120" r="120" fill="blue"></circle>
    18         <svg id="inner_SVG">
    19             <circle id="circle" cx="120" cy="120" r="120" fill="red"></circle>
    20         </svg>
    21     </svg>
    22 </div>
    23 <pre id="test">
    25 <script type="text/javascript">
    27     var shouldUseComputed = ["inner_SVG"]
    28     var shouldUseUsed = ["outer_SVG"]
    30     shouldUseUsed.forEach(function(elemId) {
    32         var style = window.getComputedStyle(document.getElementById(elemId));
    34         ok(style.width.match(/^\d+px$/), 
    35             "Inline Outer SVG element's getComputedStyle.width should be used value. ");
    37         ok(style.height.match(/^\d+px$/), 
    38             "Inline Outer SVG element's getComputedStyle.height should be used value.");
    39     });
    41     shouldUseComputed.forEach(function(elemId) {
    42         var style = window.getComputedStyle(document.getElementById(elemId));
    44         // Computed value should match either the percentage used, or "auto" in the case of the inner SVG element.
    45         ok(style.width.match(/^\d+%$|^auto$/), 
    46             "Inline inner SVG element's getComputedStyle.width should be computed value. " + style.width);
    48         ok(style.height.match(/^\d+%$|^auto$/), 
    49             "Inline inner SVG element's getComputedStyle.height should be computed value. " + style.height);
    50     });
    52 </script>
    53 </pre>
    54 </body>
    55 </html>

mercurial