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

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/nomodule-set-on-inline-classic-scripts.html

Issue 2668783003: Import wpt@767dc2a4f049c761bd146d61de2ea860a895a624 (Closed)
Patch Set: Update test expectations and baselines. Created 3 years, 10 months 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 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>Inline classic scripts with nomodule content attribute must not run</titl e>
5 <link rel="author" title="Yusuke Suzuki" href="mailto:utatane.tea@gmail.com">
6 <link rel="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org">
7 <script src="/resources/testharness.js"></script>
8 <script src="/resources/testharnessreport.js"></script>
9 </head>
10 <body>
11 <script>
12 window.executed = true;
13 </script>
14 <script>
15
16 test(() => {
17 assert_true(executed);
18 }, 'An inline classic script without nomodule content attribute must run');
19
20
21 window.executed = false;
22 </script>
23 <script nomodule>
24 window.executed = true;
25 </script>
26 <script>
27
28 test(() => {
29 assert_false(executed);
30 }, 'An inline classic script with nomodule content attribute must not run');
31
32 </script>
33 <script>
34
35 test(() => {
36 window.executed = false;
37 const element = document.createElement("script");
38 element.noModule = false;
39 element.textContent = `window.executed = true`;
40 document.body.appendChild(element);
41 assert_true(window.executed);
42 }, 'An inline classic script element dynamically inserted after noModule was set to false must run.');
43
44 test(() => {
45 window.executed = false;
46 const element = document.createElement("script");
47 element.noModule = true;
48 element.textContent = `window.executed = true`;
49 document.body.appendChild(element);
50 assert_false(window.executed);
51 }, 'An inline classic script element dynamically inserted after noModule was set to true must not run.');
52
53 window.executed = false;
54 </script>
55 </body>
56 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698