From e4630ce481ad622c831f88faf1ec973137f4e4d7 Mon Sep 17 00:00:00 2001 From: Francis Dominic Fajardo Date: Sat, 28 Jun 2025 16:14:55 +0800 Subject: [PATCH] Issue #2765 - Follow-up: Avoid declaring RefPtr in the return statement --- layout/base/nsLayoutUtils.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index 854c401938..e78536d00e 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -9348,7 +9348,8 @@ nsLayoutUtils::GetNonAnonymousStyleContext(nsIFrame* aFrame) } MOZ_ASSERT(node, "Native anonymous element with no originating node?"); if (nsIFrame* primaryFrame = node->GetPrimaryFrame()) { - return RefPtr(primaryFrame->StyleContext()).forget(); + RefPtr context = primaryFrame->StyleContext(); + return context.forget(); } // If the element doesn't have primary frame, get the computed style // from the element directly.