diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2017-11-20 14:20:39 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-02-08 21:02:09 +0100 |
commit | 85083fce2da7a270e324fd951b7f3d03a50aef1b (patch) | |
tree | d278950db54b32faa9dded6e46dd475f904d3030 /dom/html | |
parent | ef720ec2507fafcb67b5ef1a1ef34a2aae5b5868 (diff) | |
download | UXP-85083fce2da7a270e324fd951b7f3d03a50aef1b.tar UXP-85083fce2da7a270e324fd951b7f3d03a50aef1b.tar.gz UXP-85083fce2da7a270e324fd951b7f3d03a50aef1b.tar.lz UXP-85083fce2da7a270e324fd951b7f3d03a50aef1b.tar.xz UXP-85083fce2da7a270e324fd951b7f3d03a50aef1b.zip |
Implement "cookie-averse document objects".
See: https://html.spec.whatwg.org/multipage/dom.html#cookie-averse-document-object
This resolves #196.
Diffstat (limited to 'dom/html')
-rw-r--r-- | dom/html/nsHTMLDocument.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/dom/html/nsHTMLDocument.cpp b/dom/html/nsHTMLDocument.cpp index 5e6302941..7d66aab04 100644 --- a/dom/html/nsHTMLDocument.cpp +++ b/dom/html/nsHTMLDocument.cpp @@ -1255,6 +1255,11 @@ nsHTMLDocument::GetCookie(nsAString& aCookie, ErrorResult& rv) rv.Throw(NS_ERROR_DOM_SECURITY_ERR); return; } + + // If the document is a cookie-averse document, return an empty string. + if (IsCookieAverse()) { + return; + } // not having a cookie service isn't an error nsCOMPtr<nsICookieService> service = do_GetService(NS_COOKIESERVICE_CONTRACTID); @@ -1310,6 +1315,11 @@ nsHTMLDocument::SetCookie(const nsAString& aCookie, ErrorResult& rv) return; } + // If the document is a cookie-averse document, do nothing. + if (IsCookieAverse()) { + return; + } + // not having a cookie service isn't an error nsCOMPtr<nsICookieService> service = do_GetService(NS_COOKIESERVICE_CONTRACTID); if (service && mDocumentURI) { |