1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 18:18:12 +00:00

LibWeb+WebContent: Convert BrowsingContext to new pixel units

This fixes a few glitches. We no longer give the page double the width
it should have, and we mark the correct area of the page as needing
repainting.
This commit is contained in:
Sam Atkins 2022-11-03 12:49:54 +00:00 committed by Linus Groh
parent 8fb7c32ec3
commit affc8a22ca
23 changed files with 68 additions and 70 deletions

View file

@ -79,12 +79,12 @@ void PageHost::set_is_scripting_enabled(bool is_scripting_enabled)
page().set_is_scripting_enabled(is_scripting_enabled);
}
void PageHost::set_window_position(Gfx::IntPoint position)
void PageHost::set_window_position(Web::DevicePixelPoint position)
{
page().set_window_position(position);
}
void PageHost::set_window_size(Gfx::IntSize size)
void PageHost::set_window_size(Web::DevicePixelSize size)
{
page().set_window_size(size);
}
@ -125,9 +125,9 @@ void PageHost::paint(Web::DevicePixelRect const& content_rect, Gfx::Bitmap& targ
layout_root->paint_all_phases(context);
}
void PageHost::set_viewport_rect(Gfx::IntRect const& rect)
void PageHost::set_viewport_rect(Web::DevicePixelRect const& rect)
{
page().top_level_browsing_context().set_viewport_rect(rect);
page().top_level_browsing_context().set_viewport_rect(page().device_to_css_rect(rect));
}
void PageHost::page_did_invalidate(Web::CSSPixelRect const& content_rect)