Bug 976772 - [e10s] Make sure context menu appears at the right place, even in a subframe (r=felipe)

This commit is contained in:
Bill McCloskey 2014-02-28 16:58:52 -08:00
Родитель d99dfa9f16
Коммит 0351870a89
3 изменённых файлов: 43 добавлений и 4 удалений

Просмотреть файл

@ -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>