Bug 1269444 - Move Plugin Zoom Value update into SetWindow call; r?bsmedberg draft
authorKyle Machulis <kyle@nonpolynomial.com>
Fri, 20 May 2016 13:32:10 -0700
changeset 370475 c48fb3aa93b77118c494f454f8782e9f1c349db3
parent 370474 5511d54a3f172c1d68f98cc55dce4de1d0ba1b51
child 521757 9d3cfa2dbd9232e3176be24a646ac67631be9d8a
push id19069
push userbmo:kyle@nonpolynomial.com
push dateTue, 24 May 2016 20:22:38 +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);