 = element.attachShadow(initDict);
      }
    }
    assert_true(!allowsShadowDom || !!shadowRoot);

    if (allowsShadowDom) {
      const correctShadowHtml = `<template shadowrootmode="${mode}"` +
          `${delegatesAttr}${serializableAttr}${clonableAttr}>` +
          (emptyShadowTree ? `` : `<slot></slot>`) + `</template>`;
      const correctHtml = `<${elementType}>${correctShadowHtml}` +
          `${lightDOMContent}</${elementType}>`;
      assert_equals(shadowRoot.mode,mode);
      assert_equals(