Skip to content

Commit

Permalink
merge autoland to mozilla-central. r=merge a=merge
Browse files Browse the repository at this point in the history
MozReview-Commit-ID: 9SALJlvWgoZ
  • Loading branch information
Archaeopteryx committed Sep 13, 2017
2 parents a0b4d71 + fc7ba35 commit 6ac6001
Show file tree
Hide file tree
Showing 423 changed files with 5,851 additions and 2,719 deletions.
10 changes: 10 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,13 @@ BinPackArguments: false
BinPackParameters: false
SpaceAfterTemplateKeyword: false
ReflowComments: false


BreakBeforeBraces: Custom
BraceWrapping:
AfterEnum: true
AfterStruct: true
AfterFunction: true
AfterClass: true
SplitEmptyFunction: true

6 changes: 6 additions & 0 deletions browser/app/profile/firefox.js
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,10 @@ pref("browser.download.animateNotifications", true);
// This records whether or not the panel has been shown at least once.
pref("browser.download.panel.shown", false);

// This controls whether the button is automatically shown/hidden depending
// on whether there are downloads to show.
pref("browser.download.autohideButton", true);

#ifndef XP_MACOSX
pref("browser.helperApps.deleteTempFileOnExit", true);
#endif
Expand Down Expand Up @@ -1266,6 +1270,7 @@ pref("browser.newtabpage.directory.source", "https://tiles.services.mozilla.com/

// activates Activity Stream
pref("browser.newtabpage.activity-stream.enabled", true);
pref("browser.newtabpage.activity-stream.prerender", true);
pref("browser.newtabpage.activity-stream.aboutHome.enabled", false);

// Enable the DOM fullscreen API.
Expand Down Expand Up @@ -1716,6 +1721,7 @@ pref("browser.suppress_first_window_animation", true);
pref("browser.onboarding.enabled", true);
// Mark this as an upgraded profile so we don't offer the initial new user onboarding tour.
pref("browser.onboarding.tourset-version", 2);
pref("browser.onboarding.state", "default");
// On the Activity-Stream page, the snippet's position overlaps with our notification.
// So use `browser.onboarding.notification.finished` to let the AS page know
// if our notification is finished and safe to show their snippet.
Expand Down
2 changes: 0 additions & 2 deletions browser/base/content/browser-customization.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ var CustomizationHandler = {
UpdateUrlbarSearchSplitterState();

PlacesToolbarHelper.customizeStart();
DownloadsButton.customizeStart();
},

_customizationEnding(aDetails) {
Expand All @@ -63,7 +62,6 @@ var CustomizationHandler = {
}

PlacesToolbarHelper.customizeDone();
DownloadsButton.customizeDone();

UpdateUrlbarSearchSplitterState();

Expand Down
58 changes: 45 additions & 13 deletions browser/base/content/browser.css
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ panelview:not([mainview]):not([current]) {
visibility: collapse;
}

photonpanelmultiview panelview:not([current]) {
transition: none;
visibility: collapse;
}

panelview[mainview] > .panel-header,
panelview:not([title]) > .panel-header {
display: none;
Expand Down Expand Up @@ -518,10 +523,9 @@ toolbar:not(#TabsToolbar) > #personal-bookmarks {

/* ::::: location bar & search bar ::::: */

#urlbar-container {
min-width: 50ch;
}

/* url bar min-width is defined further down, together with the maximum size
* of the identity icon block, for different window sizes.
*/
#search-container {
min-width: 25ch;
}
Expand Down Expand Up @@ -701,39 +705,67 @@ html|input.urlbar-input[textoverflow]:not([focused]) {
-moz-user-focus: ignore;
}


/* We leave 49ch plus whatever space the download button will need when it
* appears. Normally this should be 16px for the icon, plus 2 * 2px padding
* plus the toolbarbutton-inner-padding. We're adding 4px to ensure things
* like rounding on hidpi don't accidentally result in the button going
* into overflow.
*/
#urlbar-container {
min-width: calc(49ch + 24px + 2 * var(--toolbarbutton-inner-padding));
}

#nav-bar[downloadsbuttonshown] #urlbar-container {
min-width: 49ch;
}

#identity-icon-labels {
max-width: 18em;
max-width: 17em;
}
@media (max-width: 700px) {
#urlbar-container {
min-width: 45ch;
min-width: calc(44ch + 24px + 2 * var(--toolbarbutton-inner-padding));
}
#nav-bar[downloadsbuttonshown] #urlbar-container {
min-width: 44ch;
}

