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