2 <?xml-stylesheet href=
"chrome://global/skin" type=
"text/css"?>
3 <?xml-stylesheet href=
"chrome://mochikit/content/tests/SimpleTest/test.css" type=
"text/css"?>
4 <window xmlns=
"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
5 xmlns:
html=
"http://www.w3.org/1999/xhtml"
6 title=
"Test for Bug 703150">
8 https://bugzilla.mozilla.org/show_bug.cgi?id=703150
11 <script src=
"chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
12 <script src=
"chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
14 <scrollbar id=
"scrollbar" curpos=
"0" maxpos=
"500"/>
16 <script class=
"testbody" type=
"application/javascript">
20 var scrollbar = document.getElementById(
"scrollbar");
21 var scrollbarThumb = null;
22 for (let child of SpecialPowers.InspectorUtils.getChildrenForNode(scrollbar, true, false)) {
23 if (child.nodeName ===
"slider") {
24 scrollbarThumb = SpecialPowers.unwrap(child.childNodes[
0]);
28 ok(scrollbarThumb,
"Should find thumb");
29 is(scrollbarThumb.nodeName,
"thumb",
"Should find thumb");
31 function mousedownHandler(aEvent)
33 aEvent.stopPropagation();
35 window.addEventListener(
"mousedown", mousedownHandler, true);
37 // Wait for finishing reflow...
38 SimpleTest.executeSoon(function () {
39 synthesizeMouseAtCenter(scrollbarThumb, { type:
"mousedown" });
41 is(scrollbar.getAttribute(
"curpos"),
"0",
42 "scrollbar thumb has been moved already");
44 synthesizeMouseAtCenter(scrollbar, { type:
"mousemove" });
46 ok(scrollbar.getAttribute(
"curpos")
> 0,
47 "scrollbar thumb hasn't been dragged");
49 synthesizeMouseAtCenter(scrollbarThumb, { type:
"mouseup" });
51 window.removeEventListener(
"mousedown", mousedownHandler, true);
57 SimpleTest.waitForExplicitFinish();
62 <body id=
"html_body" xmlns=
"http://www.w3.org/1999/xhtml">
63 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=703150">Mozilla Bug
703150</a>