mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-05 08:31:51 +00:00
LibWeb/CSS: Implement device-aspect-ratio media feature
Gets us 8 WPT passes, and prevents a regression in the following commit.
This commit is contained in:
parent
b577302f07
commit
72f50217b0
Notes:
github-actions[bot]
2025-05-23 09:19:23 +00:00
Author: https://github.com/AtkinsSJ
Commit: 72f50217b0
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4817
2 changed files with 14 additions and 11 deletions
|
@ -323,7 +323,10 @@ Optional<CSS::MediaFeatureValue> Window::query_media_feature(CSS::MediaFeatureID
|
|||
return CSS::MediaFeatureValue(CSS::Keyword::Srgb);
|
||||
case CSS::MediaFeatureID::ColorIndex:
|
||||
return CSS::MediaFeatureValue(0);
|
||||
// FIXME: device-aspect-ratio
|
||||
case CSS::MediaFeatureID::DeviceAspectRatio: {
|
||||
auto screen_area = page().client().screen_rect();
|
||||
return CSS::MediaFeatureValue(CSS::Ratio(screen_area.width().value(), screen_area.height().value()));
|
||||
}
|
||||
case CSS::MediaFeatureID::DeviceHeight:
|
||||
return CSS::MediaFeatureValue(CSS::Length::make_px(page().web_exposed_screen_area().height()));
|
||||
case CSS::MediaFeatureID::DeviceWidth:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue