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