diff --git a/test/fixtures/wpt/README.md b/test/fixtures/wpt/README.md
index 51f8e94232e6b0..f198a63893bc02 100644
--- a/test/fixtures/wpt/README.md
+++ b/test/fixtures/wpt/README.md
@@ -13,7 +13,7 @@ Last update:
- common: https://github.com/web-platform-tests/wpt/tree/03c5072aff/common
- console: https://github.com/web-platform-tests/wpt/tree/767ae35464/console
- dom/abort: https://github.com/web-platform-tests/wpt/tree/8fadb38120/dom/abort
-- dom/events: https://github.com/web-platform-tests/wpt/tree/f8821adb28/dom/events
+- dom/events: https://github.com/web-platform-tests/wpt/tree/ab8999891c/dom/events
- encoding: https://github.com/web-platform-tests/wpt/tree/779d175c40/encoding
- fetch/data-urls/resources: https://github.com/web-platform-tests/wpt/tree/7c79d998ff/fetch/data-urls/resources
- FileAPI: https://github.com/web-platform-tests/wpt/tree/3b279420d4/FileAPI
diff --git a/test/fixtures/wpt/dom/events/Body-FrameSet-Event-Handlers.html b/test/fixtures/wpt/dom/events/Body-FrameSet-Event-Handlers.html
new file mode 100644
index 00000000000000..3a891158d5f863
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/Body-FrameSet-Event-Handlers.html
@@ -0,0 +1,123 @@
+
+
+
HTMLBodyElement and HTMLFrameSetElement Event Handler Tests
+
+
+
+
+
diff --git a/test/fixtures/wpt/dom/events/Event-constructors.any.js b/test/fixtures/wpt/dom/events/Event-constructors.any.js
index aced2f3c2cda61..faa623ea92991b 100644
--- a/test/fixtures/wpt/dom/events/Event-constructors.any.js
+++ b/test/fixtures/wpt/dom/events/Event-constructors.any.js
@@ -1,5 +1,11 @@
// META: title=Event constructors
+test(function() {
+ assert_throws_js(
+ TypeError,
+ () => Event(""),
+ "Calling Event constructor without 'new' must throw")
+})
test(function() {
assert_throws_js(TypeError, function() {
new Event()
diff --git a/test/fixtures/wpt/dom/events/event-global-is-still-set-when-reporting-exception-onerror.html b/test/fixtures/wpt/dom/events/event-global-is-still-set-when-reporting-exception-onerror.html
new file mode 100644
index 00000000000000..ceaac4fe2b2408
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/event-global-is-still-set-when-reporting-exception-onerror.html
@@ -0,0 +1,43 @@
+
+
+window.onerror handler restores window.event after it reports an exception
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/wpt/dom/events/mouse-event-retarget.html b/test/fixtures/wpt/dom/events/mouse-event-retarget.html
new file mode 100644
index 00000000000000..c9ce6240d40cc8
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/mouse-event-retarget.html
@@ -0,0 +1,26 @@
+
+
+Script created MouseEvent properly retargets and adjusts offsetX
+
+
+
+
+
+Hello
+
+
diff --git a/test/fixtures/wpt/dom/events/no-focus-events-at-clicking-editable-content-in-link.html b/test/fixtures/wpt/dom/events/no-focus-events-at-clicking-editable-content-in-link.html
new file mode 100644
index 00000000000000..dc08636c467fdf
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/no-focus-events-at-clicking-editable-content-in-link.html
@@ -0,0 +1,80 @@
+
+
+
+
+Clicking editable content in link shouldn't cause redundant focus related events
+
+
+
+
+
+
+
+Hello
+Hello
+
+
+
diff --git a/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-mousewheel-event-listener-on-body.html b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-mousewheel-event-listener-on-body.html
new file mode 100644
index 00000000000000..5574fe0acbcccb
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-mousewheel-event-listener-on-body.html
@@ -0,0 +1,19 @@
+
+non-passive mousewheel event listener on body
+
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-mousewheel-event-listener-on-div.html b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-mousewheel-event-listener-on-div.html
new file mode 100644
index 00000000000000..6fbf692cd79d76
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-mousewheel-event-listener-on-div.html
@@ -0,0 +1,35 @@
+
+non-passive mousewheel event listener on div
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-mousewheel-event-listener-on-document.html b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-mousewheel-event-listener-on-document.html
new file mode 100644
index 00000000000000..7d07393c699dd5
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-mousewheel-event-listener-on-document.html
@@ -0,0 +1,19 @@
+
+non-passive mousewheel event listener on document
+
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-mousewheel-event-listener-on-root.html b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-mousewheel-event-listener-on-root.html
new file mode 100644
index 00000000000000..e85fbacaba6a97
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-mousewheel-event-listener-on-root.html
@@ -0,0 +1,19 @@
+
+non-passive mousewheel event listener on root
+
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-mousewheel-event-listener-on-window.html b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-mousewheel-event-listener-on-window.html
new file mode 100644
index 00000000000000..29b09f85615d61
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-mousewheel-event-listener-on-window.html
@@ -0,0 +1,19 @@
+
+non-passive mousewheel event listener on window
+
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-touchmove-event-listener-on-body.html b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-touchmove-event-listener-on-body.html
new file mode 100644
index 00000000000000..f417bdd0a66817
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-touchmove-event-listener-on-body.html
@@ -0,0 +1,25 @@
+
+non-passive touchmove event listener on body
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-touchmove-event-listener-on-div.html b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-touchmove-event-listener-on-div.html
new file mode 100644
index 00000000000000..11c9345407566d
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-touchmove-event-listener-on-div.html
@@ -0,0 +1,25 @@
+
+non-passive touchmove event listener on div
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-touchmove-event-listener-on-document.html b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-touchmove-event-listener-on-document.html
new file mode 100644
index 00000000000000..8b95a8d492be36
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-touchmove-event-listener-on-document.html
@@ -0,0 +1,25 @@
+
+non-passive touchmove event listener on document
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-touchmove-event-listener-on-root.html b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-touchmove-event-listener-on-root.html
new file mode 100644
index 00000000000000..c41ab72bd8c645
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-touchmove-event-listener-on-root.html
@@ -0,0 +1,25 @@
+
+non-passive touchmove event listener on root
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-touchmove-event-listener-on-window.html b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-touchmove-event-listener-on-window.html
new file mode 100644
index 00000000000000..3d6675c56615eb
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-touchmove-event-listener-on-window.html
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-touchstart-event-listener-on-body.html b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-touchstart-event-listener-on-body.html
new file mode 100644
index 00000000000000..f6e6ecb06d9c55
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-touchstart-event-listener-on-body.html
@@ -0,0 +1,25 @@
+
+non-passive touchstart event listener on body
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-touchstart-event-listener-on-div.html b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-touchstart-event-listener-on-div.html
new file mode 100644
index 00000000000000..2e7c6e6b3b6992
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-touchstart-event-listener-on-div.html
@@ -0,0 +1,25 @@
+
+non-passive touchstart event listener on div
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-touchstart-event-listener-on-document.html b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-touchstart-event-listener-on-document.html
new file mode 100644
index 00000000000000..22fcbdc322ca27
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-touchstart-event-listener-on-document.html
@@ -0,0 +1,25 @@
+
+non-passive touchstart event listener on document
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-touchstart-event-listener-on-root.html b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-touchstart-event-listener-on-root.html
new file mode 100644
index 00000000000000..56c51349a04f38
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-touchstart-event-listener-on-root.html
@@ -0,0 +1,25 @@
+
+non-passive touchstart event listener on root
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-touchstart-event-listener-on-window.html b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-touchstart-event-listener-on-window.html
new file mode 100644
index 00000000000000..4e9d424a9ded16
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-touchstart-event-listener-on-window.html
@@ -0,0 +1,25 @@
+
+non-passive touchstart event listener on window
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-wheel-event-listener-on-body.html b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-wheel-event-listener-on-body.html
new file mode 100644
index 00000000000000..070cadc29187af
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-wheel-event-listener-on-body.html
@@ -0,0 +1,18 @@
+
+non-passive wheel event listener on body
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-wheel-event-listener-on-div.html b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-wheel-event-listener-on-div.html
new file mode 100644
index 00000000000000..c49d18ac139a55
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-wheel-event-listener-on-div.html
@@ -0,0 +1,34 @@
+
+non-passive wheel event listener on div
+
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-wheel-event-listener-on-document.html b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-wheel-event-listener-on-document.html
new file mode 100644
index 00000000000000..31a55cad43e17d
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-wheel-event-listener-on-document.html
@@ -0,0 +1,18 @@
+
+non-passive wheel event listener on document
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-wheel-event-listener-on-root.html b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-wheel-event-listener-on-root.html
new file mode 100644
index 00000000000000..b7bacbfc7ceb38
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-wheel-event-listener-on-root.html
@@ -0,0 +1,18 @@
+
+non-passive wheel event listener on root
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-wheel-event-listener-on-window.html b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-wheel-event-listener-on-window.html
new file mode 100644
index 00000000000000..c236059df4dac9
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/non-passive-wheel-event-listener-on-window.html
@@ -0,0 +1,18 @@
+
+non-passive wheel event listener on window
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-mousewheel-event-listener-on-body.html b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-mousewheel-event-listener-on-body.html
new file mode 100644
index 00000000000000..9db12cfbdc7343
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-mousewheel-event-listener-on-body.html
@@ -0,0 +1,19 @@
+
+passive mousewheel event listener on body
+
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-mousewheel-event-listener-on-div.html b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-mousewheel-event-listener-on-div.html
new file mode 100644
index 00000000000000..373670856b833e
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-mousewheel-event-listener-on-div.html
@@ -0,0 +1,35 @@
+
+passive mousewheel event listener on div
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-mousewheel-event-listener-on-document.html b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-mousewheel-event-listener-on-document.html
new file mode 100644
index 00000000000000..71262280b6fec6
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-mousewheel-event-listener-on-document.html
@@ -0,0 +1,19 @@
+
+passive mousewheel event listener on document
+
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-mousewheel-event-listener-on-root.html b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-mousewheel-event-listener-on-root.html
new file mode 100644
index 00000000000000..fc641d172e91bb
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-mousewheel-event-listener-on-root.html
@@ -0,0 +1,19 @@
+
+passive mousewheel event listener on root
+
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-mousewheel-event-listener-on-window.html b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-mousewheel-event-listener-on-window.html
new file mode 100644
index 00000000000000..f60955c7c48895
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-mousewheel-event-listener-on-window.html
@@ -0,0 +1,19 @@
+
+passive mousewheel event listener on window
+
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-touchmove-event-listener-on-body.html b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-touchmove-event-listener-on-body.html
new file mode 100644
index 00000000000000..2349bad2583434
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-touchmove-event-listener-on-body.html
@@ -0,0 +1,25 @@
+
+passive touchmove event listener on body
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-touchmove-event-listener-on-div.html b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-touchmove-event-listener-on-div.html
new file mode 100644
index 00000000000000..a61b34851e99ae
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-touchmove-event-listener-on-div.html
@@ -0,0 +1,25 @@
+
+passive touchmove event listener on div
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-touchmove-event-listener-on-document.html b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-touchmove-event-listener-on-document.html
new file mode 100644
index 00000000000000..b49971b5b0145e
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-touchmove-event-listener-on-document.html
@@ -0,0 +1,25 @@
+
+passive touchmove event listener on document
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-touchmove-event-listener-on-root.html b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-touchmove-event-listener-on-root.html
new file mode 100644
index 00000000000000..b8517045900863
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-touchmove-event-listener-on-root.html
@@ -0,0 +1,25 @@
+
+passive touchmove event listener on root
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-touchmove-event-listener-on-window.html b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-touchmove-event-listener-on-window.html
new file mode 100644
index 00000000000000..351d6ace845935
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-touchmove-event-listener-on-window.html
@@ -0,0 +1,25 @@
+
+passive touchmove event listener on window
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-touchstart-event-listener-on-body.html b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-touchstart-event-listener-on-body.html
new file mode 100644
index 00000000000000..c3d2b577fd8c66
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-touchstart-event-listener-on-body.html
@@ -0,0 +1,25 @@
+
+passive touchstart event listener on body
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-touchstart-event-listener-on-div.html b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-touchstart-event-listener-on-div.html
new file mode 100644
index 00000000000000..103e7f0d233a60
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-touchstart-event-listener-on-div.html
@@ -0,0 +1,25 @@
+
+passive touchstart event listener on div
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-touchstart-event-listener-on-document.html b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-touchstart-event-listener-on-document.html
new file mode 100644
index 00000000000000..2e4de2405fb2fb
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-touchstart-event-listener-on-document.html
@@ -0,0 +1,25 @@
+
+passive touchstart event listener on document
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-touchstart-event-listener-on-root.html b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-touchstart-event-listener-on-root.html
new file mode 100644
index 00000000000000..0f52e9a16fe67c
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-touchstart-event-listener-on-root.html
@@ -0,0 +1,25 @@
+
+passive touchstart event listener on root
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-touchstart-event-listener-on-window.html b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-touchstart-event-listener-on-window.html
new file mode 100644
index 00000000000000..c47af8101f2b7b
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-touchstart-event-listener-on-window.html
@@ -0,0 +1,25 @@
+
+passive touchstart event listener on window
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-wheel-event-listener-on-body.html b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-wheel-event-listener-on-body.html
new file mode 100644
index 00000000000000..fe0869b0229f5c
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-wheel-event-listener-on-body.html
@@ -0,0 +1,18 @@
+
+passive wheel event listener on body
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-wheel-event-listener-on-div.html b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-wheel-event-listener-on-div.html
new file mode 100644
index 00000000000000..e2ca6e795ae0f3
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-wheel-event-listener-on-div.html
@@ -0,0 +1,34 @@
+
+passive wheel event listener on div
+
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-wheel-event-listener-on-document.html b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-wheel-event-listener-on-document.html
new file mode 100644
index 00000000000000..61b716f7bbfb58
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-wheel-event-listener-on-document.html
@@ -0,0 +1,18 @@
+
+passive wheel event listener on document
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-wheel-event-listener-on-root.html b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-wheel-event-listener-on-root.html
new file mode 100644
index 00000000000000..6b383bc871d7aa
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-wheel-event-listener-on-root.html
@@ -0,0 +1,18 @@
+
+passive wheel event listener on root
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-wheel-event-listener-on-window.html b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-wheel-event-listener-on-window.html
new file mode 100644
index 00000000000000..a1e901f5527d9a
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/passive-wheel-event-listener-on-window.html
@@ -0,0 +1,18 @@
+
+passive wheel event listener on window
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/wpt/dom/events/non-cancelable-when-passive/resources/scrolling.js b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/resources/scrolling.js
new file mode 100644
index 00000000000000..88e10f5efdceab
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/resources/scrolling.js
@@ -0,0 +1,34 @@
+function raf() {
+ return new Promise((resolve) => {
+ // rAF twice.
+ window.requestAnimationFrame(() => {
+ window.requestAnimationFrame(resolve);
+ });
+ });
+}
+
+async function runTest({target, eventName, passive, expectCancelable}) {
+ await raf();
+
+ let cancelable = null;
+ let arrived = false;
+ target.addEventListener(eventName, function (event) {
+ cancelable = event.cancelable;
+ arrived = true;
+ }, {passive:passive, once:true});
+
+ promise_test(async (t) => {
+ t.add_cleanup(() => {
+ document.querySelector('.remove-on-cleanup')?.remove();
+ });
+ const pos_x = Math.floor(window.innerWidth / 2);
+ const pos_y = Math.floor(window.innerHeight / 2);
+ const delta_x = 0;
+ const delta_y = 100;
+
+ await new test_driver.Actions()
+ .scroll(pos_x, pos_y, delta_x, delta_y).send();
+ await t.step_wait(() => arrived, `Didn't get event ${eventName} on ${target.localName}`);
+ assert_equals(cancelable, expectCancelable);
+ });
+}
diff --git a/test/fixtures/wpt/dom/events/non-cancelable-when-passive/resources/touching.js b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/resources/touching.js
new file mode 100644
index 00000000000000..620d26804bf8c7
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/resources/touching.js
@@ -0,0 +1,34 @@
+function waitForCompositorCommit() {
+ return new Promise((resolve) => {
+ // rAF twice.
+ window.requestAnimationFrame(() => {
+ window.requestAnimationFrame(resolve);
+ });
+ });
+}
+
+function injectInput(touchDiv) {
+ return new test_driver.Actions()
+ .addPointer("touch_pointer", "touch")
+ .pointerMove(0, 0, {origin: touchDiv})
+ .pointerDown()
+ .pointerMove(30, 30)
+ .pointerUp()
+ .send();
+}
+
+function runTest({target, eventName, passive, expectCancelable}) {
+ let touchDiv = document.getElementById("touchDiv");
+ let cancelable = null;
+ let arrived = false;
+ target.addEventListener(eventName, function (event) {
+ cancelable = event.cancelable;
+ arrived = true;
+ }, {passive});
+ promise_test(async () => {
+ await waitForCompositorCommit();
+ await injectInput(touchDiv);
+ await waitFor(() => arrived);
+ assert_equals(cancelable, expectCancelable);
+ });
+}
diff --git a/test/fixtures/wpt/dom/events/non-cancelable-when-passive/resources/wait-for.js b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/resources/wait-for.js
new file mode 100644
index 00000000000000..0bf3e558342fd6
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/resources/wait-for.js
@@ -0,0 +1,15 @@
+function waitFor(condition, MAX_FRAME = 500) {
+ return new Promise((resolve, reject) => {
+ function tick(frames) {
+ // We requestAnimationFrame either for MAX_FRAME frames or until condition is
+ // met.
+ if (frames >= MAX_FRAME)
+ reject(new Error(`Condition did not become true after ${MAX_FRAME} frames`));
+ else if (condition())
+ resolve();
+ else
+ requestAnimationFrame(() => tick(frames + 1));
+ }
+ tick(0);
+ });
+}
diff --git a/test/fixtures/wpt/dom/events/non-cancelable-when-passive/synthetic-events-cancelable.html b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/synthetic-events-cancelable.html
new file mode 100644
index 00000000000000..4287770b8d5828
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/non-cancelable-when-passive/synthetic-events-cancelable.html
@@ -0,0 +1,34 @@
+
+Synthetic events are always cancelable by default
+
+
+
+
diff --git a/test/fixtures/wpt/dom/events/passive-by-default.html b/test/fixtures/wpt/dom/events/passive-by-default.html
new file mode 100644
index 00000000000000..02029f4dacf811
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/passive-by-default.html
@@ -0,0 +1,50 @@
+
+Default passive event listeners on window, document, document element, body
+
+
+
+
+
+
diff --git a/test/fixtures/wpt/dom/events/scrolling/iframe-chains.html b/test/fixtures/wpt/dom/events/scrolling/iframe-chains.html
index 2d7e1827adad6f..fb7d674aae13ee 100644
--- a/test/fixtures/wpt/dom/events/scrolling/iframe-chains.html
+++ b/test/fixtures/wpt/dom/events/scrolling/iframe-chains.html
@@ -39,7 +39,8 @@
promise_test(async t => {
await new test_driver.Actions().scroll(50, 50, 0, 50).send();
- assert_equals(scroller.scrollTop, 50);
+ // Allow the possibility the scroll is not fully synchronous
+ await t.step_wait(() => scroller.scrollTop === 50);
}, "Wheel scroll in iframe chains to containing element.");
diff --git a/test/fixtures/wpt/dom/events/scrolling/scroll_support.js b/test/fixtures/wpt/dom/events/scrolling/scroll_support.js
index 0a73f34fefc8ab..169393e4c3e419 100644
--- a/test/fixtures/wpt/dom/events/scrolling/scroll_support.js
+++ b/test/fixtures/wpt/dom/events/scrolling/scroll_support.js
@@ -1,8 +1,22 @@
+async function waitForScrollendEvent(test, target, timeoutMs = 500) {
+ return new Promise((resolve, reject) => {
+ const timeoutCallback = test.step_timeout(() => {
+ reject(`No Scrollend event received for target ${target}`);
+ }, timeoutMs);
+ target.addEventListener('scrollend', (evt) => {
+ clearTimeout(timeoutCallback);
+ resolve(evt);
+ }, { once: true });
+ });
+}
+
const MAX_FRAME = 700;
const MAX_UNCHANGED_FRAMES = 20;
// Returns a promise that resolves when the given condition is met or rejects
// after MAX_FRAME animation frames.
+// TODO(crbug.com/1400399): deprecate. We should not use frame based waits in
+// WPT as frame rates may vary greatly in different testing environments.
function waitFor(condition, error_message = 'Reaches the maximum frames.') {
return new Promise((resolve, reject) => {
function tick(frames) {
@@ -19,6 +33,9 @@ function waitFor(condition, error_message = 'Reaches the maximum frames.') {
});
}
+// TODO(crbug.com/1400446): Test driver should defer sending events until the
+// browser is ready. Also the term compositor-commit is misleading as not all
+// user-agents use a compositor process.
function waitForCompositorCommit() {
return new Promise((resolve) => {
// rAF twice.
@@ -28,6 +45,8 @@ function waitForCompositorCommit() {
});
}
+// TODO(crbug.com/1400399): Deprecate as frame rates may vary greatly in
+// different test environments.
function waitForAnimationEnd(getValue) {
var last_changed_frame = 0;
var last_position = getValue();
@@ -50,6 +69,31 @@ function waitForAnimationEnd(getValue) {
})
}
+// Scrolls in target according to move_path with pauses in between
+function touchScrollInTargetSequentiallyWithPause(target, move_path, pause_time_in_ms = 100) {
+ const test_driver_actions = new test_driver.Actions()
+ .addPointer("pointer1", "touch")
+ .pointerMove(0, 0, {origin: target})
+ .pointerDown();
+
+ const substeps = 5;
+ let x = 0;
+ let y = 0;
+ // Do each move in 5 steps
+ for(let move of move_path) {
+ let step_x = (move.x - x) / substeps;
+ let step_y = (move.y - y) / substeps;
+ for(let step = 0; step < substeps; step++) {
+ x += step_x;
+ y += step_y;
+ test_driver_actions.pointerMove(x, y, {origin: target});
+ }
+ test_driver_actions.pause(pause_time_in_ms);
+ }
+
+ return test_driver_actions.pointerUp().send();
+}
+
function touchScrollInTarget(pixels_to_scroll, target, direction, pause_time_in_ms = 100) {
var x_delta = 0;
var y_delta = 0;
@@ -61,7 +105,7 @@ function touchScrollInTarget(pixels_to_scroll, target, direction, pause_time_in_
} else if (direction == "right") {
x_delta = -1 * pixels_to_scroll / num_movs;
} else if (direction == "left") {
- x_delta = pixels_to_scroll / num_movs;;
+ x_delta = pixels_to_scroll / num_movs;
} else {
throw("scroll direction '" + direction + "' is not expected, direction should be 'down', 'up', 'left' or 'right'");
}
@@ -95,3 +139,25 @@ function mouseActionsInTarget(target, origin, delta, pause_time_in_ms = 100) {
.pointerUp()
.send();
}
+
+// Returns a promise that resolves when the given condition holds for 10
+// animation frames or rejects if the condition changes to false within 10
+// animation frames.
+// TODO(crbug.com/1400399): Deprecate as frame rates may very greatly in
+// different test environments.
+function conditionHolds(condition, error_message = 'Condition is not true anymore.') {
+ const MAX_FRAME = 10;
+ return new Promise((resolve, reject) => {
+ function tick(frames) {
+ // We requestAnimationFrame either for 10 frames or until condition is
+ // violated.
+ if (frames >= MAX_FRAME)
+ resolve();
+ else if (!condition())
+ reject(error_message);
+ else
+ requestAnimationFrame(tick.bind(this, frames + 1));
+ }
+ tick(0);
+ });
+}
diff --git a/test/fixtures/wpt/dom/events/scrolling/scrollend-event-fired-after-sequence-of-scrolls.tentative.html b/test/fixtures/wpt/dom/events/scrolling/scrollend-event-fired-after-sequence-of-scrolls.tentative.html
new file mode 100644
index 00000000000000..77bf029ced58c5
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/scrolling/scrollend-event-fired-after-sequence-of-scrolls.tentative.html
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/wpt/dom/events/scrolling/scrollend-event-fired-after-snap.html b/test/fixtures/wpt/dom/events/scrolling/scrollend-event-fired-after-snap.html
index ef1b495791cad1..03079ddc6cad8c 100644
--- a/test/fixtures/wpt/dom/events/scrolling/scrollend-event-fired-after-snap.html
+++ b/test/fixtures/wpt/dom/events/scrolling/scrollend-event-fired-after-snap.html
@@ -1,4 +1,5 @@
+
diff --git a/test/fixtures/wpt/dom/events/scrolling/scrollend-event-fired-for-programmatic-scroll.html b/test/fixtures/wpt/dom/events/scrolling/scrollend-event-fired-for-programmatic-scroll.html
index 79b5f5f0186871..c6569e0bebbd9f 100644
--- a/test/fixtures/wpt/dom/events/scrolling/scrollend-event-fired-for-programmatic-scroll.html
+++ b/test/fixtures/wpt/dom/events/scrolling/scrollend-event-fired-for-programmatic-scroll.html
@@ -1,5 +1,6 @@
+
diff --git a/test/fixtures/wpt/dom/events/scrolling/scrollend-event-fired-for-scrollIntoView.html b/test/fixtures/wpt/dom/events/scrolling/scrollend-event-fired-for-scrollIntoView.html
index 63e1c3e22eaafc..8782b1dfee6237 100644
--- a/test/fixtures/wpt/dom/events/scrolling/scrollend-event-fired-for-scrollIntoView.html
+++ b/test/fixtures/wpt/dom/events/scrolling/scrollend-event-fired-for-scrollIntoView.html
@@ -1,5 +1,6 @@
+
diff --git a/test/fixtures/wpt/dom/events/scrolling/scrollend-event-fired-to-document.html b/test/fixtures/wpt/dom/events/scrolling/scrollend-event-fired-to-document.html
index 99c1c6930fab0b..30904553883435 100644
--- a/test/fixtures/wpt/dom/events/scrolling/scrollend-event-fired-to-document.html
+++ b/test/fixtures/wpt/dom/events/scrolling/scrollend-event-fired-to-document.html
@@ -1,4 +1,5 @@
+
diff --git a/test/fixtures/wpt/dom/events/scrolling/scrollend-event-fired-to-element-with-overscroll-behavior.html b/test/fixtures/wpt/dom/events/scrolling/scrollend-event-fired-to-element-with-overscroll-behavior.html
index 0269c66fdde192..acad168e56c995 100644
--- a/test/fixtures/wpt/dom/events/scrolling/scrollend-event-fired-to-element-with-overscroll-behavior.html
+++ b/test/fixtures/wpt/dom/events/scrolling/scrollend-event-fired-to-element-with-overscroll-behavior.html
@@ -1,4 +1,5 @@
+
@@ -80,12 +81,20 @@
'on target.');
assert_equals(target_div.scrollLeft, 0);
- // Scroll up on target div and wait for the element with overscroll-y to get
- // scrollend event.
+ let touchEndPromise = new Promise((resolve) => {
+ target_div.addEventListener("touchend", resolve);
+ });
await touchScrollInTarget(300, target_div, 'up');
- await waitFor(() => { return vertical_scrollend_arrived; },
- 'Expected element did not receive scrollend event after scroll up on ' +
- 'target.');
+
+ // The scrollend event should never be fired before the gesture has completed.
+ await touchEndPromise;
+
+ // Ensure we wait at least a tick after the touch end.
+ await waitForCompositorCommit();
+
+ // We should not trigger a scrollend event for a scroll that did not change
+ // the scroll position.
+ assert_equals(vertical_scrollend_arrived, false);
assert_equals(target_div.scrollTop, 0);
}, 'Tests that the last element in the cut scroll chain gets scrollend ' +
'event when no element scrolls by touch.');
diff --git a/test/fixtures/wpt/dom/events/scrolling/scrollend-event-fired-to-scrolled-element.html b/test/fixtures/wpt/dom/events/scrolling/scrollend-event-fired-to-scrolled-element.html
index 87cad79df7c2af..734339694220cc 100644
--- a/test/fixtures/wpt/dom/events/scrolling/scrollend-event-fired-to-scrolled-element.html
+++ b/test/fixtures/wpt/dom/events/scrolling/scrollend-event-fired-to-scrolled-element.html
@@ -1,4 +1,5 @@
+
diff --git a/test/fixtures/wpt/dom/events/scrolling/scrollend-event-fired-to-window.html b/test/fixtures/wpt/dom/events/scrolling/scrollend-event-fired-to-window.html
index f9510e6e231615..ef72f56d2ba9d6 100644
--- a/test/fixtures/wpt/dom/events/scrolling/scrollend-event-fired-to-window.html
+++ b/test/fixtures/wpt/dom/events/scrolling/scrollend-event-fired-to-window.html
@@ -1,4 +1,5 @@
+
diff --git a/test/fixtures/wpt/dom/events/scrolling/scrollend-event-for-user-scroll.html b/test/fixtures/wpt/dom/events/scrolling/scrollend-event-for-user-scroll.html
index 30f16571cd8320..5146c5f719a1e4 100644
--- a/test/fixtures/wpt/dom/events/scrolling/scrollend-event-for-user-scroll.html
+++ b/test/fixtures/wpt/dom/events/scrolling/scrollend-event-for-user-scroll.html
@@ -1,6 +1,7 @@
+
@@ -29,110 +30,170 @@
diff --git a/test/fixtures/wpt/dom/events/scrolling/scrollend-event-handler-content-attributes.html b/test/fixtures/wpt/dom/events/scrolling/scrollend-event-handler-content-attributes.html
new file mode 100644
index 00000000000000..47f563c39bd907
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/scrolling/scrollend-event-handler-content-attributes.html
@@ -0,0 +1,108 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/wpt/dom/events/scrolling/scrollend-event-not-fired-after-removing-scroller.tentative.html b/test/fixtures/wpt/dom/events/scrolling/scrollend-event-not-fired-after-removing-scroller.tentative.html
new file mode 100644
index 00000000000000..95447fbd12ea2a
--- /dev/null
+++ b/test/fixtures/wpt/dom/events/scrolling/scrollend-event-not-fired-after-removing-scroller.tentative.html
@@ -0,0 +1,84 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/wpt/versions.json b/test/fixtures/wpt/versions.json
index 9200762e6f9255..2e17ed940d47e8 100644
--- a/test/fixtures/wpt/versions.json
+++ b/test/fixtures/wpt/versions.json
@@ -12,7 +12,7 @@
"path": "dom/abort"
},
"dom/events": {
- "commit": "f8821adb281696322f4bd96d412a98ae510f9125",
+ "commit": "ab8999891c6225bef1741c2960033aad620481a8",
"path": "dom/events"
},
"encoding": {
diff --git a/test/wpt/status/dom/events.json b/test/wpt/status/dom/events.json
index 012b73f70001ae..95fbda98402b14 100644
--- a/test/wpt/status/dom/events.json
+++ b/test/wpt/status/dom/events.json
@@ -19,8 +19,8 @@
"Event-constructors.any.js": {
"fail": {
"expected": [
- "Untitled 2",
- "Untitled 3"
+ "Untitled 3",
+ "Untitled 4"
]
}
},