Bug 1423492 part 3. Stop overring UnsetAttr in SVGMarkerElement. r=bytesized,qdot

This changes behavior some, by moving the code involved from "before we remove
the attribute" to AfterSetAttr.  But I think it should be OK, and SVG elements
can't sanely implement BeforeSetAttr right now...

MozReview-Commit-ID: KQGIDQOMGne
This commit is contained in:
Boris Zbarsky 2018-01-03 21:03:45 -05:00
Родитель 95e7db08f7
Коммит 834c47ec08
2 изменённых файлов: 17 добавлений и 9 удалений

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

@ -237,16 +237,21 @@ SVGMarkerElement::ParseAttribute(int32_t aNameSpaceID, nsAtom* aName,
}
nsresult
SVGMarkerElement::UnsetAttr(int32_t aNamespaceID, nsAtom* aName,
bool aNotify)
SVGMarkerElement::AfterSetAttr(int32_t aNamespaceID, nsAtom* aName,
const nsAttrValue* aValue,
const nsAttrValue* aOldValue,
nsIPrincipal* aMaybeScriptedPrincipal,
bool aNotify)
{
if (aNamespaceID == kNameSpaceID_None) {
if (aName == nsGkAtoms::orient) {
mOrientType.SetBaseValue(SVG_MARKER_ORIENT_ANGLE);
}
if (!aValue && aNamespaceID == kNameSpaceID_None &&
aName == nsGkAtoms::orient) {
mOrientType.SetBaseValue(SVG_MARKER_ORIENT_ANGLE);
}
return nsSVGElement::UnsetAttr(aNamespaceID, aName, aNotify);
return SVGMarkerElementBase::AfterSetAttr(aNamespaceID, aName,
aValue, aOldValue,
aMaybeScriptedPrincipal,
aNotify);
}
//----------------------------------------------------------------------

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

@ -115,8 +115,11 @@ public:
// nsIContent interface
NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* name) const override;
virtual nsresult UnsetAttr(int32_t aNameSpaceID, nsAtom* aAttribute,
bool aNotify) override;
virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsAtom* aName,
const nsAttrValue* aValue,
const nsAttrValue* aOldValue,
nsIPrincipal* aMaybeScriptedPrincipal,
bool aNotify) override;
// nsSVGSVGElement methods:
virtual bool HasValidDimensions() const override;