Fix build on x32

Recognize x32 and disable JIT and native LLINT in this configuration.

Change-Id: I1576e38ffcff92495c4c108f66f2df17de9a5e9c
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Treat qrc protocol the same as file protocol in loading

KUrl's with qrc protocol was not recognized as local files which
triggered mimetype sniffing that doesn't support SVG and break it.

This patch makes qrc urls be treated as local files and modifies the
one place were KURL::isLocalFile depended on the protocol being exactly
"file" and not "qrc".

Task-number: QTBUG-37058
Change-Id: Iad35ebc1fd72049484d2efa1f9caee96060fb236
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Account for extra guard page on Windows stack when using Java plugin.

This fixes some ASSERTs when debugging applications that load pages
which contain Java applets.

Task-number: QTBUG-36591
Change-Id: I65971dc97c3b002a28646916b82a548496c4c4d9
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Use moveDoubleToInts in SpecializedThunkJIT::returnDouble for non-X86 JSVALUE32_64 ports.

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

Patch by Julien Brianceau <jbriance@cisco.com> on 2013-11-29
Reviewed by Zoltan Herczeg.

The moveDoubleToInts implementations in ARM, MIPS and SH4 macro assemblers do not clobber
src FPRegister and are likely to be more efficient than the current generic implementation
using the stack.

* jit/SpecializedThunkJIT.h:
(JSC::SpecializedThunkJIT::returnDouble):

Change-Id: Ie3b6516a4047717212521315e85f5e2094373cbc
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159873 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Enable changing the cursor for the QQuickWebView.

Implements setting the platform cursor in QtPageClient.

Task-number: QTBUG-36368
Change-Id: I0ec2dc5eae550a7fa1197587f85c3f84b3225240
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Avoid deleting QtWebComboBox it's own nested QEventLoop

A race condition meant that sometimes a QtWebComboBox would be deleted
in an eventloop run while hiding itself. This patch adds a flags
and delays scheduling a deletion until after the nested eventloop.

Task-number: QTBUG-29844
Change-Id: Ia5e03954756afa29c0be0a2d7f49ae8d1dbba250
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Do no allow arbitrarily large buffer during loading

If the network is faster or we get a cache-hit, we can currently
end up processing very large QByteArrays. To lower the maximum memory
pressure and improve caching, we should limit the maximum size of the
buffers.

Task-number: QTBUG-36979
Change-Id: I681e764d95db75aa846de2df8b84ac6630872afb
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Fix rendering of WebKit2 QML WebView with ANGLE.

The WebKit2 QML WebView was not rendered on ANGLE builds
due to a precision mismatch for a uniform matrix used in
in both vertex and fragment shaders which made the ANGLE
compiler bail out on linking the shader program.

This was fixed by overriding the precision to highp in
both shaders.

Task-number: QTBUG-37043
Change-Id: I79f331e84448f537daef15a4490bb5df40113f89
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Set correct virtual keycode for the apostrophe key

We currently set the virtual keycode to 0 for the apostrophe key, but
it should use the same keycode as double-quote.

Task-number: QTBUG-37280
Change-Id: Ic69c3f117c3f5f2ee3b5b1a77ce1c0b173c3a456
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Implement Qt port for for leveldb

Replace the pthread/posix port classes in leveldb with a Qt port.
This should enable us to use leveldb on all Qt platforms.

Change-Id: Ie467f1c23ac28c436d26fb8fdc06c09ce70aff7d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Setting a large numeric property on an object causes it to allocate a huge backing store

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

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

There are two distinct actions that we're trying to optimize for:

new Array(100000);

and:

a = [];
a[100000] = 42;

In the first case, the programmer has indicated that they expect this Array to be very big,
so they should get a contiguous array up until some threshold, above which we perform density
calculations to see if it is indeed dense enough to warrant being contiguous.

In the second case, the programmer hasn't indicated anything about the size of the Array, so
we should be more conservative and assume it should be sparse until we've proven otherwise.

Currently both of those cases are handled by MIN_SPARSE_ARRAY_INDEX. We should distinguish
between them for the purposes of not over-allocating large backing stores like we see on
http://www.peekanalytics.com/burgerjoints/

The way that we'll do this is to keep the MIN_SPARSE_ARRAY_INDEX for the first case, and
introduce a new heuristic for the second case. If we are putting to an index above a certain
threshold (say, 1000) and it is beyond the length of the array, then we will use a sparse
map instead. So for example, in the second case above the empty array has a blank indexing
type and a length of 0. We put-by-val to an index > 1000 and > a.length, so we'll use a sparse map.

This fix is ~800x speedup on the accompanying regression test :-o

