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 id1
push usershaver@mozilla.com
push dateTue, 04 Jan 2011 17:58:04 +0000
reviewersbzbarsky, blocking-beta8
bugs611182
milestone2.0b8pre
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 -