<commit_before>var wptImages = function(win) {
  var images = [];
  if (win) {
    var doc = win.document;
    var elements = doc.getElementsByTagName("*");
    for (var i = 0; i < elements.length; i++) {
      var el = elements[i];
      if (el.tagName == "IMG") {
        var url = el.currentSrc || el.src;

        // Only include HTTP(S) URLs i.e. skip dataURIs
        if (url.indexOf("http") === 0) {
          images.push({
            url: url,
            width: el.width,
            height: el.height,
            naturalWidth: el.naturalWidth,
            naturalHeight: el.naturalHeight,
            loading: el.getAttribute("loading"),
            "in-viewport": el.getBoundingClientRect().top < window.innerHeight,
          });
        }
      }
      if (el.tagName == "IFRAME") {
        try {
          var im = wptImages(el.contentWindow);
          if (im && im.length) {
            images = images.concat(im);
          }
        } catch(e) {}
      }
      if (images.length > 10000)
        break;
    }
  }
  return images;
};

return JSON.stringify(wptImages(window));<commit_msg>Measure decoding attribute of images (#206)<commit_after>var wptImages = function(win) {
  var images = [];
  if (win) {
    var doc = win.document;
    var elements = doc.getElementsByTagName("*");
    for (var i = 0; i < elements.length; i++) {
      var el = elements[i];
      if (el.tagName == "IMG") {
        var url = el.currentSrc || el.src;

        // Only include HTTP(S) URLs i.e. skip dataURIs
        if (url.indexOf("http") === 0) {
          images.push({
            url: url,
            width: el.width,
            height: el.height,
            naturalWidth: el.naturalWidth,
            naturalHeight: el.naturalHeight,
            loading: el.getAttribute("loading"),
            decoding: el.getAttribute("decoding"),
            inViewport: el.getBoundingClientRect().top < window.innerHeight,
          });
        }
      }
      if (el.tagName == "IFRAME") {
        try {
          var im = wptImages(el.contentWindow);
          if (im && im.length) {
            images = images.concat(im);
          }
        } catch(e) {}
      }
      if (images.length > 10000)
        break;
    }
  }
  return images;
};

return JSON.stringify(wptImages(window));
{'fraction_non_alphanumeric': 0.14092495636998253, 'fraction_numerical': 0.007417102966841187, 'mean_word_length': 1.7693236714975846, 'pattern_counts': {'":': 1, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3915414', 'n_tokens_mistral': 720, 'n_tokens_neox': 699, 'n_words': 160}