Files
UXP/dom/webidl/SubmitEvent.webidl
T
Basilisk-Dev 9b3d172a95 Issue #2403 - Implement SubmitEvent functionality (#2919)
# Summary

Added SubmitEvent support (constructor, submitter attribute) and wired form submit events to produce SubmitEvent instances.

Implemented SubmitEvent DOM class, WebIDL, and build hooks.

Added a test file (logs to console).

# Notes

Form submissions already carry the originating control in `InternalFormEvent::mOriginator`, so `SubmitEvent.submitter` can be populated directly from the existing event data without invasive changes to form submission logic.

`EventDispatcher` now returns `SubmitEvent` specifically for `eFormSubmit`, keeping other form events (e.g., reset) unchanged.

`event.submitter` is set for user-initiated submits via the originating submit control.

`new SubmitEvent("submit", { submitter })` returns the provided submitter (or `null` if omitted).

# Ways to test
Go to repo.palemoon.org. You will no longer see the message `This browser doesn't have "SubmitEvent" support, use a tricky method to polyfill` in the console. The site will work as expected without loading this polyfill anymore.

Go to GitHub. You will now be able to mark notifications as read.

Open the test file submitted in this PR. You will see the results of the test in the browser console.

Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2919
Co-authored-by: Basilisk-Dev <basiliskdev@protonmail.com>
Co-committed-by: Basilisk-Dev <basiliskdev@protonmail.com>
2026-01-29 21:41:47 +08:00

17 lines
515 B
Plaintext

/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
[Constructor(DOMString type, optional SubmitEventInit eventInitDict)]
interface SubmitEvent : Event
{
readonly attribute HTMLElement? submitter;
};
dictionary SubmitEventInit : EventInit
{
HTMLElement? submitter = null;
};