From ee5e93fbb53e3cf83ab74e7ffe0b6b0b61dc3253 Mon Sep 17 00:00:00 2001 From: ejn Date: Fri, 16 Jan 2015 10:53:05 +0100 Subject: [PATCH] Only traverse ancestors so long as they are elements In Firefox an error "does not implement interface Element" was being raised when the MouseWheel event was outside the map, due to the traverse up the tree winding up at the document element. This error was caught in the try-catch block and so did not bubble up to the user, but trying to use Firebug and stop on all errors then it caused some irritation. --- lib/OpenLayers/Handler/MouseWheel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OpenLayers/Handler/MouseWheel.js b/lib/OpenLayers/Handler/MouseWheel.js index 5167056de7..1f3ef19494 100644 --- a/lib/OpenLayers/Handler/MouseWheel.js +++ b/lib/OpenLayers/Handler/MouseWheel.js @@ -111,7 +111,7 @@ OpenLayers.Handler.MouseWheel = OpenLayers.Class(OpenLayers.Handler, { var overMapDiv = false; var elem = OpenLayers.Event.element(e); - while((elem != null) && !overMapDiv && !overScrollableDiv) { + while(elem && (elem.nodeType == 1) && !overMapDiv && !overScrollableDiv) { if (!overScrollableDiv) { try {