WebCore:
authordimich@chromium.org <dimich@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Mar 2009 21:21:06 +0000 (21:21 +0000)
committerdimich@chromium.org <dimich@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Mar 2009 21:21:06 +0000 (21:21 +0000)
commit08d3657faf294a656461a68a13f3cd9ddf6e6762
tree6fbc01b0fd22866a191c1dfdcbe6ba8fda8fdf92
parent03cedae2162068d4705050de5c75a5242917b4ba
WebCore:

2009-03-04  Dmitry Titov  <dimich@chromium.org>

        Reviewed by Alexey Proskuryakov.

        https://bugs.webkit.org/show_bug.cgi?id=24150
        Add virtual ScriptExecutionContext::encoding()

        Test: http/tests/workers/text-encoding.html

        * dom/Document.cpp:
        (WebCore::Document::encoding):
        * dom/Document.h:
        (WebCore::Document::inputEncoding):
        (WebCore::Document::charset):
        (WebCore::Document::characterSet):
        Add new virtual method and route DOM synonym functions on Document through it.

        * dom/ScriptExecutionContext.h:
        * workers/Worker.cpp:
        (WebCore::Worker::Worker):
        (WebCore::Worker::notifyFinished):
        * workers/WorkerContext.cpp:
        (WebCore::WorkerContext::WorkerContext):
        (WebCore::WorkerContext::encoding):
        (WebCore::WorkerContext::completeURL): Added comment on why this is different from Document::completeURL
        * workers/WorkerContext.h:
        (WebCore::WorkerContext::create):
        * workers/WorkerContextProxy.h:
        * workers/WorkerMessagingProxy.cpp:
        (WebCore::WorkerMessagingProxy::startWorkerContext):
        * workers/WorkerMessagingProxy.h:
        * workers/WorkerThread.cpp:
        (WebCore::WorkerThreadStartupData::create):
        (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
        (WebCore::WorkerThread::create):
        (WebCore::WorkerThread::WorkerThread):
        (WebCore::WorkerThread::workerThread):
        * workers/WorkerThread.h:
        All of the above route the 'encoding' parameter of parent context to the new
        instance of WorkerContext - from Worker::notifyFinished() via WorkerMessagingProxy
        through WorkerThread through WorkerThreadStartupData and into constructor of WorkerContext.

LayoutTests:

2009-03-04  Dmitry Titov  <dimich@chromium.org>

        Reviewed by Alexey Proskuryakov.

        https://bugs.webkit.org/show_bug.cgi?id=24150
        Add virtual ScriptExecutionContext::encoding()

        Test to verify how the text encoding in workers is used.
        Script decoding and url completion is checked, with and
        w/o http 'Content-Type: ...;charset=...' header.

        * http/tests/workers/resources/worker-encoded.php: Added.
        * http/tests/workers/resources/xhr-query-utf8.php: Added.
        * http/tests/workers/resources/xhr-response.php: Added.
        * http/tests/workers/text-encoding-expected.txt: Added.
        * http/tests/workers/text-encoding.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@41499 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/workers/resources/worker-encoded.php [new file with mode: 0644]
LayoutTests/http/tests/workers/resources/xhr-query-utf8.php [new file with mode: 0644]
LayoutTests/http/tests/workers/resources/xhr-response.php [new file with mode: 0644]
LayoutTests/http/tests/workers/text-encoding-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/workers/text-encoding.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/dom/Document.cpp
WebCore/dom/Document.h
WebCore/dom/ScriptExecutionContext.h
WebCore/workers/Worker.cpp
WebCore/workers/WorkerContext.cpp
WebCore/workers/WorkerContext.h
WebCore/workers/WorkerContextProxy.h
WebCore/workers/WorkerMessagingProxy.cpp
WebCore/workers/WorkerMessagingProxy.h
WebCore/workers/WorkerThread.cpp
WebCore/workers/WorkerThread.h