content/html/document/test/bug199692-scrolled.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 <!DOCTYPE html>
     2 <html>
     3 <!--
     4 https://bugzilla.mozilla.org/show_bug.cgi?id=199692
     5 -->
     6 <head>
     7   <title>Scrolled page for bug 199692 tests</title>
     8   <style type="text/css">
     9 /* Disable default margins/padding/borders so (0, 0) gets a div. */
    10 * { margin: 0; padding: 0; border: 0; }
    11   </style>
    12   <script type="application/javascript">
    13 function $(id) { return document.getElementById(id); }
    15 function runTests()
    16 {
    17   var is = window.parent.is;
    19   is(document.elementFromPoint(0, 0), $("down"),
    20      "document.elementFromPoint not respecting scrolling?");
    21   is(document.elementFromPoint(200, 200), null,
    22      "should have returned null for a not-visible point");
    23   is(document.elementFromPoint(3, -5), null,
    24      "should have returned null for a not-visible point");
    25 }
    26   </script>
    27 </head>
    28 <!-- This page is loaded in a 200px-square iframe scrolled to #down. -->
    29 <body>
    30 <div style="height: 150px; background: lightblue;">first</div>
    31 <div id="down" style="height: 250px; background: lightgreen;">second</div>
    32 </body>
    33 </html>

mercurial