| OLD | NEW |
| (Empty) |
| 1 <script> | |
| 2 if (window.testRunner) | |
| 3 testRunner.dumpAsText(); | |
| 4 | |
| 5 // The 'this' value provided to this method, and provided by this method to 'bar
', should | |
| 6 // both be the containing window object. | |
| 7 function foo(childThis) { | |
| 8 bar(childThis, this); | |
| 9 } | |
| 10 | |
| 11 function bar(childThis, parentThis) { | |
| 12 var result = "PASS"; | |
| 13 | |
| 14 if (childThis != frames[0]) | |
| 15 result = "FAIL"; | |
| 16 if (parentThis != window) | |
| 17 result = "FAIL"; | |
| 18 if (this != window) | |
| 19 result = "FAIL"; | |
| 20 | |
| 21 dump(result); | |
| 22 } | |
| 23 | |
| 24 function dump(str) | |
| 25 { | |
| 26 document.getElementById("output").innerText = str; | |
| 27 } | |
| 28 | |
| 29 | |
| 30 </script> | |
| 31 | |
| 32 <div>This test checks whether cross-site calling uses the proper | |
| 33 object as the global "this" value. The text below should say | |
| 34 PASS:</div> | |
| 35 | |
| 36 <div id="output"> </div> | |
| 37 | |
| 38 <iframe src="resources/cross-site-this-helper.html"></iframe> | |
| OLD | NEW |