Skip to content
Closed
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
12 changes: 10 additions & 2 deletions src/proxy-animation.js
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,11 @@ function autoAlignStartTime(details) {
// 5. Let start offset be the resolved timeline time corresponding to the start of the animation attachment range.
// In the case of view timelines, it requires a calculation based on the proportion of the cover range.
try {
startOffset = CSS.percent(fractionalStartDelay(details) * 100);
const startDelayFraction = fractionalStartDelay(details);
if (startDelayFraction === null)
return;

startOffset = CSS.percent(startDelayFraction * 100);
} catch {
// TODO: Validate supported values for range start, to avoid exceptions when resolving the values.

Expand All @@ -901,7 +905,11 @@ function autoAlignStartTime(details) {
// 6. Let end offset be the resolved timeline time corresponding to the end of the animation attachment range.
// In the case of view timelines, it requires a calculation based on the proportion of the cover range.
try {
endOffset = CSS.percent((1 - fractionalEndDelay(details)) * 100);
const endDelayFraction = fractionalEndDelay(details);
if (endDelayFraction === null)
return;

endOffset = CSS.percent((1 - endDelayFraction) * 100);
} catch {
// TODO: Validate supported values for range end, to avoid exceptions when resolving the values.

Expand Down
5 changes: 4 additions & 1 deletion src/scroll-timeline-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,9 @@ export function range(timeline, phase) {
if (!(timeline instanceof ViewTimeline))
return unresolved;

if (!sourceMeasurements || !subjectMeasurements)
return unresolved;

return calculateRange(phase, sourceMeasurements, subjectMeasurements, details.axis, details.inset);
}

Expand Down Expand Up @@ -810,7 +813,7 @@ export function fractionalOffset(timeline, value) {

export function calculateRelativePosition(phaseRange, offset, coverRange, subject) {
if (!phaseRange || !coverRange)
return 0;
return null;

let style = getComputedStyle(subject)
const info = {
Expand Down