4 https://bugzilla.mozilla.org/show_bug.cgi?id=1013412
7 <title>Test for Bug
1013412</title>
8 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
9 <script src=
"/tests/SimpleTest/paint_listener.js"></script>
10 <script src=
"/tests/SimpleTest/EventUtils.js"></script>
11 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css"/>
20 background: repeating-linear-gradient(#EEE, #EEE
100px, #DDD
100px, #DDD
200px);
28 box-shadow: inset
0 0 0 60px #
555;
36 border:
10px solid white;
40 transform-origin:
10px
230px;
41 will-change: transform;
46 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=1013412">Mozilla Bug
1013412</a>
49 <p>Scrolling the page should be async, but scrolling over the dark circle should not scroll the page and instead rotate the white ball.
</p>
52 <div id=
"circle"></div>
57 <script type=
"application/javascript">
59 /** Test for Bug
1013412 **/
62 var rotationAdjusted = false;
64 var incrementForMode = function (mode) {
66 case WheelEvent.DOM_DELTA_PIXEL: return
1;
67 case WheelEvent.DOM_DELTA_LINE: return
15;
68 case WheelEvent.DOM_DELTA_PAGE: return
400;
73 document.getElementById(
"scrollbox").addEventListener(
"wheel", function (e) {
74 rotation += e.deltaY * incrementForMode(e.deltaMode) *
0.2;
75 document.getElementById(
"circle").style.transform =
"rotate(" + rotation +
"deg)";
76 rotationAdjusted = true;
82 var content = document.getElementById('content');
83 if (iteration <
300) { // enough iterations that we would scroll to the bottom of 'content'
85 sendWheelAndPaint(content,
100,
10,
86 { deltaMode: WheelEvent.DOM_DELTA_LINE,
87 deltaY:
1.0, lineOrPageDeltaY:
1 },
91 var scrollbox = document.getElementById('scrollbox');
92 is(content.scrollTop < content.scrollTopMax, true,
"We should not have scrolled to the bottom of the scrollframe");
93 is(rotationAdjusted, true,
"The rotation should have been adjusted");
97 function startTest() {
98 // If we allow smooth scrolling the
"smooth" scrolling may cause the page to
99 // glide past the scrollbox (which is supposed to stop the scrolling) and so
100 // we might end up at the bottom of the page.
101 SpecialPowers.pushPrefEnv({
"set": [[
"general.smoothScroll", false]]}, runTest);
104 SimpleTest.waitForExplicitFinish();
105 SimpleTest.waitForFocus(startTest, window);