mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
This code was calling `elementFromPoint` on every scroll event. This is an expensive browser API, and also seems to trigger a premature 'paint' event during initial render. This seems to trigger cumulative-layout-shift metric problems, even though the shift was never actually visible onscreen. This workaround was added more than 7 years ago, and it seems like `document.fullscreenElement` now correctly detects fullscreen youtube embeds. So we should be able to remove the `elementFromPoint` call without affecting any functionality.