REGRESSION(r121420): Performance regression of form state saving for pages with multiple forms
https://bugs.webkit.org/show_bug.cgi?id=91804

Reviewed by Hajime Morita.

The complexity of FormKeyGenerator::formKey() was O(N) where N is the
number form elements with an identical action URL, and formKey() is
called for every form. So, it's O(N^2). A page in www.reddit.com
contains hundreds of form elements with action="#". So FormController::
formElementsState() took a few seconds on a slow machine.

In order to avoid O(N^2) operation, storing a map from form signatures
to next index numbers, instead of storing existing formKey strings.

No new tests. Just a performance improvement.

Note: This is a re-landing of r123191. We rolled it out because of
suspicion of a performance regression. However it was innocent.

* html/FormController.cpp:
(FormKeyGenerator): Remove m_existingKeys. Add a map from a form
signature string to the next index number.
(WebCore::formSignature): Returns a signature string for a form, without
an index number. This is like "actionURL [name1 name2 ]"
(WebCore::FormKeyGenerator::formKey):
Creates a formKey string by concatenating a formSignature and #n. N is
obtained from m_formSignatureToNextIndexMap in O(1).
(WebCore::FormKeyGenerator::willDeleteForm):
Remove the code for m_existingKeys.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Tests] Re-factor fast/forms/number/number-spinbutton-change-and-input-events.html
https://bugs.webkit.org/show_bug.cgi?id=92206

Reviewed by Kent Tamura.

For ease of maintenance and improving test coverage with low cost, I
would like to make a test script of number-spinbutton-change-and-inputs.html
sharable with other input types which have spin button.

This patch moves JavaScript codes from test HTML file to shared JavaScript
file, common-spinbutton-change-and-input-events.html with parametrized
entry point for specifying input type.

* fast/forms/number/number-spinbutton-change-and-input-events-expected.txt: Changed "numnber" to "number", and "numberInput" to "testInput".
* fast/forms/number/number-spinbutton-change-and-input-events.html: Removed JavaScript code.
* fast/forms/resources/common-spinbutton-change-and-input-events.js: Removed HTML code. Made entry point. Changed to support testing without maximum value.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123692 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Support RTSP in browser
https://bugs.webkit.org/show_bug.cgi?id=92233

Patch by Jonathan Dong <jonathan.dong@torchmobile.com.cn> on 2012-07-25
Reviewed by Rob Buis.

Handle URL scheme "rtsp://" before creating the DocumentLoader
and send the request to webkit. As we don't have any application
which can deal with rtsp invocation for now, we need to create
a media document to wrap the rtsp url within a video tag which
makes it load as a normal video clip.

RIM PR: 169669
Internally reviewed by Charles Wei <charles.wei@torchmobile.com.cn>.

* WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
(WebCore::FrameLoaderClientBlackBerry::createDocumentLoader):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123693 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Integrate certmgr with CredentialBackingStore
https://bugs.webkit.org/show_bug.cgi?id=92183

Patch by Jonathan Dong <jonathan.dong@torchmobile.com.cn> on 2012-07-25
Reviewed by George Staikos.

Integrated BlackBerry::Platform::CertMgrWrapper with
CredentialBackingStore, when certmgr is ready we save
the password in certmgr and retrieve it from certmgr.

RIM PR: 171991
Internally reviewed by Joe Mason <jmason@rim.com>.

No new tests since there's no functional change.

* platform/network/blackberry/CredentialBackingStore.cpp:
(WebCore::hashCredentialInfo):
(WebCore):
(WebCore::CredentialBackingStore::CredentialBackingStore):
(WebCore::CredentialBackingStore::open):
(WebCore::CredentialBackingStore::addLogin):
(WebCore::CredentialBackingStore::updateLogin):
(WebCore::CredentialBackingStore::getLogin):
* platform/network/blackberry/CredentialBackingStore.h:
(CredentialBackingStore):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123694 268f45cc-cd09-0410-ab3c-d52691b4dbfc
TestRunner.a should contain a TestRunner object
https://bugs.webkit.org/show_bug.cgi?id=92313

