From 40a355a42d4a9444dc753c04c6608dade2f06a23 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:13:27 +0200 Subject: Adding upstream version 125.0.1. Signed-off-by: Daniel Baumann --- layout/base/nsLayoutUtils.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'layout/base/nsLayoutUtils.cpp') diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index 28230421d5..db766f6603 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -9492,8 +9492,9 @@ nsRect nsLayoutUtils::ComputeSVGOriginBox(SVGViewportElement* aElement) { } /* static */ -nsRect nsLayoutUtils::ComputeSVGReferenceRect(nsIFrame* aFrame, - StyleGeometryBox aGeometryBox) { +nsRect nsLayoutUtils::ComputeSVGReferenceRect( + nsIFrame* aFrame, StyleGeometryBox aGeometryBox, + MayHaveNonScalingStrokeCyclicDependency aMayHaveCyclicDependency) { MOZ_ASSERT(aFrame->GetContent()->IsSVGElement()); nsRect r; @@ -9502,9 +9503,12 @@ nsRect nsLayoutUtils::ComputeSVGReferenceRect(nsIFrame* aFrame, // XXX Bug 1299876 // The size of stroke-box is not correct if this graphic element has // specific stroke-linejoin or stroke-linecap. - gfxRect bbox = - SVGUtils::GetBBox(aFrame, SVGUtils::eBBoxIncludeFillGeometry | - SVGUtils::eBBoxIncludeStroke); + const uint32_t flags = SVGUtils::eBBoxIncludeFillGeometry | + SVGUtils::eBBoxIncludeStroke | + (bool(aMayHaveCyclicDependency) + ? SVGUtils::eAvoidCycleIfNonScalingStroke + : 0); + gfxRect bbox = SVGUtils::GetBBox(aFrame, flags); r = nsLayoutUtils::RoundGfxRectToAppRect(bbox, AppUnitsPerCSSPixel()); break; } -- cgit v1.2.3