[csswg-drafts] [css-border][css-viewport] Consider moving border-width pixel snapping from computed value to used value (#13350)

weinig has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-border][css-viewport] Consider moving border-width pixel snapping from computed value to used value ==
Currently, the computed value for [`border-width`](https://drafts.csswg.org/css-borders-4/#typedef-line-width) properties is defined to "absolute length, [snapped as a border width](https://www.w3.org/TR/css-values-4/#snap-a-length-as-a-border-width)". 

This has an unfortunate interaction with the [`zoom`](https://drafts.csswg.org/css-viewport/#zoom-property) property, where pixel snapping will not be preserved for most values of [`zoom`](https://drafts.csswg.org/css-viewport/#zoom-property) (as [`zoom`](https://drafts.csswg.org/css-viewport/#zoom-property) is applied after computed value).

If instead, we move the application of "[snapped as a border width](https://www.w3.org/TR/css-values-4/#snap-a-length-as-a-border-width)" to the used value, I believe this would be resolved.

I say I think, because I am not exactly sure when [`zoom`](https://drafts.csswg.org/css-viewport/#zoom-property) gets applied, the spec [says](https://drafts.csswg.org/css-viewport/#zoom-property):
> "the [used value](https://drafts.csswg.org/css-cascade-5/#used-value) of a CSS property (including values inside of [path()](https://drafts.csswg.org/css-shapes-1/#funcdef-basic-shape-path) strings) is pre-multiplied (before any other steps in the used value stage) by the used value of [zoom](https://drafts.csswg.org/css-viewport/#propdef-zoom) for the element". 

The goal here would be for the order to be 
1. Apply [`zoom`](https://drafts.csswg.org/css-viewport/#zoom-property) 
2. Apply "[snapped as a border width](https://www.w3.org/TR/css-values-4/#snap-a-length-as-a-border-width)".

The only other user visible change here would be when explicitly inheriting border-widths by a child with a different [`zoom`](https://drafts.csswg.org/css-viewport/#zoom-property) value, as the non-pixel snapped value will now be inherited, which I think would be preferable anyway.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/13350 using your GitHub account


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

Received on Wednesday, 14 January 2026 17:40:07 UTC