B2G/gecko/browser/components/places/content/treeView.js
/**
   * Gets the node at a given row.
   */
Gets the node at a given row.
Gets the node at a given row .
function PTV__getNodeForRow(aRow) {
    if (aRow < 0) {
      return null;
    }
    let node = this._rows[aRow];
    if (node !== undefined)
      return node;
    let rowNode, row;
    for (let i = aRow - 1; i >= 0 && rowNode === undefined; i--) {
      rowNode = this._rows[i];
      row = i;
    }
    if (!rowNode)
      return this._rows[aRow] = this._rootNode.getChild(aRow);
    if (rowNode instanceof Ci.nsINavHistoryContainerResultNode)
      return this._rows[aRow] = rowNode.getChild(aRow - row - 1);
    let [parent, parentRow] = this._getParentByChildRow(row);
    return this._rows[aRow] = parent.getChild(aRow - parentRow - 1);
  }
function PTV__getNodeForRow ( aRow ) { if ( aRow < 0 ) { return null ; } let node = this . _rows [ aRow ] ; if ( node !== undefined ) return node ; let rowNode , row ; for ( let i = aRow - 1 ; i >= 0 && rowNode === undefined ; i -- ) { rowNode = this . _rows [ i ] ; row = i ; } if ( ! rowNode ) return this . _rows [ aRow ] = this . _rootNode . getChild ( aRow ) ; if ( rowNode instanceof Ci . nsINavHistoryContainerResultNode ) return this . _rows [ aRow ] = rowNode . getChild ( aRow - row - 1 ) ; let [ parent , parentRow ] = this . _getParentByChildRow ( row ) ; return this . _rows [ aRow ] = parent . getChild ( aRow - parentRow - 1 ) ; }
Gets the node at a given row.
Gets the node at a given row .
// Find the nearest node. // If there's no container prior to the given row, it's a child of // the root node (remember: all containers are listed in the rows array). // Unset elements may exist only in plain containers.  Thus, if the nearest // node is a container, it's the row's parent, otherwise, it's a sibling.