@@ -261,7 +261,7 @@ export const onINP = (
261
261
return intersectingLoAFs ;
262
262
} ;
263
263
264
- const attributeLoAFDetails = ( attribution : INPAttribution , value : number ) => {
264
+ const attributeLoAFDetails = ( attribution : INPAttribution ) => {
265
265
// If there is no LoAF data then nothing further to attribute
266
266
if ( ! attribution . longAnimationFrameEntries ?. length ) {
267
267
return ;
@@ -330,8 +330,7 @@ export const onINP = (
330
330
? lastLoAF . startTime + lastLoAF . duration
331
331
: 0 ;
332
332
if ( lastLoAFEndTime >= interactionTime + inputDelay + processingDuration ) {
333
- totalPaintDuration =
334
- attribution . interactionTime + value - lastLoAFEndTime ;
333
+ totalPaintDuration = attribution . nextPaintTime - lastLoAFEndTime ;
335
334
}
336
335
337
336
if ( longestScriptEntry && longestScriptSubpart ) {
@@ -345,7 +344,8 @@ export const onINP = (
345
344
attribution . totalStyleAndLayoutDuration = totalStyleAndLayoutDuration ;
346
345
attribution . totalPaintDuration = totalPaintDuration ;
347
346
attribution . totalUnattributedDuration =
348
- value -
347
+ interactionTime +
348
+ attribution . nextPaintTime -
349
349
totalScriptDuration -
350
350
totalStyleAndLayoutDuration -
351
351
totalPaintDuration ;
@@ -407,7 +407,7 @@ export const onINP = (
407
407
totalUnattributedDuration : undefined ,
408
408
} ;
409
409
410
- attributeLoAFDetails ( attribution , metric . value ) ;
410
+ attributeLoAFDetails ( attribution ) ;
411
411
412
412
// Use `Object.assign()` to ensure the original metric object is returned.
413
413
const metricWithAttribution : INPMetricWithAttribution = Object . assign (
0 commit comments