summaryrefslogtreecommitdiffstats
path: root/layout/svg/SVGGeometryFrame.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:33 +0000
commit086c044dc34dfc0f74fbe41f4ecb402b2cd34884 (patch)
treea4f824bd33cb075dd5aa3eb5a0a94af221bbe83a /layout/svg/SVGGeometryFrame.cpp
parentAdding debian version 124.0.1-1. (diff)
downloadfirefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.tar.xz
firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.zip
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'layout/svg/SVGGeometryFrame.cpp')
-rw-r--r--layout/svg/SVGGeometryFrame.cpp32
1 files changed, 25 insertions, 7 deletions
diff --git a/layout/svg/SVGGeometryFrame.cpp b/layout/svg/SVGGeometryFrame.cpp
index 7d0bd7cc4c..3d6d6aef7e 100644
--- a/layout/svg/SVGGeometryFrame.cpp
+++ b/layout/svg/SVGGeometryFrame.cpp
@@ -358,13 +358,31 @@ SVGBBox SVGGeometryFrame::GetBBoxContribution(const Matrix& aToBBoxUserspace,
SVGGeometryElement* element = static_cast<SVGGeometryElement*>(GetContent());
- bool getFill = (aFlags & SVGUtils::eBBoxIncludeFillGeometry) ||
- ((aFlags & SVGUtils::eBBoxIncludeFill) &&
- !StyleSVG()->mFill.kind.IsNone());
-
- bool getStroke =
- (aFlags & SVGUtils::eBBoxIncludeStrokeGeometry) ||
- ((aFlags & SVGUtils::eBBoxIncludeStroke) && SVGUtils::HasStroke(this));
+ const bool getFill = (aFlags & SVGUtils::eBBoxIncludeFillGeometry) ||
+ ((aFlags & SVGUtils::eBBoxIncludeFill) &&
+ !StyleSVG()->mFill.kind.IsNone());
+
+ const bool getStroke =
+ ((aFlags & SVGUtils::eBBoxIncludeStrokeGeometry) ||
+ ((aFlags & SVGUtils::eBBoxIncludeStroke) &&
+ SVGUtils::HasStroke(this))) &&
+ // If this frame has non-scaling-stroke and we would like to compute its
+ // stroke, it may cause a potential cyclical dependency if the caller is
+ // for transform. In this case, we have to fall back to fill-box, so make
+ // |getStroke| be false.
+ // https://github.com/w3c/csswg-drafts/issues/9640
+ //
+ // Note:
+ // 1. We don't care about the computation of the markers below in this
+ // function because we know the callers don't set
+ // SVGUtils::eBBoxIncludeMarkers.
+ // See nsStyleTransformMatrix::GetSVGBox() and
+ // MotionPathUtils::GetRayContainReferenceSize() for more details.
+ // 2. We have to break the dependency here *again* because the geometry
+ // frame may be in the subtree of a SVGContainerFrame, which may not
+ // set non-scaling-stroke.
+ !(StyleSVGReset()->HasNonScalingStroke() &&
+ (aFlags & SVGUtils::eAvoidCycleIfNonScalingStroke));
SVGContentUtils::AutoStrokeOptions strokeOptions;
if (getStroke) {