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