mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-30 23:12:56 +00:00
LibWeb: Change viewport ownership from BrowsingContext
to Navigable
This commit is contained in:
parent
4356d37b2c
commit
dd7bba66ed
Notes:
sideshowbarker
2024-07-17 01:13:25 +09:00
Author: https://github.com/kalenikaliaksandr
Commit: dd7bba66ed
Pull-request: https://github.com/SerenityOS/serenity/pull/18219
23 changed files with 196 additions and 129 deletions
|
@ -173,12 +173,12 @@ CSSPixelRect IntersectionObserver::root_intersection_rectangle() const
|
|||
if (intersection_root.has<JS::Handle<DOM::Document>>()) {
|
||||
auto document = intersection_root.get<JS::Handle<DOM::Document>>();
|
||||
|
||||
// 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());
|
||||
// Since the spec says that this is only reach if the document is fully active, that means it must have a navigable.
|
||||
VERIFY(document->navigable());
|
||||
|
||||
// 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() };
|
||||
rect = CSSPixelRect { CSSPixelPoint { 0, 0 }, document->viewport_rect().size() };
|
||||
} else {
|
||||
VERIFY(intersection_root.has<JS::Handle<DOM::Element>>());
|
||||
auto element = intersection_root.get<JS::Handle<DOM::Element>>();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue