Bug 1508143 - Port bug 1508143: Replace use of tree binding's .builderView and .contentView with .view. r=jorgk
authorRichard Marti <richard.marti@gmail.com>
Mon, 19 Nov 2018 19:46:35 +0100
changeset 33743 aa07a415e6471232454abc757e172b11693baa08
parent 33742 0a1e5f9bc3135ad07009ca682ae8b43f82992d58
child 33744 614e7c6b92064d9985d9e300b6f22ddf15925c48
push id388
push userclokep@gmail.com
push dateMon, 28 Jan 2019 20:54:56 +0000
reviewersjorgk
bugs1508143
Bug 1508143 - Port bug 1508143: Replace use of tree binding's .builderView and .contentView with .view. r=jorgk
editor/ui/dialogs/content/EdAdvancedEdit.js
mail/base/content/mailWidgets.xml
mail/test/mozmill/shared-modules/test-account-manager-helpers.js
mailnews/base/content/msgSynchronize.js
mailnews/base/prefs/content/AccountManager.js
--- a/editor/ui/dialogs/content/EdAdvancedEdit.js
+++ b/editor/ui/dialogs/content/EdAdvancedEdit.js
@@ -315,19 +315,19 @@ function AddTreeItem ( name, value, tree
   } catch (e) {}
   gDoOnSelectTree = true;
 
   return treeitem;
 }
 
 function selectTreeItem(treeChildren, item)
 {
-  var index = treeChildren.parentNode.contentView.getIndexOfItem(item);
+  var index = treeChildren.parentNode.view.getIndexOfItem(item);
   treeChildren.parentNode.view.selection.select(index);
 }
 
 function getSelectedItem(tree)
 {
   if (tree.view.selection.count == 1)
-    return tree.contentView.getItemAtIndex(tree.currentIndex);
+    return tree.view.getItemAtIndex(tree.currentIndex);
   else
     return null;
 }
--- a/mail/base/content/mailWidgets.xml
+++ b/mail/base/content/mailWidgets.xml
@@ -1849,17 +1849,17 @@
           ]]>
         </body>
       </method>
       <method name="fire">
         <body>
           <![CDATA[
             this.hidePopup();
             if (this.tree.currentIndex >= 0) {
-              this.setAttribute("uri", this.tree.builderView.getResourceAtIndex(this.tree.currentIndex).Value);
+              this.setAttribute("uri", this.tree.view.getResourceAtIndex(this.tree.currentIndex).Value);
               this.doCommand();
             }
           ]]>
         </body>
       </method>
       <method name="onBlurMenuList">
         <parameter name="event"/>
         <body>
--- a/mail/test/mozmill/shared-modules/test-account-manager-helpers.js
+++ b/mail/test/mozmill/shared-modules/test-account-manager-helpers.js
@@ -88,17 +88,17 @@ function click_account_tree_row(controll
 
   fdh.click_tree_row(tree, rowIndex, controller);
 
   utils.waitFor(() => controller.window.pendingAccount == null,
                 "Timeout waiting for pendingAccount to become null");
 
   // Ensure the page is fully loaded (e.g. onInit functions).
   wh.wait_for_frame_load(controller.e("contentFrame"),
-    controller.window.pageURL(tree.contentView.getItemAtIndex(rowIndex)
+    controller.window.pageURL(tree.view.getItemAtIndex(rowIndex)
                                               .getAttribute("PageTag")));
 }
 
 /**
  * Returns the index of the row in account tree corresponding to the wanted
  * account and its settings pane.
  *
  * @param aAccountKey  The key of the account to return.
--- a/mailnews/base/content/msgSynchronize.js
+++ b/mailnews/base/content/msgSynchronize.js
@@ -191,10 +191,10 @@ function UpdateNode(resource, row)
     if (!(resource.Value in gInitialFolderStates)) {
       gInitialFolderStates[resource.Value] = folder.getFlag(Ci.nsMsgFolderFlags.Offline);
     }
 
     folder.toggleFlag(Ci.nsMsgFolderFlags.Offline);
 }
 
 function GetFolderResource(aTree, aIndex) {
-  return aTree.builderView.getResourceAtIndex(aIndex);
+  return aTree.view.getResourceAtIndex(aIndex);
 }
--- a/mailnews/base/prefs/content/AccountManager.js
+++ b/mailnews/base/prefs/content/AccountManager.js
@@ -190,23 +190,23 @@ function selectServer(server, selectPage
     let pageId = accountNode.getAttribute("PageTag");
     if (pageId != selectPageId) {
       // ... or one of its children.
       pageToSelect = accountNode.querySelector('[PageTag="' + selectPageId + '"]');
     }
   }
 
   let accountTree = document.getElementById("accounttree");
-  let index = accountTree.contentView.getIndexOfItem(pageToSelect);
+  let index = accountTree.view.getIndexOfItem(pageToSelect);
   accountTree.view.selection.select(index);
   accountTree.treeBoxObject.ensureRowIsVisible(index);
 
   let lastItem = accountNode.lastChild.lastChild;
   if (lastItem.localName == "treeitem")
-    index = accountTree.contentView.getIndexOfItem(lastItem);
+    index = accountTree.view.getIndexOfItem(lastItem);
 
   accountTree.treeBoxObject.ensureRowIsVisible(index);
 }
 
 function replaceWithDefaultSmtpServer(deletedSmtpServerKey)
 {
   // First we replace the smtpserverkey in every identity.
   let am = MailServices.accounts;
@@ -1033,17 +1033,17 @@ function onAccountTreeSelect(pageId, acc
 {
   let tree = document.getElementById("accounttree");
 
   let changeView = pageId && account;
   if (!changeView) {
     if (tree.view.selection.count < 1)
       return false;
 
-    let node = tree.contentView.getItemAtIndex(tree.currentIndex);
+    let node = tree.view.getItemAtIndex(tree.currentIndex);
     account = ("_account" in node) ? node._account : null;
 
     pageId = node.getAttribute("PageTag")
   }
 
   if (pageId == currentPageId && account == currentAccount)
     return true;