| OLD | NEW |
| (Empty) |
| 1 <style> | |
| 2 area { | |
| 3 display: inline; | |
| 4 } | |
| 5 </style> | |
| 6 <p>When an anchor tag catch 'href' attribute or release 'href' attribute, distri
bution should happen.</p> | |
| 7 <div id="host1"></div> | |
| 8 <div id="host2"></div> | |
| 9 <script> | |
| 10 if (window.testRunner) | |
| 11 testRunner.waitUntilDone(); | |
| 12 | |
| 13 function createArea(href, textContent) | |
| 14 { | |
| 15 var area = document.createElement('area'); | |
| 16 if (href) | |
| 17 area.setAttribute('href', href); | |
| 18 area.appendChild(document.createTextNode(textContent)); | |
| 19 | |
| 20 return area; | |
| 21 } | |
| 22 | |
| 23 var area1 = createArea('http://www.example.com/', 'Anchor 1'); | |
| 24 var area2 = createArea('http://www.example.com/', 'Anchor 2'); | |
| 25 var area3 = createArea(null, 'Anchor 3'); | |
| 26 var area4 = createArea(null, 'Anchor 4'); | |
| 27 | |
| 28 host1.appendChild(area1); | |
| 29 host1.appendChild(area2); | |
| 30 host2.appendChild(area3); | |
| 31 host2.appendChild(area4); | |
| 32 | |
| 33 host1.createShadowRoot().innerHTML = '<content select="area:enabled"></content>'
; | |
| 34 host2.createShadowRoot().innerHTML = '<content select="area:enabled"></content>'
; | |
| 35 | |
| 36 setTimeout(function() { | |
| 37 area2.removeAttribute('href'); | |
| 38 area4.setAttribute('href', 'http://www.example.com/'); | |
| 39 if (testRunner) | |
| 40 testRunner.notifyDone(); | |
| 41 }, 0); | |
| 42 </script> | |
| OLD | NEW |