W3C home > Mailing lists > Public > www-style@w3.org > June 2015

[css-snappoints] Definition of "nearest ancestor" for scroll-snap-coordinate

From: Simon Fraser <simon.fraser@apple.com>
Date: Mon, 15 Jun 2015 12:29:56 -0700
Message-id: <8FED9906-B9DD-4F15-8495-46E0CA0C35DE@apple.com>
To: "www-style@w3.org list" <www-style@w3.org>
The Snap Points spec[1] says, for scroll-snap-coordinate:

> The scroll-snap-coordinate property is used to define the x and y coordinate within the element which will align with the nearest ancestor scroll container’s snap-destination for the respective axis.

The question is what “nearest ancestor” means here. Consider:

<div style="position: absolute;>
  <div style="overflow:scroll">
    <div style="position: absolute; scroll-snap-coordinate: 50% 50%"></div>

Here the inner <div> doesn’t actually scroll with the scroller, because it is positioned, with its containing block is outside the scroller. So it doesn’t make sense for "scroll-snap-coordinate” to cause snapping in that intermediate scroller.

So I think “nearest ancestor” needs to actually be worded in terms of containing blocks.


[1] http://dev.w3.org/csswg/css-snappoints/#scroll-snap-coordinate
Received on Monday, 15 June 2015 19:30:28 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:54 UTC