diff --git a/src/browser/tests/intersection_observer/basic.html b/src/browser/tests/intersection_observer/basic.html index dde36231..3c9258bf 100644 --- a/src/browser/tests/intersection_observer/basic.html +++ b/src/browser/tests/intersection_observer/basic.html @@ -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(); }); diff --git a/src/browser/webapi/IntersectionObserver.zig b/src/browser/webapi/IntersectionObserver.zig index 8f0b338e..a8f7ba1a 100644 --- a/src/browser/webapi/IntersectionObserver.zig +++ b/src/browser/webapi/IntersectionObserver.zig @@ -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,