Bug 461199 (Part 19) - nsSVGAElement fails to call ResetLinkState in [Uns|S]etAttr

Have nsSVGAelement implement UnsetAttr and SetAttr, and make sure it calls
mozilla::dom::Link::ResetLinkState when appropriate.
r=jwatt
sr=bz
This commit is contained in:
Shawn Wilsher 2010-02-24 08:37:02 -08:00
Родитель 09e99cfbd1
Коммит bf3378292a
2 изменённых файлов: 34 добавлений и 0 удалений

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

@ -263,6 +263,30 @@ nsSVGAElement::IntrinsicState() const
return Link::LinkState() | nsSVGAElementBase::IntrinsicState();
}
nsresult
nsSVGAElement::SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
nsIAtom* aPrefix, const nsAString& aValue,
PRBool aNotify)
{
if (aName == nsGkAtoms::href && aNameSpaceID == kNameSpaceID_XLink) {
Link::ResetLinkState();
}
return nsSVGAElementBase::SetAttr(aNameSpaceID, aName, aPrefix, aValue,
aNotify);
}
nsresult
nsSVGAElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttr,
PRBool aNotify)
{
if (aAttr == nsGkAtoms::href && aNameSpaceID == kNameSpaceID_XLink) {
Link::ResetLinkState();
}
return nsSVGAElementBase::UnsetAttr(aNameSpaceID, aAttr, aNotify);
}
//----------------------------------------------------------------------
// nsSVGElement methods

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

@ -90,6 +90,16 @@ public:
virtual void SetLinkState(nsLinkState aState);
virtual already_AddRefed<nsIURI> GetHrefURI() const;
virtual PRInt32 IntrinsicState() const;
nsresult SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
const nsAString& aValue, PRBool aNotify)
{
return SetAttr(aNameSpaceID, aName, nsnull, aValue, aNotify);
}
virtual nsresult SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
nsIAtom* aPrefix, const nsAString& aValue,
PRBool aNotify);
virtual nsresult UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
PRBool aNotify);
protected: