Backed out changeset de77ab24fab9 (bug 1170011) for browser_viewSourceInTabOnViewSource.js failures.
authorRyan VanderMeulen <ryanvm@gmail.com>
Tue, 25 Aug 2015 23:16:22 -0400
changeset 259360 60383e5c8e4ef597f298e6e0c4e936775c381c3d
parent 259359 d4985245dfd55ba44e0417c42c956e03d094b0df
child 259361 c98c36baf339156b4a5cc1306787b28a2a72f82e
push id29277
push userryanvm@gmail.com
push dateWed, 26 Aug 2015 18:32:23 +0000
treeherdermozilla-central@fea87cbeaa6b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1170011
milestone43.0a1
backs outde77ab24fab948bdb153fd1e6baf0357b69238c6
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
Backed out changeset de77ab24fab9 (bug 1170011) for browser_viewSourceInTabOnViewSource.js failures.
browser/base/content/browser-context.inc
browser/base/content/browser-sets.inc
browser/base/content/browser.js
browser/base/content/test/general/browser.ini
browser/base/content/test/general/browser_viewSourceInTabOnViewSource.js
--- a/browser/base/content/browser-context.inc
+++ b/browser/base/content/browser-context.inc
@@ -377,17 +377,17 @@
                 accesskey="&viewPartialSourceCmd.accesskey;"
                 oncommand="gContextMenu.viewPartialSource('mathml');"
                 observes="isImage"/>
       <menuseparator id="context-sep-viewsource"/>
       <menuitem id="context-viewsource"
                 label="&viewPageSourceCmd.label;"
                 accesskey="&viewPageSourceCmd.accesskey;"
                 oncommand="BrowserViewSource(gContextMenu.browser);"
-                observes="canViewSource"/>
+                observes="isImage"/>
       <menuitem id="context-viewinfo"
                 label="&viewPageInfoCmd.label;"
                 accesskey="&viewPageInfoCmd.accesskey;"
                 oncommand="gContextMenu.viewInfo();"/>
       <menuseparator id="spell-separator"/>
       <menuitem id="spell-check-enabled"
                 label="&spellCheckToggle.label;"
                 type="checkbox"
--- a/browser/base/content/browser-sets.inc
+++ b/browser/base/content/browser-sets.inc
@@ -34,17 +34,17 @@
     <command id="cmd_closeWindow" oncommand="BrowserTryToCloseWindow()" reserved="true"/>
     <command id="cmd_toggleMute" oncommand="gBrowser.selectedTab.toggleMuteAudio()"/>
     <command id="cmd_CustomizeToolbars" oncommand="BrowserCustomizeToolbar()"/>
     <command id="cmd_quitApplication" oncommand="goQuitApplication()" reserved="true"/>
 
 
     <commandset id="editMenuCommands"/>
 
-    <command id="View:PageSource" oncommand="BrowserViewSource(window.gBrowser.selectedBrowser);" observes="canViewSource"/>
+    <command id="View:PageSource" oncommand="BrowserViewSource(window.gBrowser.selectedBrowser);" observes="isImage"/>
     <command id="View:PageInfo" oncommand="BrowserPageInfo();"/>
     <command id="View:FullScreen" oncommand="BrowserFullScreen();"/>
     <command id="View:ReaderView" oncommand="ReaderParent.toggleReaderMode(event);"/>
     <command id="cmd_find"
              oncommand="gFindBar.onFindCommand();"
              observes="isImage"/>
     <command id="cmd_findAgain"
              oncommand="gFindBar.onFindAgainCommand(false);"
@@ -169,17 +169,16 @@
                  accesskey="&editPopupSettings.accesskey;"
                  oncommand="gPopupBlockerObserver.editPopupSettings();"/>
     <broadcaster id="blockedPopupDontShowMessage"
                  accesskey="&dontShowMessage.accesskey;"
                  type="checkbox"
                  oncommand="gPopupBlockerObserver.dontShowMessage();"/>
     <broadcaster id="blockedPopupsSeparator"/>
     <broadcaster id="isImage"/>
-    <broadcaster id="canViewSource"/>
     <broadcaster id="isFrameImage"/>
     <broadcaster id="singleFeedMenuitemState" disabled="true"/>
     <broadcaster id="multipleFeedsMenuState" hidden="true"/>
     <broadcaster id="tabviewGroupsNumber" groups="1"/>
 #ifdef MOZ_SERVICES_SYNC
     <broadcaster id="sync-setup-state"/>
     <broadcaster id="sync-syncnow-state" hidden="true"/>
     <broadcaster id="sync-reauth-state" hidden="true"/>
@@ -227,19 +226,17 @@
                  key="key_responsiveUI"/>
     <broadcaster id="devtoolsMenuBroadcaster_Eyedropper"
                  label="&eyedropper.label;"
                  type="checkbox" autocheck="false"
                  command="Tools:Eyedropper"/>
     <broadcaster id="devtoolsMenuBroadcaster_PageSource"
                  label="&pageSourceCmd.label;"
                  key="key_viewSource"
