[whatwg/dom] Does the currentEvent variable make a sense in Inner Invoke? (Issue #1191)

Now we have this:
> 7. Let currentEvent be undefined.
> 8. If global is a [Window](https://html.spec.whatwg.org/multipage/nav-history-apis.html#window) object, then:
>    1. Set currentEvent to global’s [current event](https://dom.spec.whatwg.org/#window-current-event).
>    2. If invocationTargetInShadowTree is false, then set global’s [current event](https://dom.spec.whatwg.org/#window-current-event) to event.

>12. If global is a [Window](https://html.spec.whatwg.org/multipage/nav-history-apis.html#window) object, then set global’s [current event](https://dom.spec.whatwg.org/#window-current-event) to currentEvent.

Can we short into this:
> 7. If global is a [Window](https://html.spec.whatwg.org/multipage/nav-history-apis.html#window) object, then:
>    1. If invocationTargetInShadowTree is false, then set global’s [current event](https://dom.spec.whatwg.org/#window-current-event) to event.

>11. If global is a [Window](https://html.spec.whatwg.org/multipage/nav-history-apis.html#window) object, then set global’s [current event](https://dom.spec.whatwg.org/#window-current-event) to undefined.

I wondered because `currentEvent` always has `undefined` value. Do we have a case when this reduction could break the logic?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/1191
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/dom/issues/1191@github.com>

Received on Tuesday, 25 April 2023 11:48:54 UTC