mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
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:
parent
76c8556c39
commit
4e6205407f
@ -144,12 +144,6 @@ SVGAnimatedPathSegList::ClearAnimValue(nsSVGElement *aElement)
|
|||||||
aElement->DidAnimatePathSegList();
|
aElement->DidAnimatePathSegList();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
|
||||||
SVGAnimatedPathSegList::IsRendered() const
|
|
||||||
{
|
|
||||||
return mAnimVal ? !mAnimVal->IsEmpty() : !mBaseVal.IsEmpty();
|
|
||||||
}
|
|
||||||
|
|
||||||
UniquePtr<nsISMILAttr>
|
UniquePtr<nsISMILAttr>
|
||||||
SVGAnimatedPathSegList::ToSMILAttr(nsSVGElement *aElement)
|
SVGAnimatedPathSegList::ToSMILAttr(nsSVGElement *aElement)
|
||||||
{
|
{
|
||||||
|
@ -73,11 +73,6 @@ public:
|
|||||||
|
|
||||||
void ClearAnimValue(nsSVGElement *aElement);
|
void ClearAnimValue(nsSVGElement *aElement);
|
||||||
|
|
||||||
/**
|
|
||||||
* Empty paths are not rendered.
|
|
||||||
*/
|
|
||||||
bool IsRendered() const;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Needed for correct DOM wrapper construction since GetAnimValue may
|
* Needed for correct DOM wrapper construction since GetAnimValue may
|
||||||
* actually return the baseVal!
|
* actually return the baseVal!
|
||||||
|
@ -10,7 +10,6 @@
|
|||||||
#include "nsSVGEnum.h"
|
#include "nsSVGEnum.h"
|
||||||
#include "nsSVGLength2.h"
|
#include "nsSVGLength2.h"
|
||||||
#include "nsSVGString.h"
|
#include "nsSVGString.h"
|
||||||
#include "mozilla/dom/SVGAnimatedPathSegList.h"
|
|
||||||
#include "mozilla/dom/SVGTextContentElement.h"
|
#include "mozilla/dom/SVGTextContentElement.h"
|
||||||
|
|
||||||
class nsAtom;
|
class nsAtom;
|
||||||
@ -45,14 +44,6 @@ public:
|
|||||||
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult,
|
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult,
|
||||||
bool aPreallocateChildren) const override;
|
bool aPreallocateChildren) const override;
|
||||||
|
|
||||||
SVGAnimatedPathSegList* GetAnimPathSegList() override {
|
|
||||||
return &mPath;
|
|
||||||
}
|
|
||||||
|
|
||||||
nsAtom* GetPathDataAttrName() const override {
|
|
||||||
return nsGkAtoms::path;
|
|
||||||
}
|
|
||||||
|
|
||||||
// WebIDL
|
// WebIDL
|
||||||
already_AddRefed<SVGAnimatedLength> StartOffset();
|
already_AddRefed<SVGAnimatedLength> StartOffset();
|
||||||
already_AddRefed<SVGAnimatedEnumeration> Method();
|
already_AddRefed<SVGAnimatedEnumeration> Method();
|
||||||
@ -84,8 +75,6 @@ public:
|
|||||||
enum { HREF, XLINK_HREF };
|
enum { HREF, XLINK_HREF };
|
||||||
nsSVGString mStringAttributes[2];
|
nsSVGString mStringAttributes[2];
|
||||||
static StringInfo sStringInfo[2];
|
static StringInfo sStringInfo[2];
|
||||||
|
|
||||||
SVGAnimatedPathSegList mPath;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace dom
|
} // namespace dom
|
||||||
|
@ -30,7 +30,6 @@ EXPORTS.mozilla.dom += [
|
|||||||
'SVGAnimatedInteger.h',
|
'SVGAnimatedInteger.h',
|
||||||
'SVGAnimatedLength.h',
|
'SVGAnimatedLength.h',
|
||||||
'SVGAnimatedNumber.h',
|
'SVGAnimatedNumber.h',
|
||||||
'SVGAnimatedPathSegList.h',
|
|
||||||
'SVGAnimatedRect.h',
|
'SVGAnimatedRect.h',
|
||||||
'SVGAnimatedString.h',
|
'SVGAnimatedString.h',
|
||||||
'SVGAnimatedTransformList.h',
|
'SVGAnimatedTransformList.h',
|
||||||
|
@ -477,7 +477,6 @@ fuzzy-if(skiaContent,1,610) == textPath-03.svg pass.svg
|
|||||||
== textPath-05.html pass.svg
|
== textPath-05.html pass.svg
|
||||||
== textPath-06.svg pass.svg
|
== textPath-06.svg pass.svg
|
||||||
== textPath-line-01.svg textPath-line-01-ref.svg
|
== textPath-line-01.svg textPath-line-01-ref.svg
|
||||||
== textPath-path-attribute-01.svg pass.svg
|
|
||||||
== textPath-side-attribute-01.svg pass.svg
|
== textPath-side-attribute-01.svg pass.svg
|
||||||
|
|
||||||
== text-white-space-01.svg text-white-space-01-ref.svg
|
== text-white-space-01.svg text-white-space-01-ref.svg
|
||||||
|
@ -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 |
@ -3382,7 +3382,6 @@ SVGTextFrame::HandleAttributeChangeInDescendant(Element* aElement,
|
|||||||
if (aElement->IsSVGElement(nsGkAtoms::textPath)) {
|
if (aElement->IsSVGElement(nsGkAtoms::textPath)) {
|
||||||
if (aNameSpaceID == kNameSpaceID_None &&
|
if (aNameSpaceID == kNameSpaceID_None &&
|
||||||
(aAttribute == nsGkAtoms::startOffset ||
|
(aAttribute == nsGkAtoms::startOffset ||
|
||||||
aAttribute == nsGkAtoms::path ||
|
|
||||||
aAttribute == nsGkAtoms::side_)) {
|
aAttribute == nsGkAtoms::side_)) {
|
||||||
NotifyGlyphMetricsChange();
|
NotifyGlyphMetricsChange();
|
||||||
} else if ((aNameSpaceID == kNameSpaceID_XLink ||
|
} else if ((aNameSpaceID == kNameSpaceID_XLink ||
|
||||||
@ -5020,27 +5019,18 @@ SVGTextFrame::GetTextPathGeometryElement(nsIFrame* aTextPathFrame)
|
|||||||
already_AddRefed<Path>
|
already_AddRefed<Path>
|
||||||
SVGTextFrame::GetTextPath(nsIFrame* aTextPathFrame)
|
SVGTextFrame::GetTextPath(nsIFrame* aTextPathFrame)
|
||||||
{
|
{
|
||||||
nsIContent* content = aTextPathFrame->GetContent();
|
SVGGeometryElement* element = GetTextPathGeometryElement(aTextPathFrame);
|
||||||
SVGTextPathElement* tp = static_cast<SVGTextPathElement*>(content);
|
if (!element) {
|
||||||
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) {
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
RefPtr<Path> path = geomElement->GetOrBuildPathForMeasuring();
|
RefPtr<Path> path = element->GetOrBuildPathForMeasuring();
|
||||||
if (!path) {
|
if (!path) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
gfxMatrix matrix = geomElement->PrependLocalTransformsTo(gfxMatrix());
|
gfxMatrix matrix = element->PrependLocalTransformsTo(gfxMatrix());
|
||||||
if (!matrix.IsIdentity()) {
|
if (!matrix.IsIdentity()) {
|
||||||
// Apply the geometry element's transform
|
|
||||||
RefPtr<PathBuilder> builder =
|
RefPtr<PathBuilder> builder =
|
||||||
path->TransformedCopyToBuilder(ToMatrix(matrix));
|
path->TransformedCopyToBuilder(ToMatrix(matrix));
|
||||||
path = builder->Finish();
|
path = builder->Finish();
|
||||||
@ -5052,19 +5042,11 @@ SVGTextFrame::GetTextPath(nsIFrame* aTextPathFrame)
|
|||||||
gfxFloat
|
gfxFloat
|
||||||
SVGTextFrame::GetOffsetScale(nsIFrame* aTextPathFrame)
|
SVGTextFrame::GetOffsetScale(nsIFrame* aTextPathFrame)
|
||||||
{
|
{
|
||||||
nsIContent* content = aTextPathFrame->GetContent();
|
SVGGeometryElement* element = GetTextPathGeometryElement(aTextPathFrame);
|
||||||
SVGTextPathElement* tp = static_cast<SVGTextPathElement*>(content);
|
if (!element)
|
||||||
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)
|
|
||||||
return 1.0;
|
return 1.0;
|
||||||
|
|
||||||
return geomElement->GetPathLengthScale(SVGGeometryElement::eForTextPath);
|
return element->GetPathLengthScale(SVGGeometryElement::eForTextPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
gfxFloat
|
gfxFloat
|
||||||
|
Loading…
Reference in New Issue
Block a user