зеркало из https://github.com/mozilla/gecko-dev.git
Make test_wheeltransaction.xul work with asynchronous scrolling. (bug 1140293, r=mstange)
--HG-- extra : rebase_source : 185871e093d11b8d9fe24b1c0dfc952314fd874b
This commit is contained in:
Родитель
c83c61bfca
Коммит
605d89d902
|
@ -6,8 +6,12 @@
|
||||||
onunload="onunload();"
|
onunload="onunload();"
|
||||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||||
|
|
||||||
|
<script type="application/javascript"
|
||||||
|
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
|
||||||
<script type="application/javascript"
|
<script type="application/javascript"
|
||||||
src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js" />
|
src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js" />
|
||||||
|
<script type="application/javascript"
|
||||||
|
src="chrome://mochikit/content/tests/SimpleTest/paint_listener.js" />
|
||||||
|
|
||||||
<body xmlns="http://www.w3.org/1999/xhtml">
|
<body xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
|
@ -113,11 +117,13 @@ var gPrefSvc = Components.classes["@mozilla.org/preferences-service;1"].
|
||||||
const kPrefSmoothScroll = "general.smoothScroll";
|
const kPrefSmoothScroll = "general.smoothScroll";
|
||||||
const kPrefNameTimeout = "mousewheel.transaction.timeout";
|
const kPrefNameTimeout = "mousewheel.transaction.timeout";
|
||||||
const kPrefNameIgnoreMoveDelay = "mousewheel.transaction.ignoremovedelay";
|
const kPrefNameIgnoreMoveDelay = "mousewheel.transaction.ignoremovedelay";
|
||||||
|
const kPrefTestEventsAsyncEnabled = "test.events.async.enabled";
|
||||||
|
|
||||||
const kDefaultTimeout = gPrefSvc.getIntPref(kPrefNameTimeout);
|
const kDefaultTimeout = gPrefSvc.getIntPref(kPrefNameTimeout);
|
||||||
const kDefaultIgnoreMoveDelay = gPrefSvc.getIntPref(kPrefNameIgnoreMoveDelay);
|
const kDefaultIgnoreMoveDelay = gPrefSvc.getIntPref(kPrefNameIgnoreMoveDelay);
|
||||||
|
|
||||||
gPrefSvc.setBoolPref(kPrefSmoothScroll, false);
|
gPrefSvc.setBoolPref(kPrefSmoothScroll, false);
|
||||||
|
gPrefSvc.setBoolPref(kPrefTestEventsAsyncEnabled, true);
|
||||||
|
|
||||||
var gTimeout, gIgnoreMoveDelay;
|
var gTimeout, gIgnoreMoveDelay;
|
||||||
var gEnoughForTimeout, gEnoughForIgnoreMoveDelay;
|
var gEnoughForTimeout, gEnoughForIgnoreMoveDelay;
|
||||||
|
@ -175,7 +181,9 @@ function onunload()
|
||||||
{
|
{
|
||||||
resetTimeoutPrefs();
|
resetTimeoutPrefs();
|
||||||
gPrefSvc.clearUserPref(kPrefSmoothScroll);
|
gPrefSvc.clearUserPref(kPrefSmoothScroll);
|
||||||
|
gPrefSvc.clearUserPref(kPrefTestEventsAsyncEnabled);
|
||||||
disableNonTestMouseEvents(false);
|
disableNonTestMouseEvents(false);
|
||||||
|
SpecialPowers.DOMWindowUtils.restoreNormalRefresh();
|
||||||
window.opener.wrappedJSObject.SimpleTest.finish();
|
window.opener.wrappedJSObject.SimpleTest.finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1095,7 +1103,7 @@ function _fireWheelScrollEvent(aOffset, aIsVertical, aForward, aDelta)
|
||||||
} else {
|
} else {
|
||||||
event.deltaX = aForward ? aDelta : -aDelta;
|
event.deltaX = aForward ? aDelta : -aDelta;
|
||||||
}
|
}
|
||||||
synthesizeWheel(gRootView, aOffset.x, aOffset.y, event, window);
|
sendWheelAndPaint(gRootView, aOffset.x, aOffset.y, event, null, window);
|
||||||
}
|
}
|
||||||
|
|
||||||
function _canScroll(aElement, aIsVertical, aForward)
|
function _canScroll(aElement, aIsVertical, aForward)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче