Skip to content

Conversation

@eszpotanski
Copy link
Contributor

Chromium-based browsers can report slightly different widths and heights for divs covering the same area, based on used zoom.

For instance, when Speedscope is used with 110% zoom and window size is changed (or redraw is triggered in some other way), the following error is raised, sometimes preventing blocks from being redrawn (the same as in #486):

canvas-context.ts:56 Uncaught RangeError: Maximum call stack size exceeded
    at CanvasContext.onBeforeFrame (canvas-context.ts:56:27)
    at graphics.ts:497:46
    at Set.forEach (<anonymous>)
    at Context.resize (graphics.ts:497:32)
    at GLCanvas.maybeResize (application.tsx:107:33)
    at CanvasContext.onBeforeFrame (canvas-context.ts:63:7)
    at graphics.ts:497:46
    at Set.forEach (<anonymous>)
    at Context.resize (graphics.ts:497:32)
    at GLCanvas.maybeResize (application.tsx:107:33)
image

In this PR, a small margin of error is introduced to make sure the recurrence is properly stopped. It potentially fixes #418 and #486.

With some specific zoom (e.g. 110%), browser can report slightly
different values of divs that cover the same area, leading to infinite
recurrence

Signed-off-by: Eryk Szpotanski <[email protected]>
@coveralls
Copy link

Coverage Status

coverage: 43.454%. remained the same
when pulling 20b47e1 on antmicro:eszp/fix-infinite-recurrence-when-redrawing
into fc76932 on jlfwong:main.

@jlfwong
Copy link
Owner

jlfwong commented Nov 3, 2025

Amazing, thanks for tracking down the root cause of this!

@jlfwong jlfwong merged commit 928dae9 into jlfwong:main Nov 3, 2025
6 checks passed
@eszpotanski eszpotanski deleted the eszp/fix-infinite-recurrence-when-redrawing branch November 4, 2025 09:45
@jlfwong
Copy link
Owner

jlfwong commented Dec 3, 2025

@eszpotanski This is now live on https://speedscope.app and published to npm as [email protected]

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.

Rendering issues with Chrome and Edge on Linux Mint

3 participants