Remove SubmitEvent polyfill#37276
Merged
silverwind merged 1 commit intogo-gitea:mainfrom Apr 18, 2026
Merged
Conversation
PaleMoon/UXP now supports the native SubmitEvent API (per go-gitea#37270 comment thread), so the polyfill added for it is dead weight. Remove the `submitEventSubmitter` wrapper, the `initSubmitEventPolyfill` init function, its two document.body listeners, and the `form._submitter` expando. Call sites use `e.submitter` directly. `repo-diff.ts` switches from `nodeName` string comparisons to `instanceof HTMLButtonElement` / `HTMLInputElement` for cleaner type narrowing. Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Removes the legacy SubmitEvent polyfill now that PaleMoon/UXP supports the native API, and updates submit-handling call sites to use SubmitEvent.submitter directly (with improved type narrowing in repo-diff.ts).
Changes:
- Deleted
SubmitEventpolyfill helpers (submitEventSubmitter,initSubmitEventPolyfill, and_submitterexpando tracking). - Removed polyfill initialization from the global JS init pipeline.
- Updated submit handlers to use
e.submitterdirectly and replacednodeNamechecks withinstanceof-based narrowing.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| web_src/js/utils/dom.ts | Removes the SubmitEvent polyfill implementation and related helpers. |
| web_src/js/index.ts | Drops polyfill import and init call from the global initializer list. |
| web_src/js/features/repo-diff.ts | Uses e.submitter directly and narrows submitter type via instanceof. |
| web_src/js/features/common-fetch-action.ts | Uses e.submitter directly and adjusts option typing to allow null submitters. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
delvh
approved these changes
Apr 18, 2026
Member
Author
|
I also verified the |
lunny
approved these changes
Apr 18, 2026
zjjhot
added a commit
to zjjhot/gitea
that referenced
this pull request
Apr 20, 2026
* main: (25 commits) Add WebKit to e2e test matrix (go-gitea#37298) Don't add useless labels which will bother changelog generation (go-gitea#37267) Fix Repository transferring page (go-gitea#37277) Stabilize issue-project e2e test, increase timeout factor (go-gitea#37297) Fix Mermaid diagrams failing when node labels contain line breaks (go-gitea#37296) Add project column picker to issue and pull request sidebar (go-gitea#37037) Fix container auth for public instance (go-gitea#37290) Refactor frontend `tw-justify-between` layouts to `flex-left-right` (go-gitea#37291) Update Nix flake (go-gitea#37284) Workflow Artifact Info Hover (go-gitea#37100) [skip ci] Updated translations via Crowdin release notes for 1.26.0 (go-gitea#37282) Enhance GetActionWorkflow to support fallback references (go-gitea#37189) Refactor LDAP tests (go-gitea#37274) Remove `SubmitEvent` polyfill (go-gitea#37276) Upgrade go-git to v5.18.0 (go-gitea#37268) Avoid top-level await (go-gitea#37272) Frontend iframe renderer framework: 3D models, OpenAPI (go-gitea#37233) pull: Fix CODEOWNERS absolute path matching. (go-gitea#37244) Swift registry metadata: preserve more JSON fields and accept empty metadata (go-gitea#37254) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remove this obsolete polyfill as per #37270 (comment).