Reviewed by Kent Tamura.

This patch adds a stub implementation of TestRunner, which is the new
home for our implementation of window.testRunner. A future patch will
migrate functions from LayoutTestController to TestRunner.

* DumpRenderTree/DumpRenderTree.gypi:
* DumpRenderTree/chromium/LayoutTestController.h:
* DumpRenderTree/chromium/TestRunner/TestRunner.cpp: Added.
* DumpRenderTree/chromium/TestRunner/TestRunner.h: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123695 268f45cc-cd09-0410-ab3c-d52691b4dbfc
flexitems can overflow the flexbox due to rounding
https://bugs.webkit.org/show_bug.cgi?id=92163

Reviewed by Levi Weintraub.

Source/WebCore:

Don't round flex item sizes and use LayoutPoint for the location of flex items.

Test: css3/flexbox/flex-rounding.html

* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::resolveFlexibleLengths):
(WebCore::RenderFlexibleBox::layoutAndPlaceChildren):
(WebCore::RenderFlexibleBox::layoutColumnReverse):

LayoutTests:

Tests for dividing space in non-integral amounts.

* css3/flexbox/flex-rounding-expected.txt: Added.
* css3/flexbox/flex-rounding.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123696 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Update fast/canvas/webgl expectations
https://bugs.webkit.org/show_bug.cgi?id=92309

Patch by Joshua Netterfield <jnetterfield@rim.com> on 2012-07-25
Reviewed by Rob Buis.

Add the css-webkit-canvas-* files, because we render them correctly.

There is nothing we can do about running out of memory on draw-elements-out-of-bounds,
so make that expected.

Our output for framebuffer-object-attachement-expected.txt is valid.

* platform/blackberry/fast/canvas/webgl/css-webkit-canvas-expected.png: Added.
* platform/blackberry/fast/canvas/webgl/css-webkit-canvas-expected.txt: Added.
* platform/blackberry/fast/canvas/webgl/css-webkit-canvas-repaint-expected.png: Added.
* platform/blackberry/fast/canvas/webgl/css-webkit-canvas-repaint-expected.txt: Added.
* platform/blackberry/fast/canvas/webgl/draw-elements-out-of-bounds-expected.txt: Added.
* platform/blackberry/fast/canvas/webgl/framebuffer-object-attachment-expected.txt: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123697 268f45cc-cd09-0410-ab3c-d52691b4dbfc
IndexedDB: IDBTransaction::abort() should throw DOMException
https://bugs.webkit.org/show_bug.cgi?id=92069

Patch by Xingnan Wang <xingnan.wang@intel.com> on 2012-07-25
Reviewed by Kentaro Hara.

Source/WebCore:

Keep aligned with the W3C spec.
http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#widl-IDBTransaction-abort-void

Test: storage/indexeddb/transaction-abort.html.

* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::abort):
(WebCore):
* Modules/indexeddb/IDBTransaction.h:
(IDBTransaction):
* Modules/indexeddb/IDBTransaction.idl:

LayoutTests:

Add the exception test for IDBTransaction::abort().

* storage/indexeddb/resources/transaction-abort.js:
(transactionAborted):
* storage/indexeddb/transaction-abort-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123698 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WebGL] fast/canvas/webgl/framebuffer-object-attachment.html fails on certain platforms
https://bugs.webkit.org/show_bug.cgi?id=92296

Patch by Joshua Netterfield <jnetterfield@rim.com> on 2012-07-25
Reviewed by Rob Buis.

No new tests, because it introduces no new functionality, only fixes the above mentioned test.

* html/canvas/WebGLFramebuffer.cpp:
(WebCore::WebGLFramebuffer::checkStatus):

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