Bug 1227666 - Insure that cached plugin geometry configuration cached in ShadowLayerForwarder gets cleared when we reflow and new content has no plugins. r=roc

--HG--
extra : transplant_source : %87%99%FBt%10%B9%24%8D%8B%1EJ%E2h%20%5EB%FA%3E%B2%FE
This commit is contained in:
Jim Mathies 2015-11-25 12:11:00 -06:00
parent 5d8bf09be9
commit 9eb83d5a42
2 changed files with 13 additions and 4 deletions

View File

@ -1747,10 +1747,13 @@ already_AddRefed<LayerManager> nsDisplayList::PaintRoot(nsDisplayListBuilder* aB
// If this is the content process, we ship plugin geometry updates over with layer
// updates, so calculate that now before we call EndTransaction.
if (rootPresContext &&
aBuilder->WillComputePluginGeometry() &&
XRE_IsContentProcess()) {
rootPresContext->ComputePluginGeometryUpdates(aBuilder->RootReferenceFrame(), aBuilder, this);
if (rootPresContext && XRE_IsContentProcess()) {
if (aBuilder->WillComputePluginGeometry()) {
rootPresContext->ComputePluginGeometryUpdates(aBuilder->RootReferenceFrame(), aBuilder, this);
}
// The layer system caches plugin configuration information for forwarding
// with layer updates which needs to get set during reflow. This must be
// called even if there are no windowed plugins in the page.
rootPresContext->CollectPluginGeometryUpdates(layerManager);
}

View File

@ -3206,6 +3206,12 @@ nsRootPresContext::CollectPluginGeometryUpdates(LayerManager* aLayerManager)
mozilla::layers::ClientLayerManager* clm = aLayerManager->AsClientLayerManager();
nsTArray<nsIWidget::Configuration> configurations;
// If there aren't any plugins to configure, clear the plugin data cache
// in the layer system.
if (!mRegisteredPlugins.Count() && clm) {
clm->StorePluginWidgetConfigurations(configurations);
return;
}
PluginGetGeometryUpdate(mRegisteredPlugins, &configurations);
if (configurations.IsEmpty()) {
PluginDidSetGeometry(mRegisteredPlugins);