| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script> | 3 <script> |
| 4 window.onload = function() | 4 window.onload = function() |
| 5 { | 5 { |
| 6 if (window.testRunner) { | 6 if (window.testRunner) { |
| 7 testRunner.dumpAsText(); | 7 testRunner.dumpAsText(); |
| 8 } | 8 } |
| 9 | 9 |
| 10 function alertMsg(msg) { | 10 function alertMsg(msg) { |
| 11 return "javascript:alert(\"FAIL: " + msg + | 11 return "javascript:alert(\"FAIL: " + msg + |
| 12 "\");document.body.innerHTML=\"<p style='font-weight:bold;color:red'
>Failure testing " + msg + "</p>\";//"; | 12 "\");document.body.innerHTML=\"<p style='font-weight:bold;color:red'
>Failure testing " + msg + "</p>\";//"; |
| 13 } | 13 } |
| 14 // Test different ways of setting iframe.src | 14 // Test different ways of setting iframe.src |
| 15 var aliasTests = [ | 15 var aliasTests = [ |
| 16 // Attr/Node attributes | 16 // Attr/Node attributes |
| 17 function(iFrame) { iFrame.attributes['src'].value = alertMsg("value"); i
Frame.src = iFrame.src;}, | 17 function(iFrame) { iFrame.attributes['src'].value = alertMsg("value"); i
Frame.src = iFrame.src;}, |
| 18 | 18 |
| 19 // Text Node Manipulation | 19 // Text Node Manipulation |
| 20 function(iFrame) { iFrame.attributes['src'].firstChild.replaceWholeText(
alertMsg("nodeValue"));}, | |
| 21 function(iFrame) { iFrame.attributes['src'].firstChild.data = alertMsg("
nodeValue");}, | 20 function(iFrame) { iFrame.attributes['src'].firstChild.data = alertMsg("
nodeValue");}, |
| 22 | 21 |
| 23 // Node attribute manipulation functions | 22 // Node attribute manipulation functions |
| 24 function(iFrame) { iFrame.setAttribute("src", alertMsg("setAttribute"));
}, | 23 function(iFrame) { iFrame.setAttribute("src", alertMsg("setAttribute"));
}, |
| 25 function(iFrame) { iFrame.setAttributeNS(null, "src", alertMsg("setAttri
buteNS"));}, | 24 function(iFrame) { iFrame.setAttributeNS(null, "src", alertMsg("setAttri
buteNS"));}, |
| 26 function(iFrame) { | 25 function(iFrame) { |
| 27 var a = document.createAttribute('src'); | 26 var a = document.createAttribute('src'); |
| 28 a.value = alertMsg("setAttributeNode"); | 27 a.value = alertMsg("setAttributeNode"); |
| 29 iFrame.setAttributeNode(a); | 28 iFrame.setAttributeNode(a); |
| 30 }, | 29 }, |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 } | 89 } |
| 91 | 90 |
| 92 </script> | 91 </script> |
| 93 </head> | 92 </head> |
| 94 <body> | 93 <body> |
| 95 <p>This script tests if iframe.src can be set to a JavaScript URL via alternate | 94 <p>This script tests if iframe.src can be set to a JavaScript URL via alternate |
| 96 DOM interfaces (such as Node.textContent or NamedNode.setNamedItem). | 95 DOM interfaces (such as Node.textContent or NamedNode.setNamedItem). |
| 97 The test is successful if no alerts appear and the page finishes loading.</p> | 96 The test is successful if no alerts appear and the page finishes loading.</p> |
| 98 </body> | 97 </body> |
| 99 </html> | 98 </html> |
| OLD | NEW |