Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
Merge m-c to inbound.
Browse files Browse the repository at this point in the history
  • Loading branch information
rvandermeulen committed Nov 2, 2012
2 parents 0c2ffe1 + e9e22bd commit e7fdab1
Show file tree
Hide file tree
Showing 40 changed files with 1,150 additions and 502 deletions.
13 changes: 12 additions & 1 deletion accessible/tests/mochitest/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ function openBrowserWindowIntl()
"_blank", params,
gBrowserContext.startURL);

addA11yLoadEvent(startBrowserTests, browserWindow());
whenDelayedStartupFinished(browserWindow(), function () {
addA11yLoadEvent(startBrowserTests, browserWindow());
});
}

function startBrowserTests()
Expand All @@ -140,3 +142,12 @@ function startBrowserTests()
else
gBrowserContext.testFunc();
}

function whenDelayedStartupFinished(aWindow, aCallback) {
Services.obs.addObserver(function observer(aSubject, aTopic) {
if (aWindow == aSubject) {
Services.obs.removeObserver(observer, aTopic);
setTimeout(aCallback, 0);
}
}, "browser-delayed-startup-finished", false);
}
2 changes: 1 addition & 1 deletion browser/app/profile/firefox.js
Original file line number Diff line number Diff line change
Expand Up @@ -1027,7 +1027,7 @@ pref("devtools.responsiveUI.enabled", true);

// Enable the Debugger
pref("devtools.debugger.enabled", true);
pref("devtools.debugger.chrome-enabled", false);
pref("devtools.debugger.chrome-enabled", true);
pref("devtools.debugger.remote-host", "localhost");
pref("devtools.debugger.remote-autoconnect", false);
pref("devtools.debugger.remote-connection-retries", 3);
Expand Down
82 changes: 41 additions & 41 deletions browser/base/content/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -1008,7 +1008,6 @@ var gBrowserInit = {
if ("arguments" in window && window.arguments[0])
var uriToLoad = window.arguments[0];

var isLoadingBlank = isBlankPageURL(uriToLoad);
var mustLoadSidebar = false;

gBrowser.addEventListener("DOMUpdatePageReport", gPopupBlockerObserver, false);
Expand Down Expand Up @@ -1095,44 +1094,6 @@ var gBrowserInit = {
// setup simple gestures support
gGestureSupport.init(true);


if (uriToLoad && uriToLoad != "about:blank") {
if (uriToLoad instanceof Ci.nsISupportsArray) {
let count = uriToLoad.Count();
let specs = [];
for (let i = 0; i < count; i++) {
let urisstring = uriToLoad.GetElementAt(i).QueryInterface(Ci.nsISupportsString);
specs.push(urisstring.data);
}

// This function throws for certain malformed URIs, so use exception handling
// so that we don't disrupt startup
try {
gBrowser.loadTabs(specs, false, true);
} catch (e) {}
}
else if (uriToLoad instanceof XULElement) {
// swap the given tab with the default about:blank tab and then close
// the original tab in the other window.

// Stop the about:blank load
gBrowser.stop();
// make sure it has a docshell
gBrowser.docShell;

gBrowser.swapBrowsersAndCloseOther(gBrowser.selectedTab, uriToLoad);
}
else if (window.arguments.length >= 3) {
loadURI(uriToLoad, window.arguments[2], window.arguments[3] || null,
window.arguments[4] || false);
window.focus();
}
// Note: loadOneOrMoreURIs *must not* be called if window.arguments.length >= 3.
// Such callers expect that window.arguments[0] is handled as a single URI.
else
loadOneOrMoreURIs(uriToLoad);
}

if (window.opener && !window.opener.closed) {
let openerSidebarBox = window.opener.document.getElementById("sidebar-box");
// If the opener had a sidebar, open the same sidebar in our window.
Expand Down Expand Up @@ -1242,7 +1203,7 @@ var gBrowserInit = {
retrieveToolbarIconsizesFromTheme();

// Wait until chrome is painted before executing code not critical to making the window visible
this._boundDelayedStartup = this._delayedStartup.bind(this, isLoadingBlank, mustLoadSidebar);
this._boundDelayedStartup = this._delayedStartup.bind(this, uriToLoad, mustLoadSidebar);
window.addEventListener("MozAfterPaint", this._boundDelayedStartup);

gStartupRan = true;
Expand All @@ -1253,14 +1214,53 @@ var gBrowserInit = {
this._boundDelayedStartup = null;
},

_delayedStartup: function(isLoadingBlank, mustLoadSidebar) {
_delayedStartup: function(uriToLoad, mustLoadSidebar) {
let tmp = {};
Cu.import("resource:///modules/TelemetryTimestamps.jsm", tmp);
let TelemetryTimestamps = tmp.TelemetryTimestamps;
TelemetryTimestamps.add("delayedStartupStarted");

this._cancelDelayedStartup();

var isLoadingBlank = isBlankPageURL(uriToLoad);

if (uriToLoad && uriToLoad != "about:blank") {
if (uriToLoad instanceof Ci.nsISupportsArray) {
let count = uriToLoad.Count();
let specs = [];
for (let i = 0; i < count; i++) {
let urisstring = uriToLoad.GetElementAt(i).QueryInterface(Ci.nsISupportsString);
specs.push(urisstring.data);
}

// This function throws for certain malformed URIs, so use exception handling
// so that we don't disrupt startup
try {
gBrowser.loadTabs(specs, false, true);
} catch (e) {}
}
else if (uriToLoad instanceof XULElement) {
// swap the given tab with the default about:blank tab and then close
// the original tab in the other window.

// Stop the about:blank load
gBrowser.stop();
// make sure it has a docshell
gBrowser.docShell;

gBrowser.swapBrowsersAndCloseOther(gBrowser.selectedTab, uriToLoad);
}
else if (window.arguments.length >= 3) {
loadURI(uriToLoad, window.arguments[2], window.arguments[3] || null,
window.arguments[4] || false);
window.focus();
}
// Note: loadOneOrMoreURIs *must not* be called if window.arguments.length >= 3.
// Such callers expect that window.arguments[0] is handled as a single URI.
else
loadOneOrMoreURIs(uriToLoad);
}

#ifdef MOZ_SAFE_BROWSING
// Bug 778855 - Perf regression if we do this here. To be addressed in bug 779008.
setTimeout(function() { SafeBrowsing.init(); }, 2000);
Expand Down
Loading

0 comments on commit e7fdab1

Please sign in to comment.