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