OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- | 2 <!-- |
3 Distributed under both the W3C Test Suite License [1] and the W3C | 3 Distributed under both the W3C Test Suite License [1] and the W3C |
4 3-clause BSD License [2]. To contribute to a W3C Test Suite, see the | 4 3-clause BSD License [2]. To contribute to a W3C Test Suite, see the |
5 policies and contribution forms [3]. | 5 policies and contribution forms [3]. |
6 | 6 |
7 [1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license | 7 [1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license |
8 [2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license | 8 [2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license |
9 [3] http://www.w3.org/2004/10/27-testcases | 9 [3] http://www.w3.org/2004/10/27-testcases |
10 --> | 10 --> |
11 <html> | 11 <html> |
12 <head> | 12 <head> |
13 <title>Shadow DOM Test: A_10_01_02_06_01</title> | 13 <title>Shadow DOM Test: A_10_01_02_06_01</title> |
14 <link rel="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru"> | 14 <link rel="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru"> |
15 <link rel="help" href="http://www.w3.org/TR/2013/WD-shadow-dom-20130514/#shadow-
root-methods"> | 15 <link rel="help" href="http://www.w3.org/TR/2013/WD-shadow-dom-20130514/#shadow-
root-methods"> |
16 <meta name="assert" content="ShadowRoot Object: Element? elementFromPoint(float
x, float y) method"> | 16 <meta name="assert" content="ShadowRoot Object: Element? elementFromPoint(float
x, float y) method"> |
17 <script src="../../../../../../resources/testharness.js"></script> | 17 <script src="../../../../../../resources/testharness.js"></script> |
18 <script src="../../../../../../resources/testharnessreport.js"></script> | 18 <script src="../../../../../../resources/testharnessreport.js"></script> |
19 <script src="../../../testcommon.js"></script> | 19 <script src="../../../testcommon.js"></script> |
20 <link rel="stylesheet" href="../../../../../../resources/testharness.css"> | 20 <link rel="stylesheet" href="../../../../../../resources/testharness.css"> |
21 </head> | 21 </head> |
22 <body> | 22 <body> |
23 <div id="log"></div> | 23 <div id="log"></div> |
24 <script> | 24 <script> |
25 test(function () { | 25 test(function () { |
26 | 26 |
27 » var d = newHTMLDocument(); | 27 var d = newHTMLDocument(); |
28 | 28 |
29 var el = d.createElement('div'); | 29 var el = d.createElement('div'); |
30 d.body.appendChild(el); | 30 d.body.appendChild(el); |
31 | 31 |
32 try { | 32 try { |
33 el.elementFromPoint(1, 1); | 33 el.elementFromPoint(1, 1); |
34 assert_true(false, 'TypeMismatchError should be thrown'); | 34 assert_true(false, 'TypeMismatchError should be thrown'); |
35 } catch(e) { | 35 } catch(e) { |
36 assert_true(e instanceof TypeError, 'Wrong error type'); | 36 assert_true(e instanceof TypeError, 'Wrong error type'); |
37 } | 37 } |
38 | 38 |
39 }, 'A_10_01_02_06_01_T01'); | 39 }, 'A_10_01_02_06_01_T01'); |
| 40 |
| 41 // Added test for checking if elementFromPoint() method is existing on Shadowroo
t. |
| 42 test(function () { |
| 43 |
| 44 var d = newHTMLDocument(); |
| 45 |
| 46 var el = d.createElement('div'); |
| 47 |
| 48 var s = el.createShadowRoot(); |
| 49 d.body.appendChild(el); |
| 50 |
| 51 if (typeof(s) == 'undefined' || typeof (s.elementFromPoint(1, 1)) != 'object
') { |
| 52 assert_true(false, 'Shadowroot doesn\'t have elementFromPoint() method.'
); |
| 53 } |
| 54 |
| 55 }, 'A_10_01_02_06_01_T02'); |
40 </script> | 56 </script> |
41 </body> | 57 </body> |
42 </html> | 58 </html> |
OLD | NEW |