diff --git a/src/components/fx/hover.js b/src/components/fx/hover.js index 61796f0eb04..0da92d4a893 100644 --- a/src/components/fx/hover.js +++ b/src/components/fx/hover.js @@ -279,11 +279,9 @@ function _hover(gd, evt, subplot, noHoverEvent) { if(hasUserCalledHover) { if('xpx' in evt) xpx = evt.xpx; else xpx = xaArray[0]._length / 2; - evt.pointerX = xpx + xaArray[0]._offset; if('ypx' in evt) ypx = evt.ypx; else ypx = yaArray[0]._length / 2; - evt.pointerY = ypx + yaArray[0]._offset; } else { // fire the beforehover event and quit if it returns false @@ -300,13 +298,14 @@ function _hover(gd, evt, subplot, noHoverEvent) { // in case hover was called from mouseout into hovertext, // it's possible you're not actually over the plot anymore - if(xpx < 0 || xpx > dbb.width || ypx < 0 || ypx > dbb.height) { + if(xpx < 0 || xpx > xaArray[0]._length || ypx < 0 || ypx > yaArray[0]._length) { return dragElement.unhoverRaw(gd, evt); } - evt.pointerX = evt.offsetX; - evt.pointerY = evt.offsetY; } + evt.pointerX = xpx + xaArray[0]._offset; + evt.pointerY = ypx + yaArray[0]._offset; + if('xval' in evt) xvalArray = helpers.flat(subplots, evt.xval); else xvalArray = helpers.p2c(xaArray, xpx); diff --git a/tasks/test_syntax.js b/tasks/test_syntax.js index bb94efc3faa..31c2d55b34b 100644 --- a/tasks/test_syntax.js +++ b/tasks/test_syntax.js @@ -73,6 +73,9 @@ function assertSrcContents() { // Forbidden in IE in any context var IE_BLACK_LIST = ['classList']; + // not implemented in FF, or inconsistent with others + var FF_BLACK_LIST = ['offsetX', 'offsetY']; + // require'd built-in modules var BUILTINS = ['events']; @@ -103,6 +106,9 @@ function assertSrcContents() { else if(IE_SVG_BLACK_LIST.indexOf(lastPart) !== -1) { logs.push(file + ' : contains .' + lastPart + ' (IE failure in SVG)'); } + else if(FF_BLACK_LIST.indexOf(lastPart) !== -1) { + logs.push(file + ' : contains .' + lastPart + ' (FF failure)'); + } } else if(node.type === 'Identifier' && node.source() === 'getComputedStyle') { if(node.parent.source() !== 'window.getComputedStyle') {