MCPcopy
hub / github.com/ampproject/amphtml / load

Method load

extensions/amp-font/0.1/fontloader.js:56–71  ·  view source on GitHub ↗

* Triggers the font load. Returns promise that will complete when loading * is considered to be complete. * @param {!FontConfigDef} fontConfig Config that describes the font to be * loaded. * @param {number} timeout number of milliseconds after which the font load * attempt woul

(fontConfig, timeout)

Source from the content-addressed store, hash-verified

54 * @return {!Promise}
55 */
56 load(fontConfig, timeout) {
57 this.fontConfig_ = fontConfig;
58 return Services.timerFor(this.ampdoc_.win)
59 .timeoutPromise(timeout, this.load_())
60 .then(
61 () => {
62 this.fontLoadResolved_ = true;
63 this.dispose_();
64 },
65 (reason) => {
66 this.fontLoadRejected_ = true;
67 this.dispose_();
68 throw reason;
69 }
70 );
71 }
72
73 /**
74 * Triggers the font load. Returns promise that will complete when loading

Callers 15

loadObject_Method · 0.45
onOverlayButtonInteractFunction · 0.45
openxFunction · 0.45
createAdsAndEmbedFunction · 0.45
loadFonts_Method · 0.45
addDevice_Method · 0.45
loadFontsFunction · 0.45
executeInternalMethod · 0.45
switchToLowerBitrate_Method · 0.45
handleMediaError_Method · 0.45
pickSmallerPhase1Function · 0.45

Calls 4

load_Method · 0.95
dispose_Method · 0.95
timeoutPromiseMethod · 0.80
thenMethod · 0.45

Tested by

no test coverage detected