Backed out changeset 3fca18104696 (bug 1170531) for e10s-m4 test failures in test_bug1067255.html
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Mon, 22 Jun 2015 15:21:02 +0200
changeset 280787 5b3a945118134a4f12c03619d76ee05bcbafc23b
parent 280786 46b61d66cd52943334dfa381725ac6d201d0465e
child 280788 22ad2f837fdaf7a04baef68ed8a7d7ca6e5d24ef
push id4932
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 18:23:06 +0000
treeherdermozilla-beta@6dd5a4f5f745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1170531, 1067255
milestone41.0a1
backs out3fca18104696e85d3f90c84802e03479b9c023ee
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 3fca18104696 (bug 1170531) for e10s-m4 test failures in test_bug1067255.html
dom/base/nsGlobalWindowCommands.cpp
editor/libeditor/nsPlaintextEditor.cpp
toolkit/content/editMenuOverlay.js
toolkit/content/globalOverlay.js
toolkit/content/tests/browser/browser.ini
toolkit/content/tests/browser/browser_bug1170531.js
--- a/dom/base/nsGlobalWindowCommands.cpp
+++ b/dom/base/nsGlobalWindowCommands.cpp
@@ -481,33 +481,24 @@ NS_IMPL_ISUPPORTS(nsClipboardCommand, ns
 
 nsresult
 nsClipboardCommand::IsCommandEnabled(const char* aCommandName, nsISupports *aContext, bool *outCmdEnabled)
 {
   NS_ENSURE_ARG_POINTER(outCmdEnabled);
   *outCmdEnabled = false;
 
   if (strcmp(aCommandName, "cmd_copy") &&
-      strcmp(aCommandName, "cmd_copyAndCollapseToEnd") &&
-      strcmp(aCommandName, "cmd_cut"))
+      strcmp(aCommandName, "cmd_copyAndCollapseToEnd"))
     return NS_OK;
 
   nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(aContext);
   NS_ENSURE_TRUE(window, NS_ERROR_FAILURE);
 
   nsCOMPtr<nsIDocument> doc = window->GetExtantDoc();
-  if (doc->IsHTMLOrXHTML()) {
-    // In HTML and XHTML documents, we always want cut and copy commands to be enabled.
-    *outCmdEnabled = true;
-  } else {
-    // Cut isn't enabled in xul documents which use nsClipboardCommand
-    if (strcmp(aCommandName, "cmd_cut")) {
-      *outCmdEnabled = nsCopySupport::CanCopy(doc);
-    }
-  }
+  *outCmdEnabled = nsCopySupport::CanCopy(doc);
   return NS_OK;
 }
 
 nsresult
 nsClipboardCommand::DoCommand(const char *aCommandName, nsISupports *aContext)
 {
   if (strcmp(aCommandName, "cmd_cut") &&
       strcmp(aCommandName, "cmd_copy") &&
--- a/editor/libeditor/nsPlaintextEditor.cpp
+++ b/editor/libeditor/nsPlaintextEditor.cpp
@@ -1150,22 +1150,16 @@ nsPlaintextEditor::Redo(uint32_t aCount)
 
   NotifyEditorObservers(eNotifyEditorObserversOfEnd);
   return result;
 }
 
 bool
 nsPlaintextEditor::CanCutOrCopy(PasswordFieldAllowed aPasswordFieldAllowed)
 {
-  nsCOMPtr<nsIDocument> doc = GetDocument();
-  if (doc && doc->IsHTMLOrXHTML()) {
-    // In HTML and XHTML documents, we always want cut and copy commands to be enabled.
-    return true;
-  }
-
   nsRefPtr<Selection> selection = GetSelection();
   if (!selection) {
     return false;
   }
 
   if (aPasswordFieldAllowed == ePasswordFieldNotAllowed &&
       IsPasswordEditor())
     return false;
--- a/toolkit/content/editMenuOverlay.js
+++ b/toolkit/content/editMenuOverlay.js
@@ -12,18 +12,17 @@ function goUpdateGlobalEditMenuItems()
   // cut, copy, and paste buttons been added to the toolbars) for performance.
   // This only works in applications/on platforms that set the gEditUIVisible
   // flag, so we check to see if that flag is defined before using it.
   if (typeof gEditUIVisible != "undefined" && !gEditUIVisible)
     return;
 
   goUpdateCommand("cmd_undo");
   goUpdateCommand("cmd_redo");
-  goUpdateCommand("cmd_cut");
-  goUpdateCommand("cmd_copy");
+  // don't update the cmd_cut or cmd_copy items - as we want them to always be enabled
   goUpdateCommand("cmd_paste");
   goUpdateCommand("cmd_selectAll");
   goUpdateCommand("cmd_delete");
   goUpdateCommand("cmd_switchTextDirection");
 }
 
 // update menu items that relate to undo/redo
 function goUpdateUndoEditMenuItems()
--- a/toolkit/content/globalOverlay.js
+++ b/toolkit/content/globalOverlay.js
@@ -88,17 +88,17 @@ function goUpdateCommand(aCommand)
   }
 }
 
 function goDoCommand(aCommand)
 {
   try {
     var controller = top.document.commandDispatcher
                         .getControllerForCommand(aCommand);
-    if (controller && controller.isCommandEnabled(aCommand))
+    if (controller)
       controller.doCommand(aCommand);
   }
   catch (e) {
     Components.utils.reportError("An error occurred executing the " +
                                  aCommand + " command: " + e);
   }
 }
 
