JavaScript generated documents don't inherit the cookie URL
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Sep 2011 21:01:37 +0000 (21:01 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Sep 2011 21:01:37 +0000 (21:01 +0000)
commit9416cdd66c13915532ea6db8fab1ddad6c9cf164
treee1bac5f5e01e015c06f2e202c9054c5451b6cff9
parentfb5189a82a8c1769e3099228a1bf3d6bd8b18c8e
JavaScript generated documents don't inherit the cookie URL
https://bugs.webkit.org/show_bug.cgi?id=69003

Patch by Sergey Glazunov <serg.glazunov@gmail.com> on 2011-09-28
Reviewed by Adam Barth.

Source/WebCore:

Test: http/tests/security/cookies/cookie-theft-with-javascript-doc.html

* dom/Document.h:
(WebCore::Document::setCookieURL):
* loader/DocumentWriter.cpp:
(WebCore::DocumentWriter::replaceDocument):
(WebCore::DocumentWriter::begin):
* loader/DocumentWriter.h:

LayoutTests:

* http/tests/security/cookies/cookie-theft-with-javascript-doc-expected.txt: Added.
* http/tests/security/cookies/cookie-theft-with-javascript-doc.html: Added.
* http/tests/security/cookies/resources/innocent-victim-with-cookies.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96260 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/tests/security/cookies/cookie-theft-with-javascript-doc-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/security/cookies/cookie-theft-with-javascript-doc.html [new file with mode: 0644]
LayoutTests/http/tests/security/cookies/resources/innocent-victim-with-cookies.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.h
Source/WebCore/loader/DocumentWriter.cpp
Source/WebCore/loader/DocumentWriter.h