diff --git a/browser/base/content/test/social/browser_chat_tearoff.js b/browser/base/content/test/social/browser_chat_tearoff.js index 87fd31e8f50..5906f73d8c3 100644 --- a/browser/base/content/test/social/browser_chat_tearoff.js +++ b/browser/base/content/test/social/browser_chat_tearoff.js @@ -56,6 +56,7 @@ var tests = { doc.body.appendChild(div); let swap = document.getAnonymousElementByAttribute(chats.selectedChat, "anonid", "swap"); swap.click(); + port.close(); break; case "got-chatbox-message": ok(true, "got chatbox message"); @@ -73,13 +74,16 @@ var tests = { .getInterface(Components.interfaces.nsIDOMWindow); Services.wm.removeListener(this); // wait for load to ensure the window is ready for us to test - domwindow.addEventListener("load", function _load() { + domwindow.addEventListener("load", function _load(event) { let doc = domwindow.document; - if (doc.location.href != "chrome://browser/content/chatWindow.xul") - return; + if (event.target != doc) + return; + domwindow.removeEventListener("load", _load, false); - domwindow.addEventListener("unload", function _close() { + domwindow.addEventListener("unload", function _close(event) { + if (event.target != doc) + return; domwindow.removeEventListener("unload", _close, false); info("window has been closed"); waitForCondition(function() { @@ -160,13 +164,15 @@ var tests = { Services.wm.removeListener(this); // wait for load to ensure the window is ready for us to test, make sure // we're not getting called for about:blank - domwindow.addEventListener("load", function _load() { + domwindow.addEventListener("load", function _load(event) { let doc = domwindow.document; - if (doc.location.href != "chrome://browser/content/chatWindow.xul") - return; + if (event.target != doc) + return; domwindow.removeEventListener("load", _load, false); - domwindow.addEventListener("unload", function _close() { + domwindow.addEventListener("unload", function _close(event) { + if (event.target != doc) + return; domwindow.removeEventListener("unload", _close, false); ok(true, "window has been closed"); next(); @@ -184,6 +190,7 @@ var tests = { },function() { // logout, we should get unload next port.postMessage({topic: "test-logout"}); + port.close(); }, domwindow); }, false); diff --git a/browser/branding/official/pref/firefox-branding.js b/browser/branding/official/pref/firefox-branding.js index b8856dbf0fb..abc07038c0b 100644 --- a/browser/branding/official/pref/firefox-branding.js +++ b/browser/branding/official/pref/firefox-branding.js @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -pref("startup.homepage_override_url","https://www.mozilla.org/%LOCALE%/firefox/%VERSION%/whatsnew/?oldversion=%OLD_VERSION%"); +pref("startup.homepage_override_url",""); pref("startup.homepage_welcome_url","https://www.mozilla.org/%LOCALE%/firefox/%VERSION%/firstrun/"); // Interval: Time between checks for a new version (in seconds) pref("app.update.interval", 43200); // 12 hours diff --git a/browser/metro/base/content/bindings/grid.xml b/browser/metro/base/content/bindings/grid.xml index 744b1076588..6042b9eeaa1 100644 --- a/browser/metro/base/content/bindings/grid.xml +++ b/browser/metro/base/content/bindings/grid.xml @@ -463,21 +463,26 @@ // clear explicit width and columns before calculating from avail. height again let gridStyle = this._grid.style; - gridStyle.removeProperty('min-width'); - gridStyle.removeProperty('-moz-column-count'); + gridStyle.removeProperty("min-width"); + gridStyle.removeProperty("-moz-column-count"); - // We favor overflowing horizontally, not vertically (rows then colums) - // rows attribute = max rows - let maxRowCount = Math.min(this.getAttribute("rows") || Infinity, Math.floor(containerDims.height / itemDims.height)); - this._rowCount = Math.min(this.itemCount, maxRowCount); + if (this.hasAttribute("vertical")) { + this._columnCount = Math.floor(containerDims.width / itemDims.width) || 1; + this._rowCount = Math.floor(this.itemCount / this._columnCount); + } else { + // We favor overflowing horizontally, not vertically (rows then colums) + // rows attribute = max rows + let maxRowCount = Math.min(this.getAttribute("rows") || Infinity, Math.floor(containerDims.height / itemDims.height)); + this._rowCount = Math.min(this.itemCount, maxRowCount); - // columns attribute = min cols - this._columnCount = this.itemCount ? - Math.max( - // at least 1 column when there are items - this.getAttribute("columns") || 1, - Math.ceil(this.itemCount / this._rowCount) - ) : this.getAttribute("columns") || 0; + // columns attribute = min cols + this._columnCount = this.itemCount ? + Math.max( + // at least 1 column when there are items + this.getAttribute("columns") || 1, + Math.ceil(this.itemCount / this._rowCount) + ) : this.getAttribute("columns") || 0; + } // width is typically auto, cap max columns by truncating items collection // or, setting max-width style property with overflow hidden diff --git a/browser/metro/base/content/startui/BookmarksView.js b/browser/metro/base/content/startui/BookmarksView.js index a3cf34279e7..83eac5b6e1b 100644 --- a/browser/metro/base/content/startui/BookmarksView.js +++ b/browser/metro/base/content/startui/BookmarksView.js @@ -323,10 +323,6 @@ let BookmarksStartView = { this._view.destruct(); } }, - - show: function show() { - this._grid.arrangeItems(); - } }; /** diff --git a/browser/metro/base/content/startui/HistoryView.js b/browser/metro/base/content/startui/HistoryView.js index 42b100541ce..efd46487a24 100644 --- a/browser/metro/base/content/startui/HistoryView.js +++ b/browser/metro/base/content/startui/HistoryView.js @@ -302,10 +302,6 @@ let HistoryStartView = { _view: null, get _grid() { return document.getElementById("start-history-grid"); }, - show: function show() { - this._grid.arrangeItems(); - }, - init: function init() { this._view = new HistoryView(this._grid, StartUI.maxResultsPerSection, true); this._view.populateGrid(); diff --git a/browser/metro/base/content/startui/RemoteTabsView.js b/browser/metro/base/content/startui/RemoteTabsView.js index 6cd321b0f4f..d9715d7dda5 100644 --- a/browser/metro/base/content/startui/RemoteTabsView.js +++ b/browser/metro/base/content/startui/RemoteTabsView.js @@ -98,6 +98,7 @@ RemoteTabsView.prototype = Util.extend(Object.create(View.prototype), { }, this); } this.setUIAccessVisible(show); + this._set.arrangeItems(); }, destruct: function destruct() { @@ -127,8 +128,4 @@ let RemoteTabsStartView = { this._view.destruct(); } }, - - show: function show() { - this._grid.arrangeItems(); - } }; diff --git a/browser/metro/base/content/startui/StartUI.js b/browser/metro/base/content/startui/StartUI.js index 0647dbec4d2..7cbc43d7dfb 100644 --- a/browser/metro/base/content/startui/StartUI.js +++ b/browser/metro/base/content/startui/StartUI.js @@ -6,10 +6,6 @@ Cu.import("resource://gre/modules/Services.jsm"); -// When setting the max-height of the start tab contents, this is the buffer we subtract -// for the nav bar plus white space above it. -const kBottomContentMargin = 50; - var StartUI = { get startUI() { return document.getElementById("start-container"); }, @@ -30,7 +26,6 @@ var StartUI = { document.getElementById("bcast_preciseInput").setAttribute("input", this.chromeWin.InputSourceHelper.isPrecise ? "precise" : "imprecise"); - this._updateStartHeight(); this._adjustDOMforViewState(); TopSitesStartView.init(); @@ -38,12 +33,6 @@ var StartUI = { HistoryStartView.init(); RemoteTabsStartView.init(); - TopSitesStartView.show(); - BookmarksStartView.show(); - HistoryStartView.show(); - RemoteTabsStartView.show(); - - this.chromeWin.document.getElementById("browsers").addEventListener("SizeChanged", this, true); this.chromeWin.addEventListener("MozPrecisePointer", this, true); this.chromeWin.addEventListener("MozImprecisePointer", this, true); Services.obs.addObserver(this, "metro_viewstate_changed", false); @@ -60,7 +49,6 @@ var StartUI = { RemoteTabsStartView.uninit(); if (this.chromeWin) { - this.chromeWin.document.getElementById("browsers").removeEventListener("SizeChanged", this, true); this.chromeWin.removeEventListener("MozPrecisePointer", this, true); this.chromeWin.removeEventListener("MozImprecisePointer", this, true); } @@ -108,7 +96,8 @@ var StartUI = { this.onClick(aEvent); break; case "MozMousePixelScroll": - if (this.startUI.getAttribute("viewstate") == "snapped") { + let viewstate = this.startUI.getAttribute("viewstate"); + if (viewstate === "snapped" || viewstate === "portrait") { window.scrollBy(0, aEvent.detail); } else { window.scrollBy(aEvent.detail, 0); @@ -117,17 +106,9 @@ var StartUI = { aEvent.preventDefault(); aEvent.stopPropagation(); break; - case "SizeChanged": - this._updateStartHeight(); - break; } }, - _updateStartHeight: function () { - document.getElementById("start-container").style.maxHeight = - (this.chromeWin.ContentAreaObserver.contentHeight - kBottomContentMargin) + "px"; - }, - _adjustDOMforViewState: function() { if (this.chromeWin.MetroUtils.immersive) { let currViewState = ""; diff --git a/browser/metro/base/content/startui/TopSitesView.js b/browser/metro/base/content/startui/TopSitesView.js index eebf9b9b319..19458115e5b 100644 --- a/browser/metro/base/content/startui/TopSitesView.js +++ b/browser/metro/base/content/startui/TopSitesView.js @@ -311,8 +311,4 @@ let TopSitesStartView = { this._view.destruct(); } }, - - show: function show() { - this._grid.arrangeItems(); - } }; diff --git a/browser/metro/modules/View.jsm b/browser/metro/modules/View.jsm index d9968bb25c4..5c9e6ec0983 100644 --- a/browser/metro/modules/View.jsm +++ b/browser/metro/modules/View.jsm @@ -29,9 +29,18 @@ function View() { View.prototype = { _adjustDOMforViewState: function _adjustDOMforViewState(aState) { if (this._set) { - if (undefined == aState) - aState = this._set.getAttribute("viewstate"); + if (undefined == aState) + aState = this._set.getAttribute("viewstate"); + this._set.setAttribute("suppressonselect", (aState == "snapped")); + + if (aState == "portrait") { + this._set.setAttribute("vertical", true); + } else { + this._set.removeAttribute("vertical"); + } + + this._set.arrangeItems(); } }, diff --git a/browser/metro/theme/browser.css b/browser/metro/theme/browser.css index 72617e3b4d6..eb8e6936352 100644 --- a/browser/metro/theme/browser.css +++ b/browser/metro/theme/browser.css @@ -190,15 +190,19 @@ documenttab[selected] .documenttab-selection { #startui-page { overflow-x: scroll; overflow-y: hidden; + height: 100%; } #startui-body { height: 100%; + margin: 0; } #start-container { display: -moz-box; min-width: @grid_double_column_width@; + height: 100%; + width: 100%; } #start-topsites { @@ -210,7 +214,8 @@ documenttab[selected] .documenttab-selection { padding-bottom: @toolbar_height@; } -#start-container[viewstate="snapped"] { +#start-container[viewstate="snapped"], +#start-container[viewstate="portrait"] { -moz-box-orient: vertical; } diff --git a/browser/metro/theme/defines.inc b/browser/metro/theme/defines.inc index 035b6fff42a..fa11961709c 100644 --- a/browser/metro/theme/defines.inc +++ b/browser/metro/theme/defines.inc @@ -44,6 +44,7 @@ %define tile_border_color #dbdcde %define tile_spacing 12px +%define tile_side_margin 6px %define scroller_thickness 4px %define scroller_minimum 8px diff --git a/browser/metro/theme/platform.css b/browser/metro/theme/platform.css index 3819fb428df..6445542e95c 100644 --- a/browser/metro/theme/platform.css +++ b/browser/metro/theme/platform.css @@ -624,6 +624,7 @@ arrowbox { } .meta-section-title { + margin: @metro_spacing_normal@ @tile_side_margin@; font-size: @metro_font_large@; font-weight: 100; cursor: default; diff --git a/browser/metro/theme/tiles.css b/browser/metro/theme/tiles.css index 58db1bc31d1..f93d6a56a88 100644 --- a/browser/metro/theme/tiles.css +++ b/browser/metro/theme/tiles.css @@ -68,7 +68,7 @@ richgriditem { background-origin: padding-box; /* content positioning within the grid "cell" gives us the gutters/spacing between tiles */ - top: 2px; right: 6px; bottom: 10px; left: 6px; + top: 2px; right: @tile_side_margin@; bottom: 10px; left: @tile_side_margin@; border: @metro_border_thin@ solid @tile_border_color@; box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.1); transition: 150ms transform ease-out; diff --git a/toolkit/components/thumbnails/test/thumbnails_background.sjs b/toolkit/components/thumbnails/test/thumbnails_background.sjs index fe7e77508a5..e20ad760cb8 100644 --- a/toolkit/components/thumbnails/test/thumbnails_background.sjs +++ b/toolkit/components/thumbnails/test/thumbnails_background.sjs @@ -8,7 +8,7 @@ var timer; function handleRequest(req, resp) { resp.processAsync(); - resp.setHeader("Cache-Control", "no-cache", false); + resp.setHeader("Cache-Control", "no-cache, no-store", false); resp.setHeader("Content-Type", "text/html;charset=utf-8", false); let opts = {};