| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 | 2 |
| 3 <p>Test that stale distribution data stored in the ElementShadow is not used.</p
> | 3 <p>Test that stale distribution data stored in the ElementShadow is not used.</p
> |
| 4 <p>Passes if it does not crash or assert</p> | 4 <p>Passes if it does not crash or assert</p> |
| 5 | 5 |
| 6 <div id="host"></div> | 6 <div id="host"></div> |
| 7 | 7 |
| 8 <script> | 8 <script> |
| 9 if (window.testRunner) | 9 if (window.testRunner) |
| 10 testRunner.dumpAsText(); | 10 testRunner.dumpAsText(); |
| 11 | 11 |
| 12 var host = document.getElementById('host'); | 12 var host = document.getElementById('host'); |
| 13 var oldestShadowRoot = host.createShadowRoot(); | 13 var oldestShadowRoot = host.webkitCreateShadowRoot(); |
| 14 var youngestShadowRoot = host.createShadowRoot(); | 14 var youngestShadowRoot = host.webkitCreateShadowRoot(); |
| 15 | 15 |
| 16 oldestShadowRoot.innerHTML = ''; | 16 oldestShadowRoot.innerHTML = ''; |
| 17 youngestShadowRoot.innerHTML = '<shadow></shadow>'; | 17 youngestShadowRoot.innerHTML = '<shadow></shadow>'; |
| 18 | 18 |
| 19 // Cause a distribution to populate the ElementShadow. | 19 // Cause a distribution to populate the ElementShadow. |
| 20 host.offsetLeft; | 20 host.offsetLeft; |
| 21 | 21 |
| 22 // Create a stale pointer to the HTMLShadowElement. | 22 // Create a stale pointer to the HTMLShadowElement. |
| 23 youngestShadowRoot.innerHTML = ''; | 23 youngestShadowRoot.innerHTML = ''; |
| 24 | 24 |
| 25 // Trigger a sync attach() from innerHTML. The sync attach skips the | 25 // Trigger a sync attach() from innerHTML. The sync attach skips the |
| 26 // recalcDistribution call and would access stale data. | 26 // recalcDistribution call and would access stale data. |
| 27 oldestShadowRoot.innerHTML = '<span></span>'; | 27 oldestShadowRoot.innerHTML = '<span></span>'; |
| 28 </script> | 28 </script> |
| OLD | NEW |