mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-22 15:44:45 +00:00
LibHTML: Push the visible viewport rect from HtmlView to Frame
This will allow various mechanisms and optimizations based on the currently visible viewport rect.
This commit is contained in:
@@ -95,6 +95,8 @@ void HtmlView::layout_and_sync_size()
|
||||
set_content_size(enclosing_int_rect(layout_root()->rect()).size());
|
||||
}
|
||||
|
||||
main_frame().set_viewport_rect(visible_content_rect());
|
||||
|
||||
#ifdef HTML_DEBUG
|
||||
dbgprintf("\033[33;1mLayout tree after layout:\033[0m\n");
|
||||
::dump_tree(*layout_root());
|
||||
@@ -381,3 +383,8 @@ void HtmlView::dump_selection(const char* event_name)
|
||||
<< layout_root()->selection().start().layout_node << ":" << layout_root()->selection().start().index_in_node << ", end: "
|
||||
<< layout_root()->selection().end().layout_node << ":" << layout_root()->selection().end().index_in_node;
|
||||
}
|
||||
|
||||
void HtmlView::did_scroll()
|
||||
{
|
||||
main_frame().set_viewport_rect(visible_content_rect());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user