OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <!-- |
| 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 |
| 5 policies and contribution forms [3]. |
| 6 |
| 7 [1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license |
| 8 [2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license |
| 9 [3] http://www.w3.org/2004/10/27-testcases |
| 10 --> |
| 11 <html> |
| 12 <head> |
| 13 <title>Shadow DOM Test: A_10_04_01</title> |
| 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/#content
-element"> |
| 16 <meta name="assert" content="The content HTML element: fallback content"> |
| 17 <script src="../../../../../resources/testharness.js"></script> |
| 18 <script src="../../../../../resources/testharnessreport.js"></script> |
| 19 <script src="../../testcommon.js"></script> |
| 20 <link rel="stylesheet" href="../../../../../resources/testharness.css"> |
| 21 </head> |
| 22 <body> |
| 23 <div id="log"></div> |
| 24 <script> |
| 25 test(unit(function (ctx) { |
| 26 |
| 27 var d = newRenderedHTMLDocument(ctx); |
| 28 |
| 29 d.body.innerHTML = |
| 30 '<ul class="cls">' + |
| 31 '<li id="li1" class="shadow">1</li>' + |
| 32 '<li id="li2" class="shadow2">2</li>' + |
| 33 '<li id="li3" class="shadow">3</li>' + |
| 34 '<li id="li4">4</li>' + |
| 35 '<li id="li5" class="shadow">5</li>' + |
| 36 '<li id="li6" class="shadow2">6</li>' + |
| 37 '</ul>'; |
| 38 |
| 39 var host = d.querySelector('.cls'); |
| 40 //Shadow root to play with |
| 41 var s = host.createShadowRoot(); |
| 42 |
| 43 var div = d.createElement('div'); |
| 44 div.innerHTML = '' + |
| 45 '<ul><content select=".clazz"><span id="spandex">This is fallback conten
t</span></content></ul>'; |
| 46 s.appendChild(div); |
| 47 |
| 48 assert_true(s.querySelector('#spandex').offsetTop > 0, 'Fallback content sho
uld be rendered'); |
| 49 |
| 50 }), 'A_10_04_01_T01'); |
| 51 |
| 52 |
| 53 |
| 54 test(unit(function (ctx) { |
| 55 |
| 56 var d = newRenderedHTMLDocument(ctx); |
| 57 |
| 58 d.body.innerHTML = |
| 59 '<ul class="cls">' + |
| 60 '<li id="li1" class="shadow">1</li>' + |
| 61 '<li id="li2" class="shadow2">2</li>' + |
| 62 '<li id="li3" class="shadow">3</li>' + |
| 63 '<li id="li4">4</li>' + |
| 64 '<li id="li5" class="shadow">5</li>' + |
| 65 '<li id="li6" class="shadow2">6</li>' + |
| 66 '</ul>'; |
| 67 |
| 68 var host = d.querySelector('.cls'); |
| 69 //Shadow root to play with |
| 70 var s = host.createShadowRoot(); |
| 71 |
| 72 var div = d.createElement('div'); |
| 73 div.innerHTML = '' + |
| 74 '<ul><content select=".shadow"><span id="spandex">This is fallback conte
nt</span></content></ul>'; |
| 75 s.appendChild(div); |
| 76 |
| 77 assert_equals(s.querySelector('#spandex').offsetTop, 0, 'Fallback content sh
ould not be rendered'); |
| 78 |
| 79 }), 'A_10_04_01_T02'); |
| 80 </script> |
| 81 </body> |
| 82 </html> |
OLD | NEW |