test_declarative_shadowdom_failure_log.html (1131B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=1870055 5 --> 6 <head> 7 <title>Test for Logging of Declarative ShadowDOM attachment failure</title> 8 <script type="text/javascript" src="head.js"></script> 9 <script src="/tests/SimpleTest/SimpleTest.js"></script> 10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 11 </head> 12 <body> 13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1870055">Bug 1870055</a> 14 <script> 15 16 SimpleTest.waitForExplicitFinish(); 17 18 window.addEventListener("load", () => { 19 const declarativeString = `<template shadowrootmode="open"></template>`; 20 const wrapper = document.createElement('div'); 21 wrapper.attachShadow({mode: "open"}); 22 23 SimpleTest.monitorConsole(SimpleTest.finish, [{ errorMessage: "Failed to attach Declarative Shadow DOM." }]); 24 25 const observer = new MutationObserver(e => { 26 if (e[0].addedNodes) { 27 SimpleTest.endMonitorConsole(); 28 } 29 }); 30 observer.observe(document.body, { childList: true }); 31 32 wrapper.setHTMLUnsafe(declarativeString); 33 document.body.appendChild(wrapper); 34 }); 35 </script> 36 </body> 37 </html>