2012-08-20 06:46:08 +04:00
|
|
|
<!DOCTYPE HTML>
|
|
|
|
<html>
|
|
|
|
<!--
|
|
|
|
https://bugzilla.mozilla.org/show_bug.cgi?id=422132
|
|
|
|
-->
|
|
|
|
<head>
|
|
|
|
<title>Test for Bug 422132</title>
|
|
|
|
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
|
|
|
|
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
|
|
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
|
2015-04-15 23:41:26 +03:00
|
|
|
<script type="text/javascript" src="/tests/SimpleTest/paint_listener.js"></script>
|
2012-08-20 06:46:08 +04:00
|
|
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=422132">Mozilla Bug 422132</a>
|
|
|
|
<p id="display"></p>
|
|
|
|
<div id="target" style="font-size: 0; width: 200px; height: 200px; overflow: auto;">
|
|
|
|
<div style="width: 1000px; height: 1000px;"></div>
|
|
|
|
</div>
|
|
|
|
<div id="content" style="display: none">
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<pre id="test">
|
|
|
|
<script class="testbody" type="text/javascript">
|
|
|
|
|
|
|
|
/** Test for Bug 422132 **/
|
|
|
|
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
2015-02-19 19:53:01 +03:00
|
|
|
SimpleTest.waitForFocus(function() {
|
|
|
|
SpecialPowers.pushPrefEnv({
|
|
|
|
"set":[["general.smoothScroll", false],
|
|
|
|
["mousewheel.min_line_scroll_amount", 1],
|
2015-04-15 23:41:26 +03:00
|
|
|
["mousewheel.system_scroll_override_on_root_content.enabled", false],
|
2015-02-19 19:53:01 +03:00
|
|
|
["mousewheel.transaction.timeout", 100000]]}, runTests)}, window);
|
2012-08-20 06:46:08 +04:00
|
|
|
|
|
|
|
function runTests()
|
|
|
|
{
|
|
|
|
var target = document.getElementById("target");
|
|
|
|
|
|
|
|
var scrollLeft = target.scrollLeft;
|
|
|
|
var scrollTop = target.scrollTop;
|
2015-04-15 23:37:04 +03:00
|
|
|
|
|
|
|
var tests = [
|
|
|
|
{
|
2015-04-15 23:41:26 +03:00
|
|
|
prepare: function() {
|
|
|
|
scrollLeft = target.scrollLeft;
|
|
|
|
scrollTop = target.scrollTop;
|
|
|
|
},
|
2015-04-15 23:37:04 +03:00
|
|
|
event: {
|
|
|
|
deltaMode: WheelEvent.DOM_DELTA_PIXEL,
|
|
|
|
deltaX: 0.5,
|
|
|
|
deltaY: 0.5,
|
|
|
|
lineOrPageDeltaX: 0,
|
|
|
|
lineOrPageDeltaY: 0
|
|
|
|
},
|
|
|
|
}, {
|
|
|
|
event: {
|
|
|
|
deltaMode: WheelEvent.DOM_DELTA_PIXEL,
|
|
|
|
deltaX: 0.5,
|
|
|
|
deltaY: 0.5,
|
|
|
|
lineOrPageDeltaX: 0,
|
|
|
|
lineOrPageDeltaY: 0
|
|
|
|
},
|
|
|
|
check: function() {
|
2015-04-15 23:41:26 +03:00
|
|
|
is(target.scrollLeft - scrollLeft, 1,
|
2015-04-15 23:37:04 +03:00
|
|
|
"not scrolled to right by 0.5px delta value with pending 0.5px delta");
|
2015-04-15 23:41:26 +03:00
|
|
|
is(target.scrollTop - scrollTop, 1,
|
2015-04-15 23:37:04 +03:00
|
|
|
"not scrolled to bottom by 0.5px delta value with pending 0.5px delta");
|
|
|
|
},
|
|
|
|
}, {
|
2015-04-15 23:41:26 +03:00
|
|
|
prepare: function() {
|
|
|
|
scrollLeft = target.scrollLeft;
|
|
|
|
scrollTop = target.scrollTop;
|
|
|
|
},
|
2015-04-15 23:37:04 +03:00
|
|
|
event: {
|
|
|
|
deltaMode: WheelEvent.DOM_DELTA_LINE,
|
|
|
|
deltaX: 0.5,
|
|
|
|
deltaY: 0.5,
|
|
|
|
lineOrPageDeltaX: 0,
|
|
|
|
lineOrPageDeltaY: 0
|
|
|
|
},
|
|
|
|
}, {
|
|
|
|
event: {
|
|
|
|
deltaMode: WheelEvent.DOM_DELTA_LINE,
|
|
|
|
deltaX: 0.5,
|
|
|
|
deltaY: 0.5,
|
|
|
|
lineOrPageDeltaX: 1,
|
|
|
|
lineOrPageDeltaY: 1
|
|
|
|
},
|
|
|
|
check: function() {
|
2015-04-15 23:41:26 +03:00
|
|
|
is(target.scrollLeft - scrollLeft, 1,
|
2015-04-15 23:37:04 +03:00
|
|
|
"not scrolled to right by 0.5 line delta value with pending 0.5 line delta");
|
2015-04-15 23:41:26 +03:00
|
|
|
is(target.scrollTop - scrollTop, 1,
|
2015-04-15 23:37:04 +03:00
|
|
|
"not scrolled to bottom by 0.5 line delta value with pending 0.5 line delta");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
var nextTest = function() {
|
|
|
|
var test = tests.shift();
|
2015-04-15 23:41:26 +03:00
|
|
|
if (test.prepare) {
|
|
|
|
test.prepare();
|
|
|
|
}
|
|
|
|
|
|
|
|
sendWheelAndPaint(target, 10, 10, test.event, function() {
|
|
|
|
if (test.check) {
|
|
|
|
test.check();
|
|
|
|
}
|
2015-04-15 23:37:04 +03:00
|
|
|
if (tests.length == 0) {
|
|
|
|
SimpleTest.finish();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
setTimeout(nextTest, 0);
|
2015-04-15 23:41:26 +03:00
|
|
|
});
|
2015-04-15 23:37:04 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
nextTest();
|
2012-08-20 06:46:08 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</pre>
|
|
|
|
</body>
|
|
|
|
</html>
|