* runtime/ArrayConventions.h:
(JSC::indexIsSufficientlyBeyondLengthForSparseMap):
* runtime/JSObject.cpp:
(JSC::JSObject::putByIndexBeyondVectorLengthWithoutAttributes):
(JSC::JSObject::putByIndexBeyondVectorLengthWithArrayStorage):
(JSC::JSObject::putByIndexBeyondVectorLength):
(JSC::JSObject::putDirectIndexBeyondVectorLengthWithArrayStorage):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153374 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Change-Id: I1c29992d6e09c9d523a8093e76e3848a9581ce45
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
JSObject::putDirectIndexBeyondVectorLengthWithArrayStorage does a check on the length of the ArrayStorage after possible reallocing it

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

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

* runtime/JSObject.cpp:
(JSC::JSObject::putDirectIndexBeyondVectorLengthWithArrayStorage):

Change-Id: I034d6950683304d08a4e076d58fb1b999ade444b
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154633 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Compile fix for Win64 with jit disabled.

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

Reviewed by Michael Saboff.

* offlineasm/cloop.rb: Added std:: before isnan.

Change-Id: Ie7d922b7d6a0f45619a77029b07804aef5d01076
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154066 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
REGRESSION (r139343): WebKit crashes when canceling a load inside

<https://webkit.org/b/119853> webView:resource:didFinishLoadingFromDataSource:

Reviewed by Brady Eidson.

Source/WebCore:

A client implementing webView:resource:didFinishLoadingFromDataSource:
might decide to call stopLoading: for the identifier that just finished
loading. If this happens we re-enter the loader and attempt to cancel a
load that has already finished and been removed from the set of active
loaders. Prevent this by clearing DocumentLoader's
m_identifierForLoadWithoutResourceLoader before calling
dispatchDidFinishLoading().

New API test: WebKit1.StopLoadingFromDidFinishLoading.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::finishedLoading): Set
m_identifierForLoadWithoutResourceLoader to 0 before calling
dispatchDidFinishLoading().

Tools:

Wrote an API test that verifies -[WebView stopLoading:] can be called
inside webView:resource:didFinishLoadingFromDataSource: without crashing.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/mac/StopLoadingFromDidFinishLoading.mm: Added.
(-[StopLoadingFromDidFinishLoadingDelegate webView:resource:didFinishLoadingFromDataSource:]):
(TestWebKitAPI::TEST):

Change-Id: Ib5da6cfdd74eac0e284a512ee54e74353aba783b
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154115 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Assertion failure in Range::processContentsBetweenOffsets

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

Reviewed by Darin Adler.

Source/WebCore:

Merge https://chromium.googlesource.com/chromium/blink/+/c15de182774c7859c20d97126eb844ae97b792a4

This patch changes ASSERT statements for checking |endOffset| inbound in Range::processContentsBetweenOffsets()
to limit |endOffset|. This is necessary when DOMNodeRemovedFromDocument event handler splits text nodes,
Range::insertNode() on text node, in the range calling Range::deleteContents().

Test: fast/dom/Range/range-delete-contents-mutation-event-crash.html

* dom/Range.cpp:
(WebCore::Range::processContentsBetweenOffsets):

Change-Id: Ibafd4e42cfc50b0a386f31a0c1b49072cdb220d5
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157431 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Fix crash in BitmapImage::destroyDecodedData()

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

Patch by Laszlo Vidacs <lac@inf.u-szeged.hu> on 2013-11-07
Reviewed by Csaba Osztrogonác.

Merge from https://chromium.googlesource.com/chromium/blink/+/6b6887bf53068f8537908e501fdc7317ad2c6d86

* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::destroyDecodedData):

Change-Id: Ifa093a86c9cf2bfb8df29bc021c58c9c80eeaece
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158840 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Use qmake optimize_full

Qmake now has new config optimize_full that replaces -O2 with -O3. We
should use that in QtWebKit instead of trying to do the same ourselves.

This makes clang now use -O3 like gcc does.

Change-Id: I3db6167833c579bdea941d3ad1b3636cbad62475
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
When checking if relative URL is local, take baseUrl into account

Links with empty schemes (href="file.html") or anchored links
(href="#someid") should now be treated as local links if base
url is local.

See <https://bugs.webkit.org/show_bug.cgi?id=94360>.

Change-Id: I31e254ad7341bd54965c91d2e9dd2fbff7a99776
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Fix documentation of the selector API

We support all CSS selectors WebKit supports since the methods map
internally to the DOM Selectors API. We should therefore update
the documentation to claim more than CSS2 selector support.

Task-number: QTBUG-37208
Change-Id: I4eae7c897f13bbb17221995ef764020d9341d1f8
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Fix missing image in QWebView class documentation.

Add a current image of a QWebView showing the  Qt Project Homepage
previewed in Qt Creator.

Task-number: QTBUG-37208
Change-Id: Iedfee6965aa0ef35ba2a532a937e8054c4a0a9d5
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Reviewed-by: Michael Bruning <michael.bruning@digia.com>