Bug 804606. On Mac, call ApplyPluginGeometryUpdates immediately when we've computed geometry, instead of waiting until the paint event. r=smichaud
authorRobert O'Callahan <robert@ocallahan.org>
Wed, 07 Nov 2012 09:38:11 +1300
changeset 113195 12f5029c12a50a313d2f4d6e5c88f52a052dcdb5
parent 113194 59106ef8d4e2cfd13525f70437aae7a82c264af4
child 113196 ef15df8a2e6bdddca491c3e302a1b720bee431d9
push idunknown
push userunknown
push dateunknown
reviewerssmichaud
bugs804606
milestone19.0a1
Bug 804606. On Mac, call ApplyPluginGeometryUpdates immediately when we've computed geometry, instead of waiting until the paint event. r=smichaud
browser/components/privatebrowsing/test/browser/global/browser_privatebrowsing_geoprompt.js
browser/components/privatebrowsing/test/browser/global/browser_privatebrowsing_geoprompt_page.html
browser/components/privatebrowsing/test/browser/global/browser_privatebrowsing_openlocation.js
browser/components/privatebrowsing/test/browser/global/browser_privatebrowsing_zoomrestore.js
layout/base/nsPresContext.cpp
layout/base/nsPresShell.cpp
toolkit/system/windowsproxy/Makefile.in
toolkit/system/windowsproxy/nsWindowsSystemProxySettings.cpp
--- a/layout/base/nsPresContext.cpp
+++ b/layout/base/nsPresContext.cpp
@@ -2612,17 +2612,23 @@ nsRootPresContext::ComputePluginGeometry
     // again.
     aBuilder->SetAllowMergingAndFlattening(false);
     nsRegion region = rootFrame->GetVisualOverflowRectRelativeToSelf();
     // nsDisplayPlugin::ComputeVisibility will automatically set a non-hidden
     // widget configuration for the plugin, if it's visible.
     aList->ComputeVisibilityForRoot(aBuilder, &region);
   }
 
+#ifdef XP_MACOSX
+  // We control painting of Mac plugins, so just apply geometry updates now.
+  // This is not happening during a paint event.
+  ApplyPluginGeometryUpdates();
+#else
   InitApplyPluginGeometryTimer();
+#endif
 }
 
 static void
 ApplyPluginGeometryUpdatesCallback(nsITimer *aTimer, void *aClosure)
 {
   static_cast<nsRootPresContext*>(aClosure)->ApplyPluginGeometryUpdates();
 }
 
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -7122,17 +7122,19 @@ PresShell::WillPaintWindow(bool aWillSen
 {
   nsRootPresContext* rootPresContext = mPresContext->GetRootPresContext();
   if (rootPresContext != mPresContext) {
     // This could be a popup's presshell. We don't allow plugins in popups
     // so there's nothing to do here.
     return;
   }
 
+#ifndef XP_MACOSX
   rootPresContext->ApplyPluginGeometryUpdates();
+#endif
 }
 
 void
 PresShell::DidPaintWindow()
 {
   nsRootPresContext* rootPresContext = mPresContext->GetRootPresContext();
   if (rootPresContext != mPresContext) {
     // This could be a popup's presshell. No point in notifying XPConnect