B2G/gecko/browser/devtools/highlighter/highlighter.jsm
/**
   * Highlight a rectangular region.
   *
   * @param object aRect
   *        The rectangle region to highlight.
   * @returns boolean
   *          True if the rectangle was highlighted, false otherwise.
   */
Highlight a rectangular region.
@param object aRect
The rectangle region to highlight.
@returns boolean
True if the rectangle was highlighted, false otherwise.
Highlight a rectangular region . @param object aRect The rectangle region to highlight . @returns boolean True if the rectangle was highlighted false otherwise .
function Highlighter_highlightRectangle(aRect)
  {
    if (!aRect) {
      this.unhighlight();
      return;
    }
    let oldRect = this._contentRect;
    if (oldRect && aRect.top == oldRect.top && aRect.left == oldRect.left &&
        aRect.width == oldRect.width && aRect.height == oldRect.height) {
      return; 
    }
    let aRectScaled = LayoutHelpers.getZoomedRect(this.win, aRect);
    if (aRectScaled.left >= 0 && aRectScaled.top >= 0 &&
        aRectScaled.width > 0 && aRectScaled.height > 0) {
      this.showOutline();
      let top = "top:" + aRectScaled.top + "px;";
      let left = "left:" + aRectScaled.left + "px;";
      let width = "width:" + aRectScaled.width + "px;";
      let height = "height:" + aRectScaled.height + "px;";
      this.outline.setAttribute("style", top + left + width + height);
      this._highlighting = true;
    } else {
      this.unhighlight();
    }
    this._contentRect = aRect; 
    this._highlightRect = aRectScaled; 
    return;
  }
function Highlighter_highlightRectangle ( aRect ) { if ( ! aRect ) { this . unhighlight ( ) ; return ; } let oldRect = this . _contentRect ; if ( oldRect && aRect . top == oldRect . top && aRect . left == oldRect . left && aRect . width == oldRect . width && aRect . height == oldRect . height ) { return ; } let aRectScaled = LayoutHelpers . getZoomedRect ( this . win , aRect ) ; if ( aRectScaled . left >= 0 && aRectScaled . top >= 0 && aRectScaled . width > 0 && aRectScaled . height > 0 ) { this . showOutline ( ) ; let top = "top:" + aRectScaled . top + "px;" ; let left = "left:" + aRectScaled . left + "px;" ; let width = "width:" + aRectScaled . width + "px;" ; let height = "height:" + aRectScaled . height + "px;" ; this . outline . setAttribute ( "style" , top + left + width + height ) ; this . _highlighting = true ; } else { this . unhighlight ( ) ; } this . _contentRect = aRect ; this . _highlightRect = aRectScaled ; return ; }
Highlight a rectangular region.
Highlight a rectangular region .
// same rectangle // The bottom div and the right div are flexibles (flex=1). // We don't need to resize them. // save orig (non-scaled) rect // and save the scaled rect.