#identity-icon-labels {
max-width: 70px;
max-width: 60px;
}
}
@media (max-width: 600px) {
#urlbar-container {
min-width: 40ch;
min-width: calc(39ch + 24px + 2 * var(--toolbarbutton-inner-padding));
}
#nav-bar[downloadsbuttonshown] #urlbar-container {
min-width: 39ch;
}
#identity-icon-labels {
max-width: 60px;
max-width: 50px;
}
}
@media (max-width: 500px) {
#urlbar-container {
min-width: 35ch;
min-width: calc(34ch + 24px + 2 * var(--toolbarbutton-inner-padding));
}
#nav-bar[downloadsbuttonshown] #urlbar-container {
min-width: 34ch;
}
#identity-icon-labels {
max-width: 50px;
max-width: 40px;
}
}
@media (max-width: 400px) {
#urlbar-container {
min-width: 28ch;
min-width: calc(27ch + 24px + 2 * var(--toolbarbutton-inner-padding));
}
#nav-bar[downloadsbuttonshown] #urlbar-container {
min-width: 27ch;
}
#identity-icon-labels {
max-width: 40px;
max-width: 30px;
}
}

Expand Down
6 changes: 6 additions & 0 deletions browser/base/content/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -1321,6 +1321,10 @@ var gBrowserInit = {

SidebarUI.init();

// We do this in onload because we want to ensure the button's state
// doesn't flicker as the window is being shown.
DownloadsButton.init();

// Certain kinds of automigration rely on this notification to complete
// their tasks BEFORE the browser window is shown. SessionStore uses it to
// restore tabs into windows AFTER important parts like gMultiProcessBrowser
Expand Down Expand Up @@ -1847,6 +1851,8 @@ var gBrowserInit = {

SidebarUI.uninit();

DownloadsButton.uninit();

// Now either cancel delayedStartup, or clean up the services initialized from
// it.
if (this._boundDelayedStartup) {
Expand Down
2 changes: 2 additions & 0 deletions browser/base/content/browser.xul
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,9 @@
ondragenter="DownloadsIndicatorView.onDragOver(event);"
label="&downloads.label;"
removable="true"
overflows="false"
cui-areatype="toolbar"
hidden="true"
tooltip="dynamic-shortcut-tooltip"/>

<toolbarbutton id="library-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
Expand Down
16 changes: 13 additions & 3 deletions browser/base/content/test/general/browser_documentnavigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ async function expectFocusOnF6(backward, expectedDocument, expectedElement, onCo
}

is(fm.focusedWindow.document.documentElement.id, expectedDocument, desc + " document matches");
is(fm.focusedElement, expectedElement, desc + " element matches");
is(fm.focusedElement, expectedElement, desc + " element matches (wanted: " + expectedElement.id + " got: " + fm.focusedElement.id + ")");

if (onContent) {
window.messageManager.removeMessageListener("BrowserTest:FocusChanged", focusChangedListener);
Expand Down Expand Up @@ -171,8 +171,9 @@ add_task(async function() {
});

// Navigate when the downloads panel is open
add_task(async function() {
await pushPrefs(["accessibility.tabfocus", 7]);
add_task(async function test_download_focus() {
await pushPrefs(["accessibility.tabfocus", 7], ["browser.download.autohideButton", false]);
await promiseButtonShown("downloads-button");

let popupShownPromise = BrowserTestUtils.waitForEvent(document, "popupshown", true);
EventUtils.synthesizeMouseAtCenter(document.getElementById("downloads-button"), { });
Expand Down Expand Up @@ -253,3 +254,12 @@ add_task(async function() {
});

// XXXndeakin add tests for browsers inside of panels

function promiseButtonShown(id) {
let dwu = window.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
return BrowserTestUtils.waitForCondition(() => {
let target = document.getElementById(id);
let bounds = dwu.getBoundsWithoutFlushing(target);
return bounds.width > 0 && bounds.height > 0;
}, `Waiting for button ${id} to have non-0 size`);
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const EXPECTED_APPMENU_SUBVIEW_REFLOWS = [
{
stack: [
"descriptionHeightWorkaround@resource:///modules/PanelMultiView.jsm",
"onTransitionEnd@resource:///modules/PanelMultiView.jsm",
"_cleanupTransitionPhase@resource:///modules/PanelMultiView.jsm",
],

times: 2, // This number should only ever go down - never up.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,6 @@ var whitelist = [
{file: "resource://app/modules/NewTabSearchProvider.jsm"},
{file: "resource://app/modules/NewTabWebChannel.jsm"},

// browser/extensions/activity-stream/data/content/activity-stream-prerendered.html
// This will used when Bug 1397875 lands
{file: "resource://activity-stream/data/content/activity-stream-prerendered.html"},

// layout/mathml/nsMathMLChar.cpp
{file: "resource://gre/res/fonts/mathfontSTIXGeneral.properties"},
{file: "resource://gre/res/fonts/mathfontUnicode.properties"},
Expand Down
10 changes: 5 additions & 5 deletions browser/base/content/test/urlbar/browser_dragdropURL.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ const DRAG_WORD = "Firefox";
add_task(async function checkDragURL() {
await BrowserTestUtils.withNewTab(TEST_URL, function(browser) {
// Have to use something other than the URL bar as a source, so picking the
// downloads button somewhat arbitrarily:
EventUtils.synthesizeDrop(document.getElementById("downloads-button"), gURLBar,
// home button somewhat arbitrarily:
EventUtils.synthesizeDrop(document.getElementById("home-button"), gURLBar,
[[{type: "text/plain", data: DRAG_URL}]], "copy", window);
is(gURLBar.value, TEST_URL, "URL bar value should not have changed");
is(gBrowser.selectedBrowser.userTypedValue, null, "Stored URL bar value should not have changed");
Expand All @@ -19,19 +19,19 @@ add_task(async function checkDragURL() {

add_task(async function checkDragForbiddenURL() {
await BrowserTestUtils.withNewTab(TEST_URL, function(browser) {
EventUtils.synthesizeDrop(document.getElementById("downloads-button"), gURLBar,
EventUtils.synthesizeDrop(document.getElementById("home-button"), gURLBar,
[[{type: "text/plain", data: DRAG_FORBIDDEN_URL}]], "copy", window);
isnot(gURLBar.value, DRAG_FORBIDDEN_URL, "Shouldn't be allowed to drop forbidden URL on URL bar");
});
});

add_task(async function checkDragText() {
await BrowserTestUtils.withNewTab(TEST_URL, function(browser) {
EventUtils.synthesizeDrop(document.getElementById("downloads-button"), gURLBar,
EventUtils.synthesizeDrop(document.getElementById("home-button"), gURLBar,
[[{type: "text/plain", data: DRAG_TEXT}]], "copy", window);
is(gURLBar.value, DRAG_TEXT, "Dragging normal text should replace the URL bar value");

EventUtils.synthesizeDrop(document.getElementById("downloads-button"), gURLBar,
EventUtils.synthesizeDrop(document.getElementById("home-button"), gURLBar,
[[{type: "text/plain", data: DRAG_WORD}]], "copy", window);
is(gURLBar.value, DRAG_WORD, "Dragging a single word should replace the URL bar value");
});
Expand Down
15 changes: 8 additions & 7 deletions browser/base/content/urlbarBindings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
allowevents="true"
inputmode="url"
xbl:inherits="tooltiptext=inputtooltiptext,value,maxlength,disabled,size,readonly,placeholder,tabindex,accesskey,focused,textoverflow"/>
<xul:image anonid="urlbar-go-button"
class="urlbar-go-button urlbar-icon"
onclick="gURLBar.handleCommand(event);"
tooltiptext="&goEndCap.tooltip;"
xbl:inherits="pageproxystate,parentfocused=focused,usertyping"/>
</xul:hbox>
<xul:image anonid="urlbar-go-button"
class="urlbar-go-button urlbar-icon"
onclick="gURLBar.handleCommand(event);"
tooltiptext="&goEndCap.tooltip;"
xbl:inherits="pageproxystate,parentfocused=focused,usertyping"/>
<xul:dropmarker anonid="historydropmarker"
class="autocomplete-history-dropmarker urlbar-history-dropmarker urlbar-icon"
tooltiptext="&urlbar.openHistoryPopup.tooltip;"
Expand Down Expand Up @@ -1943,9 +1943,10 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
// Position the popup below the navbar. To get the y-coordinate,
// which is an offset from the bottom of the input, subtract the
// bottom of the navbar from the buttom of the input.
let yOffset =
let yOffset = Math.round(
this.DOMWindowUtils.getBoundsWithoutFlushing(document.getElementById("nav-bar")).bottom -
this.DOMWindowUtils.getBoundsWithoutFlushing(aInput).bottom;
this.DOMWindowUtils.getBoundsWithoutFlushing(aInput).bottom);

this.openPopup(aElement, "after_start", 0, yOffset, false, false);
]]></body>
</method>
Expand Down
Loading

0 comments on commit 6ac6001

Please sign in to comment.