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

Return unresolved current time for unattached source #235

Merged
merged 1 commit into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/scroll-timeline-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ export class ScrollTimeline {
get currentTime() {
const unresolved = null;
const container = this.source;
if (!container) return unresolved;
if (!container || !container.isConnected) return unresolved;
if (this.phase == 'inactive')
return unresolved;
const scrollerStyle = getComputedStyle(container);
Expand Down
2 changes: 1 addition & 1 deletion test/expected.txt
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ PASS /scroll-animations/scroll-timelines/constructor.html 'y' is a valid axis va
PASS /scroll-animations/scroll-timelines/constructor.html Creating a ScrollTimeline with an invalid axis value should throw
PASS /scroll-animations/scroll-timelines/current-time-nan.html currentTime should be null for a display: inline source
PASS /scroll-animations/scroll-timelines/current-time-nan.html currentTime should be null for a display: none source
FAIL /scroll-animations/scroll-timelines/current-time-nan.html currentTime should be null for an unattached source
PASS /scroll-animations/scroll-timelines/current-time-nan.html currentTime should be null for an unattached source
PASS /scroll-animations/scroll-timelines/current-time-nan.html currentTime should be null when the source is not a scroller
PASS /scroll-animations/scroll-timelines/current-time-root-scroller.html currentTime calculates the correct time for a document.scrollingElement source
PASS /scroll-animations/scroll-timelines/current-time-writing-modes.html currentTime handles direction: rtl correctly
Expand Down
Loading