| OLD | NEW | 
|   1 <script> |   1 <script> | 
|   2     if (window.testRunner) { |   2     if (window.testRunner) { | 
|   3         testRunner.dumpAsText(); |   3         testRunner.dumpAsText(); | 
|   4         testRunner.dumpChildFramesAsText(); |   4         testRunner.dumpChildFramesAsText(); | 
|   5         testRunner.waitUntilDone(); |   5         testRunner.waitUntilDone(); | 
|   6     } |   6     } | 
|   7  |   7  | 
|   8     addEventListener("message", function() { |   8     addEventListener("message", function() { | 
|   9         // Call injected function. |   9         // Call injected function. | 
|  10         try { |  10         try { | 
|  11             attack(); |  11             attack(); | 
|  12         } catch (e) { |  12         } catch (e) { | 
|  13             // V8 throws a TypeError: Cannot set property 'fail' of undefined. |  13             // V8 throws a TypeError: Cannot set property 'fail' of undefined. | 
|  14         } |  14         } | 
|  15  |  15  | 
|  16         // Post message to victim to check if it was accessed. |  16         // Post message to victim to check if it was accessed. | 
|  17         window.frames['theFrame'].postMessage("test", "*"); |  17         document.getElementById('theFrame').contentWindow.postMessage("test", "*
    "); | 
|  18     }, false); |  18     }, false); | 
|  19 </script> |  19 </script> | 
|  20 <body> |  20 <body> | 
|  21     <p>Test cross-origin direct document access.</p> |  21     <p>Test cross-origin direct document access.</p> | 
|  22     <iframe name="theFrame" src="resources/cross-frame-iframe-for-document-direc
    t-test.html"></iframe> |  22     <iframe id="theFrame" src="resources/cross-frame-iframe-for-document-direct-
    test.html"></iframe> | 
|  23 </body> |  23 </body> | 
|  24 </html> |  24 </html> | 
| OLD | NEW |