From 7bc5ad9c0222beef0ff95ee443f5ad8dc4c3ee0d Mon Sep 17 00:00:00 2001 From: Mark Hammond Date: Thu, 10 Dec 2015 09:28:54 -0500 Subject: [PATCH 01/35] Bug 1231535 - remove sync spinner and add ellipsis to Synced Tabs panel. r=Gijs --- browser/base/content/browser-syncui.js | 2 +- .../themes/shared/customizableui/panelUIOverlay.inc.css | 8 -------- services/sync/locales/en-US/sync.properties | 2 +- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/browser/base/content/browser-syncui.js b/browser/base/content/browser-syncui.js index 1e42fb774885..4a3c63b6f352 100644 --- a/browser/base/content/browser-syncui.js +++ b/browser/base/content/browser-syncui.js @@ -182,7 +182,7 @@ var gSyncUI = { if (++this._numActiveSyncTasks == 1) { let broadcaster = document.getElementById("sync-status"); broadcaster.setAttribute("syncstatus", "active"); - broadcaster.setAttribute("label", this._stringBundle.GetStringFromName("syncing.label")); + broadcaster.setAttribute("label", this._stringBundle.GetStringFromName("syncing2.label")); broadcaster.setAttribute("disabled", "true"); } this.updateUI(); diff --git a/browser/themes/shared/customizableui/panelUIOverlay.inc.css b/browser/themes/shared/customizableui/panelUIOverlay.inc.css index bf1869d0ecfc..569334c6c0b5 100644 --- a/browser/themes/shared/customizableui/panelUIOverlay.inc.css +++ b/browser/themes/shared/customizableui/panelUIOverlay.inc.css @@ -634,7 +634,6 @@ toolbarpaletteitem[place="palette"] > toolbaritem > toolbarbutton { #PanelUI-update-status > .toolbarbutton-icon, #PanelUI-fxa-label > .toolbarbutton-icon, #PanelUI-fxa-icon > .toolbarbutton-icon, -#PanelUI-remotetabs-syncnow > .toolbarbutton-icon, #PanelUI-customize > .toolbarbutton-icon, #PanelUI-help > .toolbarbutton-icon, #PanelUI-quit > .toolbarbutton-icon { @@ -668,7 +667,6 @@ toolbarpaletteitem[place="palette"] > toolbaritem > toolbarbutton { list-style-image: url(chrome://branding/content/icon16.png); } -#PanelUI-remotetabs-syncnow, #PanelUI-fxa-label, #PanelUI-fxa-icon { list-style-image: url(chrome://browser/skin/sync-horizontalbar.png); @@ -752,7 +750,6 @@ toolbarpaletteitem[place="palette"] > toolbaritem > toolbarbutton { visibility: collapse; } -#PanelUI-remotetabs-syncnow[syncstatus="active"], #PanelUI-fxa-icon[syncstatus="active"] { list-style-image: url(chrome://browser/skin/syncProgress-horizontalbar.png); } @@ -782,7 +779,6 @@ toolbarpaletteitem[place="palette"] > toolbaritem > toolbarbutton { #PanelUI-fxa-label, #PanelUI-fxa-icon, -#PanelUI-remotetabs-syncnow, #PanelUI-customize, #PanelUI-help, #PanelUI-quit { @@ -1622,12 +1618,10 @@ menuitem[checked="true"].subviewbutton > .menu-iconic-left { } #PanelUI-fxa-label, - #PanelUI-remotetabs-syncnow, #PanelUI-fxa-icon { list-style-image: url(chrome://browser/skin/sync-horizontalbar@2x.png); } - #PanelUI-remotetabs-syncnow[syncstatus="active"], #PanelUI-fxa-icon[syncstatus="active"] { list-style-image: url(chrome://browser/skin/syncProgress-horizontalbar@2x.png); } @@ -1650,7 +1644,6 @@ menuitem[checked="true"].subviewbutton > .menu-iconic-left { #PanelUI-fxa-label, #PanelUI-fxa-icon, - #PanelUI-remotetabs-syncnow, #PanelUI-customize, #PanelUI-help, #PanelUI-quit { @@ -1660,7 +1653,6 @@ menuitem[checked="true"].subviewbutton > .menu-iconic-left { #PanelUI-update-status > .toolbarbutton-icon, #PanelUI-fxa-label > .toolbarbutton-icon, #PanelUI-fxa-icon > .toolbarbutton-icon, - #PanelUI-remotetabs-syncnow > .toolbarbutton-icon, #PanelUI-customize > .toolbarbutton-icon, #PanelUI-help > .toolbarbutton-icon, #PanelUI-quit > .toolbarbutton-icon { diff --git a/services/sync/locales/en-US/sync.properties b/services/sync/locales/en-US/sync.properties index 8c3b9b14c508..23b71916c830 100644 --- a/services/sync/locales/en-US/sync.properties +++ b/services/sync/locales/en-US/sync.properties @@ -26,4 +26,4 @@ sync.eol.learnMore.label = Learn more sync.eol.learnMore.accesskey = L syncnow.label = Sync Now -syncing.label = Syncing +syncing2.label = Syncing… From 397ca2b9bc3022d648e9a7bcb72fc1720e7577d2 Mon Sep 17 00:00:00 2001 From: Sebastian Kaspari Date: Thu, 10 Dec 2015 09:36:08 -0500 Subject: [PATCH 02/35] Bug 1230603 - GeckoPreferences: Always process matching PrefHandlers. r=margaret --HG-- extra : commitid : nleRxtcu6j extra : rebase_source : 032a80f2d1d8ffe8a3eada234996189390ade088 --- .../gecko/preferences/GeckoPreferences.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/mobile/android/base/java/org/mozilla/gecko/preferences/GeckoPreferences.java b/mobile/android/base/java/org/mozilla/gecko/preferences/GeckoPreferences.java index c47b056a346e..8ac766a6e38f 100644 --- a/mobile/android/base/java/org/mozilla/gecko/preferences/GeckoPreferences.java +++ b/mobile/android/base/java/org/mozilla/gecko/preferences/GeckoPreferences.java @@ -685,6 +685,15 @@ OnSharedPreferenceChangeListener } setupPreferences((PreferenceGroup) pref, prefs); } else { + if (handlers.containsKey(key)) { + PrefHandler handler = handlers.get(key); + if (!handler.setupPref(this, pref)) { + preferences.removePreference(pref); + i--; + continue; + } + } + pref.setOnPreferenceChangeListener(this); if (PREFS_UPDATER_AUTODOWNLOAD.equals(key)) { if (!AppConstants.MOZ_UPDATER) { @@ -853,15 +862,6 @@ OnSharedPreferenceChangeListener final String url = getResources().getString(R.string.faq_link, VERSION, OS, LOCALE); ((LinkPreference) pref).setUrl(url); - } else if (handlers.containsKey(key)) { - // This should be the last task. We might have removed some of this preferences previously. We only - // want to run the PrefHandler for a preference if it still exists. - PrefHandler handler = handlers.get(key); - if (!handler.setupPref(this, pref)) { - preferences.removePreference(pref); - i--; - continue; - } } // Some Preference UI elements are not actually preferences, From 297357597faf1b6da8dc8a33042402ce235b6df3 Mon Sep 17 00:00:00 2001 From: Gijs Kruitbosch Date: Tue, 8 Dec 2015 09:56:27 -0500 Subject: [PATCH 03/35] Bug 1224605 - also show the OSK when tapping in focused inputs, r=masayuki --HG-- extra : commitid : Dk5EQ4MMs4X extra : rebase_source : 3bfa3f930a95904d2b179b58f3735f2e1cae1dc0 --- dom/events/IMEStateManager.cpp | 11 +++++++++-- widget/IMEData.h | 2 +- widget/windows/WinIMEHandler.cpp | 4 ++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/dom/events/IMEStateManager.cpp b/dom/events/IMEStateManager.cpp index acada04c2de8..07ba254997bf 100644 --- a/dom/events/IMEStateManager.cpp +++ b/dom/events/IMEStateManager.cpp @@ -77,6 +77,8 @@ GetActionCauseName(InputContextAction::Cause aCause) return "CAUSE_KEY"; case InputContextAction::CAUSE_MOUSE: return "CAUSE_MOUSE"; + case InputContextAction::CAUSE_TOUCH: + return "CAUSE_TOUCH"; default: return "illegal value"; } @@ -657,8 +659,13 @@ IMEStateManager::OnClickInEditor(nsPresContext* aPresContext, return; // should notify only first click event. } - InputContextAction action(InputContextAction::CAUSE_MOUSE, - InputContextAction::FOCUS_NOT_CHANGED); + uint16_t inputSource = nsIDOMMouseEvent::MOZ_SOURCE_UNKNOWN; + aMouseEvent->GetMozInputSource(&inputSource); + InputContextAction::Cause cause = + inputSource == nsIDOMMouseEvent::MOZ_SOURCE_TOUCH ? + InputContextAction::CAUSE_TOUCH : InputContextAction::CAUSE_MOUSE; + + InputContextAction action(cause, InputContextAction::FOCUS_NOT_CHANGED); IMEState newState = GetNewIMEState(aPresContext, aContent); SetIMEState(newState, aContent, widget, action); } diff --git a/widget/IMEData.h b/widget/IMEData.h index b49fe9afdbe3..208bfc6bce20 100644 --- a/widget/IMEData.h +++ b/widget/IMEData.h @@ -341,7 +341,7 @@ struct InputContextAction final bool UserMightRequestOpenVKB() const { return (mFocusChange == FOCUS_NOT_CHANGED && - mCause == CAUSE_MOUSE); + (mCause == CAUSE_MOUSE || mCause == CAUSE_TOUCH)); } InputContextAction() diff --git a/widget/windows/WinIMEHandler.cpp b/widget/windows/WinIMEHandler.cpp index 520ad5eb72d3..14802b8820e0 100644 --- a/widget/windows/WinIMEHandler.cpp +++ b/widget/windows/WinIMEHandler.cpp @@ -374,6 +374,10 @@ IMEHandler::SetInputContext(nsWindow* aWindow, // Assume that SetInputContext() is called only when aWindow has focus. sPluginHasFocus = (aInputContext.mIMEState.mEnabled == IMEState::PLUGIN); + if (aAction.UserMightRequestOpenVKB()) { + IMEHandler::MaybeShowOnScreenKeyboard(); + } + bool enable = WinUtils::IsIMEEnabled(aInputContext); bool adjustOpenState = (enable && aInputContext.mIMEState.mOpen != IMEState::DONT_CHANGE_OPEN_STATE); From 63de561f4944b863c59fbed848f985a027619327 Mon Sep 17 00:00:00 2001 From: Nick Alexander Date: Thu, 10 Dec 2015 10:51:42 -0500 Subject: [PATCH 04/35] Bug 1231667 - Set Android SDK directory in topsrcdir Gradle configuration. r=me f=mcomella --HG-- extra : commitid : JaIcJaQkY0L extra : rebase_source : 874d2ee3c68058b5c96997437a78155ec789c6c5 extra : histedit_source : 7a1c2bc56259d10ccd6b02451016c83c52135351 --- .hgignore | 3 +++ settings.gradle | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.hgignore b/.hgignore index 94e391ff1233..31f1b149453d 100644 --- a/.hgignore +++ b/.hgignore @@ -59,6 +59,9 @@ _OPT\.OBJ/ # Gradle cache. ^.gradle/ +# Local Gradle configuration properties. +^local.properties$ + # Python stuff installed at build time. ^python/psutil/.*\.so ^python/psutil/.*\.pyd diff --git a/settings.gradle b/settings.gradle index f13360b22640..8e48f79ac630 100644 --- a/settings.gradle +++ b/settings.gradle @@ -18,9 +18,16 @@ def slurper = new JsonSlurper() def json = slurper.parseText(standardOutput.toString()) if (json.substs.MOZ_BUILD_APP != 'mobile/android') { - throw new GradleException("Building with Gradle is only supported for Fennec, i.e., MOZ_BUILD_APP == 'mobile/android'."); + throw new GradleException("Building with Gradle is only supported for Fennec, i.e., MOZ_BUILD_APP == 'mobile/android'.") } +// Set the Android SDK location. This is the *least specific* mechanism, which +// is unfortunate: we'd prefer to use the *most specific* mechanism. That is, +// local.properties (first 'sdk.dir', then 'android.dir') and then the +// environment variable ANDROID_HOME will override this. That's unfortunate, +// but it's hard to automatically arrange better. +System.setProperty('android.home', json.substs.ANDROID_SDK_ROOT) + include ':app' include ':base' include ':omnijar' From f9d1382e0317729e1477de1269d837e61d9d5edd Mon Sep 17 00:00:00 2001 From: Nick Alexander Date: Wed, 9 Dec 2015 23:48:07 -0500 Subject: [PATCH 05/35] Bug 1231749 - Use |mach build faster| to see changes in toolkit/ in Gradle configuration. r=me f=vivek DONTBUILD NPOTB This also adds toolkit/ to the Gradle omnijar project. --HG-- extra : commitid : 2xxf4DfPX1S extra : rebase_source : f423d0dc72da32bed214c9aa88818b145f386b77 extra : histedit_source : f21b9fe9a4f48fcefb950b9b2275da4207c722b8 --- mobile/android/app/omnijar/build.gradle | 1 + mobile/android/base/Makefile.in | 14 +++++--------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/mobile/android/app/omnijar/build.gradle b/mobile/android/app/omnijar/build.gradle index 68c00f3265fe..c5274a618aa2 100644 --- a/mobile/android/app/omnijar/build.gradle +++ b/mobile/android/app/omnijar/build.gradle @@ -20,6 +20,7 @@ sourceSets { srcDir "${topsrcdir}/mobile/android/locales" srcDir "${topsrcdir}/mobile/android/modules" srcDir "${topsrcdir}/mobile/android/themes" + srcDir "${topsrcdir}/toolkit" } } } diff --git a/mobile/android/base/Makefile.in b/mobile/android/base/Makefile.in index 7bcf272e9106..1b78ec71dded 100644 --- a/mobile/android/base/Makefile.in +++ b/mobile/android/base/Makefile.in @@ -471,17 +471,13 @@ update-generated-wrappers: .PHONY: update-generated-wrappers # This target is only used by IDE integrations. It rebuilds resources -# that end up in omni.ja, does most of the packaging step, and then -# updates omni.ja in place. If you're not using an IDE, you should be -# using |mach build mobile/android && mach package|. +# that end up in omni.ja using the equivalent of |mach build faster|, +# does most of the packaging step, and then updates omni.ja in +# place. If you're not using an IDE, you should be using |mach build +# mobile/android && mach package|. $(abspath $(DIST)/fennec/$(OMNIJAR_NAME)): FORCE $(REPORT_BUILD) - $(MAKE) -C ../locales - $(MAKE) -C ../chrome - $(MAKE) -C ../components - $(MAKE) -C ../modules - $(MAKE) -C ../app - $(MAKE) -C ../themes/core + $(MAKE) -C ../../../faster $(MAKE) -C ../installer stage-package $(MKDIR) -p $(@D) rsync --update $(DIST)/fennec/$(notdir $(OMNIJAR_NAME)) $@ From 672223aab882ef77ec5e40eba220e280d9c6a790 Mon Sep 17 00:00:00 2001 From: Marco Bonardo Date: Thu, 10 Dec 2015 10:15:04 -0500 Subject: [PATCH 06/35] Bug 1231661 - Relax no-multi-spaces Eslint rule. r=Mossop --HG-- extra : commitid : 1EJvx7UZuqf extra : rebase_source : be2c04fcb78999c35e4aad215ce399dd50c2448f --- toolkit/.eslintrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolkit/.eslintrc b/toolkit/.eslintrc index f576c577915e..7d2539e17331 100644 --- a/toolkit/.eslintrc +++ b/toolkit/.eslintrc @@ -101,7 +101,7 @@ // "no-mixed-spaces-and-tabs": [2, "smart-tabs"], // No unnecessary spacing - // "no-multi-spaces": 2, + // no-multi-spaces: [2, { exceptions: { "AssignmentExpression": true, "VariableDeclarator": true, "ArrayExpression": true } }], // No reassigning native JS objects // "no-native-reassign": 2, From c4481294eec9c22d7a60429c634af88dfe7ef90a Mon Sep 17 00:00:00 2001 From: Marco Bonardo Date: Thu, 10 Dec 2015 14:09:38 -0500 Subject: [PATCH 07/35] Bug 1231661 - followup: readd somehow lost double quotes. r=post-facto --HG-- extra : commitid : 9yLTD3T4bWC --- toolkit/.eslintrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolkit/.eslintrc b/toolkit/.eslintrc index 7d2539e17331..5db3708c08f0 100644 --- a/toolkit/.eslintrc +++ b/toolkit/.eslintrc @@ -101,7 +101,7 @@ // "no-mixed-spaces-and-tabs": [2, "smart-tabs"], // No unnecessary spacing - // no-multi-spaces: [2, { exceptions: { "AssignmentExpression": true, "VariableDeclarator": true, "ArrayExpression": true } }], + // "no-multi-spaces": [2, { exceptions: { "AssignmentExpression": true, "VariableDeclarator": true, "ArrayExpression": true } }], // No reassigning native JS objects // "no-native-reassign": 2, From 4680ffb0805baff13ab2d3434528f53919b9babc Mon Sep 17 00:00:00 2001 From: Felipe Gomes Date: Thu, 10 Dec 2015 14:31:14 -0500 Subject: [PATCH 08/35] Bug 1231720 - Log when ESLint finishes running. r=nalexander --HG-- extra : commitid : 5u08LIBan4s --- python/mach_commands.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/python/mach_commands.py b/python/mach_commands.py index c27173133df8..def1b5d74b05 100644 --- a/python/mach_commands.py +++ b/python/mach_commands.py @@ -200,11 +200,16 @@ class MachCommands(MachCommandBase): '--ext', ext, # This keeps ext as a single argument. ] + args - return self.run_process(cmd_args, + success = self.run_process(cmd_args, pass_thru=True, # Allow user to run eslint interactively. ensure_exit_code=False, # Don't throw on non-zero exit code. require_unix_environment=True # eslint is not a valid Win32 binary. ) + + self.log(logging.INFO, 'eslint', {'msg': ('No errors' if success == 0 else 'Errors')}, + 'Finished eslint. {msg} encountered.') + return success + def eslint_setup(self, update_only=False): """Ensure eslint is optimally configured. From 19f1667df69beea787d2a5d3e6f99303512bb345 Mon Sep 17 00:00:00 2001 From: Felipe Gomes Date: Thu, 10 Dec 2015 14:34:44 -0500 Subject: [PATCH 09/35] Bug 1231728 - Enable no-dupe-args, no-dupe-keys, no-duplicate-case, no-obj-calls, no-with rules globally, no-redlecare and consistent-return in browser. r=Mossop --HG-- extra : commitid : Axo4haH85oJ --- browser/.eslintrc | 10 +++++++++- toolkit/.eslintrc | 10 +++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/browser/.eslintrc b/browser/.eslintrc index e7e9d8ce5928..230ece043bbc 100644 --- a/browser/.eslintrc +++ b/browser/.eslintrc @@ -1,5 +1,13 @@ { "extends": [ "../toolkit/.eslintrc" - ] + ], + + "rules": { + // No redeclaring variables + "no-redeclare": 2, + + // Functions must always return something or nothing + "consistent-return": 2, + } } diff --git a/toolkit/.eslintrc b/toolkit/.eslintrc index 5db3708c08f0..345239bef81e 100644 --- a/toolkit/.eslintrc +++ b/toolkit/.eslintrc @@ -53,13 +53,13 @@ // "no-array-constructor": 2, // No duplicate arguments in function declarations - // "no-dupe-args": 2, + "no-dupe-args": 2, // No duplicate keys in object declarations - // "no-dupe-keys": 2, + "no-dupe-keys": 2, // No duplicate cases in switch statements - // "no-duplicate-case": 2, + "no-duplicate-case": 2, // No labels // "no-labels": 2, @@ -116,7 +116,7 @@ // "no-new-object": 2, // No Math() or JSON() - // "no-obj-calls": 2, + "no-obj-calls": 2, // No octal literals // "no-octal": 2, @@ -158,7 +158,7 @@ // "no-use-before-define": [2, "nofunc"], // No using with - // "no-with": 2, + "no-with": 2, // Always require semicolon at end of statement // "semi": [2, "always"], From bddd338cd761b89f813da67bbf9ec8131de8367d Mon Sep 17 00:00:00 2001 From: Felipe Gomes Date: Thu, 10 Dec 2015 14:38:30 -0500 Subject: [PATCH 10/35] Bug 1231728 - Fixes some code to follow eslint rules. r=mak --HG-- extra : commitid : 2pB0pOqsHVW --- browser/base/content/browser-places.js | 6 ++++-- browser/base/content/browser.js | 8 ++++---- browser/base/content/pageinfo/pageInfo.js | 4 ++-- browser/components/extensions/ext-tabs.js | 4 ++-- toolkit/components/feeds/FeedProcessor.js | 1 - 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/browser/base/content/browser-places.js b/browser/base/content/browser-places.js index 94c652135f19..ce5ed1f16037 100644 --- a/browser/base/content/browser-places.js +++ b/browser/base/content/browser-places.js @@ -318,8 +318,10 @@ var PlacesCommandHook = { * whether or not to show the edit-bookmark UI for the bookmark item */ bookmarkPage: Task.async(function* (aBrowser, aParent, aShowEditUI) { - if (PlacesUIUtils.useAsyncTransactions) - return (yield this._bookmarkPagePT(aBrowser, aParent, aShowEditUI)); + if (PlacesUIUtils.useAsyncTransactions) { + yield this._bookmarkPagePT(aBrowser, aParent, aShowEditUI); + return; + } var uri = aBrowser.currentURI; var itemId = PlacesUtils.getMostRecentBookmarkForURI(uri); diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index ee3b46786564..72101a1d0084 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -502,8 +502,8 @@ var gPopupBlockerObserver = { this._reportButton.hidden = true; // Hide the notification box (if it's visible). - var notificationBox = gBrowser.getNotificationBox(); - var notification = notificationBox.getNotificationWithValue("popup-blocked"); + let notificationBox = gBrowser.getNotificationBox(); + let notification = notificationBox.getNotificationWithValue("popup-blocked"); if (notification) { notificationBox.removeNotification(notification, false); } @@ -534,8 +534,8 @@ var gPopupBlockerObserver = { .replace("#1", brandShortName) .replace("#2", popupCount); - var notificationBox = gBrowser.getNotificationBox(); - var notification = notificationBox.getNotificationWithValue("popup-blocked"); + let notificationBox = gBrowser.getNotificationBox(); + let notification = notificationBox.getNotificationWithValue("popup-blocked"); if (notification) { notification.label = message; } diff --git a/browser/base/content/pageinfo/pageInfo.js b/browser/base/content/pageinfo/pageInfo.js index 0527de6630c4..431b9d287319 100644 --- a/browser/base/content/pageinfo/pageInfo.js +++ b/browser/base/content/pageinfo/pageInfo.js @@ -839,7 +839,7 @@ function makePreview(row) // find out the file size var sizeText; if (cacheEntry) { - var imageSize = cacheEntry.dataSize; + let imageSize = cacheEntry.dataSize; var kbSize = Math.round(imageSize / 1024 * 100) / 100; sizeText = gBundle.getFormattedString("generalSize", [formatNumber(kbSize), formatNumber(imageSize)]); @@ -953,7 +953,7 @@ function makePreview(row) document.getElementById("theimagecontainer").collapsed = true; } - var imageSize = ""; + let imageSize = ""; if (url && !isAudio) { if (width != physWidth || height != physHeight) { imageSize = gBundle.getFormattedString("mediaDimensionsScaled", diff --git a/browser/components/extensions/ext-tabs.js b/browser/components/extensions/ext-tabs.js index 6ed5b7fc6f4d..1017806fdb8b 100644 --- a/browser/components/extensions/ext-tabs.js +++ b/browser/components/extensions/ext-tabs.js @@ -502,11 +502,11 @@ extensions.registerSchemaAPI("tabs", null, (extension, context) => { }, executeScript: function(tabId, details, callback) { - self.tabs._execute(tabId, details, 'js', callback); + self.tabs._execute(tabId, details, "js", callback); }, insertCss: function(tabId, details, callback) { - self.tabs._execute(tabId, details, 'css', callback); + self.tabs._execute(tabId, details, "css", callback); }, connect: function(tabId, connectInfo) { diff --git a/toolkit/components/feeds/FeedProcessor.js b/toolkit/components/feeds/FeedProcessor.js index 6b524163cfe9..e8e90f2fa61e 100644 --- a/toolkit/components/feeds/FeedProcessor.js +++ b/toolkit/components/feeds/FeedProcessor.js @@ -235,7 +235,6 @@ Feed.prototype = { generator: ["generator"], authors : ["authors"], contributors: ["contributors"], - title: ["title","rss1:title", "atom03:title","atom:title"], link: [["link",strToURI],["rss1:link",strToURI]], categories: ["categories", "dc:subject"], rights: ["atom03:rights","atom:rights"], From 1eefb717c675aedc1ff5822a4b5efb96492ab06c Mon Sep 17 00:00:00 2001 From: Felipe Gomes Date: Thu, 10 Dec 2015 14:39:12 -0500 Subject: [PATCH 11/35] Bug 1231728 - Fixes sync/setup.js switch statement. r=markh --HG-- extra : commitid : D6gDBTXrBPU --- browser/base/content/sync/setup.js | 1 - 1 file changed, 1 deletion(-) diff --git a/browser/base/content/sync/setup.js b/browser/base/content/sync/setup.js index c59f5219be64..568a50fcf48b 100644 --- a/browser/base/content/sync/setup.js +++ b/browser/base/content/sync/setup.js @@ -512,7 +512,6 @@ var gSyncSetup = { onWizardBack: function () { switch (this.wizard.pageIndex) { case NEW_ACCOUNT_START_PAGE: - case EXISTING_ACCOUNT_LOGIN_PAGE: this.wizard.pageIndex = INTRO_PAGE; return false; case EXISTING_ACCOUNT_CONNECT_PAGE: From b9206ee7420686d89a680712cee27c3236401c6c Mon Sep 17 00:00:00 2001 From: Patrick Brosset Date: Thu, 10 Dec 2015 15:46:32 -0500 Subject: [PATCH 12/35] Bug 1229859 - Massively reduce the number of eslint errors in devtools by ignoring lib files, adding missing .eslintrc files and making some rules be warnings; r=Mossop --HG-- extra : commitid : F4M9s89to3Y extra : rebase_source : 768a99038b43f548d8e0f88248d1be1fe7e5c579 extra : histedit_source : 619e1e7f909a09a7f5731ad8cef9e9a714d76b5e%2Ca78d84e263764af29e9e9e42f419f8189b223d8c --- .eslintignore | 6 +++++- devtools/.eslintrc | 12 ++++++------ devtools/client/aboutdebugging/test/.eslintrc | 4 ++++ devtools/client/commandline/test/.eslintrc | 6 +++++- devtools/client/jsonview/test/.eslintrc | 4 ++++ devtools/client/memory/test/browser/.eslintrc | 4 ++++ devtools/client/memory/test/unit/.eslintrc | 4 ++++ devtools/shared/apps/tests/unit/.eslintrc | 4 ++++ devtools/shared/heapsnapshot/tests/unit/.eslintrc | 4 ++++ devtools/shared/security/tests/unit/.eslintrc | 4 ++++ devtools/shared/tests/browser/.eslintrc | 4 ++++ devtools/shared/transport/tests/unit/.eslintrc | 4 ++++ devtools/shared/webconsole/test/unit/.eslintrc | 4 ++++ devtools/shared/worker/tests/browser/.eslintrc | 4 ++++ 14 files changed, 60 insertions(+), 8 deletions(-) create mode 100644 devtools/client/aboutdebugging/test/.eslintrc create mode 100644 devtools/client/jsonview/test/.eslintrc create mode 100644 devtools/client/memory/test/browser/.eslintrc create mode 100644 devtools/client/memory/test/unit/.eslintrc create mode 100644 devtools/shared/apps/tests/unit/.eslintrc create mode 100644 devtools/shared/heapsnapshot/tests/unit/.eslintrc create mode 100644 devtools/shared/security/tests/unit/.eslintrc create mode 100644 devtools/shared/tests/browser/.eslintrc create mode 100644 devtools/shared/transport/tests/unit/.eslintrc create mode 100644 devtools/shared/webconsole/test/unit/.eslintrc create mode 100644 devtools/shared/worker/tests/browser/.eslintrc diff --git a/.eslintignore b/.eslintignore index 0ddeac78258d..cf1522f3a6ef 100644 --- a/.eslintignore +++ b/.eslintignore @@ -128,6 +128,7 @@ devtools/client/webaudioeditor/lib/dagre-d3.js # Ignore codemirror devtools/client/sourceeditor/codemirror/*.js devtools/client/sourceeditor/codemirror/**/*.js +devtools/client/sourceeditor/test/codemirror/* # Ignore jquery test libs devtools/client/markupview/test/lib_* @@ -140,9 +141,12 @@ devtools/client/webide/webide-prefs.js # Ignore various libs devtools/shared/jsbeautify/* devtools/shared/acorn/* -devtools/shared/tern/* +devtools/client/sourceeditor/tern/* devtools/shared/pretty-fast/* devtools/shared/sourcemap/* +devtools/shared/qrcode/decoder/* +devtools/shared/qrcode/encoder/* +devtools/client/shared/vendor/* # mobile/android/ exclusions mobile/android/chrome/content diff --git a/devtools/.eslintrc b/devtools/.eslintrc index 0be3ee679004..830644326a7b 100644 --- a/devtools/.eslintrc +++ b/devtools/.eslintrc @@ -36,16 +36,16 @@ "block-scoped-var": 2, // Enforce one true brace style (opening brace on the same line) and avoid // start and end braces on the same line. - "brace-style": [2, "1tbs", {"allowSingleLine": false}], + "brace-style": [1, "1tbs", {"allowSingleLine": false}], // Require camel case names - "camelcase": 2, + "camelcase": 1, // Allow trailing commas for easy list extension. Having them does not // impair readability, but also not required either. "comma-dangle": 0, // Enforce spacing before and after comma - "comma-spacing": [2, {"before": false, "after": true}], + "comma-spacing": [1, {"before": false, "after": true}], // Enforce one true comma style. - "comma-style": [2, "last"], + "comma-style": [1, "last"], // Warn about cyclomatic complexity in functions. "complexity": 1, // Require return statements to either always or never specify values. @@ -84,7 +84,7 @@ // Only useful in a node environment. "handle-callback-err": 0, // Tab width. - "indent": [2, 2, {"SwitchCase": 1}], + "indent": [1, 2, {"SwitchCase": 1}], // Enforces spacing between keys and values in object literal properties. "key-spacing": [1, {"beforeColon": false, "afterColon": true}], // Allow mixed 'LF' and 'CRLF' as linebreaks. @@ -168,7 +168,7 @@ // Allow unnecessary parentheses, as they may make the code more readable. "no-extra-parens": 0, // Disallow unnecessary semicolons. - "no-extra-semi": 2, + "no-extra-semi": 1, // Deprecated, will be removed in 1.0. "no-extra-strict": 0, // Disallow fallthrough of case statements, except if there is a comment. diff --git a/devtools/client/aboutdebugging/test/.eslintrc b/devtools/client/aboutdebugging/test/.eslintrc new file mode 100644 index 000000000000..044c3e4f49e8 --- /dev/null +++ b/devtools/client/aboutdebugging/test/.eslintrc @@ -0,0 +1,4 @@ +{ + // Extend from the shared list of defined globals for mochitests. + "extends": "../../../.eslintrc.mochitests" +} diff --git a/devtools/client/commandline/test/.eslintrc b/devtools/client/commandline/test/.eslintrc index 044c3e4f49e8..7ee9912f0253 100644 --- a/devtools/client/commandline/test/.eslintrc +++ b/devtools/client/commandline/test/.eslintrc @@ -1,4 +1,8 @@ { // Extend from the shared list of defined globals for mochitests. - "extends": "../../../.eslintrc.mochitests" + "extends": "../../../.eslintrc.mochitests", + "globals": { + "helpers": true, + "assert": true + } } diff --git a/devtools/client/jsonview/test/.eslintrc b/devtools/client/jsonview/test/.eslintrc new file mode 100644 index 000000000000..044c3e4f49e8 --- /dev/null +++ b/devtools/client/jsonview/test/.eslintrc @@ -0,0 +1,4 @@ +{ + // Extend from the shared list of defined globals for mochitests. + "extends": "../../../.eslintrc.mochitests" +} diff --git a/devtools/client/memory/test/browser/.eslintrc b/devtools/client/memory/test/browser/.eslintrc new file mode 100644 index 000000000000..c73d0b308f27 --- /dev/null +++ b/devtools/client/memory/test/browser/.eslintrc @@ -0,0 +1,4 @@ +{ + // Extend from the shared list of defined globals for mochitests. + "extends": "../../../../.eslintrc.mochitests" +} diff --git a/devtools/client/memory/test/unit/.eslintrc b/devtools/client/memory/test/unit/.eslintrc new file mode 100644 index 000000000000..3a133a92001f --- /dev/null +++ b/devtools/client/memory/test/unit/.eslintrc @@ -0,0 +1,4 @@ +{ + // Extend from the shared list of defined globals for mochitests. + "extends": "../../../../.eslintrc.xpcshell" +} diff --git a/devtools/shared/apps/tests/unit/.eslintrc b/devtools/shared/apps/tests/unit/.eslintrc new file mode 100644 index 000000000000..3fe48b834e19 --- /dev/null +++ b/devtools/shared/apps/tests/unit/.eslintrc @@ -0,0 +1,4 @@ +{ + // Extend from the common devtools xpcshell eslintrc config. + "extends": "../../../../.eslintrc.xpcshell" +} \ No newline at end of file diff --git a/devtools/shared/heapsnapshot/tests/unit/.eslintrc b/devtools/shared/heapsnapshot/tests/unit/.eslintrc new file mode 100644 index 000000000000..3fe48b834e19 --- /dev/null +++ b/devtools/shared/heapsnapshot/tests/unit/.eslintrc @@ -0,0 +1,4 @@ +{ + // Extend from the common devtools xpcshell eslintrc config. + "extends": "../../../../.eslintrc.xpcshell" +} \ No newline at end of file diff --git a/devtools/shared/security/tests/unit/.eslintrc b/devtools/shared/security/tests/unit/.eslintrc new file mode 100644 index 000000000000..3fe48b834e19 --- /dev/null +++ b/devtools/shared/security/tests/unit/.eslintrc @@ -0,0 +1,4 @@ +{ + // Extend from the common devtools xpcshell eslintrc config. + "extends": "../../../../.eslintrc.xpcshell" +} \ No newline at end of file diff --git a/devtools/shared/tests/browser/.eslintrc b/devtools/shared/tests/browser/.eslintrc new file mode 100644 index 000000000000..044c3e4f49e8 --- /dev/null +++ b/devtools/shared/tests/browser/.eslintrc @@ -0,0 +1,4 @@ +{ + // Extend from the shared list of defined globals for mochitests. + "extends": "../../../.eslintrc.mochitests" +} diff --git a/devtools/shared/transport/tests/unit/.eslintrc b/devtools/shared/transport/tests/unit/.eslintrc new file mode 100644 index 000000000000..3fe48b834e19 --- /dev/null +++ b/devtools/shared/transport/tests/unit/.eslintrc @@ -0,0 +1,4 @@ +{ + // Extend from the common devtools xpcshell eslintrc config. + "extends": "../../../../.eslintrc.xpcshell" +} \ No newline at end of file diff --git a/devtools/shared/webconsole/test/unit/.eslintrc b/devtools/shared/webconsole/test/unit/.eslintrc new file mode 100644 index 000000000000..3fe48b834e19 --- /dev/null +++ b/devtools/shared/webconsole/test/unit/.eslintrc @@ -0,0 +1,4 @@ +{ + // Extend from the common devtools xpcshell eslintrc config. + "extends": "../../../../.eslintrc.xpcshell" +} \ No newline at end of file diff --git a/devtools/shared/worker/tests/browser/.eslintrc b/devtools/shared/worker/tests/browser/.eslintrc new file mode 100644 index 000000000000..c73d0b308f27 --- /dev/null +++ b/devtools/shared/worker/tests/browser/.eslintrc @@ -0,0 +1,4 @@ +{ + // Extend from the shared list of defined globals for mochitests. + "extends": "../../../../.eslintrc.mochitests" +} From 8b2a7c7941ff675508d689f9bce8d9f986dc07d5 Mon Sep 17 00:00:00 2001 From: Patrick Brosset Date: Fri, 4 Dec 2015 11:21:21 +0100 Subject: [PATCH 13/35] Bug 1229859 - Introduce new import-globals-from eslint rule to import globals from other modules; r=Mossop --HG-- extra : commitid : 3Qt8LBtIO0m extra : histedit_source : 5907ea5fdfeaa84b116dcc87bfae96e90d2ead9f --- devtools/.eslintrc | 1 + .../animationinspector/animation-panel.js | 3 +- .../docs/import-globals-from.rst | 18 +++++ testing/eslint-plugin-mozilla/docs/index.rst | 6 ++ testing/eslint-plugin-mozilla/lib/helpers.js | 29 +++++++ testing/eslint-plugin-mozilla/lib/index.js | 2 + .../lib/rules/import-globals-from.js | 78 +++++++++++++++++++ .../lib/rules/import-headjs-globals.js | 9 +-- 8 files changed, 140 insertions(+), 6 deletions(-) create mode 100644 testing/eslint-plugin-mozilla/docs/import-globals-from.rst create mode 100644 testing/eslint-plugin-mozilla/lib/rules/import-globals-from.js diff --git a/devtools/.eslintrc b/devtools/.eslintrc index 830644326a7b..cada2b761658 100644 --- a/devtools/.eslintrc +++ b/devtools/.eslintrc @@ -25,6 +25,7 @@ // Rules from the mozilla plugin "mozilla/balanced-listeners": 2, "mozilla/components-imports": 1, + "mozilla/import-globals-from": 1, "mozilla/import-headjs-globals": 1, "mozilla/mark-test-function-used": 1, "mozilla/no-aArgs": 1, diff --git a/devtools/client/animationinspector/animation-panel.js b/devtools/client/animationinspector/animation-panel.js index 1f28077ffa9d..190343417c10 100644 --- a/devtools/client/animationinspector/animation-panel.js +++ b/devtools/client/animationinspector/animation-panel.js @@ -3,7 +3,8 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * 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/. */ -/* globals AnimationsController, document, promise, gToolbox, gInspector */ +/* import-globals-from animation-controller.js */ +/* globals document */ "use strict"; diff --git a/testing/eslint-plugin-mozilla/docs/import-globals-from.rst b/testing/eslint-plugin-mozilla/docs/import-globals-from.rst new file mode 100644 index 000000000000..fcd32b301bc6 --- /dev/null +++ b/testing/eslint-plugin-mozilla/docs/import-globals-from.rst @@ -0,0 +1,18 @@ +.. _import-globals-from: + +=================== +import-globals-from +=================== + +Rule Details +------------ + +When the "import-globals-from " comment is found in a file, then all +globals from the file at will be imported in the current scope. + +This is useful for tests that rely on globals defined in head.js files, or for +scripts that are loaded as