OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src='../resources/testharness.js'></script> |
| 3 <script src='../resources/testharnessreport.js'></script> |
| 4 <script src='resources/shadow-dom.js'></script> |
| 5 <div id='host' class='container'> |
| 6 <template data-mode='open' data-expose-as='root'> |
| 7 <div id='container' style='position: relative'> |
| 8 <slot name='x'></slot> |
| 9 </div> |
| 10 </template> |
| 11 <span id='target' slot='x'>X</span> |
| 12 </div> |
| 13 |
| 14 <script> |
| 15 test(() => { |
| 16 // Update layout and make layout clean. |
| 17 document.body.offsetTop; |
| 18 // Change slotting to make layout dirty. |
| 19 convertTemplatesToShadowRootsWithin(host); |
| 20 var slot = root.querySelector('slot'); |
| 21 assert_equals(slot.assignedNodes()[0].id, 'target', 'make sure the element is
assigned to slot'); |
| 22 assert_equals(target.offsetParent.id, 'container', 'offsetParent should return
layout tree parent.'); |
| 23 }, 'slotting change should cause layout recalculation.'); |
| 24 </script> |
OLD | NEW |