Merge mozilla-central to mozilla-inbound
authorEd Morley <bmo@edmorley.co.uk>
Sat, 31 Dec 2011 13:10:25 +0000
changeset 84838 196f5b34b6e3979195a2cf5068eccaa96dc1133d
parent 84837 37348c68ba0b7bdfd6affeebd30cd7d8cd68a987 (current diff)
parent 84799 8f658d460c3d12f53e4068425c64555cb4007bfd (diff)
child 84839 7fc0a1ede6a9333b847f4b0e51ac075f3011d0c4
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone12.0a1
Merge mozilla-central to mozilla-inbound
--- a/browser/app/blocklist.xml
+++ b/browser/app/blocklist.xml
@@ -1,10 +1,10 @@
 <?xml version="1.0"?>
-<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist" lastupdate="1324588296000">
+<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist" lastupdate="1325216886000">
   <emItems>
       <emItem  blockID="i41" id="{99079a25-328f-4bd4-be04-00955acaa0a7}">
                         <versionRange  minVersion="0.1" maxVersion="4.3.1.00" severity="1">
                     </versionRange>
                   </emItem>
       <emItem  blockID="i8" id="{B13721C7-F507-4982-B2E5-502A71474FED}">
                         <versionRange  minVersion=" " severity="1">
                     </versionRange>
@@ -111,16 +111,18 @@
       <emItem  blockID="i6" id="{3f963a5b-e555-4543-90e2-c3908898db71}">
                         <versionRange  minVersion=" " maxVersion="8.5">
                     </versionRange>
                   </emItem>
       <emItem  blockID="i12" id="masterfiler@gmail.com">
                         <versionRange  severity="3">
                     </versionRange>
                   </emItem>
+      <emItem  blockID="i48" id="admin@youtubespeedup.com">
+                        </emItem>
       <emItem  blockID="i20" id="{AB2CE124-6272-4b12-94A9-7303C7397BD1}">
                         <versionRange  minVersion="0.1" maxVersion="5.2.0.7164" severity="1">
                     </versionRange>
                   </emItem>
       <emItem  blockID="i47" id="youtube@youtube2.com">
                         </emItem>
       <emItem  blockID="i17" id="{3252b9ae-c69a-4eaf-9502-dc9c1f6c009e}">
                         <versionRange  minVersion="2.2" maxVersion="2.2">
--- a/editor/libeditor/base/nsEditor.cpp
+++ b/editor/libeditor/base/nsEditor.cpp
@@ -116,16 +116,17 @@
 #include "nsComputedDOMStyle.h"
 #include "nsTextEditUtils.h"
 #include "nsComputedDOMStyle.h"
 
 #include "mozilla/FunctionTimer.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/dom/Element.h"
 #include "nsContentUtils.h"
+#include "nsCCUncollectableMarker.h"
 
 #define NS_ERROR_EDITOR_NO_SELECTION NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_EDITOR,1)
 #define NS_ERROR_EDITOR_NO_TEXTNODE  NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_EDITOR,2)
 
 #ifdef NS_DEBUG_EDITOR
 static bool gNoisy = false;
 #endif
 
@@ -194,16 +195,22 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(ns
  NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMARRAY(mActionListeners)
  NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMARRAY(mEditorObservers)
  NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMARRAY(mDocStateListeners)
  NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mEventTarget)
  NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mEventListener)
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsEditor)
+ nsIDocument* currentDoc =
+   tmp->mRootElement ? tmp->mRootElement->GetCurrentDoc() : nsnull;
+ if (currentDoc &&
+     nsCCUncollectableMarker::InGeneration(cb, currentDoc->GetMarkedCCGeneration())) {
+   return NS_SUCCESS_INTERRUPTED_TRAVERSE;
+ }
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mRootElement)
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mInlineSpellChecker)
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mTxnMgr)
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mIMETextRangeList)
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mIMETextNode)
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMARRAY(mActionListeners)
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMARRAY(mEditorObservers)
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMARRAY(mDocStateListeners)
--- a/editor/libeditor/base/nsEditorCommands.cpp
+++ b/editor/libeditor/base/nsEditorCommands.cpp
@@ -315,23 +315,17 @@ nsCutOrDeleteCommand::GetCommandStatePar
 NS_IMETHODIMP
 nsCopyCommand::IsCommandEnabled(const char * aCommandName,
                                 nsISupports *aCommandRefCon,
                                 bool *outCmdEnabled)
 {
   NS_ENSURE_ARG_POINTER(outCmdEnabled);
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
   if (editor)
-  {
-    bool isEditable = false;
-    nsresult rv = editor->GetIsSelectionEditable(&isEditable);
-    NS_ENSURE_SUCCESS(rv, rv);
-    if (isEditable)
-      return editor->CanCopy(outCmdEnabled);
-  }
+    return editor->CanCopy(outCmdEnabled);
 
   *outCmdEnabled = false;
   return NS_OK;
 }
 
 
 NS_IMETHODIMP
 nsCopyCommand::DoCommand(const char *aCommandName, nsISupports *aCommandRefCon)
