Bug 1446533 part 1. Rename nsGenericDOMDataNode to CharacterData. r=mystor
authorBoris Zbarsky <bzbarsky@mit.edu>
Mon, 19 Mar 2018 15:18:06 -0400
changeset 408816 899edac390aa22850065c7b4b8a70a25f4168b49
parent 408815 910c72f13436ecbf40211b0e4e21321820147dee
child 408817 77630b78e554b65175734793b75c0732c8f22582
push id101056
push userbzbarsky@mozilla.com
push dateMon, 19 Mar 2018 19:51:43 +0000
treeherdermozilla-inbound@1a0cc5a0be89 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmystor
bugs1446533
milestone61.0a1
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 1446533 part 1. Rename nsGenericDOMDataNode to CharacterData. r=mystor This is not renaming the files yet; that will be a separate changeset. MozReview-Commit-ID: 5TxkEiQlaKF
dom/base/Comment.cpp
dom/base/Comment.h
dom/base/DirectionalityUtils.cpp
dom/base/DocumentType.cpp
dom/base/DocumentType.h
dom/base/Text.cpp
dom/base/Text.h
dom/base/nsGenericDOMDataNode.cpp
dom/base/nsGenericDOMDataNode.h
dom/base/nsINode.h
dom/base/nsRange.cpp
dom/base/nsTextNode.cpp
dom/base/nsTextNode.h
dom/bindings/Bindings.conf
dom/xml/CDATASection.cpp
dom/xml/CDATASection.h
dom/xml/ProcessingInstruction.cpp
dom/xml/ProcessingInstruction.h
dom/xml/XMLStylesheetProcessingInstruction.cpp
dom/xml/XMLStylesheetProcessingInstruction.h
editor/libeditor/DeleteRangeTransaction.cpp
editor/libeditor/DeleteTextTransaction.cpp
editor/libeditor/DeleteTextTransaction.h
editor/libeditor/EditorBase.cpp
editor/libeditor/EditorBase.h
editor/libeditor/HTMLEditRules.cpp
editor/libeditor/HTMLEditor.cpp
editor/libeditor/HTMLEditor.h
layout/base/GeometryUtils.cpp
layout/base/nsCSSFrameConstructor.cpp
layout/base/nsCSSFrameConstructor.h
layout/inspector/InspectorUtils.cpp
layout/inspector/InspectorUtils.h
layout/inspector/inDOMView.cpp
--- a/dom/base/Comment.cpp
+++ b/dom/base/Comment.cpp
@@ -18,26 +18,26 @@ using namespace dom;
 
 namespace mozilla {
 namespace dom {
 
 Comment::~Comment()
 {
 }
 
-NS_IMPL_ISUPPORTS_INHERITED(Comment, nsGenericDOMDataNode, nsIDOMNode,
+NS_IMPL_ISUPPORTS_INHERITED(Comment, CharacterData, nsIDOMNode,
                             nsIDOMCharacterData)
 
 bool
 Comment::IsNodeOfType(uint32_t aFlags) const
 {
   return !(aFlags & ~(eCOMMENT | eDATA_NODE));
 }
 
-nsGenericDOMDataNode*
+CharacterData*
 Comment::CloneDataNode(mozilla::dom::NodeInfo *aNodeInfo, bool aCloneText) const
 {
   RefPtr<mozilla::dom::NodeInfo> ni = aNodeInfo;
   Comment *it = new Comment(ni.forget());
   if (it && aCloneText) {
     it->mText = mText;
   }
 
--- a/dom/base/Comment.h
+++ b/dom/base/Comment.h
@@ -9,53 +9,53 @@
 
 #include "mozilla/Attributes.h"
 #include "nsIDOMCharacterData.h"
 #include "nsGenericDOMDataNode.h"
 
 namespace mozilla {
 namespace dom {
 
-class Comment final : public nsGenericDOMDataNode,
+class Comment final : public CharacterData,
                       public nsIDOMCharacterData
 {
 private:
   void Init()
   {
     MOZ_ASSERT(mNodeInfo->NodeType() == COMMENT_NODE,
                "Bad NodeType in aNodeInfo");
   }
 
   virtual ~Comment();
 
 public:
   explicit Comment(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
-    : nsGenericDOMDataNode(aNodeInfo)
+    : CharacterData(aNodeInfo)
   {
     Init();
   }
 
   explicit Comment(nsNodeInfoManager* aNodeInfoManager)
-    : nsGenericDOMDataNode(aNodeInfoManager->GetCommentNodeInfo())
+    : CharacterData(aNodeInfoManager->GetCommentNodeInfo())
   {
     Init();
   }
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMCharacterData
-  NS_FORWARD_NSIDOMCHARACTERDATA(nsGenericDOMDataNode::)
-  using nsGenericDOMDataNode::SetData; // Prevent hiding overloaded virtual function.
+  NS_FORWARD_NSIDOMCHARACTERDATA(CharacterData::)
+  using CharacterData::SetData; // Prevent hiding overloaded virtual function.
 
   // nsINode
   virtual bool IsNodeOfType(uint32_t aFlags) const override;
 
-  virtual nsGenericDOMDataNode* CloneDataNode(mozilla::dom::NodeInfo *aNodeInfo,
-                                              bool aCloneText) const override;
+  virtual CharacterData* CloneDataNode(mozilla::dom::NodeInfo *aNodeInfo,
+                                       bool aCloneText) const override;
 
   virtual nsIDOMNode* AsDOMNode() override { return this; }
 #ifdef DEBUG
   virtual void List(FILE* out, int32_t aIndent) const override;
   virtual void DumpContent(FILE* out = stdout, int32_t aIndent = 0,
                            bool aDumpAll = true) const override
   {
     return;
--- a/dom/base/DirectionalityUtils.cpp
+++ b/dom/base/DirectionalityUtils.cpp
@@ -195,17 +195,17 @@
 
   11. If the value of the @dir attribute on a bdi element is changed to an
   invalid value (or if it's removed), determine the new directionality similar
   to the case 3 above.
 
   == Implemention Notes ==
   When a new node gets bound to the tree, the BindToTree function gets called.
   The reverse case is UnbindFromTree.
-  When the contents of a text node change, nsGenericDOMDataNode::SetTextInternal
+  When the contents of a text node change, CharacterData::SetTextInternal
   gets called.
   */
 
 #include "mozilla/dom/DirectionalityUtils.h"
 
 #include "nsINode.h"
 #include "nsIContent.h"
 #include "nsIDocument.h"
--- a/dom/base/DocumentType.cpp
+++ b/dom/base/DocumentType.cpp
@@ -45,36 +45,36 @@ DocumentType::WrapNode(JSContext *cx, JS
 {
   return DocumentTypeBinding::Wrap(cx, this, aGivenProto);
 }
 
 DocumentType::DocumentType(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo,
                            const nsAString& aPublicId,
                            const nsAString& aSystemId,
                            const nsAString& aInternalSubset) :
-  nsGenericDOMDataNode(aNodeInfo),
+  CharacterData(aNodeInfo),
   mPublicId(aPublicId),
   mSystemId(aSystemId),
   mInternalSubset(aInternalSubset)
 {
   MOZ_ASSERT(mNodeInfo->NodeType() == DOCUMENT_TYPE_NODE,
              "Bad NodeType in aNodeInfo");
 }
 
 DocumentType::~DocumentType()
 {
 }
 
-NS_IMPL_ISUPPORTS_INHERITED(DocumentType, nsGenericDOMDataNode, nsIDOMNode)
+NS_IMPL_ISUPPORTS_INHERITED(DocumentType, CharacterData, nsIDOMNode)
 
 bool
 DocumentType::IsNodeOfType(uint32_t aFlags) const
 {
   // Don't claim to be eDATA_NODE since we're just inheriting
-  // nsGenericDOMDataNode for convinience. Doctypes aren't really
+  // CharacterData for convinience. Doctypes aren't really
   // data nodes (they have a null .nodeValue and don't implement
   // nsIDOMCharacterData)
   return false;
 }
 
 const nsTextFragment*
 DocumentType::GetText()
 {
@@ -100,17 +100,17 @@ DocumentType::GetSystemId(nsAString& aSy
 }
 
 void
 DocumentType::GetInternalSubset(nsAString& aInternalSubset) const
 {
   aInternalSubset = mInternalSubset;
 }
 
-nsGenericDOMDataNode*
+CharacterData*
 DocumentType::CloneDataNode(mozilla::dom::NodeInfo *aNodeInfo, bool aCloneText) const
 {
   already_AddRefed<mozilla::dom::NodeInfo> ni = RefPtr<mozilla::dom::NodeInfo>(aNodeInfo).forget();
   return new DocumentType(ni, mPublicId, mSystemId, mInternalSubset);
 }
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/base/DocumentType.h
+++ b/dom/base/DocumentType.h
@@ -21,17 +21,17 @@
 namespace mozilla {
 namespace dom {
 
 // XXX DocumentType is currently implemented by inheriting the generic
 // CharacterData object, even though DocumentType is not character
 // data. This is done simply for convenience and should be changed if
 // this restricts what should be done for character data.
 
-class DocumentType final : public nsGenericDOMDataNode,
+class DocumentType final : public CharacterData,
                            public nsIDOMNode
 {
 public:
   DocumentType(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo,
                const nsAString& aPublicId,
                const nsAString& aSystemId,
                const nsAString& aInternalSubset);
 
@@ -50,18 +50,18 @@ public:
   virtual void SetNodeValueInternal(const nsAString& aNodeValue,
                                     mozilla::ErrorResult& aError) override
   {
   }
 
   // nsIContent overrides
   virtual const nsTextFragment* GetText() override;
 
-  virtual nsGenericDOMDataNode* CloneDataNode(mozilla::dom::NodeInfo *aNodeInfo,
-                                              bool aCloneText) const override;
+  virtual CharacterData* CloneDataNode(mozilla::dom::NodeInfo *aNodeInfo,
+                                       bool aCloneText) const override;
 
   virtual nsIDOMNode* AsDOMNode() override { return this; }
 
   // WebIDL API
   void GetName(nsAString& aName) const;
   void GetPublicId(nsAString& aPublicId) const;
   void GetSystemId(nsAString& aSystemId) const;
   void GetInternalSubset(nsAString& aInternalSubset) const;
--- a/dom/base/Text.cpp
+++ b/dom/base/Text.cpp
@@ -29,17 +29,17 @@ Text::SplitText(uint32_t aOffset, ErrorR
     return nullptr;
   }
 
   nsIDocument* document = GetComposedDoc();
   mozAutoDocUpdate updateBatch(document, UPDATE_CONTENT_MODEL, true);
 
   // Use Clone for creating the new node so that the new node is of same class
   // as this node!
-  nsGenericDOMDataNode* clone = CloneDataNode(mNodeInfo, false);
+  CharacterData* clone = CloneDataNode(mNodeInfo, false);
   MOZ_ASSERT(clone && clone->IsText());
   RefPtr<Text> newContent = static_cast<Text*>(clone);
 
   // nsRange expects the CharacterDataChanged notification is followed
   // by an insertion of |newContent|. If you change this code,
   // make sure you make the appropriate changes in nsRange.
   newContent->SetText(cutText, true); // XXX should be false?
 
--- a/dom/base/Text.h
+++ b/dom/base/Text.h
@@ -8,25 +8,25 @@
 #define mozilla_dom_Text_h
 
 #include "nsGenericDOMDataNode.h"
 #include "mozilla/ErrorResult.h"
 
 namespace mozilla {
 namespace dom {
 
-class Text : public nsGenericDOMDataNode
+class Text : public CharacterData
 {
 public:
   explicit Text(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
-    : nsGenericDOMDataNode(aNodeInfo)
+    : CharacterData(aNodeInfo)
   {}
 
   explicit Text(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
-    : nsGenericDOMDataNode(aNodeInfo)
+    : CharacterData(aNodeInfo)
   {}
 
   // WebIDL API
   already_AddRefed<Text> SplitText(uint32_t aOffset, ErrorResult& rv);
   void GetWholeText(nsAString& aWholeText, ErrorResult& rv);
 
   static already_AddRefed<Text>
   Constructor(const GlobalObject& aGlobal,
--- a/dom/base/nsGenericDOMDataNode.cpp
+++ b/dom/base/nsGenericDOMDataNode.cpp
@@ -33,134 +33,134 @@
 #include "nsCCUncollectableMarker.h"
 #include "mozAutoDocUpdate.h"
 #include "nsTextNode.h"
 #include "nsBidiUtils.h"
 #include "PLDHashTable.h"
 #include "mozilla/Sprintf.h"
 #include "nsWrapperCacheInlines.h"
 
-using namespace mozilla;
-using namespace mozilla::dom;
+namespace mozilla {
+namespace dom {
 
-nsGenericDOMDataNode::nsGenericDOMDataNode(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
+CharacterData::CharacterData(already_AddRefed<dom::NodeInfo>& aNodeInfo)
   : nsIContent(aNodeInfo)
 {
   MOZ_ASSERT(mNodeInfo->NodeType() == TEXT_NODE ||
              mNodeInfo->NodeType() == CDATA_SECTION_NODE ||
              mNodeInfo->NodeType() == COMMENT_NODE ||
              mNodeInfo->NodeType() == PROCESSING_INSTRUCTION_NODE ||
              mNodeInfo->NodeType() == DOCUMENT_TYPE_NODE,
              "Bad NodeType in aNodeInfo");
 }
 
-nsGenericDOMDataNode::nsGenericDOMDataNode(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
+CharacterData::CharacterData(already_AddRefed<dom::NodeInfo>&& aNodeInfo)
   : nsIContent(aNodeInfo)
 {
   MOZ_ASSERT(mNodeInfo->NodeType() == TEXT_NODE ||
              mNodeInfo->NodeType() == CDATA_SECTION_NODE ||
              mNodeInfo->NodeType() == COMMENT_NODE ||
              mNodeInfo->NodeType() == PROCESSING_INSTRUCTION_NODE ||
              mNodeInfo->NodeType() == DOCUMENT_TYPE_NODE,
              "Bad NodeType in aNodeInfo");
 }
 
-nsGenericDOMDataNode::~nsGenericDOMDataNode()
+CharacterData::~CharacterData()
 {
   NS_PRECONDITION(!IsInUncomposedDoc(),
                   "Please remove this from the document properly");
   if (GetParent()) {
     NS_RELEASE(mParent);
   }
 }
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(nsGenericDOMDataNode)
+NS_IMPL_CYCLE_COLLECTION_CLASS(CharacterData)
 
-NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(nsGenericDOMDataNode)
+NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(CharacterData)
 
-NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(nsGenericDOMDataNode)
+NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(CharacterData)
   return Element::CanSkip(tmp, aRemovingAllowed);
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_END
 
-NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_BEGIN(nsGenericDOMDataNode)
+NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_BEGIN(CharacterData)
   return Element::CanSkipInCC(tmp);
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_END
 
-NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_BEGIN(nsGenericDOMDataNode)
+NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_BEGIN(CharacterData)
   return Element::CanSkipThis(tmp);
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_END
 
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsGenericDOMDataNode)
+NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(CharacterData)
   if (MOZ_UNLIKELY(cb.WantDebugInfo())) {
     char name[40];
-    SprintfLiteral(name, "nsGenericDOMDataNode (len=%d)",
+    SprintfLiteral(name, "CharacterData (len=%d)",
                    tmp->mText.GetLength());
     cb.DescribeRefCountedNode(tmp->mRefCnt.get(), name);
   } else {
-    NS_IMPL_CYCLE_COLLECTION_DESCRIBE(nsGenericDOMDataNode, tmp->mRefCnt.get())
+    NS_IMPL_CYCLE_COLLECTION_DESCRIBE(CharacterData, tmp->mRefCnt.get())
   }
 
   if (!nsIContent::Traverse(tmp, cb)) {
     return NS_SUCCESS_INTERRUPTED_TRAVERSE;
   }
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsGenericDOMDataNode)
+NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(CharacterData)
   nsIContent::Unlink(tmp);
 
   // Clear flag here because unlinking slots will clear the
   // containing shadow root pointer.
   tmp->UnsetFlags(NODE_IS_IN_SHADOW_TREE);
 
   nsContentSlots* slots = tmp->GetExistingContentSlots();
   if (slots) {
     slots->Unlink();
   }
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
-NS_INTERFACE_MAP_BEGIN(nsGenericDOMDataNode)
+NS_INTERFACE_MAP_BEGIN(CharacterData)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
-  NS_INTERFACE_MAP_ENTRIES_CYCLE_COLLECTION(nsGenericDOMDataNode)
+  NS_INTERFACE_MAP_ENTRIES_CYCLE_COLLECTION(CharacterData)
   NS_INTERFACE_MAP_ENTRY(nsIContent)
   NS_INTERFACE_MAP_ENTRY(nsINode)
   NS_INTERFACE_MAP_ENTRY(nsIDOMEventTarget)
   NS_INTERFACE_MAP_ENTRY(mozilla::dom::EventTarget)
   NS_INTERFACE_MAP_ENTRY_TEAROFF(nsISupportsWeakReference,
                                  new nsNodeSupportsWeakRefTearoff(this))
   // DOM bindings depend on the identity pointer being the
   // same as nsINode (which nsIContent inherits).
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIContent)
 NS_INTERFACE_MAP_END
 
-NS_IMPL_MAIN_THREAD_ONLY_CYCLE_COLLECTING_ADDREF(nsGenericDOMDataNode)
-NS_IMPL_MAIN_THREAD_ONLY_CYCLE_COLLECTING_RELEASE_WITH_LAST_RELEASE(nsGenericDOMDataNode,
+NS_IMPL_MAIN_THREAD_ONLY_CYCLE_COLLECTING_ADDREF(CharacterData)
+NS_IMPL_MAIN_THREAD_ONLY_CYCLE_COLLECTING_RELEASE_WITH_LAST_RELEASE(CharacterData,
                                                                     nsNodeUtils::LastRelease(this))
 
 
 void
-nsGenericDOMDataNode::GetNodeValueInternal(nsAString& aNodeValue)
+CharacterData::GetNodeValueInternal(nsAString& aNodeValue)
 {
   DebugOnly<nsresult> rv = GetData(aNodeValue);
   NS_ASSERTION(NS_SUCCEEDED(rv), "GetData() failed!");
 }
 
 void
-nsGenericDOMDataNode::SetNodeValueInternal(const nsAString& aNodeValue,
+CharacterData::SetNodeValueInternal(const nsAString& aNodeValue,
                                            ErrorResult& aError)
 {
   aError = SetTextInternal(0, mText.GetLength(), aNodeValue.BeginReading(),
                            aNodeValue.Length(), true);
 }
 
 //----------------------------------------------------------------------
 
 // Implementation of nsIDOMCharacterData
 
 nsresult
-nsGenericDOMDataNode::GetData(nsAString& aData) const
+CharacterData::GetData(nsAString& aData) const
 {
   if (mText.Is2b()) {
     aData.Truncate();
     mText.AppendTo(aData);
   } else {
     // Must use Substring() since nsDependentCString() requires null
     // terminated strings.
 
@@ -172,41 +172,41 @@ nsGenericDOMDataNode::GetData(nsAString&
       aData.Truncate();
     }
   }
 
   return NS_OK;
 }
 
 nsresult
-nsGenericDOMDataNode::SetData(const nsAString& aData)
+CharacterData::SetData(const nsAString& aData)
 {
   return SetTextInternal(0, mText.GetLength(), aData.BeginReading(),
                          aData.Length(), true);
 }
 
 nsresult
-nsGenericDOMDataNode::GetLength(uint32_t* aLength)
+CharacterData::GetLength(uint32_t* aLength)
 {
   *aLength = mText.GetLength();
   return NS_OK;
 }
 
 nsresult
-nsGenericDOMDataNode::SubstringData(uint32_t aStart, uint32_t aCount,
-                                    nsAString& aReturn)
+CharacterData::SubstringData(uint32_t aStart, uint32_t aCount,
+                             nsAString& aReturn)
 {
   ErrorResult rv;
   SubstringData(aStart, aCount, aReturn, rv);
   return rv.StealNSResult();
 }
 
 void
-nsGenericDOMDataNode::SubstringData(uint32_t aStart, uint32_t aCount,
-                                    nsAString& aReturn, ErrorResult& rv)
+CharacterData::SubstringData(uint32_t aStart, uint32_t aCount,
+                             nsAString& aReturn, ErrorResult& rv)
 {
   aReturn.Truncate();
 
   uint32_t textLength = mText.GetLength();
   if (aStart > textLength) {
     rv.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR);
     return;
   }
@@ -225,49 +225,49 @@ nsGenericDOMDataNode::SubstringData(uint
     const char *data = mText.Get1b() + aStart;
     CopyASCIItoUTF16(Substring(data, data + amount), aReturn);
   }
 }
 
 //----------------------------------------------------------------------
 
 nsresult
-nsGenericDOMDataNode::AppendData(const nsAString& aData)
+CharacterData::AppendData(const nsAString& aData)
 {
   return SetTextInternal(mText.GetLength(), 0, aData.BeginReading(),
                          aData.Length(), true);
 }
 
 nsresult
-nsGenericDOMDataNode::InsertData(uint32_t aOffset,
-                                 const nsAString& aData)
+CharacterData::InsertData(uint32_t aOffset,
+                          const nsAString& aData)
 {
   return SetTextInternal(aOffset, 0, aData.BeginReading(),
                          aData.Length(), true);
 }
 
 nsresult
-nsGenericDOMDataNode::DeleteData(uint32_t aOffset, uint32_t aCount)
+CharacterData::DeleteData(uint32_t aOffset, uint32_t aCount)
 {
   return SetTextInternal(aOffset, aCount, nullptr, 0, true);
 }
 
 nsresult
-nsGenericDOMDataNode::ReplaceData(uint32_t aOffset, uint32_t aCount,
-                                  const nsAString& aData)
+CharacterData::ReplaceData(uint32_t aOffset, uint32_t aCount,
+                           const nsAString& aData)
 {
   return SetTextInternal(aOffset, aCount, aData.BeginReading(),
                          aData.Length(), true);
 }
 
 nsresult
-nsGenericDOMDataNode::SetTextInternal(uint32_t aOffset, uint32_t aCount,
-                                      const char16_t* aBuffer,
-                                      uint32_t aLength, bool aNotify,
-                                      CharacterDataChangeInfo::Details* aDetails)
+CharacterData::SetTextInternal(uint32_t aOffset, uint32_t aCount,
+                               const char16_t* aBuffer,
+                               uint32_t aLength, bool aNotify,
+                               CharacterDataChangeInfo::Details* aDetails)
 {
   NS_PRECONDITION(aBuffer || !aLength,
                   "Null buffer passed to SetTextInternal!");
 
   // sanitize arguments
   uint32_t textLength = mText.GetLength();
   if (aOffset > textLength) {
     return NS_ERROR_DOM_INDEX_SIZE_ERR;
@@ -410,18 +410,18 @@ nsGenericDOMDataNode::SetTextInternal(ui
 }
 
 //----------------------------------------------------------------------
 
 // Implementation of nsIContent
 
 #ifdef DEBUG
 void
-nsGenericDOMDataNode::ToCString(nsAString& aBuf, int32_t aOffset,
-                                int32_t aLen) const
+CharacterData::ToCString(nsAString& aBuf, int32_t aOffset,
+                         int32_t aLen) const
 {
   if (mText.Is2b()) {
     const char16_t* cp = mText.Get2b() + aOffset;
     const char16_t* end = cp + aLen;
 
     while (cp < end) {
       char16_t ch = *cp++;
       if (ch == '&') {
@@ -459,19 +459,19 @@ nsGenericDOMDataNode::ToCString(nsAStrin
       }
     }
   }
 }
 #endif
 
 
 nsresult
-nsGenericDOMDataNode::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
-                                 nsIContent* aBindingParent,
-                                 bool aCompileEventHandlers)
+CharacterData::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
+                          nsIContent* aBindingParent,
+                          bool aCompileEventHandlers)
 {
   NS_PRECONDITION(aParent || aDocument, "Must have document if no parent!");
   NS_PRECONDITION(NODE_FROM(aParent, aDocument)->OwnerDoc() == OwnerDoc(),
                   "Must have the same owner document");
   NS_PRECONDITION(!aParent || aDocument == aParent->GetUncomposedDoc(),
                   "aDocument must be current doc of aParent");
   NS_PRECONDITION(!GetUncomposedDoc() && !IsInUncomposedDoc(),
                   "Already have a document.  Unbind first!");
@@ -568,17 +568,17 @@ nsGenericDOMDataNode::BindToTree(nsIDocu
   MOZ_ASSERT(aParent == GetParent(), "Bound to wrong parent");
   MOZ_ASSERT(aBindingParent == GetBindingParent(),
              "Bound to wrong binding parent");
 
   return NS_OK;
 }
 
 void
-nsGenericDOMDataNode::UnbindFromTree(bool aDeep, bool aNullParent)
+CharacterData::UnbindFromTree(bool aDeep, bool aNullParent)
 {
   // Unset frame flags; if we need them again later, they'll get set again.
   UnsetFlags(NS_CREATE_FRAME_IF_NON_WHITESPACE |
              NS_REFRAME_IF_WHITESPACE);
 
   nsIDocument* document = GetComposedDoc();
 
   if (aNullParent) {
@@ -620,152 +620,152 @@ nsGenericDOMDataNode::UnbindFromTree(boo
       slots->mContainingShadow = nullptr;
     }
   }
 
   nsNodeUtils::ParentChainChanged(this);
 }
 
 already_AddRefed<nsINodeList>
-nsGenericDOMDataNode::GetChildren(uint32_t aFilter)
+CharacterData::GetChildren(uint32_t aFilter)
 {
   return nullptr;
 }
 
 uint32_t
-nsGenericDOMDataNode::GetChildCount() const
+CharacterData::GetChildCount() const
 {
   return 0;
 }
 
 nsIContent *
-nsGenericDOMDataNode::GetChildAt_Deprecated(uint32_t aIndex) const
+CharacterData::GetChildAt_Deprecated(uint32_t aIndex) const
 {
   return nullptr;
 }
 
 
 int32_t
-nsGenericDOMDataNode::ComputeIndexOf(const nsINode* aPossibleChild) const
+CharacterData::ComputeIndexOf(const nsINode* aPossibleChild) const
 {
   return -1;
 }
 
 nsresult
-nsGenericDOMDataNode::InsertChildBefore(nsIContent* aKid,
-                                        nsIContent* aBeforeThis,
-                                        bool aNotify)
+CharacterData::InsertChildBefore(nsIContent* aKid,
+                                 nsIContent* aBeforeThis,
+                                 bool aNotify)
 {
   return NS_OK;
 }
 
 nsresult
-nsGenericDOMDataNode::InsertChildAt_Deprecated(nsIContent* aKid,
-                                               uint32_t aIndex,
-                                               bool aNotify)
+CharacterData::InsertChildAt_Deprecated(nsIContent* aKid,
+                                        uint32_t aIndex,
+                                        bool aNotify)
 {
   return NS_OK;
 }
 
 void
-nsGenericDOMDataNode::RemoveChildAt_Deprecated(uint32_t aIndex, bool aNotify)
+CharacterData::RemoveChildAt_Deprecated(uint32_t aIndex, bool aNotify)
 {
 }
 
 void
-nsGenericDOMDataNode::RemoveChildNode(nsIContent* aKid, bool aNotify)
+CharacterData::RemoveChildNode(nsIContent* aKid, bool aNotify)
 {
 }
 
 nsXBLBinding *
-nsGenericDOMDataNode::DoGetXBLBinding() const
+CharacterData::DoGetXBLBinding() const
 {
   return nullptr;
 }
 
 bool
-nsGenericDOMDataNode::IsNodeOfType(uint32_t aFlags) const
+CharacterData::IsNodeOfType(uint32_t aFlags) const
 {
   return !(aFlags & ~eDATA_NODE);
 }
 
 void
-nsGenericDOMDataNode::SaveSubtreeState()
+CharacterData::SaveSubtreeState()
 {
 }
 
 #ifdef DEBUG
 void
-nsGenericDOMDataNode::List(FILE* out, int32_t aIndent) const
+CharacterData::List(FILE* out, int32_t aIndent) const
 {
 }
 
 void
-nsGenericDOMDataNode::DumpContent(FILE* out, int32_t aIndent,
-                                  bool aDumpAll) const
+CharacterData::DumpContent(FILE* out, int32_t aIndent,
+                           bool aDumpAll) const
 {
 }
 #endif
 
 bool
-nsGenericDOMDataNode::IsLink(nsIURI** aURI) const
+CharacterData::IsLink(nsIURI** aURI) const
 {
   *aURI = nullptr;
   return false;
 }
 
 //----------------------------------------------------------------------
 
 // Implementation of the nsIContent interface text functions
 
 const nsTextFragment *
-nsGenericDOMDataNode::GetText()
+CharacterData::GetText()
 {
   return &mText;
 }
 
 uint32_t
-nsGenericDOMDataNode::TextLength() const
+CharacterData::TextLength() const
 {
   return TextDataLength();
 }
 
 nsresult
-nsGenericDOMDataNode::SetText(const char16_t* aBuffer,
-                              uint32_t aLength,
-                              bool aNotify)
+CharacterData::SetText(const char16_t* aBuffer,
+                       uint32_t aLength,
+                       bool aNotify)
 {
   return SetTextInternal(0, mText.GetLength(), aBuffer, aLength, aNotify);
 }
 
 nsresult
-nsGenericDOMDataNode::AppendText(const char16_t* aBuffer,
-                                 uint32_t aLength,
-                                 bool aNotify)
+CharacterData::AppendText(const char16_t* aBuffer,
+                          uint32_t aLength,
+                          bool aNotify)
 {
   return SetTextInternal(mText.GetLength(), 0, aBuffer, aLength, aNotify);
 }
 
 bool
-nsGenericDOMDataNode::TextIsOnlyWhitespace()
+CharacterData::TextIsOnlyWhitespace()
 {
 
   MOZ_ASSERT(NS_IsMainThread());
   if (!ThreadSafeTextIsOnlyWhitespace()) {
     UnsetFlags(NS_TEXT_IS_ONLY_WHITESPACE);
     SetFlags(NS_CACHED_TEXT_IS_ONLY_WHITESPACE);
     return false;
   }
 
   SetFlags(NS_CACHED_TEXT_IS_ONLY_WHITESPACE | NS_TEXT_IS_ONLY_WHITESPACE);
   return true;
 }
 
 bool
-nsGenericDOMDataNode::ThreadSafeTextIsOnlyWhitespace() const
+CharacterData::ThreadSafeTextIsOnlyWhitespace() const
 {
   // FIXME: should this method take content language into account?
   if (mText.Is2b()) {
     // The fragment contains non-8bit characters and such characters
     // are never considered whitespace.
     //
     // FIXME(emilio): This is not quite true in presence of the
     // NS_MAYBE_MODIFIED_FREQUENTLY flag... But looks like we only set that on
@@ -791,17 +791,17 @@ nsGenericDOMDataNode::ThreadSafeTextIsOn
 
     ++cp;
   }
 
   return true;
 }
 
 bool
-nsGenericDOMDataNode::HasTextForTranslation()
+CharacterData::HasTextForTranslation()
 {
   if (NodeType() != TEXT_NODE &&
       NodeType() != CDATA_SECTION_NODE) {
     return false;
   }
 
   if (mText.Is2b()) {
     // The fragment contains non-8bit characters which means there
@@ -831,36 +831,38 @@ nsGenericDOMDataNode::HasTextForTranslat
       return true;
     }
   }
 
   return false;
 }
 
 void
-nsGenericDOMDataNode::AppendTextTo(nsAString& aResult)
+CharacterData::AppendTextTo(nsAString& aResult)
 {
   mText.AppendTo(aResult);
 }
 
 bool
-nsGenericDOMDataNode::AppendTextTo(nsAString& aResult,
-                                   const mozilla::fallible_t& aFallible)
+CharacterData::AppendTextTo(nsAString& aResult,
+                            const mozilla::fallible_t& aFallible)
 {
   return mText.AppendTo(aResult, aFallible);
 }
 
 already_AddRefed<nsAtom>
-nsGenericDOMDataNode::GetCurrentValueAtom()
+CharacterData::GetCurrentValueAtom()
 {
   nsAutoString val;
   GetData(val);
   return NS_Atomize(val);
 }
 
 void
-nsGenericDOMDataNode::AddSizeOfExcludingThis(nsWindowSizes& aSizes,
-                                             size_t* aNodeSize) const
+CharacterData::AddSizeOfExcludingThis(nsWindowSizes& aSizes,
+                                      size_t* aNodeSize) const
 {
   nsIContent::AddSizeOfExcludingThis(aSizes, aNodeSize);
   *aNodeSize += mText.SizeOfExcludingThis(aSizes.mState.mMallocSizeOf);
 }
 
+} // namespace dom
+} // namespace mozilla
--- a/dom/base/nsGenericDOMDataNode.h
+++ b/dom/base/nsGenericDOMDataNode.h
@@ -26,74 +26,77 @@
 class nsIDocument;
 
 namespace mozilla {
 namespace dom {
 class HTMLSlotElement;
 } // namespace dom
 } // namespace mozilla
 
-#define DATA_NODE_FLAG_BIT(n_) NODE_FLAG_BIT(NODE_TYPE_SPECIFIC_BITS_OFFSET + (n_))
+#define CHARACTER_DATA_FLAG_BIT(n_) NODE_FLAG_BIT(NODE_TYPE_SPECIFIC_BITS_OFFSET + (n_))
 
 // Data node specific flags
 enum {
   // This bit is set to indicate that if the text node changes to
   // non-whitespace, we may need to create a frame for it. This bit must
   // not be set on nodes that already have a frame.
-  NS_CREATE_FRAME_IF_NON_WHITESPACE =     DATA_NODE_FLAG_BIT(0),
+  NS_CREATE_FRAME_IF_NON_WHITESPACE =     CHARACTER_DATA_FLAG_BIT(0),
 
   // This bit is set to indicate that if the text node changes to
   // whitespace, we may need to reframe it (or its ancestors).
-  NS_REFRAME_IF_WHITESPACE =              DATA_NODE_FLAG_BIT(1),
+  NS_REFRAME_IF_WHITESPACE =              CHARACTER_DATA_FLAG_BIT(1),
 
   // This bit is set to indicate that we have a cached
   // TextIsOnlyWhitespace value
-  NS_CACHED_TEXT_IS_ONLY_WHITESPACE =     DATA_NODE_FLAG_BIT(2),
+  NS_CACHED_TEXT_IS_ONLY_WHITESPACE =     CHARACTER_DATA_FLAG_BIT(2),
 
   // This bit is only meaningful if the NS_CACHED_TEXT_IS_ONLY_WHITESPACE
   // bit is set, and if so it indicates whether we're only whitespace or
   // not.
-  NS_TEXT_IS_ONLY_WHITESPACE =            DATA_NODE_FLAG_BIT(3),
+  NS_TEXT_IS_ONLY_WHITESPACE =            CHARACTER_DATA_FLAG_BIT(3),
 
   // This bit is set if there is a NewlineProperty attached to the node
   // (used by nsTextFrame).
-  NS_HAS_NEWLINE_PROPERTY =               DATA_NODE_FLAG_BIT(4),
+  NS_HAS_NEWLINE_PROPERTY =               CHARACTER_DATA_FLAG_BIT(4),
 
   // This bit is set if there is a FlowLengthProperty attached to the node
   // (used by nsTextFrame).
-  NS_HAS_FLOWLENGTH_PROPERTY =            DATA_NODE_FLAG_BIT(5),
+  NS_HAS_FLOWLENGTH_PROPERTY =            CHARACTER_DATA_FLAG_BIT(5),
 
   // This bit is set if the node may be modified frequently.  This is typically
   // specified if the instance is in <input> or <textarea>.
-  NS_MAYBE_MODIFIED_FREQUENTLY =          DATA_NODE_FLAG_BIT(6),
+  NS_MAYBE_MODIFIED_FREQUENTLY =          CHARACTER_DATA_FLAG_BIT(6),
 };
 
 // Make sure we have enough space for those bits
 ASSERT_NODE_FLAGS_SPACE(NODE_TYPE_SPECIFIC_BITS_OFFSET + 7);
 
-#undef DATA_NODE_FLAG_BIT
+#undef CHARACTER_DATA_FLAG_BIT
 
-class nsGenericDOMDataNode : public nsIContent
+namespace mozilla {
+namespace dom {
+
+class CharacterData : public nsIContent
 {
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
 
   NS_DECL_ADDSIZEOFEXCLUDINGTHIS
 
-  explicit nsGenericDOMDataNode(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
-  explicit nsGenericDOMDataNode(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
+  explicit CharacterData(already_AddRefed<dom::NodeInfo>& aNodeInfo);
+  explicit CharacterData(already_AddRefed<dom::NodeInfo>&& aNodeInfo);
 
   void MarkAsMaybeModifiedFrequently()
   {
     SetFlags(NS_MAYBE_MODIFIED_FREQUENTLY);
   }
 
   virtual void GetNodeValueInternal(nsAString& aNodeValue) override;
   virtual void SetNodeValueInternal(const nsAString& aNodeValue,
-                                    mozilla::ErrorResult& aError) override;
+                                    ErrorResult& aError) override;
 
   // Implementation for nsIDOMCharacterData
   nsresult GetData(nsAString& aData) const;
   nsresult SetData(const nsAString& aData);
   nsresult GetLength(uint32_t* aLength);
   nsresult SubstringData(uint32_t aOffset, uint32_t aCount,
                          nsAString& aReturn);
   nsresult AppendData(const nsAString& aArg);
@@ -108,23 +111,23 @@ public:
   virtual int32_t ComputeIndexOf(const nsINode* aPossibleChild) const override;
   virtual nsresult InsertChildBefore(nsIContent* aKid, nsIContent* aBeforeThis,
                                      bool aNotify) override;
   virtual nsresult InsertChildAt_Deprecated(nsIContent* aKid, uint32_t aIndex,
                                             bool aNotify) override;
   virtual void RemoveChildAt_Deprecated(uint32_t aIndex, bool aNotify) override;
   virtual void RemoveChildNode(nsIContent* aKid, bool aNotify) override;
   virtual void GetTextContentInternal(nsAString& aTextContent,
-                                      mozilla::OOMReporter& aError) override
+                                      OOMReporter& aError) override
   {
     GetNodeValue(aTextContent);
   }
   virtual void SetTextContentInternal(const nsAString& aTextContent,
                                       nsIPrincipal* aSubjectPrincipal,
-                                      mozilla::ErrorResult& aError) override
+                                      ErrorResult& aError) override
   {
     // Batch possible DOMSubtreeModified events.
     mozAutoSubtreeModified subtree(OwnerDoc(), nullptr);
     return SetNodeValue(aTextContent, aError);
   }
 
   // Implementation for nsIContent
   virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
@@ -147,86 +150,85 @@ public:
   virtual nsresult AppendText(const char16_t* aBuffer, uint32_t aLength,
                               bool aNotify) override;
   virtual bool TextIsOnlyWhitespace() override;
   bool ThreadSafeTextIsOnlyWhitespace() const final;
   virtual bool HasTextForTranslation() override;
   virtual void AppendTextTo(nsAString& aResult) override;
   MOZ_MUST_USE
   virtual bool AppendTextTo(nsAString& aResult,
-                            const mozilla::fallible_t&) override;
+                            const fallible_t&) override;
   virtual void SaveSubtreeState() override;
 
 #ifdef DEBUG
   virtual void List(FILE* out, int32_t aIndent) const override;
   virtual void DumpContent(FILE* out, int32_t aIndent, bool aDumpAll) const override;
 #endif
 
   virtual nsXBLBinding* DoGetXBLBinding() const override;
   virtual bool IsNodeOfType(uint32_t aFlags) const override;
   virtual bool IsLink(nsIURI** aURI) const override;
 
-  virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult,
+  virtual nsresult Clone(dom::NodeInfo *aNodeInfo, nsINode **aResult,
                          bool aPreallocateChildren) const override
   {
     nsCOMPtr<nsINode> result = CloneDataNode(aNodeInfo, true);
     result.forget(aResult);
 
     if (!*aResult) {
       return NS_ERROR_OUT_OF_MEMORY;
     }
 
     return NS_OK;
   }
 
   // WebIDL API
   // Our XPCOM GetData is just fine for WebIDL
-  virtual void SetData(const nsAString& aData, mozilla::ErrorResult& rv)
+  virtual void SetData(const nsAString& aData, ErrorResult& rv)
   {
     rv = SetData(aData);
   }
   // nsINode::Length() returns the right thing for our length attribute
   void SubstringData(uint32_t aStart, uint32_t aCount, nsAString& aReturn,
-                     mozilla::ErrorResult& rv);
-  void AppendData(const nsAString& aData, mozilla::ErrorResult& rv)
+                     ErrorResult& rv);
+  void AppendData(const nsAString& aData, ErrorResult& rv)
   {
     rv = AppendData(aData);
   }
-  void InsertData(uint32_t aOffset, const nsAString& aData,
-                  mozilla::ErrorResult& rv)
+  void InsertData(uint32_t aOffset, const nsAString& aData, ErrorResult& rv)
   {
     rv = InsertData(aOffset, aData);
   }
-  void DeleteData(uint32_t aOffset, uint32_t aCount, mozilla::ErrorResult& rv)
+  void DeleteData(uint32_t aOffset, uint32_t aCount, ErrorResult& rv)
   {
     rv = DeleteData(aOffset, aCount);
   }
   void ReplaceData(uint32_t aOffset, uint32_t aCount, const nsAString& aData,
-                   mozilla::ErrorResult& rv)
+                   ErrorResult& rv)
   {
     rv = ReplaceData(aOffset, aCount, aData);
   }
 
   uint32_t TextDataLength() const
   {
     return mText.GetLength();
   }
 
   //----------------------------------------
 
 #ifdef DEBUG
   void ToCString(nsAString& aBuf, int32_t aOffset, int32_t aLen) const;
 #endif
 
-  NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(nsGenericDOMDataNode)
+  NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(CharacterData)
 
 protected:
-  virtual ~nsGenericDOMDataNode();
+  virtual ~CharacterData();
 
-  virtual mozilla::dom::Element* GetNameSpaceElement() override
+  virtual Element* GetNameSpaceElement() override
   {
     nsINode *parent = GetParentNode();
 
     return parent && parent->IsElement() ? parent->AsElement() : nullptr;
   }
 
   nsresult SetTextInternal(uint32_t aOffset, uint32_t aCount,
                            const char16_t* aBuffer, uint32_t aLength,
@@ -236,18 +238,18 @@ protected:
   /**
    * Method to clone this node. This needs to be overriden by all derived
    * classes. If aCloneText is true the text content will be cloned too.
    *
    * @param aOwnerDocument the ownerDocument of the clone
    * @param aCloneText if true the text content will be cloned too
    * @return the clone
    */
-  virtual nsGenericDOMDataNode *CloneDataNode(mozilla::dom::NodeInfo *aNodeInfo,
-                                              bool aCloneText) const = 0;
+  virtual CharacterData *CloneDataNode(dom::NodeInfo *aNodeInfo,
+                                       bool aCloneText) const = 0;
 
   nsTextFragment mText;
 
 public:
   virtual bool OwnedOnlyByTheDOMTree() override
   {
     return GetParent() && mRefCnt.get() == 1;
   }
@@ -260,9 +262,12 @@ public:
   {
     mRefCnt.RemovePurple();
   }
 
 private:
   already_AddRefed<nsAtom> GetCurrentValueAtom();
 };
 
+} // namespace dom
+} // namespace mozilla
+
 #endif /* nsGenericDOMDataNode_h___ */
--- a/dom/base/nsINode.h
+++ b/dom/base/nsINode.h
@@ -401,18 +401,17 @@ public:
     /** xml processing instructions */
     ePROCESSING_INSTRUCTION = 1 << 4,
     /** comment nodes */
     eCOMMENT             = 1 << 5,
     /** form control elements */
     eHTML_FORM_CONTROL   = 1 << 6,
     /** document fragments */
     eDOCUMENT_FRAGMENT   = 1 << 7,
-    /** data nodes (comments, PIs, text). Nodes of this type always
-     returns a non-null value for nsIContent::GetText() */
+    /** character data nodes (comments, PIs, text). */
     eDATA_NODE           = 1 << 8,
     /** HTMLMediaElement */
     eMEDIA               = 1 << 9,
     /** animation elements */
     eANIMATION           = 1 << 10,
     /** filter elements that implement SVGFilterPrimitiveStandardAttributes */
     eFILTER              = 1 << 11,
     /** SVGGeometryElement */
--- a/dom/base/nsRange.cpp
+++ b/dom/base/nsRange.cpp
@@ -3237,17 +3237,17 @@ GetTextFrameForContent(nsIContent* aCont
   nsIDocument* doc = aContent->OwnerDoc();
   nsIPresShell* presShell = doc->GetShell();
   if (!presShell) {
     return nullptr;
   }
 
   const bool frameWillBeUnsuppressed =
     presShell->FrameConstructor()->EnsureFrameForTextNodeIsCreatedAfterFlush(
-      static_cast<nsGenericDOMDataNode*>(aContent));
+      static_cast<CharacterData*>(aContent));
   if (aFlushLayout) {
     doc->FlushPendingNotifications(FlushType::Layout);
   } else if (frameWillBeUnsuppressed) {
     doc->FlushPendingNotifications(FlushType::Frames);
   }
 
   nsIFrame* frame = aContent->GetPrimaryFrame();
   if (!frame || !frame->IsTextFrame()) {
@@ -3750,17 +3750,17 @@ ElementIsVisibleNoFlush(Element* aElemen
   RefPtr<nsStyleContext> sc =
     nsComputedDOMStyle::GetStyleContextNoFlush(aElement, nullptr);
   return sc && sc->StyleVisibility()->IsVisible();
 }
 
 static void
 AppendTransformedText(InnerTextAccumulator& aResult, nsIContent* aContainer)
 {
-  auto textNode = static_cast<nsGenericDOMDataNode*>(aContainer);
+  auto textNode = static_cast<CharacterData*>(aContainer);
 
   nsIFrame* frame = textNode->GetPrimaryFrame();
   if (!IsVisibleAndNotInReplacedElement(frame)) {
     return;
   }
 
   nsIFrame::RenderedText text =
     frame->GetRenderedText(0, aContainer->GetChildCount());
--- a/dom/base/nsTextNode.cpp
+++ b/dom/base/nsTextNode.cpp
@@ -50,18 +50,18 @@ public:
                               nsIContent* aBindingParent,
                               bool aCompileEventHandlers) override;
   virtual void UnbindFromTree(bool aDeep = true,
                               bool aNullParent = true) override;
 
   NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTECHANGED
   NS_DECL_NSIMUTATIONOBSERVER_NODEWILLBEDESTROYED
 
-  virtual nsGenericDOMDataNode *CloneDataNode(mozilla::dom::NodeInfo *aNodeInfo,
-                                              bool aCloneText) const override
+  virtual CharacterData *CloneDataNode(mozilla::dom::NodeInfo *aNodeInfo,
+                                       bool aCloneText) const override
   {
     already_AddRefed<mozilla::dom::NodeInfo> ni =
       RefPtr<mozilla::dom::NodeInfo>(aNodeInfo).forget();
     nsAttributeTextNode *it = new nsAttributeTextNode(ni,
                                                       mNameSpaceID,
                                                       mAttrName);
     if (it && aCloneText) {
       it->mText = mText;
@@ -94,32 +94,32 @@ private:
 };
 
 nsTextNode::~nsTextNode()
 {
 }
 
 // Use the CC variant of this, even though this class does not define
 // a new CC participant, to make QIing to the CC interfaces faster.
-NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED(nsTextNode, nsGenericDOMDataNode, nsIDOMNode,
+NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED(nsTextNode, CharacterData, nsIDOMNode,
                                              nsIDOMCharacterData)
 
 JSObject*
 nsTextNode::WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto)
 {
   return TextBinding::Wrap(aCx, this, aGivenProto);
 }
 
 bool
 nsTextNode::IsNodeOfType(uint32_t aFlags) const
 {
   return !(aFlags & ~(eTEXT | eDATA_NODE));
 }
 
-nsGenericDOMDataNode*
+CharacterData*
 nsTextNode::CloneDataNode(mozilla::dom::NodeInfo *aNodeInfo, bool aCloneText) const
 {
   already_AddRefed<mozilla::dom::NodeInfo> ni = RefPtr<mozilla::dom::NodeInfo>(aNodeInfo).forget();
   nsTextNode *it = new nsTextNode(ni);
   if (aCloneText) {
     it->mText = mText;
   }
 
@@ -135,31 +135,31 @@ nsTextNode::AppendTextForNormalize(const
   };
   return SetTextInternal(mText.GetLength(), 0, aBuffer, aLength, aNotify, &details);
 }
 
 nsresult
 nsTextNode::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
                        nsIContent* aBindingParent, bool aCompileEventHandlers)
 {
-  nsresult rv = nsGenericDOMDataNode::BindToTree(aDocument, aParent,
-                                                 aBindingParent,
-                                                 aCompileEventHandlers);
+  nsresult rv = CharacterData::BindToTree(aDocument, aParent,
+                                          aBindingParent,
+                                          aCompileEventHandlers);
   NS_ENSURE_SUCCESS(rv, rv);
 
   SetDirectionFromNewTextNode(this);
 
   return NS_OK;
 }
 
 void nsTextNode::UnbindFromTree(bool aDeep, bool aNullParent)
 {
   ResetDirectionSetByTextNode(this);
 
-  nsGenericDOMDataNode::UnbindFromTree(aDeep, aNullParent);
+  CharacterData::UnbindFromTree(aDeep, aNullParent);
 }
 
 bool
 nsTextNode::IsShadowDOMEnabled(JSContext* aCx, JSObject* aObject)
 {
   return nsDocument::IsShadowDOMEnabled(aCx, aObject);
 }
 
--- a/dom/base/nsTextNode.h
+++ b/dom/base/nsTextNode.h
@@ -43,24 +43,24 @@ public:
   {
     Init();
   }
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMCharacterData
-  NS_FORWARD_NSIDOMCHARACTERDATA(nsGenericDOMDataNode::)
-  using nsGenericDOMDataNode::SetData; // Prevent hiding overloaded virtual function.
+  NS_FORWARD_NSIDOMCHARACTERDATA(mozilla::dom::CharacterData::)
+  using CharacterData::SetData; // Prevent hiding overloaded virtual function.
 
   // nsINode
   virtual bool IsNodeOfType(uint32_t aFlags) const override;
 
-  virtual nsGenericDOMDataNode* CloneDataNode(mozilla::dom::NodeInfo *aNodeInfo,
-                                              bool aCloneText) const override;
+  virtual CharacterData* CloneDataNode(mozilla::dom::NodeInfo *aNodeInfo,
+                                       bool aCloneText) const override;
 
   virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
                               nsIContent* aBindingParent,
                               bool aCompileEventHandlers) override;
   virtual void UnbindFromTree(bool aDeep = true,
                               bool aNullParent = true) override;
 
   nsresult AppendTextForNormalize(const char16_t* aBuffer, uint32_t aLength,
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -135,17 +135,17 @@ DOMInterfaces = {
     'nativeType': 'nsDOMCaretPosition',
 },
 
 'ChannelWrapper': {
     'nativeType': 'mozilla::extensions::ChannelWrapper',
 },
 
 'CharacterData': {
-    'nativeType': 'nsGenericDOMDataNode',
+    'headerFile': 'nsGenericDOMDataNode.h',
     'concrete': False
 },
 
 'console': {
     'nativeType': 'mozilla::dom::Console',
 },
 
 'ConsoleInstance': {
--- a/dom/xml/CDATASection.cpp
+++ b/dom/xml/CDATASection.cpp
@@ -10,32 +10,32 @@
 
 namespace mozilla {
 namespace dom {
 
 CDATASection::~CDATASection()
 {
 }
 
-NS_IMPL_ISUPPORTS_INHERITED(CDATASection, nsGenericDOMDataNode, nsIDOMNode,
+NS_IMPL_ISUPPORTS_INHERITED(CDATASection, CharacterData, nsIDOMNode,
                             nsIDOMCharacterData)
 
 JSObject*
 CDATASection::WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto)
 {
   return CDATASectionBinding::Wrap(aCx, this, aGivenProto);
 }
 
 bool
 CDATASection::IsNodeOfType(uint32_t aFlags) const
 {
   return !(aFlags & ~(eTEXT | eDATA_NODE));
 }
 
-nsGenericDOMDataNode*
+CharacterData*
 CDATASection::CloneDataNode(mozilla::dom::NodeInfo *aNodeInfo, bool aCloneText) const
 {
   RefPtr<mozilla::dom::NodeInfo> ni = aNodeInfo;
   CDATASection *it = new CDATASection(ni.forget());
   if (it && aCloneText) {
     it->mText = mText;
   }
 
--- a/dom/xml/CDATASection.h
+++ b/dom/xml/CDATASection.h
@@ -40,24 +40,25 @@ public:
   {
     Init();
   }
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMCharacterData
-  NS_FORWARD_NSIDOMCHARACTERDATA(nsGenericDOMDataNode::)
-  using nsGenericDOMDataNode::SetData; // Prevent hiding overloaded virtual function.
+  NS_FORWARD_NSIDOMCHARACTERDATA(CharacterData::)
+  using CharacterData::SetData; // Prevent hiding overloaded virtual function.
+  using CharacterData::GetData;
 
   // nsINode
   virtual bool IsNodeOfType(uint32_t aFlags) const override;
 
-  virtual nsGenericDOMDataNode* CloneDataNode(mozilla::dom::NodeInfo *aNodeInfo,
-                                              bool aCloneText) const override;
+  virtual CharacterData* CloneDataNode(mozilla::dom::NodeInfo *aNodeInfo,
+                                       bool aCloneText) const override;
 
   virtual nsIDOMNode* AsDOMNode() override { return this; }
 #ifdef DEBUG
   virtual void List(FILE* out, int32_t aIndent) const override;
   virtual void DumpContent(FILE* out, int32_t aIndent,bool aDumpAll) const override;
 #endif
 
 protected:
--- a/dom/xml/ProcessingInstruction.cpp
+++ b/dom/xml/ProcessingInstruction.cpp
@@ -43,31 +43,31 @@ NS_NewXMLProcessingInstruction(nsNodeInf
   return instance.forget();
 }
 
 namespace mozilla {
 namespace dom {
 
 ProcessingInstruction::ProcessingInstruction(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
                                              const nsAString& aData)
-  : nsGenericDOMDataNode(Move(aNodeInfo))
+  : CharacterData(Move(aNodeInfo))
 {
   MOZ_ASSERT(mNodeInfo->NodeType() == nsINode::PROCESSING_INSTRUCTION_NODE,
              "Bad NodeType in aNodeInfo");
 
   SetTextInternal(0, mText.GetLength(),
                   aData.BeginReading(), aData.Length(),
                   false);  // Don't notify (bug 420429).
 }
 
 ProcessingInstruction::~ProcessingInstruction()
 {
 }
 
-NS_IMPL_ISUPPORTS_INHERITED(ProcessingInstruction, nsGenericDOMDataNode,
+NS_IMPL_ISUPPORTS_INHERITED(ProcessingInstruction, CharacterData,
                             nsIDOMNode, nsIDOMCharacterData)
 
 JSObject*
 ProcessingInstruction::WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto)
 {
   return ProcessingInstructionBinding::Wrap(aCx, this, aGivenProto);
 }
 
@@ -81,22 +81,22 @@ ProcessingInstruction::GetAttrValue(nsAt
 }
 
 bool
 ProcessingInstruction::IsNodeOfType(uint32_t aFlags) const
 {
   return !(aFlags & ~(ePROCESSING_INSTRUCTION | eDATA_NODE));
 }
 
-nsGenericDOMDataNode*
+CharacterData*
 ProcessingInstruction::CloneDataNode(mozilla::dom::NodeInfo *aNodeInfo,
                                      bool aCloneText) const
 {
   nsAutoString data;
-  nsGenericDOMDataNode::GetData(data);
+  GetData(data);
   RefPtr<mozilla::dom::NodeInfo> ni = aNodeInfo;
   return new ProcessingInstruction(ni.forget(), data);
 }
 
 #ifdef DEBUG
 void
 ProcessingInstruction::List(FILE* out, int32_t aIndent) const
 {
--- a/dom/xml/ProcessingInstruction.h
+++ b/dom/xml/ProcessingInstruction.h
@@ -10,35 +10,36 @@
 #include "mozilla/Attributes.h"
 #include "nsIDOMCharacterData.h"
 #include "nsGenericDOMDataNode.h"
 #include "nsAString.h"
 
 namespace mozilla {
 namespace dom {
 
-class ProcessingInstruction : public nsGenericDOMDataNode,
+class ProcessingInstruction : public CharacterData,
                               public nsIDOMCharacterData
 {
 public:
   ProcessingInstruction(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
                         const nsAString& aData);
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMCharacterData
-  NS_FORWARD_NSIDOMCHARACTERDATA(nsGenericDOMDataNode::)
-  using nsGenericDOMDataNode::SetData; // Prevent hiding overloaded virtual function.
+  NS_FORWARD_NSIDOMCHARACTERDATA(CharacterData::)
+  using CharacterData::SetData; // Prevent hiding overloaded virtual function.
+  using CharacterData::GetData;
 
   // nsINode
   virtual bool IsNodeOfType(uint32_t aFlags) const override;
 
-  virtual nsGenericDOMDataNode* CloneDataNode(mozilla::dom::NodeInfo *aNodeInfo,
-                                              bool aCloneText) const override;
+  virtual CharacterData* CloneDataNode(mozilla::dom::NodeInfo *aNodeInfo,
+                                       bool aCloneText) const override;
 
 #ifdef DEBUG
   virtual void List(FILE* out, int32_t aIndent) const override;
   virtual void DumpContent(FILE* out, int32_t aIndent, bool aDumpAll) const override;
 #endif
 
   virtual nsIDOMNode* AsDOMNode() override { return this; }
 
--- a/dom/xml/XMLStylesheetProcessingInstruction.cpp
+++ b/dom/xml/XMLStylesheetProcessingInstruction.cpp
@@ -73,17 +73,17 @@ XMLStylesheetProcessingInstruction::Unbi
 }
 
 // nsIDOMNode
 
 void
 XMLStylesheetProcessingInstruction::SetNodeValueInternal(const nsAString& aNodeValue,
                                                          ErrorResult& aError)
 {
-  nsGenericDOMDataNode::SetNodeValueInternal(aNodeValue, aError);
+  CharacterData::SetNodeValueInternal(aNodeValue, aError);
   if (!aError.Failed()) {
     UpdateStyleSheetInternal(nullptr, nullptr, true);
   }
 }
 
 // nsStyleLinkElement
 
 void
@@ -172,20 +172,20 @@ XMLStylesheetProcessingInstruction::GetS
     return;
   }
 
   // If we get here we assume that we're loading a css file, so set the
   // type to 'text/css'
   aType.AssignLiteral("text/css");
 }
 
-nsGenericDOMDataNode*
+CharacterData*
 XMLStylesheetProcessingInstruction::CloneDataNode(mozilla::dom::NodeInfo *aNodeInfo,
                                                   bool aCloneText) const
 {
   nsAutoString data;
-  nsGenericDOMDataNode::GetData(data);
+  GetData(data);
   RefPtr<mozilla::dom::NodeInfo> ni = aNodeInfo;
   return new XMLStylesheetProcessingInstruction(ni.forget(), data);
 }
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/xml/XMLStylesheetProcessingInstruction.h
+++ b/dom/xml/XMLStylesheetProcessingInstruction.h
@@ -59,35 +59,36 @@ public:
   // nsIStyleSheetLinkingElement
   virtual void OverrideBaseURI(nsIURI* aNewBaseURI) override;
 
   // nsStyleLinkElement
   void GetCharset(nsAString& aCharset) override;
 
   virtual void SetData(const nsAString& aData, mozilla::ErrorResult& rv) override
   {
-    nsGenericDOMDataNode::SetData(aData, rv);
+    CharacterData::SetData(aData, rv);
     if (rv.Failed()) {
       return;
     }
     UpdateStyleSheetInternal(nullptr, nullptr, true);
   }
   using ProcessingInstruction::SetData; // Prevent hiding overloaded virtual function.
+  using ProcessingInstruction::GetData;
 
 protected:
   virtual ~XMLStylesheetProcessingInstruction();
 
   nsCOMPtr<nsIURI> mOverriddenBaseURI;
 
   already_AddRefed<nsIURI>
     GetStyleSheetURL(bool* aIsInline, nsIPrincipal** aTriggeringPrincipal) final;
   void GetStyleSheetInfo(nsAString& aTitle,
                          nsAString& aType,
                          nsAString& aMedia,
                          bool* aIsAlternate) final;
-  nsGenericDOMDataNode* CloneDataNode(mozilla::dom::NodeInfo* aNodeInfo,
-                                      bool aCloneText) const final;
+  CharacterData* CloneDataNode(mozilla::dom::NodeInfo* aNodeInfo,
+                               bool aCloneText) const final;
 };
 
 } // namespace dom
 } // namespace mozilla
 
 #endif // mozilla_dom_XMLStylesheetProcessingInstruction_h
--- a/editor/libeditor/DeleteRangeTransaction.cpp
+++ b/editor/libeditor/DeleteRangeTransaction.cpp
@@ -141,18 +141,18 @@ DeleteRangeTransaction::CreateTxnsToDele
     int32_t numToDel;
     if (aStart == aEnd) {
       numToDel = 1;
     } else {
       numToDel = aEnd.Offset() - aStart.Offset();
       MOZ_DIAGNOSTIC_ASSERT(numToDel > 0);
     }
 
-    RefPtr<nsGenericDOMDataNode> charDataNode =
-      static_cast<nsGenericDOMDataNode*>(aStart.Container());
+    RefPtr<CharacterData> charDataNode =
+      static_cast<CharacterData*>(aStart.Container());
 
     RefPtr<DeleteTextTransaction> deleteTextTransaction =
       DeleteTextTransaction::MaybeCreate(*mEditorBase, *charDataNode,
                                          aStart.Offset(), numToDel);
     // If the text node isn't editable, it should be never undone/redone.
     // So, the transaction shouldn't be recorded.
     if (NS_WARN_IF(!deleteTextTransaction)) {
       return NS_ERROR_FAILURE;
@@ -206,18 +206,18 @@ DeleteRangeTransaction::CreateTxnsToDele
     startOffset = 0;
     numToDelete = aPoint.Offset();
   }
 
   if (!numToDelete) {
     return NS_OK;
   }
 
-  RefPtr<nsGenericDOMDataNode> dataNode =
-    static_cast<nsGenericDOMDataNode*>(aPoint.Container());
+  RefPtr<CharacterData> dataNode =
+    static_cast<CharacterData*>(aPoint.Container());
   RefPtr<DeleteTextTransaction> deleteTextTransaction =
     DeleteTextTransaction::MaybeCreate(*mEditorBase, *dataNode,
                                        startOffset, numToDelete);
   // If the text node isn't editable, it should be never undone/redone.
   // So, the transaction shouldn't be recorded.
   if (NS_WARN_IF(!deleteTextTransaction)) {
     return NS_ERROR_FAILURE;
   }
--- a/editor/libeditor/DeleteTextTransaction.cpp
+++ b/editor/libeditor/DeleteTextTransaction.cpp
@@ -18,30 +18,30 @@
 
 namespace mozilla {
 
 using namespace dom;
 
 // static
 already_AddRefed<DeleteTextTransaction>
 DeleteTextTransaction::MaybeCreate(EditorBase& aEditorBase,
-                                   nsGenericDOMDataNode& aCharData,
+                                   CharacterData& aCharData,
                                    uint32_t aOffset,
                                    uint32_t aLengthToDelete)
 {
   RefPtr<DeleteTextTransaction> transaction =
     new DeleteTextTransaction(aEditorBase, aCharData, aOffset, aLengthToDelete);
   return transaction.forget();
 }
 
 // static
 already_AddRefed<DeleteTextTransaction>
 DeleteTextTransaction::MaybeCreateForPreviousCharacter(
                          EditorBase& aEditorBase,
-                         nsGenericDOMDataNode& aCharData,
+                         CharacterData& aCharData,
                          uint32_t aOffset)
 {
   if (NS_WARN_IF(!aOffset)) {
     return nullptr;
   }
 
   nsAutoString data;
   aCharData.GetData(data);
@@ -60,17 +60,17 @@ DeleteTextTransaction::MaybeCreateForPre
   return DeleteTextTransaction::MaybeCreate(aEditorBase, aCharData,
                                             offset, length);
 }
 
 // static
 already_AddRefed<DeleteTextTransaction>
 DeleteTextTransaction::MaybeCreateForNextCharacter(
                          EditorBase& aEditorBase,
-                         nsGenericDOMDataNode& aCharData,
+                         CharacterData& aCharData,
                          uint32_t aOffset)
 {
   nsAutoString data;
   aCharData.GetData(data);
   if (NS_WARN_IF(aOffset >= data.Length()) ||
       NS_WARN_IF(data.IsEmpty())) {
     return nullptr;
   }
@@ -82,17 +82,17 @@ DeleteTextTransaction::MaybeCreateForNex
     ++length;
   }
   return DeleteTextTransaction::MaybeCreate(aEditorBase, aCharData,
                                             aOffset, length);
 }
 
 DeleteTextTransaction::DeleteTextTransaction(
                          EditorBase& aEditorBase,
-                         nsGenericDOMDataNode& aCharData,
+                         CharacterData& aCharData,
                          uint32_t aOffset,
                          uint32_t aLengthToDelete)
   : mEditorBase(&aEditorBase)
   , mCharData(&aCharData)
   , mOffset(aOffset)
   , mLengthToDelete(aLengthToDelete)
 {
   NS_ASSERTION(mCharData->Length() >= aOffset + aLengthToDelete,
--- a/editor/libeditor/DeleteTextTransaction.h
+++ b/editor/libeditor/DeleteTextTransaction.h
@@ -21,52 +21,52 @@ class RangeUpdater;
 
 /**
  * A transaction that removes text from a content node.
  */
 class DeleteTextTransaction final : public EditTransactionBase
 {
 protected:
   DeleteTextTransaction(EditorBase& aEditorBase,
-                        nsGenericDOMDataNode& aCharData,
+                        dom::CharacterData& aCharData,
                         uint32_t aOffset,
                         uint32_t aLengthToDelete);
 
 public:
 
   /**
    * Creates a delete text transaction to remove given range.  This returns
    * nullptr if it cannot modify the text node.
    *
    * @param aEditorBase         The provider of basic editing operations.
    * @param aCharData           The content node to remove text from.
    * @param aOffset             The location in aElement to begin the deletion.
    * @param aLenthToDelete      The length to delete.
    */
   static already_AddRefed<DeleteTextTransaction>
   MaybeCreate(EditorBase& aEditorBase,
-              nsGenericDOMDataNode& aCharData,
+              dom::CharacterData& aCharData,
               uint32_t aOffset,
               uint32_t aLengthToDelete);
 
   /**
    * Creates a delete text transaction to remove a previous or next character.
    * Those methods MAY return nullptr.
    *
    * @param aEditorBase         The provider of basic editing operations.
    * @param aCharData           The content node to remove text from.
    * @param aOffset             The location in aElement to begin the deletion.
    */
   static already_AddRefed<DeleteTextTransaction>
   MaybeCreateForPreviousCharacter(EditorBase& aEditorBase,
-                                  nsGenericDOMDataNode& aCharData,
+                                  dom::CharacterData& aCharData,
                                   uint32_t aOffset);
   static already_AddRefed<DeleteTextTransaction>
   MaybeCreateForNextCharacter(EditorBase& aEditorBase,
-                              nsGenericDOMDataNode& aCharData,
+                              dom::CharacterData& aCharData,
                               uint32_t aOffset);
 
   /**
    * CanDoIt() returns true if there are enough members and can modify the
    * text.  Otherwise, false.
    */
   bool CanDoIt() const;
 
@@ -80,17 +80,17 @@ public:
 
   uint32_t LengthToDelete() { return mLengthToDelete; }
 
 protected:
   // The provider of basic editing operations.
   RefPtr<EditorBase> mEditorBase;
 
   // The CharacterData node to operate upon.
-  RefPtr<nsGenericDOMDataNode> mCharData;
+  RefPtr<dom::CharacterData> mCharData;
 
   // The offset into mCharData where the deletion is to take place.
   uint32_t mOffset;
 
   // The length to delete.
   uint32_t mLengthToDelete;
 
   // The text that was deleted.
--- a/editor/libeditor/EditorBase.cpp
+++ b/editor/libeditor/EditorBase.cpp
@@ -3093,17 +3093,17 @@ EditorBase::SetTextImpl(Selection& aSele
       }
     }
   }
 
   return rv;
 }
 
 nsresult
-EditorBase::DeleteText(nsGenericDOMDataNode& aCharData,
+EditorBase::DeleteText(CharacterData& aCharData,
                        uint32_t aOffset,
                        uint32_t aLength)
 {
   RefPtr<DeleteTextTransaction> transaction =
     DeleteTextTransaction::MaybeCreate(*this, aCharData, aOffset, aLength);
   if (NS_WARN_IF(!transaction)) {
     return NS_ERROR_FAILURE;
   }
@@ -4676,18 +4676,18 @@ EditorBase::CreateTxnForDeleteRange(nsRa
     nsCOMPtr<nsIContent> priorNode = GetPreviousEditableNode(*node);
     if (NS_WARN_IF(!priorNode)) {
       return nullptr;
     }
 
     // there is a priorNode, so delete its last child (if chardata, delete the
     // last char). if it has no children, delete it
     if (priorNode->IsNodeOfType(nsINode::eDATA_NODE)) {
-      RefPtr<nsGenericDOMDataNode> priorNodeAsCharData =
-        static_cast<nsGenericDOMDataNode*>(priorNode.get());
+      RefPtr<CharacterData> priorNodeAsCharData =
+        static_cast<CharacterData*>(priorNode.get());
       uint32_t length = priorNode->Length();
       // Bail out for empty chardata XXX: Do we want to do something else?
       if (NS_WARN_IF(!length)) {
         return nullptr;
       }
       RefPtr<DeleteTextTransaction> deleteTextTransaction =
         DeleteTextTransaction::MaybeCreateForPreviousCharacter(
                                  *this, *priorNodeAsCharData, length);
@@ -4716,18 +4716,18 @@ EditorBase::CreateTxnForDeleteRange(nsRa
     nsCOMPtr<nsIContent> nextNode = GetNextEditableNode(*node);
     if (NS_WARN_IF(!nextNode)) {
       return nullptr;
     }
 
     // there is a nextNode, so delete its first child (if chardata, delete the
     // first char). if it has no children, delete it
     if (nextNode->IsNodeOfType(nsINode::eDATA_NODE)) {
-      RefPtr<nsGenericDOMDataNode> nextNodeAsCharData =
-        static_cast<nsGenericDOMDataNode*>(nextNode.get());
+      RefPtr<CharacterData> nextNodeAsCharData =
+        static_cast<CharacterData*>(nextNode.get());
       uint32_t length = nextNode->Length();
       // Bail out for empty chardata XXX: Do we want to do something else?
       if (NS_WARN_IF(!length)) {
         return nullptr;
       }
       RefPtr<DeleteTextTransaction> deleteTextTransaction =
         DeleteTextTransaction::MaybeCreateForNextCharacter(
                                  *this, *nextNodeAsCharData, 0);
@@ -4749,18 +4749,18 @@ EditorBase::CreateTxnForDeleteRange(nsRa
     nextNode.forget(aRemovingNode);
     return deleteNodeTransaction.forget();
   }
 
   if (node->IsNodeOfType(nsINode::eDATA_NODE)) {
     if (NS_WARN_IF(aAction != ePrevious && aAction != eNext)) {
       return nullptr;
     }
-    RefPtr<nsGenericDOMDataNode> nodeAsCharData =
-      static_cast<nsGenericDOMDataNode*>(node.get());
+    RefPtr<CharacterData> nodeAsCharData =
+      static_cast<CharacterData*>(node.get());
     // We have chardata, so delete a char at the proper offset
     RefPtr<DeleteTextTransaction> deleteTextTransaction =
       aAction == ePrevious ?
         DeleteTextTransaction::MaybeCreateForPreviousCharacter(
                                  *this, *nodeAsCharData, offset) :
         DeleteTextTransaction::MaybeCreateForNextCharacter(
                                  *this, *nodeAsCharData, offset);
     if (NS_WARN_IF(!deleteTextTransaction)) {
@@ -4796,18 +4796,18 @@ EditorBase::CreateTxnForDeleteRange(nsRa
   if (NS_WARN_IF(!selectedNode)) {
     return nullptr;
   }
 
   if (selectedNode->IsNodeOfType(nsINode::eDATA_NODE)) {
     if (NS_WARN_IF(aAction != ePrevious && aAction != eNext)) {
       return nullptr;
     }
-    RefPtr<nsGenericDOMDataNode> selectedNodeAsCharData =
-      static_cast<nsGenericDOMDataNode*>(selectedNode.get());
+    RefPtr<CharacterData> selectedNodeAsCharData =
+      static_cast<CharacterData*>(selectedNode.get());
     // we are deleting from a chardata node, so do a character deletion
     uint32_t position = 0;
     if (aAction == ePrevious) {
       position = selectedNode->Length();
     }
     RefPtr<DeleteTextTransaction> deleteTextTransaction =
       aAction == ePrevious ?
         DeleteTextTransaction::MaybeCreateForPreviousCharacter(
--- a/editor/libeditor/EditorBase.h
+++ b/editor/libeditor/EditorBase.h
@@ -557,17 +557,17 @@ protected:
    */
   already_AddRefed<EditTransactionBase>
     CreateTxnForDeleteRange(nsRange* aRangeToDelete,
                             EDirection aAction,
                             nsINode** aRemovingNode,
                             int32_t* aOffset,
                             int32_t* aLength);
 
-  nsresult DeleteText(nsGenericDOMDataNode& aElement,
+  nsresult DeleteText(dom::CharacterData& aElement,
                       uint32_t aOffset, uint32_t aLength);
 
   /**
    * This method first deletes the selection, if it's not collapsed.  Then if
    * the selection lies in a CharacterData node, it splits it.  If the
    * selection is at this point collapsed in a CharacterData node, it's
    * adjusted to be collapsed right before or after the node instead (which is
    * always possible, since the node was split).
--- a/editor/libeditor/HTMLEditRules.cpp
+++ b/editor/libeditor/HTMLEditRules.cpp
@@ -2788,28 +2788,28 @@ HTMLEditRules::WillDeleteSelection(Selec
 
         // Check endpoints for possible text deletion.  We can assume that if
         // text node is found, we can delete to end or to begining as
         // appropriate, since the case where both sel endpoints in same text
         // node was already handled (we wouldn't be here)
         if (startNode->GetAsText() &&
             startNode->Length() > static_cast<uint32_t>(startOffset)) {
           // Delete to last character
-          OwningNonNull<nsGenericDOMDataNode> dataNode =
-            *static_cast<nsGenericDOMDataNode*>(startNode.get());
+          OwningNonNull<CharacterData> dataNode =
+            *static_cast<CharacterData*>(startNode.get());
           NS_ENSURE_STATE(mHTMLEditor);
           rv = mHTMLEditor->DeleteText(dataNode, startOffset,
                                        startNode->Length() - startOffset);
           NS_ENSURE_SUCCESS(rv, rv);
         }
         if (endNode->GetAsText() && endOffset) {
           // Delete to first character
           NS_ENSURE_STATE(mHTMLEditor);
-          OwningNonNull<nsGenericDOMDataNode> dataNode =
-            *static_cast<nsGenericDOMDataNode*>(endNode.get());
+          OwningNonNull<CharacterData> dataNode =
+            *static_cast<CharacterData*>(endNode.get());
           rv = mHTMLEditor->DeleteText(dataNode, 0, endOffset);
           NS_ENSURE_SUCCESS(rv, rv);
         }
 
         if (join) {
           EditActionResult ret = TryToJoinBlocks(*leftParent, *rightParent);
           MOZ_ASSERT(*aHandled);
           *aCancel |= ret.Canceled();
--- a/editor/libeditor/HTMLEditor.cpp
+++ b/editor/libeditor/HTMLEditor.cpp
@@ -3189,17 +3189,17 @@ HTMLEditor::DeleteNode(nsIDOMNode* aNode
                  !IsMozEditorBogusNode(content))) {
     return NS_ERROR_FAILURE;
   }
 
   return EditorBase::DeleteNode(aNode);
 }
 
 nsresult
-HTMLEditor::DeleteText(nsGenericDOMDataNode& aCharData,
+HTMLEditor::DeleteText(CharacterData& aCharData,
                        uint32_t aOffset,
                        uint32_t aLength)
 {
   // Do nothing if the node is read-only
   if (!IsModifiableNode(&aCharData)) {
     return NS_ERROR_FAILURE;
   }
 
--- a/editor/libeditor/HTMLEditor.h
+++ b/editor/libeditor/HTMLEditor.h
@@ -381,17 +381,17 @@ public:
 
   virtual bool AreNodesSameType(nsIContent* aNode1,
                                 nsIContent* aNode2) override;
 
   NS_IMETHOD DeleteSelectionImpl(EDirection aAction,
                                  EStripWrappers aStripWrappers) override;
   nsresult DeleteNode(nsINode* aNode);
   NS_IMETHOD DeleteNode(nsIDOMNode* aNode) override;
-  nsresult DeleteText(nsGenericDOMDataNode& aTextNode, uint32_t aOffset,
+  nsresult DeleteText(dom::CharacterData& aTextNode, uint32_t aOffset,
                       uint32_t aLength);
   virtual nsresult
   InsertTextImpl(nsIDocument& aDocument,
                  const nsAString& aStringToInsert,
                  const EditorRawDOMPoint& aPointToInsert,
                  EditorRawDOMPoint* aPointAfterInsertedString =
                    nullptr) override;
   virtual bool IsModifiableNode(nsINode* aNode) override;
--- a/layout/base/GeometryUtils.cpp
+++ b/layout/base/GeometryUtils.cpp
@@ -33,17 +33,17 @@ enum GeometryNodeType {
 
 static nsIFrame*
 GetFrameForNode(nsINode* aNode, GeometryNodeType aType)
 {
   nsIDocument* doc = aNode->OwnerDoc();
   if (aType == GEOMETRY_NODE_TEXT) {
     if (nsIPresShell* shell = doc->GetShell()) {
       shell->FrameConstructor()->EnsureFrameForTextNodeIsCreatedAfterFlush(
-          static_cast<nsGenericDOMDataNode*>(aNode));
+          static_cast<CharacterData*>(aNode));
     }
   }
   doc->FlushPendingNotifications(FlushType::Layout);
 
   switch (aType) {
   case GEOMETRY_NODE_TEXT:
   case GEOMETRY_NODE_ELEMENT:
     return aNode->AsContent()->GetPrimaryFrame();
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -8810,17 +8810,17 @@ InvalidateCanvasIfNeeded(nsIPresShell* p
   // Invalidate the viewport.
 
   nsIFrame* rootFrame = presShell->GetRootFrame();
   rootFrame->InvalidateFrameSubtree();
 }
 
 bool
 nsCSSFrameConstructor::EnsureFrameForTextNodeIsCreatedAfterFlush(
-  nsGenericDOMDataNode* aContent)
+  CharacterData* aContent)
 {
   if (!aContent->HasFlag(NS_CREATE_FRAME_IF_NON_WHITESPACE)) {
     return false;
   }
 
   if (mAlwaysCreateFramesForIgnorableWhitespace) {
     return false;
   }
--- a/layout/base/nsCSSFrameConstructor.h
+++ b/layout/base/nsCSSFrameConstructor.h
@@ -32,24 +32,24 @@ struct nsGenConInitializer;
 
 class nsContainerFrame;
 class nsFirstLineFrame;
 class nsFirstLetterFrame;
 class nsICSSAnonBoxPseudo;
 class nsIDocument;
 class nsPageContentFrame;
 struct PendingBinding;
-class nsGenericDOMDataNode;
 
 class nsFrameConstructorState;
 
 namespace mozilla {
 
 namespace dom {
 
+class CharacterData;
 class FlattenedChildIterator;
 
 } // namespace dom
 } // namespace mozilla
 
 class nsCSSFrameConstructor final : public nsFrameManager
 {
 public:
@@ -323,17 +323,17 @@ public:
                             const CharacterDataChangeInfo& aInfo);
 
   // If aContent is a text node that has been optimized away due to being
   // whitespace next to a block boundary (or for some other reason), ensure that
   // a frame for it is created the next time frames are flushed, if it can
   // possibly have a frame at all.
   //
   // Returns whether there are chances for the frame to be unsuppressed.
-  bool EnsureFrameForTextNodeIsCreatedAfterFlush(nsGenericDOMDataNode* aContent);
+  bool EnsureFrameForTextNodeIsCreatedAfterFlush(mozilla::dom::CharacterData* aContent);
 
   // Generate the child frames and process bindings
   void GenerateChildFrames(nsContainerFrame* aFrame);
 
   // Should be called when a frame is going to be destroyed and
   // WillDestroyFrameTree hasn't been called yet.
   void NotifyDestroyingFrame(nsIFrame* aFrame);
 
--- a/layout/inspector/InspectorUtils.cpp
+++ b/layout/inspector/InspectorUtils.cpp
@@ -105,17 +105,17 @@ InspectorUtils::GetAllStyleSheets(Global
 
   // Get the document sheets.
   for (size_t i = 0; i < aDocument.SheetCount(); i++) {
     aResult.AppendElement(aDocument.SheetAt(i));
   }
 }
 
 bool
-InspectorUtils::IsIgnorableWhitespace(nsGenericDOMDataNode& aDataNode)
+InspectorUtils::IsIgnorableWhitespace(CharacterData& aDataNode)
 {
   if (!aDataNode.TextIsOnlyWhitespace()) {
     return false;
   }
 
   // Okay.  We have only white space.  Let's check the white-space
   // property now and make sure that this isn't preformatted text...
   if (nsIFrame* frame = aDataNode.GetPrimaryFrame()) {
--- a/layout/inspector/InspectorUtils.h
+++ b/layout/inspector/InspectorUtils.h
@@ -6,26 +6,26 @@
  */
 
 #ifndef mozilla_dom_InspectorUtils_h
 #define mozilla_dom_InspectorUtils_h
 
 #include "mozilla/dom/BindingDeclarations.h"
 
 class nsAtom;
-class nsGenericDOMDataNode;
 class nsIDocument;
 class nsStyleContext;
 
 namespace mozilla {
 class StyleSheet;
 namespace css {
 class Rule;
 } // namespace css
 namespace dom {
+class CharacterData;
 class Element;
 class InspectorFontFace;
 } // namespace dom
 } // namespace mozilla
 
 namespace mozilla {
 namespace dom {
 
@@ -159,21 +159,21 @@ public:
   // that accepts values of this type.  Throws on unsupported properties or
   // unknown types.
   static bool CssPropertySupportsType(GlobalObject& aGlobal,
                                       const nsAString& aProperty,
                                       uint32_t aType,
                                       ErrorResult& aRv);
 
   static bool IsIgnorableWhitespace(GlobalObject& aGlobalObject,
-                                    nsGenericDOMDataNode& aDataNode)
+                                    CharacterData& aDataNode)
   {
     return IsIgnorableWhitespace(aDataNode);
   }
-  static bool IsIgnorableWhitespace(nsGenericDOMDataNode& aDataNode);
+  static bool IsIgnorableWhitespace(CharacterData& aDataNode);
 
   // Returns the "parent" of a node.  The parent of a document node is the
   // frame/iframe containing that document.  aShowingAnonymousContent says
   // whether we are showing anonymous content.
   static nsINode* GetParentForNode(nsINode& aNode,
                                    bool aShowingAnonymousContent);
   static nsINode* GetParentForNode(GlobalObject& aGlobalObject,
                                    nsINode& aNode,
--- a/layout/inspector/inDOMView.cpp
+++ b/layout/inspector/inDOMView.cpp
@@ -1200,17 +1200,17 @@ inDOMView::AppendKidsToArray(nsINodeList
     // following line.
     uint32_t filterForNodeType = 1 << (nodeType - 1);
 
     if (mWhatToShow & filterForNodeType) {
       if ((nodeType == nsINode::TEXT_NODE ||
            nodeType == nsINode::COMMENT_NODE) &&
           !mShowWhitespaceNodes) {
         nsCOMPtr<nsIContent> content = do_QueryInterface(kid);
-        auto data = static_cast<nsGenericDOMDataNode*>(content.get());
+        auto data = static_cast<dom::CharacterData*>(content.get());
         NS_ASSERTION(data, "Does not implement nsIDOMCharacterData!");
         if (InspectorUtils::IsIgnorableWhitespace(*data)) {
           continue;
         }
       }
 
       nsCOMPtr<nsIDOMNode> node = do_QueryInterface(kid);
       aArray.AppendElement(node.forget());