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>
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>
Fix the webkit build with icu on Mac OS X 10.9.

The QtWebKit build on OS X 10.9 was failing due to the wrong headers
being used for ICU. WebKit uses the system ICU libraries and includes
the headers for this from the WebKit source.

Fixed by changing the include path order for the QtWebKit build.

Task-number: QTBUG-35667
Change-Id: Ic68991535457c1fc318b54f6830de352399dd5c4
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Fix crash with rendering sliders that have anonymous nodes.

Added a check to no longer unconditionally call Node::toInputElement.

Task-number: QTBUG-37029
Change-Id: I905dba35c19d4adb6652bbeaad77998560e36119
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Fix build with force_static_libs_as_shared

The tools and tests now only links directly against webkitwidgets,
which means they not treated correctly force_static_libs_as_shared mode.

Change-Id: If51c1af1fad3c070710742d2db797d2c073d6046
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Fix dragging of selections

A regression from (r151091) broke drag and drop of selections. This
patch restores the maintenance of the m_writableData which is used
by DragClientQt.

Task-number: QTBUG-37314
Change-Id: I9afa193daec53d8d5affa560b8f225bb7dc79470
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Fix link and image dragging

Ensure we can drag and drop images, and fix copying and dragging of
links so the link title is correctly preserved.

Change-Id: Ib257ee67405ac259c72387616b5d620b163c07b0
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Fix doc warnings

- Qt for Embedded Linux Requirements isn't available since Qt5
- NOTIFY signal documentations are now ignored and are part of their property
- The QtQuick1 WebView code isn't available anymore
- Adjust to other renamed and removed pages

Change-Id: Ife04becb1a847fb0bfb11dfafa6db2caa36aa9f0
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Fix a documentation oversight

We had forgotten a few substitutions in the process it would seem.

Change-Id: I37297c39bea84b0d277784edb80e72eab8de7ca7
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
Fix build: LLIntAssembly.h is in a subdir of generated/

ruby /home/thiago/src/qt/qt5/qtwebkit/Source/JavaScriptCore/offlineasm/asm.rb /home/thiago/src/qt/qt5/qtwebkit/Source/JavaScriptCore/llint/LowLevelInterpreter.asm LLIntOffsetsExtractor generated/LLIntOffsetsExtractor/LLIntAssembly.h
offlineasm: Parsing /home/thiago/src/qt/qt5/qtwebkit/Source/JavaScriptCore/llint/LowLevelInterpreter.asm and LLIntOffsetsExtractor and creating assembly file generated/LLIntOffsetsExtractor/LLIntAssembly.h.

Change-Id: If12f1476de74c3feeb5c6d6e2e115829e1106581
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Fix compiler warnings when building Qt WebKit

Fix warnings about C++11 violating syntax, unused variables in leveldb
and non anynomous classes deriving from anonymous ones.

Change-Id: I39326eed03fabe2856f1ea7c93eff65f30ee78ee
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Fix static builds

Disable WebKit2 since WTF from qtdeclarative conflicts with ours,
and renable use of thin archives for static builds, except only use
it for the intermediate staticlibs.

Change-Id: Iee625c5d25f01d1700d4c89028578e4d1288e2ba
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Doc: Put \qtvariable in module page back

It was removed by d441d6f39bb846989d95bcf5caf387b42414718d for
some reason.

Change-Id: I333cf71dc5bf69b3a1f5aa04f5089e9fbd617c6b
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>