1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 04:58:13 +00:00

LibWeb: Support media queries with the resolution feature

The resolution is simply 1dppx * device pixel ratio.

This makes high resolution images show up on https://apple.com/
when running on a high-DPI display. :^)
This commit is contained in:
Andreas Kling 2023-08-25 18:07:11 +02:00
parent b63e393cef
commit da8692572a
3 changed files with 45 additions and 1 deletions

View file

@ -546,7 +546,8 @@ Optional<CSS::MediaFeatureValue> Window::query_media_feature(CSS::MediaFeatureID
case CSS::MediaFeatureID::PrefersReducedTransparency:
// FIXME: Make this a preference
return CSS::MediaFeatureValue(CSS::ValueID::NoPreference);
// FIXME: resolution
case CSS::MediaFeatureID::Resolution:
return CSS::MediaFeatureValue(CSS::Resolution(device_pixel_ratio(), CSS::Resolution::Type::Dppx));
case CSS::MediaFeatureID::Scan:
return CSS::MediaFeatureValue(CSS::ValueID::Progressive);
case CSS::MediaFeatureID::Scripting: