LibWeb/CSS: Correct our scan media-feature

Despite what the spec suggests, modern displays are not progressive, and
WPT expects `@media (scan: progressive)` to fail. So, return `none`
here to accurately represent that.

I've left a FIXME in case we can detect the display type from the OS
somehow in the future.

Gets us 4 WPT subtest passes.
This commit is contained in:
Sam Atkins 2025-05-22 16:57:38 +01:00
parent 9fe8445946
commit 00617884a6
Notes: github-actions[bot] 2025-05-23 09:19:05 +00:00
2 changed files with 8 additions and 7 deletions

View file

@ -406,7 +406,8 @@ Optional<CSS::MediaFeatureValue> Window::query_media_feature(CSS::MediaFeatureID
case CSS::MediaFeatureID::Resolution:
return CSS::MediaFeatureValue(CSS::Resolution(device_pixel_ratio(), CSS::Resolution::Type::Dppx));
case CSS::MediaFeatureID::Scan:
return CSS::MediaFeatureValue(CSS::Keyword::Progressive);
// FIXME: Detect this from the display, if we can. Most displays aren't scanning and should return None.
return CSS::MediaFeatureValue(CSS::Keyword::None);
case CSS::MediaFeatureID::Scripting:
if (associated_document().is_scripting_enabled())
return CSS::MediaFeatureValue(CSS::Keyword::Enabled);