Bug 1915971 - Remove some no longer needed code to handle transform attribute changes. r=longsonr
These are handled as part of the transform property changing now. Differential Revision: https://phabricator.services.mozilla.com/D220729
This commit is contained in:
@@ -32,46 +32,6 @@ bool SVGTransformableElement::IsAttributeMapped(
|
|||||||
SVGElement::IsAttributeMapped(aAttribute);
|
SVGElement::IsAttributeMapped(aAttribute);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsChangeHint SVGTransformableElement::GetAttributeChangeHint(
|
|
||||||
const nsAtom* aAttribute, int32_t aModType) const {
|
|
||||||
nsChangeHint retval =
|
|
||||||
SVGElement::GetAttributeChangeHint(aAttribute, aModType);
|
|
||||||
if (aAttribute == nsGkAtoms::transform ||
|
|
||||||
aAttribute == nsGkAtoms::mozAnimateMotionDummyAttr) {
|
|
||||||
nsIFrame* frame = GetPrimaryFrame();
|
|
||||||
retval |= nsChangeHint_InvalidateRenderingObservers;
|
|
||||||
if (!frame || frame->HasAnyStateBits(NS_FRAME_IS_NONDISPLAY)) {
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isAdditionOrRemoval = false;
|
|
||||||
if (aModType == MutationEvent_Binding::ADDITION ||
|
|
||||||
aModType == MutationEvent_Binding::REMOVAL) {
|
|
||||||
isAdditionOrRemoval = true;
|
|
||||||
} else {
|
|
||||||
MOZ_ASSERT(aModType == MutationEvent_Binding::MODIFICATION,
|
|
||||||
"Unknown modification type.");
|
|
||||||
if (!mTransforms || !mTransforms->HasTransform()) {
|
|
||||||
// New value is empty, treat as removal.
|
|
||||||
// FIXME: Should we just rely on CreatedOrRemovedOnLastChange?
|
|
||||||
isAdditionOrRemoval = true;
|
|
||||||
} else if (mTransforms->CreatedOrRemovedOnLastChange()) {
|
|
||||||
// Old value was empty, treat as addition.
|
|
||||||
isAdditionOrRemoval = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isAdditionOrRemoval) {
|
|
||||||
retval |= nsChangeHint_ComprehensiveAddOrRemoveTransform;
|
|
||||||
} else {
|
|
||||||
// We just assume the old and new transforms are different.
|
|
||||||
retval |= nsChangeHint_UpdatePostTransformOverflow |
|
|
||||||
nsChangeHint_UpdateTransformLayer;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool SVGTransformableElement::IsEventAttributeNameInternal(nsAtom* aName) {
|
bool SVGTransformableElement::IsEventAttributeNameInternal(nsAtom* aName) {
|
||||||
return nsContentUtils::IsEventAttributeName(aName, EventNameType_SVGGraphic);
|
return nsContentUtils::IsEventAttributeName(aName, EventNameType_SVGGraphic);
|
||||||
}
|
}
|
||||||
@@ -79,13 +39,6 @@ bool SVGTransformableElement::IsEventAttributeNameInternal(nsAtom* aName) {
|
|||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// SVGElement overrides
|
// SVGElement overrides
|
||||||
|
|
||||||
gfxMatrix SVGTransformableElement::PrependLocalTransformsTo(
|
|
||||||
const gfxMatrix& aMatrix, SVGTransformTypes aWhich) const {
|
|
||||||
// We don't have any eUserSpaceToParent transforms. (Sub-classes that do
|
|
||||||
// must override this function and handle that themselves.)
|
|
||||||
return aMatrix;
|
|
||||||
}
|
|
||||||
|
|
||||||
const gfx::Matrix* SVGTransformableElement::GetAnimateMotionTransform() const {
|
const gfx::Matrix* SVGTransformableElement::GetAnimateMotionTransform() const {
|
||||||
return mAnimateMotionTransform.get();
|
return mAnimateMotionTransform.get();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,16 +33,9 @@ class SVGTransformableElement : public SVGElement {
|
|||||||
// WebIDL
|
// WebIDL
|
||||||
already_AddRefed<DOMSVGAnimatedTransformList> Transform();
|
already_AddRefed<DOMSVGAnimatedTransformList> Transform();
|
||||||
|
|
||||||
// nsIContent interface
|
|
||||||
nsChangeHint GetAttributeChangeHint(const nsAtom* aAttribute,
|
|
||||||
int32_t aModType) const override;
|
|
||||||
|
|
||||||
// SVGElement overrides
|
// SVGElement overrides
|
||||||
bool IsEventAttributeNameInternal(nsAtom* aName) override;
|
bool IsEventAttributeNameInternal(nsAtom* aName) override;
|
||||||
|
|
||||||
gfxMatrix PrependLocalTransformsTo(
|
|
||||||
const gfxMatrix& aMatrix,
|
|
||||||
SVGTransformTypes aWhich = eAllTransforms) const override;
|
|
||||||
const gfx::Matrix* GetAnimateMotionTransform() const override;
|
const gfx::Matrix* GetAnimateMotionTransform() const override;
|
||||||
void SetAnimateMotionTransform(const gfx::Matrix* aMatrix) override;
|
void SetAnimateMotionTransform(const gfx::Matrix* aMatrix) override;
|
||||||
NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const override;
|
NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const override;
|
||||||
|
|||||||
Reference in New Issue
Block a user