Index: third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/script-for-event.html |
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/script-for-event.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/script-for-event.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e3b8e15b414451f22b643f3f07730b265781c2e2 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/script-for-event.html |
@@ -0,0 +1,93 @@ |
+<!DOCTYPE html> |
+<title>Module scripts with for and event attributes</title> |
+<link rel="author" title="Matheus Kerschbaum" href="mailto:matjk7@gmail.com"> |
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"> |
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#prepare-a-script"> |
+<script src="/resources/testharness.js"></script> |
+<script src="/resources/testharnessreport.js"></script> |
+<div id="log"></div> |
+<script> |
+var expected = [ |
+ true, |
+ true, |
+ true, |
+ true, |
+ true, |
+ true, |
+ true, |
+ true, |
+ true, |
+ true, |
+ true, |
+ true, |
+ true, |
+ true, |
+ true, |
+ true, |
+ true, |
+]; |
+var run = expected.map(function() { return false }); |
+</script> |
+<script for="wİndow" event="onload" type="module"> |
kouhei (in TOK)
2017/05/12 21:53:17
Optional: can we have run-expectation as a custom
hiroshige
2017/05/13 00:04:04
Sounds nice, but how can we replace |run| with a c
kouhei (in TOK)
2017/05/13 00:08:40
I don't think we can replace |run|. only |expected
hiroshige
2017/05/13 00:14:14
Hmm. I'd like to defer refactoring (if any, and it
|
+run[0] = true; |
+</script> |
+<script for="window" event="onload x" type="module"> |
+run[1] = true; |
+</script> |
+<script for="window" event="onload(x" type="module"> |
+run[2] = true; |
+</script> |
+<script for="window" event="onload(x)" type="module"> |
+run[3] = true; |
+</script> |
+<script for="window" event="onclick" type="module"> |
+run[4] = true; |
+</script> |
+<script for="" event="onload" type="module"> |
+run[5] = true; |
+</script> |
+<script for="window" event="" type="module"> |
+run[6] = true; |
+</script> |
+<script for="" event="" type="module"> |
+run[7] = true; |
+</script> |
+<script for=" window" event="onload" type="module"> |
+run[8] = true; |
+</script> |
+<script for="window " event="onload" type="module"> |
+run[9] = true; |
+</script> |
+<script for="window" event=" onload" type="module"> |
+run[10] = true; |
+</script> |
+<script for="window" event="onload " type="module"> |
+run[11] = true; |
+</script> |
+<script for=" window " event=" onload " type="module"> |
+run[12] = true; |
+</script> |
+<script for=" window " event=" onload() " type="module"> |
+run[13] = true; |
+</script> |
+<script for="object" event="handler" type="module"> |
+run[14] = true; |
+</script> |
+<script event="handler" type="module"> |
+run[15] = true; |
+</script> |
+<script for="object" type="module"> |
+run[16] = true; |
+</script> |
+<script type="module"> |
+test(function() { |
+ for (var i = 0; i < run.length; ++i) { |
+ test(function() { |
+ var script = document.querySelectorAll("script[for], script[event]")[i]; |
+ assert_equals(run[i], expected[i], |
kouhei (in TOK)
2017/05/12 21:53:17
so we can query it here script.getAttribute() to g
|
+ "script for=" + format_value(script.getAttribute("for")) + |
+ " event=" + format_value(script.getAttribute("event"))); |
+ }, "Script " + i); |
+ } |
+}); |
+</script> |