| <!DOCTYPE html> |
| <html> |
| <body> |
| <script> |
| if (window.testRunner) |
| testRunner.dumpAsText(); |
| |
| var cases = [ |
| "http://example.com/foo/bar", |
| "HTTP://example.com/foo/bar", |
| "https://example.com/ttt?ggg", |
| "ftp://example.com/ttt?ggg", |
| "file:///home/abarth", |
| "data:text/html,<b>foo</b>" |
| ]; |
| |
| window.onload = function(e) |
| { |
| for (var i = 0; i < cases.length; ++i) { |
| var a = document.createElement('a'); |
| a.href = cases[i]; |
| a.textContent = 'Link'; |
| document.body.appendChild(a); |
| document.body.appendChild(document.createElement('br')); |
| } |
| |
| var s = ''; |
| var elmts = document.getElementsByTagName('a'); |
| for (var i = 0; i < elmts.length; ++i) |
| s += elmts[i].href + ' => ' + elmts[i].origin + '\n'; |
| |
| var pre = document.createElement('pre'); |
| pre.textContent = s; |
| document.body.appendChild(pre); |
| }; |
| |
| </script> |
| </body> |
| </html> |