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
commit affc8a22ca
Notes: sideshowbarker 2024-07-17 02:09:23 +09:00
23 changed files with 68 additions and 70 deletions

View file

@ -833,7 +833,7 @@ void Document::update_layout()
if (!browsing_context())
return;
auto viewport_rect = browsing_context()->viewport_rect();
auto viewport_rect = browsing_context()->viewport_rect().to_type<float>();
if (!m_layout_root) {
m_next_layout_node_serial_id = 0;
@ -1724,7 +1724,7 @@ void Document::run_the_resize_steps()
if (!browsing_context())
return;
auto viewport_size = browsing_context()->viewport_rect().size();
auto viewport_size = browsing_context()->viewport_rect().size().to_type<float>().to_type<int>();
if (m_last_viewport_size == viewport_size)
return;
m_last_viewport_size = viewport_size;