Bug 611182 - Part 7: Don't notify the edit rules object for document modifications outside of the editable area; r=bzbarsky a=blocking-beta8+
authorEhsan Akhgari <ehsan@mozilla.com>
Sat, 13 Nov 2010 15:12:15 -0500
changeset 57485 98b0ae8881953f47aa601acbc7fa95ada11b0124
parent 57484 8c4b1c2924833701e31be35f4c93cc53c9a32803
child 57486 c1351e1799b8f0aa39c55263755367b452312217
push id16941
push usereakhgari@mozilla.com
push dateSun, 14 Nov 2010 21:28:20 +0000
treeherdermozilla-central@98b0ae888195 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbzbarsky, blocking-beta8
bugs611182
milestone2.0b8pre
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 611182 - Part 7: Don't notify the edit rules object for document modifications outside of the editable area; r=bzbarsky a=blocking-beta8+
editor/libeditor/html/nsHTMLEditor.cpp
--- a/editor/libeditor/html/nsHTMLEditor.cpp
+++ b/editor/libeditor/html/nsHTMLEditor.cpp
@@ -3859,31 +3859,31 @@ nsHTMLEditor::ContentInserted(nsIDocumen
   if (!aChild) {
     return;
   }
 
   if (ShouldReplaceRootElement()) {
     ResetRootElementAndEventTarget();
   }
   // We don't need to handle our own modifications
-  else if (!mAction) {
+  else if (!mAction && (aContainer ? aContainer->IsEditable() : aDocument->IsEditable())) {
     mRules->DocumentModified();
   }
 }
 
 void
 nsHTMLEditor::ContentRemoved(nsIDocument *aDocument, nsIContent* aContainer,
                              nsIContent* aChild, PRInt32 aIndexInContainer,
                              nsIContent* aPreviousSibling)
 {
   if (SameCOMIdentity(aChild, mRootElement)) {
     ResetRootElementAndEventTarget();
   }
   // We don't need to handle our own modifications
-  else if (!mAction) {
+  else if (!mAction && (aContainer ? aContainer->IsEditable() : aDocument->IsEditable())) {
     mRules->DocumentModified();
   }
 }
 
 #ifdef XP_MAC
 #pragma mark -
 #pragma mark  support utils
 #pragma mark -