Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[scroll-animations-1] Timeline lookup should probably not use flat tree #8192

Closed
andruud opened this issue Dec 6, 2022 · 6 comments
Closed

Comments

@andruud
Copy link
Member

andruud commented Dec 6, 2022

It was strongly argued (by @tabatkins) that container queries should not look up the flat tree, to avoid the presence of a container inside the shadow to become an implicit part of the API contract. I don't see why scroll containers should be any different.

Should probably follow container queries and specify that we search shadow-including ancestors (inclusive).

@andruud andruud added the scroll-animations-1 Current Work label Dec 6, 2022
@fantasai
Copy link
Collaborator

fantasai commented Dec 7, 2022

While I 100% agree for container queries, I'm less convinced for this case. We're looking at the nearest scroll container because that's what determines whether you're visible!

I can easily imagine some kind of web-component that implements fancier scrolling behavior of some kind, that we wouldn't want to exclude here. Right?

@ydaniv
Copy link
Contributor

ydaniv commented Jan 24, 2023

I tend to agree with @fantasai on both perspectives. If we do restrict it we lose the ability described above.

The only case I can think of is perhaps if author expected to get an inactive timeline for a container inside the shadow but nearest continued to look up in the host.
For ScrollTimeline that can be mitigated with a named timeline.

ViewTimelines, however, always look for nearest scroll ancestor:

View progress timelines are segments of a scroll progress timeline that are scoped to the scroll positions in which any part of the associated element’s principal box intersects its nearest ancestor scrollport

IMO it should come down to whether we want to allow the author a way of scoping this case.

@andruud
Copy link
Member Author

andruud commented Feb 1, 2023

Fine to spec it as flat-tree ancestors, but currently the spec just says "nearest ancestor", which is ambiguous.

@atanassov atanassov added this to Overflow in March 2023 VF2F Mar 7, 2023
@astearns astearns moved this from Overflow to Monday - Mar 20 in March 2023 VF2F Mar 11, 2023
@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed [scroll-animations-1] Timeline lookup should probably not use flat tree, and agreed to the following:

  • RESOLVED: SLA does do flat-tree lookup for nearest ancestor scroller, spec will be clarified
The full IRC log of that discussion <fantasai> TabAtkins: My position on container queries doesn't apply here, I agree with fantasai
<fantasai> s/Topic/Subtopic/
<TabAtkins> ydaniv: AGreed, but one concern
<TabAtkins> ydaniv: "nearest" is taking your lookup - you might think youw ere inactive but end up in an active timeline
<TabAtkins> flackr: I think that's consistent with other scroller APIs, like stickypos
<TabAtkins> fantasai: So proposing to resolve we do use the flat tree to find nearest scroller
<TabAtkins> flackr: yup
<TabAtkins> astearns: so where the spec currently says "nearest ancestor" we make it explicit to be flat tree
<TabAtkins> RESOLVED: SLA does do flat-tree lookup for nearest ancestor scroller, spec will be clarified

@fantasai
Copy link
Collaborator

@andruud I shifted the note about using the flat tree from https://drafts.csswg.org/scroll-animations-1/#timeline-scope and generalized it into https://drafts.csswg.org/scroll-animations-1/#other-specs as

Like most operations in CSS besides selector matching, features in this specification operate over the flattened element tree.

Let me know if this works for you, or if you would like some other clarifications.

@andruud
Copy link
Member Author

andruud commented Mar 30, 2023

@fantasai Works for me, thank you. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
March 2023 VF2F
Monday - Mar 20
Development

No branches or pull requests

6 participants