test-007.html (1503B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>Shadow DOM Test: A_10_01_02_06_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-root-methods"> 7 <meta name="assert" content="ShadowRoot Object: Element? elementFromPoint(float x, float y) method"> 8 <script src="/resources/testharness.js"></script> 9 <script src="/resources/testharnessreport.js"></script> 10 <script src="../../../../../html/resources/common.js"></script> 11 </head> 12 <body> 13 <div id="log"></div> 14 <script> 15 test(function () { 16 17 var d = newHTMLDocument(); 18 19 var el = d.createElement('div'); 20 d.body.appendChild(el); 21 22 var s = el.attachShadow({mode: 'open'}); 23 24 var span = d.createElement('span'); 25 span.innerHTML = 'Some text'; 26 s.appendChild(span); 27 28 assert_equals(s.elementFromPoint(-1, 1), null, 'If x argument of elementFromPoint(x, y) is less ' + 29 'than zero then method shold return null'); 30 31 }, 'A_10_01_02_06_02_T01'); 32 33 34 test(function () { 35 36 var d = newHTMLDocument(); 37 38 var el = d.createElement('div'); 39 d.body.appendChild(el); 40 41 var s = el.attachShadow({mode: 'open'}); 42 43 var span = d.createElement('span'); 44 span.innerHTML = 'Some text'; 45 s.appendChild(span); 46 47 assert_equals(s.elementFromPoint(1, -1), null, 'If y argument of elementFromPoint(x, y) is less ' + 48 'than zero then method shold return null'); 49 50 }, 'A_10_01_02_06_02_T02'); 51 </script> 52 </body> 53 </html>