Part 6 of fix for bug 560273 (Stop using DOM tearoffs from quickstubs) - add nsINode::GetFeature. r=jst.

--HG--
extra : rebase_source : 7b2ef182466615e7b244f7c5e55f327855b3cc6a
This commit is contained in:
Peter Van der Beken 2010-04-19 17:40:16 +02:00
Родитель 5e36a08f62
Коммит 0ede6ae84d
5 изменённых файлов: 13 добавлений и 22 удалений

Просмотреть файл

@ -1005,6 +1005,10 @@ public:
return static_cast<nsIVariant*>(GetProperty(DOM_USER_DATA, key)); return static_cast<nsIVariant*>(GetProperty(DOM_USER_DATA, key));
} }
nsresult GetFeature(const nsAString& aFeature,
const nsAString& aVersion,
nsISupports** aReturn);
void LookupPrefix(const nsAString& aNamespaceURI, nsAString& aPrefix); void LookupPrefix(const nsAString& aNamespaceURI, nsAString& aPrefix);
PRBool IsDefaultNamespace(const nsAString& aNamespaceURI) PRBool IsDefaultNamespace(const nsAString& aNamespaceURI)
{ {

Просмотреть файл

@ -605,8 +605,7 @@ nsDOMAttribute::GetFeature(const nsAString& aFeature,
const nsAString& aVersion, const nsAString& aVersion,
nsISupports** aReturn) nsISupports** aReturn)
{ {
return nsGenericElement::InternalGetFeature(static_cast<nsIDOMAttr*>(this), return nsINode::GetFeature(aFeature, aVersion, aReturn);
aFeature, aVersion, aReturn);
} }
NS_IMETHODIMP NS_IMETHODIMP

Просмотреть файл

@ -5735,8 +5735,7 @@ nsDocument::GetFeature(const nsAString& aFeature,
const nsAString& aVersion, const nsAString& aVersion,
nsISupports** aReturn) nsISupports** aReturn)
{ {
return nsGenericElement::InternalGetFeature(static_cast<nsIDOMDocument*>(this), return nsINode::GetFeature(aFeature, aVersion, aReturn);
aFeature, aVersion, aReturn);
} }
NS_IMETHODIMP NS_IMETHODIMP

Просмотреть файл

@ -1201,8 +1201,7 @@ nsNode3Tearoff::GetFeature(const nsAString& aFeature,
const nsAString& aVersion, const nsAString& aVersion,
nsISupports** aReturn) nsISupports** aReturn)
{ {
return nsGenericElement::InternalGetFeature(static_cast<nsIDOM3Node*>(this), return mContent->GetFeature(aFeature, aVersion, aReturn);
aFeature, aVersion, aReturn);
} }
NS_IMETHODIMP NS_IMETHODIMP
@ -2145,9 +2144,8 @@ nsGenericElement::SetPrefix(const nsAString& aPrefix)
return NS_OK; return NS_OK;
} }
already_AddRefed<nsIDOMNSFeatureFactory> static already_AddRefed<nsIDOMNSFeatureFactory>
nsGenericElement::GetDOMFeatureFactory(const nsAString& aFeature, GetDOMFeatureFactory(const nsAString& aFeature, const nsAString& aVersion)
const nsAString& aVersion)
{ {
nsIDOMNSFeatureFactory *factory = nsnull; nsIDOMNSFeatureFactory *factory = nsnull;
nsCOMPtr<nsICategoryManager> categoryManager = nsCOMPtr<nsICategoryManager> categoryManager =
@ -2243,17 +2241,16 @@ nsGenericElement::InternalIsSupported(nsISupports* aObject,
} }
nsresult nsresult
nsGenericElement::InternalGetFeature(nsISupports* aObject, nsINode::GetFeature(const nsAString& aFeature,
const nsAString& aFeature, const nsAString& aVersion,
const nsAString& aVersion, nsISupports** aReturn)
nsISupports** aReturn)
{ {
*aReturn = nsnull; *aReturn = nsnull;
nsCOMPtr<nsIDOMNSFeatureFactory> factory = nsCOMPtr<nsIDOMNSFeatureFactory> factory =
GetDOMFeatureFactory(aFeature, aVersion); GetDOMFeatureFactory(aFeature, aVersion);
if (factory) { if (factory) {
factory->GetFeature(aObject, aFeature, aVersion, aReturn); factory->GetFeature(this, aFeature, aVersion, aReturn);
} }
return NS_OK; return NS_OK;

Просмотреть файл

@ -588,14 +588,6 @@ public:
const nsAString& aVersion, const nsAString& aVersion,
PRBool* aReturn); PRBool* aReturn);
static nsresult InternalGetFeature(nsISupports* aObject,
const nsAString& aFeature,
const nsAString& aVersion,
nsISupports** aReturn);
static already_AddRefed<nsIDOMNSFeatureFactory>
GetDOMFeatureFactory(const nsAString& aFeature, const nsAString& aVersion);
static PRBool ShouldBlur(nsIContent *aContent); static PRBool ShouldBlur(nsIContent *aContent);
/** /**