Bug 1276897 - r=tlee, a=sylvestre
authorMatt Woodrow <mwoodrow@mozilla.com>
Wed, 01 Jun 2016 13:23:20 +1200
changeset 325467 21048041da57844815f861eb92b13afa1b3fc854
parent 325466 68ca48e7a1646a4e43f1c11393c92de0fc52bb3e
child 325468 099dc4e6838eb8fb920178fba801d125e04316e7
push id9804
push usercbook@mozilla.com
push dateWed, 20 Jul 2016 08:30:59 +0000
treeherdermozilla-aurora@099dc4e6838e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstlee, sylvestre
bugs1276897
milestone49.0a2
Bug 1276897 - r=tlee, a=sylvestre
layout/base/nsDisplayList.cpp
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -2092,19 +2092,20 @@ void nsDisplayList::HitTest(nsDisplayLis
     bool snap;
     nsRect r = item->GetBounds(aBuilder, &snap).Intersect(aRect);
     auto itemType = item->GetType();
     bool same3DContext =
       (itemType == nsDisplayItem::TYPE_TRANSFORM &&
        static_cast<nsDisplayTransform*>(item)->IsParticipating3DContext()) ||
       ((itemType == nsDisplayItem::TYPE_PERSPECTIVE ||
         itemType == nsDisplayItem::TYPE_OPACITY) &&
-       static_cast<nsDisplayPerspective*>(item)->Frame()->Extend3DContext());
+       item->Frame()->Extend3DContext());
     if (same3DContext &&
-        !static_cast<nsDisplayTransform*>(item)->IsLeafOf3DContext()) {
+        (itemType != nsDisplayItem::TYPE_TRANSFORM ||
+         !static_cast<nsDisplayTransform*>(item)->IsLeafOf3DContext())) {
       if (!item->GetClip().MayIntersect(aRect)) {
         continue;
       }
       AutoTArray<nsIFrame*, 1> neverUsed;
       // Start gethering leaves of the 3D rendering context, and
       // append leaves at the end of mItemBuffer.  Leaves are
       // processed at following iterations.
       aState->mInPreserves3D = true;