Bug 813383 - Use firstElementChild/nextElementSibling/lastElementChild instead of firstChild/nextSibling/lastChild when possible. r=felipe
authorJared Wein <jwein@mozilla.com>
Mon, 19 Nov 2012 17:54:12 -0800
changeset 113740 1aab9de3c55472c04651164b445357cb1bf5b87c
parent 113739 5c2a58449a3d04ac1adade9a93f82f7a9a61d33d
child 113741 a047867610ac825164dac5ce5bec25cfacd80df7
push id23888
push useremorley@mozilla.com
push dateTue, 20 Nov 2012 14:54:23 +0000
treeherdermozilla-central@a9d59073400b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfelipe
bugs813383
milestone20.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 813383 - Use firstElementChild/nextElementSibling/lastElementChild instead of firstChild/nextSibling/lastChild when possible. r=felipe
browser/base/content/socialchat.xml
--- a/browser/base/content/socialchat.xml
+++ b/browser/base/content/socialchat.xml
@@ -174,33 +174,33 @@
           return !!this.querySelector("[collapsed]");
         ]]></getter>
       </property>
 
       <property name="collapsedChildren">
         <getter><![CDATA[
           // A generator yielding all collapsed chatboxes, in the order in
           // which they should be restored.
-          let child = this.lastChild;
+          let child = this.lastElementChild;
           while (child) {
             if (child.collapsed)
               yield child;
-            child = child.previousSibling;
+            child = child.previousElementSibling;
           }
         ]]></getter>
       </property>
 
       <property name="visibleChildren">
         <getter><![CDATA[
           // A generator yielding all non-collapsed chatboxes.
-          let child = this.firstChild;
+          let child = this.firstElementChild;
           while (child) {
             if (!child.collapsed)
               yield child;
-            child = child.nextSibling;
+            child = child.nextElementSibling;
           }
         ]]></getter>
       </property>
 
       <property name="collapsibleChildren">
         <getter><![CDATA[
           // A generator yielding all children which are able to be collapsed
           // in the order in which they should be collapsed.
@@ -354,18 +354,18 @@
           }
           this.chatboxForURL.delete(aChatbox.getAttribute('src'));
         ]]></body>
       </method>
 
       <method name="removeAll">
         <body><![CDATA[
           this.selectedChat = null;
-          while (this.firstChild) {
-            this._remove(this.firstChild);
+          while (this.firstElementChild) {
+            this._remove(this.firstElementChild);
           }
           // and the nub/popup must also die.
           this.nub.collapsed = true;
         ]]></body>
       </method>
 
       <method name="initChatBox">
         <!-- ideally this would be a method on the chatbox itself, but the