Implementing DOMFormData class.
https://bugs.webkit.org/show_bug.cgi?id=35707

Reviewed by Dmitry Titov.

This patch only addresses the implementation of DOMFormData class and
moves the FormData construction logic from HTMLFormElement::createFormData
to FormData::create() so that it can be used by both HTMLFormElement
and XMLHttpRequest.

The DOMFormData IDL interface will be exposed in another patch and the
test will be added then.

* Android.mk:
* GNUmakefile.am:
* WebCore.gypi:
* WebCore.pro:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* html/DOMFormData.cpp: Added.
* html/DOMFormData.h: Added.
* html/FormDataList.h:
(WebCore::FormDataList::encoding):
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::createFormData):
(WebCore::HTMLFormElement::submit):
* html/HTMLFormElement.h:
* platform/network/FormData.cpp:
(WebCore::FormData::create):
(WebCore::FormData::createMultiPart):
(WebCore::FormData::appendDOMFormData):
* platform/network/FormData.h:
(WebCore::FormData::boundary):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::send):
* xml/XMLHttpRequest.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55821 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-03-10  Justin Schuh  <jschuh@chromium.org>

        Reviewed by Adam Barth.

        Make Chrome consistently handle leading format characters in URLs

        https://bugs.webkit.org/show_bug.cgi?id=35948

        * http/tests/security/xss-DENIED-window-open-javascript-url-leading-format-char-expected.txt: Added.
        * http/tests/security/xss-DENIED-window-open-javascript-url-leading-format-char.html: Added.
2010-03-10  Justin Schuh  <jschuh@chromium.org>

        Reviewed by Adam Barth.

        Make Chrome consistently handle leading format characters in URLs

        https://bugs.webkit.org/show_bug.cgi?id=35948

        Test: http/tests/security/xss-DENIED-window-open-javascript-url-leading-format-char.html

        * platform/KURLGoogle.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55822 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore: Adding support for the optional creation callback that could be
passed to openDatabase().

Reviewed by Adam Barth.

Tests: storage/open-database-creation-callback.html
       storage/open-database-creation-callback-isolated-world.html

https://bugs.webkit.org/show_bug.cgi?id=34726

* Android.jscbindings.mk
* Android.v8bindings.mk
* GNUmakefile.am:
* WebCore.gypi:
* WebCore.pro:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::openDatabase):
* bindings/js/JSDatabaseCallback.cpp: Added.
(WebCore::JSDatabaseCallback::JSDatabaseCallback):
(WebCore::JSDatabaseCallback::~JSDatabaseCallback):
(WebCore::JSDatabaseCallback::handleEvent):
* bindings/js/JSDatabaseCallback.h: Added.
(WebCore::JSDatabaseCallback::create):
* bindings/v8/custom/V8DOMWindowCustom.cpp:
(WebCore::V8DOMWindow::openDatabaseCallback):
* bindings/v8/custom/V8DatabaseCallback.cpp: Added.
(WebCore::V8DatabaseCallback::V8DatabaseCallback):
(WebCore::V8DatabaseCallback::~V8DatabaseCallback):
(WebCore::V8DatabaseCallback::handleEvent):
* bindings/v8/custom/V8DatabaseCallback.h: Added.
(WebCore::V8DatabaseCallback::create):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::openDatabase):
* page/DOMWindow.h:
* page/DOMWindow.idl:
* storage/Database.cpp:
(WebCore::DatabaseCreationCallbackTask::create):
(WebCore::DatabaseCreationCallbackTask::performTask):
(WebCore::DatabaseCreationCallbackTask::DatabaseCreationCallbackTask):
(WebCore::Database::openDatabase):
(WebCore::Database::Database):
(WebCore::Database::performOpenAndVerify):
(WebCore::Database::performCreationCallback):
* storage/Database.h:
(WebCore::Database::isNew):
* storage/DatabaseCallback.h: Added.
(WebCore::DatabaseCallback::~DatabaseCallback):
* workers/WorkerContext.cpp:
(WebCore::WorkerContext::openDatabase):
* workers/WorkerContext.h:

LayoutTests: Adding a test to test the creation callback passed to
openDatabase() and another one to make sure it is executed in the
correct world.

Reviewed by Adam Barth.

Also, fixing fast/frames/sandboxed-iframe-storage.html: calling
openDatabase() without at least 4 parameters should always fail,
because the database name, version, description and estimated size
are not optional according to the spec.

https://bugs.webkit.org/show_bug.cgi?id=34726

