summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/HTML
diff options
context:
space:
mode:
authorSam Atkins <atkinssj@serenityos.org>2022-11-25 17:07:19 +0000
committerLinus Groh <mail@linusgroh.de>2022-12-10 12:03:19 +0000
commit8dfeb67f8ceee2491615e11895f87e5172a7eae4 (patch)
treeb67f35e2a1c5051701e363abc354fab61e20104c /Userland/Libraries/LibWeb/HTML
parent6361584d4a92c351f4f66ddf7b7924beb11e55ae (diff)
downloadserenity-8dfeb67f8ceee2491615e11895f87e5172a7eae4.zip
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.
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML')
-rw-r--r--Userland/Libraries/LibWeb/HTML/Window.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/Window.cpp b/Userland/Libraries/LibWeb/HTML/Window.cpp
index 2314e854cd..f4d39a476a 100644
--- a/Userland/Libraries/LibWeb/HTML/Window.cpp
+++ b/Userland/Libraries/LibWeb/HTML/Window.cpp
@@ -673,12 +673,12 @@ Optional<CSS::MediaFeatureValue> Window::query_media_feature(CSS::MediaFeatureID
// FIXME: device-aspect-ratio
case CSS::MediaFeatureID::DeviceHeight:
if (auto* page = this->page()) {
- return CSS::MediaFeatureValue(CSS::Length::make_px(page->screen_rect().height()));
+ return CSS::MediaFeatureValue(CSS::Length::make_px(page->web_exposed_screen_area().height().value()));
}
return CSS::MediaFeatureValue(0);
case CSS::MediaFeatureID::DeviceWidth:
if (auto* page = this->page()) {
- return CSS::MediaFeatureValue(CSS::Length::make_px(page->screen_rect().width()));
+ return CSS::MediaFeatureValue(CSS::Length::make_px(page->web_exposed_screen_area().width().value()));
}
return CSS::MediaFeatureValue(0);
case CSS::MediaFeatureID::DisplayMode: