B2G/gecko/browser/components/tabview/modules/utils.jsm
// or null if they don't intersect.
or null if they don't intersect.
or null if they don ' t intersect .
function Rect_intersection(rect) {
    var box = new Rect(Math.max(rect.left, this.left), Math.max(rect.top, this.top), 0, 0);
    box.right = Math.min(rect.right, this.right);
    box.bottom = Math.min(rect.bottom, this.bottom);
    if (box.width > 0 && box.height > 0)
      return box;
    return null;
  }
function Rect_intersection ( rect ) { var box = new Rect ( Math . max ( rect . left , this . left ) , Math . max ( rect . top , this . top ) , 0 , 0 ) ; box . right = Math . min ( rect . right , this . right ) ; box . bottom = Math . min ( rect . bottom , this . bottom ) ; if ( box . width > 0 && box . height > 0 ) return box ; return null ; }
or null if they don't intersect.
or null if they don ' t intersect .