-                 command="View:PageSource">
-      <observes element="canViewSource" attribute="disabled"/>
-    </broadcaster>
+                 command="View:PageSource"/>
     <broadcaster id="devtoolsMenuBroadcaster_ErrorConsole"
                  label="&errorConsoleCmd.label;"
                  command="Tools:ErrorConsole"/>
     <broadcaster id="devtoolsMenuBroadcaster_GetMoreTools"
                  label="&getMoreDevtoolsCmd.label;"
                  oncommand="openUILinkIn('https://addons.mozilla.org/firefox/collections/mozilla/webdeveloper/', 'tab');"/>
     <broadcaster id="devtoolsMenuBroadcaster_connect"
                  label="&devtoolsConnect.label;"
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -4044,20 +4044,16 @@ var XULBrowserWindow = {
   },
   get statusTextField () {
     return gBrowser.getStatusPanel();
   },
   get isImage () {
     delete this.isImage;
     return this.isImage = document.getElementById("isImage");
   },
-  get canViewSource () {
-    delete this.canViewSource;
-    return this.canViewSource = document.getElementById("canViewSource");
-  },
 
   init: function () {
     // Initialize the security button's state and tooltip text.
     var securityUI = gBrowser.securityUI;
     this.onSecurityChange(null, null, securityUI.state, true);
   },
 
   setJSStatus: function () {
@@ -4205,53 +4201,41 @@ var XULBrowserWindow = {
     }
     else if (aStateFlags & nsIWebProgressListener.STATE_STOP) {
       // This (thanks to the filter) is a network stop or the last
       // request stop outside of loading the document, stop throbbers
       // and progress bars and such
       if (aRequest) {
         let msg = "";
         let location;
-        let canViewSource = true;
         // Get the URI either from a channel or a pseudo-object
         if (aRequest instanceof nsIChannel || "URI" in aRequest) {
           location = aRequest.URI;
 
           // For keyword URIs clear the user typed value since they will be changed into real URIs
           if (location.scheme == "keyword" && aWebProgress.isTopLevel)
             gBrowser.userTypedValue = null;
 
-          canViewSource = !Services.prefs.getBoolPref("view_source.tab") ||
-                          location.scheme != "view-source";
-
           if (location.spec != "about:blank") {
             switch (aStatus) {
               case Components.results.NS_ERROR_NET_TIMEOUT:
                 msg = gNavigatorBundle.getString("nv_timeout");
                 break;
             }
           }
         }
 
         this.status = "";
         this.setDefaultStatus(msg);
 
         // Disable menu entries for images, enable otherwise
-        if (browser.documentContentType && BrowserUtils.mimeTypeIsTextBased(browser.documentContentType)) {
+        if (browser.documentContentType && BrowserUtils.mimeTypeIsTextBased(browser.documentContentType))
           this.isImage.removeAttribute('disabled');
-        } else {
-          canViewSource = false;
+        else
           this.isImage.setAttribute('disabled', 'true');
-        }
-
-        if (canViewSource) {
-          this.canViewSource.removeAttribute('disabled');
-        } else {
-          this.canViewSource.setAttribute('disabled', 'true');
-        }
       }
 
       this.isBusy = false;
 
       if (this._busyUI) {
         this._busyUI = false;
 
         this.stopCommand.setAttribute("disabled", "true");
--- a/browser/base/content/test/general/browser.ini
+++ b/browser/base/content/test/general/browser.ini
@@ -470,17 +470,16 @@ skip-if = os == "linux" || e10s # Bug 10
 [browser_urlbarSearchSingleWordNotification.js]
 [browser_urlbarSearchSuggestionsNotification.js]
 [browser_urlbarStop.js]
 [browser_urlbarTrimURLs.js]
 [browser_urlbar_autoFill_backspaced.js]
 [browser_urlbar_search_healthreport.js]
 [browser_urlbar_searchsettings.js]
 [browser_utilityOverlay.js]
-[browser_viewSourceInTabOnViewSource.js]
 [browser_visibleFindSelection.js]
 [browser_visibleLabel.js]
 [browser_visibleTabs.js]
 [browser_visibleTabs_bookmarkAllPages.js]
 skip-if = true # Bug 1005420 - fails intermittently. also with e10s enabled: bizarre problem with hidden tab having _mouseenter called, via _setPositionalAttributes, and tab not being found resulting in 'candidate is undefined'
 [browser_visibleTabs_bookmarkAllTabs.js]
 [browser_visibleTabs_contextMenu.js]
 [browser_visibleTabs_tabPreview.js]
deleted file mode 100644
--- a/browser/base/content/test/general/browser_viewSourceInTabOnViewSource.js
+++ /dev/null
@@ -1,31 +0,0 @@
-add_task(function*() {
-  yield new Promise((resolve) => {
-    SpecialPowers.pushPrefEnv({"set": [
-                                ["view_source.tab", true],
-                              ]}, resolve);
-  });
-});
-
-add_task(function* test_regular_page() {
-  function* test_expect_view_source_enabled(browser) {
-    ok(!XULBrowserWindow.canViewSource.hasAttribute("disabled"),
-       "View Source should be enabled");
-  }
-
-  yield BrowserTestUtils.withNewTab({
-    gBrowser,
-    url: "http://example.com",
-  }, test_expect_view_source_enabled);
-});
-
-add_task(function* test_view_source_page() {
-  function* test_expect_view_source_disabled(browser) {
-    ok(XULBrowserWindow.canViewSource.hasAttribute("disabled"),
-       "View Source should be disabled");
-  }
-
-  yield BrowserTestUtils.withNewTab({
-    gBrowser,
-    url: "view-source:http://example.com",
-  }, test_expect_view_source_disabled);
-});