MCPcopy Index your code
hub / github.com/ampproject/amphtml / calcShadowDomStreamingSupported

Function calcShadowDomStreamingSupported

src/shadow-embed.js:319–334  ·  view source on GitHub ↗

* @param {!Window} win * @return {boolean}

(win)

Source from the content-addressed store, hash-verified

317 * @return {boolean}
318 */
319function calcShadowDomStreamingSupported(win) {
320 // API must be supported.
321 if (
322 !win.document.implementation ||
323 typeof win.document.implementation.createHTMLDocument != 'function'
324 ) {
325 return false;
326 }
327 // Firefox does not support DOM streaming.
328 // See: https://bugzilla.mozilla.org/show_bug.cgi?id=867102
329 if (Services.platformFor(win).isFirefox()) {
330 return false;
331 }
332 // Assume full streaming support.
333 return true;
334}
335
336/**
337 * Creates the Shadow DOM writer available on this platform.

Callers 1

Calls 1

isFirefoxMethod · 0.80

Tested by

no test coverage detected