style: Don't reject negative values at parse time in media features

Clean-up some other test expectations while at it.

Differential Revision: https://phabricator.services.mozilla.com/D170677
This commit is contained in:
Emilio Cobos Álvarez 2023-02-26 00:15:24 +00:00 committed by Martin Robinson
parent 4ed0f518fb
commit d68bd45cc3
3 changed files with 9 additions and 9 deletions

View file

@ -126,18 +126,18 @@ fn eval_scan(_: &Context, _: Option<Scan>) -> bool {
}
/// https://drafts.csswg.org/mediaqueries-4/#color
fn eval_color(context: &Context) -> u32 {
fn eval_color(context: &Context) -> i32 {
unsafe { bindings::Gecko_MediaFeatures_GetColorDepth(context.device().document()) }
}
/// https://drafts.csswg.org/mediaqueries-4/#color-index
fn eval_color_index(_: &Context) -> u32 {
fn eval_color_index(_: &Context) -> i32 {
// We should return zero if the device does not use a color lookup table.
0
}
/// https://drafts.csswg.org/mediaqueries-4/#monochrome
fn eval_monochrome(context: &Context) -> u32 {
fn eval_monochrome(context: &Context) -> i32 {
// For color devices we should return 0.
unsafe { bindings::Gecko_MediaFeatures_GetMonochromeBitsPerPixel(context.device().document()) }
}