Re: [csswg-drafts] [css-text-decor-4] Clarified constraints for thickness length and percentage #7283 (#7284)

@dbaron, after playing with this a bit, I think I have a better understanding of what _device pixels_ means.

When loading the following example on a highdpi (dsf=2) monitor, the blue and green lines have the same thickness (in Chrome Canary and Firefox), but the red line is thicker. This is because Chrome/Firefox draw the blue and green lines at (1.1 css pixels * dsf (2)) = 2 device pixels, whereas the red line draws at round(1.4 css pixels * dsf (2)) = 3 device pixels.
```
  <div style="position: absolute; top: 25px; left: 5px; width: 20px; height: 1px; background: blue;"></div>
  <span style="color: green; text-decoration: underline; text-decoration-thickness: 1.1px;">&nbsp;&nbsp;</span>
  <span style="color: red; text-decoration: underline; text-decoration-thickness: 1.4px;">&nbsp;&nbsp;</span>
```
Is this dsf behavior what is meant by _device pixels_? If so, I agree that referring to _device pixels_ makes sense. We would not want to round to css pixels (e.g., (round(1.4 css pixels) * dsf (2)) = 2 device pixels for the red line) because that would limit the granularity of the decoration thickness on highdpi monitors.

-- 
GitHub Notification of comment by progers
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/pull/7284#issuecomment-1131968160 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 19 May 2022 17:06:56 UTC