Branch WebKitGTK+ for 2.4


git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.4@163300 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Merge r163037 - Consolidate page loading functions
https://bugs.webkit.org/show_bug.cgi?id=127847

Reviewed by Tim Horton.

Get rid of the loadURL functions (and the LoadURL message), rename
loadURLRequest to loadRequest and change it to take a ResourceRequest instead
of an API::URLRequest.

* UIProcess/API/C/WKPage.cpp:
(WKPageLoadURL):
(WKPageLoadURLWithUserData):
(WKPageLoadURLRequest):
(WKPageLoadURLRequestWithUserData):
* UIProcess/API/Cocoa/WKBrowsingContextController.mm:
(-[WKBrowsingContextController loadRequest:userData:]):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView loadRequest:]):
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkit_web_view_load_uri):
(webkit_web_view_load_request):
* UIProcess/WebInspectorProxy.cpp:
(WebKit::decidePolicyForNavigationAction):
(WebKit::WebInspectorProxy::createInspectorPage):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::loadRequest):
(WebKit::WebPageProxy::loadFile):
* UIProcess/WebPageProxy.h:
* UIProcess/cf/WebPageProxyCF.cpp:
(WebKit::WebPageProxy::restoreFromSessionStateData):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::loadRequest):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.4@163301 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Merge r163072 - Remove ENABLE(JAVASCRIPT_DEBUGGER) leftovers
https://bugs.webkit.org/show_bug.cgi?id=127845

Reviewed by Joseph Pecoraro.

.:

* Source/autotools/SetupWebKitFeatures.m4:

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::supportsProfiling):

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig:

Tools:

* Scripts/webkitperl/FeatureList.pm:

WebKitLibraries:

* win/tools/vsprops/FeatureDefines.props:
* win/tools/vsprops/FeatureDefinesCairo.props:

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.4@163303 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Merge r163081 - [SOUP] Fix the build if !ENABLE(WEB_TIMING)
https://bugs.webkit.org/show_bug.cgi?id=127906

Reviewed by Gustavo Noronha Silva.

* platform/network/soup/SoupNetworkSession.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.4@163304 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Merge r163086 - Web Inspector: Implement open/close Console window shortcut
https://bugs.webkit.org/show_bug.cgi?id=127896

Patch by Diego Pino Garcia <dpino@igalia.com> on 2014-01-30
Reviewed by Timothy Hatcher.

* UserInterface/KeyboardShortcut.js:
(WebInspector.KeyboardShortcut.prototype.get displayName):
Bug: Option symbol should be displayed as Alternative symbol (\u2387)
in non Mac platforms.
* UserInterface/Main.js:
(WebInspector.contentLoaded):
Create keyboard shortcut for toggling console window.

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.4@163305 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Merge r163174 - Don't allocate a new XMLHttpRequestStaticData every time staticData() is called
https://bugs.webkit.org/show_bug.cgi?id=127996

Reviewed by Andreas Kling.

std::once_flag should be static.

* xml/XMLHttpRequest.cpp:
(WebCore::staticData):

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.4@163306 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Partially revert r162947 so that Document::topDocument() again Walk over the chain of
owner Elements. This fixes the crashes related to creating and accessing the AXObjectCache
of documents that were introduced in that revision, which determined the top document by
returning the Document of the main frame. This fails badly when the frame in question is cached.

Patch by Zan Dobersek <zdobersek@igalia.com> on 2014-02-04

* dom/Document.cpp:
(WebCore::Document::topDocument):

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.4@163386 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Fix make distcheck.

Source/WebCore:

* GNUmakefile.list.am:

Source/WebKit2:

* GNUmakefile.list.am:
* Shared/InteractionInformationAtPosition.h:

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.4@163434 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Merge r163329 - REGRESSION (r163018): Can’t scroll in <select> lists
https://bugs.webkit.org/show_bug.cgi?id=128090

Source/WebCore:

The regression was caused by the fact that a new method scrollWithWheelEventLocation() was added
to RenderBox to replace the generic scroll() method for the particular case of scrolling using
the mouse wheel. This turned out to be a mistake because in the case of some elements, like select lists,
the scroll method was overriden and now the incorrect method was being called.
The solution was to remove the new method and just add two default parameters to the generic
scroll method.

