[WK2 iOS] Need to show title in the action sheet for images not inside an anchor...
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2014-04-28  Enrica Casucci  <enrica@apple.com>
2
3         [WK2 iOS] Need to show title in the action sheet for images not inside an anchor element.
4         https://bugs.webkit.org/show_bug.cgi?id=132304
5         <rdar://problem/16535227>
6
7         Reviewed by Benjamin Poulain.
8
9         If the image in not inside an anchor tag, we must use the title attribute as
10         title for the action sheet.
11
12         * UIProcess/ios/WKActionSheetAssistant.mm:
13         (-[WKActionSheetAssistant _createSheetWithElementActions:showLinkTitle:]):
14
15 2014-04-28  Tim Horton  <timothy_horton@apple.com>
16
17         WebKit2 View Gestures (Swipe): Discard snapshots made with a different view size/pixel density
18         https://bugs.webkit.org/show_bug.cgi?id=132115
19
20         Reviewed by Simon Fraser.
21
22         We shouldn't try to use snapshots if they no longer match the destination view size.
23         To do this, we need an accurate understanding of the topContentInset, both for the Web view,
24         and for any custom views, because we don't want to include the inset area in the snapshot,
25         and we don't want to reject snapshots that differ from the current view only because they have an inset or not.
26
27         * UIProcess/API/Cocoa/WKViewPrivate.h:
28         * UIProcess/API/mac/WKView.mm:
29         (-[WKView _takeViewSnapshot]):
30         (-[WKView _setCustomSwipeViewsTopContentInset:]):
31         Add and plumb through a topContentInset property to apply to the custom swipe views.
32         For simplicitly's sake in the multi-view case, it is applied in window coordinates,
33         so clients will have to do conversions if necessary.
34         Don't include the top content inset in the snapshot that is taken.
35
36         * UIProcess/mac/ViewGestureController.h:
37         (WebKit::ViewGestureController::setCustomSwipeViewsTopContentInset):
38         * UIProcess/mac/ViewGestureControllerMac.mm:
39         (WebKit::ViewGestureController::ViewGestureController):
40         (WebKit::ViewGestureController::windowRelativeBoundsForCustomSwipeViews):
41         Apply the aforementioned custom swipe view top content inset.
42
43         (WebKit::ViewGestureController::determineSnapshotLayerParent):
44         (WebKit::ViewGestureController::determineLayerAdjacentToSnapshotForParent):
45         Factor these out of beginSwipeGesture.
46
47         (WebKit::ViewGestureController::retrieveSnapshotForItem):
48         Don't return a snapshot if the current deviceScaleFactor doesn't match that
49         at which the snapshot was taken, or if the size of the snapshot doesn't match
50         the unobscured part of the snapshot layer (the layer's size sans top content inset).
51
52         (WebKit::layerGeometryFlippedToRoot): Added.
53         Determine whether geometry flipping occurs between a layer and the root of the tree it is in.
54
55         (WebKit::ViewGestureController::applyDebuggingPropertiesToSwipeViews):
56         Factor out debugging layer properties, and add some borders and backgrounds to our layers.
57         I switched to invert instead of blur because blur makes the borders hard to use.
58
59         (WebKit::ViewGestureController::beginSwipeGesture):
60         Add an additional layer, the swipeLayer, which is the parent of the swipeSnapshotLayer.
61         We use this layer to compensate for geometry flipping, since we don't necessarily
62         know the structure of the layer tree ahead of time when inserting snapshots into the
63         client's layer tree, in the custom swipe view case.
64         The swipe layer is always the full size of the view, including topContentInset, and
65         has a white background in order to fill in that space. The snapshot layer is the size
66         of the view *excluding* the topContentInset, which should match the size of the snapshot image
67         itself (and we reject the image and just paint white if this is not the case).
68
69         (WebKit::ViewGestureController::handleSwipeGesture):
70         (WebKit::ViewGestureController::removeSwipeSnapshot):
71         Move and remove the new swipeLayer.
72
73         * UIProcess/mac/ViewSnapshotStore.h:
74         * UIProcess/mac/ViewSnapshotStore.mm:
75         (WebKit::ViewSnapshotStore::recordSnapshot):
76         Store the deviceScaleFactor at the time the snapshot was taken.
77         Fix a bug where the count of snapshots with live images was too high
78         because we were failing to decrement it when replacing a snapshot of
79         an existing item with a fresh one.
80
81 2014-04-28  Enrica Casucci  <enrica@apple.com>
82
83         WK2 iOS: crash when handling a synthetic keyboard event.
84         https://bugs.webkit.org/show_bug.cgi?id=132296
85         <rdar://problem/16469726>
86
87         Reviewed by Benjamin Poulain.
88
89         Adding a null check, since synthetic keyboard events do not
90         have a corresponding platform event. We already do this on OS X.
91
92         * WebProcess/WebPage/ios/WebPageIOS.mm:
93         (WebKit::WebPage::handleEditingKeyboardEvent):
94
95 2014-04-24  Andy Estes  <aestes@apple.com>
96
97         [iOS] Implement WebQuickLookHandleClient for WebKit2
98         https://bugs.webkit.org/show_bug.cgi?id=132157
99
100         Reviewed by Darin Adler.
101
102         * Shared/API/Cocoa/_WKNSFileManagerExtras.h: Added.
103         * Shared/API/Cocoa/_WKNSFileManagerExtras.mm: Added.
104         (+[NSFileManager _web_createTemporaryFileForQuickLook:]): Called WebCore::createTemporaryFileForQuickLook().
105         * Shared/ios/QuickLookDocumentData.cpp: Added.
106         (WebKit::QuickLookDocumentData::QuickLookDocumentData):
107         (WebKit::QuickLookDocumentData::append): Appened each CFDataRef to m_data and added their sizes to m_size.
108         (WebKit::QuickLookDocumentData::decodedData): Returned the combined CFDataRef created by decode().
109         Named this method 'decodedData' to indicate that it should only be called on objects populated by decode().
110         (WebKit::QuickLookDocumentData::clear): Cleared m_data and reset m_size to 0.
111         (WebKit::QuickLookDocumentData::encode): Implemented a custom encoding function to avoid having to combine
112         m_data into contiguous memory at encoding time. Encoded m_size then sequentially encoded each member of m_data.
113         (WebKit::QuickLookDocumentData::decode): Decoded the byte stream into a single CFDataRef. Eagerly copied the
114         decoded data rather than using a DataReference since we know this will outlive the decoder.
115         * Shared/ios/QuickLookDocumentData.h: Added.
116         * UIProcess/API/APILoaderClient.h:
117         (API::LoaderClient::didStartLoadForQuickLookDocumentInMainFrame):
118         (API::LoaderClient::didFinishLoadForQuickLookDocumentInMainFrame):
119         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
120         * UIProcess/Cocoa/NavigationState.h:
121         * UIProcess/Cocoa/NavigationState.mm:
122         (WebKit::NavigationState::setNavigationDelegate):
123         (WebKit::NavigationState::LoaderClient::didStartLoadForQuickLookDocumentInMainFrame):
124         (WebKit::NavigationState::LoaderClient::didFinishLoadForQuickLookDocumentInMainFrame):
125         * UIProcess/WebPageProxy.h:
126         * UIProcess/WebPageProxy.messages.in:
127         * UIProcess/ios/WebPageProxyIOS.mm:
128         (WebKit::WebPageProxy::didStartLoadForQuickLookDocumentInMainFrame):
129         (WebKit::WebPageProxy::didFinishLoadForQuickLookDocumentInMainFrame):
130         * WebKit2.xcodeproj/project.pbxproj:
131         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
132         * WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm:
133         (WebKit::WebFrameLoaderClient::didCreateQuickLookHandle):
134         * WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.cpp: Added.
135         (WebKit::WebQuickLookHandleClient::WebQuickLookHandleClient): Sent DidStartLoadForQuickLookDocumentInMainFrame
136         to WebPageProxy.
137         (WebKit::WebQuickLookHandleClient::didReceiveDataArray): Appended dataArray to m_data.
138         (WebKit::WebQuickLookHandleClient::didFinishLoading): Sent DidFinishLoadForQuickLookDocumentInMainFrame to
139         WebPageProxy and then cleared m_data.
140         (WebKit::WebQuickLookHandleClient::didFail): Cleared m_data.
141         * WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.h: Added.
142         (WebKit::WebQuickLookHandleClient::create):
143
144 2014-04-28  Brady Eidson  <beidson@apple.com>
145
146         Hide service controls for selection behind a runtime switch
147         <rdar://problem/16736616> and https://bugs.webkit.org/show_bug.cgi?id=132291
148
149         Reviewed by Tim Horton.
150
151         * Shared/WebPreferencesStore.h:
152
153         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
154         (WebKit::WebEditorClient::selectionRectsDidChange): Do nothing if the UI is disabled.
155
156         * WebProcess/WebPage/WebPage.cpp:
157         (WebKit::WebPage::WebPage):
158         (WebKit::WebPage::updatePreferences):
159
160         * WebProcess/WebPage/WebPage.h:
161         (WebKit::WebPage::serviceControlsEnabled):
162
163 2014-04-28  Commit Queue  <commit-queue@webkit.org>
164
165         Unreviewed, rolling out r167853.
166         https://bugs.webkit.org/show_bug.cgi?id=132288
167
168         caused crashes+timeouts+layout test failures described in the
169         bug (Requested by thorton on #webkit).
170
171         Reverted changeset:
172
173         "Coalesce responses on network process side"
174         https://bugs.webkit.org/show_bug.cgi?id=132229
175         http://trac.webkit.org/changeset/167853
176
177 2014-04-28  Simon Fraser  <simon.fraser@apple.com>
178
179         Fix the iOS buld.
180
181         * UIProcess/WebPageProxy.cpp:
182         (WebKit::areAllTouchPointsReleased):
183
184 2014-04-24  Simon Fraser  <simon.fraser@apple.com>
185
186         [iOS WK2] Make subview rebuilding more incremental
187         https://bugs.webkit.org/show_bug.cgi?id=132162
188         <rdar://problem/16718916>
189
190         Reviewed by Sam Weinig.
191         
192         Previously we did bulk replacement of subviews, but that triggers
193         UIKit to send spurious will/DidMoveToWindow messages, which can
194         interfere with UIScrollView scrolling.
195         
196         Make _web_setSubviews more incremental, only removing
197         deleted subviews, adding new ones, and moving existing ones
198         into the correct order.
199
200         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
201         (-[UIView _web_setSubviews:]):
202
203 2014-04-24  Simon Fraser  <simon.fraser@apple.com>
204
205         [iOS WK2] flickery scrolling with overflow-scrolling:touch
206         https://bugs.webkit.org/show_bug.cgi?id=132150
207         <rdar://problem/16683006>
208
209         Reviewed by Tim Horton.
210         
211         Maintain a flag that tells us if the user is interacting
212         with the UIScrollView, and while set, don't clobber the contentOffset
213         via scrolling tree updates.
214
215         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
216         (-[WKOverflowScrollViewDelegate initWithScrollingTreeNode:WebKit::]):
217         (-[WKOverflowScrollViewDelegate scrollViewWillBeginDragging:]):
218         (-[WKOverflowScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]):
219         (-[WKOverflowScrollViewDelegate scrollViewDidEndDecelerating:]): We need this one,
220         not scrollViewDidEndScrollingAnimation:, to detect the end of decleration.
221         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren):
222         (-[WKOverflowScrollViewDelegate scrollViewDidEndScrollingAnimation:]): Deleted.
223
224 2014-04-28  Krzysztof Wolanski  <k.wolanski@samsung.com>
225
226         [X11] Add missing case for mime type application/x-webkit-test-netscape
227         https://bugs.webkit.org/show_bug.cgi?id=132278
228
229         Reviewed by Darin Adler.
230
231         Case for x-webkit-test-netscape has been omitted along with r167759.
232
233         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
234         (WebKit::NetscapePlugin::initialize):
235
236 2014-04-28  Zan Dobersek  <zdobersek@igalia.com>
237
238         [WK2][X11] NetscapePluginModule::scanPlugin() should write UTF-8 strings to stdout
239         https://bugs.webkit.org/show_bug.cgi?id=132245
240
241         Reviewed by Carlos Garcia Campos.
242
243         NetscapePluginModule::scanPlugin(), in the helper writeLine function, takes each character
244         of the given string and writes it out as a UChar, doing two fputc calls for each byte of the
245         16-bit type.
246
247         This fails badly with characters with integer value less than 256 as the most significant byte
248         of the UChar is written out as a null character. This effectively chops the output that's gathered
249         in the UIProcess and is parsed in PluginProcessProxy::scanPlugin().
250
251         To avoid all this, the UTF-8 encoding of the string is written out in the PluginProcess, and
252         String::fromUTF8() is called in the UIProcess to properly decode the received string.
253
254         * Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp:
255         (WebKit::writeCharacter):
256         (WebKit::writeLine):
257         (WebKit::writeByte): Deleted.
258         * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
259         (WebKit::PluginProcessProxy::scanPlugin):
260
261 2014-04-28  Zan Dobersek  <zdobersek@igalia.com>
262
263         [GTK][WK2] Missing return statement in webkit_plugin_get_description()
264         https://bugs.webkit.org/show_bug.cgi?id=132263
265
266         Reviewed by Carlos Garcia Campos.
267
268         * UIProcess/API/gtk/WebKitPlugin.cpp:
269         (webkit_plugin_get_description): Actually return the data of the cached
270         plugin description CString.
271
272 2014-04-28  Carlos Garcia Campos  <cgarcia@igalia.com>
273
274         [GTK] Crash in debug build with removing windowed plugin child widgets from the view
275         https://bugs.webkit.org/show_bug.cgi?id=132252
276
277         Reviewed by Philippe Normand.
278
279         It crashes due to an assert in HashTable that checks the iterators
280         validity. The problem is that we are iterating the children map
281         and the callback called on every iteration might modify the map,
282         making the iterators invalid. This happens when the WebView is
283         destroyed, GtkContainer calls gtk_container_foreach() with
284         gtk_widget_destroy as callback. When a widget inside a container
285         is destroyed, it's removed from the container, and in our case,
286         the child widget is removed from the map. This fixes several
287         crashes when running layout tests in debug bot.
288
289         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
290         (webkitWebViewBaseContainerForall): Use copyKeysToVector() instead
291         of using a range iterator for the map keys and check in every
292         iteration that the child widget from the keys vector is still
293         present in the map before calling the callback.
294
295 2014-04-28  Carlos Garcia Campos  <cgarcia@igalia.com>
296
297         [GTK] GObject introspection links to installed libs when using jhbuild
298         https://bugs.webkit.org/show_bug.cgi?id=132220
299
300         Reviewed by Martin Robinson.
301
302         The problem is that gobject-introspection is linking the temporary
303         binaries adding the library paths present LDFLAGS environment
304         variable first, taking precedence over the libraries in the build
305         dir. Since the libraries paths of the dependencies are already
306         correctly deduced by gobject-introspection using ldd, we can
307         just unset the LDFLAGS variable before calling g-ir-scanner to
308         make sure the libraries in the build dir take predence.
309
310         * PlatformGTK.cmake:
311
312 2014-04-27  Tim Horton  <timothy_horton@apple.com>
313
314         REGRESSION (r164702): Double tap doesn't stay under the new element once the animation finishes
315         https://bugs.webkit.org/show_bug.cgi?id=132239
316         <rdar://problem/16192842>
317
318         Reviewed by Darin Adler.
319
320         * WebProcess/WebPage/WebPage.cpp:
321         (WebKit::WebPage::scalePage):
322         The change in r167864 broke iOS animated resize, because it was depending on
323         the dynamic size update code not running if the scale wasn't going to change.
324         So, as a band-aid we should bail from doing that work if the scales aren't different.
325         In the long term we should try to untangle this code and make it less platform dependent.
326
327 2014-04-27  Eunmi Lee  <eunmi15.lee@samsung.com>
328
329         TouchEvent is not handled after releasing any point among touched points.
330         https://bugs.webkit.org/show_bug.cgi?id=132043
331
332         Reviewed by Benjamin Poulain.
333
334         Handle TouchEvent until all touched points are released by setting
335         trackingTouchEvents variable to false when all points are released.
336
337         * UIProcess/WebPageProxy.cpp:
338         (WebKit::areAllTouchPointsReleased):
339         (WebKit::WebPageProxy::handleTouchEventSynchronously):
340         (WebKit::WebPageProxy::handleTouchEventAsynchronously):
341         (WebKit::WebPageProxy::handleTouchEvent):
342
343 2014-04-27  Alexey Proskuryakov  <ap@apple.com>
344
345         Don't use DispatchMessageEvenWhenWaitingForSyncReply for messages from NetworkProcess
346         https://bugs.webkit.org/show_bug.cgi?id=132144
347
348         Reviewed by Darin Adler.
349
350         * NetworkProcess/AsynchronousNetworkLoaderClient.cpp:
351         (WebKit::AsynchronousNetworkLoaderClient::willSendRequest):
352         (WebKit::AsynchronousNetworkLoaderClient::canAuthenticateAgainstProtectionSpace):
353         Dont use the IPC::DispatchMessageEvenWhenWaitingForSyncReply flag. It's not needed,
354         almost never works in NetworkProcess, but may cause trouble if it did.
355
356         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
357         (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess): Removed
358         setOnlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage()
359         function call, because there are no more any messages in NetworkProcess it could affect.
360
361         * Platform/IPC/Connection.cpp: (IPC::Connection::dispatchMessage): Added a FIXME
362         for an unrelated bug Anders and myself noticed while looking into this.
363
364 2014-04-27  Dan Bernstein  <mitz@apple.com>
365
366         [Cocoa] -[WKWebProcessPlugInController parameters] returns nil if no parameters have been set yet
367         https://bugs.webkit.org/show_bug.cgi?id=132223
368
369         Reviewed by Sam Weinig.
370
371         * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
372         (WebKit::InjectedBundle::bundleParameters): Create the WKWebProcessBundleParameters if
373         needed.
374
375 2014-04-27  Tim Horton  <timothy_horton@apple.com>
376
377         REGRESSION (r164702): Double tap doesn't stay under the new element once the animation finishes
378         https://bugs.webkit.org/show_bug.cgi?id=132239
379         <rdar://problem/16192842>
380
381         Reviewed by Sam Weinig.
382
383         * WebProcess/WebPage/WebPage.cpp:
384         (WebKit::WebPage::scalePage):
385         The early-return added to WebPage::scalePage breaks callers who depend
386         on being able to call scalePage() with the same scale but a different
387         origin and having that change take effect.
388
389         Page::setPageScaleFactor already has the requisite logic, so move
390         the early return down after that call, and guard only notification
391         of page scale changes.
392
393 2014-04-25  Andy Estes  <aestes@apple.com>
394
395         [iOS] Stop creating a WKWebResourceQuickLookDelegate for every WebResourceLoader
396         https://bugs.webkit.org/show_bug.cgi?id=132215
397
398         Reviewed by Dan Bernstein.
399
400         * WebKit2.xcodeproj/project.pbxproj:
401         * WebProcess/Network/WebResourceLoader.cpp:
402         (WebKit::WebResourceLoader::didReceiveResponseWithCertificateInfo): Called QuickLookHandle::create() directly.
403         * WebProcess/Network/WebResourceLoader.h:
404         * WebProcess/ios/WebResourceLoaderIOS.mm: Removed.
405
406 2014-04-27  Sam Weinig  <sam@webkit.org>
407
408         [iOS WebKit2] Add support for text autosizing
409         <rdar://problem/16545245>
410         https://bugs.webkit.org/show_bug.cgi?id=132237
411
412         Reviewed by Tim Horton.
413
414         * Shared/WebPageCreationParameters.cpp:
415         (WebKit::WebPageCreationParameters::encode):
416         (WebKit::WebPageCreationParameters::decode):
417         * Shared/WebPageCreationParameters.h:
418         * UIProcess/WebPageProxy.cpp:
419         (WebKit::WebPageProxy::creationParameters):
420         * UIProcess/WebPageProxy.h:
421         * UIProcess/ios/WebPageProxyIOS.mm:
422         (WebKit::WebPageProxy::textAutosizingWidth):
423         * WebProcess/WebPage/WebPage.cpp:
424         (WebKit::WebPage::WebPage):
425         Pass the text autosizing width from the UIProcess to WebProcess.
426
427 2014-04-27  Tim Horton  <timothy_horton@apple.com>
428
429         WebKit2 View Gestures (Zoom): Pages with 'background-attachment: fixed' don't behave correctly when zoomed
430         https://bugs.webkit.org/show_bug.cgi?id=132225
431         <rdar://problem/15729975>
432
433         Reviewed by Darin Adler.
434
435         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
436         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
437         (WebKit::TiledCoreAnimationDrawingArea::layerForTransientZoom):
438         (WebKit::TiledCoreAnimationDrawingArea::shadowLayerForTransientZoom):
439         (WebKit::TiledCoreAnimationDrawingArea::adjustTransientZoom):
440         (WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom):
441         (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToPage):
442         Factor out code to choose which layer (and shadow layer) to apply the transient zoom to.
443         If we have a contentsContainmentLayer (because we have composited background-attachment: fixed),
444         it applies page scale, so we should apply the transient zoom to that layer
445         instead of the RenderView's main GraphicsLayer.
446
447 2014-04-27  Pratik Solanki  <psolanki@apple.com>
448
449         Unreviewed. iOS build fix.
450
451         * UIProcess/ios/SmartMagnificationController.h:
452
453 2014-04-27  Zan Dobersek  <zdobersek@igalia.com>
454
455         Move cross-port WebKit2 code to std::unique_ptr
456         https://bugs.webkit.org/show_bug.cgi?id=129670
457
458         Reviewed by Darin Adler.
459
460         Replace uses of OwnPtr, PassOwnPtr in cross-port WebKit2 code with std::unique_ptr.
461
462         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
463         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createIndex):
464         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h:
465         * NetworkProcess/NetworkProcess.h:
466         (WebKit::NetworkProcess::addSupplement):
467         * NetworkProcess/SynchronousNetworkLoaderClient.cpp:
468         (WebKit::SynchronousNetworkLoaderClient::didReceiveBuffer):
469         * NetworkProcess/SynchronousNetworkLoaderClient.h:
470         * Platform/IPC/Connection.cpp:
471         (IPC::Connection::dispatchWorkQueueMessageReceiverMessage):
472         * Platform/IPC/Connection.h:
473         * Platform/IPC/MessageReceiver.h:
474         * Platform/Module.h:
475         * Platform/WorkQueue.h:
476         * Platform/efl/ModuleEfl.cpp:
477         (WebKit::Module::load):
478         * Platform/mac/LayerHostingContext.mm:
479         * Shared/APIURL.h:
480         * Shared/Network/CustomProtocols/CustomProtocolManager.h:
481         * Shared/Plugins/NPRemoteObjectMap.cpp:
482         * Shared/ShareableBitmap.h:
483         * UIProcess/DrawingAreaProxyImpl.h:
484         * UIProcess/InspectorServer/WebSocketServer.cpp:
485         (WebKit::WebSocketServer::didAcceptConnection):
486         (WebKit::WebSocketServer::didCloseWebSocketServerConnection):
487         * UIProcess/InspectorServer/WebSocketServer.h:
488         * UIProcess/InspectorServer/soup/WebSocketServerSoup.cpp:
489         (WebKit::connectionCallback):
490         * UIProcess/Network/NetworkProcessProxy.cpp:
491         (WebKit::NetworkProcessProxy::createDownloadProxy):
492         * UIProcess/Network/NetworkProcessProxy.h:
493         * UIProcess/Notifications/WebNotificationManagerProxy.h:
494         * UIProcess/Plugins/WebPluginSiteDataManager.cpp:
495         (WebKit::WebPluginSiteDataManager::getSitesWithData):
496         (WebKit::WebPluginSiteDataManager::clearSiteData):
497         (WebKit::WebPluginSiteDataManager::didGetSitesWithDataForAllPlugins):
498         (WebKit::WebPluginSiteDataManager::didClearSiteDataForAllPlugins):
499         * UIProcess/Plugins/WebPluginSiteDataManager.h:
500         * UIProcess/Storage/StorageManager.cpp:
501         (WebKit::callCallbackFunction):
502         (WebKit::StorageManager::getOriginsInternal):
503         * UIProcess/WebPageProxy.cpp:
504         (WebKit::ExceededDatabaseQuotaRecords::areBeingProcessed):
505         (WebKit::ExceededDatabaseQuotaRecords::createRecord):
506         (WebKit::ExceededDatabaseQuotaRecords::add):
507         (WebKit::ExceededDatabaseQuotaRecords::next):
508         (WebKit::WebPageProxy::handleMouseEvent):
509         (WebKit::WebPageProxy::handleWheelEvent):
510         (WebKit::WebPageProxy::processNextQueuedWheelEvent):
511         (WebKit::WebPageProxy::internalShowContextMenu):
512         * UIProcess/WebPageProxy.h:
513         * UIProcess/WebProcessProxy.cpp:
514         (WebKit::WebProcessProxy::createDownloadProxy):
515         * UIProcess/WebProcessProxy.h:
516         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
517         (WebKit::PluginDestructionProtector::PluginDestructionProtector):
518         * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
519         (WebKit::NetscapePluginStream::deliverData):
520         * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
521         * WebProcess/Plugins/PluginProcessConnectionManager.h:
522         * WebProcess/Plugins/PluginProxy.cpp:
523         (WebKit::PluginProxy::initialize):
524         (WebKit::PluginProxy::didCreatePluginInternal):
525         (WebKit::PluginProxy::didFailToCreatePluginInternal):
526         * WebProcess/Plugins/PluginProxy.h:
527         * WebProcess/Plugins/PluginView.cpp:
528         (WebKit::PluginView::createWebEvent):
529         (WebKit::PluginView::handleEvent):
530         * WebProcess/Plugins/PluginView.h:
531         * WebProcess/WebCoreSupport/WebPopupMenu.h:
532         * WebProcess/WebPage/EventDispatcher.cpp:
533         (WebKit::EventDispatcher::EventDispatcher):
534         * WebProcess/WebPage/EventDispatcher.h:
535         * WebProcess/WebPage/WebPage.cpp:
536         (WebKit::WebPage::WebPage):
537         (WebKit::WebPage::beginPrinting):
538         * WebProcess/WebPage/WebPage.h:
539         * WebProcess/WebProcess.h:
540         (WebKit::WebProcess::addSupplement):
541
542 2014-04-27  Antti Koivisto  <antti@apple.com>
543
544         Coalesce responses on network process side
545         https://bugs.webkit.org/show_bug.cgi?id=132229
546
547         Reviewed by Andreas Kling.
548         
549         To reduce IPC we should coalesce response data in the network process and send it over with single IPC call.
550
551         * NetworkProcess/AsynchronousNetworkLoaderClient.cpp:
552         (WebKit::AsynchronousNetworkLoaderClient::AsynchronousNetworkLoaderClient):
553         (WebKit::AsynchronousNetworkLoaderClient::didReceiveResponse):
554         (WebKit::AsynchronousNetworkLoaderClient::didReceiveBuffer):
555         (WebKit::AsynchronousNetworkLoaderClient::didFinishLoading):
556         (WebKit::AsynchronousNetworkLoaderClient::didFail):
557         (WebKit::AsynchronousNetworkLoaderClient::dispatchPartialCoalescedResponse):
558         (WebKit::AsynchronousNetworkLoaderClient::clearCoalescedResponse):
559         (WebKit::AsynchronousNetworkLoaderClient::responseCoalesceTimerFired):
560         
561             Coalesce the response. Completed response is sent on didFinishLoading. If the coalesce timer fires
562             before that the data accumulated so far is dispatched.
563
564         * NetworkProcess/AsynchronousNetworkLoaderClient.h:
565         * NetworkProcess/NetworkResourceLoader.h:
566         * WebProcess/Network/WebResourceLoader.cpp:
567         (WebKit::WebResourceLoader::didReceiveCompleteResponse):
568         * WebProcess/Network/WebResourceLoader.h:
569         * WebProcess/Network/WebResourceLoader.messages.in:
570         
571             Add a new message type that covers didReceiveResponse, didReceiveBuffer and didFinishLoading in a single message.
572
573 2014-04-26  Tim Horton  <timothy_horton@apple.com>
574
575         REGRESSION (r167775): Safari crashes in ViewSnapshotStore::pruneSnapshots after loading 20 pages
576         https://bugs.webkit.org/show_bug.cgi?id=132204
577         <rdar://problem/16735622>
578
579         Reviewed by Dan Bernstein and Sam Weinig.
580
581         * UIProcess/mac/ViewSnapshotStore.mm:
582         (WebKit::ViewSnapshotStore::pruneSnapshots):
583         (WebKit::ViewSnapshotStore::recordSnapshot):
584         Fix a bug where the count of snapshots with live images was too high
585         because we were failing to decrement it when replacing a snapshot of
586         an existing item with a fresh one.
587
588 2014-04-26  Dan Bernstein  <mitz@apple.com>
589
590         [Cocoa] Rename a bundle form delegate method
591         https://bugs.webkit.org/show_bug.cgi?id=132221
592
593         Reviewed by Adele Peterson.
594
595         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFormDelegatePrivate.h: Renamed.
596         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
597         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Check for the method
598         under the old (“new”) name and under the new name.
599
600 2014-04-25  Dan Bernstein  <mitz@apple.com>
601
602         [Cocoa] Synthesized getter for WKNavigationAction's _userInitiated property has the wrong name
603         https://bugs.webkit.org/show_bug.cgi?id=132219
604
605         Reviewed by Sam Weinig.
606
607         * UIProcess/API/Cocoa/WKNavigationActionInternal.h:
608
609 2014-04-25  Simon Fraser  <simon.fraser@apple.com>
610
611         [iOS] getAssistedNodeInformation crashes getting the bounding box if it doesn't have a renderer
612         https://bugs.webkit.org/show_bug.cgi?id=132217
613         <rdar://problem/16671662>
614
615         Reviewed by Dean Jackson.
616
617         * WebProcess/WebPage/ios/WebPageIOS.mm:
618         (WebKit::WebPage::getAssistedNodeInformation): Check that m_assistedNode has
619         a renderer before asking for its bounding box.
620
621 2014-04-25  Benjamin Poulain  <bpoulain@apple.com>
622
623         [iOS][WK2] Add an intermediary view to do the target transform and adjustment transform
624         https://bugs.webkit.org/show_bug.cgi?id=132175
625
626         Reviewed by Enrica Casucci.
627
628         Some utility views of WKContentView account for the transforms between the content view
629         and the utility view.
630
631         Since the dynamic resize relies on setting subLayerTransforms, it is getting in the way.
632
633         This patch adds a layer in between for the animation. That way the content view remains
634         unscaled.
635
636         * UIProcess/API/Cocoa/WKWebView.mm:
637         (-[WKWebView _didCommitLayerTree:WebKit::]):
638         (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:]):
639         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
640         (-[WKWebView _endAnimatedResize]):
641
642 2014-04-25  Enrica Casucci  <enrica@apple.com>
643
644         REGRESSION (iOS WebKit2): Selection is not being repainted during live resize.
645         https://bugs.webkit.org/show_bug.cgi?id=132216
646         <rdar://problem/16628819>
647
648         Reviewed by Benjamin Poulain.
649
650         Since the selection is drawn in the UIProcess on iOS,
651         we need to update the selection rects and force a repaint
652         during a live resize.
653
654         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
655         (WebKit::WebFrameLoaderClient::dispatchDidLayout):
656         * WebProcess/WebPage/WebPage.h:
657         * WebProcess/WebPage/ios/WebPageIOS.mm:
658         (WebKit::WebPage::updateSelectionAppearance):
659
660 2014-04-25  Brady Eidson  <beidson@apple.com>
661
662         Add a selection overlay.
663         <rdar://problem/16727797> and https://bugs.webkit.org/show_bug.cgi?id=132200
664
665         Reviewed by David Hyatt.
666
667         * WebKit2.xcodeproj/project.pbxproj:
668
669         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
670         (WebKit::WebEditorClient::selectionRectsDidChange): Pass the new selection rects on
671           to the selection overlay controller.
672         * WebProcess/WebCoreSupport/WebEditorClient.h:
673
674         * WebProcess/WebPage/SelectionOverlayController.cpp: Added.
675         (WebKit::SelectionOverlayController::SelectionOverlayController):
676         (WebKit::SelectionOverlayController::createOverlayIfNeeded):
677         (WebKit::SelectionOverlayController::destroyOverlay):
678         (WebKit::SelectionOverlayController::pageOverlayDestroyed):
679         (WebKit::SelectionOverlayController::willMoveToWebPage):
680         (WebKit::SelectionOverlayController::didMoveToWebPage):
681         (WebKit::SelectionOverlayController::selectionRectsDidChange):
682         (WebKit::SelectionOverlayController::drawRect):
683         (WebKit::SelectionOverlayController::mouseEvent):
684         * WebProcess/WebPage/SelectionOverlayController.h: Added.
685         (WebKit::SelectionOverlayController::create):
686         * WebProcess/WebPage/mac/SelectionOverlayControllerMac.mm: Added.
687         (WebKit::SelectionOverlayController::drawRect):
688         (WebKit::SelectionOverlayController::mouseEvent):
689         (WebKit::SelectionOverlayController::handleClick):
690         (WebKit::SelectionOverlayController::clearHighlight):
691
692         * WebProcess/WebPage/WebPage.cpp:
693         (WebKit::WebPage::selectionOverlayController):
694         * WebProcess/WebPage/WebPage.h:
695
696 2014-04-25  Enrica Casucci  <enrica@apple.com>
697
698         Remove duplicate member variable in WKAutocorrectionRects and WKAutocorrectionContext.
699         https://bugs.webkit.org/show_bug.cgi?id=132206
700
701         Reviewed by Benjamin Poulain.
702
703         * UIProcess/ios/WKContentViewInteraction.mm:
704
705 2014-04-25  Dean Jackson  <dino@apple.com>
706
707         Allow a platform-specific size enumeration to be passed into popup-menu display
708         https://bugs.webkit.org/show_bug.cgi?id=132195
709
710         Reviewed by Brent Fulgham. With some in-person review comments from Sam Weinig.
711
712         Platforms like OS X use a set of predefined sizes for built-in controls
713         used for <select>: normal, small and mini. Expose that information to
714         the PopupMenuClient via the PopupMenuStyle, allowing it to be passed
715         into the platform code in WebKitSystemInterface.
716
717         * Shared/PlatformPopupMenuData.cpp: Encode and decode the PopupMenuSize enum.
718         (WebKit::PlatformPopupMenuData::encode):
719         (WebKit::PlatformPopupMenuData::decode):
720         * Shared/PlatformPopupMenuData.h: Add PopupMenuSize member variable.
721         * UIProcess/mac/WebPopupMenuProxyMac.mm:
722         (WebKit::WebPopupMenuProxyMac::showPopupMenu): Convert the PopupMenuSize
723         into a WKControlSize, and pass that into WKPopupMenu.
724         * WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm:
725         (WebKit::WebPopupMenu::setUpPlatformData): Add the PopupMenuSize to
726         the PlatformPopupMenuData.
727
728 2014-04-25  Tim Horton  <timothy_horton@apple.com>
729
730         REGRESSION (r167775): Safari crashes in ViewSnapshotStore::pruneSnapshots after loading 20 pages
731         https://bugs.webkit.org/show_bug.cgi?id=132204
732         <rdar://problem/16729123>
733
734         Reviewed by Anders Carlsson.
735
736         * UIProcess/mac/ViewSnapshotStore.h:
737         * UIProcess/mac/ViewSnapshotStore.mm:
738         (WebKit::ViewSnapshotStore::ViewSnapshotStore):
739         (WebKit::ViewSnapshotStore::pruneSnapshots):
740         (WebKit::ViewSnapshotStore::recordSnapshot):
741         Keep track of the number of snapshots that actually have live images; the
742         size of the snapshot map no longer represents that.
743         Also, fix the crash by using the UUID from the current item instead of from
744         the (potentially null) most distant item; r167775 accidentally typo'd this.
745
746 2014-04-25  Carlos Garcia Campos  <cgarcia@igalia.com>
747
748         [GTK] Plugin process crashes with GTK2 windowed plugins
749         https://bugs.webkit.org/show_bug.cgi?id=132127
750
751         Reviewed by Martin Robinson.
752
753         It happens sometimes because the socket is used before the plug
754         has been added. A runtime critical warnings is shown and it
755         sometimes ends up crashing.
756
757         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
758         (WebKit::NetscapePlugin::platformPostInitializeWindowed): Do not
759         show the plug widget until the socket is connected.
760
761 2014-04-24  Andreas Kling  <akling@apple.com>
762
763         [iOS WebKit2] Enable optimization to mmap downloaded resources once they become file-backed.
764         <https://webkit.org/b/132171>
765         <rdar://problem/16720733>
766
767         Implement a CFNetwork-based version of NetworkResourceLoader::willCacheResponseAsync()
768         and activate the DiskCacheMonitor code path. This means that once resources go into
769         file system cache, we get notified and mmap them from disk, saving heaps of memory.
770
771         Reviewed by Antti Koivisto.
772
773         * NetworkProcess/NetworkResourceLoader.h:
774         * NetworkProcess/mac/DiskCacheMonitor.mm:
775         * NetworkProcess/mac/NetworkResourceLoaderMac.mm:
776         (WebKit::NetworkResourceLoader::willCacheResponseAsync):
777
778 2014-04-24  Andreas Kling  <akling@apple.com>
779
780         [iOS WebKit2] RemoteLayerTreeDrawingArea should force CA to garbage collect surfaces.
781         <https://webkit.org/b/132160>
782         <rdar://problem/16110687>
783
784         Do an empty CATransaction at the end of RemoteLayerTreeDrawingArea::flushLayers()
785         to get CA to garbage collect its IOSurfaces. This helps clean up unused surfaces
786         that we'd otherwise end up hanging on to for a long time.
787
788         Reviewed by Tim Horton.
789
790         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
791         (WebKit::RemoteLayerTreeDrawingArea::didUpdate):
792
793 2014-04-24  Commit Queue  <commit-queue@webkit.org>
794
795         Unreviewed, rolling out r167700.
796         https://bugs.webkit.org/show_bug.cgi?id=132142
797
798         Incorrectly reverted the change in r167547 for
799         webkit.org/b/131898 (Requested by rniwa on #webkit).
800
801         Reverted changeset:
802
803         "Cursor doesn't change back to pointer when leaving the Safari
804         window"
805         https://bugs.webkit.org/show_bug.cgi?id=132038
806         http://trac.webkit.org/changeset/167700
807
808 2014-04-24  Brady Eidson  <beidson@apple.com>
809
810         Rename "IMAGE_CONTROLS" feature to "SERVICE_CONTROLS"
811         https://bugs.webkit.org/show_bug.cgi?id=132155
812
813         Reviewed by Tim Horton.
814
815         * Configurations/FeatureDefines.xcconfig:
816         * Shared/ContextMenuContextData.cpp:
817         (WebKit::ContextMenuContextData::ContextMenuContextData):
818         (WebKit::ContextMenuContextData::operator=):
819         (WebKit::ContextMenuContextData::encode):
820         (WebKit::ContextMenuContextData::decode):
821         * Shared/ContextMenuContextData.h:
822         * UIProcess/WebPageProxy.cpp:
823         (WebKit::WebPageProxy::internalShowContextMenu):
824         * UIProcess/WebPageProxy.h:
825         * UIProcess/mac/WebContextMenuProxyMac.h:
826         * UIProcess/mac/WebContextMenuProxyMac.mm:
827         (WebKit::WebContextMenuProxyMac::contextMenuItemSelected):
828         (WebKit::WebContextMenuProxyMac::populate):
829         (WebKit::WebContextMenuProxyMac::showContextMenu):
830         * WebProcess/InjectedBundle/InjectedBundle.cpp:
831         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
832         * WebProcess/WebPage/WebContextMenu.cpp:
833         * WebProcess/WebPage/WebContextMenu.h:
834         * WebProcess/WebPage/WebPage.cpp:
835         (WebKit::WebPage::updatePreferences):
836         * WebProcess/WebPage/WebPage.h:
837         * WebProcess/WebPage/WebPage.messages.in:
838
839 2014-04-24  Joseph Pecoraro  <pecoraro@apple.com>
840
841         [iOS] Add some missing overrides and remove unnecessary virtuals
842         https://bugs.webkit.org/show_bug.cgi?id=132153
843
844         Reviewed by Darin Adler.
845
846         * UIProcess/ios/PageClientImplIOS.h:
847         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
848
849 2014-04-24  Tim Horton  <timothy_horton@apple.com>
850
851         WebKit2 View Gestures: Use a single struct for the snapshot, and pass it around
852         https://bugs.webkit.org/show_bug.cgi?id=132114
853
854         Reviewed by Simon Fraser.
855
856         Have only a single map in ViewSnapshotStore, from back-forward item
857         to ViewSnapshotStore::Snapshot, and return the Snapshot struct when looking
858         up snapshots (via getSnapshot()), so that future patches can persist additional
859         information along with the snapshot.
860
861         * UIProcess/ios/ViewGestureControllerIOS.mm:
862         (WebKit::ViewGestureController::beginSwipeGesture):
863         (WebKit::ViewGestureController::endSwipeGesture):
864         * UIProcess/mac/ViewGestureController.h:
865         * UIProcess/mac/ViewGestureControllerMac.mm:
866         (WebKit::ViewGestureController::retrieveSnapshotForItem):
867         (WebKit::ViewGestureController::beginSwipeGesture):
868         (WebKit::ViewGestureController::endSwipeGesture):
869         Adopt getSnapshot() instead of snapshotAndRenderTreeSize().
870         Move retrieveSnapshotForItem out into a separate function (for future use).
871
872         * UIProcess/mac/ViewSnapshotStore.h:
873         (WebKit::ViewSnapshotStore::disableSnapshotting):
874         (WebKit::ViewSnapshotStore::enableSnapshotting):
875         * UIProcess/mac/ViewSnapshotStore.mm:
876         (WebKit::ViewSnapshotStore::pruneSnapshots):
877         (WebKit::ViewSnapshotStore::recordSnapshot):
878         (WebKit::ViewSnapshotStore::getSnapshot):
879         (WebKit::ViewSnapshotStore::snapshotAndRenderTreeSize): Deleted.
880         Make Snapshot struct public.
881         Get rid of the separate map of back-forward items to render tree sizes.
882         When evicting, instead of removing the entry, clear out its snapshot image;
883         this way, we can keep other snapshot metadata around.
884
885 2014-04-24  Enrica Casucci  <enrica@apple.com>
886
887         [iOS WebKit2] Should properly handle focus redirect (keyboard state changes when focus changes).
888         https://bugs.webkit.org/show_bug.cgi?id=132136
889         <rdar://problem/16238336>
890
891         Reviewed by Benjamin Poulain.
892
893         Focusing a field from JavaScript should not make the keyboard or the select picker
894         appear unless the user has already started interacting with one of the fields in the page.
895         Adding a parameter to StartAssistingNode to indicate whether the focus change is a result
896         of a user action.
897
898         * UIProcess/PageClient.h:
899         * UIProcess/WebPageProxy.h:
900         * UIProcess/WebPageProxy.messages.in:
901         * UIProcess/ios/PageClientImplIOS.h:
902         * UIProcess/ios/PageClientImplIOS.mm:
903         (WebKit::PageClientImpl::startAssistingNode):
904         * UIProcess/ios/WKContentViewInteraction.h:
905         * UIProcess/ios/WKContentViewInteraction.mm:
906         (-[WKContentView _startAssistingNode:userIsInteracting:userObject:]):
907         * UIProcess/ios/WebPageProxyIOS.mm:
908         (WebKit::WebPageProxy::startAssistingNode):
909         * WebProcess/WebPage/WebPage.cpp:
910         (WebKit::WebPage::WebPage):
911         (WebKit::WebPage::dispatchTouchEvent):
912         * WebProcess/WebPage/WebPage.h:
913         * WebProcess/WebPage/ios/WebPageIOS.mm:
914         (WebKit::WebPage::handleTap):
915         (WebKit::WebPage::elementDidFocus):
916
917 2014-04-24  Myles C. Maxfield  <mmaxfield@apple.com>
918
919         FontCache::fontCache() never returns nullptr so it can be made to return a reference instead
920         https://bugs.webkit.org/show_bug.cgi?id=132110
921
922         Reviewed by Tim Horton.
923
924         Updates callers to use '.' instead of '->'.
925
926         No new tests are necessary because there should be no behavior change.
927
928         * WebProcess/WebProcess.cpp:
929         (WebKit::WebProcess::terminate):
930         (WebKit::WebProcess::didClose):
931         (WebKit::WebProcess::getWebCoreStatistics):
932
933 2014-04-24  Eric Carlson  <eric.carlson@apple.com>
934
935         [iOS] Manage AudioSession category according to media type
936         https://bugs.webkit.org/show_bug.cgi?id=132096
937
938         Reviewed by Jer Noble.
939
940         * WebProcess/WebPage/WebPage.cpp:
941         (WebKit::WebPage::WebPage): Tell WebCore to manage the AudioSession.
942
943 2014-04-24  Tim Horton  <timothy_horton@apple.com>
944
945         [wk2] Provide SPI allowing clients to hand events directly to swipe code, bypassing scrolling
946         https://bugs.webkit.org/show_bug.cgi?id=132092
947         <rdar://problem/15948244>
948
949         Reviewed by Darin Adler.
950
951         * UIProcess/API/Cocoa/WKViewPrivate.h:
952         * UIProcess/API/mac/WKView.mm:
953         (-[WKView _tryToSwipeWithEvent:ignoringPinnedState:]):
954         Added. Hand the event directly to ViewGestureController, optionally
955         ignoring whether or not the WKView is scrollable (always pretending that it is not).
956
957         * UIProcess/mac/ViewGestureController.h:
958         (WebKit::ViewGestureController::shouldIgnorePinnedState):
959         (WebKit::ViewGestureController::setShouldIgnorePinnedState):
960         * UIProcess/mac/ViewGestureControllerMac.mm:
961         (WebKit::ViewGestureController::ViewGestureController):
962         (WebKit::ViewGestureController::scrollEventCanBecomeSwipe):
963         (WebKit::ViewGestureController::handleScrollWheelEvent):
964         (WebKit::ViewGestureController::wheelEventWasNotHandledByWebCore):
965         (WebKit::scrollEventCanBecomeSwipe):
966         If we're ignoring the view's pinned state, pretend that we're always pinned,
967         and don't worry about sending events to WebCore.
968
969 2014-04-24  Carlos Garcia Campos  <cgarcia@igalia.com>
970
971         [GTK] wmode='transparent' for flash plugin doesn't work
972         https://bugs.webkit.org/show_bug.cgi?id=120055
973
974         Reviewed by Gustavo Noronha Silva.
975
976         Force opaque window mode for flash plugin when wmode='transparent',
977         since X11 backend doesn't support transparency. We should add
978         proper transparency support because forcing opaque window mode
979         doesn't really work. Handle this as a plugin quirk instead of
980         adding X11 specific code to WebFrameLoaderClient::createPlugin().
981
982         * Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp:
983         (WebKit::NetscapePluginModule::determineQuirks): Add
984         ForceFlashWindowlessMode quirk for flash in case of EFL platform
985         because EFL port doesn't support windowed plugins.
986         * Shared/Plugins/PluginQuirks.h: Add ForceFlashWindowlessMode X11
987         plugin quirk.
988         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
989         (WebKit::NetscapePlugin::initialize): Modify or add wmode
990         parameter for flash plugin, to force opaque window mode when
991         transparent mode is specified or when ForceFlashWindowlessMode
992         quirk is present.
993         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
994         (WebKit::WebFrameLoaderClient::createPlugin): Remove X11 specific code.
995
996 2014-04-23  Simon Fraser  <simon.fraser@apple.com>
997
998         [iOS WK2] Missing content inside long overflow-scrolling:touch 
999         https://bugs.webkit.org/show_bug.cgi?id=132105
1000
1001         Reviewed by Tim Horton.
1002         
1003         PlatformCALayerRemote needs to track bounds origin as well as size,
1004         since iOS uses bounds origin for overflow scrolling.
1005
1006         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
1007         (WebKit::applyPropertiesToLayer):
1008         * Shared/mac/RemoteLayerTreeTransaction.h:
1009         * Shared/mac/RemoteLayerTreeTransaction.mm:
1010         (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
1011         (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
1012         (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
1013         (WebKit::dumpChangedLayers):
1014         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
1015         (WebKit::PlatformCALayerRemote::updateBackingStore):
1016         (WebKit::PlatformCALayerRemote::bounds):
1017         (WebKit::PlatformCALayerRemote::setBounds):
1018
1019 2014-04-23  Andreas Kling  <akling@apple.com>
1020
1021         Remove unused WKPageSetMemoryCacheClientCallsEnabled API.
1022         <https://webkit.org/b/132098>
1023
1024         This API was added to WK2 back in 2011 but never actually used.
1025
1026         Reviewed by Anders Carlsson.
1027
1028         * Shared/WebPageCreationParameters.cpp:
1029         (WebKit::WebPageCreationParameters::encode):
1030         (WebKit::WebPageCreationParameters::decode):
1031         * Shared/WebPageCreationParameters.h:
1032         * UIProcess/API/C/WKPage.cpp:
1033         (WKPageSetMemoryCacheClientCallsEnabled): Deleted.
1034         * UIProcess/API/C/WKPage.h:
1035         * UIProcess/WebPageProxy.cpp:
1036         (WebKit::WebPageProxy::WebPageProxy):
1037         (WebKit::WebPageProxy::creationParameters):
1038         (WebKit::WebPageProxy::setMemoryCacheClientCallsEnabled): Deleted.
1039         * UIProcess/WebPageProxy.h:
1040         * WebProcess/WebPage/WebPage.cpp:
1041         (WebKit::WebPage::WebPage):
1042         (WebKit::WebPage::setMemoryCacheMessagesEnabled): Deleted.
1043         * WebProcess/WebPage/WebPage.h:
1044         * WebProcess/WebPage/WebPage.messages.in:
1045
1046 2014-04-23  Simon Fraser  <simon.fraser@apple.com>
1047
1048         [iOS WK2] Make -webkit-overflow-scrolling:touch work
1049         https://bugs.webkit.org/show_bug.cgi?id=132097
1050
1051         Reviewed by Tim Horton.
1052         
1053         Scrolling of UIScrollViews in content (for -webkit-overflow-scrolling:touch)
1054         depends on them getting hit-tested correctly. UIKit hit testing assumes
1055         that subviews are enclosed by their ancestors, but this is not true of
1056         web content. In addition, we had a root layer that was zero sized.
1057         
1058         Fix by overriding hitTest:withEvent: on our content WKViews to hit
1059         test subviews even if they are not enclosed.
1060
1061         * UIProcess/ios/RemoteLayerTreeHostIOS.mm:
1062         (-[UIView _recursiveFindDescendantViewAtPoint:withEvent:]):
1063         (-[UIView _findDescendantViewAtPoint:withEvent:]):
1064         (-[WKCompositingView hitTest:withEvent:]):
1065         (-[WKTransformView hitTest:withEvent:]):
1066         (-[WKRemoteView hitTest:withEvent:]):
1067         (WebKit::RemoteLayerTreeHost::createLayer):
1068         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
1069         (WebKit::RemoteLayerTreeDrawingArea::updatePreferences):
1070         Update debug borders on the root layer.
1071         (WebKit::RemoteLayerTreeDrawingArea::mainFrameContentSizeChanged):
1072         Size the root layer to the contents size. This isn't strictly necessary
1073         given the hit testing overrides, but seems sensible to do anyway.
1074
1075 2014-04-23  Simon Fraser  <simon.fraser@apple.com>
1076
1077         Nonopaque layers double-paint with UI-side compositing
1078         https://bugs.webkit.org/show_bug.cgi?id=132101
1079
1080         Reviewed by Tim Horton.
1081         
1082         The non-IOSurface code path was failing to clear the backing store
1083         before painting.
1084
1085         * Shared/mac/RemoteLayerBackingStore.mm:
1086         (WebKit::RemoteLayerBackingStore::display):
1087         (WebKit::RemoteLayerBackingStore::drawInContext):
1088
1089 2014-04-23  Benjamin Poulain  <bpoulain@apple.com>
1090
1091         [iOS][WK2] Image and text documents sometime gets the webpage viewport configuration
1092         https://bugs.webkit.org/show_bug.cgi?id=132099
1093
1094         Reviewed by Tim Horton.
1095
1096         When didReceiveMobileDocType(), if the doctype was not XHTML mobile, we were setting
1097         the viewport configuration to webpageParameters(). This is obviously not correct for
1098         Image and Text documents.
1099
1100         This patch moves the code deciding the default configuration out of WebPage::didCommitLoad()
1101         and use it from WebPage::didCommitLoad() and WebPage::didReceiveMobileDocType().
1102
1103         * WebProcess/WebPage/WebPage.cpp:
1104         (WebKit::WebPage::didCommitLoad):
1105         * WebProcess/WebPage/WebPage.h:
1106         * WebProcess/WebPage/ios/WebPageIOS.mm:
1107         (WebKit::WebPage::didReceiveMobileDocType):
1108         (WebKit::WebPage::resetViewportDefaultConfiguration):
1109
1110 2014-04-23  Benjamin Poulain  <bpoulain@apple.com>
1111
1112         [iOS][WK2] Fix a few mistakes affecting the initial layout and the initial unobscured rect
1113         https://bugs.webkit.org/show_bug.cgi?id=132093
1114         <rdar://problem/16703237>
1115
1116         Reviewed by Tim Horton.
1117
1118         The user of WKWebView can setup a size on device pixels, which can add half a point to the minimum
1119         layout size. By rounding this up before applying the page scale, we ended up with rounding errors
1120         on the layout size and the transitory unobscured content rect.
1121
1122         This patch fixes changes the minimal layout size to float point values to reduce the rounding problems.
1123
1124         * UIProcess/API/Cocoa/WKWebView.mm:
1125         (setViewportConfigurationMinimumLayoutSize):
1126         (-[WKWebView _setMinimumLayoutSizeOverrideForMinimalUI:]):
1127         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
1128         * UIProcess/WebPageProxy.h:
1129         * UIProcess/ios/WebPageProxyIOS.mm:
1130         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
1131         (WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSize):
1132         (WebKit::WebPageProxy::setMinimumLayoutSizeForMinimalUI):
1133
1134         * WebProcess/WebPage/WebPage.cpp:
1135         (WebKit::WebPage::didCommitLoad):
1136         Defaulting the content size to the minimum layout size only works if the initial-scale is 1.
1137         ViewportConfiguration knows exactly what to do before the first layout.
1138
1139         * WebProcess/WebPage/WebPage.h:
1140         * WebProcess/WebPage/WebPage.messages.in:
1141         * WebProcess/WebPage/ios/WebPageIOS.mm:
1142         (WebKit::WebPage::setViewportConfigurationMinimumLayoutSize):
1143         (WebKit::WebPage::setMinimumLayoutSizeForMinimalUI):
1144         (WebKit::WebPage::dynamicViewportSizeUpdate):
1145         A few fixes here:
1146         -setZoomedOutPageScaleFactor() was incorrectly using the initial scale. 99% of the time, initial scale
1147          and minimum scale are equal, but the page can specify something different with the viewport meta tag.
1148         -Use floating point for manipulating the minimum layout sizes, then round the value.
1149         -minimumLayoutSizeInDocumentCoordinate was scaled the wrong way around.
1150
1151         (WebKit::WebPage::viewportConfigurationChanged):
1152
1153 2014-04-23  Yongjun Zhang  <yongjun_zhang@apple.com>
1154
1155         Support encoding/decoding NSUInteger arguments in WKRemoteObjectCoder.
1156         https://bugs.webkit.org/show_bug.cgi?id=132040
1157
1158         Add support for encoding/decoding NSUInteger arguments.
1159
1160         Reviewed by Sam Weinig.
1161
1162         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
1163         (encodeInvocation):
1164         (decodeInvocationArguments):
1165
1166 2014-04-22  Ryosuke Niwa  <rniwa@webkit.org>
1167
1168         Cursor doesn't change back to pointer when leaving the Safari window
1169         https://bugs.webkit.org/show_bug.cgi?id=132038
1170
1171         Reviewed by Alexey Proskuryakov.
1172
1173         Since the cursor type is now updated asynchronously after r147739,
1174         [window windowNumber] != [NSWindow windowNumberAtPoint:[NSEvent mouseLocation] belowWindowWithWindowNumber:0]
1175         evalutes to false depending on how fast cursor is moving.
1176
1177         Instead, check whether the NSWindow of the WebView is the key window or not since
1178         key window appears to control the cursor style in Cocoa as far as I've tested:
1179         https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/WinPanel/Concepts/ChangingMainKeyWindow.html
1180
1181         * UIProcess/mac/PageClientImpl.mm:
1182         (WebKit::PageClientImpl::setCursor):
1183
1184 2014-04-22  Yongjun Zhang  <yongjun_zhang@apple.com>
1185
1186         Add SPI to expose provisional URL from Frame.
1187         https://bugs.webkit.org/show_bug.cgi?id=132014
1188
1189         Add methods to return the provisional URL from WKWebProcessPlugInFrame.
1190
1191         Reviewed by Dan Bernstein.
1192
1193         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
1194         (-[WKWebProcessPlugInFrame _provisionalURL]):
1195         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFramePrivate.h:
1196
1197 2014-04-22  Benjamin Poulain  <bpoulain@apple.com>
1198
1199         [iOS][WK2] Split iOS touch event dispatch for the regular touch event dispatch
1200         https://bugs.webkit.org/show_bug.cgi?id=132033
1201
1202         Reviewed by Simon Fraser.
1203
1204         The generic touch event dispatching does not work well with iOS gesture recognizers.
1205         Some events are required to be synchronous, while other needs can be asynchronous and
1206         can even use event coalescing. We only need UI callback for the synchronous events.
1207
1208         Previously, that was implemented by changing the property ShouldSendEventsSynchronously
1209         on WebPageProxy. That is causing issues when synchronous events are sent right after asynchronous
1210         events because the responses in WebPageProxy::didReceiveEvent() easily get out of order.
1211
1212         This patch completely split the UIGestureRecognizerDispatching from the normal asynchronous event dispatching.
1213
1214         Synchronous events are sent directly to the WebProcess and report the result to the PageClient right away.
1215
1216         Asynchronous events are sent to the EventDispatcher where they are coalesced until the main thread is free
1217         to process events.
1218
1219         There can be a race where a synchronous event comes before the asynchronous events are processed. In that case,
1220         the synchronous event handler starts by getting the events out of the EventDispatcher and dispatch them first.
1221
1222         * Shared/NativeWebTouchEvent.h:
1223         (WebKit::NativeWebTouchEvent::uniqueId): Deleted.
1224         * Shared/ios/NativeWebTouchEventIOS.mm:
1225         (WebKit::NativeWebTouchEvent::NativeWebTouchEvent):
1226         * UIProcess/WebPageProxy.cpp:
1227         (WebKit::WebPageProxy::handleSynchronousTouchEvent):
1228         (WebKit::WebPageProxy::sendAsynchronousTouchEvent):
1229         (WebKit::WebPageProxy::didReceiveEvent):
1230         (WebKit::WebPageProxy::resetStateAfterProcessExited):
1231         * UIProcess/WebPageProxy.h:
1232         * UIProcess/ios/WKContentViewInteraction.h:
1233         * UIProcess/ios/WKContentViewInteraction.mm:
1234         (-[WKContentView _webTouchEventsRecognized:]):
1235         (-[WKContentView _webTouchEvent:WebKit::preventsNativeGestures:]):
1236         * WebProcess/WebPage/EventDispatcher.cpp:
1237         (WebKit::EventDispatcher::EventDispatcher):
1238         (WebKit::EventDispatcher::clearQueuedTouchEventsForPage):
1239         (WebKit::EventDispatcher::getQueuedTouchEventsForPage):
1240         (WebKit::EventDispatcher::touchEvent):
1241         (WebKit::EventDispatcher::dispatchTouchEvents):
1242         * WebProcess/WebPage/EventDispatcher.h:
1243         * WebProcess/WebPage/EventDispatcher.messages.in:
1244         * WebProcess/WebPage/WebPage.cpp:
1245         (WebKit::WebPage::dispatchTouchEvent):
1246         (WebKit::WebPage::touchEventSync):
1247         (WebKit::WebPage::touchEvent):
1248         (WebKit::WebPage::touchEventSyncForTesting):
1249         (WebKit::WebPage::didCommitLoad):
1250         * WebProcess/WebPage/WebPage.h:
1251         * WebProcess/WebPage/WebPage.messages.in:
1252         * WebProcess/WebPage/ios/WebPageIOS.mm:
1253         (WebKit::WebPage::dispatchAsynchronousTouchEventsQueue):
1254
1255 2014-04-22  Chris Fleizach  <cfleizach@apple.com>
1256
1257         AX: iOS hit-testing does not work when page is zoomed
1258         https://bugs.webkit.org/show_bug.cgi?id=132013
1259
1260         Reviewed by Simon Fraser.
1261
1262         Implement accessibilityHitTest so that the point can be converted correctly.
1263
1264         * WebProcess/WebPage/WKAccessibilityWebPageObjectIOS.mm:
1265         (-[WKAccessibilityWebPageObject accessibilityHitTest:]):
1266
1267 2014-04-22  Commit Queue  <commit-queue@webkit.org>
1268
1269         Unreviewed, rolling out r167674.
1270         https://bugs.webkit.org/show_bug.cgi?id=132025
1271
1272         Going a different way with this (Requested by bradee-oh on
1273         #webkit).
1274
1275         Reverted changeset:
1276
1277         "Change Image Controls replacement to use selection and paste"
1278         https://bugs.webkit.org/show_bug.cgi?id=131992
1279         http://trac.webkit.org/changeset/167674
1280
1281 2014-04-22  Joseph Pecoraro  <pecoraro@apple.com>
1282
1283         Remove unused local variable
1284         https://bugs.webkit.org/show_bug.cgi?id=132020
1285
1286         Reviewed by Alexey Proskuryakov.
1287
1288         * UIProcess/ios/forms/WKFormSelectPopover.mm:
1289         (-[WKSelectPopover initWithView:hasGroups:]):
1290
1291 2014-04-22  Brady Eidson  <beidson@apple.com>
1292
1293         Change Image Controls replacement to use selection and paste
1294         <rdar://problem/16302722> and https://bugs.webkit.org/show_bug.cgi?id=131992
1295
1296         Reviewed by Tim Horton.
1297
1298         * UIProcess/mac/WebContextMenuProxyMac.mm:
1299         (-[WKSharingServicePickerDelegate sharingService:didShareItems:]): Write the
1300           replacement data to a special pasteboard, then replace the current selection from
1301           that pasteboard.
1302
1303         Remove all other code used to support the old replacement mechanism:
1304         * UIProcess/WebPageProxy.cpp:
1305         (WebKit::WebPageProxy::replaceControlledImage): Deleted.
1306         * UIProcess/WebPageProxy.h:
1307         * UIProcess/mac/WebContextMenuProxyMac.h:
1308         (WebKit::WebContextMenuProxyMac::page):
1309         (WebKit::WebContextMenuProxyMac::replaceControlledImage): Deleted.
1310         * WebProcess/WebPage/WebContextMenu.cpp:
1311         (WebKit::WebContextMenu::replaceControlledImage): Deleted.
1312         * WebProcess/WebPage/WebContextMenu.h:
1313         * WebProcess/WebPage/WebPage.cpp:
1314         (WebKit::WebPage::replaceControlledImage): Deleted.
1315         * WebProcess/WebPage/WebPage.h:
1316         * WebProcess/WebPage/WebPage.messages.in:
1317
1318 2014-04-22  Eunmi Lee  <eunmi15.lee@samsung.com>
1319
1320         [EFL][WK2] Remove duplicated code to set size to the DrawingArea.
1321         https://bugs.webkit.org/show_bug.cgi?id=131972
1322
1323         Reviewed by Andreas Kling.
1324
1325         DrawingArea's size is set in the WebView.cpp when EwkView's size is
1326         changed, so we don't have to set again in the PageViewportController.
1327
1328         * UIProcess/CoordinatedGraphics/PageViewportController.cpp:
1329         (WebKit::PageViewportController::didChangeViewportSize):
1330
1331 2014-04-22  Tim Horton  <timothy_horton@apple.com>
1332
1333         WKThumbnailView doesn't quite work with topContentInset
1334         https://bugs.webkit.org/show_bug.cgi?id=131976
1335         <rdar://problem/16642127>
1336
1337         Reviewed by Darin Adler.
1338
1339         * UIProcess/API/Cocoa/_WKThumbnailView.mm:
1340         (-[_WKThumbnailView initWithFrame:fromWKView:]):
1341         _WKThumbnailView always needs a layer.
1342         We don't want to use snapshots by default, this was debugging accidentally landed in the last change.
1343
1344         (-[_WKThumbnailView _requestSnapshotIfNeeded]):
1345         Don't request a new snapshot if the scale is the same as the existing one.
1346         Reduce the height of the snapshot by the topContentInset.
1347         Having the origin at (0, 0) is still correct, as the inset content is in negative Y space,
1348         and (0, 0) is the true origin of the content.
1349
1350         (-[_WKThumbnailView setScale:]):
1351         When not snapshotting, we've decided that WKThumbnailView should apply the scale to the WKView layer tree,
1352         instead of depending on clients to do so.
1353
1354         (-[_WKThumbnailView setUsesSnapshot:]):
1355         We *do* need to apply thumbnail scale in the web process even when snapshotting,
1356         because we use the live layer tree temporarily while waiting for the asynchronous
1357         snapshot to return. This was a misstep in the last thumbnail view patch.
1358
1359 2014-04-22  Shivakumar JM  <shiva.jm@samsung.com>
1360
1361         [WebKit2] Cleanup the build from unused parameter in WebProcess Module 
1362         https://bugs.webkit.org/show_bug.cgi?id=131970
1363
1364         Reviewed by Darin Adler.
1365
1366         Fix a build warning by removing the parameters in function paintLayerContents() to fix build warning.
1367
1368         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
1369         (WebKit::CoordinatedLayerTreeHost::paintLayerContents):
1370
1371 2014-04-22  Carlos Garcia Campos  <cgarcia@igalia.com>
1372
1373         [GTK] Crash after getting web view context property with g_object_get
1374         https://bugs.webkit.org/show_bug.cgi?id=131983
1375
1376         Reviewed by Philippe Normand.
1377
1378         The problem is that the getter is using g_value_take_object() and
1379         the default context is destroyed when the caller releases its ref.
1380
1381         * UIProcess/API/gtk/WebKitWebView.cpp:
1382         (webkitWebViewGetProperty): Use g_value_set_object() instead of
1383         g_value_take_object().
1384
1385 2014-04-22  Ryuan Choi  <ryuan.choi@samsung.com>
1386
1387         [EFL][WK2] Remove unnecessary includes in files of Source/WebKit2/UIProcess/API/efl
1388         https://bugs.webkit.org/show_bug.cgi?id=131979
1389
1390         Reviewed by Gyuyoung Kim.
1391
1392         Removed unnecessary includes of header files.
1393         In addition, tried to use forward declarations.
1394
1395         * UIProcess/API/efl/EwkView.cpp:
1396         * UIProcess/API/efl/EwkView.h:
1397         * UIProcess/API/efl/EwkViewCallbacks.h:
1398         * UIProcess/API/efl/GestureRecognizer.h:
1399         * UIProcess/API/efl/ewk_context_menu_item_private.h:
1400         * UIProcess/API/efl/ewk_context_menu_private.h:
1401         * UIProcess/API/efl/ewk_download_job.cpp:
1402         * UIProcess/API/efl/ewk_download_job_private.h:
1403         * UIProcess/API/efl/ewk_form_submission_request.cpp:
1404         * UIProcess/API/efl/ewk_form_submission_request_private.h:
1405         * UIProcess/API/efl/ewk_navigation_data.cpp:
1406         * UIProcess/API/efl/ewk_navigation_data_private.h:
1407         * UIProcess/API/efl/ewk_page_group_private.h:
1408         * UIProcess/API/efl/ewk_popup_menu_private.h:
1409         * UIProcess/API/efl/ewk_view.cpp:
1410         * UIProcess/API/efl/ewk_window_features_private.h:
1411         * UIProcess/efl/PageUIClientEfl.cpp:
1412         * UIProcess/efl/ViewClientEfl.cpp:
1413
1414 2014-04-21  Tim Horton  <timothy_horton@apple.com>
1415
1416         [wk2] Don't send intrinsic content size updates with dirty layout
1417         https://bugs.webkit.org/show_bug.cgi?id=131964
1418         <rdar://problem/14292718>
1419
1420         Reviewed by Simon Fraser.
1421
1422         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
1423         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1424         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
1425         (WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
1426         (WebKit::TiledCoreAnimationDrawingArea::updateIntrinsicContentSizeIfNeeded):
1427         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
1428         (WebKit::TiledCoreAnimationDrawingArea::updateGeometry):
1429         (WebKit::TiledCoreAnimationDrawingArea::updateIntrinsicContentSizeTimerFired): Deleted.
1430         Instead of using a timer (which can fire while layout is dirty) to coalesce
1431         intrinsic content size changes, send them only from flushLayers, just after updating layout.
1432         This ensures that we never get intermediate intrinsic content sizes that won't be painted.
1433
1434 2014-04-21  Tim Horton  <timothy_horton@apple.com>
1435
1436         Remove a unnecessary forward-declared class from TiledCoreAnimationDrawingArea.
1437
1438         Rubber-stamped by Simon Fraser.
1439
1440         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
1441
1442 2014-04-21  Simon Fraser  <simon.fraser@apple.com>
1443
1444         Don't try to use a null connection()->xpcConnection()
1445         https://bugs.webkit.org/show_bug.cgi?id=131961
1446
1447         Reviewed by Dan Bernstein.
1448         
1449         If running with -WebKit2UseXPCServiceForWebProcess NO, connection()->xpcConnection()
1450         is null and xpc_connection_get_pid() would crash, so null-check the xpcConnection.
1451
1452         * UIProcess/Network/NetworkProcessProxy.cpp:
1453         (WebKit::NetworkProcessProxy::didFinishLaunching):
1454
1455 2014-04-21  Dan Bernstein  <mitz@apple.com>
1456
1457         WebKit part of <rdar://problem/16631323> Page::setDefersLoading doesn’t do anything when using the Network process
1458         https://bugs.webkit.org/show_bug.cgi?id=131939
1459
1460         Reviewed by David Kilzer.
1461
1462         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1463         (WebKit::NetworkConnectionToWebProcess::setDefersLoading): Added. Forwards the message to
1464         the NetworkResourceLoader. 
1465         * NetworkProcess/NetworkConnectionToWebProcess.h:
1466
1467         * NetworkProcess/NetworkConnectionToWebProcess.messages.in: Added SetDefersLoading message.
1468
1469         * NetworkProcess/NetworkResourceLoader.cpp:
1470         (WebKit::NetworkResourceLoader::NetworkResourceLoader): Initialize new member variable
1471         m_defersLoading from the new field in the loader parameters.
1472         (WebKit::NetworkResourceLoader::start): Added. Like WebCore::ResourceLoader, if loading is
1473         deferred, keep the request in m_deferredRequest and bail out.
1474         (WebKit::NetworkResourceLoader::setDefersLoading): Added. Similar to
1475         WebCore::ResourceLoader::setDefersLoading.
1476         * NetworkProcess/NetworkResourceLoader.h:
1477         (WebKit::NetworkResourceLoader::defersLoading): 
1478
1479         * Shared/Network/NetworkResourceLoadParameters.cpp:
1480         (WebKit::NetworkResourceLoadParameters::NetworkResourceLoadParameters): Initialize new field
1481         defersLoading to false.
1482         (WebKit::NetworkResourceLoadParameters::encode): Encode new field.
1483         (WebKit::NetworkResourceLoadParameters::decode): Decode new field.
1484         * Shared/Network/NetworkResourceLoadParameters.h: Added defersLoading field.
1485
1486         * WebProcess/Network/WebResourceLoadScheduler.cpp:
1487         (WebKit::WebResourceLoadScheduler::scheduleLoad): Populate defersLoading field in the load
1488         parameters.
1489         (WebKit::WebResourceLoadScheduler::setDefersLoading): Send a message to the Network process.
1490         * WebProcess/Network/WebResourceLoadScheduler.h:
1491
1492 2014-04-21  Anders Carlsson  <andersca@apple.com>
1493
1494         Errors passed to delegate methods should have recovery attempters
1495         https://bugs.webkit.org/show_bug.cgi?id=131957
1496         <rdar://problem/16642539>
1497
1498         Reviewed by Tim Horton.
1499
1500         * UIProcess/API/Cocoa/_WKErrorRecoveryAttempting.h: Added.
1501         * UIProcess/API/Cocoa/_WKErrorRecoveryAttempting.mm: Added.
1502         * UIProcess/Cocoa/NavigationState.mm:
1503         (WebKit::createErrorWithRecoveryAttempter):
1504         (WebKit::NavigationState::LoaderClient::didFailProvisionalLoadWithErrorForFrame):
1505         (WebKit::NavigationState::LoaderClient::didFailLoadWithErrorForFrame):
1506         * UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.h: Added.
1507         * UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm: Added.
1508         (-[WKReloadFrameErrorRecoveryAttempter initWithWebView:frameHandle:urlString:]):
1509         (-[WKReloadFrameErrorRecoveryAttempter attemptRecovery]):
1510         * WebKit2.xcodeproj/project.pbxproj:
1511
1512 2014-04-21  Eric Carlson  <eric.carlson@apple.com>
1513
1514         [Mac] implement WebKitDataCue
1515         https://bugs.webkit.org/show_bug.cgi?id=131799
1516
1517         Reviewed by Dean Jackson.
1518
1519         * Configurations/FeatureDefines.xcconfig: Define ENABLE_DATACUE_VALUE.
1520
1521 2014-04-21  Beth Dakin  <bdakin@apple.com>
1522
1523         topContentInset does not play well with fullscreen elements
1524         https://bugs.webkit.org/show_bug.cgi?id=131955
1525         -and corresponding-
1526         <rdar://problem/16651925>
1527
1528         Reviewed by Sam Weinig.
1529
1530         If you take an element (such as a <video>) fullscreen when you have a 
1531         topContentInset set, there will be an inset-sized gap at the top of the fullscreen 
1532         video.
1533
1534         Save and restore the topContentInset whenever the scroll position is saved and 
1535         restored.
1536         * WebProcess/FullScreen/WebFullScreenManager.cpp:
1537         (WebKit::WebFullScreenManager::WebFullScreenManager):
1538         (WebKit::WebFullScreenManager::saveScrollPosition):
1539         (WebKit::WebFullScreenManager::restoreScrollPosition):
1540         * WebProcess/FullScreen/WebFullScreenManager.h:
1541
1542 2014-04-21  Gavin Barraclough  <baraclough@apple.com>
1543
1544         Don't use ProcessAssertion on simulator
1545         https://bugs.webkit.org/show_bug.cgi?id=131950
1546
1547         Rubber stamped by Enrica Casucci
1548
1549         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1550         (WebKit::connectToService):
1551         * UIProcess/ios/ProcessAssertion.h:
1552
1553 2014-04-21  Enrica Casucci  <enrica@apple.com>
1554
1555         [iOS WebKit2] support replacements for misspelled words.
1556         https://bugs.webkit.org/show_bug.cgi?id=131827
1557         <rdar://problem/16319657>
1558
1559         Reviewed by Darin Adler.
1560
1561         This is the second a final piece to support replacements.
1562         It adds some entrypoints used by the keyboard code to perform
1563         replacement when reaching the edge of a word using backspace.
1564         I've modified the behavior of replaceSelectedText to work both
1565         with caret or range selections.
1566
1567         * Shared/EditorState.cpp:
1568         (WebKit::EditorState::encode):
1569         (WebKit::EditorState::decode):
1570         * Shared/EditorState.h:
1571         (WebKit::EditorState::EditorState):
1572         * UIProcess/ios/WKContentViewInteraction.mm:
1573         (-[WKContentView isReplaceAllowed]):
1574         (-[WKContentView _characterBeforeCaretSelection]):
1575         * WebProcess/WebPage/WebPage.cpp:
1576         (WebKit::WebPage::editorState):
1577         * WebProcess/WebPage/ios/WebPageIOS.mm:
1578         (WebKit::WebPage::replaceSelectedText):
1579
1580 2014-04-21  Gavin Barraclough  <baraclough@apple.com>
1581
1582         Don't use ProcessAssertion on simulator
1583         https://bugs.webkit.org/show_bug.cgi?id=131950
1584
1585         Rubber stamped by Benjamin Poulain
1586
1587         * UIProcess/ios/ProcessAssertion.mm:
1588         (WebKit::ProcessAssertion::ProcessAssertion):
1589         (WebKit::ProcessAssertion::setState):
1590
1591 2014-04-21  Anders Carlsson  <andersca@apple.com>
1592
1593         Another build fix.
1594
1595         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
1596         (WebKit::XPCServiceInitializerDelegate::checkEntitlements):
1597
1598 2014-04-21  Anders Carlsson  <andersca@apple.com>
1599
1600         Build fix.
1601
1602         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
1603         (WebKit::XPCServiceInitializer):
1604
1605 2014-04-21  Tim Horton  <timothy_horton@apple.com>
1606
1607         [iOS WebKit2] Implement CSS viewport units
1608         https://bugs.webkit.org/show_bug.cgi?id=131863
1609         <rdar://problem/16279088>
1610
1611         Reviewed by Darin Adler.
1612
1613         * UIProcess/API/Cocoa/WKWebView.mm:
1614         (setMinimumLayoutSizeForMinimalUI):
1615         (-[WKWebView _minimumLayoutSizeOverrideForMinimalUI]):
1616         (-[WKWebView _setMinimumLayoutSizeOverrideForMinimalUI:]):
1617         Add _setMinimumLayoutSizeOverrideForMinimalUI:, which pushes said size
1618         down from the client to WebPageIOS, below.
1619
1620         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1621         * UIProcess/WebPageProxy.h:
1622         * UIProcess/ios/WebPageProxyIOS.mm:
1623         (WebKit::WebPageProxy::setMinimumLayoutSizeForMinimalUI):
1624         * WebProcess/WebPage/WebPage.h:
1625         * WebProcess/WebPage/WebPage.messages.in:
1626         * WebProcess/WebPage/ios/WebPageIOS.mm:
1627         (WebKit::WebPage::setMinimumLayoutSizeForMinimalUI):
1628         (WebKit::WebPage::viewportConfigurationChanged):
1629         Update FrameView's viewport size based on the minimum layout size for minimal UI (if we have it)
1630         or the normal minimum layout size, scaled to the page's initial scale.
1631
1632 2014-04-21  Benjamin Poulain  <bpoulain@apple.com>
1633
1634         [iOS][WK2] Fix the dynamic viewport update when the viewport's max-scale conflict with the transition
1635         https://bugs.webkit.org/show_bug.cgi?id=131884
1636
1637         Reviewed by Darin Adler.
1638
1639         <rdar://problem/16667291>
1640
1641         * UIProcess/API/Cocoa/WKWebView.mm:
1642         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
1643         It is fairly common to have a viewport configuration with min-scale=1 and max-scale=1.
1644         Since we were only changing the minimumScale for the transition, the target scale was affected
1645         by max-scale. This was breaking the transition from portrait to landscale.
1646
1647 2014-04-21  Benjamin Poulain  <bpoulain@apple.com>
1648
1649         [iOS][WK2] Make dynamic viewport size update content aware
1650         https://bugs.webkit.org/show_bug.cgi?id=131874
1651
1652         Reviewed by Tim Horton.
1653
1654         When possible, adjust the scroll position based on the content on dynamic viewport resize.
1655
1656         * WebProcess/WebPage/WebPage.cpp:
1657         (WebKit::WebPage::WebPage):
1658         (WebKit::WebPage::scalePage):
1659         (WebKit::WebPage::pageDidScroll):
1660         * WebProcess/WebPage/WebPage.h:
1661         The scrolling heuristic are not invertible, especially the content heuristic. To have the right
1662         behavior when doing resize without changing the page, we save the old scroll position and restore
1663         it when the content size and scale is restored.
1664
1665         * WebProcess/WebPage/ios/WebPageIOS.mm:
1666         (WebKit::WebPage::dynamicViewportSizeUpdate):
1667         On dynamic update, start by finding what node is at the center of the screen. After the layout, put that
1668         node back in the center.
1669
1670         (WebKit::WebPage::updateVisibleContentRects):
1671
1672 2014-04-21  Anders Carlsson  <andersca@apple.com>
1673
1674         Need default WKNavigationDelegate behavior
1675         https://bugs.webkit.org/show_bug.cgi?id=131944
1676         <rdar://problem/15949822>
1677
1678         Reviewed by Dan Bernstein.
1679
1680         Port the WebKit1 default delegate behavior over.
1681
1682         * UIProcess/Cocoa/NavigationState.mm:
1683         (WebKit::NavigationState::PolicyClient::decidePolicyForNavigationAction):
1684         (WebKit::NavigationState::PolicyClient::decidePolicyForResponse):
1685
1686 2014-04-21  Dan Bernstein  <mitz@apple.com>
1687
1688         [Cocoa] Expose WebPage::setDefersLoading
1689         https://bugs.webkit.org/show_bug.cgi?id=131943
1690
1691         Reviewed by Anders Carlsson, but he doesn’t like this.
1692
1693         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
1694         (-[WKWebProcessPlugInBrowserContextController _defersLoading]): Added this accessor.
1695         (-[WKWebProcessPlugInBrowserContextController _setDefersLoading:]): Ditto.
1696         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:
1697         Declared new property _defersLoading.
1698
1699         * WebProcess/WebPage/WebPage.cpp:
1700         (WebKit::WebPage::defersLoading): Added this getter.
1701         * WebProcess/WebPage/WebPage.h:
1702
1703 2014-04-21  Joseph Pecoraro  <pecoraro@apple.com>
1704
1705         Remove unused WebKitSystemInterface functions
1706         https://bugs.webkit.org/show_bug.cgi?id=131938
1707
1708         Reviewed by Alexey Proskuryakov.
1709
1710         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
1711         (InitWebCoreSystemInterface):
1712
1713 2014-04-21  Anders Carlsson  <andersca@apple.com>
1714
1715         Check the com.apple.security.network.client entitlement for all processes
1716         https://bugs.webkit.org/show_bug.cgi?id=131942
1717         <rdar://problem/12354188>
1718
1719         Reviewed by Dan Bernstein.
1720
1721         * NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm:
1722         (WebKit::NetworkServiceInitializerDelegate::NetworkServiceInitializerDelegate):
1723         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
1724         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
1725         (WebKit::XPCServiceInitializerDelegate::checkEntitlements):
1726
1727 2014-04-20  Dan Bernstein  <mitz@apple.com>
1728
1729         [Cocoa] Remove interfaces in the To Be Removed groups
1730         https://bugs.webkit.org/show_bug.cgi?id=131925
1731
1732         Reviewed by Darin Adler.
1733
1734         * Shared/API/Cocoa/WKRemoteObjectInterface.h: Removed.
1735         * Shared/API/Cocoa/WKRemoteObjectInterface.mm: Removed.
1736         * Shared/API/Cocoa/WKRemoteObjectRegistry.h: Removed.
1737         * Shared/API/Cocoa/WKRemoteObjectRegistry.mm: Removed.
1738         * UIProcess/API/Cocoa/WKProcessPool.mm:
1739         * UIProcess/API/Cocoa/WKProcessPoolConfiguration.h: Removed.
1740         * UIProcess/API/Cocoa/WKProcessPoolConfiguration.mm: Removed.
1741         * UIProcess/API/Cocoa/WKProcessPoolConfigurationPrivate.h: Removed.
1742         * UIProcess/API/Cocoa/WKProcessPoolToBeRemoved.mm: Removed.
1743         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
1744         * WebKit2.xcodeproj/project.pbxproj:
1745         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInBrowserContextControllerToBeRemoved.mm: Removed.
1746         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:
1747
1748 2014-04-20  Dan Bernstein  <mitz@apple.com>
1749
1750         [Cocoa] Crash when setting a bundle parameter to nil
1751         https://bugs.webkit.org/show_bug.cgi?id=131917
1752
1753         Reviewed by Sam Weinig.
1754
1755         * UIProcess/API/Cocoa/WKProcessPool.mm:
1756         (-[WKProcessPool _setObject:forBundleParameter:]): If the object is nil, use
1757         -[NSMutableDictionary removeObjectForKey:] rather than -setObject:forKey:.
1758
1759         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessBundleParameters.mm:
1760         (-[WKWebProcessBundleParameters setParameter:forKey:]): Ditto.
1761
1762         * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
1763         (WebKit::InjectedBundle::setBundleParameter): Unrelatedly, create m_bundleParameters if
1764         needed, as it may have not been created on intialization if no bundle parameters were set
1765         at the time.
1766
1767 2014-04-20  Dan Bernstein  <mitz@apple.com>
1768
1769         [Cocoa] Remove unused -webView:didFinishLoadingNavigation: delegate method
1770         https://bugs.webkit.org/show_bug.cgi?id=131914
1771
1772         Reviewed by Sam Weinig.
1773
1774         * UIProcess/Cocoa/NavigationState.h: Removed flag from m_navigationDelegateMethods struct.
1775         * UIProcess/Cocoa/NavigationState.mm:
1776         (WebKit::NavigationState::setNavigationDelegate): Removed check for whether the method is
1777         implemented.
1778         (WebKit::NavigationState::LoaderClient::didFinishLoadForFrame): Stopped calling the method
1779         if implemented.
1780
1781 2014-04-19  Anders Carlsson  <andersca@apple.com>
1782
1783         Plug-in process crashes if NP_Initialize returns an error the second time it's called
1784         https://bugs.webkit.org/show_bug.cgi?id=131903
1785         <rdar://problem/14355462>
1786
1787         Reviewed by Sam Weinig.
1788
1789         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
1790         (WebKit::NetscapePluginModule::decrementLoadCount):
1791         Don't try to unload the plug-in if it hasn't been initialized.
1792
1793 2014-04-19  Simon Fraser  <simon.fraser@apple.com>
1794
1795         [UI-side compositing] Implement blend modes
1796         https://bugs.webkit.org/show_bug.cgi?id=131891
1797         <rdar://problem/16490085>
1798
1799         Reviewed by Tim Horton.
1800
1801         Implement blend modes with UI-side compositing.
1802         
1803         PlatformCALayer::setBlendMode() becomes pure virtual, and overridden in
1804         PlatformCALayerMac and PlatformCALayerRemote.
1805         PlatformCAFilters::setBlendingFiltersOnLayer() now takes a raw platform
1806         layer, so it can be called from the UI process on a CALayer*.
1807         
1808         Add BlendMode to LayerProperties, and initialize, encode and decode it,
1809         as well as adding dumping support for blend modes.
1810         
1811         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
1812         (WebKit::applyPropertiesToLayer):
1813         * Shared/mac/RemoteLayerTreeTransaction.h:
1814         * Shared/mac/RemoteLayerTreeTransaction.mm:
1815         (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
1816         (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
1817         (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
1818         (WebKit::RemoteLayerTreeTextStream::operator<<):
1819         (WebKit::dumpChangedLayers):
1820         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
1821         (WebKit::PlatformCALayerRemote::setBlendMode):
1822         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
1823
1824 2014-04-19  Joseph Pecoraro  <pecoraro@apple.com>
1825
1826         Fix leak of UIScreenEdgePanGestureRecognizer in WKSwipeTransitionController
1827         https://bugs.webkit.org/show_bug.cgi?id=131877
1828
1829         Reviewed by Darin Adler.
1830
1831         * UIProcess/ios/ViewGestureControllerIOS.mm:
1832         (-[WKSwipeTransitionController gestureRecognizerForInteractiveTransition:WithTarget:action:]):
1833
1834 2014-04-19  Dan Bernstein  <mitz@apple.com>
1835
1836         Don’t install a source file inside WebProcess.app.
1837
1838         * WebKit2.xcodeproj/project.pbxproj: Removed ViewUpdateDispatcher.messages.in from
1839         WebProcess’s Copy Bundle Resources build phase.
1840
1841 2014-04-19  Darin Adler  <darin@apple.com>
1842
1843         [Mac] WebView adjusts the cursor even when another window is in front
1844         https://bugs.webkit.org/show_bug.cgi?id=131898
1845         rdar://problem/14619911
1846
1847         Reviewed by Dan Bernstein.
1848
1849         * UIProcess/API/mac/WKView.mm:
1850         (-[WKView _setCursor:]): Deleted. Moved the code all into PageClientImpl, since none of it
1851         interacts with anything special about a WKView.
1852
1853         * UIProcess/API/mac/WKViewInternal.h: Deleted the _setCursor: method.
1854
1855         * UIProcess/mac/PageClientImpl.mm:
1856         (WebKit::PageClientImpl::setCursor): Added a check that the window is under the cursor
1857         and do nothing if it's not.
1858
1859 2014-04-19  Dan Bernstein  <mitz@apple.com>
1860
1861         Use XPC services in the iOS Simulator, but not in Mountain Lion
1862         https://bugs.webkit.org/show_bug.cgi?id=131894
1863
1864         Reviewed by Anders Carlsson.
1865
1866         * Configurations/NetworkService.Development.xcconfig: Defined INFOPLIST_FILE for the
1867         Simulator.
1868         * Configurations/NetworkService.xcconfig: Ditto.
1869         * Configurations/WebContentService.Development.xcconfig: Ditto.
1870         * Configurations/WebContentService.xcconfig: Ditto.
1871         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1872         (WebKit::systemDirectoryPath): Added this helper function that returns a slash-terminated
1873         path to the System directory in the current runtime.
1874         (WebKit::ProcessLauncher::launchProcess): Changed to use the above function to tell whether
1875         a development version of WebKit2 is being used.
1876         * WebKit2Prefix.h: Set WTF_USE_XPC_SERVICES to 1 when targeting the iOS Simulator, but not
1877         when targeting Mountain Lion.
1878
1879 2014-04-19  Dan Bernstein  <mitz@apple.com>
1880
1881         [Cocoa] Crash in -[WKWebProcessPlugInHitTestResult nodeHandle] when nodeHandle() is null
1882         https://bugs.webkit.org/show_bug.cgi?id=131888
1883
1884         Reviewed by Jon Honeycutt.
1885
1886         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInHitTestResult.mm:
1887         (-[WKWebProcessPlugInHitTestResult nodeHandle]): Added a null check.
1888
1889 2014-04-19  Simon Fraser  <simon.fraser@apple.com>
1890
1891         [iOS WK2] Fuzzy layers on sites using perspective and transforms
1892         https://bugs.webkit.org/show_bug.cgi?id=131873
1893         <rdar://problem/16540576>
1894
1895         Reviewed by Sam Weinig.
1896         
1897         Always set rasterizationScale on CALayers in the UI process
1898         (as we do for WK1) so that layers are rasterized taking the
1899         device scale into account. We can do unconditionally; this
1900         is benign on layers that CA doesn't rasterize.
1901
1902         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
1903         (WebKit::applyPropertiesToLayer):
1904
1905 2014-04-18  Simon Fraser  <simon.fraser@apple.com>
1906
1907         Use 'override' in GraphicsLayerCA
1908         https://bugs.webkit.org/show_bug.cgi?id=131882
1909
1910         Reviewed by Tim Horton.
1911         
1912         Add an 'override'.
1913
1914         * WebProcess/WebPage/mac/GraphicsLayerCARemote.h:
1915
1916 2014-04-19  Darin Adler  <darin@apple.com>
1917
1918         Assertion in WebPage::runModal accesses object after it may have been destroyed
1919         https://bugs.webkit.org/show_bug.cgi?id=131875
1920
1921         Reviewed by Anders Carlsson.
1922
1923         * WebProcess/WebPage/WebPage.cpp:
1924         (WebKit::WebPage::runModal): Ref the WebPage so it's still around so we can
1925         check the m_isRunningModal flag.
1926
1927 2014-04-18  Commit Queue  <commit-queue@webkit.org>
1928
1929         Unreviewed, rolling out r167527.
1930         https://bugs.webkit.org/show_bug.cgi?id=131883
1931
1932         Broke 32-bit build (Requested by ap on #webkit).
1933
1934         Reverted changeset:
1935
1936         "[Mac] implement WebKitDataCue"
1937         https://bugs.webkit.org/show_bug.cgi?id=131799
1938         http://trac.webkit.org/changeset/167527
1939
1940 2014-04-18  Eric Carlson  <eric.carlson@apple.com>
1941
1942         [Mac] implement WebKitDataCue
1943         https://bugs.webkit.org/show_bug.cgi?id=131799
1944
1945         Reviewed by Dean Jackson.
1946
1947         * Configurations/FeatureDefines.xcconfig: Define ENABLE_DATACUE_VALUE.
1948
1949 2014-04-18  Anders Carlsson  <andersca@apple.com>
1950
1951         Keep the WebPageProxy alive for the lifetime of all PageLoadState::Transaction objects
1952         https://bugs.webkit.org/show_bug.cgi?id=131872
1953         <rdar://problem/15758414>
1954
1955         Reviewed by Dan Bernstein.
1956
1957         * UIProcess/PageLoadState.cpp:
1958         (WebKit::PageLoadState::PageLoadState):
1959         (WebKit::PageLoadState::Transaction::Transaction):
1960         (WebKit::PageLoadState::Transaction::~Transaction):
1961         * UIProcess/PageLoadState.h:
1962         (WebKit::PageLoadState::Transaction::Transaction): Deleted.
1963         (WebKit::PageLoadState::Transaction::~Transaction): Deleted.
1964         * UIProcess/WebPageProxy.cpp:
1965         (WebKit::WebPageProxy::WebPageProxy):
1966
1967 2014-04-18  Stephanie Lewis  <slewis@apple.com>
1968
1969         We shouldn’t create page throttlers for other pages than WebKit2 pages.
1970         Part of <rdar://problem/16473045> Visibility state counters are often incorrect.
1971         https://bugs.webkit.org/show_bug.cgi?id=131696
1972
1973         Reviewed by Gavin Barraclough.
1974
1975         Page throttlers were being created for SVG images and other page instances that
1976         were not accurately tracking the states that enable and disable page throttling.
1977         Make the throttler an unique ptr and only initialize it for WebKit2.
1978
1979         This also fixes  an inefficiency where we would throttle a new page on creation because 
1980         we assumed it was visible even if that was not the case.
1981
1982         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp: Check page throttler exists.
1983         (WebKit::NPRuntimeObjectMap::evaluate):
1984         * WebProcess/WebPage/WebPage.cpp: 
1985         (WebKit::WebPage::WebPage): Initialize page throttler for WebKit2 views.
1986         (WebKit::WebPage::mouseEvent): Check page throttler exists.
1987         (WebKit::WebPage::wheelEvent): ditto
1988         (WebKit::WebPage::keyEvent): ditto
1989
1990 2014-04-18  Anders Carlsson  <andersca@apple.com>
1991
1992         Don't allow app sandboxed apps without the network client entitlement to launch the network process
1993         https://bugs.webkit.org/show_bug.cgi?id=131868
1994         <rdar://problem/12354188>
1995
1996         Reviewed by Dan Bernstein.
1997
1998         * NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm:
1999         (WebKit::NetworkServiceInitializerDelegate::NetworkServiceInitializerDelegate):
2000         Add a new delegate that implements checkEntitlements().
2001
2002         (NetworkServiceInitializer):
2003         Pass the new delegate to XPCServiceInitializer.
2004
2005         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
2006         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
2007         Call checkEntitlements.
2008
2009         (WebKit::XPCServiceInitializerDelegate::checkEntitlements):
2010         Return true.
2011
2012         (WebKit::XPCServiceInitializerDelegate::hasEntitlement):
2013         Helper function that returns whether a client has the given entitlement.
2014
2015         (WebKit::XPCServiceInitializerDelegate::isClientSandboxed):
2016         Helper function that checks whether the client is sandboxed.
2017
2018 2014-04-18  Alice Barraclough  <alice.barraclough@webkit.org>
2019
2020         Find on page - extend API by providing highlighted match index
2021         https://bugs.webkit.org/show_bug.cgi?id=131776
2022
2023         Reviewed by Tim Horton.
2024
2025         * Shared/WebFindOptions.h: Add an option for determining match index.
2026
2027         Plumb through the API layers the addition of a parameter for match index.
2028         * UIProcess/API/APIFindClient.h:
2029         (API::FindClient::didFindString):
2030         * UIProcess/API/C/WKPage.cpp:
2031         (WKPageSetPageFindClient):
2032         * UIProcess/API/Cocoa/WKWebView.mm:
2033         (toFindOptions):
2034         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2035         (NS_OPTIONS):
2036         * UIProcess/API/Cocoa/_WKFindDelegate.h:
2037         * UIProcess/Cocoa/FindClient.h:
2038         * UIProcess/Cocoa/FindClient.mm:
2039         (WebKit::FindClient::setDelegate):
2040         (WebKit::FindClient::didFindString):
2041         * UIProcess/WebFindClient.cpp:
2042         (WebKit::WebFindClient::didFindString):
2043         * UIProcess/WebFindClient.h:
2044         * UIProcess/WebPageProxy.cpp:
2045         (WebKit::WebPageProxy::didFindString):
2046         * UIProcess/WebPageProxy.h:
2047         * UIProcess/WebPageProxy.messages.in:
2048
2049         The actual tracking of the match index is contained in FindController class.
2050         * WebProcess/WebPage/FindController.cpp:
2051         (WebKit::FindController::FindController): Start out as -1, understood to be an undefined index in this context.
2052         (WebKit::FindController::updateFindUIAfterPageScroll): 
2053             Perform the calculation of matchCount if the flag for DetermineMatchIndex is on.
2054         If matchCount exceeds max, keep the match index undefined because otherwise the finding could advance
2055         to a point where the index exceeds the match count, legitimately. If matchCount doesn't exceed the max, then make
2056         sure the match index, which had been being incremented or decremented blindly back in findString(), is normalized
2057         to be less than match count.
2058         (WebKit::FindController::findString): 
2059             If there is a user selection existing on the page, the next occurence of the string will be found after that
2060         selection. In that case we still want the index to properly reflect its ordinal  position within the entire document.
2061         Use findStringMatchingRanges to provide the match index, and set a flag that prevents the match index from being
2062         blindly incremented or decremented later. After findString() is actually called on the page, increment or decrement
2063         the find index under specific conditions. 
2064         (WebKit::FindController::hideFindIndicator): Reset match index when find UI goes away.
2065         * WebProcess/WebPage/FindController.h: Add m_foundStringMatchIndex to private variables.
2066         * WebProcess/WebPage/ios/FindControllerIOS.mm:
2067         (WebKit::FindController::hideFindIndicator): Reset match index when find UI goes away.
2068
2069 2014-04-18  Joseph Pecoraro  <pecoraro@apple.com>
2070
2071         Correct some issues small issues in WK2 file upload InjectedBundle APIs
2072         https://bugs.webkit.org/show_bug.cgi?id=131852
2073
2074         Reviewed by Dan Bernstein.
2075
2076         * WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h:
2077         (API::InjectedBundle::PageUIClient::shouldGenerateFileForUpload):
2078         The default return value, meaning no, should return the null string. The
2079         result is checked later, and null string is a special value meaning no.
2080
2081         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
2082         (WebKit::InjectedBundlePageUIClient::generateFileForUpload):
2083         Pre-check for the correct client function we will use.
2084
2085 2014-04-18  Andy Estes  <aestes@apple.com>
2086
2087         [iOS] REGRESSION (r167039): WebKit incorrectly sets a background process assertion state when displaying a PDF
2088         https://bugs.webkit.org/show_bug.cgi?id=131860
2089         <rdar://problem/16631282>
2090
2091         Reviewed by Tim Horton.
2092
2093         We were basing our process assertion state on whether or not the
2094         process had a WKContentView in a window, but when displaying a PDF
2095         we've removed the WKContentView from the window. Base this decision
2096         instead on whether or not the WKWebView is in the window.
2097
2098         * UIProcess/API/Cocoa/WKWebView.mm:
2099         (-[WKWebView didMoveToWindow]):
2100         * UIProcess/ios/PageClientImplIOS.mm:
2101         (WebKit::PageClientImpl::isViewInWindow):
2102
2103 2014-04-18  Anders Carlsson  <andersca@apple.com>
2104
2105         Address a couple of review comments
2106         https://bugs.webkit.org/show_bug.cgi?id=131856
2107
2108         Reviewed by Dan Bernstein.
2109
2110         * UIProcess/API/Cocoa/WKNavigationAction.h:
2111         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
2112         * UIProcess/API/Cocoa/WKPreferences.h:
2113         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2114         * UIProcess/API/Cocoa/WKWebView.h:
2115
2116 2014-04-18  Anders Carlsson  <andersca@apple.com>
2117
2118         Handle pluginOrigin being null
2119         https://bugs.webkit.org/show_bug.cgi?id=131849
2120         <rdar://problem/16655898>
2121
2122         Reviewed by Alexey Proskuryakov.
2123
2124         * WebProcess/WebProcess.cpp:
2125         (WebKit::WebProcess::shouldPlugInAutoStartFromOrigin):
2126
2127 2014-04-18  Dan Bernstein  <mitz@apple.com>
2128
2129         [Cocoa] Add a navigation delegate method corresponding to didFinishDocumentLoadForFrame for the main frame
2130         https://bugs.webkit.org/show_bug.cgi?id=131847
2131
2132         Reviewed by Anders Carlsson.
2133
2134         * UIProcess/API/APILoaderClient.h:
2135         (API::LoaderClient::didFinishDocumentLoadForFrame): Added a navigationID parameter.
2136         * UIProcess/API/C/WKPage.cpp:
2137         (WKPageSetPageLoaderClient): Updated for the above change in paramerers.
2138         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Declared new delegate method.
2139         * UIProcess/Cocoa/NavigationState.h: Declare override of didFinishDocumentLoadForFrame.
2140         * UIProcess/Cocoa/NavigationState.mm:
2141         (WebKit::NavigationState::setNavigationDelegate): Initialize
2142         webViewNavigationDidFinishDocumentLoad flag in the delegate methods struct.
2143         (WebKit::NavigationState::LoaderClient::didFinishDocumentLoadForFrame): Added override
2144         of the client function which calls the delegate.
2145         * UIProcess/WebPageProxy.cpp:
2146         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame): Get and pass the navigation ID to
2147         the client.
2148         * UIProcess/WebPageProxy.h: Added navigationID parameter.
2149         * UIProcess/WebPageProxy.messages.in: Ditto.
2150         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2151         (WebKit::WebFrameLoaderClient::dispatchDidFinishDocumentLoad): Get and send the navigation
2152         ID to the UI process.
2153
2154 2014-04-18  Philippe Normand  <pnormand@igalia.com>
2155
2156         Remove NETWORK_INFO support
2157         https://bugs.webkit.org/show_bug.cgi?id=131841
2158
2159         Reviewed by Gyuyoung Kim.
2160
2161         * CMakeLists.txt:
2162         * PlatformEfl.cmake:
2163         * Shared/API/c/WKBase.h:
2164         * Shared/APIObject.h:
2165         * Shared/WebNetworkInfo.cpp: Removed.
2166         * Shared/WebNetworkInfo.h: Removed.
2167         * UIProcess/API/C/WKAPICast.h:
2168         * UIProcess/API/C/WKContext.cpp:
2169         (WKContextGetNetworkInfoManager): Deleted.
2170         * UIProcess/API/C/WKContext.h:
2171         * UIProcess/API/C/WKNetworkInfo.cpp: Removed.
2172         * UIProcess/API/C/WKNetworkInfo.h: Removed.
2173         * UIProcess/API/C/WKNetworkInfoManager.cpp: Removed.
2174         * UIProcess/API/C/WKNetworkInfoManager.h: Removed.
2175         * UIProcess/API/efl/ewk_context.cpp:
2176         (EwkContext::EwkContext):
2177         * UIProcess/API/efl/ewk_context_private.h:
2178         * UIProcess/WebContext.cpp:
2179         (WebKit::WebContext::WebContext):
2180         * UIProcess/WebContext.h:
2181         * UIProcess/WebNetworkInfoManagerProxy.cpp: Removed.
2182         * UIProcess/WebNetworkInfoManagerProxy.h: Removed.
2183         * UIProcess/WebNetworkInfoManagerProxy.messages.in: Removed.
2184         * UIProcess/WebNetworkInfoProvider.cpp: Removed.
2185         * UIProcess/WebNetworkInfoProvider.h: Removed.
2186         * UIProcess/efl/NetworkInfoProvider.cpp: Removed.
2187         * UIProcess/efl/NetworkInfoProvider.h: Removed.
2188         * WebProcess/NetworkInfo/WebNetworkInfoManager.cpp: Removed.
2189         * WebProcess/NetworkInfo/WebNetworkInfoManager.h: Removed.
2190         * WebProcess/NetworkInfo/WebNetworkInfoManager.messages.in: Removed.
2191         * WebProcess/WebCoreSupport/WebNetworkInfoClient.cpp: Removed.
2192         * WebProcess/WebCoreSupport/WebNetworkInfoClient.h: Removed.
2193         * WebProcess/WebPage/WebPage.cpp:
2194         (WebKit::WebPage::WebPage):
2195         * WebProcess/WebProcess.cpp:
2196         (WebKit::WebProcess::WebProcess):
2197
2198 2014-04-17  Daniel Bates  <dabates@apple.com>
2199
2200         [iOS] Hook up screen.{availHeight, availWidth, height, width}
2201         https://bugs.webkit.org/show_bug.cgi?id=131821
2202         <rdar://problem/16413795>
2203
2204         Reviewed by Benjamin Poulain and Tim Horton.
2205
2206         Implement WebKit2-specific support infrastructure.
2207
2208         Additionally substitute "screenSize" for "viewporScreenSize" to make the code more understandable.
2209
2210         * Shared/WebPageCreationParameters.cpp:
2211         (WebKit::WebPageCreationParameters::encode): Modified to encode the available screen size
2212         creation parameter.
2213         (WebKit::WebPageCreationParameters::decode): Modified to decode the available screen size
2214         creation parameter.
2215         * Shared/WebPageCreationParameters.h:
2216         * UIProcess/WebPageProxy.cpp:
2217         (WebKit::WebPageProxy::creationParameters): Initialize the available screen size
2218         parameter.
2219         * UIProcess/WebPageProxy.h:
2220         * UIProcess/ios/WebPageProxyIOS.mm:
2221         (WebKit::WebPageProxy::screenSize): Renamed; formerly named viewportScreenSize.
2222         (WebKit::WebPageProxy::availableScreenSize): Added.
2223         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2224         (WebKit::WebChromeClient::screenSize): Renamed; formerly named viewportScreenSize.
2225         (WebKit::WebChromeClient::availableScreenSize): Added; turns around and calls WebPage::availableScreenSize().
2226         * WebProcess/WebCoreSupport/WebChromeClient.h:
2227         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2228         (InitWebCoreSystemInterface): Hook up WebKit System Interface function WKGetAvailableScreenSize.
2229         * WebProcess/WebPage/WebPage.cpp:
2230         (WebKit::WebPage::WebPage): Initialize available screen size instance variable.
2231         * WebProcess/WebPage/WebPage.h:
2232         * WebProcess/WebPage/ios/WebPageIOS.mm:
2233         (WebKit::WebPage::screenSize):
2234         (WebKit::WebPage::availableScreenSize):
2235
2236 2014-04-17  Anders Carlsson  <andersca@apple.com>
2237
2238         Remove unused API enums
2239         https://bugs.webkit.org/show_bug.cgi?id=131836
2240
2241         Reviewed by Tim Horton.
2242
2243         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
2244         (NS_ENUM):
2245         * UIProcess/Cocoa/NavigationState.mm:
2246         (WebKit::NavigationState::PolicyClient::decidePolicyForNavigationAction):
2247         (WebKit::NavigationState::PolicyClient::decidePolicyForResponse):
2248
2249 2014-04-17  Brent Fulgham  <bfulgham@apple.com>
2250
2251         Make RenderLayerBacking get the timingFunction of the correct animation.
2252         https://bugs.webkit.org/show_bug.cgi?id=100632
2253
2254         Reviewed by Simon Fraser.
2255
2256         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
2257         (IPC::ArgumentCoder<GraphicsLayerAnimation>::decode): Update for new signatures for
2258         FloatAnimationValue, TransformAnimationValue, etc.
2259
2260 2014-04-17  Enrica Casucci  <enrica@apple.com>
2261
2262         [iOS WebKit2] support replacements for misspelled words.
2263         https://bugs.webkit.org/show_bug.cgi?id=131827
2264         <rdar://problem/16319657>
2265
2266         Reviewed by Benjamin Poulain.
2267
2268         This is the first part of the work to add support for replacements.
2269         It handles _promptForReplace in canPerformAction to decide
2270         whether to show the Replace button in the menu and add the
2271         implementation of the replace action.
2272
2273         * Shared/EditorState.cpp:
2274         (WebKit::EditorState::encode):
2275         (WebKit::EditorState::decode):
2276         * Shared/EditorState.h:
2277         (WebKit::EditorState::EditorState):
2278         * UIProcess/WebPageProxy.h:
2279         * UIProcess/ios/WKContentViewInteraction.mm:
2280         (-[WKContentView selectedText]):
2281         (-[WKContentView replaceText:withText:]):
2282         (-[WKContentView _promptForReplace:]):
2283         (-[WKContentView replace:]):
2284         (-[WKContentView canPerformAction:withSender:]):
2285         (-[WKContentView selectWordForReplacement]): This is called
2286         by UIKit when the user taps on a mispelled word to select it.
2287         * UIProcess/ios/WebPageProxyIOS.mm:
2288         (WebKit::WebPageProxy::replaceSelectedText):
2289         * WebProcess/WebPage/WebPage.cpp:
2290         (WebKit::WebPage::WebPage):
2291         (WebKit::WebPage::editorState):
2292         * WebProcess/WebPage/WebPage.h:
2293         * WebProcess/WebPage/WebPage.messages.in:
2294         * WebProcess/WebPage/ios/WebPageIOS.mm:
2295         (WebKit::WebPage::selectWithGesture): Removed m_shouldReturnWordForSelection.
2296         We now return always the word corresponding to the caret selection or
2297         the selected text up to a maximum of 200 characters.
2298         (WebKit::WebPage::extendSelection):
2299         (WebKit::WebPage::replaceSelectedText):
2300
2301 2014-04-17  Tim Horton  <timothy_horton@apple.com>
2302
2303         [iOS] REGRESSION (r166975): WKPDFView is broken
2304         https://bugs.webkit.org/show_bug.cgi?id=131828
2305
2306         Reviewed by Simon Fraser.
2307
2308         * UIProcess/API/Cocoa/WKWebView.mm:
2309         (-[WKWebView _didCommitLayerTree:WebKit::]):
2310         Bail from updating the scroll view parameters from the layer tree update
2311         while it's being managed by a custom content view.
2312         We'll get any changes again in the next commit after removing the custom
2313         content view (and painting the new page) anyway, so this should be OK.
2314
2315 2014-04-17  Pratik Solanki  <psolanki@apple.com>
2316
2317         _webProcessIdentifier should return 0 if the web process crashed
2318         https://bugs.webkit.org/show_bug.cgi?id=131813
2319         <rdar://problem/16650605>
2320
2321         Reviewed by Anders Carlsson.
2322
2323         * UIProcess/API/Cocoa/WKWebView.mm:
2324         (-[WKWebView _hasWebProcess]):
2325         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2326
2327 2014-04-17  Darin Adler  <darin@apple.com>
2328
2329         Remove use of deprecatedDeleteAllValues in NPRemoteObjectMap::pluginDestroyed
2330         https://bugs.webkit.org/show_bug.cgi?id=122496
2331
2332         Reviewed by Brent Fulgham.
2333
2334         * Shared/Plugins/NPRemoteObjectMap.cpp:
2335         (WebKit::NPRemoteObjectMap::pluginDestroyed): Use new-style code and write the
2336         deprecatedDeleteAllValues function out using a loop. Might be nice to return here
2337         and use unique_ptr instead some day, but I tried that before and got it wrong, so
2338         lets do that another time.
2339
2340 2014-04-17  Darin Adler  <darin@apple.com>
2341
2342         Add separate flag for IndexedDatabase in workers since the current implementation is not threadsafe
2343         https://bugs.webkit.org/show_bug.cgi?id=131785
2344         rdar://problem/16003108
2345
2346         Reviewed by Brady Eidson.
2347
2348         * Configurations/FeatureDefines.xcconfig: Added INDEXED_DATABASE_IN_WORKERS.
2349
2350 2014-04-17  Dan Bernstein  <mitz@apple.com>
2351
2352         WebKit2 part of <rdar://problem/16601336> [Cocoa] _userInitiated is always NO in WKNavigationAction passed to -webView:createWebViewWithConfiguration:forNavigationAction:windowFeatures:
2353         https://bugs.webkit.org/show_bug.cgi?id=131783
2354
2355         Reviewed by Tim Horton.
2356
2357         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2358         (WebKit::WebChromeClient::createWindow): Set the isProcessingUserGesture field of
2359         the NavigationActionData to the corresponding value in the NavigationAction.
2360         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2361         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): Ditto.
2362         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Ditto.
2363
2364 2014-04-16  Benjamin Poulain  <bpoulain@apple.com>
2365
2366         [iOS][WK2] Fix the DidCommitLoad initial scrolling position
2367         https://bugs.webkit.org/show_bug.cgi?id=131780
2368
2369         Reviewed by Jon Honeycutt.
2370
2371         * UIProcess/API/Cocoa/WKWebView.mm:
2372         (-[WKWebView _didCommitLayerTree:]):
2373         That code is older than _obscuredInsets and used the contentInsets as a workaround.
2374
2375 2014-04-16  Benjamin Poulain  <bpoulain@apple.com>
2376
2377         [iOS][WK2] Fix annoying scrolling bugs
2378         https://bugs.webkit.org/show_bug.cgi?id=131722
2379
2380         Reviewed by Simon Fraser.
2381
2382         * UIProcess/API/Cocoa/WKWebView.mm:
2383         (-[WKWebView _scrollToContentOffset:WebCore::]):
2384         We are scrolling at the wrong position when we have the "small obscured insets".
2385
2386 2014-04-16  Gavin Barraclough  <baraclough@apple.com>
2387
2388         On iOS keep network process running using a process assertion rather than a boost
2389         https://bugs.webkit.org/show_bug.cgi?id=131779
2390
2391         Reviewed by Benjamin Poulain.
2392
2393         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2394         (WebKit::connectToService):
2395             - No need to leak a boost onto the NetworkProcess on iOS.
2396         * UIProcess/Network/NetworkProcessProxy.cpp:
2397         (WebKit::NetworkProcessProxy::didFinishLaunching):
2398             - Take a ProcessAssertion on the NetworkProcess.
2399         * UIProcess/Shared/ChildProcessProxy.h:
2400             - Added m_assertion.
2401         * UIProcess/WebProcessProxy.h:
2402             - Removed m_assertion.
2403         * UIProcess/ios/ProcessAssertion.h: Added.
2404             - Added - refactored from WebProcessProxy.h.
2405         * UIProcess/ios/ProcessAssertion.mm: Added.
2406         (WebKit::ProcessAssertion::ProcessAssertion):
2407         (WebKit::ProcessAssertion::setState):
2408             - Added - refactored from WebProcessProxyIOS.mm.
2409         * UIProcess/ios/WebProcessProxyIOS.mm:
2410         (WebKit::WebProcessProxy::updateProcessState):
2411             - Code refactored out to ProcessAssertion.mm.
2412         * WebKit2.xcodeproj/project.pbxproj:
2413             - Added files.
2414
2415 2014-04-16  Benjamin Poulain  <bpoulain@apple.com>
2416
2417         [iOS][WK2] Improve the approximation of the scroll position of the dynamic viewport size updates
2418         https://bugs.webkit.org/show_bug.cgi?id=131720
2419
2420         Reviewed by Tim Horton.
2421
2422         * UIProcess/API/Cocoa/WKWebView.mm:
2423         (-[WKWebView _scrollToContentOffset:]):
2424         The scrolling tree was forcing scroll at the wrong scale during the transition. 
2425
2426         (-[WKWebView _setMinimumLayoutSizeOverride:]):
2427         This was left out by accident. The WebProcess was getting the new layout size twice, making
2428         WebPage::dynamicViewportSizeUpdate() very confused when the content size changes.
2429
2430         * WebProcess/WebPage/ios/WebPageIOS.mm:
2431         (WebKit::WebPage::dynamicViewportSizeUpdate):
2432         Add scrolling adjustment for the dynamic relayout case:
2433         -Sticky top and bottom like the UIProcess.
2434         -Keep the same relative position of the unobscured rect's center.
2435
2436         Also fix a bug in the horizontal and vertical adjustments: the code was using the exposed rect
2437         instead of the unobscured rect, which made the adjustments off by the size of the obscured insets.
2438
2439         The type is changed from double to float since ARMv7 has a grudge against double.
2440
2441 2014-04-16  Benjamin Poulain  <bpoulain@apple.com>
2442
2443         [iOS][WK2] Do not update the visible content rects when setting the same obscured insets multiple times
2444         https://bugs.webkit.org/show_bug.cgi?id=131633
2445
2446         Reviewed by Darin Adler.
2447
2448         We should avoid computing the visible content rects when not needed.
2449
2450         * UIProcess/API/Cocoa/WKWebView.mm:
2451         (-[WKWebView _setObscuredInsets:]):
2452
2453 2014-04-16  Zan Dobersek  <zdobersek@igalia.com>
2454
2455         Make IPC::Arguments a variadic template
2456         https://bugs.webkit.org/show_bug.cgi?id=131684
2457
2458         Reviewed by Darin Adler.
2459
2460         Make IPC::Arguments a variadic template that uses the template parameter pack to further
2461         define the std::tuple ValueType and is used to define the std::tuple container of the
2462         values passed into the container.
2463
2464         * Platform/IPC/Arguments.h:
2465         (IPC::Arguments::Arguments):
2466         (IPC::Arguments::encode):
2467         (IPC::Arguments::decode):
2468         (IPC::Arguments0::encode): Deleted.
2469         (IPC::Arguments0::decode): Deleted.
2470         (IPC::Arguments1::Arguments1): Deleted.
2471         (IPC::Arguments1::encode): Deleted.
2472         (IPC::Arguments1::decode): Deleted.
2473         (IPC::Arguments2::Arguments2): Deleted.
2474         (IPC::Arguments2::encode): Deleted.
2475         (IPC::Arguments2::decode): Deleted.
2476         (IPC::Arguments3::Arguments3): Deleted.
2477         (IPC::Arguments3::encode): Deleted.
2478         (IPC::Arguments3::decode): Deleted.
2479         (IPC::Arguments4::Arguments4): Deleted.
2480         (IPC::Arguments4::encode): Deleted.
2481         (IPC::Arguments4::decode): Deleted.
2482         (IPC::Arguments5::Arguments5): Deleted.
2483         (IPC::Arguments5::encode): Deleted.
2484         (IPC::Arguments5::decode): Deleted.
2485         (IPC::Arguments6::Arguments6): Deleted.
2486         (IPC::Arguments6::encode): Deleted.
2487         (IPC::Arguments6::decode): Deleted.
2488         (IPC::Arguments7::Arguments7): Deleted.
2489         (IPC::Arguments7::encode): Deleted.
2490         (IPC::Arguments7::decode): Deleted.
2491         (IPC::Arguments8::Arguments8): Deleted.
2492         (IPC::Arguments8::encode): Deleted.
2493         (IPC::Arguments8::decode): Deleted.
2494         (IPC::Arguments10::Arguments10): Deleted.
2495         (IPC::Arguments10::encode): Deleted.
2496         (IPC::Arguments10::decode): Deleted.
2497         * Scripts/webkit2/LegacyMessages-expected.h:
2498         * Scripts/webkit2/Messages-expected.h:
2499         * Scripts/webkit2/messages.py: Clean up the code a bit.
2500         (reply_parameter_type):
2501         (arguments_type):
2502         (reply_type):
2503         (decode_type):
2504         (arguments_type_old): Deleted.
2505         (base_class): Deleted.
2506         (delayed_reply_type): Deleted.
2507
2508 2014-04-16  Tim Horton  <timothy_horton@apple.com>
2509
2510         Deduplicate LayerTreeContext
2511         https://bugs.webkit.org/show_bug.cgi?id=131773
2512
2513         Reviewed by Simon Fraser.
2514
2515         There are three identical implementations, one for each platform, for no reason.
2516
2517         * CMakeLists.txt:
2518         * PlatformEfl.cmake:
2519         * PlatformGTK.cmake:
2520         * Shared/LayerTreeContext.cpp: Renamed from Source/WebKit2/Shared/mac/LayerTreeContextMac.mm.
2521         (WebKit::LayerTreeContext::LayerTreeContext):
2522         (WebKit::LayerTreeContext::~LayerTreeContext):
2523         (WebKit::LayerTreeContext::encode):
2524         (WebKit::LayerTreeContext::decode):
2525         (WebKit::LayerTreeContext::isEmpty):
2526         (WebKit::operator==):
2527         * Shared/LayerTreeContext.h:
2528         (WebKit::operator!=): Deleted.
2529         * Shared/efl/LayerTreeContextEfl.cpp: Removed.
2530         * Shared/gtk/LayerTreeContextGtk.cpp: Removed.
2531         * WebKit2.xcodeproj/project.pbxproj:
2532         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
2533         (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
2534         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
2535         (WebKit::LayerTreeHostGtk::initialize):
2536
2537 2014-04-16  Tim Horton  <timothy_horton@apple.com>
2538
2539         Don't build LayerTreeHost on Mac (and clean it up)
2540         https://bugs.webkit.org/show_bug.cgi?id=131769
2541
2542         Reviewed by Simon Fraser.
2543
2544         * WebKit2.xcodeproj/project.pbxproj:
2545         Don't include it in the project.
2546
2547         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2548         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2549         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp:
2550         (WebKit::CoordinatedDrawingArea::updatePreferences):
2551         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2552         (WebKit::DrawingAreaImpl::updatePreferences):
2553         * WebProcess/WebPage/LayerTreeHost.h:
2554         (WebKit::LayerTreeHost::setLayerHostingMode): Deleted.
2555         (WebKit::LayerTreeHost::supportsAcceleratedCompositing): Deleted.
2556         * WebProcess/WebPage/WebPage.cpp:
2557         (WebKit::WebPage::updatePreferences):
2558         * WebProcess/WebPage/ios/WebPageIOS.mm:
2559         Get rid of LayerTreeHost::supportsAcceleratedCompositing, which always returns true everywhere.
2560         Remove some LayerTreeHost.h includes.
2561         Remove LayerTreeHost::setLayerHostingMode, which is PLATFORM(COCOA) and not needed.
2562
2563 2014-04-16  Simon Fraser  <simon.fraser@apple.com>
2564
2565         Failing to decode a layer tree commit message resulted in silent and mysterious failure
2566         https://bugs.webkit.org/show_bug.cgi?id=131766
2567         <rdar://problem/16520894>
2568
2569         Reviewed by Sam Weinig.
2570         
2571         If the message decode failed, we should have already marked the message as invalid.
2572         Failing to do so indicates in a decode code coding error.
2573
2574         * Platform/IPC/HandleMessage.h:
2575         (IPC::handleMessage):
2576         (IPC::handleMessageVariadic):
2577         (IPC::handleMessageDelayed):
2578
2579 2014-04-16  Tim Horton  <timothy_horton@apple.com>
2580
2581         Minor include sanity in WebPage.h
2582         https://bugs.webkit.org/show_bug.cgi?id=131752
2583
2584         Reviewed by Simon Fraser.
2585
2586         * WebProcess/WebPage/WebPage.h:
2587         Remove a bunch of unnecessary includes.
2588         Un-indent some stuff.
2589
2590         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2591         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2592         * WebProcess/WebPage/FindController.cpp:
2593         * WebProcess/WebPage/WebPage.cpp:
2594         * WebProcess/WebPage/mac/WebPageMac.mm:
2595         Add back more specific includes, into implementation files.
2596         
2597         * WebProcess/WebPage/WebUndoStep.cpp:
2598         (WebKit::WebUndoStep::~WebUndoStep):
2599         * WebProcess/WebPage/WebUndoStep.h:
2600         Add an out-of-line destructor.
2601
2602 2014-04-16  Gavin Barraclough  <baraclough@apple.com>
2603
2604         REGRESSION: PCE.js is 20x slower in WebKit2 because timers are throttled
2605         https://bugs.webkit.org/show_bug.cgi?id=131189
2606
2607         Unreviewed rollout of r166754
2608
2609         This change is no longer necessary.
2610
2611         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2612         (WebKit::connectToService):
2613
2614 2014-04-16  Alexey Proskuryakov  <ap@apple.com>
2615
2616         Updating tests after bug 131721, [GTK] Fix unused parameter warnings.
2617
2618         * Scripts/webkit2/LegacyMessageReceiver-expected.cpp:
2619         (WebKit::WebPage::didReceiveWebPageMessage):
2620         (WebKit::WebPage::didReceiveSyncWebPageMessage):
2621         * Scripts/webkit2/MessageReceiver-expected.cpp:
2622         (WebKit::WebPage::didReceiveMessage):
2623         (WebKit::WebPage::didReceiveSyncMessage):
2624
2625 2014-04-16  Brendan Long  <b.long@cablelabs.com>
2626
2627         [GTK] Fix unused parameter warnings
2628         https://bugs.webkit.org/show_bug.cgi?id=131721
2629
2630         Reviewed by Darin Adler.
2631
2632         * Scripts/webkit2/messages.py:
2633         (generate_message_handler): Add UNUSED_PARAM() for a couple parameters which aren't always used.
2634         * Shared/WebCoreArgumentCoders.cpp:
2635         (IPC::ArgumentCoder<LinearTimingFunction>::decode): Remove unused parameters.
2636         * WebProcess/InjectedBundle/APIInjectedBundleFormClient.h:
2637         (API::InjectedBundle::FormClient::textDidChangeInTextField): Same.
2638         (API::InjectedBundle::FormClient::willSubmitForm): Same.
2639         (API::InjectedBundle::FormClient::willSendSubmitEvent): Same.
2640         * WebProcess/Network/NetworkProcessConnection.cpp:
2641         (WebKit::NetworkProcessConnection::didReceiveSyncMessage): Same.
2642
2643 2014-04-16  Tim Horton  <timothy_horton@apple.com>
2644
2645         Accidentally included some style-checker-testing changes in the last commit.
2646
2647         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2648         (WebKit::PDFPlugin::attemptToUnlockPDF):
2649         (WebKit::PDFPlugin::updatePageAndDeviceScaleFactors):
2650
2651 2014-04-16  Tim Horton  <timothy_horton@apple.com>
2652
2653         Fix some style checker complaints in PDFPlugin
2654         https://bugs.webkit.org/show_bug.cgi?id=131706
2655
2656         Reviewed by Darin Adler.
2657
2658         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2659         (-[WKPDFPluginAccessibilityObject accessibilityAttributeValue:]):
2660         (-[WKPDFPluginAccessibilityObject accessibilityAttributeValue:forParameter:]):
2661         (-[WKPDFPluginAccessibilityObject accessibilityAttributeNames]):
2662         (WebKit::PDFPlugin::attemptToUnlockPDF):
2663         (WebKit::PDFPlugin::updatePageAndDeviceScaleFactors):
2664         (WebKit::PDFPlugin::isEditingCommandEnabled):
2665         (WebKit::PDFPlugin::nextMatchForString):
2666         (WebKit::PDFPlugin::handleWheelEvent):
2667         (WebKit::PDFPlugin::liveData):
2668
2669 2014-04-15  Dan Bernstein  <mitz@apple.com>
2670
2671         [Cocoa] Add a form delegate method corresponding to willSubmitForm
2672         https://bugs.webkit.org/show_bug.cgi?id=131718
2673
2674         Reviewed by Tim Horton.
2675
2676         * UIProcess/API/Cocoa/WKWebView.mm:
2677         (-[WKWebView _setFormDelegate:]): Changed to define and create a FormClient (which derives
2678         from API::FormClient and messages a delegate), and set it as the form client.
2679
2680         * UIProcess/API/Cocoa/_WKFormDelegate.h: Declared new delegate method.
2681
2682         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFormDelegatePrivate.h: Added a
2683         variant of willSubmitForm that returs a user object to pass to the delegate in the UI
2684         process, giving it a temporary name with “new”.
2685
2686         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2687         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Changed willSubmitForm()
2688         to check for the new bundle delegate method first and encode the user object as user data.
2689         Moved the encoding of an NSObject <NSSecureCoding> as user data into a helper function.
2690
2691 2014-04-15  Hyowon Kim  <hw1008.kim@samsung.com>
2692
2693         Make page overlay functionality working on coordinated graphics.
2694         https://bugs.webkit.org/show_bug.cgi?id=131425
2695
2696         Reviewed by Darin Adler.
2697
2698         Page overlay functionality did not work on coordinated graphics since r166975.
2699         This patch removes deprecated code related to the PageOverlay GraphicsLayer management.
2700         and makes CoordinatedLayerTreeHost use PageOverlayController.
2701
2702         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp:
2703         (WebKit::CoordinatedDrawingArea::mainFrameContentSizeChanged):
2704         (WebKit::CoordinatedDrawingArea::didInstallPageOverlay): Deleted.
2705         (WebKit::CoordinatedDrawingArea::didUninstallPageOverlay): Deleted.
2706         (WebKit::CoordinatedDrawingArea::setPageOverlayNeedsDisplay): Deleted.
2707         (WebKit::CoordinatedDrawingArea::setPageOverlayOpacity): Deleted.
2708         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h:
2709         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
2710         (WebKit::CoordinatedLayerTreeHost::setRootCompositingLayer):
2711         (WebKit::CoordinatedLayerTreeHost::didFlushRootLayer):
2712         (WebKit::CoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged):
2713         (WebKit::CoordinatedLayerTreeHost::didInstallPageOverlay): Deleted.
2714         (WebKit::CoordinatedLayerTreeHost::didUninstallPageOverlay): Deleted.
2715         (WebKit::CoordinatedLayerTreeHost::setPageOverlayNeedsDisplay): Deleted.
2716         (WebKit::CoordinatedLayerTreeHost::setPageOverlayOpacity): Deleted.
2717         (WebKit::CoordinatedLayerTreeHost::createPageOverlayLayer): Deleted.
2718         (WebKit::CoordinatedLayerTreeHost::destroyPageOverlayLayer): Deleted.
2719         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
2720         * WebProcess/WebPage/LayerTreeHost.h:
2721         (WebKit::LayerTreeHost::didInstallPageOverlay):
2722         (WebKit::LayerTreeHost::didUninstallPageOverlay):
2723         (WebKit::LayerTreeHost::setPageOverlayNeedsDisplay):
2724
2725 2014-04-15  Dan Bernstein  <mitz@apple.com>
2726
2727         Introduce API::FormClient
2728         https://bugs.webkit.org/show_bug.cgi?id=131714
2729
2730         Reviewed by Tim Horton.
2731
2732         * UIProcess/API/APIFormClient.h: Added.
2733         (API::FormClient::~FormClient):
2734         (API::FormClient::willSubmitForm):
2735
2736         * UIProcess/API/C/WKPage.cpp:
2737         (WKPageSetPageFormClient): Changed to create a WebFormClient and call
2738         WebPageProxy::setFormClient.
2739
2740         * UIProcess/WebFormClient.cpp:
2741         (WebKit::WebFormClient::WebFormClient): Added a constructor from WKPageFormClientBase.
2742         * UIProcess/WebFormClient.h: Added inheritance from API::FormClient, marked overrides as
2743         such.
2744
2745         * UIProcess/WebPageProxy.cpp:
2746         (WebKit::WebPageProxy::WebPageProxy): Initialize m_formClient member.
2747         (WebKit::WebPageProxy::setFormClient): Added. Updates m_formClient.
2748         (WebKit::WebPageProxy::close): Updated code to clear m_formClient.
2749         (WebKit::WebPageProxy::willSubmitForm): Updated for type change.
2750         (WebKit::WebPageProxy::initializeFormClient): Deleted.
2751         * UIProcess/WebPageProxy.h:
2752
2753         * WebKit2.xcodeproj/project.pbxproj: Added reference to new file.
2754
2755 2014-04-15  Simon Fraser  <simon.fraser@apple.com>
2756
2757         [iOS WK2] Pages often blank on first load if page loaded by typing the URL
2758         https://bugs.webkit.org/show_bug.cgi?id=131665
2759
2760         Reviewed by Tim Horton.
2761
2762         The document overlay-related code in RemoteLayerTreeDrawingArea::setRootCompositingLayer()
2763         was triggering a compositing layer flush when called with a null rootLayer, which happens
2764         for pages going into the page cache. This would trigger a layer flush that would clobber
2765         the root layer for the visible page, resulting in missing content.
2766         
2767         Also, rebuildCompositingLayerTree() is called recursively and the m_documentOverlayRootLayer
2768         was being added to (and then removed from) every single compositing layers.
2769         
2770         Fix both these by changing to a pull model, where RenderLayerCompositor requests
2771         the overlay layer via ChromeClient, and gets it at the end of every flush,
2772         adding to the children of the root layer.
2773
2774         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2775         (WebKit::WebChromeClient::documentOverlayLayerForFrame):
2776         * WebProcess/WebCoreSupport/WebChromeClient.h:
2777         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2778         (WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
2779
2780 2014-04-15  Jinwoo Song  <jinwoo7.song@samsung.com>
2781
2782         [EFL][WK2] Pass Mouse movement data to WebMouseEvent
2783         https://bugs.webkit.org/show_bug.cgi?id=131663
2784
2785         Reviewed by Gyuyoung Kim.
2786
2787         Currently mouse movement data are not passed to WebMouseEvent. Instead, they are set to 0 as default.
2788         EFL port needs to send the deltaX and deltaY for PointerLock API which will be implemented later.
2789
2790         * Shared/efl/WebEventFactory.cpp:
2791         (WebKit::WebEventFactory::createWebMouseEvent):
2792
2793 2014-04-15  Commit Queue  <commit-queue@webkit.org>
2794
2795         Unreviewed, rolling out r167298.
2796         https://bugs.webkit.org/show_bug.cgi?id=131670
2797
2798         Broke CSS filters (17 test crashes) (Requested by ap on
2799         #webkit).
2800
2801         Reverted changeset:
2802
2803         "[iOS WK2] Pages often blank on first load if page loaded by
2804         typing the URL"
2805         https://bugs.webkit.org/show_bug.cgi?id=131665
2806         http://trac.webkit.org/changeset/167298
2807
2808 2014-04-14  Simon Fraser  <simon.fraser@apple.com>
2809
2810         [iOS WK2] Pages often blank on first load if page loaded by typing the URL
2811         https://bugs.webkit.org/show_bug.cgi?id=131665
2812
2813         Reviewed by Tim Horton.
2814
2815         The document overlay-related code in RemoteLayerTreeDrawingArea::setRootCompositingLayer()
2816         was triggering a compositing layer flush when called with a null rootLayer, which happens
2817         for pages going into the page cache. This would trigger a layer flush that would clobber
2818         the root layer for the visible page, resulting in missing content.
2819         
2820         Also, rebuildCompositingLayerTree() is called recursively and the m_documentOverlayRootLayer
2821         was being added to (and then removed from) every single compositing layers.
2822         
2823         Fix both these by changing to a pull model, where RenderLayerCompositor requests
2824         the overlay layer via ChromeClient, and gets it at the end of every flush,
2825         adding to the children of the root layer.
2826
2827         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2828         (WebKit::WebChromeClient::documentOverlayLayerForFrame):
2829         * WebProcess/WebCoreSupport/WebChromeClient.h:
2830         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2831         (WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
2832
2833 2014-04-14  Tim Horton  <timothy_horton@apple.com>
2834
2835         Fix the 32-bit build.
2836
2837         * UIProcess/mac/ViewGestureControllerMac.mm:
2838
2839 2014-04-14  Simon Fraser  <simon.fraser@apple.com>
2840
2841         REGRESSION (WebKit2): Programmatic scrolls in overflow-scrolling:touch don't work
2842         https://bugs.webkit.org/show_bug.cgi?id=131649
2843
2844         Reviewed by Tim Horton.
2845         
2846         Update the UIScrollView's contentOffset when we're told that the scroll position
2847         changed.
2848         
2849         Also refactor slightly to have a single exception-protected block.
2850
2851         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
2852         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren):
2853
2854 2014-04-14  Tim Horton  <timothy_horton@apple.com>
2855
2856         Fix the 32-bit build.
2857
2858         * UIProcess/mac/ViewGestureControllerMac.mm:
2859
2860 2014-04-14  Tim Horton  <timothy_horton@apple.com>
2861
2862         Sometimes-crash under handleSwipeGesture after closing a window or quitting
2863         https://bugs.webkit.org/show_bug.cgi?id=131648
2864         <rdar://problem/15966106>
2865
2866         Reviewed by Simon Fraser.
2867
2868         * UIProcess/mac/ViewGestureController.h:
2869         * UIProcess/mac/ViewGestureControllerMac.mm:
2870         (WebKit::ViewGestureController::~ViewGestureController):
2871         (WebKit::ViewGestureController::trackSwipeGesture):
2872         Keep a Objective C object with a single boolean property, isCancelled, on
2873         the ViewGestureController, and also retained by the swipe-tracking block.
2874         When the ViewGestureController is destroyed, we set isCancelled to YES,
2875         and the next time the block is invoked, we will cancel the swipe without
2876         touching the destroyed ViewGestureController.
2877
2878         (WebKit::ViewGestureController::handleSwipeGesture):
2879         Don't try to handle a swipe gesture if the drawing area is missing.
2880
2881         (WebKit::ViewGestureController::endSwipeGesture):
2882         Clear the swipe cancellation tracker when the gesture completes.
2883
2884 2014-04-14  Enrica Casucci  <enrica@apple.com>
2885
2886         REGRESSION(r166027) Menu is shown and immediately hidden after doubletap gesture.
2887         https://bugs.webkit.org/show_bug.cgi?id=131646
2888         <rdar://problem/16614374>
2889
2890         Reviewed by Benjamin Poulain.
2891
2892         This is a problem with every gesture that changes the selection
2893         We don't need to delay updating the selection if the selection is
2894         being changed with a gesture.
2895
2896         * UIProcess/ios/WKContentViewInteraction.h:
2897         * UIProcess/ios/WKContentViewInteraction.mm:
2898         (-[WKContentView _didUpdateBlockSelectionWithTouch:withFlags:growThreshold:shrinkThreshold:]):
2899         (-[WKContentView changeSelectionWithGestureAt:withGesture:withState:]):
2900         (-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:]):
2901         (-[WKContentView changeSelectionWithTouchesFrom:to:withGesture:withState:]):
2902         (-[WKContentView changeBlockSelectionWithTouchAt:withSelectionTouch:forHandle:]):
2903         (-[WKContentView _selectionChanged]):
2904
2905 2014-04-14  Dan Bernstein  <mitz@apple.com>
2906
2907         Let the bundle form client know whether a change in a text field was initiated by user typing
2908         https://bugs.webkit.org/show_bug.cgi?id=131643
2909
2910         Reviewed by Sam Weinig.
2911
2912         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFormDelegatePrivate.h: Added
2913         initiatedByUserTyping parameter to the delegate method.
2914
2915         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2916         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Updated overload of
2917         textDidChangeInTextField to take the initiatedByUserTyping parameter and pass it along to
2918         the delegate.
2919
2920         * WebProcess/InjectedBundle/APIInjectedBundleFormClient.h:
2921         (API::InjectedBundle::FormClient::textDidChangeInTextField): Added initiatedByUserTyping
2922         parameter.
2923
2924         * WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp:
2925         (WebKit::InjectedBundlePageFormClient::textDidChangeInTextField): Maintained the existing
2926         behavior of not calling the C SPI client if the change was not initiated by user typing.
2927         * WebProcess/InjectedBundle/InjectedBundlePageFormClient.h: Updated for added parameter.
2928
2929         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2930         (WebKit::WebEditorClient::textDidChangeInTextField): Changed to call the bundle client
2931         function unconditionally, but pass along whether the change was initiated by user typing.
2932
2933 2014-04-14  Dan Bernstein  <mitz@apple.com>
2934
2935         [Cocoa] Add a WKWebProcessPlugInFormDelegate method corresponding to willSendSubmitEvent
2936         https://bugs.webkit.org/show_bug.cgi?id=131639
2937
2938         Reviewed by Tim Horton.
2939
2940         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFormDelegatePrivate.h: Declared
2941         new delegate method.
2942         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2943         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Added an override
2944         of API::InjectedBundle::FormClient::willSendSubmitEvent which calls the new delegate
2945         method.
2946
2947 2014-04-14  Benjamin Poulain  <bpoulain@apple.com>
2948
2949         [iOS][WK2] Change the SPI used when starting the rotation animation
2950         https://bugs.webkit.org/show_bug.cgi?id=131638
2951
2952         Reviewed by Tim Horton.
2953
2954         Having an update block where all the properties are changed is more convenient for Safari.
2955
2956         * UIProcess/API/Cocoa/WKWebView.mm:
2957         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
2958         (-[WKWebView _beginAnimatedResizeToSize:obscuredInsets:minimumLayoutSizeOverride:]): Deleted.
2959         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2960
2961 2014-04-14  Simon Fraser  <simon.fraser@apple.com>
2962
2963         [iOS WK2] Hash table assertion closing a tab
2964         https://bugs.webkit.org/show_bug.cgi?id=131640
2965
2966         Reviewed by Tim Horton.
2967         
2968         Have RemoteLayerTreeContext keep track of all PlatformCALayerRemotes,
2969         and clear their context pointer when it is being destroyed to avoid
2970         calling into a deleted object later.
2971
2972         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
2973         (WebKit::PlatformCALayerRemote::~PlatformCALayerRemote):
2974         (WebKit::PlatformCALayerRemote::addAnimationForKey):
2975         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
2976         (WebKit::PlatformCALayerRemote::clearContext):
2977         * WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
2978         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
2979         (WebKit::RemoteLayerTreeContext::~RemoteLayerTreeContext):
2980         (WebKit::RemoteLayerTreeContext::layerWasCreated):
2981         (WebKit::RemoteLayerTreeContext::layerWillBeDestroyed):
2982
2983 2014-04-14  Tim Horton  <timothy_horton@apple.com>
2984
2985         Allow dynamic changes of WKThumbnailView snapshot scale
2986         https://bugs.webkit.org/show_bug.cgi?id=131628
2987         <rdar://problem/16584156>
2988
2989         Reviewed by Beth Dakin.
2990
2991         * UIProcess/API/Cocoa/_WKThumbnailView.mm:
2992         (-[_WKThumbnailView _requestSnapshotIfNeeded]):
2993         Don't bail from requesting a snapshot just because we already had one; we want to resnapshot.
2994         Keep track of when we bail from requesting a snapshot because we have one in-flight, so we can request it later.
2995
2996         (-[_WKThumbnailView _didTakeSnapshot:]):
2997         Apply the scale to the bitmap size (whoops!).
2998         Make CA always resize the content to fill the thumbnail view's layer, respecting aspect ratio.
2999         Re-snapshot if we previously deferred a snapshot.
3000
3001         (-[_WKThumbnailView setScale:]):
3002         If we get a scale change, request a new snapshot.
3003
3004         (-[_WKThumbnailView setUsesSnapshot:]):
3005         Never apply thumbnail scale to the page if we're using snapshots. It's unnecessary,
3006         because scale will be applied simply when painting the software snapshot.
3007         Apply the thumbnail scale if we're going from usesSnapshot -> !usesSnapshot.
3008
3009         * WebProcess/WebPage/WebPage.cpp:
3010         (WebKit::WebPage::snapshotAtSize):
3011         Snapshots should use the greater of the two scales, so as to never leave a portion of the snapshot unpainted.
3012
3013 2014-04-14  Tim Horton  <timothy_horton@apple.com>
3014
3015         REGRESSION (WebKit2 View Gestures): Double-tap doesn't work properly when there's no element underneath the cursor
3016         https://bugs.webkit.org/show_bug.cgi?id=131629
3017         <rdar://problem/16192821>
3018
3019         Reviewed by Dan Bernstein.
3020
3021         * UIProcess/mac/ViewGestureControllerMac.mm:
3022         (WebKit::ViewGestureController::didCollectGeometryForSmartMagnificationGesture):
3023         If there's nothing under the cursor, zoom towards the cursor instead of towards 0,0.
3024
3025 2014-04-14  Simon Fraser  <simon.fraser@apple.com>
3026
3027         Run filter animations in the UI process with UI-side compositing
3028         https://bugs.webkit.org/show_bug.cgi?id=131199
3029         <rdar://problem/16479487>
3030
3031         Reviewed by Sam Weinig.
3032         
3033         * Shared/WebCoreArgumentCoders.cpp: Removed lots of WebCore::
3034         (IPC::ArgumentCoder<SelectionRect>::decode):
3035         (IPC::ArgumentCoder<PasteboardWebContent>::encode):
3036         (IPC::ArgumentCoder<PasteboardWebContent>::decode):
3037         (IPC::ArgumentCoder<PasteboardImage>::encode):
3038         (IPC::ArgumentCoder<PasteboardImage>::decode):
3039         (IPC::ArgumentCoder<URL>::decode):
3040         (IPC::ArgumentCoder<UserStyleSheet>::encode):
3041         (IPC::ArgumentCoder<UserStyleSheet>::decode):
3042         (IPC::ArgumentCoder<UserScript>::encode):
3043         (IPC::ArgumentCoder<UserScript>::decode):
3044         (IPC::ArgumentCoder<ScrollableAreaParameters>::encode):
3045         (IPC::ArgumentCoder<ScrollableAreaParameters>::decode):
3046         (IPC::ArgumentCoder<FixedPositionViewportConstraints>::encode):
3047         (IPC::ArgumentCoder<FixedPositionViewportConstraints>::decode):
3048         (IPC::ArgumentCoder<StickyPositionViewportConstraints>::encode):
3049         (IPC::ArgumentCoder<StickyPositionViewportConstraints>::decode):
3050         (IPC::ArgumentCoder<FilterOperation>::encode):
3051         (IPC::decodeFilterOperation):
3052         (IPC::ArgumentCoder<FilterOperations>::encode):
3053         (IPC::ArgumentCoder<WebCore::UserStyleSheet>::encode): Deleted.
3054         (IPC::ArgumentCoder<WebCore::UserStyleSheet>::decode): Deleted.
3055         (IPC::ArgumentCoder<WebCore::UserScript>::encode): Deleted.
3056         (IPC::ArgumentCoder<WebCore::UserScript>::decode): Deleted.
3057         (IPC::ArgumentCoder<WebCore::ScrollableAreaParameters>::encode): Deleted.
3058         (IPC::ArgumentCoder<WebCore::ScrollableAreaParameters>::decode): Deleted.
3059         (IPC::ArgumentCoder<WebCore::FixedPositionViewportConstraints>::encode): Deleted.
3060         (IPC::ArgumentCoder<WebCore::FixedPositionViewportConstraints>::decode): Deleted.
3061         (IPC::ArgumentCoder<WebCore::StickyPositionViewportConstraints>::encode): Deleted.
3062         (IPC::ArgumentCoder<WebCore::StickyPositionViewportConstraints>::decode): Deleted.
3063         (IPC::encodeFilterOperation): Deleted.
3064         Add encoding/decoding support for FilterOperation.
3065         decodeFilterOperation() has to be a bare function because of the RefPtr
3066         out parameter.
3067         REFERENCE filters should never be encoded, since they have CachedSVGDocumentReferences.
3068
3069         * Shared/WebCoreArgumentCoders.h:
3070
3071         * Shared/mac/RemoteLayerTreeTransaction.mm:
3072         (WebKit::RemoteLayerTreeTextStream::operator<<):
3073         Add logging for filter animations to the RemoteLayerTree log output.
3074
3075         * WebProcess/WebPage/mac/GraphicsLayerCARemote.h:
3076         * WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp:
3077         (WebKit::GraphicsLayerCARemote::addAnimation): Deleted. We can run
3078         filter animations now.
3079
3080         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.h:
3081         KeyValues have a RefPtr<WebCore::FilterOperation> now (which can't be part of
3082         the union because we need its constructor to get called).
3083         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
3084         (WebKit::PlatformCAAnimationRemote::KeyframeValue::encode): Encode the filter.
3085         (WebKit::PlatformCAAnimationRemote::KeyframeValue::decode): Decode the filter.
3086         (WebKit::PlatformCAAnimationRemote::setFromValue): Implement.
3087         (WebKit::PlatformCAAnimationRemote::setToValue): Implement.
3088         (WebKit::PlatformCAAnimationRemote::setValues): Implement.
3089         (WebKit::animationValueFromKeyframeValue): Handle filters.
3090
3091 2014-04-14  Simon Fraser  <simon.fraser@apple.com>
3092
3093         Fix the build.
3094
3095         * UIProcess/mac/PageClientImpl.h:
3096
3097 2014-04-14  Simon Fraser  <simon.fraser@apple.com>
3098
3099         [WK2 iOS] Scrolling to anchor links is broken
3100         https://bugs.webkit.org/show_bug.cgi?id=131618
3101         <rdar://problem/16599144>
3102
3103         Reviewed by Tim Horton.
3104         
3105         The RemoteScrollingTree implements scrollingTreeNodeRequestsScroll
3106         to get informed about requested scroll position updates, and passes
3107         them along via the RemoteScrollingCoordinatorProxy, WebPageProxy and PageClient
3108         to the WKWebView, which performs a scroll.
3109
3110         * UIProcess/API/Cocoa/WKWebView.mm:
3111         (-[WKWebView _scrollToContentOffset:WebCore::]): Scroll to content offset,
3112         taking page scale and insets into account.
3113         * UIProcess/API/Cocoa/WKWebViewInternal.h:
3114         * UIProcess/CoordinatedGraphics/WebView.cpp:
3115         (WebKit::WebView::requestScroll):
3116         * UIProcess/CoordinatedGraphics/WebView.h:
3117         * UIProcess/PageClient.h:
3118         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
3119         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeRequestsScroll):
3120         Pass scrolls along to the WebPageProxy for the root node. We will also need
3121         to handle programmatic scrolls for overflow soon.
3122         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
3123         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
3124         (WebKit::RemoteScrollingTree::scrollingTreeNodeRequestsScroll):
3125         * UIProcess/Scrolling/RemoteScrollingTree.h:
3126         * UIProcess/WebPageProxy.cpp:
3127         (WebKit::WebPageProxy::requestScroll):
3128         * UIProcess/WebPageProxy.h:
3129         * UIProcess/ios/PageClientImplIOS.h:
3130         * UIProcess/ios/PageClientImplIOS.mm:
3131         (WebKit::PageClientImpl::canScrollView):
3132         (WebKit::PageClientImpl::requestScroll):
3133         * UIProcess/mac/PageClientImpl.mm:
3134         (WebKit::PageClientImpl::requestScroll):
3135
3136 2014-04-12  Antti Koivisto  <antti@apple.com>
3137
3138         Keep secondary tile grid for zoomed-out scale
3139         https://bugs.webkit.org/show_bug.cgi?id=131586
3140
3141         Reviewed by Darin Adler.
3142
3143         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp:
3144         (WebKit::PlatformCALayerRemoteTiledBacking::PlatformCALayerRemoteTiledBacking):
3145         (WebKit::PlatformCALayerRemoteTiledBacking::customSublayers):
3146         
3147             Always request new sublayer list from tile controller.
3148
3149         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h:
3150
3151 2014-04-14  Tim Horton  <timothy_horton@apple.com>
3152
3153         Make WK(Web)View magnification setters actually use view-relative positions
3154         https://bugs.webkit.org/show_bug.cgi?id=131611
3155         <rdar://problem/15965239>
3156
3157         Reviewed by Darin Adler.
3158
3159         * UIProcess/API/mac/WKView.mm:
3160         (-[WKView setMagnification:centeredAtPoint:]):
3161         (-[WKView setMagnification:]):
3162         Use scalePageInViewCoordinates instead.
3163
3164         * UIProcess/WebPageProxy.cpp:
3165         (WebKit::WebPageProxy::scalePageInViewCoordinates):
3166         * UIProcess/WebPageProxy.h:
3167         * WebProcess/WebPage/WebPage.cpp:
3168         (WebKit::WebPage::scalePageInViewCoordinates):
3169         (WebKit::WebPage::pageScaleFactor):
3170         * WebProcess/WebPage/WebPage.h:
3171         * WebProcess/WebPage/WebPage.messages.in:
3172         Add scalePageInViewCoordinates, which turns the scale centerpoint within the view
3173         into what scalePage expects: a post-scale scroll offset.
3174
3175 2014-04-14  Tim Horton  <timothy_horton@apple.com>
3176
3177         Support setting a background color on page overlays
3178         https://bugs.webkit.org/show_bug.cgi?id=131600
3179
3180         Reviewed by Darin Adler.
3181
3182         * WebProcess/WebPage/PageOverlay.cpp:
3183         (WebKit::PageOverlay::PageOverlay):
3184         (WebKit::PageOverlay::bounds):
3185         (WebKit::PageOverlay::startFadeInAnimation):
3186         (WebKit::PageOverlay::startFadeOutAnimation):
3187         (WebKit::PageOverlay::startFadeAnimation):
3188         (WebKit::PageOverlay::fadeAnimationTimerFired):
3189         Minor style adjustments.
3190         Use more references everywhere.
3191
3192         (WebKit::PageOverlay::setBackgroundColor):
3193         (WebKit::PageOverlay::setNeedsDisplay):
3194         * WebProcess/WebPage/PageOverlay.h:
3195         (WebKit::PageOverlay::backgroundColor):
3196         Keep track of our background color, and push it down to the page overlay controller if we have one.
3197
3198         * WebProcess/WebPage/PageOverlayController.cpp:
3199         (WebKit::updateOverlayGeometry):
3200         (WebKit::PageOverlayController::clearPageOverlay):
3201         Page overlays will always have the right size, and just use drawsContents to determine
3202         whether or not they should tile/have backing store/etc.
3203
3204         (WebKit::PageOverlayController::installPageOverlay):
3205         (WebKit::PageOverlayController::didChangeOverlayBackgroundColor):
3206         Set the background color of the layer.
3207
3208         * WebProcess/WebPage/PageOverlayController.h:
3209
3210         * WebProcess/WebPage/WebPage.cpp:
3211         (WebKit::WebPage::WebPage):
3212         References!
3213
3214 2014-04-13  Andy Estes  <aestes@apple.com>
3215
3216         [QuickLook] Move file system-related code into WebKit
3217         https://bugs.webkit.org/show_bug.cgi?id=131597
3218
3219         Reviewed by Dan Bernstein.
3220
3221         * WebProcess/Network/WebResourceLoader.h: Made m_quickLookHandle a unique_ptr.
3222         * WebProcess/ios/WebResourceLoaderIOS.mm:
3223         (WebKit::WebResourceLoader::setUpQuickLookHandleIfNeeded):
3224
3225 2014-04-13  Andy Estes  <aestes@apple.com>
3226
3227         REGRESSION (r167164): -[WKNSURLSessionLocal _getCookieHeadersForTask:completionHandler:] _block_invoke can access a deallocated completionHandler
3228         https://bugs.webkit.org/show_bug.cgi?id=131595
3229
3230         Reviewed by Dan Bernstein.
3231
3232         Make a copy of completionHandler and release it after we're done with it.
3233
3234         * Shared/mac/CookieStorageShim.mm:
3235         (-[WKNSURLSessionLocal _getCookieHeadersForTask:completionHandler:]):
3236
3237 2014-04-13  Pratik Solanki  <psolanki@apple.com>
3238
3239         Don't use ImportanceAssertion on iOS
3240         https://bugs.webkit.org/show_bug.cgi?id=131481
3241         <rdar://problem/16575830>
3242
3243         Reviewed by Darin Adler.
3244
3245         We have other API to mark processes as being in use on iOS. No need to use ImportanceAssertion.
3246
3247         * Platform/IPC/MessageDecoder.cpp:
3248         * Platform/IPC/MessageDecoder.h:
3249         * Platform/IPC/mac/ConnectionMac.cpp:
3250         (IPC::Connection::receiveSourceEventHandler):
3251         * Platform/IPC/mac/ImportanceAssertion.h:
3252
3253 2014-04-13  Commit Queue  <commit-queue@webkit.org>
3254
3255         Unreviewed, rolling out r167168 and r167194.
3256         https://bugs.webkit.org/show_bug.cgi?id=131589
3257
3258         Caused massive ASSERTION failures on the GTK Debug bot
3259         (Requested by philn on #webkit).
3260
3261         Reverted changesets:
3262
3263         "[GTK] Add HighDPI support for non-accelerated compositing
3264         contents"
3265         https://bugs.webkit.org/show_bug.cgi?id=131562
3266         http://trac.webkit.org/changeset/167168
3267
3268         "Unreviewed. Fix GTK+ build with recent cairo and GTK+ after
3269         r167168."
3270         http://trac.webkit.org/changeset/167194
3271
3272 2014-04-13  Carlos Garcia Campos  <cgarcia@igalia.com>
3273
3274         Unreviewed. Fix GTK+ build with recent cairo and GTK+ after r167168.
3275
3276         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3277         (webkitWebViewBaseCreateWebPage):
3278
3279 2014-04-12  Andy Estes  <aestes@apple.com>
3280
3281         [iOS] Move QuickLookHandle from ResourceLoader to WebResourceLoader
3282         https://bugs.webkit.org/show_bug.cgi?id=131580
3283
3284         Reviewed by Darin Adler.
3285
3286         There's no need to bloat WebKit1's ResourceLoader with a pointer that
3287         only WebKit2's WebResourceLoader cares about.
3288
3289         * WebProcess/Network/WebResourceLoader.cpp:
3290         (WebKit::WebResourceLoader::didReceiveResponseWithCertificateInfo):
3291         (WebKit::WebResourceLoader::didReceiveData):
3292         (WebKit::WebResourceLoader::didFinishResourceLoad):
3293         (WebKit::WebResourceLoader::didFailResourceLoad):
3294         * WebProcess/Network/WebResourceLoader.h:
3295         * WebProcess/ios/WebResourceLoaderIOS.mm:
3296         (WebKit::WebResourceLoader::setUpQuickLookHandleIfNeeded):
3297
3298 2014-04-11  Alexey Proskuryakov  <ap@apple.com>
3299
3300         [Mac] Crashes when copying or pasting huge images
3301         https://bugs.webkit.org/show_bug.cgi?id=131576
3302         <rdar://problem/12131833>
3303         <rdar://problem/14427398>
3304
3305         Reviewed by Darin Adler.
3306
3307         Added a few null checks for SharedMemory::create() return value in pasteboard code.
3308         Error handling feels a bit sketchy, but
3309         - I'm not sure what it should look like ideally;
3310         - it matches the kind of error handling we already have in these functions;
3311         - it appears to work reasonably well in practice. We get empty content, which
3312         is not nice, but not particularly problematic either. When copying an animated GIF,
3313         we also get the GIF in RTFD flavor, so even pasting into NSTextViews works!
3314
3315         * Platform/mac/SharedMemoryMac.cpp:
3316         (WebKit::SharedMemory::createFromVMBuffer):
3317         * UIProcess/mac/WebContextMac.mm:
3318         (WebKit::WebContext::getPasteboardBufferForType):
3319         (WebKit::WebContext::readBufferFromPasteboard):
3320         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3321         (WebKit::WebPlatformStrategies::setBufferForType):
3322
3323         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: (WebKit::WebDragClient::declareAndWriteDragImage):
3324         Also renamed some variables to prevent name collisions with with nested scope.
3325
3326 2014-04-11  Ryuan Choi  <ryuan.choi@samsung.com>
3327
3328         Unreviewed build fix on the EFL port after r167152
3329
3330         * WebProcess/WebPage/PageOverlay.cpp:
3331         (WebKit::PageOverlay::bounds):
3332
3333 2014-04-11  Hyowon Kim  <hw1008.kim@samsung.com>
3334
3335         [WK2] WebProcess crashes, when closing window after opening page by means of context menu
3336         https://bugs.webkit.org/show_bug.cgi?id=131439
3337
3338         Reviewed by Tim Horton.
3339
3340         CoordinatedGraphicsLayer calls notifyFlushRequired() through its client when destroyed.
3341         When PageOverlayController::notifyFlushRequired() is called, the DrawingArea could be null
3342         because it's destoryed in WebPage::close().
3343
3344         * WebProcess/WebPage/PageOverlayController.cpp:
3345         (WebKit::PageOverlayController::notifyFlushRequired): Add null check of m_webPage->drawingArea().
3346
3347 2014-04-11  Tim Horton  <timothy_horton@apple.com>
3348
3349         Lots of compositing test failures after r167152
3350         https://bugs.webkit.org/show_bug.cgi?id=131574
3351
3352         Reviewed by Simon Fraser.
3353
3354         * WebProcess/WebPage/PageOverlayController.h:
3355         Skip page overlay layers in layer tree dumps, for consistency between platforms.
3356
3357 2014-04-11  Beth Dakin  <bdakin@apple.com>
3358
3359         Need WK2 API to disable rubber-banding
3360         https://bugs.webkit.org/show_bug.cgi?id=131567
3361
3362         Reviewed by Simon Fraser.
3363
3364         New API allows the client to enable/disable horizontal or vertical rubber-banding. 
3365         By default, rubber-banding is enabled.
3366         * UIProcess/API/C/WKPage.cpp:
3367         (WKPageVerticalRubberBandingIsEnabled):
3368         (WKPageSetEnableVerticalRubberBanding):
3369         (WKPageHorizontalRubberBandingIsEnabled):
3370         (WKPageSetEnableHorizontalRubberBanding):
3371         * UIProcess/API/C/WKPage.h:
3372         * UIProcess/WebPageProxy.cpp:
3373         (WebKit::WebPageProxy::WebPageProxy):
3374         (WebKit::WebPageProxy::setEnableVerticalRubberBanding):
3375         (WebKit::WebPageProxy::verticalRubberBandingIsEnabled):
3376         (WebKit::WebPageProxy::setEnableHorizontalRubberBanding):
3377         (WebKit::WebPageProxy::horizontalRubberBandingIsEnabled):
3378         * UIProcess/WebPageProxy.h:
3379         * WebProcess/WebPage/WebPage.cpp:
3380         (WebKit::WebPage::setEnableVerticalRubberBanding):
3381         (WebKit::WebPage::setEnableHorizontalRubberBanding):
3382         * WebProcess/WebPage/WebPage.h:
3383         * WebProcess/WebPage/WebPage.messages.in:
3384
3385 2014-04-11  Tim Horton  <timothy_horton@apple.com>
3386
3387         Fix the Mac build.
3388
3389         * WebProcess/WebPage/FindController.cpp:
3390         (WebKit::FindController::updateFindIndicator):
3391
3392 2014-04-11  Tim Horton  <timothy_horton@apple.com>
3393
3394         [iOS WebKit2] Find-in-page indicator
3395         https://bugs.webkit.org/show_bug.cgi?id=131510
3396         <rdar://problem/16547777>
3397
3398         Reviewed by Simon Fraser and Enrica Casucci.
3399
3400         * WebKit2.xcodeproj/project.pbxproj:
3401         * WebProcess/WebPage/FindController.cpp:
3402         (WebKit::FindController::updateFindUIAfterPageScroll):
3403         WebKit2 will clear the selection if we reveal it while not enabling selection painting.
3404         So, avoid revealing it.
3405
3406         (WebKit::FindController::findString):
3407         (WebKit::FindController::hideFindIndicator):
3408         (WebKit::FindController::willFindString):
3409         (WebKit::FindController::didFailToFindString):
3410         (WebKit::FindController::didHideFindIndicator):
3411         #if out the cross-platform find indicator code on iOS; it will be replaced
3412         by the code in FindControllerIOS.
3413
3414         * WebProcess/WebPage/FindController.h:
3415
3416         * WebProcess/WebPage/ios/FindControllerIOS.mm: Added.
3417         (highlightColor):
3418         (WebKit::FindIndicatorOverlayClientIOS::drawRect):
3419         Paint the selection (with black text forced on), and the yellow rounded rect
3420         into the indicator page overlay.
3421
3422         (WebKit::FindController::updateFindIndicator):
3423         Create or update a small document-relative page overlay in the selection rect.
3424
3425         (WebKit::FindController::hideFindIndicator):
3426         (WebKit::FindController::willFindString):
3427         (WebKit::FindController::didFailToFindString):
3428         (WebKit::FindController::didHideFindIndicator):
3429         Add willFindString, didFailToFindString, and didHideFindIndicator functions.
3430         They do nothing, except on iOS where they are used to prevent selection change
3431         messages from being dispatched while using find-in-page, and to force
3432         WebCore to compute a selection rect (via updateAppearance) despite the selection not being painted.
3433
3434         * WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
3435         (WebKit::FindIndicatorOverlayClientIOS::setFrame):
3436
3437 2014-04-11  Owen Taylor  <otaylor@redhat.com>
3438
3439         [GTK] Add HighDPI support for non-accelerated compositing contents
3440         https://bugs.webkit.org/show_bug.cgi?id=131562
3441
3442         Reviewed by Martin Robinson.
3443
3444         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3445         (scaleFactorChanged): Added this callback to pass scale changes to the page proxy.
3446         (webkitWebViewBaseCreateWebPage): Attach the callback to the notify signal.
3447         * UIProcess/cairo/BackingStoreCairo.cpp:
3448         (WebKit::createBackingStoreForGTK): Pass the scale factor to the WebCore backing store.
3449         (WebKit::BackingStore::incorporateUpdate): Ditto.
3450
3451 2014-04-10  Jer Noble  <jer.noble@apple.com>
3452
3453         [WK2] Dispatch to main thread's run loop to handle cookie requests.
3454         https://bugs.webkit.org/show_bug.cgi?id=131524
3455
3456         Reviewed by Brady Eidson.
3457
3458         When using synchronous network APIs from the main thread (e.g., -[NSImage
3459         initWithContentsOfURL:]) our cookie shim would attempt to dispath_async
3460         to the main thread to handle the cookie request, and block against the original
3461         request. CFNetwork is still servicing the run loop however, so rather than
3462         dispatch_async to the main queue, use the RunLoop to dispatch to the main thread.
3463
3464         * Shared/mac/CookieStorageShim.mm:
3465         (-[WKNSURLSessionLocal _getCookieHeadersForTask:completionHandler:]):
3466
3467 2014-04-11  Tim Horton  <timothy_horton@apple.com>
3468
3469         Make the stylebot happier with r167154.
3470
3471         * UIProcess/PageClient.h:
3472         * UIProcess/WebPageProxy.h:
3473         * UIProcess/ios/PageClientImplIOS.h:
3474
3475 2014-04-11  Tim Horton  <timothy_horton@apple.com>
3476
3477         [iOS WebKit2] Expose a simplified zoom-to-rect to the WebProcess
3478         https://bugs.webkit.org/show_bug.cgi?id=131563
3479
3480         Reviewed by Simon Fraser.
3481
3482         * UIProcess/PageClient.h:
3483         * UIProcess/WebPageProxy.h:
3484         * UIProcess/WebPageProxy.messages.in:
3485         * UIProcess/ios/PageClientImplIOS.h:
3486         * UIProcess/ios/PageClientImplIOS.mm:
3487         (WebKit::PageClientImpl::zoomToRect):
3488         * UIProcess/ios/WebPageProxyIOS.mm:
3489         (WebKit::WebPageProxy::zoomToRect):
3490         * WebProcess/WebPage/WebPage.h:
3491         * WebProcess/WebPage/ios/WebPageIOS.mm:
3492         (WebKit::WebPage::zoomToRect):
3493         Add a simple message that calls WKContentView's zoom-to-rect code given just a rect and min/max scale.
3494         We will use the center of the rect as the zoom origin, and will try to show the whole rect.
3495
3496 2014-04-10  Jer Noble  <jer.noble@apple.com>
3497
3498         [iOS][WK2] Videos should animate into and out of fullscreen.
3499         https://bugs.webkit.org/show_bug.cgi?id=131497
3500
3501         Reviewed by Simon Fraser.
3502
3503         Pass a starting rect for the enterFullscreen animation and an ending rect
3504         for the exitFullscreen animation.
3505
3506         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
3507         * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in:
3508         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
3509         (WebKit::WebVideoFullscreenManagerProxy::enterFullscreenWithID): Pass initialFrame.
3510         * WebProcess/ios/WebVideoFullscreenManager.mm:
3511         (WebKit::screenRectOfContents): Casts node -> element and returns its screenRect().
3512         (WebKit::WebVideoFullscreenManager::enterFullscreenForNode): Pass initialFrame.
3513         (WebKit::WebVideoFullscreenManager::exitFullscreenForNode): Pass finalFrame.
3514
3515 2014-04-11  Tim Horton  <timothy_horton@apple.com>
3516
3517         Support document-relative and custom-frame page overlays
3518         https://bugs.webkit.org/show_bug.cgi?id=131560
3519         <rdar://problem/16595556>
3520
3521         Reviewed by Simon Fraser.
3522
3523         Add "document-relative" overlays, which attach to (and scroll with) the document,
3524         and can be given a frame rect within the document to avoid overallocation of backing store.
3525
3526         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3527         (WebKit::WebFrameLoaderClient::didChangeScrollOffset):
3528         * WebProcess/WebPage/WebPage.cpp:
3529         (WebKit::WebPage::mainFrame):
3530         (WebKit::WebPage::mainFrameView):
3531         (WebKit::WebPage::didChangeScrollOffsetForFrame):
3532         * WebProcess/WebPage/WebPage.h:
3533         Let the PageOverlayController know *which* frame scrolled, instead of "any frame".
3534
3535         * WebProcess/WebPage/FindController.cpp:
3536         (WebKit::FindController::updateFindUIAfterPageScroll):
3537         Factor out shared code.
3538
3539         (WebKit::FindController::willMoveToWebPage):
3540         (WebKit::FindController::drawRect):
3541         We can use clearRect() instead of a transparency layer and fillRect().
3542         I've looked through all the other overlay clients I know of and none of them
3543         depend on having a transparency layer at the overlay level.
3544
3545         * WebProcess/WebPage/PageOverlay.cpp:
3546         (WebKit::PageOverlay::create):
3547         (WebKit::PageOverlay::PageOverlay):
3548         (WebKit::PageOverlay::bounds):
3549         (WebKit::PageOverlay::frame):
3550         (WebKit::PageOverlay::setFrame):
3551         (WebKit::PageOverlay::drawRect):
3552         Add OverlayType, which allows creation of Document or View relative overlays.
3553         All overlays up to this point are View relative, so we default to that.
3554         Document-relative overlays scroll with the page instead of repainting as
3555         the page scrolls. They can also be given an explicit frame, allowing them
3556         to be smaller than the entire document.
3557
3558         * WebProcess/WebPage/PageOverlay.h:
3559         (WebKit::PageOverlay::overlayType):
3560         (WebKit::PageOverlay::webPage):
3561         (WebKit::PageOverlay::client): Deleted.
3562         * WebProcess/WebPage/PageOverlayController.cpp:
3563         (WebKit::PageOverlayController::initialize):
3564         (WebKit::PageOverlayController::installPageOverlay):
3565         (WebKit::PageOverlayController::uninstallPageOverlay):
3566         (WebKit::PageOverlayController::updateForceSynchronousScrollLayerPositionUpdates):
3567         (WebKit::updateOverlayGeometry):
3568         (WebKit::PageOverlayController::setPageOverlayNeedsDisplay):
3569         (WebKit::PageOverlayController::didChangeViewSize):
3570         (WebKit::PageOverlayController::didChangeDocumentSize):
3571         (WebKit::PageOverlayController::didChangeDeviceScaleFactor):
3572         (WebKit::PageOverlayController::didScrollFrame):
3573         (WebKit::PageOverlayController::flushPageOverlayLayers):
3574         (WebKit::PageOverlayController::didChangeOverlayFrame):
3575         Keep two overlay root layers - one for view-relative
3576         and one for document-relative overlays.
3577         Don't force synchronous scrolling if we only have document-relative overlays.
3578         Update the overlay's position as well as its size whenever necessary.
3579         Update document-relative overlay geometry when the document size changes.
3580         Only explicitly flush view-relative overlays; document-relative ones
3581         are plugged into the WebCore layer tree and flushed along with the page.
3582
3583         * WebProcess/WebPage/PageOverlayController.h:
3584         (WebKit::PageOverlayController::documentOverlayRootLayer):
3585         (WebKit::PageOverlayController::viewOverlayRootLayer):
3586         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
3587         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
3588         (WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
3589         (WebKit::RemoteLayerTreeDrawingArea::mainFrameContentSizeChanged):
3590         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3591         (WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
3592         (WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
3593         Let the PageOverlay controller know when the document size changes.
3594         When we set up compositing, push the document overlay root layer
3595         down into WebCore.
3596
3597 2014-04-11  Pratik Solanki  <psolanki@apple.com>
3598
3599         [iOS WebKit2]: Share NSURLCache directory for webkit processes
3600         https://bugs.webkit.org/show_bug.cgi?id=131513
3601         <rdar://problem/16420859>
3602
3603         Reviewed by Alexey Proskuryakov.
3604
3605         Use iOS specific NSURLCache API to share the cache directory used by the networking process,
3606         web process and Safari.
3607
3608         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3609         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
3610         * WebProcess/cocoa/WebProcessCocoa.mm:
3611         (WebKit::WebProcess::platformInitializeWebProcess):
3612
3613 2014-04-11  Alexey Proskuryakov  <ap@apple.com>
3614
3615         [Mac] Add IconServices to WebProcess sandbox profile
3616         https://bugs.webkit.org/show_bug.cgi?id=131558
3617         <rdar://problem/16552397>
3618
3619         Reviewed by Brady Eidson.
3620
3621         * WebProcess/com.apple.WebProcess.sb.in:
3622
3623 2014-04-11  Antti Koivisto  <antti@apple.com>
3624
3625         Pipe initial scale factor to TileController
3626         https://bugs.webkit.org/show_bug.cgi?id=131521
3627
3628         Reviewed by Tim Horton.
3629
3630         * WebProcess/WebPage/ios/WebPageIOS.mm:
3631         (WebKit::WebPage::viewportConfigurationChanged):
3632
3633 2014-04-10  Chris Fleizach  <cfleizach@apple.com>
3634
3635         AX: WebProcess at com.apple.WebCore: WebCore::AXObjectCache::rootObject + 18
3636         https://bugs.webkit.org/show_bug.cgi?id=131522
3637
3638         Reviewed by Anders Carlsson.
3639
3640         Protect against documents that have had their render tree destroyed, and no longer return a valid cache.
3641
3642         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
3643
3644 2014-04-11  Brent Fulgham  <bfulgham@apple.com>
3645
3646         [Mac] Prevent crash when exiting fullscreen mode
3647         https://bugs.webkit.org/show_bug.cgi?id=131528
3648
3649         Reviewed by Jer Noble.
3650
3651         * UIProcess/mac/WKFullScreenWindowController.mm:
3652         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
3653         Clean up the _scaleAnimation controller, not just the _fadeAnimation controller.
3654         (-[WKFullScreenWindowController close]): If we are doing an immediate
3655         close of the view, we need to stop animations so we avoid any
3656         final timer events from interacting with invalid window handles.
3657
3658 2014-04-11  Carlos Garcia Campos  <cgarcia@igalia.com>
3659
3660         wk2-gtk does not display anything
3661         https://bugs.webkit.org/show_bug.cgi?id=125558
3662
3663         Reviewed by Martin Robinson.
3664
3665         Remove fcntl call to set access mode flags on the duplicated files
3666         descriptor. Those flags are ignored in Linux and make fcntl to
3667         fail in FreeBSD. We should handle the case where the passed
3668         protection is ReadOnly.
3669         Thanks to Raphael Kubo da Costa who proposed the solution.
3670
3671         * Platform/unix/SharedMemoryUnix.cpp:
3672         (WebKit::SharedMemory::createHandle):
3673         (WebKit::accessModeFile): Deleted.
3674
3675 2014-04-11  Zan Dobersek  <zdobersek@igalia.com>
3676
3677         [GTK][WK2] Move Vector objects into WebEditorClient::executePendingEditorCommands() invocations
3678         https://bugs.webkit.org/show_bug.cgi?id=131454
3679
3680         Reviewed by Carlos Garcia Campos.
3681
3682         * WebProcess/WebCoreSupport/WebEditorClient.h:
3683         * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
3684         (WebKit::WebEditorClient::executePendingEditorCommands): Take a const reference of the Vector
3685         object to avoid unnecessary copies. Also deploy two range-based for loops and efficiently move
3686         the Editor::Command objects into the other Vector.
3687
3688 2014-04-10  Dan Bernstein  <mitz@apple.com>
3689
3690         <rdar://problem/16582465> [Cocoa] Avoid casts from CF types to unrelated Objective-C types
3691         https://bugs.webkit.org/show_bug.cgi?id=131529
3692
3693         Reviewed by Mark Rowe.
3694
3695         * Shared/API/c/cf/WKStringCF.mm:
3696         (WKStringCreateWithCFString): Cast the CFStringRef into its toll-free-bridged counterpart,
3697         NSString, then cast the NSString into a WKNSString.
3698         * Shared/API/c/cf/WKURLCF.mm:
3699         (WKURLCreateWithCFURL): Cast the CFURLRef into its toll-free-bridged counterpart, NSURL,
3700         then cast the NSURL into a WKNSURL.
3701
3702 2014-04-10  Dan Bernstein  <mitz@apple.com>
3703
3704         BundlePageDiagnosticLoggingClient leaks every string passing through it.
3705         https://bugs.webkit.org/show_bug.cgi?id=130140
3706
3707         Reviewed by Brent Fulgham.
3708
3709         * WebProcess/InjectedBundle/InjectedBundlePageDiagnosticLoggingClient.cpp:
3710         (WebKit::InjectedBundlePageDiagnosticLoggingClient::logDiagnosticMessage): Don’t copy the
3711         strings passed into the bundle client.
3712
3713 2014-04-10  Benjamin Poulain  <bpoulain@apple.com>
3714
3715         Try to fix the debug bots after r167102
3716
3717         * WebProcess/cocoa/WebProcessCocoa.mm:
3718         (WebKit::WebProcess::platformInitializeWebProcess):
3719
3720 2014-04-10  Gavin Barraclough  <barraclough@apple.com>
3721
3722         Add user default for FTL JIT
3723         https://bugs.webkit.org/show_bug.cgi?id=131520
3724
3725         Reviewed by Benjamin Poulain.
3726
3727         * Shared/WebProcessCreationParameters.cpp:
3728         (WebKit::WebProcessCreationParameters::decode):
3729         * UIProcess/mac/WebContextMac.mm:
3730         (WebKit::registerUserDefaultsIfNeeded):
3731         (WebKit::WebContext::platformInitializeWebProcess):
3732             - D'oh, whitespace.
3733
3734 2014-04-10  Gavin Barraclough  <barraclough@apple.com>
3735
3736         Add user default for FTL JIT
3737         https://bugs.webkit.org/show_bug.cgi?id=131520
3738
3739         Reviewed by Benjamin Poulain.
3740
3741         * Shared/WebProcessCreationParameters.cpp:
3742         (WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
3743         (WebKit::WebProcessCreationParameters::encode):
3744         (WebKit::WebProcessCreationParameters::decode):
3745         * Shared/WebProcessCreationParameters.h:
3746             - pass setting to WebContent process.
3747         * UIProcess/mac/WebContextMac.mm:
3748         (WebKit::registerUserDefaultsIfNeeded):
3749         (WebKit::WebContext::platformInitializeWebProcess):
3750             - read user default.
3751         * WebProcess/cocoa/WebProcessCocoa.mm:
3752         (WebKit::WebProcess::platformInitializeWebProcess):
3753             - set JSC::Option.
3754
3755 2014-04-10  Dan Bernstein  <mitz@apple.com>
3756
3757         [Cocoa] Notify the form delegate when the custom button in the form accessory view is tapped
3758         https://bugs.webkit.org/show_bug.cgi?id=131518
3759
3760         Reviewed by Tim Horton.
3761
3762         * UIProcess/API/Cocoa/_WKFormDelegate.h: Declared new delegate method.
3763         * UIProcess/ios/WKContentViewInteraction.mm:
3764         (-[WKContentView accessoryAutoFill]): Call the new delegate method.
3765
3766 2014-04-10  Commit Queue  <commit-queue@webkit.org>
3767
3768         Unreviewed, rolling out r167097.
3769         https://bugs.webkit.org/show_bug.cgi?id=131519
3770
3771         there was already a mechanism for this, and this was
3772         incomplete anyway (Requested by thorton on #webkit).
3773
3774         Reverted changeset:
3775
3776         "[iOS WebKit2] Disable the find overlay for now"
3777         https://bugs.webkit.org/show_bug.cgi?id=131509
3778         http://trac.webkit.org/changeset/167097
3779
3780 2014-04-10  Tim Horton  <timothy_horton@apple.com>
3781
3782         [iOS WebKit2] Disable the find overlay for now
3783         https://bugs.webkit.org/show_bug.cgi?id=131509
3784
3785         Reviewed by Adele Peterson.
3786
3787         * Shared/WebPreferencesStore.h:
3788         * WebProcess/WebPage/FindController.cpp:
3789         (WebKit::FindController::FindController):
3790         (WebKit::FindController::hideFindOverlay):
3791         (WebKit::FindController::hideFindUI):
3792         (WebKit::FindController::setShouldShowOverlay):
3793         * WebProcess/WebPage/FindController.h:
3794         * WebProcess/WebPage/WebPage.cpp:
3795         (WebKit::WebPage::updatePreferences):
3796         Add a setting allowing us to turn off the find-in-page overlay on iOS.
3797
3798 2014-04-10  Sergio Villar Senin  <svillar@igalia.com>
3799
3800         Unreviewed GTK build fix after r167074.
3801
3802         This involves replacing resetDragSession() by
3803         resetCurrentDragInformation() and dragSession().operation by
3804         currentDragOperation().
3805
3806         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3807         (webkitWebViewBaseDragDataReceived):
3808         (webkitWebViewBaseDragMotion):
3809         (dragExitedCallback):
3810
3811 2014-04-10  Owen Taylor  <otaylor@redhat.com>
3812
3813         [Cairo] Implement ShareableBitmap::paint() with scale factor
3814         https://bugs.webkit.org/show_bug.cgi?id=64665
3815
3816         Reviewed by Martin Robinson.
3817
3818         * Shared/cairo/ShareableBitmapCairo.cpp (WebKit::ShareableBitmap::paint):
3819
3820 2014-04-10  Enrica Casucci  <enrica@apple.com>
3821
3822         [iOS WebKit2] Support phraseboundary gesture recognizer for CJK.
3823         https://bugs.webkit.org/show_bug.cgi?id=131493
3824         <rdar://problem/16319583>
3825
3826         Reviewed by Benjamin Poulain.
3827
3828         On iOS it is possible with a gesture to change the selection
3829         within the marked text.
3830         Changing the selection triggers also the update of the inline candidates
3831         over the keyboard area.
3832         The patch adds the logic to decide whether the gesture can begin
3833         as well as the code for the movement of
3834         the selection within the marked range.
3835         The gesture is allowed to start within a given radius from the marked
3836         area.
3837
3838         * Shared/InteractionInformationAtPosition.cpp:
3839         (WebKit::InteractionInformationAtPosition::encode):
3840         (WebKit::InteractionInformationAtPosition::decode):
3841         * Shared/InteractionInformationAtPosition.h:
3842         (WebKit::InteractionInformationAtPosition::InteractionInformationAtPosition):
3843         * Shared/ios/GestureTypes.h:
3844         * UIProcess/WebPageProxy.cpp:
3845         (WebKit::WebPageProxy::editorStateChanged):
3846         * UIProcess/ios/WKContentViewInteraction.mm:
3847         (-[WKContentView pointIsNearMarkedText:]):
3848         (toGestureType):
3849         (toUIWKGestureType):
3850         * WebProcess/WebPage/ios/WebPageIOS.mm:
3851         (WebKit::WebPage::selectWithGesture):
3852         (WebKit::WebPage::getPositionInformation):
3853
3854 2014-04-10  Enrica Casucci  <enrica@apple.com>
3855
3856         Unreviewed iOS build fix after http://trac.webkit.org/changeset/167074
3857
3858         * UIProcess/WebPageProxy.cpp:
3859         (WebKit::WebPageProxy::WebPageProxy):
3860
3861 2014-04-10  Alexey Proskuryakov  <ap@apple.com>
3862
3863         Gtk build fix.
3864
3865         * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::performDragControllerAction):
3866
3867 2014-04-09  Alexey Proskuryakov  <ap@apple.com>
3868
3869         Eliminate DragSession structure
3870         https://bugs.webkit.org/show_bug.cgi?id=131465
3871
3872         Reviewed by Benjamin Poulain.
3873
3874         * Scripts/webkit2/messages.py:
3875         (struct_or_class):
3876         * Shared/WebCoreArgumentCoders.cpp:
3877         (IPC::ArgumentCoder<DragSession>::encode): Deleted.
3878         (IPC::ArgumentCoder<DragSession>::decode): Deleted.
3879         * Shared/WebCoreArgumentCoders.h:
3880         * UIProcess/API/mac/WKView.mm:
3881         (-[WKView draggingEntered:]):
3882         (-[WKView draggingUpdated:]):
3883         * UIProcess/WebPageProxy.cpp:
3884         (WebKit::WebPageProxy::WebPageProxy):
3885         (WebKit::WebPageProxy::didPerformDragControllerAction):
3886         * UIProcess/WebPageProxy.h:
3887         (WebKit::WebPageProxy::currentDragOperation):
3888         (WebKit::WebPageProxy::currentDragIsOverFileInput):
3889         (WebKit::WebPageProxy::currentDragNumberOfFilesToBeAccepted):
3890         (WebKit::WebPageProxy::resetCurrentDragInformation):
3891         (WebKit::WebPageProxy::dragSession): Deleted.
3892         (WebKit::WebPageProxy::resetDragSession): Deleted.
3893         * UIProcess/WebPageProxy.messages.in:
3894         * WebProcess/WebPage/WebPage.cpp:
3895         (WebKit::WebPage::performDragControllerAction):
3896
3897 2014-04-10  Martin Robinson  <mrobinson@igalia.com>
3898
3899         [GTK] LayerTreeHostGtk is creating a software scene graph
3900         https://bugs.webkit.org/show_bug.cgi?id=131471
3901
3902         Reviewed by Sergio Villar Senin.
3903
3904         At some point, a regression was introduced that sent the GTK+ WebKit2 scenegraph down the
3905         software route. The rest of the file depends on the fact that the TextureMapper is the OpenGL
3906         variety, so we should force that explicitly. This is causing crashes locally and soon we
3907         should be able to test this directly.
3908
3909         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
3910         (WebKit::LayerTreeHostGtk::initialize): Force the use of the OpenGL scenegraph.
3911
3912 2014-04-09  Jeremy Jones  <jeremyj@apple.com>
3913
3914         Fix build failure when #if USE(XPC_SERVICES) is false.
3915         https://bugs.webkit.org/show_bug.cgi?id=131474
3916
3917         Reviewed by Dan Bernstein.
3918
3919         Fix build. 
3920
3921         * UIProcess/ios/WebProcessProxyIOS.mm:
3922         Add #if around BackgroundTabFlags ForegroundTabFlags to prevent unused variable error.
3923
3924 2014-04-09  Ryuan Choi  <ryuan.choi@samsung.com>
3925
3926         [EFL][WK2] Add API to set preferred languages
3927         https://bugs.webkit.org/show_bug.cgi?id=131435
3928
3929         Reviewed by Gyuyoung Kim.
3930
3931         Add ewk_context_preferred_languages_set to change the list of "Accept-Language".
3932         This list is used to receive alternative version of contents, which is related
3933         to specified languages from the contents provider.
3934
3935         * UIProcess/API/efl/ewk_context.cpp:
3936         (ewk_context_preferred_languages_set):
3937         * UIProcess/API/efl/ewk_context.h:
3938         * UIProcess/API/efl/tests/test_ewk2_context.cpp:
3939         (serverCallback):
3940         (TEST_F): Added test case for ewk_context_preferred_languages_set
3941
3942 2014-04-09  Benjamin Poulain  <bpoulain@apple.com>
3943
3944         [iOS][WK2] Add the initial WebProcess handling of animated resize for rotation
3945         https://bugs.webkit.org/show_bug.cgi?id=131469
3946
3947         Reviewed by Tim Horton.
3948
3949         Add the basic handling of dynamic resize from the WebProcess.
3950
3951         On animated resize, the UIProcess decides new target rects and scale. The information
3952         is then passed to the WebProcess to update the content.
3953
3954         For various reason, the target rects and scale computed by the UIProcess can be incorrect
3955         (for example, if viewport constraints limit the scale).
3956
3957         In those cases, the WebProcess has all the information to compute a better target. This patch
3958         adds such a basic update mechanism.
3959
3960         Once the new values are computed, they are sent back to the UIProcess. If the rotation animation
3961         is still ongoing, we do not want mess with it. What we do is set a temporary transform on the subviews
3962         and restore the real value after the animation. The key is to have the two matrix multiplying to the end
3963         value so that there is no visual difference.
3964
3965         * UIProcess/API/Cocoa/WKWebView.mm:
3966         (-[WKWebView _didCommitLayerTree:WebKit::]):
3967         (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:]):
3968         (setViewportConfigurationMinimumLayoutSize):
3969         (-[WKWebView _frameOrBoundsChanged]):
3970         (-[WKWebView _setMinimumLayoutSizeOverride:]):
3971         (-[WKWebView _beginAnimatedResizeToSize:obscuredInsets:minimumLayoutSizeOverride:]):
3972         (-[WKWebView _endAnimatedResize]):
3973         * UIProcess/API/Cocoa/WKWebViewInternal.h:
3974         * UIProcess/API/ios/WKViewIOS.mm:
3975         (-[WKView _frameOrBoundsChanged]):
3976         (-[WKView setMinimumLayoutSizeOverride:]):
3977         * UIProcess/PageClient.h:
3978         * UIProcess/WebPageProxy.h:
3979         * UIProcess/WebPageProxy.messages.in:
3980         * UIProcess/ios/PageClientImplIOS.h:
3981         * UIProcess/ios/PageClientImplIOS.mm:
3982         (WebKit::PageClientImpl::dynamicViewportUpdateChangedTarget):
3983         * UIProcess/ios/WKContentView.h:
3984         * UIProcess/ios/WKContentView.mm:
3985         (-[WKContentView setMinimumLayoutSize:]): Deleted.
3986         * UIProcess/ios/WebPageProxyIOS.mm:
3987         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
3988         (WebKit::WebPageProxy::dynamicViewportUpdateChangedTarget):
3989         * WebProcess/WebPage/WebPage.h:
3990         * WebProcess/WebPage/WebPage.messages.in:
3991         * WebProcess/WebPage/ios/WebPageIOS.mm:
3992         (WebKit::WebPage::dynamicViewportSizeUpdate):
3993
3994 2014-04-09  Martin Robinson  <mrobinson@igalia.com>
3995
3996         Try to fix the GTK+ build after resetDragOperation rename
3997
3998         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3999         (webkitWebViewBaseDragDataReceived): Rename resetDragOperation to resetDragSession.
4000         (dragExitedCallback): Ditto.
4001
4002 2014-04-09  Jeremy Jones  <jeremyj@apple.com>
4003
4004         Enable fullscreen captions selection
4005         https://bugs.webkit.org/show_bug.cgi?id=131069
4006
4007         Reviewed by Eric Carlson.
4008
4009         Enable media selection in fullscreen.
4010         setLegibleMediaSelectionOptions/setAudioMediaSelectionOptions provide a list of options.
4011         selectAudioMediaOption/selectLegibleMediaOption change the selected option.
4012
4013         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
4014         Add selectAudioMediaOption/selectLegibleMediaOption
4015
4016         * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in:
4017         Add selectAudioMediaOption/selectLegibleMediaOption
4018
4019         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
4020         (WebKit::WebVideoFullscreenManagerProxy::selectAudioMediaOption):
4021         Add selectAudioMediaOption
4022
4023         (WebKit::WebVideoFullscreenManagerProxy::selectLegibleMediaOption):
4024         Add selectLegibleMediaOption
4025
4026         * WebProcess/ios/WebVideoFullscreenManager.h:
4027         Add setAudioMediaSelectionOptions/setLegibleMediaSelectionOptions
4028
4029         * WebProcess/ios/WebVideoFullscreenManager.messages.in:
4030         Add setAudioMediaSelectionOptions/setLegibleMediaSelectionOptions
4031
4032         * WebProcess/ios/WebVideoFullscreenManager.mm:
4033         (WebKit::WebVideoFullscreenManager::setAudioMediaSelectionOptions):
4034         Add setAudioMediaSelectionOptions
4035
4036         (WebKit::WebVideoFullscreenManager::setLegibleMediaSelectionOptions):
4037         Add setLegibleMediaSelectionOptions
4038
4039 2014-04-09  Alexey Proskuryakov  <ap@apple.com>
4040
4041         Rename some dragging functions
4042         https://bugs.webkit.o