diff --git a/js/lib/utils.js b/js/lib/utils.js --- a/js/lib/utils.js +++ b/js/lib/utils.js @@ -1247,16 +1247,23 @@ function isinstance(inst, base) * 254067 which makes instanceof fail if the two sides are 'from' * different windows (something we don't care about). */ return (inst && base && ((inst instanceof base) || (inst.constructor && (inst.constructor.name == base.name)))); } +function isDefaultPrevented(ev) +{ + if ("defaultPrevented" in ev) + return ev.defaultPrevented; + return ev.getPreventDefault(); +} + function scaleNumberBy1024(number) { var scale = 0; while ((number >= 1000) && (scale < 6)) { scale++; number /= 1024; } diff --git a/xul/content/static.js b/xul/content/static.js --- a/xul/content/static.js +++ b/xul/content/static.js @@ -3826,17 +3826,17 @@ function ul_getcellprops(index, column, }); } var contentDropObserver = new Object(); contentDropObserver.onDragOver = function cdnd_dover(aEvent, aFlavour, aDragSession) { - if (aEvent.getPreventDefault()) + if (isDefaultPrevented(aEvent)) return; if (aDragSession.sourceDocument == aEvent.view.document) { aDragSession.canDrop = false; return; } } @@ -3890,33 +3890,33 @@ function cdnd_gsf() * significantly impact the performance of the drag (getting the data can be * very slow). */ var tabsDropObserver = new Object(); tabsDropObserver.canDrop = function tabdnd_candrop(aEvent, aDragSession) { - if (aEvent.getPreventDefault()) + if (isDefaultPrevented(aEvent)) return false; // See comment above |var tabsDropObserver|. var flavourSet = this.getSupportedFlavours(); for (var flavour in flavourSet.flavourTable) { if (aDragSession.isDataFlavorSupported(flavour)) return true; } return false; } tabsDropObserver.onDragOver = function tabdnd_dover(aEvent, aFlavour, aDragSession) { - if (aEvent.getPreventDefault()) + if (isDefaultPrevented(aEvent)) return; // See comment above |var tabsDropObserver|. if (aDragSession.sourceNode == aEvent.target) aDragSession.canDrop = true; // If we're not accepting the drag, don't show the marker either. if (!aDragSession.canDrop) @@ -3948,17 +3948,17 @@ function tabdnd_dover(aEvent, aFlavour, // Reposition the drop marker and show it. In that order. client.tabDragMarker.style.MozMarginStart = newPosition + "px"; client.tabDragBar.collapsed = false; } tabsDropObserver.onDragExit = function tabdnd_dexit(aEvent, aDragSession) { - if (aEvent.getPreventDefault()) + if (isDefaultPrevented(aEvent)) return; /* We've either stopped being part of a drag operation, or the dragging is * somewhere away from us. */ client.tabDragBar.collapsed = true; }