Use <xul:browser>'s mapScreenCoordinatesFromContent only when it exists
This commit is contained in:
parent
8cc5be8103
commit
5b612b9a84
@ -133,16 +133,17 @@ ContentBridge.prototype = inherit(TreeStyleTabConstants, {
|
|||||||
},
|
},
|
||||||
fixupEventCoordinates : function CB_fixupEventCoordinates(aCoordinates)
|
fixupEventCoordinates : function CB_fixupEventCoordinates(aCoordinates)
|
||||||
{
|
{
|
||||||
// On Firefox 36 and later, screenX/screenY from content frame
|
// On Firefox 36 and later, screenX/screenY from out-of-process
|
||||||
// is wrong (the position (0,0) is not the screen edge, but the
|
// content frame is wrong, so we have to calculate correct
|
||||||
// edge of the frame itself), so we have to calculate correct
|
// screen coordinates manually via the utility method.
|
||||||
// screen coordinates manually.
|
|
||||||
// This hack should be removed after the bug
|
// This hack should be removed after the bug
|
||||||
// https://bugzilla.mozilla.org/show_bug.cgi?id=1075670
|
// https://bugzilla.mozilla.org/show_bug.cgi?id=1075670
|
||||||
// is fixed.
|
// is fixed.
|
||||||
var fixedCoordinates = this.mTab.linkedBrowser.mapScreenCoordinatesFromContent(aCoordinates.screenX, aCoordinates.screenY);
|
if (typeof this.mTab.linkedBrowser.mapScreenCoordinatesFromContent == 'function') {
|
||||||
|
let fixedCoordinates = this.mTab.linkedBrowser.mapScreenCoordinatesFromContent(aCoordinates.screenX, aCoordinates.screenY);
|
||||||
aCoordinates.screenX = fixedCoordinates.x;
|
aCoordinates.screenX = fixedCoordinates.x;
|
||||||
aCoordinates.screenY = fixedCoordinates.y;
|
aCoordinates.screenY = fixedCoordinates.y;
|
||||||
|
}
|
||||||
return aCoordinates;
|
return aCoordinates;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user