Bug 666801 - Use nsIWebProgress.isTopLevel attribute in browser code (r=felipe)

This commit is contained in:
Bill McCloskey
2013-04-24 22:29:24 -07:00
parent 9cc29b82cc
commit 608d5097bb
2 changed files with 9 additions and 9 deletions

View File

@@ -3753,7 +3753,7 @@ var XULBrowserWindow = {
if (aStateFlags & nsIWebProgressListener.STATE_START &&
aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) {
if (aRequest && aWebProgress.DOMWindow == content) {
if (aRequest && aWebProgress.isTopLevel) {
// clear out feed data
gBrowser.selectedBrowser.feeds = null;
@@ -3787,7 +3787,7 @@ var XULBrowserWindow = {
location = aRequest.URI;
// For keyword URIs clear the user typed value since they will be changed into real URIs
if (location.scheme == "keyword" && aWebProgress.DOMWindow == content)
if (location.scheme == "keyword" && aWebProgress.isTopLevel)
gBrowser.userTypedValue = null;
if (location.spec != "about:blank") {
@@ -3837,7 +3837,7 @@ var XULBrowserWindow = {
let tooltipNode = pageTooltip.triggerNode;
if (tooltipNode) {
// Optimise for the common case
if (aWebProgress.DOMWindow == content) {
if (aWebProgress.isTopLevel) {
pageTooltip.hidePopup();
}
else {
@@ -3868,7 +3868,7 @@ var XULBrowserWindow = {
// Do not update urlbar if there was a subframe navigation
var browser = gBrowser.selectedBrowser;
if (aWebProgress.DOMWindow == content) {
if (aWebProgress.isTopLevel) {
if ((location == "about:blank" && (gMultiProcessBrowser || !content.opener)) ||
location == "") { // Second condition is for new tabs, otherwise
// reload function is enabled until tab is refreshed.
@@ -4240,7 +4240,7 @@ var TabsProgressListener = {
#endif
// Collect telemetry data about tab load times.
if (aWebProgress.DOMWindow == aWebProgress.DOMWindow.top) {
if (aWebProgress.isTopLevel) {
if (aStateFlags & Ci.nsIWebProgressListener.STATE_IS_WINDOW) {
if (aStateFlags & Ci.nsIWebProgressListener.STATE_START)
TelemetryStopwatch.start("FX_PAGE_LOAD_MS", aBrowser);
@@ -4298,7 +4298,7 @@ var TabsProgressListener = {
gBrowser.getNotificationBox(aBrowser).removeTransientNotifications();
// Filter out location changes in sub documents.
if (aBrowser.contentWindow == aWebProgress.DOMWindow) {
if (aWebProgress.isTopLevel) {
// Initialize the click-to-play state.
aBrowser._clickToPlayPluginsActivated = new Map();
aBrowser._clickToPlayAllPluginsActivated = false;

View File

@@ -526,7 +526,7 @@
// We need to add 2 because loadURIWithFlags may have
// cancelled a pending load which would have cleared
// its anchor scroll detection temporary increment.
if (aWebProgress.DOMWindow == this.mBrowser.contentWindow)
if (aWebProgress.isTopLevel)
this.mBrowser.userTypedClear += 2;
if (this._shouldShowProgress(aRequest)) {
@@ -553,7 +553,7 @@
}
this.mTab.removeAttribute("progress");
if (aWebProgress.DOMWindow == this.mBrowser.contentWindow) {
if (aWebProgress.isTopLevel) {
if (!Components.isSuccessCode(aStatus) &&
!isTabEmpty(this.mTab)) {
// Restore the current document's location in case the
@@ -622,7 +622,7 @@
aFlags) {
// OnLocationChange is called for both the top-level content
// and the subframes.
let topLevel = aWebProgress.DOMWindow == this.mBrowser.contentWindow;
let topLevel = aWebProgress.isTopLevel;
if (topLevel) {
// The document loaded correctly, clear the value if we should