mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 21:29:06 +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:
parent
6361584d4a
commit
8dfeb67f8c
Notes:
sideshowbarker
2024-07-17 05:00:08 +09:00
Author: https://github.com/AtkinsSJ
Commit: 8dfeb67f8c
Pull-request: https://github.com/SerenityOS/serenity/pull/16382
9 changed files with 118 additions and 34 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue