jonhoo / inferno

A Rust port of FlameGraph

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Firefox rendering bug for SVGs

itamarst opened this issue · comments

In Firefox there appears to be a race condition where sometimes the height of the flamegraph is not updated fast enough, and so the browser renders it with too large of a height. Here you see two graphs stacked above each other; notice the whitespace between them that shouldn't be there:

Screenshot from 2022-05-15 15-36-23

If I reload the page, the gap (usually) disappears.

The solution I came up with, which I need to test further (it's an intermittent bug...) is to move the viewpoint DOM manipulation until after the new width was created, i.e. svg.removeAttribute("viewBox"); gets moved to the end of update_for_width_change(). I will do some more verification, and if it really fixes the bug, submit a PR.