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 333182 28ba9cceda61248595c8d4c15e23955cc2b5d9bb
parent 333181 c89874eb124ba5673eb943779176370ec00aacf7
child 333183 49da7aca28190d9e8a3b4dc7db62ebd5022edfb2
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs1269444
milestone48.0a2
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);