Bug 1446533 part 5. Remove nsIDOMCharacterData::AppendData. r=mystor
authorBoris Zbarsky <bzbarsky@mit.edu>
Mon, 19 Mar 2018 15:33:25 -0400
changeset 408820 87162a82c06235c8b42a7d248bb22e5ee5d06fb9
parent 408819 0cd517334cd515e4fb3c07409c4fcf1293b487b0
child 408821 1182d32f823ece8fdf519d4722134f2746a26d6a
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 5. Remove nsIDOMCharacterData::AppendData. r=mystor MozReview-Commit-ID: JP809oJeQiX
dom/base/CharacterData.cpp
dom/base/CharacterData.h
dom/interfaces/core/nsIDOMCharacterData.idl
--- a/dom/base/CharacterData.cpp
+++ b/dom/base/CharacterData.cpp
@@ -216,21 +216,24 @@ CharacterData::SubstringData(uint32_t aS
 
     const char *data = mText.Get1b() + aStart;
     CopyASCIItoUTF16(Substring(data, data + amount), aReturn);
   }
 }
 
 //----------------------------------------------------------------------
 
-nsresult
-CharacterData::AppendData(const nsAString& aData)
+void
+CharacterData::AppendData(const nsAString& aData, ErrorResult& aRv)
 {
-  return SetTextInternal(mText.GetLength(), 0, aData.BeginReading(),
-                         aData.Length(), true);
+  nsresult rv = SetTextInternal(mText.GetLength(), 0, aData.BeginReading(),
+                                aData.Length(), true);
+  if (NS_FAILED(rv)) {
+    aRv.Throw(rv);
+  }
 }
 
 nsresult
 CharacterData::InsertData(uint32_t aOffset,
                           const nsAString& aData)
 {
   return SetTextInternal(aOffset, 0, aData.BeginReading(),
                          aData.Length(), true);
--- a/dom/base/CharacterData.h
+++ b/dom/base/CharacterData.h
@@ -92,17 +92,16 @@ public:
   NS_IMPL_FROMCONTENT_HELPER(CharacterData, IsCharacterData())
 
   virtual void GetNodeValueInternal(nsAString& aNodeValue) override;
   virtual void SetNodeValueInternal(const nsAString& aNodeValue,
                                     ErrorResult& aError) override;
 
   // Implementation for nsIDOMCharacterData
   nsresult GetLength(uint32_t* aLength);
-  nsresult AppendData(const nsAString& aArg);
   nsresult InsertData(uint32_t aOffset, const nsAString& aArg);
   nsresult DeleteData(uint32_t aOffset, uint32_t aCount);
   nsresult ReplaceData(uint32_t aOffset, uint32_t aCount,
                        const nsAString& aArg);
 
   // nsINode methods
   virtual uint32_t GetChildCount() const override;
   virtual nsIContent *GetChildAt_Deprecated(uint32_t aIndex) const override;
@@ -179,20 +178,17 @@ public:
   }
 
   // WebIDL API
   void GetData(nsAString& aData) const;
   virtual void SetData(const nsAString& aData, ErrorResult& rv);
   // nsINode::Length() returns the right thing for our length attribute
   void SubstringData(uint32_t aStart, uint32_t aCount, nsAString& aReturn,
                      ErrorResult& rv);
-  void AppendData(const nsAString& aData, ErrorResult& rv)
-  {
-    rv = AppendData(aData);
-  }
+  void AppendData(const nsAString& aData, ErrorResult& rv);
   void InsertData(uint32_t aOffset, const nsAString& aData, ErrorResult& rv)
   {
     rv = InsertData(aOffset, aData);
   }
   void DeleteData(uint32_t aOffset, uint32_t aCount, ErrorResult& rv)
   {
     rv = DeleteData(aOffset, aCount);
   }
--- a/dom/interfaces/core/nsIDOMCharacterData.idl
+++ b/dom/interfaces/core/nsIDOMCharacterData.idl
@@ -12,18 +12,16 @@
  * For more information on this interface please see 
  * http://www.w3.org/TR/DOM-Level-2-Core/
  */
 
 [uuid(4109a2d2-e7af-445d-bb72-c7c9b875f35e)]
 interface nsIDOMCharacterData : nsIDOMNode
 {
   readonly attribute unsigned long        length;
-  void                      appendData(in DOMString arg)
-                                  raises(DOMException);
   void                      insertData(in unsigned long offset, 
                                        in DOMString arg)
                                   raises(DOMException);
   void                      deleteData(in unsigned long offset, 
                                        in unsigned long count)
                                   raises(DOMException);
   void                      replaceData(in unsigned long offset, 
                                         in unsigned long count,