Skip to content

Commit

Permalink
Return unresolved current time for unattached source (#235)
Browse files Browse the repository at this point in the history
  • Loading branch information
johannesodland authored Feb 8, 2024
1 parent 38d149a commit 8014acf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
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

0 comments on commit 8014acf

Please sign in to comment.