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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/resetting-a-form/reset-form-event-realm.html

Issue 2668783003: Import wpt@767dc2a4f049c761bd146d61de2ea860a895a624 (Closed)
Patch Set: Update test expectations and baselines. Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/resetting-a-form/reset-form-event-realm.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/resetting-a-form/reset-form-event-realm.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/resetting-a-form/reset-form-event-realm.html
new file mode 100644
index 0000000000000000000000000000000000000000..ad2cda3ebbc8ec274e352f298ed000e28442a25b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/resetting-a-form/reset-form-event-realm.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>reset() event firing realm</title>
+<link rel="help" href="https://html.spec.whatwg.org/#resetting-a-form">
+<link rel="help" href="https://dom.spec.whatwg.org/#concept-event-fire">
+<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<iframe src="reset-form-event-realm-support.html"></iframe>
+<iframe></iframe>
+
+<script>
+"use strict";
+
+async_test(t => {
+ window.onload = t.step_func_done(() => {
+ const frame0Form = frames[0].document.forms[0];
+ const frame1Body = frames[1].document.body;
+
+ frame1Body.appendChild(frame0Form);
+
+ let resetCalled = false;
+ frame0Form.onreset = t.step_func(ev => {
+ resetCalled = true;
+
+ const functionConstructorInEvRealm = ev.constructor.constructor;
+ const functionConstructorInFormRealm = frame0Form.constructor.constructor;
+
+ assert_equals(functionConstructorInEvRealm, functionConstructorInFormRealm,
+ "the event must be created in the realm of the target");
+ });
+
+ frame0Form.reset();
+ assert_true(resetCalled, "The reset event handler must have been called");
+ });
+}, "reset()'s event must be fired in the Realm of the target")
+</script>

Powered by Google App Engine
This is Rietveld 408576698