Patch by Radu Stavila <stavila@adobe.com> on 2014-02-03
Reviewed by Simon Fraser.

Test: fast/scrolling/scroll-select-list.html

* page/EventHandler.cpp:
(WebCore::scrollNode):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::scroll):
* rendering/RenderBox.h:
* rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::scroll):
* rendering/RenderEmbeddedObject.h:
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::scroll):
* rendering/RenderListBox.h:
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::scroll):
* rendering/RenderTextControlSingleLine.h:

LayoutTests:

New test validates scrolling using the mouse wheel inside a select list.
This test is for the moment added as a ImageOnlyFailure expectation
because the current implementation of eventSender cannot simulate mouse wheel events.

Patch by Radu Stavila <stavila@adobe.com> on 2014-02-03
Reviewed by Simon Fraser.

* TestExpectations:
* fast/scrolling/scroll-select-list-expected.html: Added.
* fast/scrolling/scroll-select-list.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.4@163438 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Update NEWS and Versions.m4 for 2.3.5 release.

.:

* Source/autotools/Versions.m4: Bump version numbers.

Source/WebKit/gtk:

* NEWS: Added release notes for 2.3.5.

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.4@163442 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Merge r163460 - HashMap can't be used with std::unique_ptr as value when it has a custom deleter
https://bugs.webkit.org/show_bug.cgi?id=128250

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2014-02-05
Reviewed by Darin Adler.

The problem is that the HashMap is using a unique_ptr with the
default deleter, so that when trying to move the unique_ptr the
deleters don't match.

* wtf/HashTraits.h: Add the deleter also in the template
definitation of the parent class for the HashTraits<std::unique_ptr<T, Deleter>>

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.4@163461 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Merge r163292 - Fix wrong mix of fcntl commands and flags
https://bugs.webkit.org/show_bug.cgi?id=127842

Reviewed by Darin Adler.

We are mixing the commands to set file descriptor and file status
flags in a couple of fcntl() calls. FD_CLOEXEC must be set using
F_SETFD, and the access mode flags (O_RDONLY, O_WRONLY, O_RDWR)
with F_SETFL.

This combines patches by Guillem Jover and Sergio Correia.

* Platform/IPC/unix/ConnectionUnix.cpp:
(IPC::readBytesFromSocket):
* Platform/unix/SharedMemoryUnix.cpp:
(WebKit::SharedMemory::createHandle):

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.4@163767 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Merge r163435 - MediaPlayerPrivateGStreamerBase should have virtual destructor
https://bugs.webkit.org/show_bug.cgi?id=128238

Reviewed by Carlos Garcia Campos.

MediaPlayerPrivateGStreamer inherit MediaPlayerPrivateGStreamerBase.
So MediaPlayerPrivateGStreamerBase should have virtual destructor.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: Made destructor as virtual.

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.4@163768 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Merge r163748 - Unreviewed, rolling out r162768.
http://trac.webkit.org/changeset/162768
https://bugs.webkit.org/show_bug.cgi?id=128495

