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