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:
Emilio Cobos Álvarez 2024-09-02 17:26:20 +00:00
Родитель 6e8da4e110
Коммит fa8ab09ae0
2 изменённых файлов: 0 добавлений и 54 удалений

Просмотреть файл

@ -32,46 +32,6 @@ bool SVGTransformableElement::IsAttributeMapped(
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) {
return nsContentUtils::IsEventAttributeName(aName, EventNameType_SVGGraphic);
}
@ -79,13 +39,6 @@ bool SVGTransformableElement::IsEventAttributeNameInternal(nsAtom* aName) {
//----------------------------------------------------------------------
// 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 {
return mAnimateMotionTransform.get();
}

Просмотреть файл

@ -33,16 +33,9 @@ class SVGTransformableElement : public SVGElement {
// WebIDL
already_AddRefed<DOMSVGAnimatedTransformList> Transform();
// nsIContent interface
nsChangeHint GetAttributeChangeHint(const nsAtom* aAttribute,
int32_t aModType) const override;
// SVGElement overrides
bool IsEventAttributeNameInternal(nsAtom* aName) override;
gfxMatrix PrependLocalTransformsTo(
const gfxMatrix& aMatrix,
SVGTransformTypes aWhich = eAllTransforms) const override;
const gfx::Matrix* GetAnimateMotionTransform() const override;
void SetAnimateMotionTransform(const gfx::Matrix* aMatrix) override;
NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const override;