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