Bug 1328868 - PresShell debug logging draft
authorJan Henning <jh+bugzilla@buttercookie.de>
Sat, 04 Feb 2017 21:15:32 +0100
changeset 485526 e01cff0037b706d3ab380659a0048e12da9e6e18
parent 485525 00c5f6fea44ffdd5a4e8644a63715f353ae8bc1a
child 485527 7834c37da3edee2ebc3f072dd9fdf5c53cd63a7b
push id45754
push usermozilla@buttercookie.de
push dateThu, 16 Feb 2017 20:38:49 +0000
bugs1328868
milestone54.0a1
Bug 1328868 - PresShell debug logging MozReview-Commit-ID: Ik8q3VXmXWl
layout/base/PresShell.cpp
--- 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;
@@ -11113,32 +11115,36 @@ nsIPresShell::FontSizeInflationEnabled()
 }
 
 #define DEFAULT_ZOOM 1.0f
 
 void
 nsIPresShell::HandleGlobalZoom()
 {
   float zoomFactor = nsLayoutUtils::SystemFontScale();
+  PRES_LOG("%p: HandleGlobalZoom: System font scale: %f\n", this, zoomFactor);
 
   if (zoomFactor == DEFAULT_ZOOM) {
     if (mGlobalZoomWasEnabled) {
+      PRES_LOG("%p: HandleGlobalZoom: Resetting global zoom", this);
       // We need to reset the applied zoom back to default
       // before being able to stop doing any further zooming.
       SetGlobalZoom(zoomFactor);
       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(DEFAULT_ZOOM);
   }
   mGlobalZoomWasEnabled = true;
 }
 
 void
 nsIPresShell::SetGlobalZoom(float aZoomFactor)
 {