@@ -68,15 +68,15 @@ describe("scroll() rangeStart/rangeEnd", () => {
6868 } )
6969
7070 /**
71- * 25%–50% of the scroll range is 500–1000px.
71+ * Progress 0.25–0.5 of the scroll range is 500–1000px.
7272 */
7373 test ( "Maps the range onto the animation and holds either side of it" , async ( ) => {
7474 const box = document . createElement ( "div" )
7575 document . body . appendChild ( box )
7676
7777 const stop = scroll (
7878 animate ( box , { opacity : [ 0 , 1 ] , x : [ 0 , 100 ] } , transition ) ,
79- { rangeStart : "25%" , rangeEnd : "50%" }
79+ { rangeStart : 0.25 , rangeEnd : 0.5 }
8080 )
8181
8282 const expectProgress = ( opacity : string , transform : string ) => {
@@ -109,7 +109,7 @@ describe("scroll() rangeStart/rangeEnd", () => {
109109 box . remove ( )
110110 } )
111111
112- test ( "Accepts fractions, and a range with only one end" , async ( ) => {
112+ test ( "Accepts a range with only one end" , async ( ) => {
113113 const start = document . createElement ( "div" )
114114 const end = document . createElement ( "div" )
115115 document . body . append ( start , end )
@@ -139,12 +139,12 @@ describe("scroll() rangeStart/rangeEnd", () => {
139139 } )
140140
141141 /**
142- * With a target, native ViewTimeline resolves a plain percentage against
143- * the timeline's cover range, so the JS path must too.
142+ * With a target, native ViewTimeline resolves a range against its cover
143+ * range, so the JS path must too.
144144 *
145145 * Target top = 1500, height = 500, viewport = 1000:
146146 * cover 0% = scroll 500, cover 100% = scroll 2000.
147- * rangeStart "0%" → 500, rangeEnd "50%" → 1250.
147+ * rangeStart 0 → 500, rangeEnd 0.5 → 1250.
148148 */
149149 test ( "With a target, the range is relative to the target's cover range" , async ( ) => {
150150 const target = document . createElement ( "div" )
@@ -154,15 +154,15 @@ describe("scroll() rangeStart/rangeEnd", () => {
154154
155155 const stop = scroll ( animate ( target , { opacity : [ 0 , 1 ] } , transition ) , {
156156 target,
157- rangeStart : "0%" ,
158- rangeEnd : "50%" ,
157+ rangeStart : 0 ,
158+ rangeEnd : 0.5 ,
159159 } )
160160
161161 // Before the target enters the viewport.
162162 await fireScroll ( 200 )
163163 expect ( target . style . opacity ) . toBe ( "0" )
164164
165- // Cover 25% is halfway through the 0%–50% range.
165+ // Cover 25% is halfway through the 0–0.5 range.
166166 await fireScroll ( 875 )
167167 expect ( target . style . opacity ) . toBe ( "0.5" )
168168
@@ -185,7 +185,7 @@ describe("scroll() rangeStart/rangeEnd", () => {
185185 const held = document . createElement ( "div" )
186186 document . body . append ( inRange , held )
187187
188- const range = { rangeStart : "0%" , rangeEnd : "50%" } as const
188+ const range = { rangeStart : 0 , rangeEnd : 0.5 }
189189 const stopInRange = scroll (
190190 animate ( inRange , { opacity : [ 0 , 1 ] } , transition ) ,
191191 range
0 commit comments