From bd66abba22393f553e880a2061bb095f36ead72f Mon Sep 17 00:00:00 2001 From: Jon Robson Date: Tue, 18 Jul 2023 13:33:13 -0700 Subject: [PATCH] Don't log for documentElement (nodeType 9) Follow up to Ia011aaf9f8b5b932695da3311f849682c0105cfe Bug: T340081 Change-Id: Ibff26eb90fd650532a7e23ac16232366676c0d15 --- resources/dist/index.js | Bin 47530 -> 47530 bytes resources/dist/index.js.map.json | Bin 215313 -> 215308 bytes src/index.js | 11 ++++++----- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/resources/dist/index.js b/resources/dist/index.js index 0b6d0fcf2677e53ad65503f9214399ab9814c325..531777a8089df99ab90215fba7d7b5655313f4c5 100644 GIT binary patch delta 62 zcmZ4WnQ7H$rVYwVnbg!Kt1VU1$WyenP03F#%}vcK(bUXL(@@N-smaqz&dD!MEiTcl SE=w#@DALKd-kiVGS_A;#$rkAV delta 62 zcmZ4WnQ7H$rVYwVnKd)hCaW%0Qdi8Ysmaqz&dD!MEiTclE=w#@DALKd&P>zDQ?#{B S$xklLP0cIO+?>DES_A<885e5+ diff --git a/resources/dist/index.js.map.json b/resources/dist/index.js.map.json index 22819519c2b50072d4026b573ad16d93579ca4f4..bc53c8b4c283b3ff47ad6233e61b466db3d85dec 100644 GIT binary patch delta 478 zcmXYrzfTi!7{>FqI7lci7z4zG5To%MDN$P_VffyA$Mt?R_N+i4v4f%XdbJi>YJ0bu zz#tCx)v!4DCm7Dy1>783s}vhzAnESF!o=$L)al9dym_AY^QIBmX+%E0Y7J=IDAL>3 z1stcnWof@D5^|BBS1_P>3U~v z)Du}u5GGtB6<__^i>)$Ct^4mg^DtOUcvxBxyAGXw??Q|Yexybn(?vl&pEn=f|5vGG z*|K7rbmQ>#<(#g&rXYGo`-g4F({}eBc(mW0g&JLS?}9_OkG8<|_l^buJpbV5FhG$y zy-9fPpZ9bKCcYF>|@W1|Qz$M#COsC1(8KLzPFO-w%>|_z92u~+q#$P+V o2*KvdOn*Dmhi0Z9`g~`1D-!;&TZ@FRG)IQQHZ*Syhkwuh0oMJi&;S4c delta 512 zcmXAl%WD%+6vjCTik7wuQA<~%WS5I+O_Q|6&Alg+*UZF>p&fK1mc~pnLLQ}gZ4?Au zSP^q5{txX&7)>_f&P8HsQcI8)vT)IjZgl0=J9Trud(ZuShwq-9_RO31%)6JpiwZZ> zEY8zSdfoG#f5_GQc9ITyb5DXoWl7FUSj;hnV;PYtO|(&yG*`oh`)Dp^Se7R(!Qw5f zVH3;3g|<*zHki`FDh5PEo+PQbbuFYYm2;ixE+lORk6L1T-DS(DubiPqAt(Ek?q7fk znfH=9w?N$&7f-*&W1S%1*Sfv?k|Tbb2s? zCF*?5%v)L$W#(93yBqp%*~+ndNw^;z2J|FquvGemN1s;El!sA^CIfL;ZfP(Ys zdmGLLGKs}389SG$aNP3vkxq}-VTEp=+<>t2;N-6ds?W^H3v&WpbK>dT?0%f~TJY98 N?cM8MpY{G){Rb)6v#9_8 diff --git a/src/index.js b/src/index.js index 30bfc4ad0..1d7e375ed 100644 --- a/src/index.js +++ b/src/index.js @@ -145,6 +145,12 @@ function handleDOMEventIfEligible( handler ) { target = target.parentNode; } + // If the event bubbles up all the way, + // document does not have closest method, so exit early (T336650). + if ( target === document ) { + return; + } + // If the closest method is not defined, let's return early and // understand this better by logging an error. (T340081) if ( target && !target.closest ) { @@ -153,11 +159,6 @@ function handleDOMEventIfEligible( handler ) { return; } - // If the event bubbles up all the way, - // document does not have closest method, so exit early (T336650). - if ( target === document ) { - return; - } target = findNearestEligibleTarget( target ); if ( target === null ) { return;