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