Merge for backout of changeset 550a4379468f.

This commit is contained in:
Shawn Wilsher 2010-02-18 09:43:00 -08:00
commit 601fb1a303
5 changed files with 16 additions and 39 deletions

View File

@ -60,7 +60,7 @@ public:
static const nsLinkState defaultState = eLinkState_Unknown;
Link();
nsLinkState GetLinkState() const;
virtual nsLinkState GetLinkState() const;
virtual void SetLinkState(nsLinkState aState);
/**
@ -100,7 +100,7 @@ public:
* true if ResetLinkState should notify the owning document about style
* changes or false if it should not.
*/
void ResetLinkState(bool aNotify);
virtual void ResetLinkState(bool aNotify);
protected:
virtual ~Link();

View File

@ -431,18 +431,6 @@ nsHTMLAnchorElement::SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
nsIAtom* aPrefix, const nsAString& aValue,
PRBool aNotify)
{
if (aName == nsGkAtoms::accesskey && kNameSpaceID_None == aNameSpaceID) {
RegUnRegAccessKey(PR_FALSE);
}
nsresult rv = nsGenericHTMLElement::SetAttr(aNameSpaceID, aName, aPrefix,
aValue, aNotify);
// The ordering of the parent class's SetAttr call and Link::ResetLinkState
// is important here! The attribute is not set until SetAttr returns, and
// we will need the updated attribute value because notifying the document
// that content states have changed will call IntrinsicState, which will try
// to get updated information about the visitedness from Link.
if (aName == nsGkAtoms::href && kNameSpaceID_None == aNameSpaceID) {
nsAutoString val;
GetHref(val);
@ -451,6 +439,13 @@ nsHTMLAnchorElement::SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
}
}
if (aName == nsGkAtoms::accesskey && kNameSpaceID_None == aNameSpaceID) {
RegUnRegAccessKey(PR_FALSE);
}
nsresult rv = nsGenericHTMLElement::SetAttr(aNameSpaceID, aName, aPrefix,
aValue, aNotify);
if (aName == nsGkAtoms::accesskey && kNameSpaceID_None == aNameSpaceID &&
!aValue.IsEmpty()) {
RegUnRegAccessKey(PR_TRUE);

View File

@ -243,18 +243,13 @@ nsHTMLAreaElement::SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
RegUnRegAccessKey(PR_FALSE);
}
nsresult rv =
nsGenericHTMLElement::SetAttr(aNameSpaceID, aName, aPrefix, aValue, aNotify);
// The ordering of the parent class's SetAttr call and Link::ResetLinkState
// is important here! The attribute is not set until SetAttr returns, and
// we will need the updated attribute value because notifying the document
// that content states have changed will call IntrinsicState, which will try
// to get updated information about the visitedness from Link.
if (aName == nsGkAtoms::href && aNameSpaceID == kNameSpaceID_None) {
Link::ResetLinkState(!!aNotify);
}
nsresult rv =
nsGenericHTMLElement::SetAttr(aNameSpaceID, aName, aPrefix, aValue, aNotify);
if (aName == nsGkAtoms::accesskey && aNameSpaceID == kNameSpaceID_None &&
!aValue.IsEmpty()) {
RegUnRegAccessKey(PR_TRUE);

View File

@ -285,18 +285,12 @@ nsHTMLLinkElement::SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
nsIAtom* aPrefix, const nsAString& aValue,
PRBool aNotify)
{
nsresult rv = nsGenericHTMLElement::SetAttr(aNameSpaceID, aName, aPrefix,
aValue, aNotify);
// The ordering of the parent class's SetAttr call and Link::ResetLinkState
// is important here! The attribute is not set until SetAttr returns, and
// we will need the updated attribute value because notifying the document
// that content states have changed will call IntrinsicState, which will try
// to get updated information about the visitedness from Link.
if (aName == nsGkAtoms::href && kNameSpaceID_None == aNameSpaceID) {
Link::ResetLinkState(!!aNotify);
}
nsresult rv = nsGenericHTMLElement::SetAttr(aNameSpaceID, aName, aPrefix,
aValue, aNotify);
if (NS_SUCCEEDED(rv)) {
PRBool dropSheet = PR_FALSE;
if (aNameSpaceID == kNameSpaceID_None && aName == nsGkAtoms::rel &&

View File

@ -267,19 +267,12 @@ nsSVGAElement::SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
nsIAtom* aPrefix, const nsAString& aValue,
PRBool aNotify)
{
nsresult rv = nsSVGAElementBase::SetAttr(aNameSpaceID, aName, aPrefix,
aValue, aNotify);
// The ordering of the parent class's SetAttr call and Link::ResetLinkState
// is important here! The attribute is not set until SetAttr returns, and
// we will need the updated attribute value because notifying the document
// that content states have changed will call IntrinsicState, which will try
// to get updated information about the visitedness from Link.
if (aName == nsGkAtoms::href && aNameSpaceID == kNameSpaceID_XLink) {
Link::ResetLinkState(!!aNotify);
}
return rv;
return nsSVGAElementBase::SetAttr(aNameSpaceID, aName, aPrefix, aValue,
aNotify);
}
nsresult