Skip to content

Commit

Permalink
merge mozilla-central to mozilla-inbound. r=merge a=merge on a CLOSED…
Browse files Browse the repository at this point in the history
… TREE
  • Loading branch information
Archaeopteryx committed Oct 5, 2017
2 parents aeb75e2 + 3ecafc4 commit ab63891
Show file tree
Hide file tree
Showing 237 changed files with 3,442 additions and 1,584 deletions.
6 changes: 5 additions & 1 deletion browser/app/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ clean clobber repackage::
MAC_BUNDLE_VERSION = $(shell $(PYTHON) $(srcdir)/macversion.py --version=$(MOZ_APP_VERSION) --buildid=$(DEPTH)/buildid.h)

.PHONY: repackage
tools repackage:: $(DIST)/bin/$(MOZ_APP_NAME)
tools repackage:: $(DIST)/bin/$(MOZ_APP_NAME) features
rm -rf $(dist_dest)
$(MKDIR) -p $(dist_dest)/Contents/MacOS
$(MKDIR) -p $(dist_dest)/$(LPROJ)
Expand All @@ -104,3 +104,7 @@ ifdef MOZ_UPDATER
endif
printf APPLMOZB > $(dist_dest)/Contents/PkgInfo
endif

.PHONY: features
tools features::
$(PYTHON) -c 'import os, json; listing = {"system": os.listdir("$(DIST)/bin/browser/features")}; print json.dumps(listing)' > $(DIST)/bin/browser/chrome/browser/content/browser/built_in_addons.json
8 changes: 4 additions & 4 deletions browser/app/nsBrowserApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,9 @@ static int do_main(int argc, char* argv[], char* envp[])
}

static nsresult
InitXPCOMGlue(const char *argv0)
InitXPCOMGlue()
{
UniqueFreePtr<char> exePath = BinaryPath::Get(argv0);
UniqueFreePtr<char> exePath = BinaryPath::Get();
if (!exePath) {
Output("Couldn't find the application directory.\n");
return NS_ERROR_FAILURE;
Expand Down Expand Up @@ -272,7 +272,7 @@ int main(int argc, char* argv[], char* envp[])
}
#endif

nsresult rv = InitXPCOMGlue(argv[0]);
nsresult rv = InitXPCOMGlue();
if (NS_FAILED(rv)) {
return 255;
}
Expand All @@ -290,7 +290,7 @@ int main(int argc, char* argv[], char* envp[])
DllBlocklist_Initialize();
#endif

nsresult rv = InitXPCOMGlue(argv[0]);
nsresult rv = InitXPCOMGlue();
if (NS_FAILED(rv)) {
return 255;
}
Expand Down
1 change: 1 addition & 0 deletions browser/base/content/browser-sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,7 @@ var gSync = {
}
const state = UIState.get();
if (state.status == UIState.STATUS_SIGNED_IN) {
this.updateSyncStatus({ syncing: true });
setTimeout(() => Weave.Service.errorHandler.syncAndReportErrors(), 0);
}
},
Expand Down
8 changes: 4 additions & 4 deletions browser/base/content/browser.css
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ tabbrowser {
}

#tabbrowser-tabs:not([overflow="true"]) ~ #alltabs-button,
#tabbrowser-tabs:not([overflow="true"]) + #new-tab-button,
#tabbrowser-tabs[hasadjacentnewtabbutton]:not([overflow="true"]) ~ #new-tab-button,
#tabbrowser-tabs[overflow="true"] > .tabbrowser-arrowscrollbox > .tabs-newtab-button,
#TabsToolbar[currentset]:not([currentset*="tabbrowser-tabs,new-tab-button"]) > #tabbrowser-tabs > .tabbrowser-arrowscrollbox > .tabs-newtab-button,
#tabbrowser-tabs:not([hasadjacentnewtabbutton]) > .tabbrowser-arrowscrollbox > .tabs-newtab-button,
#TabsToolbar[customizing="true"] > #tabbrowser-tabs > .tabbrowser-arrowscrollbox > .tabs-newtab-button {
visibility: collapse;
}
Expand Down Expand Up @@ -1250,7 +1250,7 @@ toolbarpaletteitem[place="palette"] > #downloads-button[indicator] > #downloads-
}

#customization-panelHolder > #widget-overflow-fixed-list {
flex: 0 1 auto; /* Size to content, but allow ourselves to shrink */
flex: 1 1 auto; /* Grow within the available space, and allow ourselves to shrink */
display: flex;
flex-direction: column;
overflow-y: auto;
Expand All @@ -1262,7 +1262,7 @@ toolbarpaletteitem[place="palette"] > #downloads-button[indicator] > #downloads-
#customization-panelHolder {
flex-direction: column;
display: flex;
min-height: 0;
min-height: calc(174px + 8em);
}

