Bug 902937 - Fixup scrollBy in StartUI.js and tests. r=mbrubeck

This commit is contained in:
Jim Mathies 2013-08-13 05:23:53 -05:00
parent 9c624067a5
commit 9ba71edfba
2 changed files with 3 additions and 13 deletions

View File

@ -95,14 +95,6 @@ var StartUI = {
section.setAttribute("expanded", "true");
},
getScrollBoxObject: function () {
let startBox = document.getElementById("start-scrollbox");
if (!startBox._cachedSBO) {
startBox._cachedSBO = startBox.boxObject.QueryInterface(Ci.nsIScrollBoxObject);
}
return startBox._cachedSBO;
},
handleEvent: function handleEvent(aEvent) {
switch (aEvent.type) {
case "MozPrecisePointer":
@ -115,11 +107,10 @@ var StartUI = {
this.onClick(aEvent);
break;
case "MozMousePixelScroll":
let scroller = this.getScrollBoxObject();
if (this.startUI.getAttribute("viewstate") == "snapped") {
scroller.scrollBy(0, aEvent.detail);
window.scrollBy(0, aEvent.detail);
} else {
scroller.scrollBy(aEvent.detail, 0);
window.scrollBy(aEvent.detail, 0);
}
aEvent.preventDefault();

View File

@ -12,8 +12,7 @@ function test() {
}
function scrollToEnd() {
let scroller = getBrowser().contentWindow.StartUI.getScrollBoxObject();
scroller.scrollBy(50000, 0);
getBrowser().contentWindow.scrollBy(50000, 0);
}
function setup() {