Bug 1328868 - PresShell debug logging draft
authorJan Henning <jh+bugzilla@buttercookie.de>
Sat, 04 Feb 2017 21:15:32 +0100
changeset 482196 9f3473818a7ca0ceb25cb188ae5a156f5a6661eb
parent 482195 c8d992bf82e4abf95919289fae65fb1201d53cfb
child 482197 5e81165e9ee97067cae18316293e296cac4fb60c
push id45026
push usermozilla@buttercookie.de
push dateSat, 11 Feb 2017 13:13:18 +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;
@@ -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)
 {