--- a/toolkit/content/tests/browser/browser.ini
+++ b/toolkit/content/tests/browser/browser.ini
@@ -31,9 +31,8 @@ support-files =
   data/post_form_inner.sjs
   data/post_form_outer.sjs
 skip-if = e10s # Bug ?????? - test directly manipulates content (gBrowser.contentDocument.getElementById("postForm").submit();)
 [browser_content_url_annotation.js]
 skip-if = !e10s || !crashreporter
 support-files =
   file_redirect.html
   file_redirect_to.html
-[browser_bug1170531.js]
\ No newline at end of file
deleted file mode 100644
--- a/toolkit/content/tests/browser/browser_bug1170531.js
+++ /dev/null
@@ -1,36 +0,0 @@
-// Test for bug 1170531
-// https://bugzilla.mozilla.org/show_bug.cgi?id=1170531
-
-add_task(function* () {
-  yield BrowserTestUtils.withNewTab({ gBrowser: gBrowser, url: "about:blank" }, function* (browser) {
-    let menu_EditPopup = document.getElementById("menu_EditPopup");
-    let menu_cut_disabled, menu_copy_disabled;
-
-    yield BrowserTestUtils.loadURI(browser, "data:text/html,<div>hello!</div>");
-    browser.focus();
-    yield new Promise(resolve => waitForFocus(resolve, window));
-    goUpdateGlobalEditMenuItems();
-    menu_cut_disabled = menu_EditPopup.querySelector("#menu_cut").getAttribute('disabled') == "true";
-    is(menu_cut_disabled, false, "menu_cut should be enabled");
-    menu_copy_disabled = menu_EditPopup.querySelector("#menu_copy").getAttribute('disabled') == "true";
-    is(menu_copy_disabled, false, "menu_copy should be enabled");
-
-    yield BrowserTestUtils.loadURI(browser, "data:text/html,<div contentEditable='true'>hello!</div>");
-    browser.focus();
-    yield new Promise(resolve => waitForFocus(resolve, window));
-    goUpdateGlobalEditMenuItems();
-    menu_cut_disabled = menu_EditPopup.querySelector("#menu_cut").getAttribute('disabled') == "true";
-    is(menu_cut_disabled, false, "menu_cut should be enabled");
-    menu_copy_disabled = menu_EditPopup.querySelector("#menu_copy").getAttribute('disabled') == "true";
-    is(menu_copy_disabled, false, "menu_copy should be enabled");
-
-    yield BrowserTestUtils.loadURI(browser, "about:preferences");
-    browser.focus();
-    yield new Promise(resolve => waitForFocus(resolve, window));
-    goUpdateGlobalEditMenuItems();
-    menu_cut_disabled = menu_EditPopup.querySelector("#menu_cut").getAttribute('disabled') == "true";
-    is(menu_cut_disabled, true, "menu_cut should be disabled");
-    menu_copy_disabled = menu_EditPopup.querySelector("#menu_copy").getAttribute('disabled') == "true";
-    is(menu_copy_disabled, true, "menu_copy should be disabled");
-  });
-});