diff --git a/layout/svg/SVGContainerFrame.cpp b/layout/svg/SVGContainerFrame.cpp index ffc259aa4162..633f1f29419b 100644 --- a/layout/svg/SVGContainerFrame.cpp +++ b/layout/svg/SVGContainerFrame.cpp @@ -104,10 +104,10 @@ void SVGContainerFrame::ReflowSVGNonDisplayText(nsIFrame* aContainer) { if (!aContainer->HasAnyStateBits(NS_FRAME_IS_DIRTY)) { return; } - NS_ASSERTION(aContainer->HasAnyStateBits(NS_FRAME_IS_NONDISPLAY) || - !aContainer->IsFrameOfType(nsIFrame::eSVG), - "it is wasteful to call ReflowSVGNonDisplayText on a container " - "frame that is not NS_FRAME_IS_NONDISPLAY"); + MOZ_ASSERT(aContainer->HasAnyStateBits(NS_FRAME_IS_NONDISPLAY) || + !aContainer->IsFrameOfType(nsIFrame::eSVG), + "it is wasteful to call ReflowSVGNonDisplayText on a container " + "frame that is not NS_FRAME_IS_NONDISPLAY or not SVG"); for (nsIFrame* kid : aContainer->PrincipalChildList()) { LayoutFrameType type = kid->Type(); if (type == LayoutFrameType::SVGText) { @@ -326,8 +326,10 @@ void SVGDisplayContainerFrame::ReflowSVG() { // Inside a non-display container frame, we might have some // SVGTextFrames. We need to cause those to get reflowed in // case they are the target of a rendering observer. - NS_ASSERTION(kid->HasAnyStateBits(NS_FRAME_IS_NONDISPLAY), - "expected kid to be a NS_FRAME_IS_NONDISPLAY frame"); + MOZ_ASSERT( + kid->HasAnyStateBits(NS_FRAME_IS_NONDISPLAY) || + !kid->IsFrameOfType(nsIFrame::eSVG), + "expected kid to be a NS_FRAME_IS_NONDISPLAY frame or not SVG"); if (kid->HasAnyStateBits(NS_FRAME_IS_DIRTY)) { SVGContainerFrame* container = do_QueryFrame(kid); if (container && container->GetContent()->IsSVGElement()) { diff --git a/layout/svg/SVGSwitchFrame.cpp b/layout/svg/SVGSwitchFrame.cpp index 5afaddd1d461..96609075652b 100644 --- a/layout/svg/SVGSwitchFrame.cpp +++ b/layout/svg/SVGSwitchFrame.cpp @@ -233,7 +233,8 @@ void SVGSwitchFrame::ReflowSVG() { // frame list, and we're iterating over that list now anyway. ConsiderChildOverflow(overflowRects, child); } else if (child && shouldReflowSVGTextFrameInside(child)) { - MOZ_ASSERT(child->HasAnyStateBits(NS_FRAME_IS_NONDISPLAY), + MOZ_ASSERT(child->HasAnyStateBits(NS_FRAME_IS_NONDISPLAY) || + !child->IsFrameOfType(nsIFrame::eSVG), "Check for this explicitly in the |if|, then"); ReflowSVGNonDisplayText(child); } diff --git a/layout/svg/crashtests/1671950.html b/layout/svg/crashtests/1671950.html new file mode 100644 index 000000000000..173ace4ea9f8 --- /dev/null +++ b/layout/svg/crashtests/1671950.html @@ -0,0 +1,27 @@ + +
+ + + + + + diff --git a/layout/svg/crashtests/crashtests.list b/layout/svg/crashtests/crashtests.list index 568d8efa324e..fc9b753bc01d 100644 --- a/layout/svg/crashtests/crashtests.list +++ b/layout/svg/crashtests/crashtests.list @@ -235,3 +235,4 @@ load 1600855.html load 1601824.html load 1605223-1.html load 1609663.html +load 1671950.html