Open Bug 2071367 Opened 2 months ago Updated 2 months ago

Update FindNearestScroller() to take scroll axis into account for single-axis scroll container

Categories

(Core :: CSS Transitions and Animations, defect)

defect

Tracking

()

People

(Reporter: boris, Unassigned)

References

(Depends on 1 open bug, Blocks 1 open bug, )

Details

Per this spec issue, the spec updates the definition of non-scrollable values and its mapping:

The visible and clip values are known as the non-scrollable values. However, if the other axis specifies a scrollable value, a specified value of visible computes to auto, enabling scrolling in its axis. If neither axis computes to a scrollable value, the box is not a scroll container. If only one axis computes to a scrollable value (i.e. the other axis is clip), the box is a single-axis scroll container.

In other words, it's possible to have a scroller which is scrollable on only one axis. This has impact on scroll animations, e.g.

#scroller {
  ...
  overflowX: scroll;
  overflowY: clip;
}
#subject {
  animation: ...;
  animation-timeline: scroll(nearest block);
}
<div id=scroller>
  <div id=subject></div>
</div>

In this case, #scroller is scrollable on the inline axis, but not on the block axis, so the nearest scroller is not #scroller. Instead, it should be the root.

The wpt:

  1. scroll-timelines/scroll-timeline-source-single-axis-*.html
  2. view-timelines/view-timeline-source-single-axis-*.html

Also, this depends on the update of to_scrollable(), and maybe others related to scroll container frame.

Linking to the tracking issue for https://github.com/w3c/csswg-drafts/issues/12289 that I filed a while back.

Depends on: 1985144

(In reply to Botond Ballo [:botond] from comment #3)

Linking to the tracking issue for https://github.com/w3c/csswg-drafts/issues/12289 that I filed a while back.

Thanks. That's what we need.

You need to log in before you can comment on or make changes to this bug.