Added document.cookie. HTMLCollection.namedItem looks for both NAME and ID attributes

git-svn-id: svn://10.0.0.236/trunk@6458 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
vidur%netscape.com
1998-07-25 00:31:52 +00:00
parent 1cc0a2a7f3
commit 640de09889
4 changed files with 58 additions and 12 deletions

View File

@@ -39,6 +39,7 @@
#include "CNavDTD.h"
#include "nsIScriptGlobalObject.h"
#include "nsContentList.h"
#include "nsINetService.h"
//#define rickgdebug 1
#ifdef rickgdebug
@@ -502,15 +503,35 @@ nsHTMLDocument::GetAnchors(nsIDOMHTMLCollection** aAnchors)
NS_IMETHODIMP
nsHTMLDocument::GetCookie(nsString& aCookie)
{
//XXX TBI
return NS_ERROR_NOT_IMPLEMENTED;
nsINetService *service;
nsresult res = NS_OK;
res = NS_NewINetService(&service, nsnull);
if ((NS_OK == res) && (nsnull != service)) {
res = service->GetCookieString(mDocumentURL, aCookie);
NS_RELEASE(service);
}
return res;
}
NS_IMETHODIMP
nsHTMLDocument::SetCookie(const nsString& aCookie)
{
//XXX TBI
return NS_ERROR_NOT_IMPLEMENTED;
nsINetService *service;
nsresult res = NS_OK;
res = NS_NewINetService(&service, nsnull);
if ((NS_OK == res) && (nsnull != service)) {
res = service->SetCookieString(mDocumentURL, aCookie);
NS_RELEASE(service);
}
return res;
}
NS_IMETHODIMP