1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 16:37:47 +00:00

LibWeb: Update Page to use navigables

This commit is contained in:
Aliaksandr Kalenik 2023-08-27 17:06:39 +02:00 committed by Andreas Kling
parent f91b34ef2e
commit ee50d9b2b5
9 changed files with 41 additions and 25 deletions

View file

@ -1012,7 +1012,7 @@ void Document::update_layout()
browsing_context()->set_needs_display();
if (browsing_context()->is_top_level() && browsing_context()->active_document() == this) {
if (navigable()->is_traversable()) {
if (auto* page = this->page())
page->client().page_did_layout();
}

View file

@ -49,6 +49,7 @@
#include <LibWeb/HTML/HTMLTextAreaElement.h>
#include <LibWeb/HTML/Numbers.h>
#include <LibWeb/HTML/Parser/HTMLParser.h>
#include <LibWeb/HTML/TraversableNavigable.h>
#include <LibWeb/HTML/Window.h>
#include <LibWeb/Infra/CharacterTypes.h>
#include <LibWeb/Infra/Strings.h>
@ -1514,8 +1515,9 @@ static ErrorOr<void> scroll_an_element_into_view(DOM::Element& element, Bindings
if (!layout_node)
return Error::from_string_view("Element has no parent layout node that is a box."sv);
if (element.document().browsing_context() == &page->top_level_browsing_context())
page->client().page_did_request_scroll_into_view(verify_cast<Layout::Box>(*layout_node).paintable_box()->absolute_padding_box_rect());
if (auto navigable = element.document().navigable()) {
element.document().navigable()->traversable_navigable()->page()->client().page_did_request_scroll_into_view(verify_cast<Layout::Box>(*layout_node).paintable_box()->absolute_padding_box_rect());
}
return {};
}