layout/style/test/test_bug391221.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/style/test/test_bug391221.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,43 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<!--
     1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=391221
     1.8 +-->
     1.9 +<head>
    1.10 +  <title>Test for Bug 391221</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=391221">Mozilla Bug 391221</a>
    1.16 +<p id="display">
    1.17 +  <div id="width-ref" style="width: 2ch"></div>
    1.18 +</p>
    1.19 +<div id="content" style="display: none">
    1.20 +
    1.21 +<div id="one" style="width: 1000px; max-width: 2ch"></div>
    1.22 +<div id="two" style="width: 0px; min-width: 2ch"></div>
    1.23 +<div id="three" style="width: 1000ch; max-width: 2px"></div>
    1.24 +  
    1.25 +</div>
    1.26 +<pre id="test">
    1.27 +<script class="testbody" type="text/javascript">
    1.28 +
    1.29 +/** Test for Bug 391221 **/
    1.30 +function getComp(id) {
    1.31 + return document.defaultView.getComputedStyle($(id), "");
    1.32 +}
    1.33 +
    1.34 +is(getComp("one").width, getComp("width-ref").width,
    1.35 +   "max-width in ch units not working?");
    1.36 +
    1.37 +is(getComp("two").width, getComp("width-ref").width,
    1.38 +   "min-width in ch units not working?");
    1.39 +
    1.40 +is(getComp("three").width, "2px", "max-width not applied to width in chars?");
    1.41 +
    1.42 +</script>
    1.43 +</pre>
    1.44 +</body>
    1.45 +</html>
    1.46 +

mercurial