Skip to content

Commit

Permalink
Merge m-c to inbound a=merge
Browse files Browse the repository at this point in the history
a=release IGNORE BAD COMMIT MESSAGES
  • Loading branch information
KWierso committed May 19, 2017
2 parents 24b1d12 + 15edcfd commit 8b07ba2
Show file tree
Hide file tree
Showing 290 changed files with 6,988 additions and 6,340 deletions.
1 change: 0 additions & 1 deletion addon-sdk/source/python-lib/cuddlefish/prefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
'browser.safebrowsing.provider.google.gethashURL': 'http://localhost/safebrowsing-dummy/gethash',
'browser.safebrowsing.provider.google4.updateURL': 'http://localhost/safebrowsing4-dummy/update',
'browser.safebrowsing.provider.google4.gethashURL': 'http://localhost/safebrowsing4-dummy/gethash',
'browser.selfsupport.url': 'https://localhost/selfsupport-dummy',
'browser.safebrowsing.provider.mozilla.gethashURL': 'http://localhost/safebrowsing-dummy/gethash',
'browser.safebrowsing.provider.mozilla.updateURL': 'http://localhost/safebrowsing-dummy/update',

Expand Down
6 changes: 0 additions & 6 deletions addon-sdk/source/test/leak/leak-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

const { Cu, Ci } = require("chrome");
const { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
const { SelfSupportBackend } = Cu.import("resource:///modules/SelfSupportBackend.jsm", {});
const Startup = Cu.import("resource://gre/modules/sdk/system/Startup.js", {}).exports;

// Adapted from the SpecialPowers.exactGC() code. We don't have a
Expand Down Expand Up @@ -38,11 +37,6 @@ function gc() {
// object then it will be unloaded after the memory measurements.
exports.asyncWindowLeakTest = function*(assert, asyncTestFunc) {

// SelfSupportBackend periodically tries to open windows. This can
// mess up our window leak detection below, so turn it off.
if (SelfSupportBackend._log)
SelfSupportBackend.uninit();

// Wait for the browser to finish loading.
yield Startup.onceInitialized;

Expand Down
1 change: 0 additions & 1 deletion addon-sdk/source/test/preferences/no-connections.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"browser.safebrowsing.provider.google4.updateURL": "http://localhost/safebrowsing4-dummy/update",
"browser.safebrowsing.provider.google4.gethashURL": "http://localhost/safebrowsing4-dummy/gethash",
"browser.safebrowsing.provider.google4.reportURL": "http://localhost/safebrowsing4-dummy/malwarereport",
"browser.selfsupport.url": "https://localhost/selfsupport-dummy",
"browser.safebrowsing.provider.mozilla.gethashURL": "http://localhost/safebrowsing-dummy/gethash",
"browser.safebrowsing.provider.mozilla.updateURL": "http://localhost/safebrowsing-dummy/update",
"browser.newtabpage.directory.source": "data:application/json,{'jetpack':1}",
Expand Down
1 change: 0 additions & 1 deletion browser/app/permissions
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

# UITour
origin uitour 1 https://www.mozilla.org
origin uitour 1 https://self-repair.mozilla.org
origin uitour 1 https://support.mozilla.org
origin uitour 1 https://addons.mozilla.org
origin uitour 1 https://discovery.addons.mozilla.org
Expand Down
2 changes: 0 additions & 2 deletions browser/app/profile/firefox.js
Original file line number Diff line number Diff line change
Expand Up @@ -822,8 +822,6 @@ pref("browser.rights.3.shown", false);
pref("browser.rights.override", true);
#endif

pref("browser.selfsupport.url", "https://self-repair.mozilla.org/%LOCALE%/repair");

pref("browser.sessionstore.resume_from_crash", true);
pref("browser.sessionstore.resume_session_once", false);

Expand Down
5 changes: 3 additions & 2 deletions browser/base/content/browser.xul
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@
noautofocus="true"
hidden="true"
overflowpadding="4"
norolluponanchor="true" />
norolluponanchor="true"
nomaxresults="true" />

<!-- for search with one-off buttons -->
<panel type="autocomplete" id="PopupSearchAutoComplete" noautofocus="true" hidden="true"/>
Expand Down Expand Up @@ -320,7 +321,7 @@
<observes element="viewTabsSidebar" attribute="checked"/>
</toolbarbutton>
<toolbarseparator/>
<toolbarbutton label="&sidebarCloseButton.tooltip;"
<toolbarbutton label="&sidebarMenuClose.label;"
class="subviewbutton"
oncommand="SidebarUI.hide()"/>
</panel>
Expand Down
51 changes: 39 additions & 12 deletions browser/base/content/tabbrowser.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1000,11 +1000,15 @@
var newTitle = "";
var docElement = this.ownerDocument.documentElement;
var sep = docElement.getAttribute("titlemenuseparator");
let tab = this.getTabForBrowser(aBrowser);
let docTitle;
// Strip out any null bytes in the content title, since the
// underlying widget implementations of nsWindow::SetTitle pass
// null-terminated strings to system APIs.
var docTitle = aBrowser.contentTitle.replace(/\0/g, "");
if (tab._labelIsContentTitle) {
// Strip out any null bytes in the content title, since the
// underlying widget implementations of nsWindow::SetTitle pass
// null-terminated strings to system APIs.
docTitle = tab.getAttribute("label").replace(/\0/g, "");
}
if (!docTitle)
docTitle = docElement.getAttribute("titledefault");
Expand Down Expand Up @@ -1412,13 +1416,14 @@
<method name="setInitialTabTitle">
<parameter name="aTab"/>
<parameter name="aTitle"/>
<parameter name="aOptions"/>
<body><![CDATA[
if (aTitle) {
aTab.setAttribute("label", aTitle);
// Don't replace the set label with the empty tab label or the URL
// while the tab is loading.
aTab._suppressTransientPlaceholderLabel = true;
this._setTabLabel(aTab, aTitle, aOptions);
}
]]></body>
</method>
Expand All @@ -1437,7 +1442,10 @@
delete aTab._suppressTransientPlaceholderLabel;
}
if (!title) {
let isContentTitle = false;
if (title) {
isContentTitle = true;
} else {
if (browser.currentURI.spec) {
try {
title = this.mURIFixup.createExposableURI(browser.currentURI).spec;
Expand Down Expand Up @@ -1465,14 +1473,33 @@
title = this.mStringBundle.getString("tabs.emptyTabTitle");
}
if (aTab.label == title)
return this._setTabLabel(aTab, title, { isContentTitle });
]]>
</body>
</method>

<method name="_setTabLabel">
<parameter name="aTab"/>
<parameter name="aLabel"/>
<parameter name="aOptions"/>
<body>
<![CDATA[
if (!aLabel || aTab.getAttribute("label") == aLabel) {
return false;
}
aTab.setAttribute("label", aLabel);
aTab._labelIsContentTitle = aOptions && aOptions.isContentTitle;
aTab.label = title;
this._tabAttrModified(aTab, ["label"]);
// Dispatch TabAttrModified event unless we're setting the label
// before the TabOpen event was dispatched.
if (!aOptions || !aOptions.beforeTabOpen) {
this._tabAttrModified(aTab, ["label"]);
}
if (aTab.selected)
if (aTab.selected) {
this.updateTitlebar();
}
return true;
]]>
Expand Down Expand Up @@ -2313,7 +2340,7 @@
t.setAttribute("label", this.mStringBundle.getString("tabs.emptyTabTitle"));
} else {
// Set URL as label so that the tab isn't empty initially.
this.setInitialTabTitle(t, aURI);
this.setInitialTabTitle(t, aURI, { beforeTabOpen: true });
}
}
Expand Down
6 changes: 2 additions & 4 deletions browser/base/content/test/general/browser_audioTabIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ async function wait_for_tab_playing_event(tab, expectPlaying) {
ok(true, "The tab should " + (expectPlaying ? "" : "not ") + "be playing");
return true;
}
return await BrowserTestUtils.waitForEvent(tab, "TabAttrModified", false, (event) => {
return BrowserTestUtils.waitForEvent(tab, "TabAttrModified", false, (event) => {
if (event.detail.changed.includes("soundplaying")) {
is(tab.hasAttribute("soundplaying"), expectPlaying, "The tab should " + (expectPlaying ? "" : "not ") + "be playing");
is(tab.soundPlaying, expectPlaying, "The tab should " + (expectPlaying ? "" : "not ") + "be playing");
Expand Down Expand Up @@ -53,8 +53,6 @@ async function pause(tab, options) {
let browser = tab.linkedBrowser;
let awaitDOMAudioPlaybackStopped =
BrowserTestUtils.waitForEvent(browser, "DOMAudioPlaybackStopped", "DOMAudioPlaybackStopped event should get fired after pause");
let awaitTabPausedAttrModified =
wait_for_tab_playing_event(tab, false);
await ContentTask.spawn(browser, {}, async function() {
let audio = content.document.querySelector("audio");
audio.pause();
Expand All @@ -73,7 +71,7 @@ async function pause(tab, options) {
ok(tab.hasAttribute("soundplaying"), "The tab should still have the soundplaying attribute immediately after DOMAudioPlaybackStopped");
}

await awaitTabPausedAttrModified;
await wait_for_tab_playing_event(tab, false);
ok(!tab.hasAttribute("soundplaying"), "The tab should not have the soundplaying attribute after the timeout has resolved");
} finally {
// Make sure other tests don't timeout if an exception gets thrown above.
Expand Down
21 changes: 1 addition & 20 deletions browser/components/nsBrowserGlue.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ XPCOMUtils.defineLazyGetter(this, "WeaveService", () =>
PageThumbs:false, PdfJs:false, PermissionUI:false, PlacesBackups:false,
PlacesUtils:false, PluralForm:false, PrivateBrowsingUtils:false,
ProcessHangMonitor:false, ReaderParent:false, RecentWindow:false,
RemotePrompt:false, SelfSupportBackend:false, SessionStore:false,
RemotePrompt:false, SessionStore:false,
ShellService:false, SimpleServiceDiscovery:false, TabCrashHandler:false,
Task:false, UITour:false, WebChannel:false,
WindowsRegistry:false, webrtcUI:false, UserAgentOverrides: false */
Expand Down Expand Up @@ -83,7 +83,6 @@ let initializedModules = {};
["ReaderParent", "resource:///modules/ReaderParent.jsm"],
["RecentWindow", "resource:///modules/RecentWindow.jsm"],
["RemotePrompt", "resource:///modules/RemotePrompt.jsm"],
["SelfSupportBackend", "resource:///modules/SelfSupportBackend.jsm", "init"],
["SessionStore", "resource:///modules/sessionstore/SessionStore.jsm"],
["ShellService", "resource:///modules/ShellService.jsm"],
["SimpleServiceDiscovery", "resource://gre/modules/SimpleServiceDiscovery.jsm"],
Expand Down Expand Up @@ -126,10 +125,6 @@ XPCOMUtils.defineLazyGetter(this, "gBrowserBundle", function() {
const global = this;

const listeners = {
observers: {
"sessionstore-windows-restored": ["SelfSupportBackend"],
},

ppmm: {
// PLEASE KEEP THIS LIST IN SYNC WITH THE LISTENERS ADDED IN ContentPrefServiceParent.init
"ContentPrefs:FunctionCall": ["ContentPrefServiceParent"],
Expand Down Expand Up @@ -171,16 +166,6 @@ const listeners = {
"webrtc:UpdateBrowserIndicators": ["webrtcUI"],
},

observe(subject, topic, data) {
for (let module of this.observers[topic]) {
try {
this[module].observe(subject, topic, data);
} catch (e) {
Cu.reportError(e);
}
}
},

receiveMessage(modules, data) {
let val;
for (let module of modules[data.name]) {
Expand All @@ -194,10 +179,6 @@ const listeners = {
},

init() {
for (let observer of Object.keys(this.observers)) {
Services.obs.addObserver(this, observer);
}

let receiveMessageMM = this.receiveMessage.bind(this, this.mm);
for (let message of Object.keys(this.mm)) {
Services.mm.addMessageListener(message, receiveMessageMM);
Expand Down
2 changes: 1 addition & 1 deletion browser/components/sessionstore/SessionStore.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -2646,7 +2646,7 @@ var SessionStoreInternal = {
// If the page has a title, set it.
if (activePageData) {
if (activePageData.title) {
win.gBrowser.setInitialTabTitle(tab, activePageData.title);
win.gBrowser.setInitialTabTitle(tab, activePageData.title, { isContentTitle: true });
} else if (activePageData.url != "about:blank") {
win.gBrowser.setInitialTabTitle(tab, activePageData.url);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ add_task(async function() {
isnot(CONTENT_TITLE.length, 0, "content title isn't empty");
isnot(CONTENT_TITLE, TEST_URL, "content title is different from the URL");
is(firstTab.label, CONTENT_TITLE, "first tab displays content title");
ok(document.title.startsWith(CONTENT_TITLE), "title bar displays content title");
ok(secondTab.hasAttribute("pending"), "second tab is pending");
is(secondTab.label, TEST_URL, "second tab displays URL as its title");

Expand All @@ -60,21 +61,24 @@ add_task(async function() {
gBrowser.selectedTab = secondTab;
await browserLoadedPromise;
ok(!secondTab.hasAttribute("pending"), "second tab isn't pending anymore");
is(gBrowser.selectedTab.label, CONTENT_TITLE, "second tab displays content title");
is(secondTab.label, CONTENT_TITLE, "second tab displays content title");
ok(document.title.startsWith(CONTENT_TITLE), "title bar displays content title");
checkLabelChangeCount(1);

info("restoring the modified browser state");
await TabStateFlusher.flushWindow(window);
await promiseBrowserState(SessionStore.getBrowserState());
[firstTab, secondTab] = gBrowser.tabs;
is(secondTab, gBrowser.selectedTab, "second tab is selected after restoring");
ok(document.title.startsWith(CONTENT_TITLE), "title bar displays content title");
ok(firstTab.hasAttribute("pending"), "first tab is pending after restoring");
is(firstTab.label, CONTENT_TITLE, "first tab displays content title in pending state");

info("selecting the first tab");
checkLabelChangeCount = observeLabelChanges(firstTab);
let tabContentRestored = TestUtils.topicObserved("sessionstore-debug-tab-restored");
gBrowser.selectedTab = firstTab;
ok(document.title.startsWith(CONTENT_TITLE), "title bar displays content title");
await tabContentRestored;
ok(!firstTab.hasAttribute("pending"), "first tab isn't pending anymore");
checkLabelChangeCount(0);
Expand Down
3 changes: 2 additions & 1 deletion browser/locales/en-US/chrome/browser/browser.dtd
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,8 @@ you can use these alternative items. Otherwise, their values should be empty. -
<!ENTITY fullZoom.label "Zoom">
<!ENTITY fullZoom.accesskey "Z">

<!ENTITY sidebarCloseButton.tooltip "Close Sidebar">
<!ENTITY sidebarCloseButton.tooltip "Close sidebar">
<!ENTITY sidebarMenuClose.label "Close Sidebar">

<!ENTITY quitApplicationCmdWin2.label "Exit">
<!ENTITY quitApplicationCmdWin2.accesskey "x">
Expand Down
Loading

0 comments on commit 8b07ba2

Please sign in to comment.