mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 12:05:15 +00:00
LibWeb: Plumb the full HtmlView viewport rect down into the engine
Previously we would use the "content rect" as the viewport rect, which could sometimes be smaller than the actual viewport rect as the content size was based on the box geometry of the root layout node. This fixes an issue on google.com where we would not render the main logo image since it was "outside" the viewport. The root layout size is currently very wrong on google.com but that's a separate issue. :^)
This commit is contained in:
parent
d3de2b7de5
commit
0d2beddc74
Notes:
sideshowbarker
2024-07-19 06:59:17 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/0d2beddc74e
1 changed files with 3 additions and 3 deletions
|
@ -124,7 +124,7 @@ void HtmlView::layout_and_sync_size()
|
|||
set_content_size(enclosing_int_rect(layout_root()->rect()).size());
|
||||
}
|
||||
|
||||
main_frame().set_viewport_rect(visible_content_rect());
|
||||
main_frame().set_viewport_rect(viewport_rect_in_content_coordinates());
|
||||
|
||||
#ifdef HTML_DEBUG
|
||||
dbgprintf("\033[33;1mLayout tree after layout:\033[0m\n");
|
||||
|
@ -162,7 +162,7 @@ void HtmlView::paint_event(GUI::PaintEvent& event)
|
|||
|
||||
RenderingContext context(painter, palette());
|
||||
context.set_should_show_line_box_borders(m_should_show_line_box_borders);
|
||||
context.set_viewport_rect(visible_content_rect());
|
||||
context.set_viewport_rect(viewport_rect_in_content_coordinates());
|
||||
layout_root()->render(context);
|
||||
}
|
||||
|
||||
|
@ -518,7 +518,7 @@ void HtmlView::dump_selection(const char* event_name)
|
|||
|
||||
void HtmlView::did_scroll()
|
||||
{
|
||||
main_frame().set_viewport_rect(visible_content_rect());
|
||||
main_frame().set_viewport_rect(viewport_rect_in_content_coordinates());
|
||||
}
|
||||
|
||||
Gfx::Point HtmlView::compute_mouse_event_offset(const Gfx::Point& event_position, const LayoutNode& layout_node) const
|
||||
|
|
Loading…
Add table
Reference in a new issue