mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Merge.
This commit is contained in:
commit
7071d53245
@ -1335,7 +1335,14 @@ SessionStoreService.prototype = {
|
||||
aData.innerHTML = aContent.document.body.innerHTML;
|
||||
}
|
||||
}
|
||||
aData.scroll = aContent.scrollX + "," + aContent.scrollY;
|
||||
|
||||
// get scroll position from nsIDOMWindowUtils, since it allows avoiding a
|
||||
// flush of layout
|
||||
let domWindowUtils = aContent.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIDOMWindowUtils);
|
||||
let scrollX = {}, scrollY = {};
|
||||
domWindowUtils.getScrollXY(false, scrollX, scrollY);
|
||||
aData.scroll = scrollX.value + "," + scrollY.value;
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -78,6 +78,7 @@ _BROWSER_TEST_FILES = \
|
||||
browser_476161.js \
|
||||
browser_476161_sample.html \
|
||||
browser_480893.js \
|
||||
browser_483330.js \
|
||||
$(NULL)
|
||||
|
||||
libs:: $(_BROWSER_TEST_FILES)
|
||||
|
@ -0,0 +1,39 @@
|
||||
function test() {
|
||||
/** Test for Bug 483330 **/
|
||||
|
||||
// test setup
|
||||
let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
|
||||
waitForExplicitFinish();
|
||||
|
||||
let tab = gBrowser.addTab();
|
||||
gBrowser.selectedTab = tab;
|
||||
|
||||
let browser = tab.linkedBrowser;
|
||||
browser.addEventListener("load", function loadListener(e) {
|
||||
browser.removeEventListener("load", arguments.callee, false);
|
||||
|
||||
// Scroll the content document
|
||||
browser.contentWindow.scrollTo(1100, 1200);
|
||||
is(browser.contentWindow.scrollX, 1100, "scrolled horizontally");
|
||||
is(browser.contentWindow.scrollY, 1200, "scrolled vertically");
|
||||
|
||||
gBrowser.removeTab(tab);
|
||||
|
||||
let newTab = ss.undoCloseTab(window, 0);
|
||||
newTab.addEventListener("SSTabRestored", function tabRestored(e) {
|
||||
newTab.removeEventListener("SSTabRestored", arguments.callee, false);
|
||||
|
||||
let newBrowser = newTab.linkedBrowser;
|
||||
|
||||
// check that the scroll position was restored
|
||||
is(newBrowser.contentWindow.scrollX, 1100, "still scrolled horizontally");
|
||||
is(newBrowser.contentWindow.scrollY, 1200, "still scrolled vertically");
|
||||
|
||||
gBrowser.removeTab(newTab);
|
||||
|
||||
finish();
|
||||
}, true);
|
||||
}, true);
|
||||
|
||||
browser.loadURI("data:text/html,<body style='width: 100000px; height: 100000px;'><p>top</p></body>");
|
||||
}
|
Loading…
Reference in New Issue
Block a user