diff --git a/layout/svg/base/src/nsSVGGeometryFrame.cpp b/layout/svg/base/src/nsSVGGeometryFrame.cpp index 7ba3e0f866b..a0de2e6f785 100644 --- a/layout/svg/base/src/nsSVGGeometryFrame.cpp +++ b/layout/svg/base/src/nsSVGGeometryFrame.cpp @@ -267,9 +267,11 @@ nsSVGGeometryFrame::HasStroke() if (GetStrokeWidth() <= 0) return PR_FALSE; + // Check for eStyleSVGPaintType_Server as the NS_STATE_SVG_STROKE_PSERVER + // state bit is only set if we have a valid URL. If we don't, we still have + // to stroke although we will be using the fallback colour if (GetStyleSVG()->mStroke.mType == eStyleSVGPaintType_Color || - (GetStyleSVG()->mStroke.mType == eStyleSVGPaintType_Server && - (GetStateBits() & NS_STATE_SVG_STROKE_PSERVER))) + GetStyleSVG()->mStroke.mType == eStyleSVGPaintType_Server) return PR_TRUE; return PR_FALSE; @@ -286,6 +288,9 @@ nsSVGGeometryFrame::HasFill() } } + // Check for eStyleSVGPaintType_Server as the NS_STATE_SVG_FILL_PSERVER + // state bit is only set if we have a valid URL. If we don't, we still have + // to fill although we will be using the fallback colour if (GetStyleSVG()->mFill.mType == eStyleSVGPaintType_Color || GetStyleSVG()->mFill.mType == eStyleSVGPaintType_Server) return PR_TRUE; diff --git a/layout/svg/base/src/nsSVGUtils.h b/layout/svg/base/src/nsSVGUtils.h index 8250c03f749..545ad72e35c 100644 --- a/layout/svg/base/src/nsSVGUtils.h +++ b/layout/svg/base/src/nsSVGUtils.h @@ -91,8 +91,11 @@ struct nsStyleFont; #define NS_STATE_SVG_DIRTY 0x02000000 +/* Do we have a paint server for fill with a valid URL? */ #define NS_STATE_SVG_FILL_PSERVER 0x04000000 +/* Do we have a paint server for stroke with a valid URL? */ #define NS_STATE_SVG_STROKE_PSERVER 0x08000000 +/* Do we have any paint servers with valid URLs? */ #define NS_STATE_SVG_PSERVER_MASK 0x0c000000 /* are we the child of a non-display container? */