flackr / scroll-timeline

A polyfill of ScrollTimeline.
Apache License 2.0
891 stars 84 forks source link

Handle explicitly undefined options argument in updateTimingHandler #197

Closed johannesodland closed 6 months ago

johannesodland commented 6 months ago

This is a follow up on #191.

Handle case where effect.updateTiming() is called with an explicit undefined options argument.

This happens in the view-timeline-subject-size-changes test.

After a discussion in #191 we skipped checking for an explicitly undefined options argument, and instead returned if the argumentList was undefined or empty. That does not cover the case where the method is called explicitly with undefined as an argument as below.

effect.updateTiming(undefined)
// argumentList == [undefined]
// arguementList.length == 1
johannesodland commented 6 months ago

@bramus I realized our changes in #191 doesn't handle the case where undefined is passed explicitly as an argument to updateTiming(), as it is done in the WPT subtest. Do you mind reviewing this PR?