diff --git a/layout/generic/nsObjectFrame.cpp b/layout/generic/nsObjectFrame.cpp index c96e79490c9..b5e204f8285 100644 --- a/layout/generic/nsObjectFrame.cpp +++ b/layout/generic/nsObjectFrame.cpp @@ -1432,7 +1432,7 @@ nsObjectFrame::ContentChanged(nsIPresContext* aPresContext, return rv; } -nsresult nsObjectFrame::GetWindowOriginInPixels(nsIPresContext * aPresContext, PRBool aWindowless, nsPoint * aOrigin) +nsresult nsObjectFrame::GetWindowOriginInPixels(nsIPresContext * aPresContext, nsPoint * aOrigin) { NS_ENSURE_ARG_POINTER(aPresContext); NS_ENSURE_ARG_POINTER(aOrigin); @@ -1443,29 +1443,6 @@ nsresult nsObjectFrame::GetWindowOriginInPixels(nsIPresContext * aPresContext, P GetOffsetFromView(aPresContext, origin, &parentWithView); - // if it's windowless, let's make sure we have our origin set right - // it may need to be corrected, like after scrolling - if (aWindowless && parentWithView) { - nsPoint correction(0,0); - nsCOMPtr parentVM; - parentWithView->GetViewManager(*getter_AddRefs(parentVM)); - - // Walk up all the views and add up their positions. This will give us our - // absolute position which is what we want to give the plugin - nsIView* theView = parentWithView; - while (theView) { - nsCOMPtr vm; - theView->GetViewManager(*getter_AddRefs(vm)); - if (vm != parentVM) - break; - - theView->GetPosition(&correction.x, &correction.y); - origin += correction; - - theView->GetParent(theView); - } - } - float t2p; aPresContext->GetTwipsToPixels(&t2p); aOrigin->x = NSTwipsToIntPixels(origin.x, t2p); @@ -1516,7 +1493,7 @@ nsObjectFrame::DidReflow(nsIPresContext* aPresContext, return rv; nsPoint origin; - GetWindowOriginInPixels(aPresContext, windowless, &origin); + GetWindowOriginInPixels(aPresContext, &origin); window->x = origin.x; window->y = origin.y; diff --git a/layout/generic/nsObjectFrame.h b/layout/generic/nsObjectFrame.h index 1af12dfb4e5..f1ed498666a 100644 --- a/layout/generic/nsObjectFrame.h +++ b/layout/generic/nsObjectFrame.h @@ -160,7 +160,7 @@ protected: nsresult NotifyContentObjectWrapper(); - nsresult GetWindowOriginInPixels(nsIPresContext * aPresContext, PRBool aWindoless, nsPoint* aOrigin); + nsresult GetWindowOriginInPixels(nsIPresContext * aPresContext, nsPoint* aOrigin); private: nsPluginInstanceOwner *mInstanceOwner; diff --git a/layout/html/base/src/nsObjectFrame.cpp b/layout/html/base/src/nsObjectFrame.cpp index c96e79490c9..b5e204f8285 100644 --- a/layout/html/base/src/nsObjectFrame.cpp +++ b/layout/html/base/src/nsObjectFrame.cpp @@ -1432,7 +1432,7 @@ nsObjectFrame::ContentChanged(nsIPresContext* aPresContext, return rv; } -nsresult nsObjectFrame::GetWindowOriginInPixels(nsIPresContext * aPresContext, PRBool aWindowless, nsPoint * aOrigin) +nsresult nsObjectFrame::GetWindowOriginInPixels(nsIPresContext * aPresContext, nsPoint * aOrigin) { NS_ENSURE_ARG_POINTER(aPresContext); NS_ENSURE_ARG_POINTER(aOrigin); @@ -1443,29 +1443,6 @@ nsresult nsObjectFrame::GetWindowOriginInPixels(nsIPresContext * aPresContext, P GetOffsetFromView(aPresContext, origin, &parentWithView); - // if it's windowless, let's make sure we have our origin set right - // it may need to be corrected, like after scrolling - if (aWindowless && parentWithView) { - nsPoint correction(0,0); - nsCOMPtr parentVM; - parentWithView->GetViewManager(*getter_AddRefs(parentVM)); - - // Walk up all the views and add up their positions. This will give us our - // absolute position which is what we want to give the plugin - nsIView* theView = parentWithView; - while (theView) { - nsCOMPtr vm; - theView->GetViewManager(*getter_AddRefs(vm)); - if (vm != parentVM) - break; - - theView->GetPosition(&correction.x, &correction.y); - origin += correction; - - theView->GetParent(theView); - } - } - float t2p; aPresContext->GetTwipsToPixels(&t2p); aOrigin->x = NSTwipsToIntPixels(origin.x, t2p); @@ -1516,7 +1493,7 @@ nsObjectFrame::DidReflow(nsIPresContext* aPresContext, return rv; nsPoint origin; - GetWindowOriginInPixels(aPresContext, windowless, &origin); + GetWindowOriginInPixels(aPresContext, &origin); window->x = origin.x; window->y = origin.y; diff --git a/layout/html/base/src/nsObjectFrame.h b/layout/html/base/src/nsObjectFrame.h index 1af12dfb4e5..f1ed498666a 100644 --- a/layout/html/base/src/nsObjectFrame.h +++ b/layout/html/base/src/nsObjectFrame.h @@ -160,7 +160,7 @@ protected: nsresult NotifyContentObjectWrapper(); - nsresult GetWindowOriginInPixels(nsIPresContext * aPresContext, PRBool aWindoless, nsPoint* aOrigin); + nsresult GetWindowOriginInPixels(nsIPresContext * aPresContext, nsPoint* aOrigin); private: nsPluginInstanceOwner *mInstanceOwner;