Bug 1436389 - Switch xbl related files to a different method for determining their environment. r?Mossop
MozReview-Commit-ID: JLqFrKZykw
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -20,16 +20,31 @@ module.exports = {
"overrides": [{
// eslint-plugin-html handles eol-last slightly different - it applies to
// each set of script tags, so we turn it off here.
"files": "**/*.*html",
"rules": {
"eol-last": "off",
}
}, {
+ // These xbl bindings are assumed to be in the browser-window environment,
+ // we would mark it in the files, but ESLint made this more difficult with
+ // our xml processor, so we list them here. Bug 1397874 & co are working
+ // towards removing these files completely.
+ "files": [
+ "browser/base/content/tabbrowser.xml",
+ "browser/base/content/urlbarBindings.xml",
+ "browser/components/search/content/search.xml",
+ "browser/components/translation/translation-infobar.xml",
+ "toolkit/components/prompts/content/tabprompts.xml"
+ ],
+ "env": {
+ "mozilla/browser-window": true
+ }
+ },{
// XXX Bug 1421969. These files/directories are still being fixed,
// so turn off mozilla/use-services for them for now.
"files": [
"devtools/**",
"extensions/pref/**",
"mobile/android/**",
"testing/**",
],
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -1,16 +1,14 @@
<?xml version="1.0"?>
<!-- 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/. -->
-<!-- eslint-env mozilla/browser-window -->
-
<bindings id="tabBrowserBindings"
xmlns="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:xbl="http://www.mozilla.org/xbl">
<binding id="tabbrowser">
<resources>
<stylesheet src="chrome://browser/content/tabbrowser.css"/>
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -2,18 +2,16 @@
<!--
-*- Mode: HTML -*-
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/.
-->
-<!-- eslint-env mozilla/browser-window -->
-
<!DOCTYPE bindings [
<!ENTITY % notificationDTD SYSTEM "chrome://global/locale/notification.dtd">
%notificationDTD;
<!ENTITY % browserDTD SYSTEM "chrome://browser/locale/browser.dtd">
%browserDTD;
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
%brandDTD;
]>
--- a/browser/components/search/content/search.xml
+++ b/browser/components/search/content/search.xml
@@ -1,16 +1,13 @@
<?xml version="1.0"?>
<!-- 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/. -->
-<!-- This file is imported into the browser window. -->
-<!-- eslint-env mozilla/browser-window -->
-
<!-- XULCommandEvent is a specialised global. -->
<!-- global XULCommandEvent -->
<!DOCTYPE bindings [
<!ENTITY % browserDTD SYSTEM "chrome://browser/locale/browser.dtd">
%browserDTD;
]>
--- a/browser/components/translation/translation-infobar.xml
+++ b/browser/components/translation/translation-infobar.xml
@@ -1,15 +1,13 @@
<?xml version="1.0"?>
<!-- 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/. -->
-<!-- eslint-env mozilla/browser-window -->
-
<!DOCTYPE bindings [
<!ENTITY % notificationDTD SYSTEM "chrome://global/locale/notification.dtd">
%notificationDTD;
<!ENTITY % translationDTD SYSTEM "chrome://browser/locale/translation.dtd" >
%translationDTD;
]>
<bindings id="translationBindings"
--- a/toolkit/components/prompts/content/tabprompts.xml
+++ b/toolkit/components/prompts/content/tabprompts.xml
@@ -1,16 +1,15 @@
<?xml version="1.0"?>
<!-- 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/. -->
<!-- This file is imported into the browser window, and expects various variables,
e.g. Ci, Services, to be available. -->
-<!-- eslint-env mozilla/browser-window -->
<!DOCTYPE bindings [
<!ENTITY % commonDialogDTD SYSTEM "chrome://global/locale/commonDialog.dtd">
<!ENTITY % dialogOverlayDTD SYSTEM "chrome://global/locale/dialogOverlay.dtd">
%commonDialogDTD;
%dialogOverlayDTD;
]>