mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-03-22 04:34:44 +00:00
Merge pull request #1572 from egrs/intersection-observer-timestamp
Use performance.now() for IntersectionObserverEntry.time
This commit is contained in:
@@ -25,6 +25,8 @@
|
||||
testing.expectEqual('number', typeof entry.intersectionRatio);
|
||||
testing.expectEqual('object', typeof entry.boundingClientRect);
|
||||
testing.expectEqual('object', typeof entry.intersectionRect);
|
||||
testing.expectEqual('number', typeof entry.time);
|
||||
testing.expectEqual(true, entry.time > 0);
|
||||
|
||||
observer.disconnect();
|
||||
});
|
||||
|
||||
@@ -246,7 +246,7 @@ fn checkIntersection(self: *IntersectionObserver, target: *Element, page: *Page)
|
||||
._page = page,
|
||||
._arena = arena,
|
||||
._target = target,
|
||||
._time = 0.0, // TODO: Get actual timestamp
|
||||
._time = page.window._performance.now(),
|
||||
._bounding_client_rect = data.bounding_client_rect,
|
||||
._intersection_rect = data.intersection_rect,
|
||||
._root_bounds = data.root_bounds,
|
||||
|
||||
Reference in New Issue
Block a user