When developers create scrolling containers that are only intended to scroll in one direction, they'll sometimes have content which slightly overflow in the other axis. Per the css-overflow-3 spec:
The visible/clip values of overflow compute to auto/hidden (respectively) if one of overflow-x or overflow-y is neither visible nor clip.
This seems to mean that even if you set the off axis overflow to clip it will still compute to hidden. While this is not a problem for user scrolling, overflow: hidden is still programmatically scrollable. Calls to scrollIntoView or anchor link scrolls can accidentally vertically scroll to your overflowing content. Worse yet, a user has no way to undo this after it happens.
This originally came up as a scroll-marker bug crbug.com/422733086 (Demo), however this problem can easily occur with existing content. E.g. consider this demo with "accidental" vertical scrolling when clicking on an item to scroll it into view: https://jsbin.com/voxohip/edit?html,css,js,output
Proposal: We should allow overflow clip in the off axis to make that axis not scrollable always at origin. E.g. overflow: auto clip; should allow creating a scroll container which cannot be scrolled vertically. We would still consider it to be a scroll container so long as one axis has a value of hidden | scroll | auto.
When developers create scrolling containers that are only intended to scroll in one direction, they'll sometimes have content which slightly overflow in the other axis. Per the css-overflow-3 spec:
This seems to mean that even if you set the off axis overflow to
clipit will still compute tohidden. While this is not a problem for user scrolling,overflow: hiddenis still programmatically scrollable. Calls to scrollIntoView or anchor link scrolls can accidentally vertically scroll to your overflowing content. Worse yet, a user has no way to undo this after it happens.This originally came up as a scroll-marker bug crbug.com/422733086 (Demo), however this problem can easily occur with existing content. E.g. consider this demo with "accidental" vertical scrolling when clicking on an item to scroll it into view: https://jsbin.com/voxohip/edit?html,css,js,output
Proposal: We should allow overflow
clipin the off axis to make that axis not scrollable always at origin. E.g.overflow: auto clip;should allow creating a scroll container which cannot be scrolled vertically. We would still consider it to be a scroll container so long as one axis has a value ofhidden | scroll | auto.