1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-09 09:34:57 +09:00

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);

View file

@ -2,8 +2,8 @@ Harness status: OK
Found 1345 tests
1265 Pass
80 Fail
1269 Pass
76 Fail
Pass query_should_be_parseable: (orientation)
Pass query_should_be_parseable: not (orientation)
Pass expression_should_be_known: (orientation)
@ -1211,11 +1211,11 @@ Pass expression_should_be_parseable: max-scan
Pass expression_should_be_unknown: max-scan
Pass expression_should_be_parseable: max-scan: progressive
Pass expression_should_be_unknown: max-scan: progressive
Fail should_not_apply: (scan)
Fail should_not_apply: (scan: progressive)
Pass should_not_apply: (scan)
Pass should_not_apply: (scan: progressive)
Pass should_not_apply: (scan: interlace)
Fail should_apply: not all and (scan)
Fail should_apply: not all and (scan: progressive)
Pass should_apply: not all and (scan)
Pass should_apply: not all and (scan: progressive)
Pass should_apply: not all and (scan: interlace)
Pass expression_should_be_known: grid
Pass expression_should_be_known: grid: 0