diff --git a/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.cpp b/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.cpp index ca85ccf04b..5282e2198b 100644 --- a/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.cpp +++ b/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.cpp @@ -175,7 +175,10 @@ CSSPixelRect IntersectionObserver::root_intersection_rectangle() const // Since the spec says that this is only reach if the document is fully active, that means it must have a browsing context. VERIFY(document->browsing_context()); - rect = document->browsing_context()->viewport_rect(); + + // NOTE: This rect is the *size* of the viewport. The viewport *offset* is not relevant, + // as intersections are computed using viewport-relative element rects. + rect = CSSPixelRect { CSSPixelPoint { 0, 0 }, document->browsing_context()->viewport_rect().size() }; } else { VERIFY(intersection_root.has>()); auto element = intersection_root.get>();