#customization-panelWrapper {
Expand Down
10 changes: 9 additions & 1 deletion browser/base/content/nsContextMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ function openContextMenu(aMessage) {
let browser = aMessage.target;
let spellInfo = data.spellInfo;

// ContextMenu.jsm sends us the target as a CPOW only so that
// we can send that CPOW back down to the content process and
// have it resolve to a DOM node. The parent should not attempt
// to access any properties on this CPOW (in fact, doing so
// will throw an exception).
data.context.targetAsCPOW = aMessage.objects.targetAsCPOW;

if (spellInfo) {
spellInfo.target = aMessage.target.messageManager;
}
Expand Down Expand Up @@ -204,6 +211,7 @@ nsContextMenu.prototype = {
this.onVideo = context.onVideo;

this.target = this.isRemote ? context.target : document.popupNode;
this.targetAsCPOW = context.targetAsCPOW;

this.principal = context.principal;
this.frameOuterWindowID = context.frameOuterWindowID;
Expand Down Expand Up @@ -717,7 +725,7 @@ nsContextMenu.prototype = {
return;
}
let documentURI = gContextMenuContentData.documentURIObject;
let fragment = LoginManagerContextMenu.addLoginsToMenu(this.target, this.browser, documentURI);
let fragment = LoginManagerContextMenu.addLoginsToMenu(this.targetAsCPOW, this.browser, documentURI);

this.showItem("fill-login-no-logins", !fragment);

Expand Down
49 changes: 49 additions & 0 deletions browser/base/content/tabbrowser.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5827,6 +5827,50 @@
]]></body>
</method>

<method name="_updateNewTabVisibility">
<body><![CDATA[
let sib = this.tabContainer.nextElementSibling;
while (sib && sib.hidden) {
sib = sib.nextElementSibling;
}
const kAttr = "hasadjacentnewtabbutton";
if (sib && sib.id == "new-tab-button") {
this.tabContainer.setAttribute(kAttr, "true");
} else {
this.tabContainer.removeAttribute(kAttr);
}
]]></body>
</method>

<method name="onWidgetAfterDOMChange">
<parameter name="aNode"/>
<parameter name="aNextNode"/>
<parameter name="aContainer"/>
<body><![CDATA[
if (aContainer.ownerDocument == document &&
aContainer.id == "TabsToolbar") {
this._updateNewTabVisibility();
}
]]></body>
</method>
<method name="onAreaNodeRegistered">
<parameter name="aArea"/>
<parameter name="aContainer"/>
<body><![CDATA[
if (aContainer.ownerDocument == document &&
aArea == "TabsToolbar") {
this._updateNewTabVisibility();
}
]]></body>
</method>
<method name="onAreaReset">
<parameter name="aArea"/>
<parameter name="aContainer"/>
<body><![CDATA[
this.onAreaNodeRegistered(aArea, aContainer);
]]></body>
</method>

