From ca40beec750ddfc64a63d09b4dbc14cf8f44d7fb Mon Sep 17 00:00:00 2001 From: Jonathan Watt Date: Thu, 7 Aug 2014 08:09:34 +0100 Subject: [PATCH] Bug 1049256, part 2 - Get rid of nsISVGChildFrame::FOR_HIT_TESTING. r=longsonr --- layout/svg/SVGTextFrame.cpp | 10 +++++----- layout/svg/nsISVGChildFrame.h | 1 - layout/svg/nsSVGAFrame.cpp | 3 --- layout/svg/nsSVGForeignObjectFrame.cpp | 3 --- layout/svg/nsSVGGFrame.cpp | 3 --- layout/svg/nsSVGGenericContainerFrame.cpp | 3 --- layout/svg/nsSVGInnerSVGFrame.cpp | 3 --- layout/svg/nsSVGOuterSVGFrame.cpp | 3 --- layout/svg/nsSVGPathGeometryFrame.cpp | 3 --- layout/svg/nsSVGUtils.cpp | 8 -------- 10 files changed, 5 insertions(+), 35 deletions(-) diff --git a/layout/svg/SVGTextFrame.cpp b/layout/svg/SVGTextFrame.cpp index 6c8508ee625b..908db5be85d5 100644 --- a/layout/svg/SVGTextFrame.cpp +++ b/layout/svg/SVGTextFrame.cpp @@ -3432,8 +3432,11 @@ SVGTextFrame::FindCloserFrameForSelection( userRect.Scale(devPxPerCSSPx); if (!userRect.IsEmpty()) { - nsRect rect = nsSVGUtils::ToCanvasBounds(userRect.ToThebesRect(), - GetCanvasTM(FOR_HIT_TESTING), + gfxMatrix m; + if (!NS_SVGDisplayListHitTestingEnabled()) { + m = GetCanvasTM(FOR_OUTERSVG_TM); + } + nsRect rect = nsSVGUtils::ToCanvasBounds(userRect.ToThebesRect(), m, presContext); if (nsLayoutUtils::PointIsCloserToRect(aPoint, rect, @@ -3893,9 +3896,6 @@ SVGTextFrame::GetCanvasTM(uint32_t aFor, nsIFrame* aTransformRoot) if (aFor == FOR_PAINTING && NS_SVGDisplayListPaintingEnabled()) { return nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(this); } - if (aFor == FOR_HIT_TESTING && NS_SVGDisplayListHitTestingEnabled()) { - return gfxMatrix(); - } } if (!mCanvasTM) { NS_ASSERTION(GetParent(), "null parent"); diff --git a/layout/svg/nsISVGChildFrame.h b/layout/svg/nsISVGChildFrame.h index 73da24474962..519ba4ad3fb9 100644 --- a/layout/svg/nsISVGChildFrame.h +++ b/layout/svg/nsISVGChildFrame.h @@ -88,7 +88,6 @@ public: */ enum RequestingCanvasTMFor { FOR_PAINTING = 1, - FOR_HIT_TESTING, FOR_OUTERSVG_TM }; diff --git a/layout/svg/nsSVGAFrame.cpp b/layout/svg/nsSVGAFrame.cpp index 41cfb4f88143..9e540aa46499 100644 --- a/layout/svg/nsSVGAFrame.cpp +++ b/layout/svg/nsSVGAFrame.cpp @@ -138,9 +138,6 @@ nsSVGAFrame::GetCanvasTM(uint32_t aFor, nsIFrame* aTransformRoot) if (aFor == FOR_PAINTING && NS_SVGDisplayListPaintingEnabled()) { return nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(this); } - if (aFor == FOR_HIT_TESTING && NS_SVGDisplayListHitTestingEnabled()) { - return gfxMatrix(); - } } if (!mCanvasTM) { NS_ASSERTION(GetParent(), "null parent"); diff --git a/layout/svg/nsSVGForeignObjectFrame.cpp b/layout/svg/nsSVGForeignObjectFrame.cpp index bbe906a696be..ccbc88fe4438 100644 --- a/layout/svg/nsSVGForeignObjectFrame.cpp +++ b/layout/svg/nsSVGForeignObjectFrame.cpp @@ -487,9 +487,6 @@ nsSVGForeignObjectFrame::GetCanvasTM(uint32_t aFor, nsIFrame* aTransformRoot) if (aFor == FOR_PAINTING && NS_SVGDisplayListPaintingEnabled()) { return nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(this); } - if (aFor == FOR_HIT_TESTING && NS_SVGDisplayListHitTestingEnabled()) { - return gfxMatrix(); - } } if (!mCanvasTM) { NS_ASSERTION(GetParent(), "null parent"); diff --git a/layout/svg/nsSVGGFrame.cpp b/layout/svg/nsSVGGFrame.cpp index 591ca1da392b..af8eaa41bb34 100644 --- a/layout/svg/nsSVGGFrame.cpp +++ b/layout/svg/nsSVGGFrame.cpp @@ -71,9 +71,6 @@ nsSVGGFrame::GetCanvasTM(uint32_t aFor, nsIFrame* aTransformRoot) if (aFor == FOR_PAINTING && NS_SVGDisplayListPaintingEnabled()) { return nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(this); } - if (aFor == FOR_HIT_TESTING && NS_SVGDisplayListHitTestingEnabled()) { - return gfxMatrix(); - } } if (!mCanvasTM) { NS_ASSERTION(GetParent(), "null parent"); diff --git a/layout/svg/nsSVGGenericContainerFrame.cpp b/layout/svg/nsSVGGenericContainerFrame.cpp index 9f34ae64c63a..44f9056f4a3f 100644 --- a/layout/svg/nsSVGGenericContainerFrame.cpp +++ b/layout/svg/nsSVGGenericContainerFrame.cpp @@ -53,9 +53,6 @@ nsSVGGenericContainerFrame::GetCanvasTM(uint32_t aFor, if (aFor == FOR_PAINTING && NS_SVGDisplayListPaintingEnabled()) { return nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(this); } - if (aFor == FOR_HIT_TESTING && NS_SVGDisplayListHitTestingEnabled()) { - return gfxMatrix(); - } } NS_ASSERTION(GetParent(), "null parent"); diff --git a/layout/svg/nsSVGInnerSVGFrame.cpp b/layout/svg/nsSVGInnerSVGFrame.cpp index a385e72ea382..51bcc83574f1 100644 --- a/layout/svg/nsSVGInnerSVGFrame.cpp +++ b/layout/svg/nsSVGInnerSVGFrame.cpp @@ -298,9 +298,6 @@ nsSVGInnerSVGFrame::GetCanvasTM(uint32_t aFor, nsIFrame* aTransformRoot) if (aFor == FOR_PAINTING && NS_SVGDisplayListPaintingEnabled()) { return nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(this); } - if (aFor == FOR_HIT_TESTING && NS_SVGDisplayListHitTestingEnabled()) { - return gfxMatrix(); - } } if (!mCanvasTM) { NS_ASSERTION(GetParent(), "null parent"); diff --git a/layout/svg/nsSVGOuterSVGFrame.cpp b/layout/svg/nsSVGOuterSVGFrame.cpp index accb33844a76..43e6c8d2a7aa 100644 --- a/layout/svg/nsSVGOuterSVGFrame.cpp +++ b/layout/svg/nsSVGOuterSVGFrame.cpp @@ -831,9 +831,6 @@ nsSVGOuterSVGFrame::GetCanvasTM(uint32_t aFor, nsIFrame* aTransformRoot) if (aFor == FOR_PAINTING && NS_SVGDisplayListPaintingEnabled()) { return nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(this); } - if (aFor == FOR_HIT_TESTING && NS_SVGDisplayListHitTestingEnabled()) { - return gfxMatrix(); - } } if (!mCanvasTM) { NS_ASSERTION(!aTransformRoot, "transform root will be ignored here"); diff --git a/layout/svg/nsSVGPathGeometryFrame.cpp b/layout/svg/nsSVGPathGeometryFrame.cpp index 3955a7ea9490..daed1d4c7ece 100644 --- a/layout/svg/nsSVGPathGeometryFrame.cpp +++ b/layout/svg/nsSVGPathGeometryFrame.cpp @@ -552,9 +552,6 @@ nsSVGPathGeometryFrame::GetCanvasTM(uint32_t aFor, nsIFrame* aTransformRoot) if (aFor == FOR_PAINTING && NS_SVGDisplayListPaintingEnabled()) { return nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(this); } - if (aFor == FOR_HIT_TESTING && NS_SVGDisplayListHitTestingEnabled()) { - return gfxMatrix(); - } } NS_ASSERTION(GetParent(), "null parent"); diff --git a/layout/svg/nsSVGUtils.cpp b/layout/svg/nsSVGUtils.cpp index 854b4be7b5a1..89232c05a654 100644 --- a/layout/svg/nsSVGUtils.cpp +++ b/layout/svg/nsSVGUtils.cpp @@ -372,10 +372,6 @@ nsSVGUtils::GetCanvasTM(nsIFrame *aFrame, uint32_t aFor, // XXX yuck, we really need a common interface for GetCanvasTM if (!aFrame->IsFrameOfType(nsIFrame::eSVG)) { - if (aFor == nsISVGChildFrame::FOR_HIT_TESTING && - NS_SVGDisplayListHitTestingEnabled()) { - return gfxMatrix(); - } return nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(aFrame); } @@ -385,10 +381,6 @@ nsSVGUtils::GetCanvasTM(nsIFrame *aFrame, uint32_t aFor, NS_SVGDisplayListPaintingEnabled()) { return nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(aFrame); } - if (aFor == nsISVGChildFrame::FOR_HIT_TESTING && - NS_SVGDisplayListHitTestingEnabled()) { - return gfxMatrix(); - } } nsIAtom* type = aFrame->GetType();