src/size-list.js
/**
   * Selects the first size that matches media conditions. If no options match,
   * the last option is returned.
   *
   * See http://www.w3.org/html/wg/drafts/html/master/semantics.html#attr-img-sizes
   * @param {!Window} win
   * @return {!./layout.LengthDef|string}
   */
Selects the first size that matches media conditions. If no options match,
the last option is returned.


Selects the first size that matches media conditions . If no options match the last option is returned .
select(win) {
    for (let i = 0; i < this.sizes_.length - 1; i++) {
      const option = this.sizes_[i];
      if (option.mediaQuery && win.matchMedia(option.mediaQuery).matches) {
        return option.size;
      }
    }
    return this.getLast();
  }
select ( win ) { for ( let i = 0 ; i < this . sizes_ . length - 1 ; i ++ ) { const option = this . sizes_ [ i ] ; if ( option . mediaQuery && win . matchMedia ( option . mediaQuery ) . matches ) { return option . size ; } } return this . getLast ( ) ; }
Selects the first size that matches media conditions.
Selects the first size that matches media conditions .