1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:28:12 +00:00

LibWeb: Update IntersectionObserver::intersection_root() for navigables

This commit is contained in:
Aliaksandr Kalenik 2023-09-12 19:18:00 +02:00 committed by Andreas Kling
parent 10b2ce49dc
commit 69513de1ad

View file

@ -8,6 +8,7 @@
#include <LibWeb/Bindings/Intrinsics.h>
#include <LibWeb/DOM/Document.h>
#include <LibWeb/DOM/Element.h>
#include <LibWeb/HTML/TraversableNavigable.h>
#include <LibWeb/IntersectionObserver/IntersectionObserver.h>
namespace Web::IntersectionObserver {
@ -155,7 +156,7 @@ Variant<JS::Handle<DOM::Element>, JS::Handle<DOM::Document>, Empty> Intersection
Variant<JS::Handle<DOM::Element>, JS::Handle<DOM::Document>> IntersectionObserver::intersection_root() const
{
if (!m_root.has_value())
return JS::make_handle(global_object().browsing_context()->top_level_browsing_context()->active_document());
return JS::make_handle(global_object().navigable()->traversable_navigable()->active_document());
return m_root.value();
}