Causes crashes on GTK WK2 in three fast/forms tests.
(Requested by zdobersek on #webkit).

* UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
(WebKit::WebPopupMenuProxyGtk::showPopupMenu):

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.4@163769 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Merge r163373 - [GTK] Ensure generated events have given modifiers GDK understands
https://bugs.webkit.org/show_bug.cgi?id=128171

Patch by Carlos Garnacho <carlosg@gnome.org> on 2014-02-04
Reviewed by Carlos Garcia Campos.

* WebKitTestRunner/gtk/EventSenderProxyGtk.cpp:
(WTR::webkitModifiersToGDKModifiers): Move around
(WTR::EventSenderProxy::createMouseButtonEvent):

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.4@163772 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Merge r163375 - [Automake] Add missing $(feature_defines) when generating InjectedBundle bindings
https://bugs.webkit.org/show_bug.cgi?id=128170

Patch by Carlos Garnacho <carlosg@gnome.org> on 2014-02-04
Reviewed by Carlos Garcia Campos.

* WebKitTestRunner/GNUmakefile.am: Add missing $(feature_defines) when
generating the InjectedBundle bindings. So the various ENABLE_* defines
are available there.

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.4@163773 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Merge r163749 - [GTK] Enable touch features
https://bugs.webkit.org/show_bug.cgi?id=98931

Patch by Carlos Garnacho <carlosg@gnome.org> on 2014-02-09
Reviewed by Carlos Garcia Campos.

* Source/autotools/SetupWebKitFeatures.m4:
* Source/cmake/OptionsGTK.cmake: set ENABLE_TOUCH_EVENTS to 1 if building with GTK+.

Source/WebCore: [GTK] Add touch-events related code to build
https://bugs.webkit.org/show_bug.cgi?id=98931

Patch by Carlos Garnacho <carlosg@gnome.org> on 2014-02-09
Reviewed by Carlos Garcia Campos.

Tests in fast/events/touch have been enabled on GTK+ now that touch
support is implemented, and thus all expected bits are there.

* platform/gtk/GtkTouchContextHelper.cpp:
* platform/gtk/GtkTouchContextHelper.h: Add helper object to track all touchpoints, handy
when creating WebTouchEvents.
* GNUmakefile.list.am:
* PlatformGTK.cmake:
* bindings/gobject/GNUmakefile.am: Add touch related code and idls to build, those are
necessary now that GTK+ implements touch events.

Source/WebKit/gtk: [GTK] Allow building with touch events enabled
https://bugs.webkit.org/show_bug.cgi?id=98931

Patch by Carlos Garnacho <carlosg@gnome.org> on 2014-02-09
Reviewed by Carlos Garcia Campos.

Even though WebKit1 GTK code doesn't implement touch events,
Fix build if ENABLE_TOUCH_EVENTS is present for WK2.

* WebCoreSupport/ChromeClientGtk.h:
(WebKit::ChromeClient::needTouchEvents): Add empty stub

Source/WebKit2: [GTK] Implement support touch events
https://bugs.webkit.org/show_bug.cgi?id=98931

Patch by Carlos Garnacho <carlosg@gnome.org> on 2014-02-09
Reviewed by Carlos Garcia Campos.

In GTK+ >= 3.4.0, GdkEventTouch is available to inform about multitouch events. Use these to implement
touch events on this platform. If a touch is left unhandled and is the "pointer emulating" one, mouse
events will be generated as a fallback.

* GNUmakefile.list.am:
* PlatformGTK.cmake:
* Shared/gtk/NativeWebTouchEventGtk.cpp:
* Shared/NativeWebTouchEvent.h:
(WebKit::NativeWebTouchEvent::nativeEvent):
(WebKit::NativeWebTouchEvent::touchContext): Add GTK+ implementation of NativeWebTouchEvent.
* Shared/gtk/WebEventFactory.cpp:
(WebKit::touchPhaseFromEvents):
(WebKit::WebEventFactory::createWebTouchEvent): Add methods to generate WebTouchEvents out
of GdkEventTouch events, a GtkTouchContextHelper object is used to hold information about all current
touches, in order to build information about all individual touchpoints.
* Shared/gtk/WebEventFactory.h:
* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::doneWithTouchEvent): Implement pointer emulation. If a touch event was unhandled
in DOM and pertains to the touch sequence that emulates pointer events. The event gets transformed to its
mouse event counterpart and handled by the widget again.
* UIProcess/API/gtk/PageClientImpl.h:
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseRealize): Listen for touch events
(webkitWebViewBaseTouchEvent):
(webkit_web_view_base_class_init): Add implementation for the touch_events() handler, this merely
lets the pageProxy handle the NativeWebTouchEvent we create to wrap the GdkEvent received.

Tools: [GTK] Enable touch features
https://bugs.webkit.org/show_bug.cgi?id=98931

Patch by Carlos Garnacho <carlosg@gnome.org> on 2014-02-09
Reviewed by Carlos Garcia Campos.

* WebKitTestRunner/EventSenderProxy.h:
* WebKitTestRunner/gtk/EventSenderProxyGtk.cpp:
(WTR::updateEventCoordinates):
(WTR::EventSenderProxy::createTouchEvent):
(WTR::EventSenderProxy::addTouchPoint):
(WTR::EventSenderProxy::updateTouchPoint):
(WTR::EventSenderProxy::sendUpdatedTouchEvents):
(WTR::EventSenderProxy::setTouchPointRadius):
(WTR::EventSenderProxy::setTouchModifier): Implement touch event proxying.

