Bug 798245. Propagate the zoom from the tab child into the frame metrics. r=cjones

This lets the default zoom make it back to the APZC when the viewport is set.
This commit is contained in:
Jeff Muizelaar 2012-12-11 17:49:57 -05:00
parent 79fbc905d4
commit 7877c58e7a
2 changed files with 11 additions and 0 deletions

View File

@ -291,6 +291,8 @@ public:
/** Return the DPI of the widget this TabChild draws to. */
void GetDPI(float* aDPI);
gfxSize GetZoom() { return mLastMetrics.mZoom; }
void SetBackgroundColor(const nscolor& aColor);
void NotifyPainted();

View File

@ -10,6 +10,11 @@
* used during painting and hit testing
*/
// include PBrowserChild explicitly because TabChild won't include it
// because we're in layout :(
#include "mozilla/dom/PBrowserChild.h"
#include "mozilla/dom/TabChild.h"
#include "mozilla/layers/PLayers.h"
#include "nsDisplayList.h"
@ -50,6 +55,7 @@
using namespace mozilla;
using namespace mozilla::css;
using namespace mozilla::layers;
using namespace mozilla::dom;
typedef FrameMetrics::ViewID ViewID;
static void AddTransformFunctions(nsCSSValueList* aList,
@ -658,6 +664,9 @@ static void RecordFrameMetrics(nsIFrame* aForFrame,
metrics.mScrollId = aScrollId;
nsIPresShell* presShell = presContext->GetPresShell();
if (TabChild *tc = GetTabChildFrom(presShell)) {
metrics.mZoom = tc->GetZoom();
}
metrics.mResolution = gfxSize(presShell->GetXResolution(), presShell->GetYResolution());
metrics.mDevPixelsPerCSSPixel = auPerCSSPixel / auPerDevPixel;