Implement "prefers-color-scheme" as a user preference. #1752

Closed
opened 1 year ago by athenian200 · 1 comments
Collaborator

The tests and spec are here:

https://wpt.live/css/mediaqueries/prefers-color-scheme.html

https://www.w3.org/TR/mediaqueries-5/#prefers-color-scheme

One thing to note is that the implementation is not supposed to respond to "no-preference" or "none" at all because those were removed from the spec. The "light" theme now appears to be the default you should report according to spec if the user doesn't express a preference.

However, the spec could expand in the future, and we should retain the option of acting like this feature isn't implemented at all in case someone wants to see a website's fallback code for browsers that don't implement this, or else sees reporting a preference at all a security risk.

At this point, though, the feature is so ubiquitous in browsers that not reporting an arbitrary preference for a light theme actually fingerprints your browser as either an older one or a browser that deliberately lacks the feature.

The tests and spec are here: https://wpt.live/css/mediaqueries/prefers-color-scheme.html https://www.w3.org/TR/mediaqueries-5/#prefers-color-scheme One thing to note is that the implementation is not supposed to respond to "no-preference" or "none" at all because those were removed from the spec. The "light" theme now appears to be the default you should report according to spec if the user doesn't express a preference. However, the spec could expand in the future, and we should retain the option of acting like this feature isn't implemented at all in case someone wants to see a website's fallback code for browsers that don't implement this, or else sees reporting a preference at all a security risk. At this point, though, the feature is so ubiquitous in browsers that *not* reporting an arbitrary preference for a light theme actually fingerprints your browser as either an older one or a browser that deliberately lacks the feature.
Poster
Collaborator

Here is my PR for the feature, I think I got everything but I would still need someone who understands the media query code to look over it just to be safe.

#1753

Here is my PR for the feature, I think I got everything but I would still need someone who understands the media query code to look over it just to be safe. https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1753
Moonchild closed this issue 1 year ago
Moonchild added the
Fixed
label 1 year ago
athenian200 was assigned by Moonchild 1 year ago
Moonchild added this to the 29.2.0 milestone 1 year ago
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: MoonchildProductions/UXP#1752
Loading…
There is no content yet.