Bug 626411 - Selecting a section of URL, then clicking "Delete" stays at refresh, instead of "go"; r=roc a=blocking-final+
authorEhsan Akhgari <ehsan@mozilla.com>
Wed, 19 Jan 2011 19:25:03 -0500
changeset 60988 26710d7a4b451513f59f6c27bff54393bf0419d5
parent 60987 c7d11beadb757e035ea92e4fc7d9af1c0fea0040
child 60990 26a942ad805b6af6f0fb2e631ec085ffa9c01e58
push idunknown
push userunknown
push dateunknown
reviewersroc, blocking-final
bugs626411
milestone2.0b10pre
Bug 626411 - Selecting a section of URL, then clicking "Delete" stays at refresh, instead of "go"; r=roc a=blocking-final+
editor/libeditor/text/nsPlaintextEditor.cpp
--- a/editor/libeditor/text/nsPlaintextEditor.cpp
+++ b/editor/libeditor/text/nsPlaintextEditor.cpp
@@ -738,22 +738,22 @@ NS_IMETHODIMP nsPlaintextEditor::DeleteS
 {
   if (!mRules) { return NS_ERROR_NOT_INITIALIZED; }
 
   // Protect the edit rules object from dying
   nsCOMPtr<nsIEditRules> kungFuDeathGrip(mRules);
 
   nsresult result;
 
+  FireTrustedInputEvent trusted(this, aAction != eNone);
+
   // delete placeholder txns merge.
   nsAutoPlaceHolderBatch batch(this, nsGkAtoms::DeleteTxnName);
   nsAutoRules beginRulesSniffing(this, kOpDeleteSelection, aAction);
 
-  FireTrustedInputEvent trusted(this, aAction != eNone);
-
   // pre-process
   nsCOMPtr<nsISelection> selection;
   result = GetSelection(getter_AddRefs(selection));
   NS_ENSURE_SUCCESS(result, result);
   NS_ENSURE_TRUE(selection, NS_ERROR_NULL_POINTER);
 
   // If there is an existing selection when an extended delete is requested,
   //  platforms that use "caret-style" caret positioning collapse the
@@ -1210,19 +1210,19 @@ nsPlaintextEditor::SetNewlineHandling(PR
 #endif
 
 NS_IMETHODIMP 
 nsPlaintextEditor::Undo(PRUint32 aCount)
 {
   // Protect the edit rules object from dying
   nsCOMPtr<nsIEditRules> kungFuDeathGrip(mRules);
 
-  nsAutoUpdateViewBatch beginViewBatching(this);
+  FireTrustedInputEvent trusted(this);
 
-  FireTrustedInputEvent trusted(this);
+  nsAutoUpdateViewBatch beginViewBatching(this);
 
   ForceCompositionEnd();
 
   nsAutoRules beginRulesSniffing(this, kOpUndo, nsIEditor::eNone);
 
   nsTextRulesInfo ruleInfo(nsTextEditRules::kUndo);
   nsCOMPtr<nsISelection> selection;
   GetSelection(getter_AddRefs(selection));
@@ -1239,19 +1239,19 @@ nsPlaintextEditor::Undo(PRUint32 aCount)
 }
 
 NS_IMETHODIMP 
 nsPlaintextEditor::Redo(PRUint32 aCount)
 {
   // Protect the edit rules object from dying
   nsCOMPtr<nsIEditRules> kungFuDeathGrip(mRules);
 
-  nsAutoUpdateViewBatch beginViewBatching(this);
+  FireTrustedInputEvent trusted(this);
 
-  FireTrustedInputEvent trusted(this);
+  nsAutoUpdateViewBatch beginViewBatching(this);
 
   ForceCompositionEnd();
 
   nsAutoRules beginRulesSniffing(this, kOpRedo, nsIEditor::eNone);
 
   nsTextRulesInfo ruleInfo(nsTextEditRules::kRedo);
   nsCOMPtr<nsISelection> selection;
   GetSelection(getter_AddRefs(selection));