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

Method constructor

third_party/subscriptions-project/swg.js:10239–10254  ·  view source on GitHub ↗

* @param {!Document} doc * @param {!Object =} attrs

(doc, attrs = {})

Source from the content-addressed store, hash-verified

10237 * @param {!Object<string, string|number>=} attrs
10238 */
10239 constructor(doc, attrs = {}) {
10240 const mergedAttrs = Object.assign({}, friendlyIframeAttributes, attrs);
10241
10242 /** @private @const {!HTMLIFrameElement} */
10243 this.iframe_ = /** @type {!HTMLIFrameElement} */ (
10244 createElement(doc, 'iframe', mergedAttrs)
10245 );
10246
10247 // Ensure that the new iframe does not inherit any CSS styles.
10248 resetAllStyles(this.iframe_);
10249
10250 /** @private @const {!Promise} */
10251 this.ready_ = new Promise((resolve) => {
10252 this.iframe_.onload = resolve;
10253 });
10254 }
10255
10256 /**
10257 * When promise is resolved.

Callers

nothing calls this directly

Calls 3

resetAllStylesFunction · 0.85
assignMethod · 0.80
createElementFunction · 0.70

Tested by

no test coverage detected