layout/style/test/test_bug412901.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/style/test/test_bug412901.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,42 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<!--
     1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=412901
     1.8 +-->
     1.9 +<head>
    1.10 +  <title>Test for Bug 412901</title>
    1.11 +  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>        
    1.12 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
    1.13 +</head>
    1.14 +<body>
    1.15 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=412901">Mozilla Bug 412901</a>
    1.16 +<div id="testDiv" style="width:20px; height:20px; border:solid silver; border-left-width:0.2px; border-right-width:0px; border-top-width:2.3px; border-bottom-width:5.5px;">
    1.17 +<div id="testDiv2" style="width:20px; height:20px; border:hidden solid silver; border-left-width:0.2px; border-right-width:0px; border-top-width:2.3px; border-bottom-width:5.5px;">
    1.18 +<p id="display"></p>
    1.19 +</div>
    1.20 +<div id="content" style="display: none">
    1.21 +  
    1.22 +</div>
    1.23 +<pre id="test">
    1.24 +<script class="testbody" type="text/javascript">
    1.25 +
    1.26 +/** Test for Bug 412901 **/
    1.27 +
    1.28 +var div = document.getElementById("testDiv");
    1.29 +var computedStyle = document.defaultView.getComputedStyle(div, "");
    1.30 +// we never round down to 0px, very small widths are rounded up to 1px
    1.31 +is(computedStyle.borderLeftWidth, "1px");
    1.32 +is(computedStyle.borderRightWidth, "0px");
    1.33 +is(computedStyle.borderTopWidth, "2px");
    1.34 +is(computedStyle.borderBottomWidth, "5px");
    1.35 +
    1.36 +var div2 = document.getElementById("testDiv2");
    1.37 +var computedStyle2 = document.defaultView.getComputedStyle(div2, "");
    1.38 +is(computedStyle2.borderLeftWidth, "0px");
    1.39 +is(computedStyle2.borderRightWidth, "0px");
    1.40 +is(computedStyle2.borderTopWidth, "0px");
    1.41 +is(computedStyle2.borderBottomWidth, "0px");
    1.42 +</script>
    1.43 +</pre>
    1.44 +</body>
    1.45 +</html>

mercurial