Bug 1337388 - Remove unnecessary AsyncPanZoomEnabled check, and add a null guard. r=tnikkel draft
authorKartikaya Gupta <kgupta@mozilla.com>
Tue, 07 Feb 2017 10:43:17 -0500
changeset 479959 8e86498d5abd19322b55f976fbaf6e63f8192552
parent 479958 e677ba018b22558fef1d07b74d416fd3a28a5dc3
child 544829 558e48e64752a1ca4ff9cbc4e72ad2c7abf9b9dd
push id44408
push userkgupta@mozilla.com
push dateTue, 07 Feb 2017 15:44:05 +0000
reviewerstnikkel
bugs1337388
milestone54.0a1
Bug 1337388 - Remove unnecessary AsyncPanZoomEnabled check, and add a null guard. r=tnikkel MozReview-Commit-ID: 87zwTEwPyLt
layout/base/nsLayoutUtils.cpp
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -3389,20 +3389,22 @@ nsLayoutUtils::ExpireDisplayPortOnAsyncS
       break;
     }
     nsIScrollableFrame* scrollAncestor = GetAsyncScrollableAncestorFrame(frame);
     if (!scrollAncestor) {
       break;
     }
     frame = do_QueryFrame(scrollAncestor);
     MOZ_ASSERT(frame);
+    if (!frame) {
+      break;
+    }
     MOZ_ASSERT(scrollAncestor->WantAsyncScroll() ||
       frame->PresContext()->PresShell()->GetRootScrollFrame() == frame);
-    if (nsLayoutUtils::AsyncPanZoomEnabled(frame) &&
-        nsLayoutUtils::HasDisplayPort(frame->GetContent())) {
+    if (nsLayoutUtils::HasDisplayPort(frame->GetContent())) {
       scrollAncestor->TriggerDisplayPortExpiration();
       // Stop after the first trigger. If it failed, there's no point in
       // continuing because all the rest of the frames we encounter are going
       // to be ancestors of |scrollAncestor| which will keep its displayport.
       // If the trigger succeeded, we stop because when the trigger executes
       // it will call this function again to trigger the next ancestor up the
       // chain.
       break;