Bug 515878: refreshing page scrolls to the top [r=mark.finkle]

This commit is contained in:
Vivien Nicolas 2009-11-30 15:19:24 -05:00
Родитель 7bc71e3785
Коммит 2b98b5442b
1 изменённых файлов: 27 добавлений и 12 удалений

Просмотреть файл

@ -795,11 +795,26 @@ var Browser = {
}
},
getNotificationBox: function() {
getNotificationBox: function getNotificationBox() {
return document.getElementById("notifications");
},
translatePhoneNumbers: function() {
removeTransientNotificationsForTab: function removeTransientNotificationsForTab(aTab) {
let notificationBox = this.getNotificationBox();
let notifications = notificationBox.allNotifications;
for (let n = notifications.length - 1; n >= 0; n--) {
let notification = notifications[n];
if (notification._chromeTab != aTab.chromeTab)
continue;
if (notification.persistence)
notification.persistence--;
else if (Date.now() > notification.timeout)
notificationBox.removeNotification(notification);
}
},
translatePhoneNumbers: function translatePhoneNumbers() {
let doc = getBrowser().contentDocument;
// jonas black magic (only match text nodes that contain a sequence of 4 numbers)
let textnodes = doc.evaluate('//text()[contains(translate(., "0123456789", "^^^^^^^^^^"), "^^^^")]',
@ -1247,7 +1262,6 @@ var Browser = {
forceChromeReflow: function forceChromeReflow() {
let dummy = getComputedStyle(document.documentElement, "").width;
}
};
Browser.MainDragger = function MainDragger(browserView) {
@ -1257,7 +1271,6 @@ Browser.MainDragger = function MainDragger(browserView) {
};
Browser.MainDragger.prototype = {
isDraggable: function isDraggable(target, scroller) { return true; },
dragStart: function dragStart(clientX, clientY, target, scroller) {
@ -1473,7 +1486,6 @@ Browser.MainDragger.prototype = {
doffset.subtract(newX.value - origX.value, newY.value - origY.value);
}
};
function nsBrowserAccess()
@ -2416,9 +2428,11 @@ ProgressController.prototype = {
/** This method is called to indicate a change to the current location. */
onLocationChange: function(aWebProgress, aRequest, aLocationURI) {
let location = aLocationURI ? aLocationURI.spec : "";
let selectedBrowser = Browser.selectedBrowser;
this._hostChanged = true;
this._hostChanged = (location != this.browser.lastSpec);
if (this._hostChanged) {
this.browser.lastSpec = this.browser.currentURI.spec;
Browser.removeTransientNotificationsForTab(this._tab);
if (this._tab == Browser.selectedTab) {
BrowserUI.updateURI();
@ -2427,6 +2441,7 @@ ProgressController.prototype = {
// to the top so the new paints will draw correctly.
Browser.scrollContentToTop();
}
}
},
/**