declarative-parser-interaction.html (1009B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>Declarative Shadow DOM</title> 4 <link rel="author" href="mailto:masonf@chromium.org"> 5 <link rel="help" href="https://github.com/whatwg/dom/issues/831"> 6 <link rel="help" href="https://crbug.com/1203645"> 7 <script src="/resources/testharness.js"></script> 8 <script src="/resources/testharnessreport.js"></script> 9 10 This test should not crash, and there should be two lines of text visible below. 11 <x-1> 12 <template shadowrootmode="open"> 13 <style> 14 @import 'non-existent.css'; 15 </style> 16 <slot></slot> 17 </template> 18 <p>Line 1</p> 19 </x-1> 20 21 <x-2> 22 <template shadowrootmode="open"> 23 <slot></slot> 24 </template> 25 <p>Line 2</p> 26 </x-2> 27 28 <script> 29 window.onload = function() { 30 const x1 = document.querySelector('x-1'); 31 const x2 = document.querySelector('x-2'); 32 test(() => { 33 assert_true(!!x1); 34 assert_true(!!x2); 35 }, 'Declarative Shadow DOM: Test for crashes and improper parsing'); 36 } 37 </script>