mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1052246 - Send correct rect information for selectionchange event. r=fabrice
This commit is contained in:
parent
bb0ede414b
commit
06f4fdde96
@ -522,8 +522,8 @@ var shell = {
|
||||
// based on tab's coordinate. So get the actual offsets between shell and evt.target.
|
||||
let elt = evt.target;
|
||||
let win = elt.ownerDocument.defaultView;
|
||||
let offsetX = win.mozInnerScreenX;
|
||||
let offsetY = win.mozInnerScreenY;
|
||||
let offsetX = win.mozInnerScreenX - window.mozInnerScreenX;
|
||||
let offsetY = win.mozInnerScreenY - window.mozInnerScreenY;
|
||||
|
||||
let rect = elt.getBoundingClientRect();
|
||||
offsetX += rect.left;
|
||||
|
@ -644,15 +644,15 @@ BrowserElementChild.prototype = {
|
||||
isCollapsed: (e.selectedText.length == 0),
|
||||
};
|
||||
|
||||
// Get correct geometry information if we have nested <iframe mozbrowser>
|
||||
// Get correct geometry information if we have nested iframe.
|
||||
let currentWindow = e.target.defaultView;
|
||||
while (currentWindow.realFrameElement) {
|
||||
let currentRect = currentWindow.realFrameElement.getBoundingClientRect();
|
||||
while (currentWindow.top != currentWindow) {
|
||||
let currentRect = currentWindow.frameElement.getBoundingClientRect();
|
||||
detail.rect.top += currentRect.top;
|
||||
detail.rect.bottom += currentRect.top;
|
||||
detail.rect.left += currentRect.left;
|
||||
detail.rect.right += currentRect.left;
|
||||
currentWindow = currentWindow.realFrameElement.ownerDocument.defaultView;
|
||||
currentWindow = currentWindow.parent;
|
||||
}
|
||||
|
||||
sendAsyncMsg("selectionchange", detail);
|
||||
|
Loading…
Reference in New Issue
Block a user