test-011.html (1556B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>Shadow DOM Test: A_10_01_01_05_01</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/#shadow-root-attributes"> 7 <meta name="assert" content="ShadowRoot Object: styleSheets of type StyleSheetList, readonly"> 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 test(unit(function (ctx) { 17 18 var d = newRenderedHTMLDocument(ctx); 19 20 var host = d.createElement('div'); 21 d.body.appendChild(host); 22 var s = host.attachShadow({mode: 'open'}); 23 24 assert_true(s.styleSheets != null, 'ShadowRoot styleSheets attribute shouldn\'t be null'); 25 assert_equals(s.styleSheets.length, 0, 'attribute must return the shadow root style sheets only'); 26 27 }), 'A_10_01_01_05_01_T01'); 28 29 30 test(unit(function (ctx) { 31 32 var d = newRenderedHTMLDocument(ctx); 33 34 var host = d.createElement('div'); 35 d.body.appendChild(host); 36 var s = host.attachShadow({mode: 'open'}); 37 38 var style = d.createElement('style'); 39 s.appendChild(style); 40 41 assert_true(s.styleSheets != null, 'ShadowRoot styleSheets attribute shouldn\'t be null'); 42 assert_equals(s.styleSheets.length, 1, 'attribute must return the shadow root style sheets'); 43 44 }), 'A_10_01_01_05_01_T02'); 45 </script> 46 </body> 47 </html>