From d4e70dc8c7e0c5d73550c169113adf1a894aac76 Mon Sep 17 00:00:00 2001 From: Gavin Sharp Date: Tue, 20 Aug 2013 14:16:25 -0700 Subject: [PATCH 1/8] Bug 907404: disable the in-product whatsnew page, so that manual upgrades are consistent with updater upgrades wrt showing the whatsnew page (updater upgrades disable whatsnew via snippets), r=dolske, a=asa --HG-- extra : transplant_source : %0D6A%BEP%99%09%CEVA%00l%A7%27%C3%08%EF%03%03%82 --- browser/branding/official/pref/firefox-branding.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 5bb3221d406b920aed7b51ca170b246eafa04f13 Mon Sep 17 00:00:00 2001 From: Justin Dolske Date: Wed, 21 Aug 2013 17:25:03 -0700 Subject: [PATCH 2/8] Bug 355063 - Password manager does not work on script-generated forms, should use new DOMFormHasPassword event instead. r=mattn --- browser/base/content/content.js | 1 + modules/libpref/src/init/all.js | 1 + .../passwordmgr/LoginManagerContent.jsm | 70 ++++++++++++++++++- .../components/passwordmgr/test/Makefile.in | 1 + ...est_basic_form_observer_autofillForms.html | 59 ++++++++-------- .../test/test_basic_form_pwevent.html | 66 +++++++++++++++++ .../passwordmgr/test/test_maxforms_1.html | 7 +- .../passwordmgr/test/test_maxforms_2.html | 7 +- .../passwordmgr/test/test_maxforms_3.html | 7 +- 9 files changed, 184 insertions(+), 35 deletions(-) create mode 100644 toolkit/components/passwordmgr/test/test_basic_form_pwevent.html diff --git a/browser/base/content/content.js b/browser/base/content/content.js index c75a8a40e35..824b29a2ac4 100644 --- a/browser/base/content/content.js +++ b/browser/base/content/content.js @@ -48,6 +48,7 @@ if (Services.prefs.getBoolPref("browser.tabs.remote")) { }); addEventListener("DOMFormHasPassword", function(event) { InsecurePasswordUtils.checkForInsecurePasswords(event.target); + LoginManagerContent.onFormPassword(event); }); addEventListener("DOMAutoComplete", function(event) { LoginManagerContent.onUsernameInput(event); diff --git a/modules/libpref/src/init/all.js b/modules/libpref/src/init/all.js index 98ed61d1ee8..ea9f78fb52f 100644 --- a/modules/libpref/src/init/all.js +++ b/modules/libpref/src/init/all.js @@ -3909,6 +3909,7 @@ pref("signon.SignonFileName3", "signons3.txt"); // obsolete pref("signon.autofillForms", true); pref("signon.autologin.proxy", false); pref("signon.debug", false); +pref("signon.useDOMFormHasPassword", true); // Satchel (Form Manager) prefs pref("browser.formfill.debug", false); diff --git a/toolkit/components/passwordmgr/LoginManagerContent.jsm b/toolkit/components/passwordmgr/LoginManagerContent.jsm index 75f24cee19e..f22bacf9bee 100644 --- a/toolkit/components/passwordmgr/LoginManagerContent.jsm +++ b/toolkit/components/passwordmgr/LoginManagerContent.jsm @@ -13,7 +13,8 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/PrivateBrowsingUtils.jsm"); -var gEnabled = false, gDebug = false; // these mirror signon.* prefs +var gEnabled = false, gDebug = false, gAutofillForms = true; // these mirror signon.* prefs +var gUseDOMFormHasPassword = false; // use DOMFormHasPassword event for autofill function log(...pieces) { function generateLogMessage(args) { @@ -70,6 +71,8 @@ var observer = { onPrefChange : function() { gDebug = Services.prefs.getBoolPref("signon.debug"); gEnabled = Services.prefs.getBoolPref("signon.rememberSignons"); + gAutofillForms = Services.prefs.getBoolPref("signon.autofillForms"); + gUseDOMFormHasPassword = Services.prefs.getBoolPref("signon.useDOMFormHasPassword"); }, }; @@ -92,6 +95,10 @@ var LoginManagerContent = { }, onContentLoaded : function (event) { + // If we're using the new DOMFormHasPassword event, don't fill at pageload. + if (gUseDOMFormHasPassword) + return; + if (!event.isTrusted) return; @@ -108,6 +115,64 @@ var LoginManagerContent = { }, + onFormPassword: function (event) { + // If we're not using the new DOMFormHasPassword event, only fill at pageload. + if (!gUseDOMFormHasPassword) + return; + + if (!event.isTrusted) + return; + + if (!gEnabled) + return; + + let form = event.target; + let doc = form.ownerDocument; + + log("onFormPassword for", doc.documentURI); + + // If there are no logins for this site, bail out now. + let formOrigin = LoginUtils._getPasswordOrigin(doc.documentURI); + if (!Services.logins.countLogins(formOrigin, "", null)) + return; + + // If we're currently displaying a master password prompt, defer + // processing this form until the user handles the prompt. + if (Services.logins.uiBusy) { + log("deferring onFormPassword for", doc.documentURI); + let self = this; + let observer = { + QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver, Ci.nsISupportsWeakReference]), + + observe: function (subject, topic, data) { + log("Got deferred onFormPassword notification:", topic); + // Only run observer once. + Services.obs.removeObserver(this, "passwordmgr-crypto-login"); + Services.obs.removeObserver(this, "passwordmgr-crypto-loginCanceled"); + if (topic == "passwordmgr-crypto-loginCanceled") + return; + self.onFormPassword(event); + }, + handleEvent : function (event) { + // Not expected to be called + } + }; + // Trickyness follows: We want an observer, but don't want it to + // cause leaks. So add the observer with a weak reference, and use + // a dummy event listener (a strong reference) to keep it alive + // until the form is destroyed. + Services.obs.addObserver(observer, "passwordmgr-crypto-login", true); + Services.obs.addObserver(observer, "passwordmgr-crypto-loginCanceled", true); + form.addEventListener("mozCleverClosureHack", observer); + return; + } + + let autofillForm = gAutofillForms && !PrivateBrowsingUtils.isWindowPrivate(doc.defaultView); + + this._fillForm(form, autofillForm, false, false, null); + }, + + /* * onUsernameInput * @@ -537,8 +602,7 @@ var LoginManagerContent = { log("fillDocument processing", forms.length, "forms on", doc.documentURI); - var autofillForm = !PrivateBrowsingUtils.isWindowPrivate(doc.defaultView) && - Services.prefs.getBoolPref("signon.autofillForms"); + var autofillForm = gAutofillForms && !PrivateBrowsingUtils.isWindowPrivate(doc.defaultView); var previousActionOrigin = null; var foundLogins = null; diff --git a/toolkit/components/passwordmgr/test/Makefile.in b/toolkit/components/passwordmgr/test/Makefile.in index 1eced10a9d6..0852f8bf88a 100644 --- a/toolkit/components/passwordmgr/test/Makefile.in +++ b/toolkit/components/passwordmgr/test/Makefile.in @@ -27,6 +27,7 @@ MOCHITEST_FILES = \ test_basic_form_observer_autocomplete.html \ test_basic_form_observer_foundLogins.html \ test_basic_form_pwonly.html \ + test_basic_form_pwevent.html \ test_bug_227640.html \ test_bug_242956.html \ test_bug_360493_1.html \ diff --git a/toolkit/components/passwordmgr/test/test_basic_form_observer_autofillForms.html b/toolkit/components/passwordmgr/test/test_basic_form_observer_autofillForms.html index 199d810671f..552b7930ecc 100644 --- a/toolkit/components/passwordmgr/test/test_basic_form_observer_autofillForms.html +++ b/toolkit/components/passwordmgr/test/test_basic_form_observer_autofillForms.html @@ -21,6 +21,36 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm"); // Assume that the pref starts out true, so set to false SpecialPowers.setBoolPref("signon.autofillForms", false); + +var TestObserver = { + receivedNotificationFoundForm : false, + receivedNotificationFoundLogins : false, + dataFoundForm : "", + dataFoundLogins : null, + QueryInterface : XPCOMUtils.generateQI([Ci.nsIObserver, Ci.nsISupportsWeakReference]), + observe : function (subject, topic, data) { + netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect'); + var pwmgr = Cc["@mozilla.org/login-manager;1"]. + getService(Ci.nsILoginManager); + if (topic == "passwordmgr-found-form") { + info("got passwordmgr-found-form"); + this.receivedNotificationFoundForm = true; + this.dataFoundForm = data; + // Now fill the form + pwmgr.fillForm(subject); + } else if (topic == "passwordmgr-found-logins") { + info("got passwordmgr-found-logins"); + this.receivedNotificationFoundLogins = true; + this.dataFoundLogins = subject.QueryInterface(Ci.nsIPropertyBag2); + } + } +}; + +// Add the observer +var os = Cc["@mozilla.org/observer-service;1"]. + getService(Ci.nsIObserverService); +os.addObserver(TestObserver, "passwordmgr-found-form", false); +os.addObserver(TestObserver, "passwordmgr-found-logins", false);

@@ -42,35 +72,6 @@ SpecialPowers.setBoolPref("signon.autofillForms", false); + + + + + +Mozilla Bug 355063 +

+
+forms go here! +
+
+
+ + diff --git a/toolkit/components/passwordmgr/test/test_maxforms_1.html b/toolkit/components/passwordmgr/test/test_maxforms_1.html index d7fa80c52f0..bcc2e29660c 100644 --- a/toolkit/components/passwordmgr/test/test_maxforms_1.html +++ b/toolkit/components/passwordmgr/test/test_maxforms_1.html @@ -52,7 +52,12 @@ function startTest() { SimpleTest.finish(); } -window.onload = startTest; +if (SpecialPowers.getBoolPref("signon.useDOMFormHasPassword")) { + info("skipping test when signon.useDOMFormHasPassword is enabled"); + SimpleTest.finish(); +} else { + window.onload = startTest; +} diff --git a/toolkit/components/passwordmgr/test/test_maxforms_2.html b/toolkit/components/passwordmgr/test/test_maxforms_2.html index 281f12d17a1..da315c42029 100644 --- a/toolkit/components/passwordmgr/test/test_maxforms_2.html +++ b/toolkit/components/passwordmgr/test/test_maxforms_2.html @@ -52,7 +52,12 @@ function startTest() { SimpleTest.finish(); } -window.onload = startTest; +if (SpecialPowers.getBoolPref("signon.useDOMFormHasPassword")) { + info("skipping test when signon.useDOMFormHasPassword is enabled"); + SimpleTest.finish(); +} else { + window.onload = startTest; +} diff --git a/toolkit/components/passwordmgr/test/test_maxforms_3.html b/toolkit/components/passwordmgr/test/test_maxforms_3.html index 84fa863f42f..63d2bfedd49 100644 --- a/toolkit/components/passwordmgr/test/test_maxforms_3.html +++ b/toolkit/components/passwordmgr/test/test_maxforms_3.html @@ -52,7 +52,12 @@ function startTest() { SimpleTest.finish(); } -window.onload = startTest; +if (SpecialPowers.getBoolPref("signon.useDOMFormHasPassword")) { + info("skipping test when signon.useDOMFormHasPassword is enabled"); + SimpleTest.finish(); +} else { + window.onload = startTest; +} From 62cd6b7999fcc0b2ce341339ecff01eeca8763e3 Mon Sep 17 00:00:00 2001 From: Mark Hammond Date: Thu, 22 Aug 2013 09:45:14 +1000 Subject: [PATCH 3/8] Bug 907821 - Fix intermittent orange in browser_chat_tearoff.js. r=mixedpuppy --HG-- extra : rebase_source : 93f508349faea2e1d22ab91060f7a8d97a58b301 --- .../test/social/browser_chat_tearoff.js | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) 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); From 8749d11467f84c128346b59c4a994ebb3c7f5fac Mon Sep 17 00:00:00 2001 From: Rodrigo Silveira Date: Mon, 29 Jul 2013 11:01:36 -0700 Subject: [PATCH 4/8] Bug 903178 - Start screen should scroll vertically when in portrait mode r=sfoster --- browser/metro/base/content/bindings/grid.xml | 31 +++++++++++-------- .../base/content/startui/BookmarksView.js | 4 --- .../metro/base/content/startui/HistoryView.js | 4 --- .../base/content/startui/RemoteTabsView.js | 5 +-- browser/metro/base/content/startui/StartUI.js | 23 ++------------ .../base/content/startui/TopSitesView.js | 4 --- browser/metro/modules/View.jsm | 13 ++++++-- browser/metro/theme/browser.css | 7 ++++- browser/metro/theme/defines.inc | 1 + browser/metro/theme/platform.css | 1 + browser/metro/theme/tiles.css | 2 +- 11 files changed, 41 insertions(+), 54 deletions(-) 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; From 11f2e4fcc48b4ec30823422f96adecd5ed0dc6f5 Mon Sep 17 00:00:00 2001 From: Mark Hammond Date: Thu, 22 Aug 2013 12:11:45 +1000 Subject: [PATCH 5/8] Bug 907350 - set cache-control: no-store to avoid browser_thumbnails_background orange. r=adw --- toolkit/components/thumbnails/test/thumbnails_background.sjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 = {}; From 9df9bcfdc38316b09fee382bd111d1dcf54e6eb4 Mon Sep 17 00:00:00 2001 From: Justin Dolske Date: Wed, 21 Aug 2013 20:09:45 -0700 Subject: [PATCH 6/8] Bug 355063 - bustage followup for Android/Metro. r=sparky --- browser/metro/base/content/contenthandlers/Content.js | 5 +++++ mobile/android/chrome/content/browser.js | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/browser/metro/base/content/contenthandlers/Content.js b/browser/metro/base/content/contenthandlers/Content.js index 0f39bee82b3..cc5051c050f 100644 --- a/browser/metro/base/content/contenthandlers/Content.js +++ b/browser/metro/base/content/contenthandlers/Content.js @@ -140,6 +140,7 @@ let Content = { addEventListener("MozApplicationManifest", this, false); addEventListener("DOMContentLoaded", this, false); addEventListener("DOMAutoComplete", this, false); + addEventListener("DOMFormHasPassword", this, false); addEventListener("blur", this, false); addEventListener("pagehide", this, false); // Attach a listener to watch for "click" events bubbling up from error @@ -189,6 +190,10 @@ let Content = { this._onClickCapture(aEvent); break; + case "DOMFormHasPassword": + LoginManagerContent.onFormPassword(aEvent); + break; + case "DOMContentLoaded": LoginManagerContent.onContentLoaded(aEvent); this._maybeNotifyErrorPage(); diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js index 1dba085b70b..6c034bc7d7b 100644 --- a/mobile/android/chrome/content/browser.js +++ b/mobile/android/chrome/content/browser.js @@ -2670,6 +2670,7 @@ Tab.prototype = { this.browser.sessionHistory.addSHistoryListener(this); this.browser.addEventListener("DOMContentLoaded", this, true); + this.browser.addEventListener("DOMFormHasPassword", this, true); this.browser.addEventListener("DOMLinkAdded", this, true); this.browser.addEventListener("DOMTitleChanged", this, true); this.browser.addEventListener("DOMWindowClose", this, true); @@ -2818,6 +2819,7 @@ Tab.prototype = { this.browser.sessionHistory.removeSHistoryListener(this); this.browser.removeEventListener("DOMContentLoaded", this, true); + this.browser.removeEventListener("DOMFormHasPassword", this, true); this.browser.removeEventListener("DOMLinkAdded", this, true); this.browser.removeEventListener("DOMTitleChanged", this, true); this.browser.removeEventListener("DOMWindowClose", this, true); @@ -3375,6 +3377,11 @@ Tab.prototype = { break; } + case "DOMFormHasPassword": { + LoginManagerContent.onFormPassword(aEvent); + break; + } + case "DOMLinkAdded": { let target = aEvent.originalTarget; if (!target.href || target.disabled) From 7d628f91f4d58e3ebfb4beb68ce84303fcc0ac73 Mon Sep 17 00:00:00 2001 From: Tim Taubert Date: Thu, 22 Aug 2013 09:22:16 +0200 Subject: [PATCH 7/8] Backed out changeset 91d27f0ac7dd (bug 355063) --- browser/metro/base/content/contenthandlers/Content.js | 5 ----- mobile/android/chrome/content/browser.js | 7 ------- 2 files changed, 12 deletions(-) diff --git a/browser/metro/base/content/contenthandlers/Content.js b/browser/metro/base/content/contenthandlers/Content.js index cc5051c050f..0f39bee82b3 100644 --- a/browser/metro/base/content/contenthandlers/Content.js +++ b/browser/metro/base/content/contenthandlers/Content.js @@ -140,7 +140,6 @@ let Content = { addEventListener("MozApplicationManifest", this, false); addEventListener("DOMContentLoaded", this, false); addEventListener("DOMAutoComplete", this, false); - addEventListener("DOMFormHasPassword", this, false); addEventListener("blur", this, false); addEventListener("pagehide", this, false); // Attach a listener to watch for "click" events bubbling up from error @@ -190,10 +189,6 @@ let Content = { this._onClickCapture(aEvent); break; - case "DOMFormHasPassword": - LoginManagerContent.onFormPassword(aEvent); - break; - case "DOMContentLoaded": LoginManagerContent.onContentLoaded(aEvent); this._maybeNotifyErrorPage(); diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js index 6c034bc7d7b..1dba085b70b 100644 --- a/mobile/android/chrome/content/browser.js +++ b/mobile/android/chrome/content/browser.js @@ -2670,7 +2670,6 @@ Tab.prototype = { this.browser.sessionHistory.addSHistoryListener(this); this.browser.addEventListener("DOMContentLoaded", this, true); - this.browser.addEventListener("DOMFormHasPassword", this, true); this.browser.addEventListener("DOMLinkAdded", this, true); this.browser.addEventListener("DOMTitleChanged", this, true); this.browser.addEventListener("DOMWindowClose", this, true); @@ -2819,7 +2818,6 @@ Tab.prototype = { this.browser.sessionHistory.removeSHistoryListener(this); this.browser.removeEventListener("DOMContentLoaded", this, true); - this.browser.removeEventListener("DOMFormHasPassword", this, true); this.browser.removeEventListener("DOMLinkAdded", this, true); this.browser.removeEventListener("DOMTitleChanged", this, true); this.browser.removeEventListener("DOMWindowClose", this, true); @@ -3377,11 +3375,6 @@ Tab.prototype = { break; } - case "DOMFormHasPassword": { - LoginManagerContent.onFormPassword(aEvent); - break; - } - case "DOMLinkAdded": { let target = aEvent.originalTarget; if (!target.href || target.disabled) From 0e9416cb6d3785a5aafc8a6fc7ad996e8dbf486d Mon Sep 17 00:00:00 2001 From: Tim Taubert Date: Thu, 22 Aug 2013 09:22:18 +0200 Subject: [PATCH 8/8] Backed out changeset 42be7b929812 (bug 355063) --- browser/base/content/content.js | 1 - modules/libpref/src/init/all.js | 1 - .../passwordmgr/LoginManagerContent.jsm | 70 +------------------ .../components/passwordmgr/test/Makefile.in | 1 - ...est_basic_form_observer_autofillForms.html | 59 ++++++++-------- .../test/test_basic_form_pwevent.html | 66 ----------------- .../passwordmgr/test/test_maxforms_1.html | 7 +- .../passwordmgr/test/test_maxforms_2.html | 7 +- .../passwordmgr/test/test_maxforms_3.html | 7 +- 9 files changed, 35 insertions(+), 184 deletions(-) delete mode 100644 toolkit/components/passwordmgr/test/test_basic_form_pwevent.html diff --git a/browser/base/content/content.js b/browser/base/content/content.js index 824b29a2ac4..c75a8a40e35 100644 --- a/browser/base/content/content.js +++ b/browser/base/content/content.js @@ -48,7 +48,6 @@ if (Services.prefs.getBoolPref("browser.tabs.remote")) { }); addEventListener("DOMFormHasPassword", function(event) { InsecurePasswordUtils.checkForInsecurePasswords(event.target); - LoginManagerContent.onFormPassword(event); }); addEventListener("DOMAutoComplete", function(event) { LoginManagerContent.onUsernameInput(event); diff --git a/modules/libpref/src/init/all.js b/modules/libpref/src/init/all.js index ea9f78fb52f..98ed61d1ee8 100644 --- a/modules/libpref/src/init/all.js +++ b/modules/libpref/src/init/all.js @@ -3909,7 +3909,6 @@ pref("signon.SignonFileName3", "signons3.txt"); // obsolete pref("signon.autofillForms", true); pref("signon.autologin.proxy", false); pref("signon.debug", false); -pref("signon.useDOMFormHasPassword", true); // Satchel (Form Manager) prefs pref("browser.formfill.debug", false); diff --git a/toolkit/components/passwordmgr/LoginManagerContent.jsm b/toolkit/components/passwordmgr/LoginManagerContent.jsm index f22bacf9bee..75f24cee19e 100644 --- a/toolkit/components/passwordmgr/LoginManagerContent.jsm +++ b/toolkit/components/passwordmgr/LoginManagerContent.jsm @@ -13,8 +13,7 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/PrivateBrowsingUtils.jsm"); -var gEnabled = false, gDebug = false, gAutofillForms = true; // these mirror signon.* prefs -var gUseDOMFormHasPassword = false; // use DOMFormHasPassword event for autofill +var gEnabled = false, gDebug = false; // these mirror signon.* prefs function log(...pieces) { function generateLogMessage(args) { @@ -71,8 +70,6 @@ var observer = { onPrefChange : function() { gDebug = Services.prefs.getBoolPref("signon.debug"); gEnabled = Services.prefs.getBoolPref("signon.rememberSignons"); - gAutofillForms = Services.prefs.getBoolPref("signon.autofillForms"); - gUseDOMFormHasPassword = Services.prefs.getBoolPref("signon.useDOMFormHasPassword"); }, }; @@ -95,10 +92,6 @@ var LoginManagerContent = { }, onContentLoaded : function (event) { - // If we're using the new DOMFormHasPassword event, don't fill at pageload. - if (gUseDOMFormHasPassword) - return; - if (!event.isTrusted) return; @@ -115,64 +108,6 @@ var LoginManagerContent = { }, - onFormPassword: function (event) { - // If we're not using the new DOMFormHasPassword event, only fill at pageload. - if (!gUseDOMFormHasPassword) - return; - - if (!event.isTrusted) - return; - - if (!gEnabled) - return; - - let form = event.target; - let doc = form.ownerDocument; - - log("onFormPassword for", doc.documentURI); - - // If there are no logins for this site, bail out now. - let formOrigin = LoginUtils._getPasswordOrigin(doc.documentURI); - if (!Services.logins.countLogins(formOrigin, "", null)) - return; - - // If we're currently displaying a master password prompt, defer - // processing this form until the user handles the prompt. - if (Services.logins.uiBusy) { - log("deferring onFormPassword for", doc.documentURI); - let self = this; - let observer = { - QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver, Ci.nsISupportsWeakReference]), - - observe: function (subject, topic, data) { - log("Got deferred onFormPassword notification:", topic); - // Only run observer once. - Services.obs.removeObserver(this, "passwordmgr-crypto-login"); - Services.obs.removeObserver(this, "passwordmgr-crypto-loginCanceled"); - if (topic == "passwordmgr-crypto-loginCanceled") - return; - self.onFormPassword(event); - }, - handleEvent : function (event) { - // Not expected to be called - } - }; - // Trickyness follows: We want an observer, but don't want it to - // cause leaks. So add the observer with a weak reference, and use - // a dummy event listener (a strong reference) to keep it alive - // until the form is destroyed. - Services.obs.addObserver(observer, "passwordmgr-crypto-login", true); - Services.obs.addObserver(observer, "passwordmgr-crypto-loginCanceled", true); - form.addEventListener("mozCleverClosureHack", observer); - return; - } - - let autofillForm = gAutofillForms && !PrivateBrowsingUtils.isWindowPrivate(doc.defaultView); - - this._fillForm(form, autofillForm, false, false, null); - }, - - /* * onUsernameInput * @@ -602,7 +537,8 @@ var LoginManagerContent = { log("fillDocument processing", forms.length, "forms on", doc.documentURI); - var autofillForm = gAutofillForms && !PrivateBrowsingUtils.isWindowPrivate(doc.defaultView); + var autofillForm = !PrivateBrowsingUtils.isWindowPrivate(doc.defaultView) && + Services.prefs.getBoolPref("signon.autofillForms"); var previousActionOrigin = null; var foundLogins = null; diff --git a/toolkit/components/passwordmgr/test/Makefile.in b/toolkit/components/passwordmgr/test/Makefile.in index 0852f8bf88a..1eced10a9d6 100644 --- a/toolkit/components/passwordmgr/test/Makefile.in +++ b/toolkit/components/passwordmgr/test/Makefile.in @@ -27,7 +27,6 @@ MOCHITEST_FILES = \ test_basic_form_observer_autocomplete.html \ test_basic_form_observer_foundLogins.html \ test_basic_form_pwonly.html \ - test_basic_form_pwevent.html \ test_bug_227640.html \ test_bug_242956.html \ test_bug_360493_1.html \ diff --git a/toolkit/components/passwordmgr/test/test_basic_form_observer_autofillForms.html b/toolkit/components/passwordmgr/test/test_basic_form_observer_autofillForms.html index 552b7930ecc..199d810671f 100644 --- a/toolkit/components/passwordmgr/test/test_basic_form_observer_autofillForms.html +++ b/toolkit/components/passwordmgr/test/test_basic_form_observer_autofillForms.html @@ -21,36 +21,6 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm"); // Assume that the pref starts out true, so set to false SpecialPowers.setBoolPref("signon.autofillForms", false); - -var TestObserver = { - receivedNotificationFoundForm : false, - receivedNotificationFoundLogins : false, - dataFoundForm : "", - dataFoundLogins : null, - QueryInterface : XPCOMUtils.generateQI([Ci.nsIObserver, Ci.nsISupportsWeakReference]), - observe : function (subject, topic, data) { - netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect'); - var pwmgr = Cc["@mozilla.org/login-manager;1"]. - getService(Ci.nsILoginManager); - if (topic == "passwordmgr-found-form") { - info("got passwordmgr-found-form"); - this.receivedNotificationFoundForm = true; - this.dataFoundForm = data; - // Now fill the form - pwmgr.fillForm(subject); - } else if (topic == "passwordmgr-found-logins") { - info("got passwordmgr-found-logins"); - this.receivedNotificationFoundLogins = true; - this.dataFoundLogins = subject.QueryInterface(Ci.nsIPropertyBag2); - } - } -}; - -// Add the observer -var os = Cc["@mozilla.org/observer-service;1"]. - getService(Ci.nsIObserverService); -os.addObserver(TestObserver, "passwordmgr-found-form", false); -os.addObserver(TestObserver, "passwordmgr-found-logins", false);

@@ -72,6 +42,35 @@ os.addObserver(TestObserver, "passwordmgr-found-logins", false); - - - - - -Mozilla Bug 355063 -

-
-forms go here! -
-
-
- - diff --git a/toolkit/components/passwordmgr/test/test_maxforms_1.html b/toolkit/components/passwordmgr/test/test_maxforms_1.html index bcc2e29660c..d7fa80c52f0 100644 --- a/toolkit/components/passwordmgr/test/test_maxforms_1.html +++ b/toolkit/components/passwordmgr/test/test_maxforms_1.html @@ -52,12 +52,7 @@ function startTest() { SimpleTest.finish(); } -if (SpecialPowers.getBoolPref("signon.useDOMFormHasPassword")) { - info("skipping test when signon.useDOMFormHasPassword is enabled"); - SimpleTest.finish(); -} else { - window.onload = startTest; -} +window.onload = startTest; diff --git a/toolkit/components/passwordmgr/test/test_maxforms_2.html b/toolkit/components/passwordmgr/test/test_maxforms_2.html index da315c42029..281f12d17a1 100644 --- a/toolkit/components/passwordmgr/test/test_maxforms_2.html +++ b/toolkit/components/passwordmgr/test/test_maxforms_2.html @@ -52,12 +52,7 @@ function startTest() { SimpleTest.finish(); } -if (SpecialPowers.getBoolPref("signon.useDOMFormHasPassword")) { - info("skipping test when signon.useDOMFormHasPassword is enabled"); - SimpleTest.finish(); -} else { - window.onload = startTest; -} +window.onload = startTest; diff --git a/toolkit/components/passwordmgr/test/test_maxforms_3.html b/toolkit/components/passwordmgr/test/test_maxforms_3.html index 63d2bfedd49..84fa863f42f 100644 --- a/toolkit/components/passwordmgr/test/test_maxforms_3.html +++ b/toolkit/components/passwordmgr/test/test_maxforms_3.html @@ -52,12 +52,7 @@ function startTest() { SimpleTest.finish(); } -if (SpecialPowers.getBoolPref("signon.useDOMFormHasPassword")) { - info("skipping test when signon.useDOMFormHasPassword is enabled"); - SimpleTest.finish(); -} else { - window.onload = startTest; -} +window.onload = startTest;