Backed out 12 changesets (bug 958596) for several Android permafails to fix a CLOSED TREE
authorWes Kocher <wkocher@mozilla.com>
Tue, 25 Feb 2014 18:34:47 -0800
changeset 181609 c9f4f70e46e17db15c78caed8621d8cc4774010b
parent 181608 a4c51a14aaf2a1bce896cc833fdcdf51fe812dcb
child 181610 93c87caa78559b44dc7c65552e2c126f0430db37
push id5439
push userffxbld
push dateMon, 17 Mar 2014 23:08:15 +0000
treeherdermozilla-aurora@c0befb3c8038 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs958596
milestone30.0a1
backs oute4c0e3d3a76857f6b92ef8df7d4d17bfdbd9ffe6
7bc4f48d6b055cf6aaf75e37684bc1c244e01543
89cd12e3db450d571375bd4e83de34945ef45857
2834110533403b231e5bec7b9b0cfcf8ca68c7a0
5329fa8c8847cf7f8da286109429899f1081664b
0d1d26d588e3b9641aa344657e55b8b527307b7c
715fe9eb5dfda2782f59d8efb1c7241dc7c8bb42
66dde9d67ffa7ffb59ffdd4d636ddad9021535fb
79e589f750652a5ea0c1ee54ec7cf6838548e07e
1ed4c880ab70ab3947654f4b9c96539be34b90e9
1d40b0b8036dc5022f0f2f4f824162926e370910
ad35d51d978158ca52ad58ffa46d8965ae6e4673
Backed out 12 changesets (bug 958596) for several Android permafails to fix a CLOSED TREE Backed out changeset e4c0e3d3a768 (bug 958596) Backed out changeset 7bc4f48d6b05 (bug 958596) Backed out changeset 89cd12e3db45 (bug 958596) Backed out changeset 283411053340 (bug 958596) Backed out changeset 5329fa8c8847 (bug 958596) Backed out changeset 0d1d26d588e3 (bug 958596) Backed out changeset 715fe9eb5dfd (bug 958596) Backed out changeset 66dde9d67ffa (bug 958596) Backed out changeset 79e589f75065 (bug 958596) Backed out changeset 1ed4c880ab70 (bug 958596) Backed out changeset 1d40b0b8036d (bug 958596) Backed out changeset ad35d51d9781 (bug 958596)
configure.in
content/base/public/Element.h
content/base/public/nsIContent.h
content/base/src/Element.cpp
gfx/2d/Factory.cpp
gfx/2d/Logging.h
gfx/2d/Rect.h
gfx/2d/Types.h
gfx/2d/moz.build
gfx/ipc/GfxMessageUtils.h
gfx/layers/FrameMetrics.h
gfx/layers/composite/APZCTreeManager.cpp
layout/base/nsDisplayList.cpp
modules/libpref/src/init/all.js
--- a/configure.in
+++ b/configure.in
@@ -7692,17 +7692,16 @@ dnl =
 dnl ========================================================
 MOZ_ARG_HEADER(Static build options)
 
 AC_SUBST(LIBXUL_LIBS)
 XPCOM_LIBS="$LIBXUL_LIBS"
 
 if test "$OS_ARCH" = "WINNT"; then
   GKMEDIAS_SHARED_LIBRARY=1
-  AC_DEFINE(GKMEDIAS_SHARED_LIBRARY)
 fi
 AC_SUBST(GKMEDIAS_SHARED_LIBRARY)
 
 if test -z "$MOZ_NATIVE_ZLIB"; then
 if test -n "$JS_SHARED_LIBRARY" -o "$GKMEDIAS_SHARED_LIBRARY"; then
   ZLIB_IN_MOZGLUE=1
   AC_DEFINE(ZLIB_IN_MOZGLUE)
 fi
--- a/content/base/public/Element.h
+++ b/content/base/public/Element.h
@@ -487,18 +487,16 @@ public:
   {
     List(out, aIndent, EmptyCString());
   }
   virtual void DumpContent(FILE* out, int32_t aIndent, bool aDumpAll) const MOZ_OVERRIDE;
   void List(FILE* out, int32_t aIndent, const nsCString& aPrefix) const;
   void ListAttributes(FILE* out) const;
 #endif
 
-  void Describe(nsAString& aOutDescription) const MOZ_OVERRIDE;
-
   /*
    * Attribute Mapping Helpers
    */
   struct MappedAttributeEntry {
     nsIAtom** attribute;
   };
 
   /**
@@ -511,18 +509,16 @@ public:
   static bool
   FindAttributeDependence(const nsIAtom* aAttribute,
                           const MappedAttributeEntry* const (&aMaps)[N])
   {
     return FindAttributeDependence(aAttribute, aMaps, N);
   }
 
 private:
-  void DescribeAttribute(uint32_t index, nsAString& aOutDescription) const;
-
   static bool
   FindAttributeDependence(const nsIAtom* aAttribute,
                           const MappedAttributeEntry* const aMaps[],
                           uint32_t aMapCount);
 
 protected:
   inline bool GetAttr(int32_t aNameSpaceID, nsIAtom* aName,
                       DOMString& aResult) const
--- a/content/base/public/nsIContent.h
+++ b/content/base/public/nsIContent.h
@@ -945,25 +945,16 @@ public:
   /**
    * Dump the content (and anything it contains) out to the given
    * file stream. Use aIndent as the base indent during formatting.
    */
   virtual void DumpContent(FILE* out = stdout, int32_t aIndent = 0,
                            bool aDumpAll = true) const = 0;
 #endif
 
-  /**
-   * Append to aOutDescription a short (preferably one line) string
-   * describing the content.
-   * Currently implemented for elements only.
-   */
-  virtual void Describe(nsAString& aOutDescription) const {
-    aOutDescription = NS_LITERAL_STRING("(not an element)");
-  }
-
   enum ETabFocusType {
   //eTabFocus_textControlsMask = (1<<0),  // unused - textboxes always tabbable
     eTabFocus_formElementsMask = (1<<1),  // non-text form elements
     eTabFocus_linksMask = (1<<2),         // links
     eTabFocus_any = 1 + (1<<1) + (1<<2)   // everything that can be focused
   };
 
   // Tab focus model bit field:
--- a/content/base/src/Element.cpp
+++ b/content/base/src/Element.cpp
@@ -2127,45 +2127,40 @@ Element::GetAttrNameAt(uint32_t aIndex) 
 }
 
 uint32_t
 Element::GetAttrCount() const
 {
   return mAttrsAndChildren.AttrCount();
 }
 
-void
-Element::DescribeAttribute(uint32_t index, nsAString& aOutDescription) const
-{
-  // name
-  mAttrsAndChildren.AttrNameAt(index)->GetQualifiedName(aOutDescription);
-
-  // value
-  aOutDescription.AppendLiteral("=\"");
-  nsAutoString value;
-  mAttrsAndChildren.AttrAt(index)->ToString(value);
-  for (int i = value.Length(); i >= 0; --i) {
-    if (value[i] == char16_t('"'))
-      value.Insert(char16_t('\\'), uint32_t(i));
-  }
-  aOutDescription.Append(value);
-  aOutDescription.AppendLiteral("\"");
-}
-
 #ifdef DEBUG
 void
 Element::ListAttributes(FILE* out) const
 {
   uint32_t index, count = mAttrsAndChildren.AttrCount();
   for (index = 0; index < count; index++) {
-    nsAutoString attributeDescription;
-    DescribeAttribute(index, attributeDescription);
+    nsAutoString buffer;
+
+    // name
+    mAttrsAndChildren.AttrNameAt(index)->GetQualifiedName(buffer);
+
+    // value
+    buffer.AppendLiteral("=\"");
+    nsAutoString value;
+    mAttrsAndChildren.AttrAt(index)->ToString(value);
+    for (int i = value.Length(); i >= 0; --i) {
+      if (value[i] == char16_t('"'))
+        value.Insert(char16_t('\\'), uint32_t(i));
+    }
+    buffer.Append(value);
+    buffer.AppendLiteral("\"");
 
     fputs(" ", out);
-    fputs(NS_LossyConvertUTF16toASCII(attributeDescription).get(), out);
+    fputs(NS_LossyConvertUTF16toASCII(buffer).get(), out);
   }
 }
 
 void
 Element::List(FILE* out, int32_t aIndent,
               const nsCString& aPrefix) const
 {
   int32_t indent;
@@ -2279,31 +2274,16 @@ Element::DumpContent(FILE* out, int32_t 
   fputs("</", out);
   fputs(NS_LossyConvertUTF16toASCII(buf).get(), out);
   fputs(">", out);
 
   if(aIndent) fputs("\n", out);
 }
 #endif
 
-void
-Element::Describe(nsAString& aOutDescription) const
-{
-  aOutDescription.Append(mNodeInfo->QualifiedName());
-  aOutDescription.AppendPrintf("@%p", (void *)this);
-
-  uint32_t index, count = mAttrsAndChildren.AttrCount();
-  for (index = 0; index < count; index++) {
-    aOutDescription.Append(' ');
-    nsAutoString attributeDescription;
-    DescribeAttribute(index, attributeDescription);
-    aOutDescription.Append(attributeDescription);
-  }
-}
-
 bool
 Element::CheckHandleEventForLinksPrecondition(nsEventChainVisitor& aVisitor,
                                               nsIURI** aURI) const
 {
   if (aVisitor.mEventStatus == nsEventStatus_eConsumeNoDefault ||
       (!aVisitor.mEvent->mFlags.mIsTrusted &&
        (aVisitor.mEvent->message != NS_MOUSE_CLICK) &&
        (aVisitor.mEvent->message != NS_KEY_PRESS) &&
--- a/gfx/2d/Factory.cpp
+++ b/gfx/2d/Factory.cpp
@@ -48,18 +48,18 @@
 #include "SourceSurfaceRawData.h"
 
 #include "DrawEventRecorder.h"
 
 #include "Logging.h"
 
 #include "mozilla/CheckedInt.h"
 
-#if defined(DEBUG) || defined(PR_LOGGING)
-GFX2D_API PRLogModuleInfo *
+#ifdef PR_LOGGING
+PRLogModuleInfo *
 GetGFX2DLog()
 {
   static PRLogModuleInfo *sLog;
   if (!sLog)
     sLog = PR_NewLogModule("gfx2d");
   return sLog;
 }
 #endif
@@ -151,17 +151,17 @@ HasCPUIDBit(unsigned int level, CPUIDReg
 }
 #endif
 #endif
 
 namespace mozilla {
 namespace gfx {
 
 // XXX - Need to define an API to set this.
-GFX2D_API int sGfxLogLevel = LOG_DEBUG;
+int sGfxLogLevel = LOG_DEBUG;
 
 #ifdef WIN32
 ID3D10Device1 *Factory::mD3D10Device;
 #ifdef USE_D2D1_1
 ID3D11Device *Factory::mD3D11Device;
 ID2D1Device *Factory::mD2D1Device;
 #endif
 #endif
--- a/gfx/2d/Logging.h
+++ b/gfx/2d/Logging.h
@@ -5,233 +5,124 @@
 
 #ifndef MOZILLA_GFX_LOGGING_H_
 #define MOZILLA_GFX_LOGGING_H_
 
 #include <string>
 #include <sstream>
 #include <stdio.h>
 
-#include "nsDebug.h"
 #include "Point.h"
-#include "BaseRect.h"
 #include "Matrix.h"
-#include "mozilla/TypedEnum.h"
 
 #ifdef WIN32
-// This file gets included from nsGlobalWindow.cpp, which doesn't like
-// having windows.h included in it. Since OutputDebugStringA is the only
-// thing we need from windows.h, we just declare it here directly.
-// Note: the function's documented signature is
-//  WINBASEAPI void WINAPI OutputDebugStringA(LPCSTR lpOutputString)
-// but if we don't include windows.h, the macros WINBASEAPI, WINAPI, and 
-// LPCSTR are not defined, so we need to replace them with their expansions.
-extern "C" __declspec(dllimport) void __stdcall OutputDebugStringA(const char* lpOutputString);
+#include <windows.h>
 #endif
 
-#if defined(DEBUG) || defined(PR_LOGGING)
+#ifdef PR_LOGGING
 #include <prlog.h>
 
-extern GFX2D_API PRLogModuleInfo *GetGFX2DLog();
+extern PRLogModuleInfo *GetGFX2DLog();
 #endif
 
 namespace mozilla {
 namespace gfx {
 
 const int LOG_DEBUG = 1;
 const int LOG_WARNING = 2;
 
-#if defined(DEBUG) || defined(PR_LOGGING)
+#ifdef PR_LOGGING
 
 inline PRLogModuleLevel PRLogLevelForLevel(int aLevel) {
   switch (aLevel) {
   case LOG_DEBUG:
     return PR_LOG_DEBUG;
   case LOG_WARNING:
     return PR_LOG_WARNING;
   }
   return PR_LOG_DEBUG;
 }
 
 #endif
 
-extern GFX2D_API int sGfxLogLevel;
+extern int sGfxLogLevel;
 
 static inline void OutputMessage(const std::string &aString, int aLevel) {
 #if defined(WIN32) && !defined(PR_LOGGING)
   if (aLevel >= sGfxLogLevel) {
     ::OutputDebugStringA(aString.c_str());
   }
-#elif defined(PR_LOGGING) && !(defined(MOZ_WIDGET_GONK) || defined(MOZ_WIDGET_ANDROID))
+#elif defined(PR_LOGGING)
   if (PR_LOG_TEST(GetGFX2DLog(), PRLogLevelForLevel(aLevel))) {
     PR_LogPrint(aString.c_str());
   }
 #else
   if (aLevel >= sGfxLogLevel) {
-    printf_stderr("%s", aString.c_str());
+    printf("%s", aString.c_str());
   }
 #endif
 }
 
 class NoLog
 {
 public:
   NoLog() {}
   ~NoLog() {}
 
   template<typename T>
   NoLog &operator <<(const T &aLogText) { return *this; }
 };
 
-MOZ_BEGIN_ENUM_CLASS(LogOptions, int)
-  NoNewline = 0x01
-MOZ_END_ENUM_CLASS(LogOptions)
-
 template<int L>
 class Log
 {
 public:
-  Log(LogOptions aOptions = LogOptions(0)) : mOptions(aOptions) {}
-  ~Log() {
-    Flush();
-  }
+  Log() {}
+  ~Log() { mMessage << '\n'; WriteLog(mMessage.str()); }
 
-  void Flush() {
-    if (!(int(mOptions) & int(LogOptions::NoNewline))) {
-      mMessage << '\n';
-    }
-    std::string str = mMessage.str();
-    if (!str.empty()) {
-      WriteLog(str);
-    }
-    mMessage.str("");
-    mMessage.clear();
-  }
-
-  Log &operator <<(char aChar) { mMessage << aChar; return *this; }
   Log &operator <<(const std::string &aLogText) { mMessage << aLogText; return *this; }
   Log &operator <<(const char aStr[]) { mMessage << static_cast<const char*>(aStr); return *this; }
   Log &operator <<(bool aBool) { mMessage << (aBool ? "true" : "false"); return *this; }
-  Log &operator <<(int32_t aInt) { mMessage << aInt; return *this; }
-  Log &operator <<(uint32_t aInt) { mMessage << aInt; return *this; }
-  Log &operator <<(int64_t aLong) { mMessage << aLong; return *this; }
-  Log &operator <<(uint64_t aLong) { mMessage << aLong; return *this; }
+  Log &operator <<(int aInt) { mMessage << aInt; return *this; }
+  Log &operator <<(unsigned int aInt) { mMessage << aInt; return *this; }
+  Log &operator <<(long aLong) { mMessage << aLong; return *this; }
+  Log &operator <<(unsigned long aLong) { mMessage << aLong; return *this; }
   Log &operator <<(Float aFloat) { mMessage << aFloat; return *this; }
   Log &operator <<(double aDouble) { mMessage << aDouble; return *this; }
-  template <typename T, typename Sub>
-  Log &operator <<(const BasePoint<T, Sub>& aPoint)
+  Log &operator <<(const Point &aPoint)
     { mMessage << "Point(" << aPoint.x << "," << aPoint.y << ")"; return *this; }
-  template <typename T, typename Sub>
-  Log &operator <<(const BaseSize<T, Sub>& aSize)
+  Log &operator <<(const Size &aSize)
     { mMessage << "Size(" << aSize.width << "," << aSize.height << ")"; return *this; }
-  template <typename T, typename Sub, typename Point, typename SizeT, typename Margin>
-  Log &operator <<(const BaseRect<T, Sub, Point, SizeT, Margin>& aRect)
+  Log &operator <<(const IntSize &aSize)
+    { mMessage << "IntSize(" << aSize.width << "," << aSize.height << ")"; return *this; }
+  Log &operator <<(const Rect &aRect)
     { mMessage << "Rect(" << aRect.x << "," << aRect.y << "," << aRect.width << "," << aRect.height << ")"; return *this; }
   Log &operator<<(const Matrix& aMatrix)
     { mMessage << "Matrix(" << aMatrix._11 << " " << aMatrix._12 << " ; " << aMatrix._21 << " " << aMatrix._22 << " ; " << aMatrix._31 << " " << aMatrix._32 << ")"; return *this; }
 
 
 private:
 
   void WriteLog(const std::string &aString) {
     OutputMessage(aString, L);
   }
 
   std::stringstream mMessage;
-  LogOptions mOptions;
 };
 
 typedef Log<LOG_DEBUG> DebugLog;
 typedef Log<LOG_WARNING> WarningLog;
 
 #ifdef GFX_LOG_DEBUG
 #define gfxDebug DebugLog
 #else
 #define gfxDebug if (1) ; else NoLog
 #endif
 #ifdef GFX_LOG_WARNING
 #define gfxWarning WarningLog
 #else
 #define gfxWarning if (1) ; else NoLog
 #endif
 
-const int INDENT_PER_LEVEL = 2;
-
-class TreeLog
-{
-public:
-  TreeLog(const std::string& aPrefix = "")
-        : mLog(LogOptions::NoNewline),
-          mPrefix(aPrefix),
-          mDepth(0),
-          mStartOfLine(true),
-          mConditionedOnPref(false),
-          mPref(nullptr) {}
-
-  template <typename T>
-  TreeLog& operator<<(const T& aObject) {
-    if (mConditionedOnPref && !*mPref) {
-      return *this;
-    }
-    if (mStartOfLine) {
-      mLog << '[' << mPrefix << "] " << std::string(mDepth * INDENT_PER_LEVEL, ' ');
-      mStartOfLine = false;
-    }
-    mLog << aObject;
-    if (EndsInNewline(aObject)) {
-      // Don't indent right here as the user may change the indent
-      // between now and the first output to the next line.
-      mLog.Flush();
-      mStartOfLine = true;
-    }
-    return *this;
-  }
-
-  void IncreaseIndent() { ++mDepth; }
-  void DecreaseIndent() { --mDepth; }
-
-  void ConditionOnPref(bool* aPref) {
-    mConditionedOnPref = true;
-    mPref = aPref;
-  }
-private:
-  Log<LOG_DEBUG> mLog;
-  std::string mPrefix;
-  uint32_t mDepth;
-  bool mStartOfLine;
-  bool mConditionedOnPref;
-  bool* mPref;
-
-  template <typename T>
-  static bool EndsInNewline(const T& aObject) {
-    return false;
-  }
-
-  static bool EndsInNewline(const std::string& aString) {
-    return !aString.empty() && aString[aString.length() - 1] == '\n';
-  }
-
-  static bool EndsInNewline(char aChar) {
-    return aChar == '\n';
-  }
-
-  static bool EndsInNewline(const char* aString) {
-    return EndsInNewline(std::string(aString));
-  }
-};
-
-class TreeAutoIndent
-{
-public:
-  TreeAutoIndent(TreeLog& aTreeLog) : mTreeLog(aTreeLog) {
-    mTreeLog.IncreaseIndent();
-  }
-  ~TreeAutoIndent() {
-    mTreeLog.DecreaseIndent();
-  }
-private:
-  TreeLog& mTreeLog;
-};
-
 }
 }
 
 #endif /* MOZILLA_GFX_LOGGING_H_ */
--- a/gfx/2d/Rect.h
+++ b/gfx/2d/Rect.h
@@ -92,17 +92,17 @@ struct RectTyped :
     RectTyped(const PointTyped<units>& aPos, const SizeTyped<units>& aSize) :
         Super(aPos, aSize) {}
     RectTyped(Float _x, Float _y, Float _width, Float _height) :
         Super(_x, _y, _width, _height) {}
     explicit RectTyped(const IntRectTyped<units>& rect) :
         Super(float(rect.x), float(rect.y),
               float(rect.width), float(rect.height)) {}
 
-    void NudgeToIntegers()
+    GFX2D_API void NudgeToIntegers()
     {
       NudgeToInteger(&(this->x));
       NudgeToInteger(&(this->y));
       NudgeToInteger(&(this->width));
       NudgeToInteger(&(this->height));
     }
 
     bool ToIntRect(IntRectTyped<units> *aOut) const
--- a/gfx/2d/Types.h
+++ b/gfx/2d/Types.h
@@ -241,17 +241,17 @@ struct GradientStop
 
   Float offset;
   Color color;
 };
 
 }
 }
 
-#if defined(XP_WIN) && defined(GKMEDIAS_SHARED_LIBRARY)
+#if defined(XP_WIN) && defined(MOZ_GFX)
 #ifdef GFX2D_INTERNAL
 #define GFX2D_API __declspec(dllexport)
 #else
 #define GFX2D_API __declspec(dllimport)
 #endif
 #else
 #define GFX2D_API
 #endif
--- a/gfx/2d/moz.build
+++ b/gfx/2d/moz.build
@@ -16,17 +16,16 @@ EXPORTS.mozilla.gfx += [
     'BasePoint4D.h',
     'BaseRect.h',
     'BaseSize.h',
     'Blur.h',
     'BorrowedContext.h',
     'DataSurfaceHelpers.h',
     'Filters.h',
     'Helpers.h',
-    'Logging.h',
     'Matrix.h',
     'PathHelpers.h',
     'Point.h',
     'Rect.h',
     'Scale.h',
     'ScaleFactor.h',
     'Tools.h',
     'Types.h',
--- a/gfx/ipc/GfxMessageUtils.h
+++ b/gfx/ipc/GfxMessageUtils.h
@@ -618,17 +618,16 @@ struct ParamTraits<mozilla::layers::Fram
     WriteParam(aMsg, aParam.mMayHaveTouchListeners);
     WriteParam(aMsg, aParam.mPresShellId);
     WriteParam(aMsg, aParam.mIsRoot);
     WriteParam(aMsg, aParam.mHasScrollgrab);
     WriteParam(aMsg, aParam.mDisableScrollingX);
     WriteParam(aMsg, aParam.mDisableScrollingY);
     WriteParam(aMsg, aParam.mUpdateScrollOffset);
     WriteParam(aMsg, aParam.mScrollGeneration);
-    WriteParam(aMsg, aParam.mContentDescription);
   }
 
   static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
   {
     return (ReadParam(aMsg, aIter, &aResult->mScrollableRect) &&
             ReadParam(aMsg, aIter, &aResult->mViewport) &&
             ReadParam(aMsg, aIter, &aResult->mScrollOffset) &&
             ReadParam(aMsg, aIter, &aResult->mDisplayPort) &&
@@ -641,18 +640,17 @@ struct ParamTraits<mozilla::layers::Fram
             ReadParam(aMsg, aIter, &aResult->mDevPixelsPerCSSPixel) &&
             ReadParam(aMsg, aIter, &aResult->mMayHaveTouchListeners) &&
             ReadParam(aMsg, aIter, &aResult->mPresShellId) &&
             ReadParam(aMsg, aIter, &aResult->mIsRoot) &&
             ReadParam(aMsg, aIter, &aResult->mHasScrollgrab) &&
             ReadParam(aMsg, aIter, &aResult->mDisableScrollingX) &&
             ReadParam(aMsg, aIter, &aResult->mDisableScrollingY) &&
             ReadParam(aMsg, aIter, &aResult->mUpdateScrollOffset) &&
-            ReadParam(aMsg, aIter, &aResult->mScrollGeneration) &&
-            ReadParam(aMsg, aIter, &aResult->mContentDescription));
+            ReadParam(aMsg, aIter, &aResult->mScrollGeneration));
   }
 };
 
 template<>
 struct ParamTraits<mozilla::layers::TextureFactoryIdentifier>
 {
   typedef mozilla::layers::TextureFactoryIdentifier paramType;
 
--- a/gfx/layers/FrameMetrics.h
+++ b/gfx/layers/FrameMetrics.h
@@ -2,22 +2,20 @@
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef GFX_FRAMEMETRICS_H
 #define GFX_FRAMEMETRICS_H
 
 #include <stdint.h>                     // for uint32_t, uint64_t
-#include <string>                       // for std::string
 #include "Units.h"                      // for CSSRect, CSSPixel, etc
 #include "mozilla/gfx/BasePoint.h"      // for BasePoint
 #include "mozilla/gfx/Rect.h"           // for RoundedIn
 #include "mozilla/gfx/ScaleFactor.h"    // for ScaleFactor
-#include "mozilla/gfx/Logging.h"        // for Log
 
 namespace IPC {
 template <typename T> struct ParamTraits;
 } // namespace IPC
 
 namespace mozilla {
 namespace layers {
 
@@ -67,18 +65,16 @@ public:
     , mUpdateScrollOffset(false)
     , mScrollGeneration(0)
   {}
 
   // Default copy ctor and operator= are fine
 
   bool operator==(const FrameMetrics& aOther) const
   {
-    // mContentDescription is not compared on purpose as it's only used
-    // for debugging.
     return mCompositionBounds.IsEqualEdges(aOther.mCompositionBounds) &&
            mDisplayPort.IsEqualEdges(aOther.mDisplayPort) &&
            mCriticalDisplayPort.IsEqualEdges(aOther.mCriticalDisplayPort) &&
            mViewport.IsEqualEdges(aOther.mViewport) &&
            mScrollOffset == aOther.mScrollOffset &&
            mScrollId == aOther.mScrollId &&
            mScrollableRect.IsEqualEdges(aOther.mScrollableRect) &&
            mResolution == aOther.mResolution &&
@@ -335,44 +331,30 @@ public:
     return mUpdateScrollOffset;
   }
 
   uint32_t GetScrollGeneration() const
   {
     return mScrollGeneration;
   }
 
-  const std::string& GetContentDescription() const
-  {
-    return mContentDescription;
-  }
-
-  void SetContentDescription(const std::string& aContentDescription)
-  {
-    mContentDescription = aContentDescription;
-  }
-
 private:
   // New fields from now on should be made private and old fields should
   // be refactored to be private.
 
   // Allow disabling scrolling in individual axis to support
   // |overflow: hidden|.
   bool mDisableScrollingX;
   bool mDisableScrollingY;
 
   // Whether mScrollOffset was updated by something other than the APZ code, and
   // if the APZC receiving this metrics should update its local copy.
   bool mUpdateScrollOffset;
   // The scroll generation counter used to acknowledge the scroll offset update.
   uint32_t mScrollGeneration;
-
-  // A description of the content element corresponding to this frame.
-  // This is empty unless the apz.printtree pref is turned on.
-  std::string mContentDescription;
 };
 
 /**
  * This class allows us to uniquely identify a scrollable layer. The
  * mLayersId identifies the layer tree (corresponding to a child process
  * and/or tab) that the scrollable layer belongs to. The mPresShellId
  * is a temporal identifier (corresponding to the document loaded that
  * contains the scrollable layer, which may change over time). The
@@ -421,21 +403,16 @@ struct ScrollableLayerGuid {
   }
 
   bool operator!=(const ScrollableLayerGuid& other) const
   {
     return !(*this == other);
   }
 };
 
-template <int LogLevel>
-gfx::Log<LogLevel>& operator<<(gfx::Log<LogLevel>& log, const ScrollableLayerGuid& aGuid) {
-  return log << '(' << aGuid.mLayersId << ',' << aGuid.mPresShellId << ',' << aGuid.mScrollId << ')';
-}
-
 struct ZoomConstraints {
   bool mAllowZoom;
   bool mAllowDoubleTapZoom;
   CSSToScreenScale mMinZoom;
   CSSToScreenScale mMaxZoom;
 
   ZoomConstraints()
     : mAllowZoom(true)
--- a/gfx/layers/composite/APZCTreeManager.cpp
+++ b/gfx/layers/composite/APZCTreeManager.cpp
@@ -11,45 +11,36 @@
 #include "Layers.h"                     // for ContainerLayer, Layer, etc
 #include "gfx3DMatrix.h"                // for gfx3DMatrix
 #include "mozilla/dom/Touch.h"          // for Touch
 #include "mozilla/gfx/Point.h"          // for Point
 #include "mozilla/layers/AsyncPanZoomController.h"
 #include "mozilla/MouseEvents.h"
 #include "mozilla/mozalloc.h"           // for operator new
 #include "mozilla/TouchEvents.h"
-#include "mozilla/Preferences.h"        // for Preferences
 #include "nsDebug.h"                    // for NS_WARNING
 #include "nsPoint.h"                    // for nsIntPoint
 #include "nsThreadUtils.h"              // for NS_IsMainThread
-#include "mozilla/gfx/Logging.h"        // for gfx::TreeLog
 
 #include <algorithm>                    // for std::stable_sort
 
 #define APZC_LOG(...)
 // #define APZC_LOG(...) printf_stderr("APZC: " __VA_ARGS__)
 
 namespace mozilla {
 namespace layers {
 
 float APZCTreeManager::sDPI = 160.0;
 
-// Pref that enables printing of the APZC tree for debugging.
-static bool gPrintApzcTree = false;
-
-gfx::TreeLog sApzcTreeLog("apzctree");
-
 APZCTreeManager::APZCTreeManager()
     : mTreeLock("APZCTreeLock"),
       mTouchCount(0)
 {
   MOZ_ASSERT(NS_IsMainThread());
   AsyncPanZoomController::InitializeGlobalState();
-  Preferences::AddBoolVarCache(&gPrintApzcTree, "apz.printtree", gPrintApzcTree);
-  sApzcTreeLog.ConditionOnPref(&gPrintApzcTree);
 }
 
 APZCTreeManager::~APZCTreeManager()
 {
 }
 
 void
 APZCTreeManager::GetAllowedTouchBehavior(WidgetInputEvent* aEvent,
@@ -120,25 +111,23 @@ APZCTreeManager::UpdatePanZoomController
   // we are sure that the layer was removed and not just transplanted elsewhere. Doing that
   // as part of a recursive tree walk is hard and so maintaining a list and removing
   // APZCs that are still alive is much simpler.
   nsTArray< nsRefPtr<AsyncPanZoomController> > apzcsToDestroy;
   Collect(mRootApzc, &apzcsToDestroy);
   mRootApzc = nullptr;
 
   if (aRoot) {
-    sApzcTreeLog << "[start]\n";
     UpdatePanZoomControllerTree(aCompositor,
                                 aRoot,
                                 // aCompositor is null in gtest scenarios
                                 aCompositor ? aCompositor->RootLayerTreeId() : 0,
                                 gfx3DMatrix(), nullptr, nullptr,
                                 aIsFirstPaint, aFirstPaintLayersId,
                                 &apzcsToDestroy);
-    sApzcTreeLog << "[end]\n";
   }
 
   for (size_t i = 0; i < apzcsToDestroy.Length(); i++) {
     APZC_LOG("Destroying APZC at %p\n", apzcsToDestroy[i].get());
     apzcsToDestroy[i]->Destroy();
   }
 }
 
@@ -150,45 +139,44 @@ APZCTreeManager::UpdatePanZoomController
                                              AsyncPanZoomController* aNextSibling,
                                              bool aIsFirstPaint, uint64_t aFirstPaintLayersId,
                                              nsTArray< nsRefPtr<AsyncPanZoomController> >* aApzcsToDestroy)
 {
   mTreeLock.AssertCurrentThreadOwns();
 
   ContainerLayer* container = aLayer->AsContainerLayer();
   AsyncPanZoomController* apzc = nullptr;
-  sApzcTreeLog << aLayer->Name() << '\t';
   if (container) {
     if (container->GetFrameMetrics().IsScrollable()) {
       const CompositorParent::LayerTreeState* state = CompositorParent::GetIndirectShadowTree(aLayersId);
       if (state && state->mController.get()) {
         // If we get here, aLayer is a scrollable container layer and somebody
         // has registered a GeckoContentController for it, so we need to ensure
         // it has an APZC instance to manage its scrolling.
 
         apzc = container->GetAsyncPanZoomController();
 
         // If the content represented by the container layer has changed (which may
         // be possible because of DLBI heuristics) then we don't want to keep using
         // the same old APZC for the new content. Null it out so we run through the
         // code to find another one or create one.
-        ScrollableLayerGuid guid(aLayersId, container->GetFrameMetrics());
-        if (apzc && !apzc->Matches(guid)) {
+        if (apzc && !apzc->Matches(ScrollableLayerGuid(aLayersId, container->GetFrameMetrics()))) {
           apzc = nullptr;
         }
 
         // If the container doesn't have an APZC already, try to find one of our
         // pre-existing ones that matches. In particular, if we find an APZC whose
         // ScrollableLayerGuid is the same, then we know what happened is that the
         // layout of the page changed causing the layer tree to be rebuilt, but the
         // underlying content for which the APZC was originally created is still
         // there. So it makes sense to pick up that APZC instance again and use it here.
         if (apzc == nullptr) {
+          ScrollableLayerGuid target(aLayersId, container->GetFrameMetrics());
           for (size_t i = 0; i < aApzcsToDestroy->Length(); i++) {
-            if (aApzcsToDestroy->ElementAt(i)->Matches(guid)) {
+            if (aApzcsToDestroy->ElementAt(i)->Matches(target)) {
               apzc = aApzcsToDestroy->ElementAt(i);
               break;
             }
           }
         }
 
         // The APZC we get off the layer may have been destroyed previously if the layer was inactive
         // or omitted from the layer tree for whatever reason from a layers update. If it later comes
@@ -229,21 +217,16 @@ APZCTreeManager::UpdatePanZoomController
         gfx3DMatrix transform;
         gfx::To3DMatrix(aLayer->GetTransform(), transform);
 
         apzc->SetLayerHitTestData(visible, aTransform, transform);
         APZC_LOG("Setting rect(%f %f %f %f) as visible region for APZC %p\n", visible.x, visible.y,
                                                                               visible.width, visible.height,
                                                                               apzc);
 
-        sApzcTreeLog << "APZC " << guid
-                     << "\tcb=" << visible
-                     << "\tsr=" << container->GetFrameMetrics().mScrollableRect
-                     << "\t" << container->GetFrameMetrics().GetContentDescription();
-
         // Bind the APZC instance into the tree of APZCs
         if (aNextSibling) {
           aNextSibling->SetPrevSibling(apzc);
         } else if (aParent) {
           aParent->SetLastChild(apzc);
         } else {
           mRootApzc = apzc;
         }
@@ -268,17 +251,16 @@ APZCTreeManager::UpdatePanZoomController
             apzc->UpdateZoomConstraints(apzc->GetParent()->GetZoomConstraints());
           }
         }
       }
     }
 
     container->SetAsyncPanZoomController(apzc);
   }
-  sApzcTreeLog << '\n';
 
   // Accumulate the CSS transform between layers that have an APZC, but exclude any
   // any layers that do have an APZC, and reset the accumulation at those layers.
   if (apzc) {
     aTransform = gfx3DMatrix();
   } else {
     // Multiply child layer transforms on the left so they get applied first
     gfx3DMatrix matrix;
@@ -286,17 +268,16 @@ APZCTreeManager::UpdatePanZoomController
     aTransform = matrix * aTransform;
   }
 
   uint64_t childLayersId = (aLayer->AsRefLayer() ? aLayer->AsRefLayer()->GetReferentId() : aLayersId);
   // If there's no APZC at this level, any APZCs for our child layers will
   // have our siblings as siblings.
   AsyncPanZoomController* next = apzc ? nullptr : aNextSibling;
   for (Layer* child = aLayer->GetLastChild(); child; child = child->GetPrevSibling()) {
-    gfx::TreeAutoIndent indent(sApzcTreeLog);
     next = UpdatePanZoomControllerTree(aCompositor, child, childLayersId, aTransform, aParent, next,
                                        aIsFirstPaint, aFirstPaintLayersId, aApzcsToDestroy);
   }
 
   // Return the APZC that should be the sibling of other APZCs as we continue
   // moving towards the first child at this depth in the layer tree.
   // If this layer doesn't have an APZC, we promote any APZCs in the subtree
   // upwards. Otherwise we fall back to the aNextSibling that was passed in.
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -587,27 +587,16 @@ static void AdjustForScrollBars(ScreenIn
   if (aScrollableFrame && !LookAndFeel::GetInt(LookAndFeel::eIntID_UseOverlayScrollbars)) {
     nsMargin sizes = aScrollableFrame->GetActualScrollbarSizes();
     // Scrollbars are not subject to scaling, so CSS pixels = screen pixels for them.
     ScreenIntMargin boundMargins = RoundedToInt(CSSMargin::FromAppUnits(sizes) * CSSToScreenScale(1.0f));
     aToAdjust.Deflate(boundMargins);
   }
 }
 
-static bool gPrintApzcTree = false;
-
-static bool GetApzcTreePrintPref() {
-  static bool initialized = false;
-  if (!initialized) {
-    Preferences::AddBoolVarCache(&gPrintApzcTree, "apz.printtree", gPrintApzcTree);
-    initialized = true;
-  }
-  return gPrintApzcTree;
-}
-
 static void RecordFrameMetrics(nsIFrame* aForFrame,
                                nsIFrame* aScrollFrame,
                                const nsIFrame* aReferenceFrame,
                                ContainerLayer* aRoot,
                                const nsRect& aVisibleRect,
                                const nsRect& aViewport,
                                nsRect* aDisplayPort,
                                nsRect* aCriticalDisplayPort,
@@ -739,24 +728,16 @@ static void RecordFrameMetrics(nsIFrame*
 
   // Adjust composition bounds for the size of scroll bars.
   // If the widget bounds were used to clamp the composition bounds,
   // this adjustment was already made to the widget bounds.
   if (!useWidgetBounds) {
     AdjustForScrollBars(metrics.mCompositionBounds, scrollableFrame);
   }
 
-  if (GetApzcTreePrintPref()) {
-    if (nsIContent* content = frameForCompositionBoundsCalculation->GetContent()) {
-      nsAutoString contentDescription;
-      content->Describe(contentDescription);
-      metrics.SetContentDescription(NS_LossyConvertUTF16toASCII(contentDescription).get());
-    }
-  }
-
   metrics.mPresShellId = presShell->GetPresShellId();
 
   // If the scroll frame's content is marked 'scrollgrab', record this
   // in the FrameMetrics so APZ knows to provide the scroll grabbing
   // behaviour.
   if (aScrollFrame && nsContentUtils::HasScrollgrab(aScrollFrame->GetContent())) {
     metrics.mHasScrollgrab = true;
   }
--- a/modules/libpref/src/init/all.js
+++ b/modules/libpref/src/init/all.js
@@ -303,19 +303,16 @@ pref("media.video_stats.enabled", true);
 pref("media.audio_data.enabled", false);
 
 // Whether to lock touch scrolling to one axis at a time
 // 0 = FREE (No locking at all)
 // 1 = STANDARD (Once locked, remain locked until scrolling ends)
 // 2 = STICKY (Allow lock to be broken, with hysteresis)
 pref("apz.axis_lock_mode", 0);
 
-// Whether to print the APZC tree for debugging
-pref("apz.printtree", false);
-
 #ifdef XP_MACOSX
 // Whether to run in native HiDPI mode on machines with "Retina"/HiDPI display;
 //   <= 0 : hidpi mode disabled, display will just use pixel-based upscaling
 //   == 1 : hidpi supported if all screens share the same backingScaleFactor
 //   >= 2 : hidpi supported even with mixed backingScaleFactors (somewhat broken)
 pref("gfx.hidpi.enabled", 2);
 #endif