B2G/gecko/browser/devtools/debugger/debugger-view.js
/**
   * Adds a breakpoint to the breakpoints container.
   * If the breakpoint already exists (was previously added), null is returned.
   * If it's already added but disabled, it will be enabled and null is returned.
   * Otherwise, the newly created element is returned.
   *
   * @param string aId
   *        A breakpoint identifier specified by the debugger.
   * @param string aLineInfo
   *        The script line information to be displayed in the list.
   * @param string aLineText
   *        The script line text to be displayed in the list.
   * @param string aUrl
   *        The original breakpoint script url.
   * @param number aLine
   *        The original breakpoint script line.
   * @return object
   *         The newly created html node representing the added breakpoint.
   */
Adds a breakpoint to the breakpoints container.
If the breakpoint already exists (was previously added), null is returned.
If it's already added but disabled, it will be enabled and null is returned.
Otherwise, the newly created element is returned.

@param string aId
A breakpoint identifier specified by the debugger.
@param string aLineInfo
The script line information to be displayed in the list.
@param string aLineText
The script line text to be displayed in the list.
@param string aUrl
The original breakpoint script url.
@param number aLine
The original breakpoint script line.
@return object
The newly created html node representing the added breakpoint.
Adds a breakpoint to the breakpoints container . If the breakpoint already exists ( was previously added ) null is returned . If it ' s already added but disabled it will be enabled and null is returned . Otherwise the newly created element is returned . @param string aId A breakpoint identifier specified by the debugger . @param string aLineInfo The script line information to be displayed in the list . @param string aLineText The script line text to be displayed in the list . @param string aUrl The original breakpoint script url . @param number aLine The original breakpoint script line . @return object The newly created html node representing the added breakpoint .
function DVB_addBreakpoint(aId, aLineInfo, aLineText, aUrl, aLine) {
    if (document.getElementById("breakpoint-" + aId)) {
      return null;
    }
    if (!this.count) {
      this.empty();
    }
    let breakpoint = this.getBreakpoint(aUrl, aLine);
    if (breakpoint) {
      breakpoint.id = "breakpoint-" + aId;
      breakpoint.breakpointActor = aId;
      breakpoint.getElementsByTagName("checkbox")[0].setAttribute("checked", "true");
      return;
    }
    breakpoint = document.createElement("box");
    let bkpCheckbox = document.createElement("checkbox");
    let bkpLineInfo = document.createElement("label");
    let bkpLineText = document.createElement("label");
    breakpoint.id = "breakpoint-" + aId;
    breakpoint.className = "dbg-breakpoint list-item";
    breakpoint.setAttribute("location", aUrl + ":" + aLine);
    breakpoint.breakpointUrl = aUrl;
    breakpoint.breakpointLine = aLine;
    breakpoint.breakpointActor = aId;
    aLineInfo = aLineInfo.trim();
    aLineText = aLineText.trim();
    bkpCheckbox.setAttribute("checked", "true");
    bkpCheckbox.addEventListener("click", this._onBreakpointCheckboxChange, false);
    bkpLineInfo.className = "dbg-breakpoint-info plain";
    bkpLineText.className = "dbg-breakpoint-text plain";
    bkpLineInfo.setAttribute("value", aLineInfo);
    bkpLineText.setAttribute("value", aLineText);
    bkpLineInfo.setAttribute("crop", "end");
    bkpLineText.setAttribute("crop", "end");
    bkpLineText.setAttribute("tooltiptext", aLineText.substr(0, BREAKPOINT_LINE_TOOLTIP_MAX_SIZE));
    let menupopupId = this._createContextMenu(breakpoint);
    breakpoint.setAttribute("contextmenu", menupopupId);
    let state = document.createElement("vbox");
    state.className = "state";
    state.appendChild(bkpCheckbox);
    let content = document.createElement("vbox");
    content.className = "content";
    content.setAttribute("flex", "1");
    content.appendChild(bkpLineInfo);
    content.appendChild(bkpLineText);
    breakpoint.appendChild(state);
    breakpoint.appendChild(content);
    this._breakpoints.appendChild(breakpoint);
    return breakpoint;
  }
function DVB_addBreakpoint ( aId , aLineInfo , aLineText , aUrl , aLine ) { if ( document . getElementById ( "breakpoint-" + aId ) ) { return null ; } if ( ! this . count ) { this . empty ( ) ; } let breakpoint = this . getBreakpoint ( aUrl , aLine ) ; if ( breakpoint ) { breakpoint . id = "breakpoint-" + aId ; breakpoint . breakpointActor = aId ; breakpoint . getElementsByTagName ( "checkbox" ) [ 0 ] . setAttribute ( "checked" , "true" ) ; return ; } breakpoint = document . createElement ( "box" ) ; let bkpCheckbox = document . createElement ( "checkbox" ) ; let bkpLineInfo = document . createElement ( "label" ) ; let bkpLineText = document . createElement ( "label" ) ; breakpoint . id = "breakpoint-" + aId ; breakpoint . className = "dbg-breakpoint list-item" ; breakpoint . setAttribute ( "location" , aUrl + ":" + aLine ) ; breakpoint . breakpointUrl = aUrl ; breakpoint . breakpointLine = aLine ; breakpoint . breakpointActor = aId ; aLineInfo = aLineInfo . trim ( ) ; aLineText = aLineText . trim ( ) ; bkpCheckbox . setAttribute ( "checked" , "true" ) ; bkpCheckbox . addEventListener ( "click" , this . _onBreakpointCheckboxChange , false ) ; bkpLineInfo . className = "dbg-breakpoint-info plain" ; bkpLineText . className = "dbg-breakpoint-text plain" ; bkpLineInfo . setAttribute ( "value" , aLineInfo ) ; bkpLineText . setAttribute ( "value" , aLineText ) ; bkpLineInfo . setAttribute ( "crop" , "end" ) ; bkpLineText . setAttribute ( "crop" , "end" ) ; bkpLineText . setAttribute ( "tooltiptext" , aLineText . substr ( 0 , BREAKPOINT_LINE_TOOLTIP_MAX_SIZE ) ) ; let menupopupId = this . _createContextMenu ( breakpoint ) ; breakpoint . setAttribute ( "contextmenu" , menupopupId ) ; let state = document . createElement ( "vbox" ) ; state . className = "state" ; state . appendChild ( bkpCheckbox ) ; let content = document . createElement ( "vbox" ) ; content . className = "content" ; content . setAttribute ( "flex" , "1" ) ; content . appendChild ( bkpLineInfo ) ; content . appendChild ( bkpLineText ) ; breakpoint . appendChild ( state ) ; breakpoint . appendChild ( content ) ; this . _breakpoints . appendChild ( breakpoint ) ; return breakpoint ; }
Adds a breakpoint to the breakpoints container.
Adds a breakpoint to the breakpoints container .
// Make sure we don't duplicate anything. // Remove the empty list text if it was there. // If the breakpoint was already added but disabled, enable it now. // Create a list item to be added to the stackframes container. // A checkbox specifies if the breakpoint is enabled or not. // This list should display the line info and text for the breakpoint. // Create a context menu for the breakpoint. // Return the element for later use if necessary.