Re: [csswg-drafts] [cssom-view] Consider adding Element.scrollParent (#1522)

> This sounds like a cool feature but I'm curious about the use-cases as I've never come across a situation where I've needed this. Are there not any cases where there may be two parents in the hierarchy and you don't want the closest, but the one after it? Also, a more specific name would be better like `closestScrollParent` or similar. `scrollParent` is vague since there could be multiple "scrollParent"s technically (i.e. grandparents, great grandparents, etc 😁 )

You could make the same argument about Element.parentElement or Element.offsetParent. I think it's expected that you get the nearest parent.

> Perhaps scrollParent and scrollParents

To get a grandparent a developer can walk the parent chain, e.g.
`target.scrollingParent.scrollingParent`

I think what is scrollable should follow the definition of what is a scroll container which is determine from the overflow properties https://www.w3.org/TR/css-overflow-3/#overflow-control and is the scrolling parent that is referred to by things like `position: sticky;`.

-- 
GitHub Notification of comment by flackr
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1522#issuecomment-2590067385 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 14 January 2025 14:28:13 UTC