Changing the mouse cursor for an entire page is sometimes necessary, and the only way I can find to do this is to change the styling of the body element. However with a complex document this can cause reflow for the entire page, so changing the mouse cursor this way can end up being a cause of serious jank!
To solve this:
- is there another way to change the cursor I’m not aware of?
- could browsers optimise specifically the cursor property to not cause reflow?
- perhaps there could be a new API like
window.setMouseCursor(style)
which avoids touching styling?