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:
Andreas Kling 2019-12-18 20:54:23 +01:00
parent 85ac9705ba
commit 7e068565bc
Notes: sideshowbarker 2024-07-19 10:49:02 +09:00
4 changed files with 20 additions and 0 deletions

View file

@ -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());
}