B2G/gecko/browser/components/places/content/treeView.js
/**
   * Tries to find an equivalent node for a node which was removed.  We first
   * look for the original node, in case it was just relocated.  Then, if we
   * that node was not found, we look for a node that has the same itemId, uri
   * and time values.
   *
   * @param aUpdatedContainer
   *        An ancestor of the node which was removed.  It does not have to be
   *        its direct parent.
   * @param aOldNode
   *        The node which was removed.
   *
   * @return the row number of an equivalent node for aOldOne, if one was
   *         found, -1 otherwise.
   */
Tries to find an equivalent node for a node which was removed.  We first
look for the original node, in case it was just relocated.  Then, if we
that node was not found, we look for a node that has the same itemId, uri
and time values.

@param aUpdatedContainer
An ancestor of the node which was removed.  It does not have to be
its direct parent.
@param aOldNode
The node which was removed.

@return the row number of an equivalent node for aOldOne, if one was
found, -1 otherwise.
Tries to find an equivalent node for a node which was removed . We first look for the original node in case it was just relocated . Then if we that node was not found we look for a node that has the same itemId uri and time values . @param aUpdatedContainer An ancestor of the node which was removed . It does not have to be its direct parent . @param aOldNode The node which was removed . @return the row number of an equivalent node for aOldOne if one was found - 1 otherwise .
function PTV__getNewRowForRemovedNode(aUpdatedContainer, aOldNode) {
    let parent = aOldNode.parent;
    if (parent) {
      let ancestors = PlacesUtils.nodeAncestors(aOldNode);
      for (let ancestor in ancestors) {
        if (!ancestor.containerOpen)
          return -1;
      }
      return this._getRowForNode(aOldNode, true);
    }
    let newNode = aUpdatedContainer.findNodeByDetails(aOldNode.uri,
                                                      aOldNode.time,
                                                      aOldNode.itemId,
                                                      true);
    if (!newNode)
      return -1;
    return this._getRowForNode(newNode, true);
  }
function PTV__getNewRowForRemovedNode ( aUpdatedContainer , aOldNode ) { let parent = aOldNode . parent ; if ( parent ) { let ancestors = PlacesUtils . nodeAncestors ( aOldNode ) ; for ( let ancestor in ancestors ) { if ( ! ancestor . containerOpen ) return - 1 ; } return this . _getRowForNode ( aOldNode , true ) ; } let newNode = aUpdatedContainer . findNodeByDetails ( aOldNode . uri , aOldNode . time , aOldNode . itemId , true ) ; if ( ! newNode ) return - 1 ; return this . _getRowForNode ( newNode , true ) ; }
Tries to find an equivalent node for a node which was removed.
Tries to find an equivalent node for a node which was removed .
// If the node's parent is still set, the node is not obsolete // and we should just find out its new position. // However, if any of the node's ancestor is closed, the node is // invisible. // There's a broken edge case here. // If a visit appears in two queries, and the second one was // the old node, we'll select the first one after refresh.  There's // nothing we could do about that, because aOldNode.parent is // gone by the time invalidateContainer is called.