Skip to content

Commit 656ed68

Browse files
Return unresolved current time for unattached source
1 parent 38d149a commit 656ed68

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/scroll-timeline-base.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ export class ScrollTimeline {
457457
get currentTime() {
458458
const unresolved = null;
459459
const container = this.source;
460-
if (!container) return unresolved;
460+
if (!container || !container.isConnected) return unresolved;
461461
if (this.phase == 'inactive')
462462
return unresolved;
463463
const scrollerStyle = getComputedStyle(container);

test/expected.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ PASS /scroll-animations/scroll-timelines/constructor.html 'y' is a valid axis va
690690
PASS /scroll-animations/scroll-timelines/constructor.html Creating a ScrollTimeline with an invalid axis value should throw
691691
PASS /scroll-animations/scroll-timelines/current-time-nan.html currentTime should be null for a display: inline source
692692
PASS /scroll-animations/scroll-timelines/current-time-nan.html currentTime should be null for a display: none source
693-
FAIL /scroll-animations/scroll-timelines/current-time-nan.html currentTime should be null for an unattached source
693+
PASS /scroll-animations/scroll-timelines/current-time-nan.html currentTime should be null for an unattached source
694694
PASS /scroll-animations/scroll-timelines/current-time-nan.html currentTime should be null when the source is not a scroller
695695
PASS /scroll-animations/scroll-timelines/current-time-root-scroller.html currentTime calculates the correct time for a document.scrollingElement source
696696
PASS /scroll-animations/scroll-timelines/current-time-writing-modes.html currentTime handles direction: rtl correctly

0 commit comments

Comments
 (0)