Skip to content

Update mentions of 'scroll container' to refer to scrollable axises when appropriate. #12289#13903

Draft
tabatkins wants to merge 9 commits into
mainfrom
scroll-axis
Draft

Update mentions of 'scroll container' to refer to scrollable axises when appropriate. #12289#13903
tabatkins wants to merge 9 commits into
mainfrom
scroll-axis

Conversation

@tabatkins
Copy link
Copy Markdown
Member

@tabatkins tabatkins commented May 8, 2026

WIP

Specs which mention scroll container:

  • css-2024: n/a
  • css-2025: n/a
  • css-2026: n/a
  • css-align-3: mixed references; some care about the scroll axis, others don't
  • css-anchor-position-1: always cares about the scroll axises
  • css-backgrounds-3: only background-attachment:local, doesn't care about axises
  • css-backgrounds-4: ditto
  • css-conditional-5: scroller CQs only establish CQ containers for their scrollable axises
  • css-display-3: doesn't care about axis
  • css-display-4: ditto
  • css-flexbox-1: minimum content size cares that the main axis is scrollable
  • css-flexbox-2: ditto
  • css-grid-1: n/a
  • css-grid-2: n/a
  • css-multicol-2: n/a
  • css-nav-1: a few bits care about whether you can scroll in a direction; these are now axis-aware
  • css-overflow-3: edits are already committed
  • css-overflow-4: scrollbar mentions, implicitly already about axises
  • css-overflow-5: TODO: hmm, unsure about scroll markers
  • css-overscroll-1: Only chain to scrollers that are scrollable in that axis.
  • css-position-3: stickypos cares about axises
  • css-position-4: n/a
  • css-scroll-anchoring-1: i don't think i need to do anything here? the algos look okay as they are, i think
  • css-scroll-snap-1: TODO: leaving alone until the WG decides if snapping on different boxes should happen or not
  • css-scroll-snap-2: same
  • css-scrollbars-1: n/a
  • css-sizing-4: auto min size, and min-intrinsic-size, care about axises, since they care about scrollability in that axis to reach something
  • css-ui-3: not touching, RECish
  • css-ui-4: resize doesn't care about axis
  • css-writing-modes-4: just a note mention
  • cssom-view-1: adjusted "potentially scrollable" to be axis aware, so scrollLeft/Top will care properly about scroll axis on body
  • scroll-animations-1: all the timelines care about axis

Copy link
Copy Markdown
Contributor

@flackr flackr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this looks good, just wanted to get clarification on a couple things.

Comment thread css-align-3/Overview.bs

The default [=overflow alignment=] behavior
for [=content distribution=] on [=scroll containers=] is ''unsafe''.
In a [=scrollable axis=] of a [=scroll container=],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this mean? I see that overflow-position is only a single value (i.e. single axis) property and other references have been updated to refer to the block axis but this one seems like it cares about both axes? Is the default overflow-position now per axis but can only be specified for both axes? Just trying to confirm what changes we need to make.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can do content-distribution in either axis via justify-content and align-content, and specify overflow safety in either axis. The existing spec gives different default behavior based on whether the container is scrollable or not (scrollables default to 'unsafe' because you can just scroll to see the overflow, generally). Now, tho, single-axis scroll containers only want to apply that default in their scrollable axis.

(The other updates are block-only because they're talking about things like baselines.)

Comment thread cssom-view-1/Overview.bs
1. If the element is the [=root element=] and <var>document</var> is in <a>quirks mode</a>, return zero and terminate these steps.
1. If the element is the [=root element=] return the value of {{Window/scrollY}} on <var>window</var>.
1. If the element is <a>the <code>body</code> element</a>, <var>document</var> is in <a>quirks mode</a>, and the element is not <a>potentially scrollable</a>, return the value of {{Window/scrollY}} on <var>window</var>.
1. If the element is <a>the <code>body</code> element</a>, <var>document</var> is in <a>quirks mode</a>, and the element is not <a>potentially scrollable</a> in the y axis, return the value of {{Window/scrollY}} on <var>window</var>.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be fine, but it's very quirky 🥁 that body.scrollTop and body.scrollLeft may refer to different scroll containers in quirks mode. I wonder if this is necessary or if we could just consider whether it is a scroll container in either axis for both.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with either. This is indeed just a quirks mode thing, so probably not important to care about. I'll go ahead and revert it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose a followup question is what to do with the setters for scrollTop/Left when the body isn't a scroller in that axis.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Presumably the same as trying to scroll any non-scrollable element. The setters and methods exist, but don't do any scrolling.

Comment thread css-overscroll-1/Overview.bs Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants