test-002.html (1180B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>Shadow DOM Test: A_10_02_02_02</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-aware-methods"> 7 <meta name="assert" content="Extensions to Element Interface: attachShadow method"> 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 23 var span = d.createElement('span'); 24 span.innerHTML = 'Some text'; 25 host.appendChild(span); 26 27 var s = host.attachShadow({mode: 'open'}); 28 29 // span should become invisible as shadow root content 30 assert_equals(span.offsetTop, 0, 'attachShadow() method should establish ' + 31 'the context object as the shadow host of the ShadowRoot object'); 32 33 }), 'A_10_02_02_02_T01'); 34 </script> 35 </body> 36 </html>