Back out 94a2a4a7c84c (bug 1075670) for breaking context menu in e10s CLOSED TREE

This commit is contained in:
Bill McCloskey 2015-01-28 16:12:36 -08:00
parent 773e64f259
commit 60707d7dcf
2 changed files with 9 additions and 7 deletions

View File

@ -789,6 +789,7 @@ NPBool nsPluginInstanceOwner::ConvertPointPuppet(PuppetWidget *widget,
tabContentBounds.ScaleInverseRoundOut(scaleFactor);
int32_t windowH = tabContentBounds.height + int(chromeSize.y);
// This is actually relative to window-chrome.
nsPoint pluginPosition = AsNsPoint(pluginFrame->GetScreenRect().TopLeft());
// Convert (sourceX, sourceY) to 'real' (not PuppetWidget) screen space.
@ -798,8 +799,8 @@ NPBool nsPluginInstanceOwner::ConvertPointPuppet(PuppetWidget *widget,
nsPoint screenPoint;
switch (sourceSpace) {
case NPCoordinateSpacePlugin:
screenPoint = sourcePoint + pluginPosition +
pluginFrame->GetContentRectRelativeToSelf().TopLeft() / nsPresContext::AppUnitsPerCSSPixel();
screenPoint = sourcePoint + pluginFrame->GetContentRectRelativeToSelf().TopLeft() +
chromeSize + pluginPosition + windowPosition;
break;
case NPCoordinateSpaceWindow:
screenPoint = nsPoint(sourcePoint.x, windowH-sourcePoint.y) +
@ -822,8 +823,8 @@ NPBool nsPluginInstanceOwner::ConvertPointPuppet(PuppetWidget *widget,
nsPoint destPoint;
switch (destSpace) {
case NPCoordinateSpacePlugin:
destPoint = screenPoint - pluginPosition -
pluginFrame->GetContentRectRelativeToSelf().TopLeft() / nsPresContext::AppUnitsPerCSSPixel();
destPoint = screenPoint - pluginFrame->GetContentRectRelativeToSelf().TopLeft() -
chromeSize - pluginPosition - windowPosition;
break;
case NPCoordinateSpaceWindow:
destPoint = screenPoint - windowPosition;

View File

@ -82,7 +82,7 @@ public:
int32_t* aY) MOZ_OVERRIDE
{ *aX = kMaxDimension; *aY = kMaxDimension; return NS_OK; }
// Widget position is controlled by the parent process via TabChild.
// We're always at <0, 0>, and so ignore move requests.
NS_IMETHOD Move(double aX, double aY) MOZ_OVERRIDE
{ return NS_OK; }
@ -94,7 +94,7 @@ public:
double aWidth,
double aHeight,
bool aRepaint) MOZ_OVERRIDE
// Widget position is controlled by the parent process via TabChild.
// (we're always at <0, 0>)
{ return Resize(aWidth, aHeight, aRepaint); }
// XXX/cjones: copying gtk behavior here; unclear what disabling a
@ -125,8 +125,9 @@ public:
NS_IMETHOD SetTitle(const nsAString& aTitle) MOZ_OVERRIDE
{ return NS_ERROR_UNEXPECTED; }
// PuppetWidgets are always at <0, 0>.
virtual nsIntPoint WidgetToScreenOffset() MOZ_OVERRIDE
{ return GetWindowPosition() + GetChromeDimensions(); }
{ return nsIntPoint(0, 0); }
void InitEvent(WidgetGUIEvent& aEvent, nsIntPoint* aPoint = nullptr);