Bug 771042, part 1 - Fix invalidation of animateMotion. r=birtles.

This commit is contained in:
Jonathan Watt 2012-07-09 18:41:12 +01:00
parent a7eb97f896
commit 9eeaa6feea
5 changed files with 14 additions and 3 deletions

View File

@ -154,6 +154,7 @@ public:
// Only visible for nsSVGGraphicElement, so it's a no-op here, and that
// subclass has the useful implementation.
virtual void SetAnimateMotionTransform(const gfxMatrix* aMatrix) {/*no-op*/}
virtual const gfxMatrix* GetAnimateMotionTransform() const { return nsnull; }
bool IsStringAnimatable(PRUint8 aAttrEnum) {
return GetStringInfo().mStringInfo[aAttrEnum].mIsAnimatable;

View File

@ -152,7 +152,8 @@ nsSVGGraphicElement::GetAttributeChangeHint(const nsIAtom* aAttribute,
{
nsChangeHint retval =
nsSVGGraphicElementBase::GetAttributeChangeHint(aAttribute, aModType);
if (aAttribute == nsGkAtoms::transform) {
if (aAttribute == nsGkAtoms::transform ||
aAttribute == nsGkAtoms::mozAnimateMotionDummyAttr) {
// We add nsChangeHint_UpdateOverflow so that nsFrame::UpdateOverflow()
// will be called on us and our ancestors.
nsIFrame* frame =
@ -226,6 +227,12 @@ nsSVGGraphicElement::PrependLocalTransformsTo(const gfxMatrix &aMatrix,
return result;
}
const gfxMatrix*
nsSVGGraphicElement::GetAnimateMotionTransform() const
{
return mAnimateMotionTransform.get();
}
void
nsSVGGraphicElement::SetAnimateMotionTransform(const gfxMatrix* aMatrix)
{

View File

@ -34,6 +34,7 @@ public:
virtual gfxMatrix PrependLocalTransformsTo(const gfxMatrix &aMatrix,
TransformTypes aWhich = eAllTransforms) const;
virtual const gfxMatrix* GetAnimateMotionTransform() const;
virtual void SetAnimateMotionTransform(const gfxMatrix* aMatrix);
virtual mozilla::SVGAnimatedTransformList* GetAnimatedTransformList();

View File

@ -163,7 +163,8 @@ nsSVGDisplayContainerFrame::IsSVGTransformed(gfxMatrix *aOwnTransform,
nsSVGElement *content = static_cast<nsSVGElement*>(mContent);
const SVGAnimatedTransformList *list = content->GetAnimatedTransformList();
if (list && !list->GetAnimValue().IsEmpty()) {
if ((list && !list->GetAnimValue().IsEmpty()) ||
content->GetAnimateMotionTransform()) {
if (aOwnTransform) {
*aOwnTransform = content->PrependLocalTransformsTo(gfxMatrix(),
nsSVGElement::eUserSpaceToParent);

View File

@ -93,7 +93,8 @@ nsSVGPathGeometryFrame::IsSVGTransformed(gfxMatrix *aOwnTransform,
nsSVGElement *content = static_cast<nsSVGElement*>(mContent);
const SVGAnimatedTransformList *list = content->GetAnimatedTransformList();
if (list && !list->GetAnimValue().IsEmpty()) {
if ((list && !list->GetAnimValue().IsEmpty()) ||
content->GetAnimateMotionTransform()) {
if (aOwnTransform) {
*aOwnTransform = content->PrependLocalTransformsTo(gfxMatrix(),
nsSVGElement::eUserSpaceToParent);