Bug 1534407 - Enable browser.xhtml by default r=mossop
authorBrian Grinstead <bgrinstead@mozilla.com>
Thu, 16 May 2019 16:34:20 +0000
changeset 474566 ad38bcbe7879cf715df2a49840b62d1235689882
parent 474565 5a721a7648f2db40785729ed8fc7c7444c1afcaf
child 474567 c50b4c90d56a76d96c138adfc3562cc5f135257a
push id36042
push userdvarga@mozilla.com
push dateTue, 21 May 2019 04:19:40 +0000
treeherdermozilla-central@ca560ff55451 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmossop
bugs1534407
milestone69.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1534407 - Enable browser.xhtml by default r=mossop Differential Revision: https://phabricator.services.mozilla.com/D26599
browser/base/jar.mn
browser/base/moz.build
browser/components/BrowserGlue.jsm
browser/confvars.sh
--- a/browser/base/jar.mn
+++ b/browser/base/jar.mn
@@ -23,20 +23,20 @@ browser.jar:
         content/browser/aboutNetError.js               (content/aboutNetError.js)
         content/browser/aboutRobots-icon.png          (content/aboutRobots-icon.png)
         content/browser/aboutFrameCrashed.html        (content/aboutFrameCrashed.html)
         content/browser/aboutTabCrashed.css           (content/aboutTabCrashed.css)
         content/browser/aboutTabCrashed.js            (content/aboutTabCrashed.js)
         content/browser/aboutTabCrashed.xhtml         (content/aboutTabCrashed.xhtml)
 *       content/browser/browser.css                   (content/browser.css)
         content/browser/browser.js                    (content/browser.js)
-#ifdef MOZ_BROWSER_XHTML
+#ifdef MOZ_BROWSER_XUL
+*       content/browser/browser.xul                   (content/browser.xul)
+#else
 *       content/browser/browser.xhtml                 (content/browser.xhtml)
-#else
-*       content/browser/browser.xul                   (content/browser.xul)
 #endif
         content/browser/browser-addons.js             (content/browser-addons.js)
         content/browser/browser-allTabsMenu.js        (content/browser-allTabsMenu.js)
         content/browser/browser-captivePortal.js      (content/browser-captivePortal.js)
         content/browser/browser-ctrlTab.js            (content/browser-ctrlTab.js)
         content/browser/browser-customization.js      (content/browser-customization.js)
         content/browser/browser-data-submission-info-bar.js (content/browser-data-submission-info-bar.js)
         content/browser/browser-contentblocking.js    (content/browser-contentblocking.js)
--- a/browser/base/moz.build
+++ b/browser/base/moz.build
@@ -54,18 +54,18 @@ BROWSER_CHROME_MANIFESTS += [
     'content/test/touch/browser.ini',
     'content/test/trackingUI/browser.ini',
     'content/test/webextensions/browser.ini',
     'content/test/webrtc/browser.ini',
 ]
 
 DEFINES['MOZ_APP_VERSION'] = CONFIG['MOZ_APP_VERSION']
 DEFINES['MOZ_APP_VERSION_DISPLAY'] = CONFIG['MOZ_APP_VERSION_DISPLAY']
-if CONFIG['MOZ_BROWSER_XHTML']:
-    DEFINES['MOZ_BROWSER_XHTML'] = CONFIG['MOZ_BROWSER_XHTML']
+if CONFIG['MOZ_BROWSER_XUL']:
+   DEFINES['MOZ_BROWSER_XUL'] = CONFIG['MOZ_BROWSER_XUL']
 
 DEFINES['APP_LICENSE_BLOCK'] = '%s/content/overrides/app-license.html' % SRCDIR
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'gtk3', 'cocoa'):
     DEFINES['CONTEXT_COPY_IMAGE_CONTENTS'] = 1
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'gtk3'):
     DEFINES['MENUBAR_CAN_AUTOHIDE'] = 1
--- a/browser/components/BrowserGlue.jsm
+++ b/browser/components/BrowserGlue.jsm
@@ -2311,21 +2311,30 @@ BrowserGlue.prototype = {
       };
 
       if (toolbarIsCustomized || getToolbarFolderCount() > NUM_TOOLBAR_BOOKMARKS_TO_UNHIDE) {
         xulStore.setValue(BROWSER_DOCURL, "PersonalToolbar", "collapsed", "false");
       }
     }
   },
 
+  _migrateXULStoreForDocument(fromURL, toURL) {
+    Array.from(Services.xulStore.getIDsEnumerator(fromURL)).forEach((id) => {
+      Array.from(Services.xulStore.getAttributeEnumerator(fromURL, id)).forEach(attr => {
+        let value = Services.xulStore.getValue(fromURL, id, attr);
+        Services.xulStore.setValue(toURL, id, attr, value);
+      });
+    });
+  },
+
   // eslint-disable-next-line complexity
   _migrateUI: function BG__migrateUI() {
     // Use an increasing number to keep track of the current migration state.
     // Completely unrelated to the current Firefox release number.
-    const UI_VERSION = 81;
+    const UI_VERSION = 82;
     const BROWSER_DOCURL = AppConstants.BROWSER_CHROME_URL;
 
     let currentUIVersion;
     if (Services.prefs.prefHasUserValue("browser.migration.version")) {
       currentUIVersion = Services.prefs.getIntPref("browser.migration.version");
     } else {
       // This is a new profile, nothing to migrate.
       Services.prefs.setIntPref("browser.migration.version", UI_VERSION);
@@ -2619,16 +2628,21 @@ BrowserGlue.prototype = {
           } else {
             value = updated;
             HomePage.set(value);
           }
         }
       }
     }
 
+    if (currentUIVersion < 82) {
+      this._migrateXULStoreForDocument("chrome://browser/content/browser.xul",
+                                       "chrome://browser/content/browser.xhtml");
+    }
+
     // Update the migration version.
     Services.prefs.setIntPref("browser.migration.version", UI_VERSION);
   },
 
   _checkForDefaultBrowser() {
     // Perform default browser checking.
     if (!ShellService) {
       return;
--- a/browser/confvars.sh
+++ b/browser/confvars.sh
@@ -26,20 +26,20 @@ if test "$OS_ARCH" = "WINNT"; then
       fi
     fi
   fi
 fi
 
 # Enable building ./signmar and running libmar signature tests
 MOZ_ENABLE_SIGNMAR=1
 
-if [ "${MOZ_BROWSER_XHTML}" = "1" ]; then
+if [ "${MOZ_BROWSER_XUL}" = "1" ]; then
+  BROWSER_CHROME_URL=chrome://browser/content/browser.xul
+else
   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_BRANDING_DIRECTORY is the default branding directory used when none is
 # specified. It should never point to the "official" branding directory.
 # For mozilla-beta, mozilla-release, or mozilla-central repositories, use
 # "unofficial" branding.
 # For the mozilla-aurora repository, use "aurora".