mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:17:35 +00:00
LibWeb: Change viewport ownership from BrowsingContext
to Navigable
This commit is contained in:
parent
4356d37b2c
commit
dd7bba66ed
23 changed files with 196 additions and 129 deletions
|
@ -962,7 +962,7 @@ void Document::update_layout()
|
|||
if (m_created_for_appropriate_template_contents)
|
||||
return;
|
||||
|
||||
if (!browsing_context())
|
||||
if (!navigable())
|
||||
return;
|
||||
|
||||
auto viewport_rect = this->viewport_rect();
|
||||
|
@ -1005,7 +1005,8 @@ void Document::update_layout()
|
|||
// Broadcast the current viewport rect to any new paintables, so they know whether they're visible or not.
|
||||
inform_all_viewport_clients_about_the_current_viewport_rect();
|
||||
|
||||
browsing_context()->set_needs_display();
|
||||
if (navigable())
|
||||
navigable()->set_needs_display();
|
||||
|
||||
if (navigable()->is_traversable()) {
|
||||
if (auto* page = this->page())
|
||||
|
@ -3034,8 +3035,8 @@ HTML::ListOfAvailableImages const& Document::list_of_available_images() const
|
|||
|
||||
CSSPixelRect Document::viewport_rect() const
|
||||
{
|
||||
if (auto* browsing_context = this->browsing_context())
|
||||
return browsing_context->viewport_rect();
|
||||
if (auto const navigable = this->navigable())
|
||||
return navigable->viewport_rect();
|
||||
return CSSPixelRect {};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue