diff --git a/dom/ipc/TabChild.h b/dom/ipc/TabChild.h index bc9e06d0fc1..25447e5836f 100644 --- a/dom/ipc/TabChild.h +++ b/dom/ipc/TabChild.h @@ -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(); diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index 99c747f5840..9ed6144798e 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -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;