1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 05:27:43 +00:00

LibWeb+WebContent+headless-browser: Make Page aware of the display scale

For now, we just report it as "1" everywhere.

Replaced `screen_rect()` with `web_exposed_screen_area()` from the spec.
This commit is contained in:
Sam Atkins 2022-11-25 17:07:19 +00:00 committed by Linus Groh
parent 6361584d4a
commit 8dfeb67f8c
9 changed files with 118 additions and 34 deletions

View file

@ -33,7 +33,13 @@ void Screen::visit_edges(Cell::Visitor& visitor)
Gfx::IntRect Screen::screen_rect() const
{
return window().page()->screen_rect();
auto screen_rect_in_css_pixels = window().page()->web_exposed_screen_area();
return {
screen_rect_in_css_pixels.x().value(),
screen_rect_in_css_pixels.y().value(),
screen_rect_in_css_pixels.width().value(),
screen_rect_in_css_pixels.height().value()
};
}
}