From 8d82ffe93c7621cc514ed788bc59d31e697c62f5 Mon Sep 17 00:00:00 2001 From: Shawn Wilsher Date: Tue, 15 Dec 2009 16:04:09 -0800 Subject: [PATCH] Bug 461199 (Part 14) - Implement nsIContent::IntrinsicState on mozilla::dom::Link subclasses All mozilla::dom::Link subclasses need to implement IntrinsicState and make sure to call LinkState. r=sicking sr=bz --- content/html/content/src/nsHTMLAnchorElement.cpp | 8 ++++++++ content/html/content/src/nsHTMLAreaElement.cpp | 8 ++++++++ content/html/content/src/nsHTMLLinkElement.cpp | 8 ++++++++ content/svg/content/src/nsSVGAElement.cpp | 7 ++++++- content/svg/content/src/nsSVGAElement.h | 1 + 5 files changed, 31 insertions(+), 1 deletion(-) diff --git a/content/html/content/src/nsHTMLAnchorElement.cpp b/content/html/content/src/nsHTMLAnchorElement.cpp index 48f1d6d504b..2240a242fa6 100644 --- a/content/html/content/src/nsHTMLAnchorElement.cpp +++ b/content/html/content/src/nsHTMLAnchorElement.cpp @@ -132,6 +132,8 @@ public: virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const; virtual void DropCachedHref(); + + virtual PRInt32 IntrinsicState() const; }; @@ -491,3 +493,9 @@ nsHTMLAnchorElement::DropCachedHref() { Link::ResetLinkState(); } + +PRInt32 +nsHTMLAnchorElement::IntrinsicState() const +{ + return Link::LinkState() | nsGenericHTMLElement::IntrinsicState(); +} diff --git a/content/html/content/src/nsHTMLAreaElement.cpp b/content/html/content/src/nsHTMLAreaElement.cpp index 15fc41dbe75..08523e2268d 100644 --- a/content/html/content/src/nsHTMLAreaElement.cpp +++ b/content/html/content/src/nsHTMLAreaElement.cpp @@ -114,6 +114,8 @@ public: virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const; + virtual PRInt32 IntrinsicState() const; + protected: }; @@ -329,3 +331,9 @@ nsHTMLAreaElement::GetHrefURI() const { return GetHrefURIForAnchors(); } + +PRInt32 +nsHTMLAreaElement::IntrinsicState() const +{ + return Link::LinkState() | nsGenericHTMLElement::IntrinsicState(); +} diff --git a/content/html/content/src/nsHTMLLinkElement.cpp b/content/html/content/src/nsHTMLLinkElement.cpp index 9dbbe6139af..7c166c5256e 100644 --- a/content/html/content/src/nsHTMLLinkElement.cpp +++ b/content/html/content/src/nsHTMLLinkElement.cpp @@ -119,6 +119,8 @@ public: virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const; + virtual PRInt32 IntrinsicState() const; + protected: virtual already_AddRefed GetStyleSheetURL(PRBool* aIsInline); virtual void GetStyleSheetInfo(nsAString& aTitle, @@ -434,3 +436,9 @@ nsHTMLLinkElement::GetStyleSheetInfo(nsAString& aTitle, return; } + +PRInt32 +nsHTMLLinkElement::IntrinsicState() const +{ + return Link::LinkState() | nsGenericHTMLElement::IntrinsicState(); +} diff --git a/content/svg/content/src/nsSVGAElement.cpp b/content/svg/content/src/nsSVGAElement.cpp index 874bcd8c049..0b4b65e2df9 100644 --- a/content/svg/content/src/nsSVGAElement.cpp +++ b/content/svg/content/src/nsSVGAElement.cpp @@ -257,6 +257,12 @@ nsSVGAElement::GetLinkTarget(nsAString& aTarget) } } +PRInt32 +nsSVGAElement::IntrinsicState() const +{ + return Link::LinkState() | nsSVGAElementBase::IntrinsicState(); +} + //---------------------------------------------------------------------- // nsSVGElement methods @@ -266,4 +272,3 @@ nsSVGAElement::GetStringInfo() return StringAttributesInfo(mStringAttributes, sStringInfo, NS_ARRAY_LENGTH(sStringInfo)); } - diff --git a/content/svg/content/src/nsSVGAElement.h b/content/svg/content/src/nsSVGAElement.h index 2dde0741cbd..6cd69cd4139 100644 --- a/content/svg/content/src/nsSVGAElement.h +++ b/content/svg/content/src/nsSVGAElement.h @@ -89,6 +89,7 @@ public: virtual nsLinkState GetLinkState() const; virtual void SetLinkState(nsLinkState aState); virtual already_AddRefed GetHrefURI() const; + virtual PRInt32 IntrinsicState() const; protected: