From ce9604c4ff42359752efb4b908d2467a265c1f63 Mon Sep 17 00:00:00 2001
From: nod_ <nod_@598310.no-reply.drupal.org>
Date: Sat, 10 Feb 2024 15:23:21 +0100
Subject: [PATCH] Issue #3420499 by catch: [jQuery 4] position.js uses
 deprecated function $.isWindow()

---
 core/misc/position.js | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/core/misc/position.js b/core/misc/position.js
index c752d63e9c8b..8c84df67710a 100644
--- a/core/misc/position.js
+++ b/core/misc/position.js
@@ -54,7 +54,7 @@
         offset: { top: 0, left: 0 },
       };
     }
-    if ($.isWindow(raw)) {
+    if (!!raw && raw === raw.window) {
       return {
         width: elem.width(),
         height: elem.height(),
@@ -346,7 +346,8 @@
     },
     getWithinInfo(element) {
       const withinElement = $(element || window);
-      const isWindow = $.isWindow(withinElement[0]);
+      const isWindow =
+        !!withinElement[0] && withinElement[0] === withinElement[0].window;
       const isDocument = !!withinElement[0] && withinElement[0].nodeType === 9;
       const hasOffset = !isWindow && !isDocument;
       return {
-- 
GitLab