Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / Source / web / tests / data / prerender / multiple_prerenders.html
blobfaa708440401e0b3cf3ba3f58e965ec78557b304
1 <html>
2 <head>
3 <script>
4 function log(message)
6 var item = document.createElement("li");
7 item.appendChild(document.createTextNode(message));
8 document.getElementById("console").appendChild(item);
11 </script>
13 </head>
14 <body>
15 <ul id=console>
16 </ul>
18 <link id="firstPrerender" rel=prerender href="http://first-prerender.com/"/>
19 <link id="secondPrerender" rel=prerender href="http://second-prerender.com/"/>
21 <p id="emptyParagraph"></p>
23 <script>
24 var firstPrerender = document.getElementById('firstPrerender');
25 var secondPrerender = document.getElementById('secondPrerender');
27 function removeFirstPrerender()
29 var link = document.getElementById('firstPrerender');
30 link.parentElement.removeChild(link);
33 function removeSecondPrerender()
35 var link = document.getElementById('firstPrerender');
36 link.parentElement.removeChild(link);
39 function removeThirdPrerender()
41 var link = document.getElementById('thirdPrerender');
42 link.parentElement.removeChild(link);
45 firstPrerender.addEventListener('webkitprerenderstart', function() { log("first_webkitprerenderstart"); }, false);
46 firstPrerender.addEventListener('webkitprerenderstop', function() { log("first_webkitprerenderstop"); }, false);
47 firstPrerender.addEventListener('webkitprerenderload', function() { log("first_webkitprerenderload"); }, false);
48 firstPrerender.addEventListener('webkitprerenderdomcontentloaded', function() { log("first_webkitprerenderdomcontentloaded"); }, false);
50 secondPrerender.addEventListener('webkitprerenderstart', function() { log("second_webkitprerenderstart"); }, false);
51 secondPrerender.addEventListener('webkitprerenderstop', function() { log("second_webkitprerenderstop"); }, false);
52 secondPrerender.addEventListener('webkitprerenderload', function() { log("second_webkitprerenderload"); }, false);
53 secondPrerender.addEventListener('webkitprerenderdomcontentloaded', function() { log("second_webkitprerenderdomcontentloaded"); }, false);
55 function addThirdPrerender()
57 var emptyParagraph = document.getElementById("emptyParagraph");
58 emptyParagraph.innerHTML = '<link id="thirdPrerender" rel=prerender href="http://third-prererender.com/"/>';
59 var thirdPrerender = document.getElementById('thirdPrerender');
61 thirdPrerender.addEventListener('webkitprerenderstart', function() { log("third_webkitprerenderstart"); }, false);
62 thirdPrerender.addEventListener('webkitprerenderstop', function() { log("third_webkitprerenderstop"); }, false);
63 thirdPrerender.addEventListener('webkitprerenderload', function() { log("third_webkitprerenderload"); }, false);
64 thirdPrerender.addEventListener('webkitprerenderdomcontentloaded', function() { log("third_webkitprerenderdomcontentloaded"); }, false);
66 </script>
67 </body>
68 </html>