Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-values] Should define the terms "device pixels" and "raster pixels" #7287

Closed
dbaron opened this issue May 19, 2022 · 2 comments
Closed
Labels
Closed Accepted as Editorial Closed Rejected as OutOfScope Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. css-values-4 Current Work css-values-5

Comments

@dbaron
Copy link
Member

dbaron commented May 19, 2022

A number of CSS specifications reference the concept of "device pixels" or "hardware pixels". See, for example, 6.2. Absolute Lengths: the cm, mm, Q, in, pt, pc, px units in css-values-4, or 5.1. Display Resolution: the resolution feature in mediaqueries-4 (which uses "hardware pixels" and "device pixels" interchangeably).

As far as I can tell, they do so without defining the term. I think a brief definition would be appropriate.

However, there are other concepts, particularly related to rasterization, such as the proposal in #3720 or the discussion in #7284 that want to discuss details of rasterization. Some of these discussions contain the assumption that rasterization happens at a scale of 1 pixel in the rasterization being equal to 1 device pixel. This is usually the case, but it isn't always. For example, in the presence of animated transforms the rendering is often rasterized once and then that rasterization is animated across a range of scales before rerasterization occurs. Or for transforms that are not a translation, device pixels and raster pixels might have different axes and different scales.

These two discussions that I mention seem like they would benefit from a definition of "raster pixels" that could be used when discussing issues of rounding of sizes or snapping to edges. (Though I admit I'm not entirely sure how such a definition should handle the case of non-translation transforms.)

@fantasai
Copy link
Collaborator

We added a definition for “device pixel”, but we're not convinced that a “raster pixel” definition belongs in Values and Units. It might be useful to define it where it's used, and if multiple specs end up using it, figure out where to factor it out. Let us know what you think.

@dbaron
Copy link
Member Author

dbaron commented Oct 24, 2023

That seems reasonable. I added "raster pixels" as an additional to-do item in #4965.

@dbaron dbaron added Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. and removed Commenter Response Pending labels Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closed Accepted as Editorial Closed Rejected as OutOfScope Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. css-values-4 Current Work css-values-5
Projects
None yet
Development

No branches or pull requests

3 participants