mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibWeb: Support device-height and device-width media query values
This commit is contained in:
committed by
Sam Atkins
parent
52a5da51bf
commit
7f527ddde3
Notes:
sideshowbarker
2024-07-17 05:01:20 +09:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/SerenityOS/serenity/commit/7f527ddde3 Pull-request: https://github.com/SerenityOS/serenity/pull/15898 Reviewed-by: https://github.com/AtkinsSJ ✅
@@ -367,8 +367,16 @@ Optional<CSS::MediaFeatureValue> Window::query_media_feature(CSS::MediaFeatureID
|
||||
case CSS::MediaFeatureID::ColorIndex:
|
||||
return CSS::MediaFeatureValue(0);
|
||||
// FIXME: device-aspect-ratio
|
||||
// FIXME: device-height
|
||||
// FIXME: device-width
|
||||
case CSS::MediaFeatureID::DeviceHeight:
|
||||
if (auto* page = this->page()) {
|
||||
return CSS::MediaFeatureValue(CSS::Length::make_px(page->screen_rect().height()));
|
||||
}
|
||||
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(0);
|
||||
case CSS::MediaFeatureID::DisplayMode:
|
||||
// FIXME: Detect if window is fullscreen
|
||||
return CSS::MediaFeatureValue(CSS::ValueID::Browser);
|
||||
|
||||
Reference in New Issue
Block a user