Re: [csswg-drafts] [scroll-animations-1] Something is odd with the handling of `source` in the ScrollTimeline constructor (#5202)

I guess the idea is that if the `ScrollTimelineOptions` may have a null source (which is the default value). And if that is given as input we resolve it to root scroller. So constructed timeline will never have a null source.

However thinking about this more, I wonder we should allow a three state in our handling
- Unspecified: Use default value as document scroller e.g., `new ScrollTimeline({source: null})`  
- Explicitly set to null:  set source to to null  e.g., `new ScrollTimeline({source: null}) `
- Explicitly set to element:  set source to element  e.g., `new ScrollTimeline({source: $div}) `


This is similar to how timeline is handler on `Animation` constructor.
I can make this change and clear up the wording mistake as well.


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

Received on Sunday, 14 June 2020 14:36:07 UTC