Bug 116108, passing coordinates to windowless plugin when in a table, r=peterl, sr=attinasi

This commit is contained in:
av%netscape.com 2001-12-22 00:21:12 +00:00
parent 3ea79dee24
commit fb71ac5834
2 changed files with 40 additions and 6 deletions

View File

@ -1591,9 +1591,8 @@ nsObjectFrame::Paint(nsIPresContext* aPresContext,
PRUint32 aFlags)
{
const nsStyleVisibility* vis = (const nsStyleVisibility*)mStyleContext->GetStyleData(eStyleStruct_Visibility);
if ((vis != nsnull) && !vis->IsVisibleOrCollapsed()) {
if ((vis != nsnull) && !vis->IsVisibleOrCollapsed())
return NS_OK;
}
nsIFrame * child = mFrames.FirstChild();
if (child) { // if we have children, we are probably not really a plugin
@ -1757,12 +1756,30 @@ nsObjectFrame::Paint(nsIPresContext* aPresContext,
mInstanceOwner->GetWindow(window);
if (window->type == nsPluginWindowType_Drawable) {
// check if we need to call SetWindow with updated parameters
PRBool doupdatewindow = PR_FALSE;
// check if we need to update hdc
PRUint32 hdc;
aRenderingContext.RetrieveCurrentNativeGraphicData(&hdc);
if(NS_REINTERPRET_CAST(PRUint32, window->window) != hdc) {
window->window = NS_REINTERPRET_CAST(nsPluginPort*, hdc);
inst->SetWindow(window);
doupdatewindow = PR_TRUE;
}
// check if we need to update window position
nsPoint origin;
GetWindowOriginInPixels(aPresContext, PR_TRUE, &origin);
if((window->x != origin.x) || (window->y != origin.y)) {
window->x = origin.x;
window->y = origin.y;
doupdatewindow = PR_TRUE;
}
if(doupdatewindow)
inst->SetWindow(window);
mInstanceOwner->Paint(aDirtyRect, hdc);
}
NS_RELEASE(inst);

View File

@ -1591,9 +1591,8 @@ nsObjectFrame::Paint(nsIPresContext* aPresContext,
PRUint32 aFlags)
{
const nsStyleVisibility* vis = (const nsStyleVisibility*)mStyleContext->GetStyleData(eStyleStruct_Visibility);
if ((vis != nsnull) && !vis->IsVisibleOrCollapsed()) {
if ((vis != nsnull) && !vis->IsVisibleOrCollapsed())
return NS_OK;
}
nsIFrame * child = mFrames.FirstChild();
if (child) { // if we have children, we are probably not really a plugin
@ -1757,12 +1756,30 @@ nsObjectFrame::Paint(nsIPresContext* aPresContext,
mInstanceOwner->GetWindow(window);
if (window->type == nsPluginWindowType_Drawable) {
// check if we need to call SetWindow with updated parameters
PRBool doupdatewindow = PR_FALSE;
// check if we need to update hdc
PRUint32 hdc;
aRenderingContext.RetrieveCurrentNativeGraphicData(&hdc);
if(NS_REINTERPRET_CAST(PRUint32, window->window) != hdc) {
window->window = NS_REINTERPRET_CAST(nsPluginPort*, hdc);
inst->SetWindow(window);
doupdatewindow = PR_TRUE;
}
// check if we need to update window position
nsPoint origin;
GetWindowOriginInPixels(aPresContext, PR_TRUE, &origin);
if((window->x != origin.x) || (window->y != origin.y)) {
window->x = origin.x;
window->y = origin.y;
doupdatewindow = PR_TRUE;
}
if(doupdatewindow)
inst->SetWindow(window);
mInstanceOwner->Paint(aDirtyRect, hdc);
}
NS_RELEASE(inst);