B2G/gecko/browser/components/places/content/places.js
/**
   * Removes content generated previously from a menupopup.
   * @param   popup
   *          The popup that contains the previously generated content.
   * @param   startID
   *          The id attribute of an element that is the start of the
   *          dynamically generated region - remove elements after this
   *          item only.
   *          Must be contained by popup. Can be null (in which case the
   *          contents of popup are removed).
   * @param   endID
   *          The id attribute of an element that is the end of the
   *          dynamically generated region - remove elements up to this
   *          item only.
   *          Must be contained by popup. Can be null (in which case all
   *          items until the end of the popup will be removed). Ignored
   *          if startID is null.
   * @returns The element for the caller to insert new items before,
   *          null if the caller should just append to the popup.
   */
Removes content generated previously from a menupopup.
@param   popup
The popup that contains the previously generated content.
@param   startID
The id attribute of an element that is the start of the
dynamically generated region - remove elements after this
item only.
Must be contained by popup. Can be null (in which case the
contents of popup are removed).
@param   endID
The id attribute of an element that is the end of the
dynamically generated region - remove elements up to this
item only.
Must be contained by popup. Can be null (in which case all
items until the end of the popup will be removed). Ignored
if startID is null.
@returns The element for the caller to insert new items before,
null if the caller should just append to the popup.
Removes content generated previously from a menupopup . @param popup The popup that contains the previously generated content . @param startID The id attribute of an element that is the start of the dynamically generated region - remove elements after this item only . Must be contained by popup . Can be null ( in which case the contents of popup are removed ) . @param endID The id attribute of an element that is the end of the dynamically generated region - remove elements up to this item only . Must be contained by popup . Can be null ( in which case all items until the end of the popup will be removed ) . Ignored if startID is null . @returns The element for the caller to insert new items before null if the caller should just append to the popup .
function VM__clean(popup, startID, endID) {
    if (endID)
      NS_ASSERT(startID, "meaningless to have valid endID and null startID");
    if (startID) {
      var startElement = document.getElementById(startID);
      NS_ASSERT(startElement.parentNode ==
                popup, "startElement is not in popup");
      NS_ASSERT(startElement,
                "startID does not correspond to an existing element");
      var endElement = null;
      if (endID) {
        endElement = document.getElementById(endID);
        NS_ASSERT(endElement.parentNode == popup,
                  "endElement is not in popup");
        NS_ASSERT(endElement,
                  "endID does not correspond to an existing element");
      }
      while (startElement.nextSibling != endElement)
        popup.removeChild(startElement.nextSibling);
      return endElement;
    }
    else {
      while(popup.hasChildNodes())
        popup.removeChild(popup.firstChild);
    }
    return null;
  }
function VM__clean ( popup , startID , endID ) { if ( endID ) NS_ASSERT ( startID , "meaningless to have valid endID and null startID" ) ; if ( startID ) { var startElement = document . getElementById ( startID ) ; NS_ASSERT ( startElement . parentNode == popup , "startElement is not in popup" ) ; NS_ASSERT ( startElement , "startID does not correspond to an existing element" ) ; var endElement = null ; if ( endID ) { endElement = document . getElementById ( endID ) ; NS_ASSERT ( endElement . parentNode == popup , "endElement is not in popup" ) ; NS_ASSERT ( endElement , "endID does not correspond to an existing element" ) ; } while ( startElement . nextSibling != endElement ) popup . removeChild ( startElement . nextSibling ) ; return endElement ; } else { while ( popup . hasChildNodes ( ) ) popup . removeChild ( popup . firstChild ) ; } return null ; }
Removes content generated previously from a menupopup.
Removes content generated previously from a menupopup .