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