<field name="_tabMinWidthLimit">50</field>
<property name="tabMinWidth">
<setter><![CDATA[
Expand All @@ -5841,6 +5885,9 @@
this.mCurrentBrowser = document.getAnonymousElementByAttribute(this, "anonid", "initialBrowser");
this.mCurrentBrowser.permanentKey = {};
CustomizableUI.addListener(this);
this._updateNewTabVisibility();
Services.obs.addObserver(this, "contextual-identity-updated");
this.mCurrentTab = this.tabContainer.firstChild;
Expand Down Expand Up @@ -5957,6 +6004,8 @@
<![CDATA[
Services.obs.removeObserver(this, "contextual-identity-updated");
CustomizableUI.removeListener(this);
for (let tab of this.tabs) {
let browser = tab.linkedBrowser;
if (browser.registeredOpenURI) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</box>
<box class="panel-arrowcontent" side="top" flex="1">
<vbox id="customization-panelHolder">
<description id="customization-panelHeader">&customizeMode.overflowList.title;</description>
<description id="customization-panelHeader">&customizeMode.overflowList.title2;</description>
<description id="customization-panelDescription">&customizeMode.overflowList.description;</description>
</vbox>
<box class="panel-inner-arrowcontentfooter" hidden="true"/>
Expand Down
67 changes: 27 additions & 40 deletions browser/components/customizableui/test/browser_synced_tabs_menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
requestLongerTimeout(2);

let {SyncedTabs} = Cu.import("resource://services-sync/SyncedTabs.jsm", {});
let {UIState} = Cu.import("resource://services-sync/UIState.jsm", {});

XPCOMUtils.defineLazyModuleGetter(this, "UITour", "resource:///modules/UITour.jsm");

Expand Down Expand Up @@ -42,18 +43,16 @@ add_task(async function setup() {
let oldInternal = SyncedTabs._internal;
SyncedTabs._internal = mockedInternal;

// This test hacks some observer states to simulate a user being signed
// in to Sync - restore them when the test completes.
let initialObserverStates = {};
for (let id of ["sync-reauth-state", "sync-setup-state", "sync-syncnow-state"]) {
initialObserverStates[id] = document.getElementById(id).hidden;
}
let origNotifyStateUpdated = UIState._internal.notifyStateUpdated;
// Sync start-up will interfere with our tests, don't let UIState send UI updates.
UIState._internal.notifyStateUpdated = () => {};

// Force gSync initialization
gSync.init();

registerCleanupFunction(() => {
UIState._internal.notifyStateUpdated = origNotifyStateUpdated;
SyncedTabs._internal = oldInternal;
for (let [id, initial] of Object.entries(initialObserverStates)) {
document.getElementById(id).hidden = initial;
}
});
});

Expand Down Expand Up @@ -135,19 +134,14 @@ async function asyncCleanup() {

// When Sync is not setup.
add_task(async function() {
document.getElementById("sync-reauth-state").hidden = true;
document.getElementById("sync-setup-state").hidden = false;
document.getElementById("sync-syncnow-state").hidden = true;
await openPrefsFromMenuPanel("PanelUI-remotetabs-setupsync", "synced-tabs")
gSync.updateAllUI({ status: UIState.STATUS_NOT_CONFIGURED });
await openPrefsFromMenuPanel("PanelUI-remotetabs-setupsync", "synced-tabs");
});
add_task(asyncCleanup);

// When Sync is configured in a "needs reauthentication" state.
add_task(async function() {
// configure our broadcasters so we are in the right state.
document.getElementById("sync-reauth-state").hidden = false;
document.getElementById("sync-setup-state").hidden = true;
document.getElementById("sync-syncnow-state").hidden = true;
gSync.updateAllUI({ status: UIState.STATUS_LOGIN_FAILED, email: "[email protected]" });
await openPrefsFromMenuPanel("PanelUI-remotetabs-reauthsync", "synced-tabs")
});

Expand All @@ -157,9 +151,7 @@ add_task(async function() {
Services.prefs.setCharPref("identity.mobilepromo.android", "http://example.com/?os=android&tail=");
Services.prefs.setCharPref("identity.mobilepromo.ios", "http://example.com/?os=ios&tail=");

document.getElementById("sync-reauth-state").hidden = true;
document.getElementById("sync-setup-state").hidden = true;
document.getElementById("sync-syncnow-state").hidden = false;
gSync.updateAllUI({ status: UIState.STATUS_SIGNED_IN, email: "[email protected]" });

let syncPanel = document.getElementById("PanelUI-remotetabs");
let links = syncPanel.querySelectorAll(".remotetabs-promo-link");
Expand Down Expand Up @@ -210,10 +202,7 @@ add_task(async function() {

// Test the "Sync Now" button
add_task(async function() {
// configure our broadcasters so we are in the right state.
document.getElementById("sync-reauth-state").hidden = true;
document.getElementById("sync-setup-state").hidden = true;
document.getElementById("sync-syncnow-state").hidden = false;
gSync.updateAllUI({ status: UIState.STATUS_SIGNED_IN, email: "[email protected]" });

await document.getElementById("nav-bar").overflowable.show();
let tabsUpdatedPromise = promiseObserverNotified("synced-tabs-menu:test:tabs-updated");
Expand All @@ -232,22 +221,11 @@ add_task(async function() {
// provides them
is(deck.selectedIndex, DECKINDEX_FETCHING, "first deck entry is visible");

let syncNowButton = document.getElementById("PanelUI-remotetabs-syncnow");

let didSync = false;
let oldDoSync = gSync.doSync;
gSync.doSync = function() {
didSync = true;
mockedInternal.hasSyncedThisSession = true;
gSync.doSync = oldDoSync;
}
syncNowButton.click();
ok(didSync, "clicking the button called the correct function");

// Tell the widget there are tabs available, but with zero clients.
mockedInternal.getTabClients = () => {
return Promise.resolve([]);
}
mockedInternal.hasSyncedThisSession = true;
await updateTabsPanel();
// The UI should be showing the "no clients" pane.
is(deck.selectedIndex, DECKINDEX_NOCLIENTS, "no-clients deck entry is visible");
Expand Down Expand Up @@ -349,6 +327,18 @@ add_task(async function() {
node = node.nextSibling;
is(node, null, "no more entries");

let didSync = false;
let oldDoSync = gSync.doSync;
gSync.doSync = function() {
didSync = true;
gSync.doSync = oldDoSync;
}

let syncNowButton = document.getElementById("PanelUI-remotetabs-syncnow");
is(syncNowButton.disabled, false);
syncNowButton.click();
ok(didSync, "clicking the button called the correct function");

await hideOverflow();
});

Expand All @@ -375,10 +365,7 @@ add_task(async function() {
]);
};

// configure our broadcasters so we are in the right state.
document.getElementById("sync-reauth-state").hidden = true;
document.getElementById("sync-setup-state").hidden = true;
document.getElementById("sync-syncnow-state").hidden = false;
gSync.updateAllUI({ status: UIState.STATUS_SIGNED_IN, email: "[email protected]" });

await document.getElementById("nav-bar").overflowable.show();
let tabsUpdatedPromise = promiseObserverNotified("synced-tabs-menu:test:tabs-updated");
Expand Down
3 changes: 1 addition & 2 deletions browser/extensions/formautofill/ProfileStorage.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -341,15 +341,14 @@ class AutofillRecords {
} else {
this._ensureMatchingVersion(record);
recordToSave = record;
this._computeFields(recordToSave);
}

if (sourceSync) {
let sync = this._getSyncMetaData(recordToSave, true);
sync.changeCounter = 0;
}

this._computeFields(recordToSave);

this._store.data[this._collectionName].push(recordToSave);

this._store.saveSoon();
Expand Down
1 change: 1 addition & 0 deletions browser/extensions/formautofill/test/browser/head.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ async function clickDoorhangerButton(button, index) {
EventUtils.synthesizeMouseAtCenter(getNotification()[button], {});
} else if (button == MENU_BUTTON) {
// Click the dropmarker arrow and wait for the menu to show up.
await BrowserTestUtils.waitForCondition(() => getNotification().menubutton);
await sleep(); // menubutton needs extra time for binding
let notification = getNotification();
ok(notification.menubutton, "notification menupopup displayed");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ support-files =
[test_basic_autocomplete_form.html]
[test_basic_creditcard_autocomplete_form.html]
scheme=https
skip-if = debug # Bug 1401454
[test_formautofill_preview_highlight.html]
[test_multiple_forms.html]
[test_on_address_submission.html]
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ add_storage_task(async function test_simple_synctombstone(storage, record) {
Assert.equal(all.length, 1);

do_check_tombstone_record(all[0]);

// a tombstone got from API should look exactly the same as it got from the
// disk (besides "_sync").
let tombstoneInDisk = Object.assign({}, storage._store.data[storage._collectionName][0]);
delete tombstoneInDisk._sync;
do_check_tombstone_record(tombstoneInDisk);
});

add_storage_task(async function test_add_tombstone(storage, record) {
Expand All @@ -108,6 +114,12 @@ add_storage_task(async function test_add_tombstone(storage, record) {
Assert.equal(all.length, 1);

do_check_tombstone_record(all[0]);

// a tombstone got from API should look exactly the same as it got from the
// disk (besides "_sync").
let tombstoneInDisk = Object.assign({}, storage._store.data[storage._collectionName][0]);
delete tombstoneInDisk._sync;
do_check_tombstone_record(tombstoneInDisk);
});

add_storage_task(async function test_add_tombstone_without_guid(storage, record) {
Expand Down
2 changes: 1 addition & 1 deletion browser/locales/en-US/chrome/browser/browser.dtd
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ you can use these alternative items. Otherwise, their values should be empty. -
<!ENTITY customizeMode.lwthemes.menuManage.accessKey "M">
<!ENTITY customizeMode.lwthemes.menuGetMore "Get More Themes">
<!ENTITY customizeMode.lwthemes.menuGetMore.accessKey "G">
<!ENTITY customizeMode.overflowList.title "Overflow Panel">
<!ENTITY customizeMode.overflowList.title2 "Overflow Menu">
<!ENTITY customizeMode.overflowList.description "Drag and drop items here to keep them within reach but out of your toolbar…">
<!ENTITY customizeMode.uidensity "Density">
<!-- LOCALIZATION NOTE (customizeMode.uidensity.menuNormal.*):
Expand Down
Loading

0 comments on commit ab63891

Please sign in to comment.