mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
Fix bug 393802 for HTML links: remove them from the link map when they stop being links due to removeAttribute. r+sr=bz
This commit is contained in:
parent
9e72e6554f
commit
10a4553f65
@ -664,6 +664,10 @@ nsHTMLAnchorElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
|
|||||||
PRBool aNotify)
|
PRBool aNotify)
|
||||||
{
|
{
|
||||||
if (aAttribute == nsGkAtoms::href && kNameSpaceID_None == aNameSpaceID) {
|
if (aAttribute == nsGkAtoms::href && kNameSpaceID_None == aNameSpaceID) {
|
||||||
|
nsIDocument* doc = GetCurrentDoc();
|
||||||
|
if (doc) {
|
||||||
|
doc->ForgetLink(this);
|
||||||
|
}
|
||||||
SetLinkState(eLinkState_Unknown);
|
SetLinkState(eLinkState_Unknown);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -279,6 +279,14 @@ nsresult
|
|||||||
nsHTMLAreaElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
|
nsHTMLAreaElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
|
||||||
PRBool aNotify)
|
PRBool aNotify)
|
||||||
{
|
{
|
||||||
|
if (aAttribute == nsGkAtoms::href && kNameSpaceID_None == aNameSpaceID) {
|
||||||
|
nsIDocument* doc = GetCurrentDoc();
|
||||||
|
if (doc) {
|
||||||
|
doc->ForgetLink(this);
|
||||||
|
}
|
||||||
|
SetLinkState(eLinkState_Unknown);
|
||||||
|
}
|
||||||
|
|
||||||
if (aAttribute == nsGkAtoms::accesskey &&
|
if (aAttribute == nsGkAtoms::accesskey &&
|
||||||
aNameSpaceID == kNameSpaceID_None) {
|
aNameSpaceID == kNameSpaceID_None) {
|
||||||
RegUnRegAccessKey(PR_FALSE);
|
RegUnRegAccessKey(PR_FALSE);
|
||||||
|
@ -322,6 +322,14 @@ nsresult
|
|||||||
nsHTMLLinkElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
|
nsHTMLLinkElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
|
||||||
PRBool aNotify)
|
PRBool aNotify)
|
||||||
{
|
{
|
||||||
|
if (aAttribute == nsGkAtoms::href && kNameSpaceID_None == aNameSpaceID) {
|
||||||
|
nsIDocument* doc = GetCurrentDoc();
|
||||||
|
if (doc) {
|
||||||
|
doc->ForgetLink(this);
|
||||||
|
}
|
||||||
|
SetLinkState(eLinkState_Unknown);
|
||||||
|
}
|
||||||
|
|
||||||
nsresult rv = nsGenericHTMLElement::UnsetAttr(aNameSpaceID, aAttribute,
|
nsresult rv = nsGenericHTMLElement::UnsetAttr(aNameSpaceID, aAttribute,
|
||||||
aNotify);
|
aNotify);
|
||||||
if (NS_SUCCEEDED(rv)) {
|
if (NS_SUCCEEDED(rv)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user