diff --git a/content/svg/content/test/Makefile.in b/content/svg/content/test/Makefile.in index 96579094ad7..b1782928d9d 100644 --- a/content/svg/content/test/Makefile.in +++ b/content/svg/content/test/Makefile.in @@ -65,6 +65,7 @@ _TEST_FILES = \ test_isSupported.xhtml \ test_nonAnimStrings.xhtml \ test_pathSeg.xhtml \ + test_pointer-events.xhtml \ test_pointer-events-2.xhtml \ test_scientific.html \ scientific-helper.svg \ diff --git a/content/svg/content/test/test_pointer-events.xhtml b/content/svg/content/test/test_pointer-events.xhtml new file mode 100644 index 00000000000..883d63ba9eb --- /dev/null +++ b/content/svg/content/test/test_pointer-events.xhtml @@ -0,0 +1,273 @@ + + +
+++ + diff --git a/layout/svg/base/src/nsSVGPathGeometryFrame.cpp b/layout/svg/base/src/nsSVGPathGeometryFrame.cpp index 4fba08d7418..8e8c8631da6 100644 --- a/layout/svg/base/src/nsSVGPathGeometryFrame.cpp +++ b/layout/svg/base/src/nsSVGPathGeometryFrame.cpp @@ -159,7 +159,7 @@ nsSVGPathGeometryFrame::GetFrameForPoint(const nsPoint &aPoint) fillRule = GetClipRule(); } else { mask = GetHittestMask(); - if (!mask || (!(mask & HITTEST_MASK_FORCE_TEST) && + if (!mask || ((mask & HITTEST_MASK_CHECK_MRECT) && !mRect.Contains(aPoint))) return nsnull; fillRule = GetStyleSVG()->mFillRule; @@ -521,24 +521,25 @@ nsSVGPathGeometryFrame::GetHittestMask() mask |= HITTEST_MASK_FILL; if (GetStyleSVG()->mStroke.mType != eStyleSVGPaintType_None) mask |= HITTEST_MASK_STROKE; + if (GetStyleSVG()->mStrokeOpacity > 0) + mask |= HITTEST_MASK_CHECK_MRECT; } break; case NS_STYLE_POINTER_EVENTS_VISIBLEFILL: if (GetStyleVisibility()->IsVisible()) { - mask |= HITTEST_MASK_FILL | HITTEST_MASK_FORCE_TEST; + mask |= HITTEST_MASK_FILL; } break; case NS_STYLE_POINTER_EVENTS_VISIBLESTROKE: if (GetStyleVisibility()->IsVisible()) { - mask |= HITTEST_MASK_STROKE | HITTEST_MASK_FORCE_TEST; + mask |= HITTEST_MASK_STROKE; } break; case NS_STYLE_POINTER_EVENTS_VISIBLE: if (GetStyleVisibility()->IsVisible()) { mask |= HITTEST_MASK_FILL | - HITTEST_MASK_STROKE | - HITTEST_MASK_FORCE_TEST; + HITTEST_MASK_STROKE; } break; case NS_STYLE_POINTER_EVENTS_PAINTED: @@ -546,18 +547,19 @@ nsSVGPathGeometryFrame::GetHittestMask() mask |= HITTEST_MASK_FILL; if (GetStyleSVG()->mStroke.mType != eStyleSVGPaintType_None) mask |= HITTEST_MASK_STROKE; + if (GetStyleSVG()->mStrokeOpacity) + mask |= HITTEST_MASK_CHECK_MRECT; break; case NS_STYLE_POINTER_EVENTS_FILL: - mask |= HITTEST_MASK_FILL | HITTEST_MASK_FORCE_TEST; + mask |= HITTEST_MASK_FILL; break; case NS_STYLE_POINTER_EVENTS_STROKE: - mask |= HITTEST_MASK_STROKE | HITTEST_MASK_FORCE_TEST; + mask |= HITTEST_MASK_STROKE; break; case NS_STYLE_POINTER_EVENTS_ALL: mask |= HITTEST_MASK_FILL | - HITTEST_MASK_STROKE | - HITTEST_MASK_FORCE_TEST; + HITTEST_MASK_STROKE; break; default: NS_ERROR("not reached"); diff --git a/layout/svg/base/src/nsSVGPathGeometryFrame.h b/layout/svg/base/src/nsSVGPathGeometryFrame.h index 8694c6f05fe..b7cb35ba4b4 100644 --- a/layout/svg/base/src/nsSVGPathGeometryFrame.h +++ b/layout/svg/base/src/nsSVGPathGeometryFrame.h @@ -54,7 +54,7 @@ typedef nsSVGGeometryFrame nsSVGPathGeometryFrameBase; #define HITTEST_MASK_FILL 0x01 #define HITTEST_MASK_STROKE 0x02 -#define HITTEST_MASK_FORCE_TEST 0x04 +#define HITTEST_MASK_CHECK_MRECT 0x04 class nsSVGPathGeometryFrame : public nsSVGPathGeometryFrameBase, public nsISVGChildFrame