зеркало из https://github.com/mozilla/gecko-dev.git
Bug 976772 - [e10s] Make sure context menu appears at the right place, even in a subframe (r=felipe)
This commit is contained in:
Родитель
d99dfa9f16
Коммит
0351870a89
|
@ -2996,10 +2996,9 @@
|
|||
gContextMenuContentData = { event: aMessage.objects.event,
|
||||
browser: browser };
|
||||
let popup = browser.ownerDocument.getElementById("contentAreaContextMenu");
|
||||
popup.openPopup(browser, "overlap",
|
||||
gContextMenuContentData.event.clientX,
|
||||
gContextMenuContentData.event.clientY,
|
||||
true, false, null);
|
||||
let event = gContextMenuContentData.event;
|
||||
let pos = browser.mapScreenCoordinatesFromContent(event.screenX, event.screenY);
|
||||
popup.openPopupAtScreen(pos.x, pos.y, true);
|
||||
break;
|
||||
}
|
||||
case "DOMWebNotificationClicked": {
|
||||
|
|
|
@ -1177,6 +1177,25 @@
|
|||
</body>
|
||||
</method>
|
||||
|
||||
<!--
|
||||
For out-of-process code, event.screen[XY] is relative to the
|
||||
left/top of the content view. For in-process code,
|
||||
event.screen[XY] is relative to the left/top of the screen. We
|
||||
use this method to map screen coordinates received from a
|
||||
(possibly out-of-process) <browser> element to coordinates
|
||||
that are relative to the screen. This code handles the
|
||||
in-process case, where we return the coordinates unchanged.
|
||||
-->
|
||||
<method name="mapScreenCoordinatesFromContent">
|
||||
<parameter name="aScreenX"/>
|
||||
<parameter name="aScreenY"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
return { x: aScreenX, y: aScreenY };
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
<method name="swapDocShells">
|
||||
<parameter name="aOtherBrowser"/>
|
||||
<body>
|
||||
|
|
|
@ -237,6 +237,27 @@
|
|||
]]></body>
|
||||
</method>
|
||||
|
||||
<!--
|
||||
For out-of-process code, event.screen[XY] is relative to the
|
||||
left/top of the content view. For in-process code,
|
||||
event.screen[XY] is relative to the left/top of the screen. We
|
||||
use this method to map screen coordinates received from a
|
||||
(possibly out-of-process) <browser> element to coordinates
|
||||
that are relative to the screen. This code handles the
|
||||
out-of-process case, where we need to translate by the screen
|
||||
position of the <browser> element.
|
||||
-->
|
||||
<method name="mapScreenCoordinatesFromContent">
|
||||
<parameter name="aScreenX"/>
|
||||
<parameter name="aScreenY"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
return { x: aScreenX + this.boxObject.screenX,
|
||||
y: aScreenY + this.boxObject.screenY };
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
</implementation>
|
||||
|
||||
</binding>
|
||||
|
|
Загрузка…
Ссылка в новой задаче