From 0b3072d2e5f37664f689d95c49a2316bcb35514d Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Thu, 2 Jul 2020 03:07:39 +0000 Subject: [PATCH] Bug 1649931 - Part 1: Remove the first parameter of GetFirst/LastLeaf() r=emilio Differential Revision: https://phabricator.services.mozilla.com/D81952 --- layout/generic/nsFrame.cpp | 14 +++++++------- layout/generic/nsIFrame.h | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index e0f2fdfec6d5..a444dc1ec21d 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -7981,7 +7981,7 @@ nsresult nsIFrame::GetNextPrevLineFromeBlockFrame(nsPresContext* aPresContext, return NS_ERROR_FAILURE; } } - GetLastLeaf(aPresContext, &lastFrame); + GetLastLeaf(&lastFrame); if (aPos->mDirection == eDirNext) { nearStoppingFrame = firstFrame; @@ -8840,9 +8840,9 @@ nsresult nsIFrame::GetFrameFromDirection( bool frameIsRTL = (nsBidiPresUtils::FrameDirection(*framePtr) == NSBIDI_RTL); if ((frameIsRTL == lineIsRTL) == (aDirection == eDirPrevious)) { - nsFrame::GetFirstLeaf(presContext, framePtr); + nsFrame::GetFirstLeaf(framePtr); } else { - nsFrame::GetLastLeaf(presContext, framePtr); + nsFrame::GetLastLeaf(framePtr); } atLineEdge = *framePtr == traversedFrame; } else { @@ -8855,7 +8855,7 @@ nsresult nsIFrame::GetFrameFromDirection( if (NS_FAILED(result)) return result; if (aDirection == eDirPrevious) { - nsFrame::GetFirstLeaf(presContext, &firstFrame); + nsFrame::GetFirstLeaf(&firstFrame); atLineEdge = firstFrame == traversedFrame; } else { // eDirNext lastFrame = firstFrame; @@ -8866,7 +8866,7 @@ nsresult nsIFrame::GetFrameFromDirection( return NS_ERROR_FAILURE; } } - nsFrame::GetLastLeaf(presContext, &lastFrame); + nsFrame::GetLastLeaf(&lastFrame); atLineEdge = lastFrame == traversedFrame; } } @@ -9813,7 +9813,7 @@ ComputedStyle* nsIFrame::DoGetParentComputedStyle( return placeholder->GetParentComputedStyleForOutOfFlow(aProviderFrame); } -void nsIFrame::GetLastLeaf(nsPresContext* aPresContext, nsIFrame** aFrame) { +void nsIFrame::GetLastLeaf(nsIFrame** aFrame) { if (!aFrame || !*aFrame) return; nsIFrame* child = *aFrame; // if we are a block frame then go for the last line of 'this' @@ -9832,7 +9832,7 @@ void nsIFrame::GetLastLeaf(nsPresContext* aPresContext, nsIFrame** aFrame) { } } -void nsIFrame::GetFirstLeaf(nsPresContext* aPresContext, nsIFrame** aFrame) { +void nsIFrame::GetFirstLeaf(nsIFrame** aFrame) { if (!aFrame || !*aFrame) return; nsIFrame* child = *aFrame; while (1) { diff --git a/layout/generic/nsIFrame.h b/layout/generic/nsIFrame.h index 5efebeb3e672..a970a97b56e4 100644 --- a/layout/generic/nsIFrame.h +++ b/layout/generic/nsIFrame.h @@ -3734,8 +3734,8 @@ class nsIFrame : public nsQueryFrame { // given a frame five me the first/last leaf available // XXX Robert O'Callahan wants to move these elsewhere - static void GetLastLeaf(nsPresContext* aPresContext, nsIFrame** aFrame); - static void GetFirstLeaf(nsPresContext* aPresContext, nsIFrame** aFrame); + static void GetLastLeaf(nsIFrame** aFrame); + static void GetFirstLeaf(nsIFrame** aFrame); static nsresult GetNextPrevLineFromeBlockFrame(nsPresContext* aPresContext, nsPeekOffsetStruct* aPos,