B2G/gecko/browser/components/places/content/controller.js
/**
   * Determine whether or not the selection can be removed, either by the
   * delete or cut operations based on whether or not any of its contents
   * are non-removable. We don't need to worry about recursion here since it
   * is a policy decision that a removable item not be placed inside a non-
   * removable item.
   * @param aIsMoveCommand
   *        True if the command for which this method is called only moves the
   *        selected items to another container, false otherwise.
   * @returns true if all nodes in the selection can be removed,
   *          false otherwise.
   */
Determine whether or not the selection can be removed, either by the
delete or cut operations based on whether or not any of its contents
are non-removable. We don't need to worry about recursion here since it
is a policy decision that a removable item not be placed inside a non
removable item.
@param aIsMoveCommand
True if the command for which this method is called only moves the
selected items to another container, false otherwise.
@returns true if all nodes in the selection can be removed,
false otherwise.
Determine whether or not the selection can be removed either by the delete or cut operations based on whether or not any of its contents are non - removable . We don ' t need to worry about recursion here since it is a policy decision that a removable item not be placed inside a non removable item . @param aIsMoveCommand True if the command for which this method is called only moves the selected items to another container false otherwise . @returns true if all nodes in the selection can be removed false otherwise .
function PC__hasRemovableSelection(aIsMoveCommand) {
    var ranges = this._view.removableSelectionRanges;
    if (!ranges.length)
      return false;
    var root = this._view.result.root;
    for (var j = 0; j < ranges.length; j++) {
      var nodes = ranges[j];
      for (var i = 0; i < nodes.length; ++i) {
        if (nodes[i] == root)
          return false;
        if (PlacesUtils.nodeIsFolder(nodes[i]) &&
            !PlacesControllerDragHelper.canMoveNode(nodes[i]))
          return false;
        var parent = nodes[i].parent || root;
        if (PlacesUtils.isReadonlyFolder(parent))
          return false;
      }
    }
    return true;
  }
function PC__hasRemovableSelection ( aIsMoveCommand ) { var ranges = this . _view . removableSelectionRanges ; if ( ! ranges . length ) return false ; var root = this . _view . result . root ; for ( var j = 0 ; j < ranges . length ; j ++ ) { var nodes = ranges [ j ] ; for ( var i = 0 ; i < nodes . length ; ++ i ) { if ( nodes [ i ] == root ) return false ; if ( PlacesUtils . nodeIsFolder ( nodes [ i ] ) && ! PlacesControllerDragHelper . canMoveNode ( nodes [ i ] ) ) return false ; var parent = nodes [ i ] . parent || root ; if ( PlacesUtils . isReadonlyFolder ( parent ) ) return false ; } } return true ; }
Determine whether or not the selection can be removed, either by the
 delete or cut operations based on whether or not any of its contents
 are non-removable.
Determine whether or not the selection can be removed either by the delete or cut operations based on whether or not any of its contents are non - removable .
// Disallow removing the view's root node // We don't call nodeIsReadOnly here, because nodeIsReadOnly means that // a node has children that cannot be edited, reordered or removed. Here, // we don't care if a node's children can't be reordered or edited, just // that they're removable. All history results have removable children // (based on the principle that any URL in the history table should be // removable), but some special bookmark folders may have non-removable // children, e.g. live bookmark folder children. It doesn't make sense // to delete a child of a live bookmark folder, since when the folder // refreshes, the child will return.