* fast/frames/resources/sandboxed-iframe-storage-allowed.html:
* fast/frames/resources/sandboxed-iframe-storage-disallowed.html:
* fast/frames/sandboxed-iframe-storage-expected.txt:
* platform/qt/Skipped:
* storage/open-database-creation-callback-expected.txt: Added.
* storage/open-database-creation-callback.html: Added.
* storage/open-database-creation-callback-isolated-world-expected.txt: Added.
* storage/open-database-creation-callback-isolated-world.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55823 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-03-10  Simon Fraser  <simon.fraser@apple.com>

        Reviewed by Darin Adler.

        https://bugs.webkit.org/show_bug.cgi?id=35975
        <rdar://problem/7739922> Flash 10.1b crashes when generating snapshots

        Do a version check before sending a drawRect event to a Flash plugin,
        since 10.1.d51 has a bug that crashes when called this way.

        * Plugins/Hosted/WebHostedNetscapePluginView.mm:
        (-[WebHostedNetscapePluginView drawRect:]):
        * Plugins/WebBaseNetscapePluginView.h:
        * Plugins/WebBaseNetscapePluginView.mm:
        (-[WebBaseNetscapePluginView supportsSnapshotting]):
        * Plugins/WebNetscapePluginView.mm:
        (-[WebNetscapePluginView drawRect:]):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=35991
Would be faster to not use a thread specific to implement StringImpl::empty()

Reviewed by Darin Adler, Geoffrey Garen, Maciej Stachowiak.

JavaScriptCore: 

Change JSC::UStringImpl's implementation of empty() match to match StringImpl's new implementation
(use a static defined within the empty() method), and change the interface to match too (return
a pointer not a reference). 

~0% performance impact (possible minor progression from moving empty() from .h to .cpp).

* JavaScriptCore.exp:
* runtime/Identifier.cpp:
(JSC::Identifier::add):
(JSC::Identifier::addSlowCase):
* runtime/PropertyNameArray.cpp:
(JSC::PropertyNameArray::add):
* runtime/UString.cpp:
(JSC::initializeUString):
(JSC::UString::UString):
* runtime/UStringImpl.cpp:
(JSC::UStringImpl::empty):
(JSC::UStringImpl::create):
* runtime/UStringImpl.h:
(JSC::UStringImpl::adopt):
(JSC::UStringImpl::createUninitialized):
(JSC::UStringImpl::tryCreateUninitialized):

WebCore: 

Copy JavaScriptCore in making 'static' strings threadsafe, make the empty string a static,
shared by all threads.

~2% progression on Dromaeo DOM core & JS lib tests.

* platform/ThreadGlobalData.cpp:
(WebCore::ThreadGlobalData::ThreadGlobalData):
(WebCore::ThreadGlobalData::~ThreadGlobalData):
* platform/ThreadGlobalData.h:
(WebCore::ThreadGlobalData::eventNames):
* platform/text/StringImpl.cpp:
(WebCore::StringImpl::StringImpl):
(WebCore::StringImpl::empty):
* platform/text/StringImpl.h:
(WebCore::StringImpl::deref):
(WebCore::StringImpl::hasOneRef):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55825 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-03-10  Adam Barth  <abarth@webkit.org>

        Unreviewed.

        http/tests/security/xss-DENIED-window-open-javascript-url.html timed out on Windows Debug Bot
        https://bugs.webkit.org/show_bug.cgi?id=33349

        Remove another test that has the same problem.  We need to find a way
        to relaibly test what happens when you mix JavaScript URLs and
        window.open.

        * http/tests/security/xss-DENIED-window-open-javascript-url-leading-format-char-expected.txt: Removed.
        * http/tests/security/xss-DENIED-window-open-javascript-url-leading-format-char.html: Removed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55826 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-03-10  Chang Shu  <chang.shu@nokia.com>

        Reviewed by Darin Adler.

        While calculating alpha channel, convert the floating point value to
        an integer in [0, 256) with equal distribution.
        https://bugs.webkit.org/show_bug.cgi?id=22150

        * css/CSSParser.cpp:
        (WebCore::CSSParser::parseColorParameters):

2010-03-10  Chang Shu  <chang.shu@nokia.com>

        Reviewed by Darin Adler.

        While calculating alpha channel, convert the floating point value to
        an integer in [0, 256) with equal distribution.
        Updated test results based on this new behavior.
        https://bugs.webkit.org/show_bug.cgi?id=22150

        * fast/canvas/canvas-alphaImageData-behavior-expected.txt:
        * fast/canvas/canvas-alphaImageData-behavior.js:
        * platform/qt/Skipped:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55827 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Windows build fix - add an missing symbol to be exported

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55828 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-03-10  Daniel Bates  <dbates@rim.com>

        Reviewed by Simon Hausmann.

        https://bugs.webkit.org/show_bug.cgi?id=35840

        Updates the subroutine builtDylibPathForName() so that it adds the "d" suffix to
        the QtWebKit library name on Windows. This change makes run-launcher work again
        under Windows. Moreover, this change corresponds to the change made in change-
        set 53924 <http://trac.webkit.org/changeset/53924>.

        * Scripts/webkitdirs.pm:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55829 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed.

VoiceOver can navigate to hidden content in widget (WAI-ARIA)
https://bugs.webkit.org/show_bug.cgi?id=35986

