dom/tests/mochitest/general/test_offsets.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/tests/mochitest/general/test_offsets.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,96 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html style="margin: 5px; border: 0; padding: 1px;">
     1.6 +<head>
     1.7 +  <title>HTML Tests for offset/client/scroll properties</title>
     1.8 +  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     1.9 +  <script type="text/javascript" src="test_offsets.js"></script>
    1.10 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css">
    1.11 +
    1.12 +<style>
    1.13 +  input {
    1.14 +    box-sizing: content-box;
    1.15 +  }
    1.16 +</style>
    1.17 +</head>
    1.18 +<body id="body" onload="setTimeout(testElements, 0, 'testelements', SimpleTest.finish);"
    1.19 +      style="margin: 1px; border: 2px solid black; padding: 4px;">
    1.20 +
    1.21 +<div id="testelements" style="margin: 0; border: 0; padding: 0;">
    1.22 +  <div id="div1" style="margin: 0; margin-left: 6px; margin-top: 2px; border: 1px solid green; padding: 6px; width: 50px; height: 20px"
    1.23 +         _offsetLeft="13" _offsetTop="9" _offsetWidth="64" _offsetHeight="34"
    1.24 +         _scrollWidth="62" _scrollHeight="32"
    1.25 +         _clientLeft="1" _clientTop="1" _clientWidth="62" _clientHeight="32"></div>
    1.26 +  <div id="noscroll" style="margin: 2px; border: 1px solid blue; padding: 3px;"
    1.27 +       _offsetLeft="10" _offsetTop="12" _offsetWidth="64" _offsetHeight="34"
    1.28 +       _scrollWidth="62" _scrollHeight="32"
    1.29 +       _clientLeft="1" _clientTop="1" _clientWidth="62" _clientHeight="32">
    1.30 +    <div id="inner">Inner Text</div>
    1.31 +  </div>
    1.32 +
    1.33 +  <div id="absolute" style="position: absolute; margin: 5px; border: 2px solid blue; padding: 0;">
    1.34 +    <div id="absolute-block" _offsetParent="absolute">
    1.35 +      <div id="absolute-replaced" _offsetParent="absolute" style="margin: 1px; border: 0; padding: 3px;"></div>
    1.36 +    </div>
    1.37 +  </div>
    1.38 +
    1.39 +  <div id="absolutelr" style="position: absolute; margin: 5px; border: 2px solid blue; padding: 0; left: 90px; top: 130px;">
    1.40 +    This is some absolute positioned text.
    1.41 +    <div id="absolutelr-block" _offsetParent="absolutelr">
    1.42 +      <div id="absolutelr-replaced" _offsetParent="absolutelr" style="margin: 1px; border: 0; padding: 3px;"></div>
    1.43 +    </div>
    1.44 +  </div>
    1.45 +
    1.46 +  <div id="relative" style="position: relative; margin: 2px; border: 1px solid orange; padding: 7px; left: 10px; top: 5px;">
    1.47 +    This is some relative positioned text.
    1.48 +    <div id="relative-block" _offsetParent="relative">
    1.49 +      <div id="relative-replaced" _offsetParent="relative" style="margin: 1px; border: 0; padding: 3px;"></div>
    1.50 +    </div>
    1.51 +  </div>
    1.52 +
    1.53 +  <div id="fixed" style="position: fixed; margin: 2px; border: 1px solid orange; padding: 7px; left: 87px; top: 12px;">
    1.54 +    This is some fixed positioned text.
    1.55 +    <div id="fixed-block" _offsetParent="fixed">
    1.56 +      <div id="fixed-replaced" _offsetParent="fixed" style="margin: 1px; border: 0; padding: 3px;"></div>
    1.57 +    </div>
    1.58 +  </div>
    1.59 +
    1.60 +  <div id="scrollbox"
    1.61 +       style="overflow: scroll; padding-left: 0px; margin: 3px; border: 4px solid green; max-width: 80px; max-height: 70px;"
    1.62 +       _scrollWidth="62" _scrollHeight="32"
    1.63 +       _clientLeft="1" _clientTop="1" _clientWidth="62" _clientHeight="32"><p id="p1" style="margin: 0; padding: 0;">One</p>
    1.64 +    <p id="p2">Two</p>
    1.65 +    <p id="scrollchild">Three</p>
    1.66 +    <p id="lastlinebox" style="margin: 0; padding: 0;"><input id="lastline" type="button"
    1.67 +                               style="margin: 0px; border: 2px solid red;"
    1.68 +                               value="This button is much longer than the others">
    1.69 +  </p></div>
    1.70 +
    1.71 +  <div id="overflow-visible" style="width:100px; height:100px;">
    1.72 +    <div id="overflow-visible-1" style="width:200px; height:1px; background:yellow;"></div>
    1.73 +    <div id="overflow-visible-2" style="height:200px; background:lime;"></div>
    1.74 +  </div>
    1.75 +
    1.76 +  <div id="div-displaynone" style="display: none; border: 0; padding: 0;"
    1.77 +         _offsetParent="null"></div>
    1.78 +  <p id="p3" style="margin: 2px; border: 0; padding: 1px;"
    1.79 +         _offsetLeft="9" _offsetTop="9" _offsetWidth="64" _offsetHeight="34"
    1.80 +         _scrollWidth="62" _scrollHeight="32"
    1.81 +         _clientLeft="1" _clientTop="1" _clientWidth="62" _clientHeight="32">
    1.82 +    <div id="div-nosize" style="width: 0; height: 0; margin: 0; border: 0; padding: 0;"></div>
    1.83 +  </p>
    1.84 +
    1.85 +</div>
    1.86 +
    1.87 +<div id="scrollbox-test" style="float: left; overflow: scroll; margin: 0; border: 0; padding: 0"></div>
    1.88 +
    1.89 +<script type="application/javascript">
    1.90 +SimpleTest.waitForExplicitFinish();
    1.91 +</script>
    1.92 +
    1.93 +<p id="display"></p>
    1.94 +<div id="content" style="display: none">
    1.95 +
    1.96 +</div>
    1.97 +
    1.98 +</body>
    1.99 +</html>

mercurial