LayoutTests: [GTK] Enable touch features
https://bugs.webkit.org/show_bug.cgi?id=98931

Patch by Carlos Garnacho <carlosg@gnome.org> on 2014-02-09
Reviewed by Carlos Garcia Campos.

* platform/gtk/TestExpectations: remove fast/events/touch
* platform/gtk-wk2/TestExpectations: Add new expectations on
fast/events/touch events.

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.4@163775 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Merge r163698 - [GTK] Make process model names properly meaningful
https://bugs.webkit.org/show_bug.cgi?id=128389

Patch by Adrian Perez de Castro <aperez@igalia.com> on 2014-02-08
Reviewed by Carlos Garcia Campos.

The name WEBKIT_PROCESS_MODEL_ONE_SECONDARY_PROCESS_PER_WEB_VIEW
is misleading because there are situations in which web views may
share the same web process even when multi-process mode is enabled;
for example when opening a related view and both interact using JS.

Source/WebKit2:

* UIProcess/API/gtk/WebKitWebContext.cpp:
(webkit_web_context_set_process_model):
(webkit_web_context_get_process_model):
Update names of WebKitProcessModel enum values.
* UIProcess/API/gtk/WebKitWebContext.h:
Ditto.

Tools:

* MiniBrowser/gtk/main.c:
(main):
Update usage of WebKitProcessModel enum values.
* TestWebKitAPI/Tests/WebKit2Gtk/TestMultiprocess.cpp:
(beforeAll):
Ditto.

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.4@163782 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Merge r163671 - Simplify web page creation
https://bugs.webkit.org/show_bug.cgi?id=128425

Reviewed by Andreas Kling.

Add a WebPageConfiguration class and stick the page group, preferences, session etc there
instead of adding more and more parameters to the WebPageProxy constructor.

Make WebContext::createWebPage fill in the missing pieces in the WebPageConfiguration object.

* UIProcess/API/ios/WKContentView.mm:
(-[WKContentView initWithFrame:configuration:]):
(-[WKContentView _commonInitializationWithContextRef:pageGroupRef:relatedToPage:]):
* UIProcess/API/mac/WKView.mm:
(-[WKView initWithFrame:contextRef:pageGroupRef:relatedToPage:]):
* UIProcess/WebContext.cpp:
(WebKit::WebContext::createWebPage):
* UIProcess/WebContext.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::create):
(WebKit::WebPageProxy::WebPageProxy):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::createWebPage):
* UIProcess/WebProcessProxy.h:

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.4@163783 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Merge r163781 - [GTK] Add API to create a webview related to another one
https://bugs.webkit.org/show_bug.cgi?id=128498

Reviewed by Gustavo Noronha Silva.

Source/WebKit2:

Add webkit_web_view_new_with_related_view() to create a new
WebView sharing the same web process as the given one.

* UIProcess/API/gtk/WebKitWebContext.cpp:
(webkitWebContextCreatePageForWebView): Use the given related
WebView to pass a related WebPageProxy to webkitWebViewBaseCreateWebPage().
* UIProcess/API/gtk/WebKitWebContextPrivate.h:
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkitWebViewConstructed): Pass the related web view to webkitWebContextCreatePageForWebView().
(webkitWebViewSetProperty):
(webkit_web_view_class_init): Add related-view construct-only property.
(webkit_web_view_new_with_related_view): New public method to
create a web view with a related one.
* UIProcess/API/gtk/WebKitWebView.h:
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseCreate): Pass nullptr as related page to webkitWebViewBaseCreateWebPage().
(webkitWebViewBaseCreateWebPage): Use the given related
WebPageProxy to initialize the web page configuration.
* UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
* UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new symbol.

Tools:

* MiniBrowser/gtk/BrowserWindow.c:
(webViewCreate): Use webkit_web_view_new_with_related_view() when
creating a new web view for window.open().
* TestWebKitAPI/Tests/WebKit2Gtk/TestMultiprocess.cpp:
(testMultiprocessWebViewCreateReadyClose): Add test case to check
that window.open() works when creating the new WebView related to
the existing one, and that no new web process is spawned when
using webkit_web_view_new_with_related_view().
(beforeAll):

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.4@163784 268f45cc-cd09-0410-ab3c-d52691b4dbfc