You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[css2?] Define when border rounding happens, and to which properties it applies #5210
Shipping Gecko and WebKit (my post was wrong, Blink and WebKit diverge, will fix) also floor to dev pixels at computed value time. Blink floors at rendering time, which I think is more unfortunate.
I came across this trying to fix css-backgrounds/animations/border-width-interpolation.html for WebKit. This test should be changed to not test values where this behavior is somewhat undefined, filed WPT issue #27934.
Browser: Rounding in layout / Rounding in computed style:
Firefox: Yes / Yes
WebKit before April 2016: Yes / No
WebKit after April 2016: Yes / Yes
Blink before April 2017: Yes / No
Blink after April 2017: No / No Possible future Blink change: Yes / Yes
The CSS Working Group just discussed [css2?] Define when border rounding happens, and to which properties it applies, and agreed to the following:
RESOLVED: Add this definition to values-4 and evaluate new definition against existing test suite.
The full IRC log of that discussion
<astearns> topic: [css2?] Define when border rounding happens, and to which properties it applies
<astearns> github: https://github.com//issues/5210
<fantasai> -> https://github.com//issues/5210#issuecomment-1292794138
<dandclark> dbaron: There have beeen differences in how border rounding works between impls.
<dandclark> dbaron: ??? landed change to make Chromium match webkit, gecko.
<dandclark> ...: we think border-rounding is interop now.
<dandclark> ...: given this, and that there's dependency on it which may increase, we should spec it.
<dandclark> ...: emilio opened this 2+ years ago, does he have anything to add?
<dandclark> emilio: <missed>
<dandclark> dbaron: In last comment I attempted to write definition in spec language. Other folks from other engines should look. If we're ok with it, lets move forward and try to spec it.
<fantasai> -> https://github.com//issues/5210
<dbaron> s/???/Traian/
<dandclark> emilio: I was misreading, I think that definition is correct.
<dandclark> astearns: This is matching existing tests?
<dandclark> dbaron: Yes there are various tests. I think there are a bunch of wpt tests for this behavior.
<dandclark> ...: I know when Trian was making chromium changes, making changes caused other engines to fail. Encouraged him to test only interoperable behavior.
<dbaron> s/other engines to fail/Chromium to fail some existing tests/
<astearns> ack fantasai
<dandclark> asterns: Proposed resolution: Add this definition to spec and evaluate new definition against existing test suite.
<dandclark> fantasai: Propose to add to values-4
<dandclark> dbaron: <missed> I don't strongly about which spec, I leave to editors.
<dandclark> asterns: Proposed resolution: Add this definition to values-4 and evaluate new definition against existing test suite.
<dandclark> RESOLVED: Add this definition to values-4 and evaluate new definition against existing test suite.
<dbaron> (and the issue should have links to the WPT PR)
@tabatkins Very nice! Thank you! Just 2 more things to mention:
1 - You might want to look at #7473 and #2114 to see if they are still relevant after this change.
2 - CSS Cascading and Inheritance says:
A used value is in principle ready to be used, but a user agent may not be able to make use of the value in a given environment. For example, a user agent may only be able to render borders with integer pixel widths and may therefore have to approximate the used width.
I think this needs a tweak since border widths are always integers now?
For 1, thanks, I've commented or closed, as appropriate.
For 2, not necessarily - there's nothing in CSS requiring that a px is an integer multiple of device pixels, so that statement can still be reasonable. ^_^
Activity
emilio commentedon Jun 14, 2020
Did some digging and Blink behavior is inherited from WebKit, but WebKit changed it to match Gecko in https://bugs.webkit.org/show_bug.cgi?id=156121.
emilio commentedon Jun 14, 2020
cc @mrego who was touching border rounding in Blink recently.
gsnedders commentedon Jul 9, 2020
On the whole this ties into the larger issue as to whether we should define rounding behaviour in CSS, which… we appear not to have an issue for?
graouts commentedon Mar 8, 2021
I came across this trying to fix
css-backgrounds/animations/border-width-interpolation.htmlfor WebKit. This test should be changed to not test values where this behavior is somewhat undefined, filed WPT issue #27934.How border-width values should be rounded in the computed style is an…
Ensure border-width interpolation test does not yield float values
Bug 1697034 [wpt PR 27934] - Ensure border-width interpolation test d…
wangxianzhu commentedon Jul 7, 2022
Blink diverged from WebKit more after https://codereview.chromium.org/2640143005 (support subpixel layout of borders, April 2017).
Browser: Rounding in layout / Rounding in computed style:
Firefox: Yes / Yes
WebKit before April 2016: Yes / No
WebKit after April 2016: Yes / Yes
Blink before April 2017: Yes / No
Blink after April 2017: No / No
Possible future Blink change: Yes / Yes
progers commentedon Sep 29, 2022
Chromium is attempting to unify on the behavior used by Gecko and WebKit:
blink-dev intent-to-ship: https://groups.google.com/a/chromium.org/g/blink-dev/c/0uq_S5p6uZg/m/ReHlihKaAwAJ
chromium bug: https://crbug.com/1201762
Snap Border and Outline Widths before Layout
Snap Border and Outline Widths before Layout
Snap Border and Outline Widths before Layout
19 remaining items
css-meeting-bot commentedon Nov 16, 2022
The CSS Working Group just discussed
[css2?] Define when border rounding happens, and to which properties it applies, and agreed to the following:RESOLVED: Add this definition to values-4 and evaluate new definition against existing test suite.The full IRC log of that discussion
<astearns> topic: [css2?] Define when border rounding happens, and to which properties it applies<astearns> github: https://github.com//issues/5210
<fantasai> -> https://github.com//issues/5210#issuecomment-1292794138
<dandclark> dbaron: There have beeen differences in how border rounding works between impls.
<dandclark> dbaron: ??? landed change to make Chromium match webkit, gecko.
<dandclark> ...: we think border-rounding is interop now.
<dandclark> ...: given this, and that there's dependency on it which may increase, we should spec it.
<dandclark> ...: emilio opened this 2+ years ago, does he have anything to add?
<dandclark> emilio: <missed>
<dandclark> dbaron: In last comment I attempted to write definition in spec language. Other folks from other engines should look. If we're ok with it, lets move forward and try to spec it.
<fantasai> -> https://github.com//issues/5210
<dbaron> s/???/Traian/
<dandclark> emilio: I was misreading, I think that definition is correct.
<dandclark> astearns: This is matching existing tests?
<dandclark> dbaron: Yes there are various tests. I think there are a bunch of wpt tests for this behavior.
<dandclark> ...: I know when Trian was making chromium changes, making changes caused other engines to fail. Encouraged him to test only interoperable behavior.
<dbaron> s/other engines to fail/Chromium to fail some existing tests/
<astearns> ack fantasai
<dandclark> asterns: Proposed resolution: Add this definition to spec and evaluate new definition against existing test suite.
<dandclark> fantasai: Propose to add to values-4
<dandclark> dbaron: <missed> I don't strongly about which spec, I leave to editors.
<dandclark> asterns: Proposed resolution: Add this definition to values-4 and evaluate new definition against existing test suite.
<dandclark> RESOLVED: Add this definition to values-4 and evaluate new definition against existing test suite.
<dbaron> (and the issue should have links to the WPT PR)
TKDev7 commentedon Feb 27, 2023
@emilio @dbaron @fantasai Would one of you guys do the edit? Or I'll try to open a PR.
[css-values-4][various] Define 'snapped as a border width', and invok…
tabatkins commentedon Feb 27, 2023
Done! Sorry, the resolution came in while I was on birthday vacation, so I missed it.
TKDev7 commentedon Feb 27, 2023
@tabatkins Very nice! Thank you! Just 2 more things to mention:
1 - You might want to look at #7473 and #2114 to see if they are still relevant after this change.
2 - CSS Cascading and Inheritance says:
I think this needs a tweak since border widths are always integers now?
tabatkins commentedon Feb 27, 2023
For 1, thanks, I've commented or closed, as appropriate.
For 2, not necessarily - there's nothing in CSS requiring that a px is an integer multiple of device pixels, so that statement can still be reasonable. ^_^
Bug 1697034 [wpt PR 27934] - Ensure border-width interpolation test d…