NS_IMETHODIMP HTMLOptionsCollection::NamedItem(const nsAString& aName, nsIDOMNode** aReturn) { NS_IF_ADDREF(*aReturn = GetNamedItem(aName)); return NS_OK; }
NS_IMETHODIMP nsDOMStorageList::NamedItem(const nsAString& aDomain, nsIDOMStorageObsolete** aStorage) { nsresult rv; NS_IF_ADDREF(*aStorage = GetNamedItem(aDomain, &rv)); return rv; }
NS_IMETHODIMP nsPluginElement::NamedItem(const nsAString& aName, nsIDOMMimeType** aReturn) { nsresult rv; NS_IF_ADDREF(*aReturn = GetNamedItem(aName, &rv)); return rv; }
NS_IMETHODIMP nsDOMStorage::GetItem(const nsAString& aKey, nsIDOMStorageItem **aItem) { nsresult rv; NS_IF_ADDREF(*aItem = GetNamedItem(aKey, &rv)); return rv; }
NS_IMETHODIMP nsDOMAttributeMap::GetNamedItem(const nsAString& aAttrName, nsIDOMNode** aAttribute) { NS_ENSURE_ARG_POINTER(aAttribute); nsresult rv; NS_IF_ADDREF(*aAttribute = GetNamedItem(aAttrName, &rv)); return rv; }
NS_IMETHODIMP nsPluginArray::NamedItem(const nsAString& aName, nsIDOMPlugin** aReturn) { NS_PRECONDITION(nsnull != aReturn, "null arg"); nsresult rv; NS_IF_ADDREF(*aReturn = GetNamedItem(aName, &rv)); return rv; }
JSObject* HTMLOptionsCollection::NamedItem(JSContext* cx, const nsAString& name, ErrorResult& error) { nsINode* item = GetNamedItem(name); if (!item) { return nullptr; } JS::Rooted<JSObject*> wrapper(cx, nsWrapperCache::GetWrapper()); JSAutoCompartment ac(cx, wrapper); JS::Rooted<JS::Value> v(cx); if (!mozilla::dom::WrapObject(cx, wrapper, item, item, nullptr, &v)) { error.Throw(NS_ERROR_FAILURE); return nullptr; } return &v.toObject(); }