Backed out changeset cd40ea4d0a95 (bug 1446617) for Reftest failure on build/tests/reftest/tests/layout/reftests/svg/textPath-path-attribute-01.svg

This commit is contained in:
Dorel Luca 2018-03-31 16:02:10 +03:00
parent 76c8556c39
commit 4e6205407f
7 changed files with 7 additions and 91 deletions

View File

@ -144,12 +144,6 @@ SVGAnimatedPathSegList::ClearAnimValue(nsSVGElement *aElement)
aElement->DidAnimatePathSegList();
}
bool
SVGAnimatedPathSegList::IsRendered() const
{
return mAnimVal ? !mAnimVal->IsEmpty() : !mBaseVal.IsEmpty();
}
UniquePtr<nsISMILAttr>
SVGAnimatedPathSegList::ToSMILAttr(nsSVGElement *aElement)
{

View File

@ -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!

View File

@ -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<SVGAnimatedLength> StartOffset();
already_AddRefed<SVGAnimatedEnumeration> Method();
@ -84,8 +75,6 @@ public:
enum { HREF, XLINK_HREF };
nsSVGString mStringAttributes[2];
static StringInfo sStringInfo[2];
SVGAnimatedPathSegList mPath;
};
} // namespace dom

View File

@ -30,7 +30,6 @@ EXPORTS.mozilla.dom += [
'SVGAnimatedInteger.h',
'SVGAnimatedLength.h',
'SVGAnimatedNumber.h',
'SVGAnimatedPathSegList.h',
'SVGAnimatedRect.h',
'SVGAnimatedString.h',
'SVGAnimatedTransformList.h',

View File

@ -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

View File

@ -1,42 +0,0 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg">
<defs>
<path id="path" d="M 100 100 h 400"/>
</defs>
<style>
.cover {
fill: lime;
stroke: lime;
stroke-width: 3px;
}
</style>
<rect width="100%" height="100%" fill="lime" />
<text font-size="20">
<textPath href="#path" fill="red">1 Should not see this</textPath>
<textPath path="M 100 100 h 400" class="cover">1 Should not see this</textPath>
</text>
<text transform="translate(0,50)" font-size="20">
<textPath fill="red">2 Should not see this
<set attributeName="path" to="M 100 100 h 400"/>
</textPath>
<textPath href="#path" class="cover">2 Should not see this
</textPath>
</text>
<text transform="translate(0,100)" font-size="20">
<textPath fill="red" path="M 400 100 h 400" href="#path">3 Should not see this
<set attributeName="path" to=""/>
</textPath>
<textPath href="#path" class="cover">3 Should not see this
</textPath>
</text>
</svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -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<Path>
SVGTextFrame::GetTextPath(nsIFrame* aTextPathFrame)
{
nsIContent* content = aTextPathFrame->GetContent();
SVGTextPathElement* tp = static_cast<SVGTextPathElement*>(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> path = geomElement->GetOrBuildPathForMeasuring();
RefPtr<Path> 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<PathBuilder> 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<SVGTextPathElement*>(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