editor/libeditor/html/tests/test_bug620906.html

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:5adaf4982b45
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=620906
5 -->
6 <head>
7 <title>Test for Bug 620906</title>
8 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
9 <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
11 </head>
12 <body>
13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=620906">Mozilla Bug 620906</a>
14 <p id="display"></p>
15 <div id="content">
16 <iframe src="data:text/html,
17 <body contenteditable
18 onmousedown='
19 document.designMode=&quot;on&quot;;
20 document.designMode=&quot;off&quot;;
21 '
22 >
23 <div style='height: 1000px;'></div>
24 </body>">
25 </iframe>
26 </div>
27 <pre id="test">
28 <script type="application/javascript">
29
30 /** Test for Bug 620906 **/
31 SimpleTest.waitForExplicitFinish();
32 addLoadEvent(function() {
33 var iframe = document.querySelector("iframe");
34 is(iframe.contentWindow.scrollY, 0, "Sanity check");
35 var rect = iframe.getBoundingClientRect();
36 setTimeout(function() {
37 var onscroll = function () {
38 iframe.contentWindow.removeEventListener("scroll", onscroll, false);
39 isnot(iframe.contentWindow.scrollY, 0, "The scrollbar should work");
40 SimpleTest.finish();
41 }
42 iframe.contentWindow.addEventListener("scroll", onscroll, false);
43 synthesizeMouse(iframe, rect.width - 5, rect.height / 2, {});
44 }, 0);
45 });
46
47 </script>
48 </pre>
49 </body>
50 </html>

mercurial