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