Bug 1328868 - PresShell debug logging
MozReview-Commit-ID: Ik8q3VXmXWl
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -211,16 +211,18 @@ using namespace mozilla::tasktracer;
#define ANCHOR_SCROLL_FLAGS \
(nsIPresShell::SCROLL_OVERFLOW_HIDDEN | nsIPresShell::SCROLL_NO_PARENT_FRAMES)
// define the scalfactor of drag and drop images
// relative to the max screen height/width
#define RELATIVE_SCALEFACTOR 0.0925f
+#define PRES_LOG(...) printf_stderr("Pres: " __VA_ARGS__)
+
using namespace mozilla;
using namespace mozilla::css;
using namespace mozilla::dom;
using namespace mozilla::gfx;
using namespace mozilla::layers;
using namespace mozilla::gfx;
using namespace mozilla::layout;
using PaintFrameFlags = nsLayoutUtils::PaintFrameFlags;
@@ -11106,30 +11108,34 @@ nsIPresShell::FontSizeInflationEnabled()
return mFontSizeInflationEnabled;
}
void
nsIPresShell::HandleGlobalZoom()
{
float zoomFactor = nsLayoutUtils::SystemFontScale();
+ PRES_LOG("%p: HandleGlobalZoom: System font scale: %f\n", this, zoomFactor);
if (zoomFactor == 0.0f) {
if (mGlobalZoomWasEnabled) {
+ PRES_LOG("%p: HandleGlobalZoom: Resetting global zoom", this);
SetGlobalZoom(1.0f);
mGlobalZoomWasEnabled = false;
}
return;
}
MOZ_ASSERT(mDocument, "our document should not be null");
if (!mFontSizeInflationEnabled && !mDocument->IsSyntheticDocument()) {
+ PRES_LOG("%p: HandleGlobalZoom: Applying global zoom", this);
SetGlobalZoom(zoomFactor);
} else {
+ PRES_LOG("%p: HandleGlobalZoom: Document not eligible", this);
SetGlobalZoom(1.0f);
}
mGlobalZoomWasEnabled = true;
}
void
nsIPresShell::SetGlobalZoom(const float& aZoomFactor)
{