Bug 1482256 - Support switching to browser.xul to browser.xhtml. r=mossop

Adds a new environment variable MOZ_BROWSER_XHTML to change Firefox to load
a modified version of browser.xul as browser.xhtml. Adds the xhtml
namespace to the script tags to make them work.

MozReview-Commit-ID: 2adtOVzXHKd
This commit is contained in:
Brendan Dahl 2018-08-09 14:16:28 -07:00
parent b8dfc69c2a
commit 195f739823
8 changed files with 29 additions and 4 deletions

View file

@ -0,0 +1,3 @@
#define BROWSER_XHTML
#include browser.xul
#undef BROWSER_XHTML

View file

@ -72,7 +72,11 @@
# that they can be shared with macWindow.inc.xul. # that they can be shared with macWindow.inc.xul.
#include global-scripts.inc #include global-scripts.inc
<script type="application/javascript"> <script type="application/javascript"
#ifdef BROWSER_XHTML
xmlns="http://www.w3.org/1999/xhtml"
#endif
>
Services.scriptloader.loadSubScript("chrome://global/content/contentAreaUtils.js", this); Services.scriptloader.loadSubScript("chrome://global/content/contentAreaUtils.js", this);
Services.scriptloader.loadSubScript("chrome://browser/content/tabbrowser.js", this); Services.scriptloader.loadSubScript("chrome://browser/content/tabbrowser.js", this);
</script> </script>

View file

@ -7,7 +7,11 @@
# file so that ESLint works correctly: # file so that ESLint works correctly:
# tools/lint/eslint/eslint-plugin-mozilla/lib/environments/browser-window.js # tools/lint/eslint/eslint-plugin-mozilla/lib/environments/browser-window.js
<script type="application/javascript"> <script type="text/javascript"
#ifdef BROWSER_XHTML
xmlns="http://www.w3.org/1999/xhtml"
#endif
>
Components.utils.import("resource://gre/modules/Services.jsm"); Components.utils.import("resource://gre/modules/Services.jsm");
for (let script of [ for (let script of [

View file

@ -163,6 +163,8 @@ var whitelist = [
// Bug 1463225 (on Mac this is only used by a test) // Bug 1463225 (on Mac this is only used by a test)
{file: "chrome://global/content/bindings/toolbar.xml", {file: "chrome://global/content/bindings/toolbar.xml",
platforms: ["macosx"]}, platforms: ["macosx"]},
// Bug 1483277 (temporarily unreferenced)
{file: "chrome://browser/content/browser.xhtml"},
]; ];
whitelist = new Set(whitelist.filter(item => whitelist = new Set(whitelist.filter(item =>

View file

@ -29,6 +29,9 @@ browser.jar:
content/browser/aboutTabCrashed.xhtml (content/aboutTabCrashed.xhtml) content/browser/aboutTabCrashed.xhtml (content/aboutTabCrashed.xhtml)
* content/browser/browser.css (content/browser.css) * content/browser/browser.css (content/browser.css)
content/browser/browser.js (content/browser.js) content/browser/browser.js (content/browser.js)
#ifdef MOZ_BROWSER_XHTML
* content/browser/browser.xhtml (content/browser.xhtml)
#endif
* content/browser/browser.xul (content/browser.xul) * content/browser/browser.xul (content/browser.xul)
content/browser/browser-addons.js (content/browser-addons.js) content/browser/browser-addons.js (content/browser-addons.js)
content/browser/browser-allTabsMenu.js (content/browser-allTabsMenu.js) content/browser/browser-allTabsMenu.js (content/browser-allTabsMenu.js)

View file

@ -62,6 +62,7 @@ BROWSER_CHROME_MANIFESTS += [
DEFINES['MOZ_APP_VERSION'] = CONFIG['MOZ_APP_VERSION'] DEFINES['MOZ_APP_VERSION'] = CONFIG['MOZ_APP_VERSION']
DEFINES['MOZ_APP_VERSION_DISPLAY'] = CONFIG['MOZ_APP_VERSION_DISPLAY'] DEFINES['MOZ_APP_VERSION_DISPLAY'] = CONFIG['MOZ_APP_VERSION_DISPLAY']
DEFINES['MOZ_BROWSER_XHTML'] = CONFIG['MOZ_BROWSER_XHTML']
DEFINES['APP_LICENSE_BLOCK'] = '%s/content/overrides/app-license.html' % SRCDIR DEFINES['APP_LICENSE_BLOCK'] = '%s/content/overrides/app-license.html' % SRCDIR

View file

@ -40,7 +40,11 @@ MOZ_ENABLE_SIGNMAR=1
MOZ_APP_VERSION=$FIREFOX_VERSION MOZ_APP_VERSION=$FIREFOX_VERSION
MOZ_APP_VERSION_DISPLAY=$FIREFOX_VERSION_DISPLAY MOZ_APP_VERSION_DISPLAY=$FIREFOX_VERSION_DISPLAY
BROWSER_CHROME_URL=chrome://browser/content/browser.xul if [ "${MOZ_BROWSER_XHTML}" = "1" ]; then
BROWSER_CHROME_URL=chrome://browser/content/browser.xhtml
else
BROWSER_CHROME_URL=chrome://browser/content/browser.xul
fi
# MOZ_APP_DISPLAYNAME will be set by branding/configure.sh # MOZ_APP_DISPLAYNAME will be set by branding/configure.sh
# MOZ_BRANDING_DIRECTORY is the default branding directory used when none is # MOZ_BRANDING_DIRECTORY is the default branding directory used when none is

View file

@ -1,4 +1,8 @@
<script type="application/javascript" src="chrome://global/content/editMenuOverlay.js"/> <script type="application/javascript" src="chrome://global/content/editMenuOverlay.js"
#ifdef BROWSER_XHTML
xmlns="http://www.w3.org/1999/xhtml"
#endif
/>
<commandset id="editMenuCommands"> <commandset id="editMenuCommands">
<commandset id="editMenuCommandSetAll" commandupdater="true" events="focus,select" <commandset id="editMenuCommandSetAll" commandupdater="true" events="focus,select"
oncommandupdate="goUpdateGlobalEditMenuItems()"/> oncommandupdate="goUpdateGlobalEditMenuItems()"/>