Bug 1269444 - Move Plugin Zoom Value update into SetWindow call; r=bsmedberg
authorKyle Machulis <kyle@nonpolynomial.com>
Fri, 20 May 2016 13:32:10 -0700
changeset 371092 369e41626760109257f1ac5f797c713213e7fba2
parent 371091 a3a5b2614b5d3479e48dd749270798b9a8c12b07
child 371093 dca0aaaa1f59bfd84c1daabc21663cb7604cd76a
push id19232
push userbmo:gps@mozilla.com
push dateWed, 25 May 2016 22:36:54 +0000
reviewersbsmedberg
bugs1269444
milestone49.0a1
Bug 1269444 - Move Plugin Zoom Value update into SetWindow call; r=bsmedberg Currently, CSS Zoom is updated on calls to ResolutionMayHaveChanged. However, this happens in between two calls in NPP_SetWindow, one for widget repaint and then one for resolution updates. Not having CSS Zoom updated during the first call to NPP_SetWindow would result in desynchronized window updates in Adobe Flash. Therefore, ResolutionMayHaveChanged is called on all NPP_SetWindow calls from nsPluginFrame, meaning the plugin library will always have access to the correct values via NPP_GetValue/NPP_SetValue. MozReview-Commit-ID: 6BddqngxsKy
layout/generic/nsPluginFrame.cpp
--- a/layout/generic/nsPluginFrame.cpp
+++ b/layout/generic/nsPluginFrame.cpp
@@ -647,16 +647,18 @@ nsPluginFrame::CallSetWindow(bool aCheck
     scaleFactor = 1.0;
   }
   size_t intScaleFactor = ceil(scaleFactor);
   window->x = intBounds.x / intScaleFactor;
   window->y = intBounds.y / intScaleFactor;
   window->width = intBounds.width / intScaleFactor;
   window->height = intBounds.height / intScaleFactor;
 
+  mInstanceOwner->ResolutionMayHaveChanged();
+
   // This will call pi->SetWindow and take care of window subclassing
   // if needed, see bug 132759. Calling SetWindow can destroy this frame
   // so check for that before doing anything else with this frame's memory.
   if (mInstanceOwner->UseAsyncRendering()) {
     rv = pi->AsyncSetWindow(window);
   }
   else {
     rv = window->CallSetWindow(pi);