Bug 784126 - Fix JSDOMParser textContent setter. r=lucasr
authorBrian Nicholson <bnicholson@mozilla.com>
Wed, 22 Aug 2012 10:15:46 -0700
changeset 103029 fcb1cb11935f91aa0778837f98235123e5422ca0
parent 103028 91cba558c70c3a08699ba5c4958239f2c77f6d33
child 103030 e97800e74b636eb088edd68ee219a8a30c7dc9b3
push id13782
push userbnicholson@mozilla.com
push dateWed, 22 Aug 2012 17:16:14 +0000
treeherdermozilla-inbound@fcb1cb11935f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslucasr
bugs784126
milestone17.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 784126 - Fix JSDOMParser textContent setter. r=lucasr
mobile/android/chrome/content/JSDOMParser.js
--- a/mobile/android/chrome/content/JSDOMParser.js
+++ b/mobile/android/chrome/content/JSDOMParser.js
@@ -491,17 +491,22 @@
         this.childNodes[i].parentNode = null;
       }
       this.childNodes = node.childNodes;
       for (let i = this.childNodes.length; --i >= 0;) {
         this.childNodes[i].parentNode = this;
       }
     },
 
-    set textContext(text) {
+    set textContent(text) {
+      // clear parentNodes for existing children
+      for (let i = this.childNodes.length; --i >= 0;) {
+        this.childNodes[i].parentNode = null;
+      }
+
       let node = new Text();
       this.childNodes = [ node ];
       node.textContent = text;
       node.parentNode = this;
     },
 
     get textContent() {
       let text = "";