summaryrefslogtreecommitdiffstats
path: root/layout/base/nsLayoutUtils.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--layout/base/nsLayoutUtils.cpp14
1 files changed, 9 insertions, 5 deletions
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;
}