build/index.js
function() {
    // Walk all of the elements in the DOM (try to only do this once)
    var elements = doc.getElementsByTagName('*');
    var re = /url\((http.*)\)/ig;
    for (var i = 0; i < elements.length; i++) {
      var el = elements[i];
      var style = win.getComputedStyle(el);

      // check for Images
      if (el.tagName == 'IMG') {
        CheckElement(el, el.src);
      }
      // Check for background images
      if (style['background-image']) {
        re.lastIndex = 0;
        var matches = re.exec(style['background-image']);
        if (matches && matches.length > 1)
          CheckElement(el, matches[1]);
      }
      // recursively walk any iFrames
      if (el.tagName == 'IFRAME') {
        try {
          var rect = GetElementViewportRect(el);
          if (rect) {
            var tm = RUMSpeedIndex(el.contentWindow);
            if (tm) {
              rects.push({'tm': tm,
                          'area': rect.area,
                          'rect': rect});
            }
        }
        } catch(e) {
        }
      }
    }
  }
function() {
    // Walk all of the elements in the DOM (try to only do this once)
    var elements = doc.getElementsByTagName('*');
    var re = /url\((http.*)\)/ig;
    for (var i = 0; i < elements.length; i++) {
      var el = elements[i];
      var style = win.getComputedStyle(el);

      // check for Images
      if (el.tagName == 'IMG') {
        CheckElement(el, el.src);
      }
      // Check for background images
      if (style['background-image']) {
        re.lastIndex = 0;
        var matches = re.exec(style['background-image']);
        if (matches && matches.length > 1)
          CheckElement(el, matches[1]);
      }
      // recursively walk any iFrames
      if (el.tagName == 'IFRAME') {
        try {
          var rect = GetElementViewportRect(el);
          if (rect) {
            var tm = RUMSpeedIndex(el.contentWindow);
            if (tm) {
              rects.push({'tm': tm,
                          'area': rect.area,
                          'rect': rect});
            }
        }
        } catch(e) {
        }
      }
    }
  }
function ( ) { // Walk all of the elements in the DOM (try to only do this once) var elements = doc . getElementsByTagName ( '*' ) ; var re = / url\((http.*)\) / ig ; for ( var i = 0 ; i < elements . length ; i ++ ) { var el = elements [ i ] ; var style = win . getComputedStyle ( el ) ; // check for Images if ( el . tagName == 'IMG' ) { CheckElement ( el , el . src ) ; } // Check for background images if ( style [ 'background-image' ] ) { re . lastIndex = 0 ; var matches = re . exec ( style [ 'background-image' ] ) ; if ( matches && matches . length > 1 ) CheckElement ( el , matches [ 1 ] ) ; } // recursively walk any iFrames if ( el . tagName == 'IFRAME' ) { try { var rect = GetElementViewportRect ( el ) ; if ( rect ) { var tm = RUMSpeedIndex ( el . contentWindow ) ; if ( tm ) { rects . push ( { 'tm' : tm , 'area' : rect . area , 'rect' : rect } ) ; } } } catch ( e ) { } } } }
Get the visible rectangles for elements that we care about
Get the visible rectangles for elements that we care about