Skip to content

[html5] Remove duplication in canvasResizedCallback invocations. NFC#27265

Merged
sbc100 merged 1 commit into
emscripten-core:mainfrom
sbc100:html5-dedupe-canvas-resized-callback
Jul 7, 2026
Merged

[html5] Remove duplication in canvasResizedCallback invocations. NFC#27265
sbc100 merged 1 commit into
emscripten-core:mainfrom
sbc100:html5-dedupe-canvas-resized-callback

Conversation

@sbc100

@sbc100 sbc100 commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Extract callCanvasResizedCallback helper function to unify the 5 separate places where strategy.canvasResizedCallback is called in libhtml5.js.

Also, initialize currentFullscreenStrategy to 0 rather than empty object. This is what it gets reset to in restoreWindowedState anyway, so we should be consistent.

@sbc100 sbc100 requested review from kleisauke and kripken July 7, 2026 06:03
@sbc100 sbc100 force-pushed the html5-dedupe-canvas-resized-callback branch from 4234491 to 8d8af19 Compare July 7, 2026 06:06
@sbc100 sbc100 changed the title [html5] Remove duplication in canvasResizedCallback invocations [html5] Remove duplication in canvasResizedCallback invocations Jul 7, 2026
@sbc100 sbc100 force-pushed the html5-dedupe-canvas-resized-callback branch from 8d8af19 to a10d38b Compare July 7, 2026 06:30
Extract $callCanvasResizedCallback helper function to unify the 5 separate
places where strategy.canvasResizedCallback is called in libhtml5.js.

Also initialize $currentFullscreenStrategy to 0 (matching its reset state) so
that property access in softFullscreenResizeWebGLRenderTarget is safe.
@sbc100 sbc100 force-pushed the html5-dedupe-canvas-resized-callback branch from a10d38b to 8a2a6ca Compare July 7, 2026 16:35
@sbc100 sbc100 changed the title [html5] Remove duplication in canvasResizedCallback invocations [html5] Remove duplication in canvasResizedCallback invocations. NFC Jul 7, 2026
@sbc100 sbc100 merged commit d154f06 into emscripten-core:main Jul 7, 2026
39 checks passed
@sbc100 sbc100 deleted the html5-dedupe-canvas-resized-callback branch July 7, 2026 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants