Bug 726467. Remove now incorrect transformations to screen space. r=mfinkle

The java front end is handling zoom now. We shouldn't need to and
so don't need these transformations at all. This fixes link
hilighting because we're now selecting the right element to hilight.

--HG--
extra : rebase_source : 961b7bba2e7ae90eac7a8957867af7aea11b737b
This commit is contained in:
Jeff Muizelaar 2012-02-21 11:51:42 -05:00
parent 1cd5a15deb
commit d80cddc229

View File

@ -2217,7 +2217,6 @@ var BrowserEventHandler = {
if (element && !FormAssistant.handleClick(element)) {
try {
let data = JSON.parse(aData);
[data.x, data.y] = ElementTouchHelper.toScreenCoords(element.ownerDocument.defaultView, data.x, data.y);
this._sendMouseEvent("mousemove", element, data.x, data.y);
this._sendMouseEvent("mousedown", element, data.x, data.y);
@ -2353,7 +2352,6 @@ var BrowserEventHandler = {
let window = aElement.ownerDocument.defaultView;
try {
[aX, aY] = ElementTouchHelper.toBrowserCoords(window, aX, aY);
let cwu = window.top.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
aButton = aButton || 0;
cwu.sendMouseEventToWindow(aName, Math.round(aX), Math.round(aY), aButton, 1, 0, true);
@ -2460,46 +2458,7 @@ var BrowserEventHandler = {
const kReferenceDpi = 240; // standard "pixel" size used in some preferences
const ElementTouchHelper = {
toBrowserCoords: function(aWindow, aX, aY) {
if (!aWindow)
throw "Must provide a window";
let browser = BrowserApp.getBrowserForWindow(aWindow.top);
if (!browser)
throw "Unable to find a browser";
let tab = BrowserApp.getTabForBrowser(browser);
if (!tab)
throw "Unable to find a tab";
let viewport = tab.viewport;
return [
(aX * viewport.zoom),
(aY * viewport.zoom)
];
},
toScreenCoords: function(aWindow, aX, aY) {
if (!aWindow)
throw "Must provide a window";
let browser = BrowserApp.getBrowserForWindow(aWindow.top);
if (!browser)
throw "Unable to find a browser";
let tab = BrowserApp.getTabForBrowser(browser);
if (!tab)
throw "Unable to find a tab";
let viewport = tab.viewport;
return [
aX/viewport.zoom,
aY/viewport.zoom
];
},
anyElementFromPoint: function(aWindow, aX, aY) {
[aX, aY] = this.toScreenCoords(aWindow, aX, aY);
let cwu = aWindow.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
let elem = cwu.elementFromPoint(aX, aY, false, true);
@ -2515,7 +2474,6 @@ const ElementTouchHelper = {
},
elementFromPoint: function(aWindow, aX, aY) {
[aX, aY] = this.toScreenCoords(aWindow, aX, aY);
// browser's elementFromPoint expect browser-relative client coordinates.
// subtract browser's scroll values to adjust
let cwu = aWindow.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);