Skip to content

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

Closed

Description

@dbaron

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

Activity

  1. fantasai commented on Oct 10, 2022

    @fantasai
    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.

  2. dbaron commented on Oct 24, 2023

    @dbaron
    MemberAuthor

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

  3. added
    Commenter Satisfied
    and removed on Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Closed Accepted as EditorialClosed Rejected as OutOfScopeCommenter Satisfiedcss-values-4css-values-5

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      Sponsor
      SponsoredKunjungi sekarang
      Promo