On Web, cache commonly used values (#2947)

This commit is contained in:
daxpedda
2023-07-11 00:11:06 +02:00
committed by GitHub
parent c4d70d75c1
commit af26f01b95
7 changed files with 131 additions and 126 deletions

View File

@@ -725,7 +725,7 @@ impl<T> EventLoopWindowTarget<T> {
let runner = self.runner.clone();
canvas.on_intersection(move |is_intersecting| {
// only fire if visible while skipping the first event if it's intersecting
if backend::is_visible(runner.window())
if backend::is_visible(runner.document())
&& !(is_intersecting && canvas_clone.borrow().is_intersecting.is_none())
{
runner.send_event(Event::WindowEvent {