diff options
Diffstat (limited to 'op_crates')
-rw-r--r-- | op_crates/web/01_event.js | 10 | ||||
-rw-r--r-- | op_crates/web/02_abort_signal.js | 6 |
2 files changed, 15 insertions, 1 deletions
diff --git a/op_crates/web/01_event.js b/op_crates/web/01_event.js index 35b269ea4..fb80ea4a6 100644 --- a/op_crates/web/01_event.js +++ b/op_crates/web/01_event.js @@ -42,6 +42,13 @@ event.currentTarget = value; } + function setIsTrusted(event, value) { + const data = eventData.get(event); + if (data) { + data.isTrusted = value; + } + } + function setDispatched(event, value) { const data = eventData.get(event); if (data) { @@ -1185,4 +1192,7 @@ window.__bootstrap.eventTarget = { setEventTargetData, }; + window.__bootstrap.event = { + setIsTrusted, + }; })(this); diff --git a/op_crates/web/02_abort_signal.js b/op_crates/web/02_abort_signal.js index 5ee047c36..412dab835 100644 --- a/op_crates/web/02_abort_signal.js +++ b/op_crates/web/02_abort_signal.js @@ -1,6 +1,8 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. ((window) => { + const { setIsTrusted } = window.__bootstrap.event; + const add = Symbol("add"); const signalAbort = Symbol("signalAbort"); const remove = Symbol("remove"); @@ -24,7 +26,9 @@ algorithm(); } this.#abortAlgorithms.clear(); - this.dispatchEvent(new Event("abort")); + const event = new Event("abort"); + setIsTrusted(event, true); + this.dispatchEvent(event); } [remove](algorithm) { |