@@ -41,7 +41,9 @@ function hasCallableMethod(value, methodNames) {
4141 return false ;
4242 }
4343
44- return methodNames . some ( ( methodName ) => typeof value [ methodName ] === 'function' ) ;
44+ return methodNames . some (
45+ ( methodName ) => typeof value [ methodName ] === 'function' ,
46+ ) ;
4547}
4648
4749function createHighlightTrace ( ) {
@@ -147,9 +149,7 @@ function getClassTokens(el) {
147149 return Array . from ( el . classList )
148150 . filter (
149151 ( token ) =>
150- token . length > 1 &&
151- token . length <= 40 &&
152- / ^ [ a - z 0 - 9 _ - ] + $ / i. test ( token ) ,
152+ token . length > 1 && token . length <= 40 && / ^ [ a - z 0 - 9 _ - ] + $ / i. test ( token ) ,
153153 )
154154 . slice ( 0 , 8 ) ;
155155}
@@ -267,7 +267,10 @@ function getTabIndexValue(el) {
267267}
268268
269269function isDisabledForDetection ( el ) {
270- if ( el . hasAttribute ( 'disabled' ) || el . getAttribute ( 'aria-disabled' ) === 'true' ) {
270+ if (
271+ el . hasAttribute ( 'disabled' ) ||
272+ el . getAttribute ( 'aria-disabled' ) === 'true'
273+ ) {
271274 return true ;
272275 }
273276
@@ -322,7 +325,11 @@ function getControlAffinityScore(el) {
322325 score += Math . min ( 40 , text . length ) ;
323326 }
324327
325- if ( / \b ( b u t t o n | b t n | f i l t e r | f o l l o w | l i k e | r e f r e s h | r e l o a d | r e p l y | s e a r c h | s h a r e | s u b m i t | t o g g l e ) \b / i. test ( searchText ) ) {
328+ if (
329+ / \b ( b u t t o n | b t n | f i l t e r | f o l l o w | l i k e | r e f r e s h | r e l o a d | r e p l y | s e a r c h | s h a r e | s u b m i t | t o g g l e ) \b / i. test (
330+ searchText ,
331+ )
332+ ) {
326333 score += 12 ;
327334 }
328335
@@ -430,7 +437,10 @@ function getStructuralClickableSignal(el) {
430437 return null ;
431438 }
432439
433- if ( hasExplicitClickableAncestor ( el ) || hasStructuredInteractiveDescendant ( el ) ) {
440+ if (
441+ hasExplicitClickableAncestor ( el ) ||
442+ hasStructuredInteractiveDescendant ( el )
443+ ) {
434444 return null ;
435445 }
436446
@@ -760,7 +770,10 @@ function isHoverableCandidate(el) {
760770 return false ;
761771 }
762772
763- if ( hasExplicitClickableAncestor ( el ) || hasStructuredInteractiveDescendant ( el ) ) {
773+ if (
774+ hasExplicitClickableAncestor ( el ) ||
775+ hasStructuredInteractiveDescendant ( el )
776+ ) {
764777 return false ;
765778 }
766779
@@ -812,7 +825,8 @@ function hasHorizontalSwipeLayout(el) {
812825 overflowX . includes ( 'auto' ) ;
813826
814827 const visibleChildren = Array . from ( el . children ) . filter (
815- ( child ) => child instanceof HTMLElement && isElementVisibleForDetection ( child ) ,
828+ ( child ) =>
829+ child instanceof HTMLElement && isElementVisibleForDetection ( child ) ,
816830 ) ;
817831
818832 if ( visibleChildren . length === 0 ) {
@@ -831,14 +845,16 @@ function hasHorizontalSwipeLayout(el) {
831845 childStyle . display . includes ( 'flex' ) ||
832846 childStyle . whiteSpace === 'nowrap'
833847 ) ;
834- } ) || ( visibleChildren [ 0 ] instanceof HTMLElement ? visibleChildren [ 0 ] : null ) ;
848+ } ) ||
849+ ( visibleChildren [ 0 ] instanceof HTMLElement ? visibleChildren [ 0 ] : null ) ;
835850
836851 if ( ! ( primaryTrack instanceof HTMLElement ) ) {
837852 return false ;
838853 }
839854
840855 const trackChildren = Array . from ( primaryTrack . children ) . filter (
841- ( child ) => child instanceof HTMLElement && isElementVisibleForDetection ( child ) ,
856+ ( child ) =>
857+ child instanceof HTMLElement && isElementVisibleForDetection ( child ) ,
842858 ) ;
843859
844860 if ( trackChildren . length < 2 ) {
@@ -863,7 +879,10 @@ function hasHorizontalSwipeLayout(el) {
863879 if ( childRect . left > previousRect . left + 12 ) {
864880 horizontalSteps += 1 ;
865881 }
866- if ( Math . abs ( childRect . top - previousRect . top ) <= Math . max ( 24 , rect . height * 0.2 ) ) {
882+ if (
883+ Math . abs ( childRect . top - previousRect . top ) <=
884+ Math . max ( 24 , rect . height * 0.2 )
885+ ) {
867886 verticalAligned += 1 ;
868887 }
869888 }
@@ -949,7 +968,10 @@ function findSwipeContext(el, maxDepth = 4) {
949968 return current ;
950969 }
951970
952- if ( hasHorizontalSwipeLayout ( current ) && current . getBoundingClientRect ( ) . width >= 180 ) {
971+ if (
972+ hasHorizontalSwipeLayout ( current ) &&
973+ current . getBoundingClientRect ( ) . width >= 180
974+ ) {
953975 return current ;
954976 }
955977
@@ -1066,7 +1088,9 @@ function generateSelector(el) {
10661088
10671089function getCandidateSignal ( type , signalSource ) {
10681090 if ( type === 'clickable' ) {
1069- return HIGHLIGHT_SIGNAL_SCORE [ signalSource ] || HIGHLIGHT_SIGNAL_SCORE . pointer ;
1091+ return (
1092+ HIGHLIGHT_SIGNAL_SCORE [ signalSource ] || HIGHLIGHT_SIGNAL_SCORE . pointer
1093+ ) ;
10701094 }
10711095
10721096 return HIGHLIGHT_SIGNAL_SCORE [ type ] || 0 ;
@@ -1430,7 +1454,9 @@ function isRectInViewport(rect) {
14301454}
14311455
14321456function isMetricsTimeBudgetExceeded ( startTime ) {
1433- return performance . now ( ) - startTime >= layoutStabilityConfig . metricsTimeBudgetMs ;
1457+ return (
1458+ performance . now ( ) - startTime >= layoutStabilityConfig . metricsTimeBudgetMs
1459+ ) ;
14341460}
14351461
14361462function countPendingViewportImages ( metricsStartTime ) {
@@ -1568,11 +1594,12 @@ function getPageMetrics() {
15681594 const metricsStartTime = performance . now ( ) ;
15691595 const viewportText = collectViewportTextMetrics ( metricsStartTime ) ;
15701596 const viewportMedia = countViewportMedia ( metricsStartTime ) ;
1571- const placeholderSignals =
1572- countViewportPlaceholderSignals ( metricsStartTime ) ;
1597+ const placeholderSignals = countViewportPlaceholderSignals ( metricsStartTime ) ;
15731598
15741599 return {
1575- bodyHeight : document . body ? document . body . getBoundingClientRect ( ) . height : 0 ,
1600+ bodyHeight : document . body
1601+ ? document . body . getBoundingClientRect ( ) . height
1602+ : 0 ,
15761603 scrollHeight : document . documentElement
15771604 ? document . documentElement . scrollHeight
15781605 : 0 ,
0 commit comments