qualifiedFontUrl(href, url) {
    if (href.charAt(href.length-1) == '/') {
      href = href.slice(0, href.length-1);
    }
    var hrefUrl = new URL(href);
    if (url.includes('://')) {
      return url;
    } else if (url.startsWith('//')) {
      return hrefUrl.protocol + url;
    } else if (url.startsWith('/')) {
      return hrefUrl.origin + url;
    } else {
      href = href.slice(0, href.lastIndexOf('/'));
      return href + '/' + url;
    }
  }
/**
   * Computes the fully qualified url at which a font can be loaded.
   * TODO(sfine): Make this method sufficiently robust, so that it can replace
   *              the current implementation of qualifiedUrl.
   *
   * @param {string} href The url at which the CSS stylesheet containing the
   *     font is located.
   * @param {string} url The url listed in the font declaration.
   */
Computes the fully qualified url at which a font can be loaded.
TODO(sfine): Make this method sufficiently robust, so that it can replace
the current implementation of qualifiedUrl.

@param {string} href The url at which the CSS stylesheet containing the
font is located.
@param {string} url The url listed in the font declaration.
Computes the fully qualified url at which a font can be loaded . TODO ( sfine ) : Make this method sufficiently robust so that it can replace the current implementation of qualifiedUrl . @param { string } href The url at which the CSS stylesheet containing the font is located . @param { string } url The url listed in the font declaration .
qualifiedFontUrl(href, url) {
    if (href.charAt(href.length-1) == '/') {
      href = href.slice(0, href.length-1);
    }
    var hrefUrl = new URL(href);
    if (url.includes('://')) {
      return url;
    } else if (url.startsWith('//')) {
      return hrefUrl.protocol + url;
    } else if (url.startsWith('/')) {
      return hrefUrl.origin + url;
    } else {
      href = href.slice(0, href.lastIndexOf('/'));
      return href + '/' + url;
    }
  }
qualifiedFontUrl ( href , url ) { if ( href . charAt ( href . length - 1 ) == '/' ) { href = href . slice ( 0 , href . length - 1 ) ; } var hrefUrl = new URL ( href ) ; if ( url . includes ( '://' ) ) { return url ; } else if ( url . startsWith ( '//' ) ) { return hrefUrl . protocol + url ; } else if ( url . startsWith ( '/' ) ) { return hrefUrl . origin + url ; } else { href = href . slice ( 0 , href . lastIndexOf ( '/' ) ) ; return href + '/' + url ; } }
Computes the fully qualified url at which a font can be loaded.
Computes the fully qualified url at which a font can be loaded .