diff --git a/editor/libeditor/base/nsEditor.cpp b/editor/libeditor/base/nsEditor.cpp
--- a/editor/libeditor/base/nsEditor.cpp
+++ b/editor/libeditor/base/nsEditor.cpp
@@ -1231,20 +1231,19 @@ nsEditor::RemoveAttribute(nsIDOMElement 
   return result;
 }
 
 
 NS_IMETHODIMP
 nsEditor::MarkNodeDirty(nsIDOMNode* aNode)
 {  
   //  mark the node dirty.
-  nsCOMPtr<nsIContent> element (do_QueryInterface(aNode));
+  nsCOMPtr<nsIDOMElement> element (do_QueryInterface(aNode));
   if (element)
-    element->SetAttr(kNameSpaceID_None, nsEditProperty::mozdirty,
-                     EmptyString(), PR_FALSE);
+    element->SetAttribute(NS_LITERAL_STRING("_moz_dirty"), EmptyString());
   return NS_OK;
 }
 
 NS_IMETHODIMP nsEditor::GetInlineSpellChecker(PRBool autoCreate,
                                               nsIInlineSpellChecker ** aInlineSpellChecker)
 {
   NS_ENSURE_ARG_POINTER(aInlineSpellChecker);
 
@@ -3587,20 +3586,31 @@ nsEditor::IsEditable(nsIDOMNode *aNode)
     }
   }
   return PR_FALSE;  // didn't pass any editability test
 }
 
 PRBool
 nsEditor::IsMozEditorBogusNode(nsIDOMNode *aNode)
 {
-  nsCOMPtr<nsIContent> element = do_QueryInterface(aNode);
-  return element &&
-         element->AttrValueIs(kNameSpaceID_None, kMOZEditorBogusNodeAttrAtom,
-                              kMOZEditorBogusNodeValue, eCaseMatters);
+  if (!aNode)
+    return PR_FALSE;
+
+  nsCOMPtr<nsIDOMElement>element = do_QueryInterface(aNode);
+  if (element)
+  {
+    nsAutoString val;
+    (void)element->GetAttribute(kMOZEditorBogusNodeAttr, val);
+    if (val.Equals(kMOZEditorBogusNodeValue)) {
+      return PR_TRUE;
+    }
+  }
+    
+    return PR_FALSE;
+
 }
 
 nsresult
 nsEditor::CountEditableChildren(nsIDOMNode *aNode, PRUint32 &outCount) 
 {
   outCount = 0;
   if (!aNode) { return NS_ERROR_NULL_POINTER; }
   nsresult res=NS_OK;
diff --git a/editor/libeditor/base/nsEditor.h b/editor/libeditor/base/nsEditor.h
--- a/editor/libeditor/base/nsEditor.h
+++ b/editor/libeditor/base/nsEditor.h
@@ -83,16 +83,17 @@ class IMETextTxn;
 class AddStyleSheetTxn;
 class RemoveStyleSheetTxn;
 class nsIFile;
 class nsISelectionController;
 class nsIDOMEventTarget;
 class nsCSSStyleSheet;
 class nsKeyEvent;
 
+#define kMOZEditorBogusNodeAttr NS_LITERAL_STRING("_moz_editor_bogus_node")
 #define kMOZEditorBogusNodeAttrAtom nsEditProperty::mozEditorBogusNode
 #define kMOZEditorBogusNodeValue NS_LITERAL_STRING("TRUE")
 
 /** implementation of an editor object.  it will be the controller/focal point 
  *  for the main editor services. i.e. the GUIManager, publishing, transaction 
  *  manager, event interfaces. the idea for the event interfaces is to have them 
  *  delegate the actual commands to the editor independent of the XPFE implementation.
  */
diff --git a/editor/libeditor/text/nsTextEditRules.cpp b/editor/libeditor/text/nsTextEditRules.cpp
--- a/editor/libeditor/text/nsTextEditRules.cpp
+++ b/editor/libeditor/text/nsTextEditRules.cpp
@@ -1343,18 +1343,18 @@ nsTextEditRules::CreateBogusNodeIfNeeded
     if (NS_FAILED(res)) return res;
     nsCOMPtr<nsIDOMElement>brElement = do_QueryInterface(newContent);
 
     // set mBogusNode to be the newly created <br>
     mBogusNode = brElement;
     if (!mBogusNode) return NS_ERROR_NULL_POINTER;
 
     // give it a special attribute
-    newContent->SetAttr(kNameSpaceID_None, kMOZEditorBogusNodeAttrAtom,
-                        kMOZEditorBogusNodeValue, PR_FALSE);
+    brElement->SetAttribute( kMOZEditorBogusNodeAttr,
+                             kMOZEditorBogusNodeValue );
     
     // put the node in the document
     res = mEditor->InsertNode(mBogusNode, body, 0);
     if (NS_FAILED(res)) return res;
 
     // set selection
     aSelection->Collapse(body, 0);
   }
