Follow-up to #3901 (cc @evanpelle).
## Description:
In the review on #3901, evanpelle pointed out that the disposer returned
by `installSafariPinchZoomBlocker` is never called at the call site in
`Main.ts`, and asked whether there's any reason to return it. There
isn't — the listeners live for the document's lifetime and the browser
releases them on teardown — so this PR drops the disposer.
### Changes
- `installSafariPinchZoomBlocker` now returns `void`. Removed the
`return () => { ... }` block and the `@returns` JSDoc line. Added a
sentence explaining why no disposer is needed.
- Tests: dropped the disposer-removal test, switched the behavior tests
to use fresh detached `<div>` elements (no document state leak across
tests), and verified the default-target = `document` case with
`vi.spyOn(document, 'addEventListener').mockImplementation(() => {})` so
no real listener actually attaches to the shared jsdom document.
Net diff: -23 lines (30 insertions, 53 deletions).
### What I tested
- `npm test` — 1245 + 65 tests pass, including the 4 surviving tests for
this helper
- `npm run build-prod` — succeeds (tsc + vite)
- `npx eslint` — clean
- `npx prettier --check` on the touched files — clean
## Please complete the following:
- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
## Please put your Discord username so you can be contacted if a bug or
regression is found:
@vansszh
iOS Safari has ignored the `user-scalable=no` viewport hint since iOS
10, so two-finger pinch still zooms the whole page and can softlock the
in-game HUD. Intercept WebKit's non-standard `gesturestart`,
`gesturechange` and `gestureend` events at `document` and call
`preventDefault()` so the page stays put. The game's own pinch-to-zoom
on the map canvas is driven by pointer events (InputHandler) and is
unaffected; browsers that do not fire GestureEvent treat the listeners
as a no-op.
Resolves#2330
If this PR fixes an issue, link it below. If not, delete these two
lines.
Resolves #(issue number)
## Description:
Describe the PR.
## Please complete the following:
- [ ] I have added screenshots for all UI updates
- [ ] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [ ] I have added relevant tests to the test directory
- [ ] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
## Please put your Discord username so you can be contacted if a bug or
regression is found:
DISCORD_USERNAME