Skip this test since it uses tables and lists, which are not
supported on Tiger/Leopard.

* platform/mac-leopard/Skipped:
* platform/mac-tiger/Skipped:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55830 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed.

VoiceOver can navigate to hidden content in widget (WAI-ARIA)
https://bugs.webkit.org/show_bug.cgi?id=35986

Wrong files were placed in skipped lists.

* platform/gtk/Skipped:
* platform/win/Skipped:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55831 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix for r55825, threadsafeCopy no longer needs to special-case for
empty strings (in fact, doing so results in leaks).

Reviewed by Mark Rowe.

* platform/text/StringImpl.cpp:
(WebCore::StringImpl::threadsafeCopy):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55832 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rubber stamped by Oliver Hunt.
        
Rename JSC::UStringImpl::data() to characters(), to match WebCore::StringImpl.

JavaScriptCore: 

* API/JSClassRef.cpp:
(OpaqueJSClassContextData::OpaqueJSClassContextData):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::keyForCharacterSwitch):
* bytecompiler/NodesCodegen.cpp:
(JSC::processClauseList):
* interpreter/Interpreter.cpp:
(JSC::Interpreter::privateExecute):
* jit/JITStubs.cpp:
(JSC::DEFINE_STUB_FUNCTION):
* runtime/ArrayPrototype.cpp:
(JSC::arrayProtoFuncToString):
* runtime/Identifier.cpp:
(JSC::Identifier::equal):
(JSC::Identifier::addSlowCase):
* runtime/JSString.cpp:
(JSC::JSString::resolveRope):
* runtime/UString.cpp:
(JSC::UString::toStrictUInt32):
(JSC::equal):
* runtime/UString.h:
(JSC::UString::data):
* runtime/UStringImpl.h:
(JSC::UStringImpl::characters):
(JSC::UStringImpl::hash):
(JSC::UStringImpl::setHash):

WebCore: 

* bridge/jni/jsc/JavaStringJSC.h:
(JSC::Bindings::JavaStringImpl::uchars):
* platform/text/AtomicString.cpp:
(WebCore::AtomicString::add):
(WebCore::AtomicString::find):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55833 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Buildfix for Thumb-2 after r55684. Add branch8 and branchTest8 functions.
https://bugs.webkit.org/show_bug.cgi?id=35892

Reviewed by Gavin Barraclough.

* assembler/ARMv7Assembler.h:
(JSC::ARMv7Assembler::):
(JSC::ARMv7Assembler::ldrb):
* assembler/MacroAssemblerARMv7.h:
(JSC::MacroAssemblerARMv7::load8):
(JSC::MacroAssemblerARMv7::branch8):
(JSC::MacroAssemblerARMv7::branchTest8):
(JSC::MacroAssemblerARMv7::setTest8):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55834 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-03-11  Zoltan Horvath  <zoltan@webkit.org>

        Reviewed by Simon Hausmann.

        Allow custom memory allocation control for TimingFunction struct
        https://bugs.webkit.org/show_bug.cgi?id=35855

        Inherits the following struct from FastAllocBase because it is 
        instantiated by 'new':

        class name    - instantiated at: WebCore/'location'
        TimingFuction - platform/graphics/GraphicsLayer.h:89

        * platform/animation/TimingFunction.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55835 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-03-11  Zoltan Horvath  <zoltan@webkit.org>

        Reviewed by Simon Hausmann.

        Allow custom memory allocation control for RenderLayerBacking class
        https://bugs.webkit.org/show_bug.cgi?id=35857

        Inherits the following class from Noncopyable because it is
        instantiated by 'new' and no need to be copyable:                                     

        class name    - instantiated at: WebCore/'location'
        RenderLayerBacking - rendering/RenderLayer.cpp:3047

        * rendering/RenderLayerBacking.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55836 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Unreviewed buildfix after r55833.

Rename all instances of data() to characters()

* bridge/qt/qt_class.cpp:
(JSC::Bindings::QtClass::fieldNamed):
* bridge/qt/qt_runtime.cpp:
(JSC::Bindings::convertValueToQVariant):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55837 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed buildfix after r55823. (To fix Qt --minimal build.)
I have déjà vu, I'm sure that I did it before. (r55598)

* bindings/js/JSDOMWindowCustom.cpp: Missing #if ENABLE(DATABASE) guard added. 



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55838 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] storage/open-database-creation-callback-isolated-world.html was introduced in r55823,
but layoutTestController.evaluateScriptInIsolatedWorld() is unimplemented now.

* platform/qt/Skipped: storage/open-database-creation-callback-isolated-world.html skipped.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55839 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-03-11  Philippe Normand  <pnormand@igalia.com>

        Unreviewed.

        Unskip the fixed test that was (accidently?) re-skipped in r54205.

        * platform/gtk/Skipped:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55840 268f45cc-cd09-0410-ab3c-d52691b4dbfc