mirror of
https://github.com/servo/servo.git
synced 2025-08-31 10:08:21 +01:00
Scope chain is now constructed
This commit is contained in:
parent
2373769e76
commit
59f66fe09d
3 changed files with 95 additions and 11 deletions
|
@ -11453,6 +11453,12 @@
|
|||
{}
|
||||
]
|
||||
],
|
||||
"mozilla/compile-event-handler-lexical-scopes-simple.html": [
|
||||
[
|
||||
"mozilla/compile-event-handler-lexical-scopes-simple.html",
|
||||
{}
|
||||
]
|
||||
],
|
||||
"mozilla/createEvent-storageevent.html": [
|
||||
[
|
||||
"mozilla/createEvent-storageevent.html",
|
||||
|
@ -18589,6 +18595,10 @@
|
|||
"8e06ffcc0933719b4b79ea6656d6635cc121d900",
|
||||
"testharness"
|
||||
],
|
||||
"mozilla/compile-event-handler-lexical-scopes-simple.html": [
|
||||
"7d1e1839390ea16183bffd09eef4e3445d5d8e16",
|
||||
"testharness"
|
||||
],
|
||||
"mozilla/createEvent-storageevent.html": [
|
||||
"f5deb0173b1459a655ecd62d1c1fd1b45c42c35b",
|
||||
"testharness"
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>Lexical scopes when compiling an inline event handler (easy mode)</title>
|
||||
<link rel="help" href="https://html.spec.whatwg.org/C/#getting-the-current-value-of-the-event-handler">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
|
||||
<script>
|
||||
setup({allow_uncaught_exception: true});
|
||||
</script>
|
||||
|
||||
<!-- Testing just the core of
|
||||
html/webappapis/scripting/events/compile-event-handler-lexical-scopes.html
|
||||
to have a test for it that works while #25199 is open -->
|
||||
|
||||
<form method="POST">
|
||||
<input value="hello" onclick="
|
||||
window.testResults.value = value;
|
||||
window.testResults.self = this;
|
||||
window.testResults.method = method;
|
||||
window.testResults.contentType = contentType;
|
||||
window.testResults.input_var = input_var;
|
||||
window.testResults.form_var = form_var;
|
||||
window.testResults.doc_var = doc_var;
|
||||
">
|
||||
</form>
|
||||
|
||||
<script>
|
||||
"use strict";
|
||||
|
||||
test(() => {
|
||||
window.testResults = {};
|
||||
|
||||
document.querySelector("input").input_var = 1;
|
||||
document.querySelector("form").form_var = 2;
|
||||
document.doc_var = 3;
|
||||
|
||||
document.querySelector("input").click();
|
||||
|
||||
assert_equals(window.testResults.value, "hello");
|
||||
assert_in_array(window.testResults.method, ["POST","post"]);
|
||||
assert_equals(window.testResults.contentType, "text/html");
|
||||
assert_equals(window.testResults.self, document.querySelector("input"));
|
||||
assert_equals(window.testResults.input_var, 1);
|
||||
assert_equals(window.testResults.form_var, 2);
|
||||
assert_equals(window.testResults.doc_var, 3);
|
||||
}, "Element, form owner, and document all expose expandos and IDL properties");
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue