Bug 1506535 - Port bug 1503342: Change uses of richlistbox.children to richlistbox.itemChildren. r=jorgk
authorGeoff Lankow <geoff@darktrojan.net>
Mon, 12 Nov 2018 23:56:21 +1300
changeset 33700 8ebed1915704a6107678b2d933790d22496bcb39
parent 33699 f7517410336f5369c55533c6f195fc6cce1e5b7a
child 33701 0eb273edd4ab0ec05bf53914f56e1eee12e10795
push id388
push userclokep@gmail.com
push dateMon, 28 Jan 2019 20:54:56 +0000
reviewersjorgk
bugs1506535, 1503342
Bug 1506535 - Port bug 1503342: Change uses of richlistbox.children to richlistbox.itemChildren. r=jorgk
mail/base/content/FilterListDialog.js
mail/components/im/content/imAccounts.js
mail/test/mozmill/attachment/test-attachment.js
--- a/mail/base/content/FilterListDialog.js
+++ b/mail/base/content/FilterListDialog.js
@@ -666,17 +666,17 @@ function moveCurrentFilter(motion)
   gCurrentFilterList.moveFilter(filter, motion);
   rebuildFilterList();
 }
 
 /**
  * Redraws the list of filters. Takes the search box value into account.
  *
  * This function should perform very fast even in case of high number of filters.
- * Therefore there are some optimizations (e.g. listelement.children[] instead of
+ * Therefore there are some optimizations (e.g. listelement.itemChildren[] instead of
  * list.getItemAtIndex()), that favour speed vs. semantical perfection.
  */
 function rebuildFilterList()
 {
   // Get filters that match the search box.
   let aTempFilterList = onFindFilter();
 
   let searchBoxFocus = false;
@@ -723,18 +723,18 @@ function rebuildFilterList()
       break;
 
     filter = gCurrentFilterList.getFilterAt(i);
     if (aTempFilterList && aTempFilterList[listitemIndex] != i)
       continue;
 
     if (listitemCount > listitemIndex) {
       // If there is a free existing listitem, reuse it.
-      // Use .children[] instead of .getItemAtIndex() as it is much faster.
-      listitem = gFilterListbox.children[listitemIndex];
+      // Use .itemChildren[] instead of .getItemAtIndex() as it is much faster.
+      listitem = gFilterListbox.itemChildren[listitemIndex];
       nameCell = listitem.firstChild;
       enabledCell = nameCell.nextSibling;
     }
     else
     {
       // If there are not enough listitems in the list, create a new one.
       listitem = document.createElement("richlistitem");
       listitem.setAttribute("align", "center");
--- a/mail/components/im/content/imAccounts.js
+++ b/mail/components/im/content/imAccounts.js
@@ -432,17 +432,17 @@ var gAccountManager = {
   },
 
   moveCurrentItem: function am_moveCurrentItem(aOffset) {
     let accountList = this.accountList;
     if (!aOffset || !accountList.selectedItem)
       return;
 
     // Create the new preference value from the richlistbox list
-    let items = accountList.children;
+    let items = accountList.itemChildren;
     let selectedID = accountList.selectedItem.id;
     let array = [];
     for (let i in items)
       if (items[i].id != selectedID)
         array.push(items[i].id);
 
     let newIndex = accountList.selectedIndex + aOffset;
     if (newIndex < 0)
--- a/mail/test/mozmill/attachment/test-attachment.js
+++ b/mail/test/mozmill/attachment/test-attachment.js
@@ -368,18 +368,18 @@ function test_selected_attachments_are_c
 
   // Select both the attachments.
   let attachmentList = mc.e("attachmentList");
   assert_equals(attachmentList.selectedItems.length, 1,
                 "On first load the first item should be selected");
 
   // We can just click on the first element, but the second one needs a
   // ctrl-click (or cmd-click for those Mac-heads among us).
-  mc.click(new elib.Elem(attachmentList.children[0]), 5, 5);
-  EventUtils.synthesizeMouse(attachmentList.children[1], 5, 5,
+  mc.click(new elib.Elem(attachmentList.itemChildren[0]), 5, 5);
+  EventUtils.synthesizeMouse(attachmentList.itemChildren[1], 5, 5,
                              {accelKey: true}, mc.window);
 
   assert_equals(attachmentList.selectedItems.length, 2,
                 "We had the wrong number of selected items after selecting " +
                 "some!");
 
   // Switch to the message with one attachment, and make sure there are no
   // selected attachments.