Merge "Don't log for documentElement (nodeType 9)"

This commit is contained in:
jenkins-bot 2023-07-18 21:37:44 +00:00 committed by Gerrit Code Review
commit 5edfaad0f0
3 changed files with 6 additions and 5 deletions

Binary file not shown.

Binary file not shown.

View file

@ -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;