@@ -658,29 +652,24 @@ NS_IMETHODIMP
 nsSelectAllCommand::IsCommandEnabled(const char * aCommandName,
                                      nsISupports *aCommandRefCon,
                                      bool *outCmdEnabled)
 {
   NS_ENSURE_ARG_POINTER(outCmdEnabled);
 
   nsresult rv = NS_OK;
   *outCmdEnabled = false;
-  bool docIsEmpty, selectionIsEditable;
+  bool docIsEmpty;
  
   // you can select all if there is an editor which is non-empty
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
   if (editor) {
-    rv = editor->GetIsSelectionEditable(&selectionIsEditable);
+    rv = editor->GetDocumentIsEmpty(&docIsEmpty);
     NS_ENSURE_SUCCESS(rv, rv);
-
-    if (selectionIsEditable) {
-      rv = editor->GetDocumentIsEmpty(&docIsEmpty);
-      NS_ENSURE_SUCCESS(rv, rv);
-      *outCmdEnabled = !docIsEmpty;
-    }
+    *outCmdEnabled = !docIsEmpty;
   } 
 
   return rv;
 }
 
 
 NS_IMETHODIMP
 nsSelectAllCommand::DoCommand(const char *aCommandName,
--- a/editor/libeditor/html/tests/test_bug676401.html
+++ b/editor/libeditor/html/tests/test_bug676401.html
@@ -27,23 +27,23 @@ https://bugzilla.mozilla.org/show_bug.cg
 <script type="application/javascript">
 
 /** Test for Bug 676401 **/
 SimpleTest.waitForExplicitFinish();
 SimpleTest.waitForFocus(runTests);
 
 var gBlock1, gBlock2;
 
-function IsCommandEnabled(command) {
+function IsCommandEnabled(command, alwaysEnabled) {
   var enabled;
 
-  // non-editable div: should return false
+  // non-editable div: should return false unless alwaysEnabled
   window.getSelection().selectAllChildren(gBlock1);
   enabled = document.queryCommandEnabled(command);
-  is(enabled, false, "'" + command + "' should not be enabled on a non-editable block.");
+  is(enabled, alwaysEnabled, "'" + command + "' should not be enabled on a non-editable block.");
 
   // editable div: should return true
   window.getSelection().selectAllChildren(gBlock2);
   enabled = document.queryCommandEnabled(command);
   is(enabled, true, "'" + command + "' should be enabled on an editable block.");
 }
 
 function runTests() {
@@ -62,47 +62,47 @@ function runTests() {
     "heading", "formatBlock",
     "contentReadOnly", "createLink",
     "decreaseFontSize", "increaseFontSize",
     "insertHTML", "insertHorizontalRule", "insertImage",
     "removeFormat", "selectAll", "styleWithCSS"
   ];
   document.execCommand("styleWithCSS", false, false);
   for (i = 0; i < commands.length; i++)
-    IsCommandEnabled(commands[i]);
+    IsCommandEnabled(commands[i], commands[i] == "selectAll");
   document.execCommand("styleWithCSS", false, true);
   for (i = 0; i < commands.length; i++)
-    IsCommandEnabled(commands[i]);
+    IsCommandEnabled(commands[i], commands[i] == "selectAll");
 
   // Mozilla-specific stuff
   commands = ["enableInlineTableEditing", "enableObjectResizing", "insertBrOnReturn"];
   for (i = 0; i < commands.length; i++)
-    IsCommandEnabled(commands[i]);
+    IsCommandEnabled(commands[i], false);
 
   // cut/copy/paste -- SpecialPowers required
   SpecialPowers.setCharPref("capability.policy.policynames",                      "allowclipboard");
   SpecialPowers.setCharPref("capability.policy.allowclipboard.sites",             "http://mochi.test:8888");
   SpecialPowers.setCharPref("capability.policy.allowclipboard.Clipboard.cutcopy", "allAccess");
   SpecialPowers.setCharPref("capability.policy.allowclipboard.Clipboard.paste",   "allAccess");
   commands = ["cut", "paste", "copy"];
   for (i = 0; i < commands.length; i++) {
-    IsCommandEnabled(commands[i]);
+    IsCommandEnabled(commands[i], commands[i] == "copy");
     document.execCommand(commands[i], false, false);
   }
   SpecialPowers.clearUserPref("capability.policy.policynames");
   SpecialPowers.clearUserPref("capability.policy.allowclipboard.sites");
   SpecialPowers.clearUserPref("capability.policy.allowclipboard.Clipboard.cutcopy");
   SpecialPowers.clearUserPref("capability.policy.allowclipboard.Clipboard.paste");
 
   // delete/undo/redo -- we have to execute this commands because:
   //  * there's nothing to undo if we haven't modified the selection first
   //  * there's nothing to redo if we haven't undone something first
   commands = ["delete", "undo", "redo"];
   for (i = 0; i < commands.length; i++) {
-    IsCommandEnabled(commands[i]);
+    IsCommandEnabled(commands[i], false);
     document.execCommand(commands[i], false, false);
   }
 
   // done
   SimpleTest.finish();
 }
 
 </script>
--- a/toolkit/toolkit-makefiles.sh
+++ b/toolkit/toolkit-makefiles.sh
@@ -417,16 +417,19 @@ MAKEFILES_xpcom="
   xpcom/proxy/src/Makefile
   xpcom/threads/Makefile
   xpcom/stub/Makefile
   xpcom/system/Makefile
   xpcom/idl-parser/Makefile
 "
 
 MAKEFILES_xpfe="
+  xpfe/components/autocomplete/Makefile
+  xpfe/components/autocomplete/public/Makefile
+  xpfe/components/autocomplete/src/Makefile
   xpfe/components/Makefile
   xpfe/components/directory/Makefile
   xpfe/components/windowds/Makefile
   xpfe/components/build/Makefile
   xpfe/appshell/Makefile
   xpfe/appshell/src/Makefile
   xpfe/appshell/public/Makefile
 "