mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-08 04:02:52 +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:
parent
85ac9705ba
commit
7e068565bc
Notes:
sideshowbarker
2024-07-19 10:49:02 +09:00
Author: https://github.com/awesomekling
Commit: 7e068565bc
4 changed files with 20 additions and 0 deletions
|
@ -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());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue