test-011.html (1409B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>Shadow DOM Test: A_04_01_11</title> 5 <link rel="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru"> 6 <link rel="help" href="http://www.w3.org/TR/2013/WD-shadow-dom-20130514/#upper-boundary-encapsulation"> 7 <meta name="assert" content="Upper-boundary encapsulation:The style sheets, represented by the shadow nodes are not accessible using shadow host document's CSSOM extensions"> 8 <script src="/resources/testharness.js"></script> 9 <script src="/resources/testharnessreport.js"></script> 10 <script src="../../../../html/resources/common.js"></script> 11 <script src="../../../resources/shadow-dom-utils.js"></script> 12 </head> 13 <body> 14 <div id="log"></div> 15 <script> 16 // check that <link> element added to head is not exposed 17 test(unit(function (ctx) { 18 19 var d = newRenderedHTMLDocument(ctx); 20 var initialStyleSheetsCount = d.styleSheets.length; 21 22 var link = d.createElement('link'); 23 link.setAttribute('rel', 'stylesheet'); 24 d.body.appendChild(link); 25 26 //create Shadow root 27 var root = d.createElement('div'); 28 d.body.appendChild(root); 29 var s = root.attachShadow({mode: 'open'}); 30 31 s.appendChild(link); 32 33 assert_equals(d.styleSheets.length, initialStyleSheetsCount, 'stylesheet link elements in shadow DOM must not be ' + 34 'exposed via the document.styleSheets collection'); 35 36 37 }), 'A_04_01_11_T2'); 38 </script> 39 </body> 40 </html>