Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Side by Side Diff: LayoutTests/http/tests/security/script-crossorigin-fails-cross-origin-2.xhtml

Issue 47923008: Block execution of failed 'crossorigin' <script>s. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <?xml version="1.0"?>
2 <html xmlns='http://www.w3.org/1999/xhtml'>
3 <head>
4 <title>crossorigin and XHTML</title>
5 </head>
6 <body>
7 <p>In an XHTML document, test that a script element with a crossorigin attribute does not load a cross-origin script when the resource sharing check fails on th e response.</p>
8 <pre></pre>
9 <script>
10 if (window.testRunner) {
11 testRunner.dumpAsText();
12 testRunner.waitUntilDone();
13 }
14
15 var result = "PASS";
16
17 function must_not_fire() {
18 result = "FAIL";
19 }
20
21 function loaded() {
22 document.querySelector("pre").innerHTML = result;
23 if (window.testRunner)
24 testRunner.notifyDone();
25 }
26 </script>
27 <!-- This script should _not_ load, nor fire onload. -->
28 <script crossorigin="anonymous" src="http://localhost:8000/security/resources/co rs-script.php?cors=false&amp;value=FAIL" onload="must_not_fire()"></script>
29 <script><![CDATA[loaded();]]></script>
30 </body>
31 </html>
32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698