зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
09e99cfbd1
Коммит
bf3378292a
|
@ -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:
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче