test_bug391221.html 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <!DOCTYPE HTML>
  2. <html>
  3. <!--
  4. https://bugzilla.mozilla.org/show_bug.cgi?id=391221
  5. -->
  6. <head>
  7. <title>Test for Bug 391221</title>
  8. <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  9. <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
  10. </head>
  11. <body>
  12. <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=391221">Mozilla Bug 391221</a>
  13. <p id="display">
  14. <div id="width-ref" style="width: 2ch"></div>
  15. </p>
  16. <div id="content" style="display: none">
  17. <div id="one" style="width: 1000px; max-width: 2ch"></div>
  18. <div id="two" style="width: 0px; min-width: 2ch"></div>
  19. <div id="three" style="width: 1000ch; max-width: 2px"></div>
  20. </div>
  21. <pre id="test">
  22. <script class="testbody" type="text/javascript">
  23. /** Test for Bug 391221 **/
  24. function getComp(id) {
  25. return document.defaultView.getComputedStyle($(id), "");
  26. }
  27. is(getComp("one").width, getComp("width-ref").width,
  28. "max-width in ch units not working?");
  29. is(getComp("two").width, getComp("width-ref").width,
  30. "min-width in ch units not working?");
  31. is(getComp("three").width, "2px", "max-width not applied to width in chars?");
  32. </script>
  33. </pre>
  34. </body>
  35. </html>