summaryrefslogtreecommitdiffstats
path: root/layout/svg/SVGGeometryFrame.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
commitfbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch)
tree4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /layout/svg/SVGGeometryFrame.cpp
parentReleasing progress-linux version 124.0.1-1~progress7.99u1. (diff)
downloadfirefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz
firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.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) {