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_06_00_10</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/#styles"
> |
| 16 <meta name="assert" content="Styles:the styles of the insertion point nodes are
inherited by those child nodes of the shadow host that are assigned to this inse
rtion point"> |
| 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 var d = newRenderedHTMLDocument(ctx); |
| 27 |
| 28 d.body.innerHTML = |
| 29 '<ul class="cls" style="font-size: 10px">' + |
| 30 '<li id="li1" class="shadow">1</li>' + |
| 31 '<li id="li2" class="shadow2">2</li>' + |
| 32 '<li id="li3" class="shadow">3</li>' + |
| 33 '<li id="li4">4</li>' + |
| 34 '<li id="li5" class="shadow">5</li>' + |
| 35 '<li id="li6" class="shadow2">6</li>' + |
| 36 '</ul>'; |
| 37 |
| 38 |
| 39 var height1 = d.querySelector('#li1').offsetHeight; |
| 40 var height2 = d.querySelector('#li2').offsetHeight; |
| 41 var height3 = d.querySelector('#li3').offsetHeight; |
| 42 var height4 = d.querySelector('#li4').offsetHeight; |
| 43 var height5 = d.querySelector('#li5').offsetHeight; |
| 44 var height6 = d.querySelector('#li6').offsetHeight; |
| 45 |
| 46 assert_true(height1 > 0, 'Point 1: Element height should be greater than
zero'); |
| 47 assert_true(height2 > 0, 'Point 2: Element height should be greater than
zero'); |
| 48 assert_true(height3 > 0, 'Point 3: Element height should be greater than
zero'); |
| 49 assert_true(height4 > 0, 'Point 4: Element height should be greater than
zero'); |
| 50 assert_true(height5 > 0, 'Point 5: Element height should be greater than
zero'); |
| 51 assert_true(height6 > 0, 'Point 6: Element height should be greater than
zero'); |
| 52 |
| 53 var host = d.querySelector('.cls'); |
| 54 //Shadow root to play with |
| 55 var s = host.createShadowRoot(); |
| 56 |
| 57 var div = d.createElement('div'); |
| 58 div.innerHTML ='<ul><content select=".shadow" style="font-size:20px"></c
ontent></ul>'; |
| 59 s.appendChild(div); |
| 60 |
| 61 |
| 62 host.setAttribute('style', 'font-size: 20px'); |
| 63 |
| 64 assert_true(d.querySelector('#li1').offsetHeight > height1, |
| 65 'Point 11: Insertion point style must be aplied to the node dist
ributed into this point'); |
| 66 assert_true(d.querySelector('#li3').offsetHeight > height3, |
| 67 'Point 12: Insertion point style must be aplied to the node dist
ributed into this point'); |
| 68 assert_true(d.querySelector('#li5').offsetHeight > height5, |
| 69 'Point 13: Insertion point style must be aplied to the node dist
ributed into this point'); |
| 70 |
| 71 }), 'A_06_00_10_T01'); |
| 72 </script> |
| 73 </body> |
| 74 </html> |
OLD | NEW |