Closed Bug 1479240 Opened 6 years ago Closed 6 years ago

Consider disallowing returning a null CSSValue from media expressions.

Categories

(Core :: CSS Parsing and Computation, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: emilio, Assigned: emilio)

References

Details

Attachments

(1 file, 2 obsolete files)

It's a bit footgunny, see bug 1479239.

There are only a few that use this with a reason to do so.
Looks like these used this mechanism for no great reason, and actually doing
this exposes trivially whether fingerprinting-resistance is enabled, which looks
like an anti-goal (if a media query parses correctly, and doesn't match either 1
or 0, then fingerprinting-resistance is enabled).
https://drafts.csswg.org/mediaqueries-4/#scan doesn't impose any requirement in
supporting the tv media type. Having this media feature without matching
anything is useless, we should either do this or remove it.
They have a good use-case for not returning a value and telling that's not a
match. That's fine since in eIdent media queries a value is required.

Actually this is just -moz-os-version, which is chrome-only, so we could
actually return a bogus 'other' value and make this a keyword media query, but
this looks a bit nicer.
(In reply to Emilio Cobos Álvarez (:emilio) from comment #3)
> Bug 1479240: Restrict this behavior to eIdent media features.

I think this commit message should be the opposite, i.e. we're restricting this behavior to all media features of types other than eIdent.
Comment on attachment 8995771 [details]
Bug 1479240: Make system metric queries always return false instead of not matching for fingerprinting-resistance. r=heycam

Cameron McCormack (:heycam) has approved the revision.

https://phabricator.services.mozilla.com/D2493
Attachment #8995771 - Flags: review+
Comment on attachment 8995773 [details]
Bug 1479240: Restrict this behavior to eIdent media features.

Cameron McCormack (:heycam) has approved the revision.

https://phabricator.services.mozilla.com/D2495
Attachment #8995773 - Flags: review+
I'll land only the first patch in this bug for now, since the third can't land without the second, and other browsers match our behavior in the second case.

I'll try to figure out a nicer interface to make this explicit rather than early-returning.
Pushed by emilio@crisal.io:
https://hg.mozilla.org/integration/mozilla-inbound/rev/89bdc7c5f654
Make system metric queries always return false instead of not matching for fingerprinting-resistance. r=heycam
https://hg.mozilla.org/mozilla-central/rev/89bdc7c5f654
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
Attachment #8995772 - Attachment is obsolete: true
Attachment #8995773 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: