From de6b866f22a8262c8c531e8fbace999563148aa2 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Tue, 21 Nov 2023 11:54:37 +0000 Subject: [PATCH] Fix detection of DOM properties Alternate fix for #7714 --- core/modules/utils/dom/dom.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/modules/utils/dom/dom.js b/core/modules/utils/dom/dom.js index 9c06fc8b0..338d96280 100644 --- a/core/modules/utils/dom/dom.js +++ b/core/modules/utils/dom/dom.js @@ -313,7 +313,7 @@ exports.collectDOMVariables = function(selectedNode,domNode,event) { variables["dom-" + attribute.name] = attribute.value.toString(); }); - if(selectedNode.offsetLeft) { + if("offsetLeft" in selectedNode) { // Add variables with a (relative and absolute) popup coordinate string for the selected node var nodeRect = { left: selectedNode.offsetLeft, @@ -338,12 +338,12 @@ exports.collectDOMVariables = function(selectedNode,domNode,event) { } } - if(domNode && domNode.offsetWidth) { + if(domNode && ("offsetWidth" in domNode)) { variables["tv-widgetnode-width"] = domNode.offsetWidth.toString(); variables["tv-widgetnode-height"] = domNode.offsetHeight.toString(); } - if(event && event.clientX && event.clientY) { + if(event && ("clientX" in event) && ("clientY" in event)) { if(selectedNode) { // Add variables for event X and Y position relative to selected node selectedNodeRect = selectedNode.getBoundingClientRect();