Description
Here is the current spec text related to an ancestor element's trapping behavior for snap areas.
A box captures snap positions if it is a scroll container or has a value other than none for scroll-snap-type. If a box’s nearest snap-position capturing ancestor on its containing block chain is a scroll container with a non-none value for scroll-snap-type, that is the box’s scroll snap container. Otherwise, the box has no scroll snap container, and its snap positions do not trigger snapping.
This allows any regular element which is not a scroll container to trap snap areas.
I tested this on latest Chrome, Safari, Firefox and as far as I can tell no engine does this. Here is a simple test page that shows this. Also I don't think we have a wpt test case for it.
Beside, one can simply achieve the same trapping behavior just by having an element with overflow auto
or hidden
that does not actually overflow. This works correctly across all engines.
Given that no engine implements this, and the behavior can be achieved without much problem, I suggest we drop this requirement.
I am not really sure what is the motivation behind allowing none scroll container to trap snap areas so maybe I am missing something.