Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE HTML>
<html>
<!--
-->
<head>
<title>Test for Logging of Declarative ShadowDOM attachment failure</title>
<script type="text/javascript" src="head.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<script>
SimpleTest.waitForExplicitFinish();
window.addEventListener("load", () => {
const declarativeString = `<template shadowrootmode="open"></template>`;
const wrapper = document.createElement('div');
wrapper.attachShadow({mode: "open"});
SimpleTest.monitorConsole(SimpleTest.finish, [{ errorMessage: "Failed to attach Declarative Shadow DOM." }]);
const observer = new MutationObserver(e => {
if (e[0].addedNodes) {
SimpleTest.endMonitorConsole();
}
});
observer.observe(document.body, { childList: true });
wrapper.setHTMLUnsafe(declarativeString);
document.body.appendChild(wrapper);
});
</script>
</body>
</html>