Backout bcac58cbf328 & 9c75f0428f8a (bug 775965) for causing bug 782981
This commit is contained in:
@@ -431,7 +431,7 @@ nsObjectFrame::PrepForDrawing(nsIWidget *aWidget)
|
||||
}
|
||||
#endif
|
||||
|
||||
rpc->RegisterPluginForGeometryUpdates(mContent);
|
||||
rpc->RegisterPluginForGeometryUpdates(this);
|
||||
rpc->RequestUpdatePluginGeometry(this);
|
||||
|
||||
// Here we set the background color for this widget because some plugins will use
|
||||
@@ -451,7 +451,7 @@ nsObjectFrame::PrepForDrawing(nsIWidget *aWidget)
|
||||
FixupWindow(GetContentRectRelativeToSelf().Size());
|
||||
|
||||
#ifndef XP_MACOSX
|
||||
rpc->RegisterPluginForGeometryUpdates(mContent);
|
||||
rpc->RegisterPluginForGeometryUpdates(this);
|
||||
rpc->RequestUpdatePluginGeometry(this);
|
||||
#endif
|
||||
}
|
||||
@@ -739,26 +739,32 @@ void
|
||||
nsObjectFrame::SetInstanceOwner(nsPluginInstanceOwner* aOwner)
|
||||
{
|
||||
mInstanceOwner = aOwner;
|
||||
if (mInstanceOwner) {
|
||||
return;
|
||||
}
|
||||
nsRootPresContext* rpc = PresContext()->GetRootPresContext();
|
||||
if (rpc) {
|
||||
rpc->UnregisterPluginForGeometryUpdates(mContent);
|
||||
}
|
||||
if (mWidget && mInnerView) {
|
||||
mInnerView->DetachWidgetEventHandler(mWidget);
|
||||
// Make sure the plugin is hidden in case an update of plugin geometry
|
||||
// hasn't happened since this plugin became hidden.
|
||||
nsIWidget* parent = mWidget->GetParent();
|
||||
if (parent) {
|
||||
nsTArray<nsIWidget::Configuration> configurations;
|
||||
this->GetEmptyClipConfiguration(&configurations);
|
||||
parent->ConfigureChildren(configurations);
|
||||
if (!mInstanceOwner) {
|
||||
nsRootPresContext* rpc = PresContext()->GetRootPresContext();
|
||||
if (rpc) {
|
||||
if (mWidget) {
|
||||
if (mInnerView) {
|
||||
mInnerView->DetachWidgetEventHandler(mWidget);
|
||||
|
||||
mWidget->Show(false);
|
||||
mWidget->Enable(false);
|
||||
mWidget->SetParent(nullptr);
|
||||
rpc->UnregisterPluginForGeometryUpdates(this);
|
||||
// Make sure the plugin is hidden in case an update of plugin geometry
|
||||
// hasn't happened since this plugin became hidden.
|
||||
nsIWidget* parent = mWidget->GetParent();
|
||||
if (parent) {
|
||||
nsTArray<nsIWidget::Configuration> configurations;
|
||||
this->GetEmptyClipConfiguration(&configurations);
|
||||
parent->ConfigureChildren(configurations);
|
||||
|
||||
mWidget->Show(false);
|
||||
mWidget->Enable(false);
|
||||
mWidget->SetParent(nullptr);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
#ifndef XP_MACOSX
|
||||
rpc->UnregisterPluginForGeometryUpdates(this);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2213,7 +2219,7 @@ nsObjectFrame::BeginSwapDocShells(nsIContent* aContent, void*)
|
||||
"Plugin windows must not be toplevel");
|
||||
nsRootPresContext* rootPC = objectFrame->PresContext()->GetRootPresContext();
|
||||
NS_ASSERTION(rootPC, "unable to unregister the plugin frame");
|
||||
rootPC->UnregisterPluginForGeometryUpdates(aContent);
|
||||
rootPC->UnregisterPluginForGeometryUpdates(objectFrame);
|
||||
}
|
||||
|
||||
/*static*/ void
|
||||
@@ -2239,7 +2245,7 @@ nsObjectFrame::EndSwapDocShells(nsIContent* aContent, void*)
|
||||
objectFrame->CallSetWindow();
|
||||
|
||||
// Register for geometry updates and make a request.
|
||||
rootPC->RegisterPluginForGeometryUpdates(aContent);
|
||||
rootPC->RegisterPluginForGeometryUpdates(objectFrame);
|
||||
rootPC->RequestUpdatePluginGeometry(objectFrame);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user