diff --git a/dom/svg/SVGAnimatedPathSegList.cpp b/dom/svg/SVGAnimatedPathSegList.cpp index 27b91272350e..1a2dd5c89878 100644 --- a/dom/svg/SVGAnimatedPathSegList.cpp +++ b/dom/svg/SVGAnimatedPathSegList.cpp @@ -144,12 +144,6 @@ SVGAnimatedPathSegList::ClearAnimValue(nsSVGElement *aElement) aElement->DidAnimatePathSegList(); } -bool -SVGAnimatedPathSegList::IsRendered() const -{ - return mAnimVal ? !mAnimVal->IsEmpty() : !mBaseVal.IsEmpty(); -} - UniquePtr SVGAnimatedPathSegList::ToSMILAttr(nsSVGElement *aElement) { diff --git a/dom/svg/SVGAnimatedPathSegList.h b/dom/svg/SVGAnimatedPathSegList.h index 17e7a17a76b7..eda6de84abe6 100644 --- a/dom/svg/SVGAnimatedPathSegList.h +++ b/dom/svg/SVGAnimatedPathSegList.h @@ -73,11 +73,6 @@ public: void ClearAnimValue(nsSVGElement *aElement); - /** - * Empty paths are not rendered. - */ - bool IsRendered() const; - /** * Needed for correct DOM wrapper construction since GetAnimValue may * actually return the baseVal! diff --git a/dom/svg/SVGTextPathElement.h b/dom/svg/SVGTextPathElement.h index 4f8fd30e42e4..3cd45b546f85 100644 --- a/dom/svg/SVGTextPathElement.h +++ b/dom/svg/SVGTextPathElement.h @@ -10,7 +10,6 @@ #include "nsSVGEnum.h" #include "nsSVGLength2.h" #include "nsSVGString.h" -#include "mozilla/dom/SVGAnimatedPathSegList.h" #include "mozilla/dom/SVGTextContentElement.h" class nsAtom; @@ -45,14 +44,6 @@ public: virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult, bool aPreallocateChildren) const override; - SVGAnimatedPathSegList* GetAnimPathSegList() override { - return &mPath; - } - - nsAtom* GetPathDataAttrName() const override { - return nsGkAtoms::path; - } - // WebIDL already_AddRefed StartOffset(); already_AddRefed Method(); @@ -84,8 +75,6 @@ public: enum { HREF, XLINK_HREF }; nsSVGString mStringAttributes[2]; static StringInfo sStringInfo[2]; - - SVGAnimatedPathSegList mPath; }; } // namespace dom diff --git a/dom/svg/moz.build b/dom/svg/moz.build index 6f79fc07d6e3..f61bf775e6a2 100644 --- a/dom/svg/moz.build +++ b/dom/svg/moz.build @@ -30,7 +30,6 @@ EXPORTS.mozilla.dom += [ 'SVGAnimatedInteger.h', 'SVGAnimatedLength.h', 'SVGAnimatedNumber.h', - 'SVGAnimatedPathSegList.h', 'SVGAnimatedRect.h', 'SVGAnimatedString.h', 'SVGAnimatedTransformList.h', diff --git a/layout/reftests/svg/reftest.list b/layout/reftests/svg/reftest.list index ff00fceb45a2..10f17f0a697e 100644 --- a/layout/reftests/svg/reftest.list +++ b/layout/reftests/svg/reftest.list @@ -477,7 +477,6 @@ fuzzy-if(skiaContent,1,610) == textPath-03.svg pass.svg == textPath-05.html pass.svg == textPath-06.svg pass.svg == textPath-line-01.svg textPath-line-01-ref.svg -== textPath-path-attribute-01.svg pass.svg == textPath-side-attribute-01.svg pass.svg == text-white-space-01.svg text-white-space-01-ref.svg diff --git a/layout/reftests/svg/textPath-path-attribute-01.svg b/layout/reftests/svg/textPath-path-attribute-01.svg deleted file mode 100644 index 444098158c5a..000000000000 --- a/layout/reftests/svg/textPath-path-attribute-01.svg +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - 1 Should not see this - 1 Should not see this - - - - 2 Should not see this - - - 2 Should not see this - - - - - 3 Should not see this - - - 3 Should not see this - - - - diff --git a/layout/svg/SVGTextFrame.cpp b/layout/svg/SVGTextFrame.cpp index 46b62f78a8e2..003337d013a7 100644 --- a/layout/svg/SVGTextFrame.cpp +++ b/layout/svg/SVGTextFrame.cpp @@ -3382,7 +3382,6 @@ SVGTextFrame::HandleAttributeChangeInDescendant(Element* aElement, if (aElement->IsSVGElement(nsGkAtoms::textPath)) { if (aNameSpaceID == kNameSpaceID_None && (aAttribute == nsGkAtoms::startOffset || - aAttribute == nsGkAtoms::path || aAttribute == nsGkAtoms::side_)) { NotifyGlyphMetricsChange(); } else if ((aNameSpaceID == kNameSpaceID_XLink || @@ -5020,27 +5019,18 @@ SVGTextFrame::GetTextPathGeometryElement(nsIFrame* aTextPathFrame) already_AddRefed SVGTextFrame::GetTextPath(nsIFrame* aTextPathFrame) { - nsIContent* content = aTextPathFrame->GetContent(); - SVGTextPathElement* tp = static_cast(content); - if (tp->mPath.IsRendered()) { - // This is just an attribute so there's no transform that can apply - // so we can just return the path directly. - return tp->mPath.GetAnimValue().BuildPathForMeasuring(); - } - - SVGGeometryElement* geomElement = GetTextPathGeometryElement(aTextPathFrame); - if (!geomElement) { + SVGGeometryElement* element = GetTextPathGeometryElement(aTextPathFrame); + if (!element) { return nullptr; } - RefPtr path = geomElement->GetOrBuildPathForMeasuring(); + RefPtr path = element->GetOrBuildPathForMeasuring(); if (!path) { return nullptr; } - gfxMatrix matrix = geomElement->PrependLocalTransformsTo(gfxMatrix()); + gfxMatrix matrix = element->PrependLocalTransformsTo(gfxMatrix()); if (!matrix.IsIdentity()) { - // Apply the geometry element's transform RefPtr builder = path->TransformedCopyToBuilder(ToMatrix(matrix)); path = builder->Finish(); @@ -5052,19 +5042,11 @@ SVGTextFrame::GetTextPath(nsIFrame* aTextPathFrame) gfxFloat SVGTextFrame::GetOffsetScale(nsIFrame* aTextPathFrame) { - nsIContent* content = aTextPathFrame->GetContent(); - SVGTextPathElement* tp = static_cast(content); - if (tp->mPath.IsRendered()) { - // A path attribute has no pathLength or transform - // so we return a unit scale. - return 1.0; - } - - SVGGeometryElement* geomElement = GetTextPathGeometryElement(aTextPathFrame); - if (!geomElement) + SVGGeometryElement* element = GetTextPathGeometryElement(aTextPathFrame); + if (!element) return 1.0; - return geomElement->GetPathLengthScale(SVGGeometryElement::eForTextPath); + return element->GetPathLengthScale(SVGGeometryElement::eForTextPath); } gfxFloat