(In reply to Hamish Willee from comment #15) > When the scroller is set as `nearest` the spec says: > > > Specifies to use the nearest ancestor scroll container. (Default.)". > > Does this mean > 1. the nearest ancestor that _could_ be a scroll container (i.e. any div say), or > 2. the nearest ancestor that has scrollbars on _any_ axis. > 3. the nearest ancestor that has scrollbars in the specified axis? > > I THINK it probably means "2", and that if you have no axis on the selected ancestor then no timeline is created. Can you confirm? Yes. I think it's 2. Basically, if there is no scrollbars on the axis you specified (i.e. its scroll range is zero), we still create the ScrollTimline object but this timeline is inactive (i.e. its timeline time is unresolved): https://github.com/w3c/csswg-drafts/issues/7401 (Note: Gecko doesn't update the implementation per this resolved spec issue (which means we still treat zero scroll range as 100%), so perhaps you could check Chrome for this case as well). Gecko doesn't implement the WebIDL for ScrollTimeline, but Chrome does, so perhaps you can check the ScrollTimeline object in Chrome.
Bug 1737918 Comment 16 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
(In reply to Hamish Willee from comment #15) > When the scroller is set as `nearest` the spec says: > > > Specifies to use the nearest ancestor scroll container. (Default.)". > > Does this mean > 1. the nearest ancestor that _could_ be a scroll container (i.e. any div say), or > 2. the nearest ancestor that has scrollbars on _any_ axis. > 3. the nearest ancestor that has scrollbars in the specified axis? > > I THINK it probably means "2", and that if you have no axis on the selected ancestor then no timeline is created. Can you confirm? Yes. I think it's 2. Basically, if there is no scrollbars on the axis you specified (i.e. its scroll range is zero), we still create the ScrollTimline object but this timeline is inactive (i.e. its timeline time is unresolved): https://github.com/w3c/csswg-drafts/issues/7401 (Note: Gecko doesn't update the implementation per this resolved spec issue (which means we still treat zero scroll range as 100%), so perhaps you could check Chrome for this case as well). Besides, Gecko's implementation may have bug because we don't handle `overflow:auto` properly here. Gecko doesn't implement the WebIDL for ScrollTimeline, but Chrome does, so perhaps you can check the ScrollTimeline object in Chrome.