diff --git a/content/base/public/nsINode.h b/content/base/public/nsINode.h index d140d939599f..3ff5dad7a42d 100644 --- a/content/base/public/nsINode.h +++ b/content/base/public/nsINode.h @@ -1005,6 +1005,10 @@ public: return static_cast(GetProperty(DOM_USER_DATA, key)); } + nsresult GetFeature(const nsAString& aFeature, + const nsAString& aVersion, + nsISupports** aReturn); + void LookupPrefix(const nsAString& aNamespaceURI, nsAString& aPrefix); PRBool IsDefaultNamespace(const nsAString& aNamespaceURI) { diff --git a/content/base/src/nsDOMAttribute.cpp b/content/base/src/nsDOMAttribute.cpp index f5ecbc5dd7ab..d554431f9249 100644 --- a/content/base/src/nsDOMAttribute.cpp +++ b/content/base/src/nsDOMAttribute.cpp @@ -605,8 +605,7 @@ nsDOMAttribute::GetFeature(const nsAString& aFeature, const nsAString& aVersion, nsISupports** aReturn) { - return nsGenericElement::InternalGetFeature(static_cast(this), - aFeature, aVersion, aReturn); + return nsINode::GetFeature(aFeature, aVersion, aReturn); } NS_IMETHODIMP diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index 44e65da0b90a..f4e770d7aedb 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -5735,8 +5735,7 @@ nsDocument::GetFeature(const nsAString& aFeature, const nsAString& aVersion, nsISupports** aReturn) { - return nsGenericElement::InternalGetFeature(static_cast(this), - aFeature, aVersion, aReturn); + return nsINode::GetFeature(aFeature, aVersion, aReturn); } NS_IMETHODIMP diff --git a/content/base/src/nsGenericElement.cpp b/content/base/src/nsGenericElement.cpp index 55ecc6643d6d..eb84e4d9e1cc 100644 --- a/content/base/src/nsGenericElement.cpp +++ b/content/base/src/nsGenericElement.cpp @@ -1201,8 +1201,7 @@ nsNode3Tearoff::GetFeature(const nsAString& aFeature, const nsAString& aVersion, nsISupports** aReturn) { - return nsGenericElement::InternalGetFeature(static_cast(this), - aFeature, aVersion, aReturn); + return mContent->GetFeature(aFeature, aVersion, aReturn); } NS_IMETHODIMP @@ -2145,9 +2144,8 @@ nsGenericElement::SetPrefix(const nsAString& aPrefix) return NS_OK; } -already_AddRefed -nsGenericElement::GetDOMFeatureFactory(const nsAString& aFeature, - const nsAString& aVersion) +static already_AddRefed +GetDOMFeatureFactory(const nsAString& aFeature, const nsAString& aVersion) { nsIDOMNSFeatureFactory *factory = nsnull; nsCOMPtr categoryManager = @@ -2243,17 +2241,16 @@ nsGenericElement::InternalIsSupported(nsISupports* aObject, } nsresult -nsGenericElement::InternalGetFeature(nsISupports* aObject, - const nsAString& aFeature, - const nsAString& aVersion, - nsISupports** aReturn) +nsINode::GetFeature(const nsAString& aFeature, + const nsAString& aVersion, + nsISupports** aReturn) { *aReturn = nsnull; nsCOMPtr factory = GetDOMFeatureFactory(aFeature, aVersion); if (factory) { - factory->GetFeature(aObject, aFeature, aVersion, aReturn); + factory->GetFeature(this, aFeature, aVersion, aReturn); } return NS_OK; diff --git a/content/base/src/nsGenericElement.h b/content/base/src/nsGenericElement.h index 52a9aa958016..c5e4431d0d48 100644 --- a/content/base/src/nsGenericElement.h +++ b/content/base/src/nsGenericElement.h @@ -588,14 +588,6 @@ public: const nsAString& aVersion, PRBool* aReturn); - static nsresult InternalGetFeature(nsISupports* aObject, - const nsAString& aFeature, - const nsAString& aVersion, - nsISupports** aReturn); - - static already_AddRefed - GetDOMFeatureFactory(const nsAString& aFeature, const nsAString& aVersion); - static PRBool ShouldBlur(nsIContent *aContent); /**