Bug 1109873 - Allow the APZC stored in the HitTestingTreeNode to be null. r=botond
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 08 Jan 2015 09:40:01 -0500
changeset 222775 6f5ff015b5e636091b8627ccde5b6dc48340ecc6
parent 222774 160acaa4fc44797106a5b7ca703cc92c8f790342
child 222776 c8c65c2ef9bf36ef9a1d19f32ea0dc345c259ccb
push id28073
push userkwierso@gmail.com
push dateFri, 09 Jan 2015 01:08:23 +0000
treeherdermozilla-central@b3f84cf78dc2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbotond
bugs1109873
milestone37.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1109873 - Allow the APZC stored in the HitTestingTreeNode to be null. r=botond
gfx/layers/apz/src/APZCTreeManager.cpp
gfx/layers/apz/src/HitTestingTreeNode.cpp
gfx/layers/apz/src/HitTestingTreeNode.h
gfx/tests/gtest/TestAsyncPanZoomController.cpp
--- a/gfx/layers/apz/src/APZCTreeManager.cpp
+++ b/gfx/layers/apz/src/APZCTreeManager.cpp
@@ -202,17 +202,17 @@ APZCTreeManager::UpdateHitTestingTree(Co
                          Matrix4x4(), nullptr, nullptr, nsIntRegion());
     mApzcTreeLog << "[end]\n";
   }
   MOZ_ASSERT(state.mEventRegions.Length() == 0);
 
   for (size_t i = 0; i < state.mNodesToDestroy.Length(); i++) {
     APZCTM_LOG("Destroying node at %p with APZC %p\n",
         state.mNodesToDestroy[i].get(),
-        state.mNodesToDestroy[i]->Apzc());
+        state.mNodesToDestroy[i]->GetApzc());
     state.mNodesToDestroy[i]->Destroy();
   }
 }
 
 // Compute the touch-sensitive region of an APZC. This is used only when
 // event-regions are disabled.
 static nsIntRegion
 ComputeTouchSensitiveRegion(GeckoContentController* aController,
@@ -339,24 +339,24 @@ APZCTreeManager::PrepareNodeForLayer(con
     // We particularly want to find the primary-holder node from the previous
     // tree that matches, because we don't want that node to get destroyed. If
     // it does get destroyed, then the APZC will get destroyed along with it by
     // definition, but we want to keep that APZC around in the new tree.
     // We leave non-primary-holder nodes in the destroy list because we don't
     // care about those nodes getting destroyed.
     for (size_t i = 0; i < aState.mNodesToDestroy.Length(); i++) {
       nsRefPtr<HitTestingTreeNode> n = aState.mNodesToDestroy[i];
-      if (n->IsPrimaryHolder() && n->Apzc()->Matches(guid)) {
+      if (n->IsPrimaryHolder() && n->GetApzc() && n->GetApzc()->Matches(guid)) {
         node = n;
         if (apzc != nullptr) {
           // If there is an APZC already then it should match the one from the
           // old primary-holder node
-          MOZ_ASSERT(apzc == node->Apzc());
+          MOZ_ASSERT(apzc == node->GetApzc());
         }
-        apzc = node->Apzc();
+        apzc = node->GetApzc();
         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 back it will have a reference to
     // a destroyed APZC and so we need to throw that out and make a new one.
@@ -383,17 +383,17 @@ APZCTreeManager::PrepareNodeForLayer(con
     APZCTM_LOG("Using APZC %p for layer %p with identifiers %" PRId64 " %" PRId64 "\n", apzc, aLayer.GetLayer(), aLayersId, aMetrics.GetScrollId());
 
     apzc->NotifyLayersUpdated(aMetrics,
         aState.mIsFirstPaint && (aLayersId == aState.mOriginatingLayersId));
 
     // Since this is the first time we are encountering an APZC with this guid,
     // the node holding it must be the primary holder. It may be newly-created
     // or not, depending on whether it went through the newApzc branch above.
-    MOZ_ASSERT(node->IsPrimaryHolder() && node->Apzc()->Matches(guid));
+    MOZ_ASSERT(node->IsPrimaryHolder() && node->GetApzc() && node->GetApzc()->Matches(guid));
 
     if (!gfxPrefs::LayoutEventRegionsEnabled()) {
       nsIntRegion unobscured = ComputeTouchSensitiveRegion(state->mController, aMetrics, aObscured);
       node->SetHitTestData(EventRegions(), Matrix4x4(), unobscured);
       APZCTM_LOG("Setting region %s as visible region for APZC %p (node %p)\n",
         Stringify(unobscured).c_str(), apzc, node.get());
     }
     apzc->SetAncestorTransform(aAncestorTransform);
@@ -473,17 +473,17 @@ APZCTreeManager::UpdateHitTestingTree(Tr
 {
   mTreeLock.AssertCurrentThreadOwns();
 
   mApzcTreeLog << aLayer.Name() << '\t';
 
   HitTestingTreeNode* node = PrepareNodeForLayer(aLayer,
         aLayer.Metrics(), aLayersId, aAncestorTransform,
         aObscured, aParent, aNextSibling, aState);
-  AsyncPanZoomController* apzc = (node ? node->Apzc() : nullptr);
+  AsyncPanZoomController* apzc = (node ? node->GetApzc() : nullptr);
   aLayer.SetApzc(apzc);
 
   mApzcTreeLog << '\n';
 
   // Accumulate the CSS transform between layers that have an APZC.
   // In the terminology of the big comment above APZCTreeManager::GetScreenToApzcTransform, if
   // we are at layer M, then aAncestorTransform is NC * OC * PC, and we left-multiply MC and
   // compute ancestorTransform to be MC * NC * OC * PC. This gets passed down as the ancestor
@@ -1087,49 +1087,54 @@ APZCTreeManager::SetTargetAPZC(uint64_t 
   mInputQueue->SetConfirmedTargetApzc(aInputBlockId, apzc);
 }
 
 void
 APZCTreeManager::UpdateZoomConstraints(const ScrollableLayerGuid& aGuid,
                                        const ZoomConstraints& aConstraints)
 {
   nsRefPtr<HitTestingTreeNode> node = GetTargetNode(aGuid, nullptr);
+  MOZ_ASSERT(!node || node->GetApzc()); // any node returned must have an APZC
+
   // For a given layers id, non-root APZCs inherit the zoom constraints
   // of their root.
-  if (node && node->Apzc()->IsRootForLayersId()) {
+  if (node && node->GetApzc()->IsRootForLayersId()) {
     MonitorAutoLock lock(mTreeLock);
     UpdateZoomConstraintsRecursively(node.get(), aConstraints);
   }
 }
 
 void
 APZCTreeManager::UpdateZoomConstraintsRecursively(HitTestingTreeNode* aNode,
                                                   const ZoomConstraints& aConstraints)
 {
   mTreeLock.AssertCurrentThreadOwns();
 
   if (aNode->IsPrimaryHolder()) {
-    aNode->Apzc()->UpdateZoomConstraints(aConstraints);
+    MOZ_ASSERT(aNode->GetApzc());
+    aNode->GetApzc()->UpdateZoomConstraints(aConstraints);
   }
   for (HitTestingTreeNode* child = aNode->GetLastChild(); child; child = child->GetPrevSibling()) {
     // We can have subtrees with their own layers id - leave those alone.
-    if (!child->Apzc()->IsRootForLayersId()) {
-      UpdateZoomConstraintsRecursively(child, aConstraints);
+    if (child->GetApzc() && child->GetApzc()->IsRootForLayersId()) {
+      continue;
     }
+    UpdateZoomConstraintsRecursively(child, aConstraints);
   }
 }
 
 void
 APZCTreeManager::FlushRepaintsRecursively(HitTestingTreeNode* aNode)
 {
   mTreeLock.AssertCurrentThreadOwns();
 
   for (HitTestingTreeNode* node = aNode; node; node = node->GetPrevSibling()) {
     if (node->IsPrimaryHolder()) {
-      node->Apzc()->FlushRepaintForNewInputBlock();
+      MOZ_ASSERT(node->GetApzc());
+      node->GetApzc()->FlushRepaintForNewInputBlock();
     }
     FlushRepaintsRecursively(node->GetLastChild());
   }
 }
 
 void
 APZCTreeManager::CancelAnimation(const ScrollableLayerGuid &aGuid)
 {
@@ -1297,17 +1302,18 @@ APZCTreeManager::HitTestAPZC(const Scree
   return target != nullptr;
 }
 
 already_AddRefed<AsyncPanZoomController>
 APZCTreeManager::GetTargetAPZC(const ScrollableLayerGuid& aGuid,
                                GuidComparator aComparator)
 {
   nsRefPtr<HitTestingTreeNode> node = GetTargetNode(aGuid, aComparator);
-  nsRefPtr<AsyncPanZoomController> apzc = node ? node->Apzc() : nullptr;
+  MOZ_ASSERT(!node || node->GetApzc()); // any node returned must have an APZC
+  nsRefPtr<AsyncPanZoomController> apzc = node ? node->GetApzc() : nullptr;
   return apzc.forget();
 }
 
 already_AddRefed<HitTestingTreeNode>
 APZCTreeManager::GetTargetNode(const ScrollableLayerGuid& aGuid,
                                GuidComparator aComparator)
 {
   MonitorAutoLock lock(mTreeLock);
@@ -1419,20 +1425,22 @@ APZCTreeManager::FindTargetNode(HitTesti
   // APZCs front-to-back on the screen.
   for (HitTestingTreeNode* node = aNode; node; node = node->GetPrevSibling()) {
     HitTestingTreeNode* match = FindTargetNode(node->GetLastChild(), aGuid, aComparator);
     if (match) {
       return match;
     }
 
     bool matches = false;
-    if (aComparator) {
-      matches = aComparator(aGuid, node->Apzc()->GetGuid());
-    } else {
-      matches = node->Apzc()->Matches(aGuid);
+    if (node->GetApzc()) {
+      if (aComparator) {
+        matches = aComparator(aGuid, node->GetApzc()->GetGuid());
+      } else {
+        matches = node->GetApzc()->Matches(aGuid);
+      }
     }
     if (matches) {
       return node;
     }
   }
   return nullptr;
 }
 
@@ -1441,44 +1449,51 @@ APZCTreeManager::GetAPZCAtPoint(HitTesti
                                 const Point& aHitTestPoint,
                                 HitTestResult* aOutHitResult)
 {
   mTreeLock.AssertCurrentThreadOwns();
 
   // This walks the tree in depth-first, reverse order, so that it encounters
   // APZCs front-to-back on the screen.
   for (HitTestingTreeNode* node = aNode; node; node = node->GetPrevSibling()) {
-    AsyncPanZoomController* apzc = node->Apzc();
+    AsyncPanZoomController* apzc = node->GetApzc();
 
     // The comments below assume there is a chain of layers L..R with L and P
     // having APZC instances as explained in the comment above
     // GetScreenToApzcTransform. This function will recurse with apzc at L and
     // P, and the comments explain what values are stored in the variables at
     // these two levels. All the comments use standard matrix notation where the
     // leftmost matrix in a multiplication is applied first.
 
     // ancestorUntransform takes points from apzc's parent APZC's CSS-
     // transformed layer coordinates to apzc's parent layer's layer coordinates.
     // It is PC.Inverse() * OC.Inverse() * NC.Inverse() * MC.Inverse() at recursion level for L,
     //   and RC.Inverse() * QC.Inverse()                               at recursion level for P.
-    Matrix4x4 ancestorUntransform = apzc->GetAncestorTransform().Inverse();
+    Matrix4x4 ancestorUntransform;
+    if (apzc) {
+      ancestorUntransform = apzc->GetAncestorTransform().Inverse();
+    }
 
     // Hit testing for this layer takes place in our parent layer coordinates,
     // since the composition bounds (used to initialize the visible rect against
     // which we hit test are in those coordinates).
     Point4D hitTestPointForThisLayer = ancestorUntransform.ProjectPoint(aHitTestPoint);
     APZCTM_LOG("Untransformed %f %f to parentlayer coordinates %f %f for hit-testing APZC %p\n",
         aHitTestPoint.x, aHitTestPoint.y,
         hitTestPointForThisLayer.x, hitTestPointForThisLayer.y, apzc);
 
     // childUntransform takes points from apzc's parent APZC's CSS-transformed
     // layer coordinates to apzc's CSS-transformed layer coordinates.
     // It is PC.Inverse() * OC.Inverse() * NC.Inverse() * MC.Inverse() * LA.Inverse() at L
     //   and RC.Inverse() * QC.Inverse() * PA.Inverse()                               at P.
-    Matrix4x4 childUntransform = ancestorUntransform * Matrix4x4(apzc->GetCurrentAsyncTransform()).Inverse();
+    Matrix4x4 asyncUntransform;
+    if (apzc) {
+      asyncUntransform = Matrix4x4(apzc->GetCurrentAsyncTransform()).Inverse();
+    }
+    Matrix4x4 childUntransform = ancestorUntransform * asyncUntransform;
     Point4D hitTestPointForChildLayers = childUntransform.ProjectPoint(aHitTestPoint);
     APZCTM_LOG("Untransformed %f %f to layer coordinates %f %f for APZC %p\n",
         aHitTestPoint.x, aHitTestPoint.y,
         hitTestPointForChildLayers.x, hitTestPointForChildLayers.y, apzc);
 
     AsyncPanZoomController* result = nullptr;
     if (hitTestPointForChildLayers.HasPositiveWCoord()) {
       result = GetAPZCAtPoint(node->GetLastChild(), hitTestPointForChildLayers.As2DPoint(), aOutHitResult);
@@ -1498,35 +1513,43 @@ APZCTreeManager::GetAPZCAtPoint(HitTesti
         // If event regions are disabled, *aOutHitResult will be ApzcHitRegion
         *aOutHitResult = hitResult;
       }
     }
 
     // If we are overscrolled, and the point matches us or one of our children,
     // the result is inside an overscrolled APZC, inform our caller of this
     // (callers typically ignore events targeted at overscrolled APZCs).
-    if (result && apzc->IsOverscrolled()) {
+    if (result && apzc && apzc->IsOverscrolled()) {
       *aOutHitResult = OverscrolledApzc;
       return nullptr;
     }
 
     if (result) {
-      if (!gfxPrefs::LayoutEventRegionsEnabled() && node->GetPrevSibling()
-          && result == node->GetPrevSibling()->Apzc()) {
+      if (!gfxPrefs::LayoutEventRegionsEnabled()) {
         // When event-regions are disabled, we treat scrollinfo layers as
         // regular scrollable layers. Unfortunately, their "hit region" (which
         // we create from the composition bounds) is their full area, and they
         // sit on top of their non-scrollinfo siblings. This means they will get
         // a HitTestingTreeNode with a hit region that will aggressively match
         // any input events that might be directed to sub-APZCs of their non-
         // scrollinfo siblings. This means we need to keep looping through to
         // see if there are any other non-scrollinfo siblings that have children
         // that match this input. If so, they should take priority. With event-
         // regions enabled we ignore scrollinfo layers and this is unnecessary.
-        continue;
+        AsyncPanZoomController* prevSiblingApzc = nullptr;
+        for (HitTestingTreeNode* n = node->GetPrevSibling(); n; n = n->GetPrevSibling()) {
+          if (n->GetApzc()) {
+            prevSiblingApzc = n->GetApzc();
+            break;
+          }
+        }
+        if (result == prevSiblingApzc) {
+          continue;
+        }
       }
 
       return result;
     }
   }
 
   return nullptr;
 }
--- a/gfx/layers/apz/src/HitTestingTreeNode.cpp
+++ b/gfx/layers/apz/src/HitTestingTreeNode.cpp
@@ -16,17 +16,19 @@
 namespace mozilla {
 namespace layers {
 
 HitTestingTreeNode::HitTestingTreeNode(AsyncPanZoomController* aApzc,
                                        bool aIsPrimaryHolder)
   : mApzc(aApzc)
   , mIsPrimaryApzcHolder(aIsPrimaryHolder)
 {
-  MOZ_ASSERT(mApzc);
+  if (mIsPrimaryApzcHolder) {
+    MOZ_ASSERT(mApzc);
+  }
 }
 
 HitTestingTreeNode::~HitTestingTreeNode()
 {
 }
 
 void
 HitTestingTreeNode::Destroy()
@@ -45,42 +47,52 @@ HitTestingTreeNode::Destroy()
   }
 }
 
 void
 HitTestingTreeNode::SetLastChild(HitTestingTreeNode* aChild)
 {
   mLastChild = aChild;
   if (aChild) {
-    // We assume that HitTestingTreeNodes with an ancestor/descendant
-    // relationship cannot both point to the same APZC instance. This assertion
-    // only covers a subset of cases in which that might occur, but it's better
-    // than nothing.
-    MOZ_ASSERT(aChild->Apzc() != Apzc());
+    aChild->mParent = this;
 
-    aChild->mParent = this;
-    aChild->Apzc()->SetParent(Apzc());
+    if (aChild->GetApzc()) {
+      AsyncPanZoomController* parent = GetNearestContainingApzc();
+      // We assume that HitTestingTreeNodes with an ancestor/descendant
+      // relationship cannot both point to the same APZC instance. This
+      // assertion only covers a subset of cases in which that might occur,
+      // but it's better than nothing.
+      MOZ_ASSERT(aChild->GetApzc() != parent);
+      aChild->SetApzcParent(parent);
+    }
   }
 }
 
 void
 HitTestingTreeNode::SetPrevSibling(HitTestingTreeNode* aSibling)
 {
   mPrevSibling = aSibling;
   if (aSibling) {
     aSibling->mParent = mParent;
-    aSibling->Apzc()->SetParent(mParent ? mParent->Apzc() : nullptr);
+
+    if (aSibling->GetApzc()) {
+      AsyncPanZoomController* parent = mParent ? mParent->GetNearestContainingApzc() : nullptr;
+      aSibling->SetApzcParent(parent);
+    }
   }
 }
 
 void
 HitTestingTreeNode::MakeRoot()
 {
   mParent = nullptr;
-  Apzc()->SetParent(nullptr);
+
+  if (GetApzc()) {
+    SetApzcParent(nullptr);
+  }
 }
 
 HitTestingTreeNode*
 HitTestingTreeNode::GetFirstChild() const
 {
   HitTestingTreeNode* child = GetLastChild();
   while (child && child->GetPrevSibling()) {
     child = child->GetPrevSibling();
@@ -102,21 +114,32 @@ HitTestingTreeNode::GetPrevSibling() con
 
 HitTestingTreeNode*
 HitTestingTreeNode::GetParent() const
 {
   return mParent;
 }
 
 AsyncPanZoomController*
-HitTestingTreeNode::Apzc() const
+HitTestingTreeNode::GetApzc() const
 {
   return mApzc;
 }
 
+AsyncPanZoomController*
+HitTestingTreeNode::GetNearestContainingApzc() const
+{
+  for (const HitTestingTreeNode* n = this; n; n = n->GetParent()) {
+    if (n->GetApzc()) {
+      return n->GetApzc();
+    }
+  }
+  return nullptr;
+}
+
 bool
 HitTestingTreeNode::IsPrimaryHolder() const
 {
   return mIsPrimaryApzcHolder;
 }
 
 void
 HitTestingTreeNode::SetHitTestData(const EventRegions& aRegions,
@@ -143,17 +166,20 @@ HitTestingTreeNode::HitTest(const Parent
   }
 
   // test against clip rect in ParentLayer coordinate space
   if (!mClipRegion.Contains(aPoint.x, aPoint.y)) {
     return HitTestResult::NoApzcHit;
   }
 
   // convert into Layer coordinate space
-  gfx::Matrix4x4 localTransform = mTransform * gfx::Matrix4x4(mApzc->GetCurrentAsyncTransform());
+  gfx::Matrix4x4 localTransform = mTransform;
+  if (mApzc) {
+    localTransform = localTransform * gfx::Matrix4x4(mApzc->GetCurrentAsyncTransform());
+  }
   gfx::Point4D pointInLayerPixels = localTransform.Inverse().ProjectPoint(aPoint.ToUnknownPoint());
   if (!pointInLayerPixels.HasPositiveWCoord()) {
     return HitTestResult::NoApzcHit;
   }
   LayerIntPoint point = RoundedToInt(ViewAs<LayerPixel>(pointInLayerPixels.As2DPoint()));
 
   // test against event regions in Layer coordinate space
   if (!mEventRegions.mHitRegion.Contains(point.x, point.y)) {
@@ -167,18 +193,30 @@ HitTestingTreeNode::HitTest(const Parent
 
 void
 HitTestingTreeNode::Dump(const char* aPrefix) const
 {
   if (mPrevSibling) {
     mPrevSibling->Dump(aPrefix);
   }
   printf_stderr("%sHitTestingTreeNode (%p) APZC (%p) g=(%s) r=(%s) t=(%s) c=(%s)\n",
-    aPrefix, this, mApzc.get(), Stringify(mApzc->GetGuid()).c_str(),
+    aPrefix, this, mApzc.get(), mApzc ? Stringify(mApzc->GetGuid()).c_str() : "",
     Stringify(mEventRegions).c_str(), Stringify(mTransform).c_str(),
     Stringify(mClipRegion).c_str());
   if (mLastChild) {
     mLastChild->Dump(nsPrintfCString("%s  ", aPrefix).get());
   }
 }
 
+void
+HitTestingTreeNode::SetApzcParent(AsyncPanZoomController* aParent)
+{
+  // precondition: GetApzc() is non-null
+  MOZ_ASSERT(GetApzc() != nullptr);
+  if (IsPrimaryHolder()) {
+    GetApzc()->SetParent(aParent);
+  } else {
+    MOZ_ASSERT(GetApzc()->GetParent() == aParent);
+  }
+}
+
 } // namespace layers
 } // namespace mozilla
--- a/gfx/layers/apz/src/HitTestingTreeNode.h
+++ b/gfx/layers/apz/src/HitTestingTreeNode.h
@@ -29,20 +29,16 @@ class AsyncPanZoomController;
  * geometry root). If this happens, exactly one of the HitTestingTreeNode
  * instances will be designated as the "primary holder" of the APZC. When
  * this primary holder is destroyed, it will destroy the APZC along with it;
  * in contrast, destroying non-primary-holder nodes will not destroy the APZC.
  * Code should not make assumptions about which of the nodes will be the
  * primary holder, only that that there will be exactly one for each APZC in
  * the tree.
  *
- * Note that every HitTestingTreeNode instance will have a pointer to an APZC,
- * and that pointer will be non-null. This will NOT be the case after the
- * HitTestingTreeNode has been Destroy()'d.
- *
  * The reason this tree exists at all is so that we can do hit-testing on the
  * thread that we receive input on (referred to the as the controller thread in
  * APZ terminology), which may be different from the compositor thread.
  * Accessing the compositor layer tree can only be done on the compositor
  * thread, and so it is simpler to make a copy of the hit-testing related
  * properties into a separate tree.
  */
 class HitTestingTreeNode {
@@ -62,29 +58,32 @@ public:
   /* Tree walking methods. GetFirstChild is O(n) in the number of children. The
    * other tree walking methods are all O(1). */
   HitTestingTreeNode* GetFirstChild() const;
   HitTestingTreeNode* GetLastChild() const;
   HitTestingTreeNode* GetPrevSibling() const;
   HitTestingTreeNode* GetParent() const;
 
   /* APZC related methods */
-  AsyncPanZoomController* Apzc() const;
+  AsyncPanZoomController* GetApzc() const;
+  AsyncPanZoomController* GetNearestContainingApzc() const;
   bool IsPrimaryHolder() const;
 
   /* Hit test related methods */
   void SetHitTestData(const EventRegions& aRegions,
                       const gfx::Matrix4x4& aTransform,
                       const nsIntRegion& aClipRegion);
   HitTestResult HitTest(const ParentLayerPoint& aPoint) const;
 
   /* Debug helpers */
   void Dump(const char* aPrefix = "") const;
 
 private:
+  void SetApzcParent(AsyncPanZoomController* aApzc);
+
   nsRefPtr<HitTestingTreeNode> mLastChild;
   nsRefPtr<HitTestingTreeNode> mPrevSibling;
   nsRefPtr<HitTestingTreeNode> mParent;
 
   nsRefPtr<AsyncPanZoomController> mApzc;
   bool mIsPrimaryApzcHolder;
 
   /* Let {L,M} be the {layer, scrollable metrics} pair that this node
--- a/gfx/tests/gtest/TestAsyncPanZoomController.cpp
+++ b/gfx/tests/gtest/TestAsyncPanZoomController.cpp
@@ -2030,25 +2030,25 @@ TEST_F(APZCTreeManagerTester, Bug1068268
   CreatePotentiallyLeakingTree();
   ScopedLayerTreeRegistration registration(0, root, mcc);
 
   manager->UpdateHitTestingTree(nullptr, root, false, 0, 0);
   nsRefPtr<HitTestingTreeNode> root = manager->GetRootNode();
   nsRefPtr<HitTestingTreeNode> node2 = root->GetFirstChild();
   nsRefPtr<HitTestingTreeNode> node5 = root->GetLastChild();
 
-  EXPECT_EQ(ApzcOf(layers[2]), node5->Apzc());
-  EXPECT_EQ(ApzcOf(layers[2]), node2->Apzc());
+  EXPECT_EQ(ApzcOf(layers[2]), node5->GetApzc());
+  EXPECT_EQ(ApzcOf(layers[2]), node2->GetApzc());
   EXPECT_EQ(ApzcOf(layers[0]), ApzcOf(layers[2])->GetParent());
   EXPECT_EQ(ApzcOf(layers[2]), ApzcOf(layers[5]));
 
   EXPECT_EQ(node2->GetFirstChild(), node2->GetLastChild());
-  EXPECT_EQ(ApzcOf(layers[3]), node2->GetLastChild()->Apzc());
+  EXPECT_EQ(ApzcOf(layers[3]), node2->GetLastChild()->GetApzc());
   EXPECT_EQ(node5->GetFirstChild(), node5->GetLastChild());
-  EXPECT_EQ(ApzcOf(layers[6]), node5->GetLastChild()->Apzc());
+  EXPECT_EQ(ApzcOf(layers[6]), node5->GetLastChild()->GetApzc());
   EXPECT_EQ(ApzcOf(layers[2]), ApzcOf(layers[3])->GetParent());
   EXPECT_EQ(ApzcOf(layers[5]), ApzcOf(layers[6])->GetParent());
 }
 
 TEST_F(APZHitTestingTester, ComplexMultiLayerTree) {
   CreateComplexMultiLayerTree();
   ScopedLayerTreeRegistration registration(0, root, mcc);
   manager->UpdateHitTestingTree(nullptr, root, false, 0, 0);
@@ -2082,28 +2082,28 @@ TEST_F(APZHitTestingTester, ComplexMulti
   TestAsyncPanZoomController* layers1_2 = ApzcOf(layers[1]);
   TestAsyncPanZoomController* layers4_6_8 = ApzcOf(layers[4]);
   TestAsyncPanZoomController* layer7 = ApzcOf(layers[7]);
   TestAsyncPanZoomController* layer9 = ApzcOf(layers[9]);
   EXPECT_EQ(nullptr, layers1_2->GetParent());
   EXPECT_EQ(nullptr, layers4_6_8->GetParent());
   EXPECT_EQ(layers4_6_8, layer7->GetParent());
   EXPECT_EQ(nullptr, layer9->GetParent());
-  EXPECT_EQ(layer9, root->Apzc());
+  EXPECT_EQ(layer9, root->GetApzc());
   TestAsyncPanZoomController* expected[] = {
     layer9,
     layers4_6_8, layers4_6_8, layers4_6_8,
     layers1_2, layers1_2
   };
   int i = 0;
   for (HitTestingTreeNode *iter = root; iter; iter = iter->GetPrevSibling()) {
-    EXPECT_EQ(expected[i++], iter->Apzc());
+    EXPECT_EQ(expected[i++], iter->GetApzc());
   }
   HitTestingTreeNode* node6 = root->GetPrevSibling()->GetPrevSibling();
-  EXPECT_EQ(layer7, node6->GetLastChild()->Apzc());
+  EXPECT_EQ(layer7, node6->GetLastChild()->GetApzc());
   EXPECT_EQ(nullptr, node6->GetLastChild()->GetPrevSibling());
 
   nsRefPtr<AsyncPanZoomController> hit = GetTargetAPZC(ScreenPoint(25, 25));
   EXPECT_EQ(ApzcOf(layers[1]), hit.get());
   hit = GetTargetAPZC(ScreenPoint(275, 375));
   EXPECT_EQ(ApzcOf(layers[9]), hit.get());
   hit = GetTargetAPZC(ScreenPoint(250, 100));
   EXPECT_EQ(ApzcOf(layers[7]), hit.get());