Skip to content

[cssom-view-1] Define HTMLElement.scrollParent - #12177

Merged
flackr merged 4 commits into
w3c:mainfrom
flackr:cssom-view-scroll-parent
May 22, 2025
Merged

[cssom-view-1] Define HTMLElement.scrollParent#12177
flackr merged 4 commits into
w3c:mainfrom
flackr:cssom-view-scroll-parent

Conversation

@flackr

@flackr flackr commented May 9, 2025

Copy link
Copy Markdown
Contributor

Define the scrollParent of an element following the discussion and resolution in #1522.

Define the scrollParent of an element following the discussion and resolution in w3c#1522.
@flackr
flackr requested a review from tabatkins May 20, 2025 13:47
@tabatkins

tabatkins commented May 20, 2025

Copy link
Copy Markdown
Member

Hm, it's slightly unfortunate that a null can mean either that the scroll parent is the root scroller, or that the scroll parent is hidden in a closed shadow. The former can still be responded to, by scrolling the root, the latter can't be, and I'm not sure there's an easy way to tell them apart.

Is that okay? Or do we want to be able to distinguish those cases?

Edit: Well I guess the third case is that it's a fixpos, which skips all the scrollers anyway and just attaches to the viewport, and thus isn't scrollable either. Hm.

@flackr

flackr commented May 20, 2025

Copy link
Copy Markdown
Contributor Author

The former can still be responded to, by scrolling the root, the latter can't be, and I'm not sure there's an easy way to tell them apart.

Right, I could see a good argument for skipping the hidden parent. WDYT of just having it keep walking up the containing block chain in that case? I think you're right that scrolling the next scroller up should still provide reasonable behavior. I've updated the steps accordingly. I think skipping the hidden ancestors is similar to offsetParent actually so this just seems generally better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants