B2G/gecko/browser/components/places/content/treeView.js
/**
   * Plain Container: container result nodes which may never include sub
   * hierarchies.
   *
   * When the rows array is constructed, we don't set the children of plain
   * containers.  Instead, we keep placeholders for these children.  We then
   * build these children lazily as the tree asks us for information about each
   * row.  Luckily, the tree doesn't ask about rows outside the visible area.
   *
   * @see _getNodeForRow and _getRowForNode for the actual magic.
   *
   * @note It's guaranteed that all containers are listed in the rows
   * elements array.  It's also guaranteed that separators (if they're not
   * filtered, see below) are listed in the visible elements array, because
   * bookmark folders are never built lazily, as described above.
   *
   * @param aContainer
   *        A container result node.
   *
   * @return true if aContainer is a plain container, false otherwise.
   */
Plain Container: container result nodes which may never include sub
hierarchies.

When the rows array is constructed, we don't set the children of plain
containers.  Instead, we keep placeholders for these children.  We then
build these children lazily as the tree asks us for information about each
row.  Luckily, the tree doesn't ask about rows outside the visible area.

@see _getNodeForRow and _getRowForNode for the actual magic.

@note It's guaranteed that all containers are listed in the rows
elements array.  It's also guaranteed that separators (if they're not
filtered, see below) are listed in the visible elements array, because
bookmark folders are never built lazily, as described above.

@param aContainer
A container result node.

@return true if aContainer is a plain container, false otherwise.
Plain Container : container result nodes which may never include sub hierarchies . When the rows array is constructed we don ' t set the children of plain containers . Instead we keep placeholders for these children . We then build these children lazily as the tree asks us for information about each row . Luckily the tree doesn ' t ask about rows outside the visible area . @see _getNodeForRow and _getRowForNode for the actual magic . @note It ' s guaranteed that all containers are listed in the rows elements array . It ' s also guaranteed that separators ( if they ' re not filtered see below ) are listed in the visible elements array because bookmark folders are never built lazily as described above . @param aContainer A container result node . @return true if aContainer is a plain container false otherwise .
function PTV__isPlainContainer(aContainer) {
    if (this._controller.hasCachedLivemarkInfo(aContainer))
      return true;
    if (!(aContainer instanceof Ci.nsINavHistoryQueryResultNode))
      return false;
    switch (aContainer.queryOptions.resultType) {
      case Ci.nsINavHistoryQueryOptions.RESULTS_AS_DATE_QUERY:
      case Ci.nsINavHistoryQueryOptions.RESULTS_AS_SITE_QUERY:
      case Ci.nsINavHistoryQueryOptions.RESULTS_AS_DATE_SITE_QUERY:
      case Ci.nsINavHistoryQueryOptions.RESULTS_AS_TAG_QUERY:
        return false;
    }
    let nodeType = aContainer.type;
    return nodeType != Ci.nsINavHistoryResultNode.RESULT_TYPE_FOLDER &&
           nodeType != Ci.nsINavHistoryResultNode.RESULT_TYPE_FOLDER_SHORTCUT;
  }
function PTV__isPlainContainer ( aContainer ) { if ( this . _controller . hasCachedLivemarkInfo ( aContainer ) ) return true ; if ( ! ( aContainer instanceof Ci . nsINavHistoryQueryResultNode ) ) return false ; switch ( aContainer . queryOptions . resultType ) { case Ci . nsINavHistoryQueryOptions . RESULTS_AS_DATE_QUERY : case Ci . nsINavHistoryQueryOptions . RESULTS_AS_SITE_QUERY : case Ci . nsINavHistoryQueryOptions . RESULTS_AS_DATE_SITE_QUERY : case Ci . nsINavHistoryQueryOptions . RESULTS_AS_TAG_QUERY : return false ; } let nodeType = aContainer . type ; return nodeType != Ci . nsINavHistoryResultNode . RESULT_TYPE_FOLDER && nodeType != Ci . nsINavHistoryResultNode . RESULT_TYPE_FOLDER_SHORTCUT ; }
Plain Container: container result nodes which may never include sub
 hierarchies.
Plain Container : container result nodes which may never include sub hierarchies .
// Livemarks are always plain containers. // We don't know enough about non-query containers. // If it's a folder, it's not a plain container.