Phone number highlights should always be visible if the mouse hovers over.
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 <<<<<<< HEAD
2 2014-07-10  Timothy Horton  <timothy_horton@apple.com>
3
4         Assertions or crashes under _takeViewSnapshot when restoring windows
5         https://bugs.webkit.org/show_bug.cgi?id=134792
6
7         Reviewed by Simon Fraser.
8
9         * UIProcess/API/mac/WKView.mm:
10         (-[WKView _takeViewSnapshot]):
11         Taking a window-server snapshot of a non-visible window tends to not succeed.
12
13 2014-07-09  Pratik Solanki  <psolanki@apple.com>
14
15         Buffer CSS and JS resources in network process before sending over to web process
16         https://bugs.webkit.org/show_bug.cgi?id=134560
17         <rdar://problem/16737186>
18
19         Reviewed by Antti Koivisto.
20
21         For CSS and JS resources, ask the network process to buffer the entire resource instead of
22         sending it to web process in chunks since the web process can't do anything with a partial
23         css or js file.
24
25         * NetworkProcess/NetworkResourceLoader.cpp:
26         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
27         * Shared/Network/NetworkResourceLoadParameters.cpp:
28         (WebKit::NetworkResourceLoadParameters::NetworkResourceLoadParameters):
29         (WebKit::NetworkResourceLoadParameters::encode):
30         (WebKit::NetworkResourceLoadParameters::decode):
31         * Shared/Network/NetworkResourceLoadParameters.h:
32         * WebProcess/Network/WebResourceLoadScheduler.cpp:
33         (WebKit::WebResourceLoadScheduler::scheduleLoad):
34
35 2014-07-09  Benjamin Poulain  <bpoulain@apple.com>
36
37         [iOS][WK2] Disable text quantization while actively changing the page's scale factor
38         https://bugs.webkit.org/show_bug.cgi?id=134781
39
40         Reviewed by Tim Horton and Myles C. Maxfield.
41
42         While zooming a page, text quantization causes glyphs to "move" in order to get to the closest
43         boundary for the current scale factor.
44
45         We do not want this to happen while dynamically changing the scale factor because the effect
46         is visible. To avoid this, we disable text quantization if the page's scale factor changes
47         in response to a non-stable contentRect update.
48
49         * WebProcess/WebCoreSupport/WebChromeClient.h:
50         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
51         (WebKit::WebChromeClient::hasStablePageScaleFactor):
52         * WebProcess/WebPage/WebPage.cpp:
53         (WebKit::WebPage::WebPage):
54         * WebProcess/WebPage/WebPage.h:
55         (WebKit::WebPage::hasStablePageScaleFactor):
56         * WebProcess/WebPage/ios/WebPageIOS.mm:
57         (WebKit::WebPage::updateVisibleContentRects):
58
59 2014-07-09  Joseph Pecoraro  <pecoraro@apple.com>
60
61         [iOS] Use UIAlertController API in WKFileUploadPanel instead of SPI
62         https://bugs.webkit.org/show_bug.cgi?id=134777
63
64         Reviewed by Sam Weinig.
65
66         * UIProcess/ios/forms/WKFileUploadPanel.mm:
67         (-[WKFileUploadPanel _showMediaSourceSelectionSheet]):
68
69 2014-07-09  Shivakumar JM  <shiva.jm@samsung.com>
70
71         [EFL][WK2] Add new Public API in ewk_download_job.h to get size of the data already downloaded.
72         https://bugs.webkit.org/show_bug.cgi?id=134759
73
74         Reviewed by Gyuyoung Kim.
75
76         Add new API in ewk_download_job.h to get size of the data already downloaded.
77
78         * UIProcess/API/efl/ewk_download_job.cpp:
79         (ewk_download_job_received_data_length_get):
80         (EwkDownloadJob::receivedData):
81         * UIProcess/API/efl/ewk_download_job.h:
82         * UIProcess/API/efl/ewk_download_job_private.h:
83         * UIProcess/API/efl/tests/test_ewk2_download_job.cpp:
84         (EWK2DownloadJobTest::on_download_requested):
85         (EWK2DownloadJobTest::on_download_finished):
86
87 2014-07-09  Enrica Casucci  <enrica@apple.com>
88
89         REGRESSION(r170858): Safari freezes upon making a search on a website (yelp.com).
90         https://bugs.webkit.org/show_bug.cgi?id=134791
91         <rdar://problem/17616971>
92
93         Reviewed by Benjamin Poulain.
94
95         After r170858 we notify the keyboard too often about
96         the changed selection. This patch removes the notification
97         until we find a better way to do it that doesn't cause
98         deadlocks.
99
100         * UIProcess/ios/WKContentViewInteraction.mm:
101         (-[WKContentView _selectionWillChange]):
102         (-[WKContentView _selectionChanged]):
103
104 2014-07-09  Anders Carlsson  <andersca@apple.com>
105
106         Safari showing blank pages
107         https://bugs.webkit.org/show_bug.cgi?id=134790
108         <rdar://problem/17617166>
109
110         Reviewed by Simon Fraser.
111
112         * UIProcess/API/Cocoa/WKWebView.mm:
113         (-[WKWebView initWithFrame:configuration:]):
114         Make sure to add the content view to the scroll view.
115
116 2014-07-09  Anders Carlsson  <andersca@apple.com>
117
118         Closed web views should never create new web processes
119         https://bugs.webkit.org/show_bug.cgi?id=134787
120         <rdar://problem/16892526>
121
122         Reviewed by Simon Fraser.
123
124         * UIProcess/API/Cocoa/WKWebView.mm:
125         (-[WKWebView loadHTMLString:baseURL:]):
126         (-[WKWebView reload]):
127         (-[WKWebView reloadFromOrigin]):
128         Return nil if the returned navigation ID is 0.
129
130         * UIProcess/WebPageProxy.cpp:
131         (WebKit::WebPageProxy::reattachToWebProcess):
132         Assert that the page is not closed.
133
134         (WebKit::WebPageProxy::reattachToWebProcessWithItem):
135         (WebKit::WebPageProxy::loadRequest):
136         (WebKit::WebPageProxy::loadFile):
137         (WebKit::WebPageProxy::loadData):
138         (WebKit::WebPageProxy::loadHTMLString):
139         (WebKit::WebPageProxy::loadAlternateHTMLString):
140         (WebKit::WebPageProxy::loadPlainTextString):
141         (WebKit::WebPageProxy::loadWebArchiveData):
142         Add early returns if the page is closed.
143
144         * UIProcess/WebPageProxy.h:
145
146 2014-07-09  Anders Carlsson  <andersca@apple.com>
147
148         Support transparent WKWebViews
149         https://bugs.webkit.org/show_bug.cgi?id=134779
150         <rdar://problem/17351058>
151
152         Reviewed by Tim Horton.
153
154         * UIProcess/API/Cocoa/WKWebView.mm:
155         (-[WKWebView initWithFrame:configuration:]):
156         Call _updateScrollViewBackground instead of setting the background color.
157
158         (contentZoomScale):
159         Use dot notation.
160
161         (scrollViewBackgroundColor):
162         Helper function that returns the scroll view background color. 
163         If the web view isn't opaque, we want the scroll view to be transparent.
164
165         (-[WKWebView _updateScrollViewBackground]):
166         Call scrollViewBackgroundColor.
167
168         (-[WKWebView setOpaque:]):
169         Call WebPageProxy::setDrawsBackground and update the scroll view background.
170
171         (-[WKWebView setBackgroundColor:]):
172         Call setBackgroundColor on the content view.
173
174 2014-07-09  Andy Estes  <aestes@apple.com>
175
176         [iOS] WebKit can crash under QuickLookDocumentData::encode() when viewing a QuickLook preview
177         https://bugs.webkit.org/show_bug.cgi?id=134780
178
179         Reviewed by Tim Horton.
180
181         Don't use CFDataCreateWithBytesNoCopy() when we can't guarantee the lifetime of the copied-from DataReference
182         will match or exceed that of the CFDataRef. Copy the data instead.
183
184         * WebProcess/Network/WebResourceLoader.cpp:
185         (WebKit::WebResourceLoader::didReceiveData):
186
187 2014-07-09  Pratik Solanki  <psolanki@apple.com>
188
189         Move resource buffering from SynchronousNetworkLoaderClient to NetworkResourceLoader
190         https://bugs.webkit.org/show_bug.cgi?id=134732
191
192         Reviewed by Darin Adler.
193
194         Buffer the resource in NetworkResourceLoader instead of SynchronousNetworkLoaderClient. This
195         is in preparation for bug 134560 where we will be supporting JS and CSS resource buffering
196         that uses AsynchronousNetworkLoaderClient.
197
198         * NetworkProcess/NetworkResourceLoader.cpp:
199         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
200         (WebKit::NetworkResourceLoader::didReceiveBuffer):
201         (WebKit::NetworkResourceLoader::didFinishLoading):
202         * NetworkProcess/NetworkResourceLoader.h:
203         (WebKit::NetworkResourceLoader::bufferedData):
204         * NetworkProcess/SynchronousNetworkLoaderClient.cpp:
205         (WebKit::SynchronousNetworkLoaderClient::didReceiveBuffer):
206         (WebKit::SynchronousNetworkLoaderClient::didFinishLoading):
207         (WebKit::SynchronousNetworkLoaderClient::didFail):
208         (WebKit::SynchronousNetworkLoaderClient::sendDelayedReply):
209         * NetworkProcess/SynchronousNetworkLoaderClient.h:
210
211 2014-07-09  Benjamin Poulain  <bpoulain@apple.com>
212
213         [iOS][WK2] subviews of the unscaled view drift out during CA animations
214         https://bugs.webkit.org/show_bug.cgi?id=134751
215
216         Reviewed by Enrica Casucci.
217
218         It is not possible to animate the WKContentView and the inverse view in such a way
219         that the combined matrix remain the identity for every frame of the animation.
220
221         This patch solves the issue by moving the unscaled view as a sibling of WKContentView
222         instead of a child so that we do not need to update two scales simultaneously.
223
224         * UIProcess/API/Cocoa/WKWebView.mm:
225         (-[WKWebView initWithFrame:configuration:]):
226         (-[WKWebView _processDidExit]):
227         (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:]):
228         Set the z scale to 1 or no coordinate transform will work with this view.
229
230         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
231         (-[WKWebView _endAnimatedResize]):
232         * UIProcess/ios/WKContentView.mm:
233         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):
234         * UIProcess/ios/WKContentViewInteraction.h:
235         * UIProcess/ios/WKContentViewInteraction.mm:
236         (-[WKContentView setupInteraction]):
237         Since we need to observe changes inside the animation block, the code now use KVO to observe changes of scale.
238
239         (-[WKContentView cleanupInteraction]):
240         (-[WKContentView unscaledView]):
241         (-[WKContentView inverseScale]):
242         (-[WKContentView observeValueForKeyPath:ofObject:change:context:]):
243         We update the utility views as usual. The extra bits here are to deal with views coming in during an animation.
244
245         If a new utility view comes in during a scaling animation, we do not want to start a new animation with the same curve
246         to end up at the right place. To avoid any issue, we just hide the view until the animation is finished.
247
248         (-[WKContentView hitTest:withEvent:]):
249         (-[WKContentView _showTapHighlight]):
250         (-[WKContentView _updateUnscaledView]): Deleted.
251
252 2014-07-09  Tim Horton  <timothy_horton@apple.com>
253
254         Use IOSurface ViewSnapshots everywhere on Mac, remove JPEG encoding path
255         https://bugs.webkit.org/show_bug.cgi?id=134773
256
257         Reviewed by Anders Carlsson.
258
259         * UIProcess/API/mac/WKView.mm:
260         (-[WKView _takeViewSnapshot]):
261         * UIProcess/mac/ViewSnapshotStore.h:
262         * UIProcess/mac/ViewSnapshotStore.mm:
263         (WebKit::ViewSnapshotStore::ViewSnapshotStore):
264         (WebKit::ViewSnapshotStore::~ViewSnapshotStore):
265         (WebKit::ViewSnapshotStore::recordSnapshot):
266         (WebKit::ViewSnapshot::clearImage):
267         (WebKit::ViewSnapshot::asLayerContents):
268         (WebKit::createIOSurfaceFromImage): Deleted.
269         (WebKit::compressImageAsJPEG): Deleted.
270         (WebKit::ViewSnapshotStore::reduceSnapshotMemoryCost): Deleted.
271         (WebKit::ViewSnapshotStore::didCompressSnapshot): Deleted.
272         Remove all ViewSnapshot(Store) code related to JPEG-encoded snapshots.
273         Remove the "image" member on ViewSnapshot; Mac will always start out with an IOSurface instead.
274         Adopt WebCore::IOSurface::createFromImage to make that happen.
275         Add a comment noting that if a snapshot comes back empty, we should throw it away completely.
276
277 2014-07-09  Anders Carlsson  <andersca@apple.com>
278
279         RemoteLayerBackingStore::ensureBackingStore should ensure that the entire backing store gets redrawn
280         https://bugs.webkit.org/show_bug.cgi?id=134772
281
282         Reviewed by Tim Horton.
283
284         * Shared/mac/RemoteLayerBackingStore.h:
285         (WebKit::RemoteLayerBackingStore::Buffer::operator bool):
286         * Shared/mac/RemoteLayerBackingStore.mm:
287         (WebKit::RemoteLayerBackingStore::ensureBackingStore):
288
289 2014-07-09  KwangHyuk Kim  <hyuki.kim@samsung.com>
290
291         [EFL] Fix crash caused by invalid cursor image.
292         https://bugs.webkit.org/show_bug.cgi?id=134663
293
294         Reviewed by Gyuyoung Kim.
295
296         Remove calling of updateCursor since the custom cursor image is invalid once a mouse is out of the webview.
297
298         * UIProcess/API/efl/EwkView.cpp:
299         (EwkViewEventHandler<EVAS_CALLBACK_MOUSE_IN>::handleEvent):
300
301 2014-07-08  Tim Horton  <timothy_horton@apple.com>
302
303         Remove WebBackForwardListItems when their owning page goes away
304         https://bugs.webkit.org/show_bug.cgi?id=134709
305         <rdar://problem/17584645>
306
307         Reviewed by Dan Bernstein.
308
309         * Shared/WebBackForwardListItem.cpp:
310         (WebKit::WebBackForwardListItem::create):
311         (WebKit::WebBackForwardListItem::WebBackForwardListItem):
312         * Shared/WebBackForwardListItem.h:
313         (WebKit::WebBackForwardListItem::pageID):
314         Add the associated PageID to the WebBackForwardListItem.
315
316         * UIProcess/WebBackForwardList.cpp:
317         (WebKit::WebBackForwardList::restoreFromState):
318         Push the current PageID onto the WebBackForwardListItem.
319
320         * UIProcess/WebProcessProxy.cpp:
321         (WebKit::WebProcessProxy::removeWebPage):
322         Remove all of the WebBackForwardListItems from m_backForwardListItemMap when
323         the page they are associated with is removed.
324
325         (WebKit::WebProcessProxy::addBackForwardItem):
326         Push the PageID from the WebProcess onto the WebBackForwardListItem.
327
328         * UIProcess/WebProcessProxy.h:
329         * UIProcess/WebProcessProxy.messages.in:
330         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
331         (WebKit::idToHistoryItemMap):
332         (WebKit::historyItemToIDMap):
333         (WebKit::updateBackForwardItem):
334         (WebKit::WebBackForwardListProxy::addItemFromUIProcess):
335         (WebKit::WK2NotifyHistoryItemChanged):
336         (WebKit::WebBackForwardListProxy::idForItem):
337         (WebKit::WebBackForwardListProxy::addItem):
338         (WebKit::WebBackForwardListProxy::goToItem):
339         (WebKit::WebBackForwardListProxy::close):
340         * WebProcess/WebPage/WebBackForwardListProxy.h:
341         * WebProcess/WebPage/WebPage.cpp:
342         (WebKit::WebPage::restoreSession):
343         Keep track of the PageID that back-forward items were created by.
344         Pass the PageID along when registering WebBackForwardListItems.
345
346 2014-07-08  Tim Horton  <timothy_horton@apple.com>
347
348         [WK2] Expose a few drawing/compositing settings on WKPreferences(Private)
349         https://bugs.webkit.org/show_bug.cgi?id=134645
350
351         Reviewed by Dan Bernstein.
352
353         * UIProcess/API/Cocoa/WKPreferences.mm:
354         (-[WKPreferences _compositingBordersVisible]):
355         (-[WKPreferences _setCompositingBordersVisible:]):
356         (-[WKPreferences _compositingRepaintCountersVisible]):
357         (-[WKPreferences _setCompositingRepaintCountersVisible:]):
358         (-[WKPreferences _tiledScrollingIndicatorVisible]):
359         (-[WKPreferences _setTiledScrollingIndicatorVisible:]):
360         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
361         Expose layer borders, repaint counters, and the tiled scrolling indicator on WKPreferences, as SPI.
362 =======
363 2014-07-09  Brady Eidson  <beidson@apple.com>
364
365         Phone number highlights should always be visible if the mouse hovers over.
366         <rdar://problem/17527476> and https://bugs.webkit.org/show_bug.cgi?id=134784
367
368         Reviewed by Tim Horton.
369
370         This is a fairly extensive rewrite of ServicesOverlayController.
371         It allows one selection highlight for the entire selection, and as many telephone number highlights as there are numbers.
372         If a telephone number highlight is hovered over, it wins and is painted.
373         If no telephone number highlight is hovered but the selection highlight is, then it is painted.
374        
375         The purposes of each method are self evident by their name, and the concepts are mostly the same as they used to be.
376
377         The exception is establishHoveredTelephoneHighlight which gets a more detailed explanation below.
378         
379         * Platform/Logging.h: Add a Services logging channel.
380
381         * WebProcess/WebPage/ServicesOverlayController.h:
382         (WebKit::TelephoneNumberData::TelephoneNumberData):
383
384         * WebProcess/WebPage/mac/ServicesOverlayController.mm:
385         (WebKit::ServicesOverlayController::ServicesOverlayController):
386         (WebKit::ServicesOverlayController::selectionRectsDidChange):
387         (WebKit::ServicesOverlayController::selectedTelephoneNumberRangesChanged):
388         (WebKit::ServicesOverlayController::clearHighlightState):
389         (WebKit::ServicesOverlayController::drawRect):
390         (WebKit::ServicesOverlayController::drawSelectionHighlight):
391         (WebKit::ServicesOverlayController::maybeDrawTelephoneNumberHighlight):
392         (WebKit::ServicesOverlayController::drawHighlight):
393         (WebKit::ServicesOverlayController::clearSelectionHighlight):
394         (WebKit::ServicesOverlayController::clearHoveredTelephoneNumberHighlight):
395         (WebKit::ServicesOverlayController::establishHoveredTelephoneHighlight): Starts walking the telephone number ranges and
396             creating a highlight for each one that doesn’t already have a highlight. If that highlight is also being hovered by
397             the mouse, then it is set as the hovered telephone number highlight and the method stops creating new highlights.
398         (WebKit::ServicesOverlayController::maybeCreateSelectionHighlight):
399         (WebKit::ServicesOverlayController::mouseEvent):
400         (WebKit::ServicesOverlayController::handleClick):
401         (WebKit::ServicesOverlayController::drawTelephoneNumberHighlight): Deleted.
402         (WebKit::ServicesOverlayController::drawCurrentHighlight): Deleted.
403 >>>>>>> Phone number highlights should always be visible if the mouse hovers over.
404
405 2014-07-08  Tim Horton  <timothy_horton@apple.com>
406
407         WKProcessPoolConfigurationPrivate's maximumProcessCount property has no effect
408         https://bugs.webkit.org/show_bug.cgi?id=134711
409
410         Reviewed by Dan Bernstein.
411
412         * UIProcess/API/Cocoa/WKProcessPool.mm:
413         (-[WKProcessPool _initWithConfiguration:]):
414         Respect the maximumProcessCount.
415         Currently the default limit is UINT_MAX; if maximumProcessCount = 0 (the default), we'll use that limit.
416
417 2014-07-08  Adrian Perez de Castro  <aperez@igalia.com>
418
419         [GTK] Move user style sheet API out of WebKitWebViewGroup
420         https://bugs.webkit.org/show_bug.cgi?id=134551
421
422         Reviewed by Carlos Garcia Campos.
423
424         * PlatformGTK.cmake: Include the new source files in the build.
425         * UIProcess/API/C/gtk/WKView.cpp:
426         (WKViewCreate):
427         Adapt to the additional webkitWebViewBaseCreateWebPage() parameter.
428         * UIProcess/API/gtk/WebKitUserContent.cpp: Added.
429         (toUserContentInjectedFrames):
430         (toUserStyleLevel):
431         (toStringVector):
432         (_WebKitUserStyleSheet::_WebKitUserStyleSheet):
433         (webkit_user_style_sheet_ref):
434         (webkit_user_style_sheet_unref):
435         (webkit_user_style_sheet_new):
436         (webkitWebKitUserStyleSheetToUserStyleSheet):
437         * UIProcess/API/gtk/WebKitUserContent.h: Added.
438         * UIProcess/API/gtk/WebKitUserContentManager.cpp: Added.
439         (_WebKitUserContentManagerPrivate::_WebKitUserContentManagerPrivate):
440         (webkit_user_content_manager_class_init):
441         (webkit_user_content_manager_new):
442         (webkit_user_content_manager_add_style_sheet):
443         (webkit_user_content_manager_remove_all_style_sheets):
444         (webkitUserContentManagerGetUserContentControllerProxy):
445         * UIProcess/API/gtk/WebKitUserContentManager.h: Added.
446         * UIProcess/API/gtk/WebKitUserContentManagerPrivate.h: Added.
447         * UIProcess/API/gtk/WebKitUserContentPrivate.h: Added.
448         * UIProcess/API/gtk/WebKitWebContext.cpp:
449         (webkitWebContextCreatePageForWebView): Add a new parameter to allow
450         passing the WebKitUserContentManager that the web view will use.
451         * UIProcess/API/gtk/WebKitWebContextPrivate.h: Ditto.
452         * UIProcess/API/gtk/WebKitWebView.cpp:
453         (webkitWebViewConstructed): Added handling of the
454         "user-content-manager" property on construction.
455         (webkitWebViewSetProperty): Added support for the
456         "user-content-manager" property.
457         (webkitWebViewGetProperty): Added support for the
458         "user-content-manager" property.
459         (webkit_web_view_class_init): Added the "user-content-manager"
460         property definition to the WebKitWebView class.
461         (webkit_web_view_new_with_related_view): Made related views share
462         the same WebKitUserContentManager used by the view they are
463         related to.
464         (webkit_web_view_new_with_user_content_manager): Added.
465         (webkit_web_view_get_user_content_manager): Added.
466         * UIProcess/API/gtk/WebKitWebView.h: Add new API methods.
467         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
468         (webkitWebViewBaseCreate): Added a parameter to pass the user
469         content manager.
470         (webkitWebViewBaseCreateWebPage): Added a parameter to pass the user
471         content manager.
472         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h: Ditto.
473         * UIProcess/API/gtk/WebKitWebViewGroup.cpp: Removed the bits related
474         to user style sheet support from WebKitWebViewGroup.
475         (webkit_web_view_group_set_settings):
476         (toAPIArray): Deleted.
477         (webkit_web_view_group_add_user_style_sheet): Deleted.
478         (webkit_web_view_group_remove_all_user_style_sheets): Deleted.
479         * UIProcess/API/gtk/WebKitWebViewGroup.h: Deleted the API methods
480         for user style sheet handling.
481         * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Added the new API
482         functions and types, and removed the methods which are no longer
483         available in WebKitWebViewGroup.
484         * UIProcess/API/gtk/webkit2.h: Add the new headers.
485         * UIProcess/UserContent/WebUserContentControllerProxy.cpp: Added
486         methods to add and remove user style sheets, alike those used for
487         user scripts.
488         (WebKit::WebUserContentControllerProxy::addProcess):
489         (WebKit::WebUserContentControllerProxy::addUserStyleSheet):
490         (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets):
491         * UIProcess/UserContent/WebUserContentControllerProxy.h: Ditto.
492         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
493         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
494         Adapt to the additional webkitWebViewBaseCreateWebPage() parameter.
495         * WebProcess/UserContent/WebUserContentController.cpp: Added methods
496         to add and remove user style sheets, alike those used for user scripts.
497         (WebKit::WebUserContentController::addUserStyleSheets):
498         (WebKit::WebUserContentController::removeAllUserStyleSheets):
499         * WebProcess/UserContent/WebUserContentController.h: Ditto.
500         * WebProcess/UserContent/WebUserContentController.messages.in:
501         Ditto.
502
503 2014-07-08  Zan Dobersek  <zdobersek@igalia.com>
504
505         [GTK] Guard uses of RedirectedXCompositeWindow in WebKitWebViewBase with PLATFORM(X11)
506         https://bugs.webkit.org/show_bug.cgi?id=133871
507
508         Reviewed by Martin Robinson.
509
510         Guard uses of the RedirectedXCompositeWindow object in WebKitWebViewBase with the
511         PLATFORM(X11) build guard. This is required to properly support building the GTK
512         port only for the Wayland target.
513
514         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
515         (webkitWebViewBaseConstructed):
516         (webkitWebViewRenderAcceleratedCompositingResults):
517         (resizeWebKitWebViewBaseFromAllocation):
518         (webkitWebViewBaseUpdatePreferences):
519         (webkitWebViewBaseCreateWebPage):
520
521 2014-07-07  Tim Horton  <timothy_horton@apple.com>
522
523         Turn on accelerated drawing for WebKit2 by default
524         https://bugs.webkit.org/show_bug.cgi?id=134708
525         <rdar://problem/17584642>
526
527         Reviewed by Simon Fraser.
528
529         * Shared/WebPreferencesDefinitions.h:
530         Make Mac match iOS, in that accelerated drawing is on by default.
531
532 2014-07-07  Timothy Horton  <timothy_horton@apple.com>
533
534         Don't leak _WKRemoteObjectRegistry in WKBrowsingContextController
535         https://bugs.webkit.org/show_bug.cgi?id=134703
536
537         Reviewed by Simon Fraser.
538
539         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
540         (-[WKBrowsingContextController _remoteObjectRegistry]):
541         Adoption is important!!
542
543 2014-07-07  Simon Fraser  <simon.fraser@apple.com>
544
545         [UI-side compositing] Support reflections on custom layers like video
546         https://bugs.webkit.org/show_bug.cgi?id=134701
547
548         Reviewed by Tim Horton.
549         
550         For video reflections, we have to support cloning of PlatformCALayerRemoteCustom
551         in the web process. Do so by implementing PlatformCALayerRemoteCustom::clone(),
552         which does the right gyrations to get AVPlayerLayers cloned, then makes a
553         new PlatformCALayerRemoteCustom to wrap the new layer. This ends up getting
554         its own context hosting ID, allowing the clone to show in the UI process.
555         
556         Attempt to do the same for WebGL, but turn it off because it breaks.
557
558         * Shared/mac/RemoteLayerBackingStore.mm:
559         (WebKit::RemoteLayerBackingStore::drawInContext):
560         * Shared/mac/RemoteLayerTreeTransaction.mm:
561         (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::encode): Unconditionally encode/decode
562         the hostingContextID. It will be 0 for most layers.
563         (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::decode):
564         (WebKit::RemoteLayerTreeTransaction::description):
565         * UIProcess/ios/RemoteLayerTreeHostIOS.mm:
566         (WebKit::RemoteLayerTreeHost::createLayer):
567         * UIProcess/mac/RemoteLayerTreeHost.mm:
568         (WebKit::RemoteLayerTreeHost::createLayer):
569         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
570         (WebKit::PlatformCALayerRemote::create): Creation with a custom PlatformLayer* always
571         creates a PlatformCALayerRemoteCustom.
572         (WebKit::PlatformCALayerRemote::clone): Factor some code.
573         (WebKit::PlatformCALayerRemote::updateClonedLayerProperties):
574         (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
575         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
576         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h:
577         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
578         (WebKit::PlatformCALayerRemoteCustom::create):
579         (WebKit::PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom):
580         (WebKit::PlatformCALayerRemoteCustom::clone): Clone by making an instance of the 
581         correct type of platform layer when possible, then wrapping a PlatformCALayerRemoteCustom
582         around it.
583         (WebKit::PlatformCALayerRemoteCustom::contents):
584         (WebKit::PlatformCALayerRemoteCustom::setContents):
585         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
586         (WebKit::RemoteLayerTreeContext::layerWasCreated):
587         (WebKit::RemoteLayerTreeContext::layerWillBeDestroyed):
588
589 2014-07-07  Simon Fraser  <simon.fraser@apple.com>
590
591         [UI-side compositing] Crash when starting a filter transition on a reflected layer
592         https://bugs.webkit.org/show_bug.cgi?id=134694
593
594         Reviewed by Tim Horton.
595         
596         When cloned layers had animations, we would fire two animationDidStart callbacks,
597         but the second would pass an empty animationKey string to the web process, resulting
598         in a crash.
599         
600         Fix by not blindly copying all layer properties when cloning PlatformCALayerRemotes,
601         since the clone would include addedAnimations, and then get the same animations
602         added on top by the caller.
603         
604         Also protect against an empty animation key in the animationDidStart callback.
605
606         * UIProcess/mac/RemoteLayerTreeHost.mm:
607         (WebKit::RemoteLayerTreeHost::animationDidStart):
608         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
609         (WebKit::PlatformCALayerRemote::PlatformCALayerRemote):
610         (WebKit::PlatformCALayerRemote::clone): Don't copy all the properties; copy
611         them manually as PlatformCALayerMac does. Only copy the big things if they don't
612         have their default values.
613         (WebKit::PlatformCALayerRemote::copyFiltersFrom): Need an implementation of this
614         for clone() to call.
615
616 2014-07-07  Tim Horton  <timothy_horton@apple.com>
617
618         Nearly everything in the UIProcess "leaks" when WKWebView is torn down
619         https://bugs.webkit.org/show_bug.cgi?id=134699
620         <rdar://problem/17581777>
621
622         Reviewed by Simon Fraser.
623
624         * UIProcess/API/Cocoa/WKWebView.mm:
625         (-[WKWebView initWithFrame:configuration:]):
626         Adoption is important!
627
628 2014-07-07  Enrica Casucci  <enrica@apple.com>
629
630         REGRESSION(iOS WK2): arrow keys movements don't work.
631         https://bugs.webkit.org/show_bug.cgi?id=134561
632         <rdar://problem/16827629>
633
634         Reviewed by Benjamin Poulain.
635
636         This change add the implementations for cursor movement selectors.
637         It also provides a mechanism to ensure that every selection
638         change in WebKit is reflected in UIKit so that it can update the 
639         autocorrection data. This way we ensure that the autocorraction state
640         is consistent even when selection changes are originated by JavaScript.
641         WebPageProxy::editorStateChanged now notifies the page client when the
642         selection is about to change as well as when it actually changed.
643         
644         * UIProcess/PageClient.h:
645         * UIProcess/WebPageProxy.cpp:
646         (WebKit::WebPageProxy::editorStateChanged):
647         * UIProcess/WebPageProxy.h:
648         * UIProcess/ios/PageClientImplIOS.h:
649         * UIProcess/ios/PageClientImplIOS.mm:
650         (WebKit::PageClientImpl::selectionWillChange):
651         * UIProcess/ios/WKContentViewInteraction.h:
652         * UIProcess/ios/WKContentViewInteraction.mm:
653         (-[WKContentView cut:]): Removed incorrect calls to textWillChange and
654         textDidChange.
655         (-[WKContentView paste:]):
656         (-[WKContentView _moveUp:withHistory:]):
657         (-[WKContentView _moveDown:withHistory:]):
658         (-[WKContentView _moveLeft:withHistory:]):
659         (-[WKContentView _moveRight:withHistory:]):
660         (-[WKContentView _moveToStartOfWord:withHistory:]):
661         (-[WKContentView _moveToStartOfParagraph:withHistory:]):
662         (-[WKContentView _moveToStartOfLine:withHistory:]):
663         (-[WKContentView _moveToStartOfDocument:withHistory:]):
664         (-[WKContentView _moveToEndOfWord:withHistory:]):
665         (-[WKContentView _moveToEndOfParagraph:withHistory:]):
666         (-[WKContentView _moveToEndOfLine:withHistory:]):
667         (-[WKContentView _moveToEndOfDocument:withHistory:]):
668         (-[WKContentView _selectionWillChange]):
669         (-[WKContentView _selectionChanged]):
670         * UIProcess/ios/WebPageProxyIOS.mm:
671         (WebKit::WebPageProxy::notifySelectionWillChange):
672
673 2014-07-07  Anders Carlsson  <andersca@apple.com>
674
675         Add SPI for saving and restoring a WKWebView's _WKSessionState
676         https://bugs.webkit.org/show_bug.cgi?id=134693
677
678         Reviewed by Dan Bernstein.
679
680         * UIProcess/API/C/WKPage.cpp:
681         (WKPageRestoreFromSessionState):
682         * UIProcess/API/Cocoa/WKWebView.mm:
683         (-[WKWebView _sessionState]):
684         (-[WKWebView _restoreFromSessionStateData:]):
685         (-[WKWebView _restoreFromSessionState:]):
686         (-[WKWebView _restoreSessionState:andNavigate:]):
687         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
688         * UIProcess/API/Cocoa/_WKSessionState.mm:
689         (-[_WKSessionState _initWithSessionState:]):
690         * UIProcess/API/Cocoa/_WKSessionStateInternal.h:
691         * UIProcess/WebPageProxy.cpp:
692         (WebKit::WebPageProxy::restoreFromSessionState):
693         * UIProcess/WebPageProxy.h:
694
695 2014-07-07  Anders Carlsson  <andersca@apple.com>
696
697         Add a stubbed out _WKSessionState class
698         https://bugs.webkit.org/show_bug.cgi?id=134690
699
700         Reviewed by Geoffrey Garen.
701
702         * UIProcess/API/Cocoa/_WKSessionState.h: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
703         * UIProcess/API/Cocoa/_WKSessionState.mm: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
704         (-[_WKSessionState initWithData:]):
705         (-[_WKSessionState data]):
706         * UIProcess/API/Cocoa/_WKSessionStateInternal.h: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
707         * UIProcess/Cocoa/SessionStateCoding.h: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
708         * UIProcess/Cocoa/SessionStateCoding.mm: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
709         (WebKit::encodeSessionState):
710         (WebKit::decodeSessionState):
711         * UIProcess/LegacySessionStateCoding.h:
712         * WebKit2.xcodeproj/project.pbxproj:
713
714 2014-07-07  Anders Carlsson  <andersca@apple.com>
715
716         Some of the WKPreferences (API) property getters read like questions
717         https://bugs.webkit.org/show_bug.cgi?id=134678
718         <rdar://problem/17576847>
719
720         Reviewed by Dan Bernstein.
721
722         * UIProcess/API/Cocoa/WKPreferences.h:
723         * UIProcess/API/Cocoa/WKPreferences.mm:
724         (-[WKPreferences javaScriptIsEnabled]):
725         (-[WKPreferences javaIsEnabled]):
726         (-[WKPreferences plugInsAreEnabled]):
727         (-[WKPreferences isJavaScriptEnabled]): Deleted.
728         (-[WKPreferences isJavaEnabled]): Deleted.
729         (-[WKPreferences arePlugInsEnabled]): Deleted.
730
731 2014-07-07  Brady Eidson  <beidson@apple.com>
732
733         ServicesOverlayController menus show up in the wrong place.
734         <rdar://problem/17130576> and https://bugs.webkit.org/show_bug.cgi?id=134684
735
736         Reviewed by Tim Horton.
737
738         * WebProcess/WebPage/mac/ServicesOverlayController.mm:
739         (WebKit::ServicesOverlayController::selectedTelephoneNumberRangesChanged): Handle cases where
740           the telephone number is in a subframe.
741         (WebKit::ServicesOverlayController::handleClick): The click point is always in main frame document
742           coordinates, so convert it to window coordinates using the main frame’s FrameView.
743
744 2014-07-07  Dan Bernstein  <mitz@apple.com>
745
746         [Cocoa] Assertion failure in NavigationState::LoaderClient::didStartProvisionalLoadForFrame (navigationID) when navigating through the page cache
747         https://bugs.webkit.org/show_bug.cgi?id=134682
748
749         Reviewed by Tim Horton.
750
751         * UIProcess/Cocoa/NavigationState.mm:
752         (WebKit::NavigationState::LoaderClient::didStartProvisionalLoadForFrame): Replaced the
753         assertion with a FIXME.
754         (WebKit::NavigationState::LoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame):
755         Ditto.
756         (WebKit::NavigationState::LoaderClient::didFailProvisionalLoadWithErrorForFrame): Ditto.
757         (WebKit::NavigationState::LoaderClient::didCommitLoadForFrame): Ditto.
758         (WebKit::NavigationState::LoaderClient::didFinishDocumentLoadForFrame): Ditto.
759         (WebKit::NavigationState::LoaderClient::didFinishLoadForFrame): Ditto.
760         (WebKit::NavigationState::LoaderClient::didFailLoadWithErrorForFrame): Ditto.
761
762 2014-07-07  KwangHyuk Kim  <hyuki.kim@samsung.com>
763
764         [EFL] Fix cursor artifacts on naver map site.
765         https://bugs.webkit.org/show_bug.cgi?id=134649
766
767         Reviewed by Gyuyoung Kim.
768
769         Old evas cursor and ecore x cursor are reset before new cursor is applied.
770
771         * UIProcess/API/efl/EwkView.cpp:
772         (EwkView::updateCursor):
773
774 2014-07-06  Benjamin Poulain  <bpoulain@apple.com>
775
776         [iOS][WK2] The tap highlight ID is not invalidated when a long press ends
777         https://bugs.webkit.org/show_bug.cgi?id=134660
778
779         Reviewed by Darin Adler.
780
781         * UIProcess/ios/WKContentViewInteraction.mm:
782         (-[WKContentView _cancelInteraction]):
783         (-[WKContentView _finishInteraction]):
784         (cancelPotentialTapIfNecessary):
785         I messed that up in r170600. I only accounted for the web process being too fast.
786
787         If the web process is too slow, _cancelInteraction or _finishInteraction happen before
788         _didGetTapHighlightForRequest:, and we also need to nuke the tap highlight.
789
790 2014-07-06  Tim Horton  <timothy_horton@apple.com>
791
792         [WK2] Don't support dynamically enabling the RemoteLayerTree debug indicator
793         https://bugs.webkit.org/show_bug.cgi?id=134644
794
795         Reviewed by Darin Adler.
796
797         * UIProcess/DrawingAreaProxy.h:
798         (WebKit::DrawingAreaProxy::setShouldShowDebugIndicator): Deleted.
799         * UIProcess/WebPageProxy.cpp:
800         (WebKit::WebPageProxy::preferencesDidChange):
801         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
802         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
803         (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
804         (WebKit::RemoteLayerTreeDrawingAreaProxy::initializeDebugIndicator):
805         (WebKit::RemoteLayerTreeDrawingAreaProxy::setShouldShowDebugIndicator): Deleted.
806         The indicator depends on the live layer tree commits coming in, including layer creation,
807         so it can't be turned on after the root layer is created. Even a refresh is insufficient
808         to get it working; the debug indicator really needs to exist from the first commit.
809         So, don't even attempt to dynamically enable the indicator; create it at
810         RemoteLayerTreeDrawingAreaProxy construction time if the pref is enabled.
811
812 2014-07-06  Yoav Weiss  <yoav@yoav.ws>
813
814         Turn on img@sizes compile flag
815         https://bugs.webkit.org/show_bug.cgi?id=134634
816
817         Reviewed by Benjamin Poulain.
818
819         * Configurations/FeatureDefines.xcconfig: Moved compile flag to alphabetical order.
820
821 2014-07-06  Brady Eidson  <beidson@apple.com>
822
823         Speculative fix for: NetworkProcess sometimes hangs under copyDefaultCredentialForProtectionSpace
824         https://bugs.webkit.org/show_bug.cgi?id=134666
825
826         Reviewed by Tim Horton.
827
828         * Shared/mac/SecItemRequestData.cpp:
829         (WebKit::SecItemRequestData::encode): Encode whether or not the query dictionary exists.
830         (WebKit::SecItemRequestData::decode): Only fail when query dictionary fails to decode if we expect one. 
831
832         * UIProcess/mac/SecItemShimProxy.cpp:
833         (WebKit::SecItemShimProxy::secItemRequest): If the request is of type Invalid, log an error message asking 
834           for a bug, and respond with an "invalid parameter" error.
835
836 2014-07-06  Antti Koivisto  <antti@apple.com>
837
838         Don't throttle layer flushes when the main resource is a GIF
839         https://bugs.webkit.org/show_bug.cgi?id=134650
840
841         Reviewed by Simon Fraser.
842
843         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
844         (WebKit::RemoteLayerTreeDrawingArea::adjustLayerFlushThrottling):
845
846 2014-07-04  Rohit Kumar  <kumar.rohit@samsung.com>
847
848         [EFL][WK2]Fix build break in EFL WK2
849         https://bugs.webkit.org/show_bug.cgi?id=134629
850
851         Unreviewed build fix.
852
853         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp:
854         (WebKit::CoordinatedDrawingArea::scheduleCompositingLayerFlushImmediately):
855         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h:
856
857 2014-07-04  Dan Bernstein  <mitz@apple.com>
858
859         [Cocoa] -[WKWebView _reload] is unused
860         https://bugs.webkit.org/show_bug.cgi?id=134638
861
862         Reviewed by Sam Weinig.
863
864         * UIProcess/API/Cocoa/WKWebView.mm:
865         (-[WKWebView _reload]): Deleted.
866         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
867
868 2014-07-04  Tim Horton  <timothy_horton@apple.com>
869
870         [WK2] Take TopContentInset into account when sending dictionary lookup point to PluginView
871         https://bugs.webkit.org/show_bug.cgi?id=134624
872         <rdar://problem/17222041>
873
874         Reviewed by Sam Weinig.
875
876         * WebProcess/Plugins/PDF/PDFPlugin.mm:
877         (WebKit::PDFPlugin::performDictionaryLookupAtLocation):
878         Perform the same coordinate conversion we use for mouse events, which happens
879         to take the top content inset into account.
880
881 2014-07-04  Philippe Normand  <pnormand@igalia.com>
882
883         Unreviewed, GTK WK2 build fix after r170787.
884
885         * WebProcess/WebPage/DrawingAreaImpl.cpp:
886         (WebKit::DrawingAreaImpl::scheduleCompositingLayerFlushImmediately):
887         * WebProcess/WebPage/DrawingAreaImpl.h:
888
889 2014-07-04  Zan Dobersek  <zdobersek@igalia.com>
890
891         Unreviewed. Reverting the bad changes introduced in r170795.
892
893         * Platform/IPC/ArgumentDecoder.cpp:
894         (IPC::ArgumentDecoder::decode): Deleted.
895         * Platform/IPC/ArgumentDecoder.h:
896         * Platform/IPC/ArgumentEncoder.cpp:
897         (IPC::ArgumentEncoder::encode): Deleted.
898         * Platform/IPC/ArgumentEncoder.h:
899
900 2014-07-04  Zan Dobersek  <zdobersek@igalia.com>
901
902         Unreviewed. Fixing the build for ports on 64-bit Linux.
903
904         Add IPC encoding and decoding overloads for the long long type, needed
905         after r170755 started encoding and decoding long long variables in
906         FormDataElement.
907
908         * Platform/IPC/ArgumentDecoder.cpp:
909         (IPC::ArgumentDecoder::decode):
910         * Platform/IPC/ArgumentDecoder.h:
911         * Platform/IPC/ArgumentEncoder.cpp:
912         (IPC::ArgumentEncoder::encode):
913         * Platform/IPC/ArgumentEncoder.h:
914
915 2014-07-04  Timothy Horton  <timothy_horton@apple.com>
916
917         [iOS][WK2] Black web view after un-suspending process
918         https://bugs.webkit.org/show_bug.cgi?id=134623
919         <rdar://problem/17513223>
920
921         Reviewed by Simon Fraser.
922
923         * UIProcess/WebPageProxy.cpp:
924         (WebKit::WebPageProxy::viewStateDidChange):
925         Add an argument to viewStateDidChange that allows callers (-[WKContentView _applicationWillEnterForeground:])
926         to force us to wait for a synchronous reply from the Web process after performing a view state change.
927
928         (WebKit::WebPageProxy::dispatchViewStateChange):
929         Move the has-been-in-window-and-now-is-newly-in-window check into dispatchViewStateChange.
930         Adjust the logic surrounding going into/out of window by factoring out the IsInWindow-did-change check, for clarity.
931
932         * UIProcess/WebPageProxy.h:
933         * UIProcess/ios/WKContentView.mm:
934         (-[WKContentView _applicationWillEnterForeground:]):
935         As previously mentioned, wait for a reply when foregrounding.
936
937         * WebProcess/WebPage/DrawingArea.h:
938         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
939         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
940         (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlushImmediately):
941         (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush):
942         (WebKit::RemoteLayerTreeDrawingArea::viewStateDidChange):
943         Make sure to schedule a commit immediately if the UI process is waiting for a reply.
944         Previously we assumed that a commit would be scheduled anyway because we would have to reparent the
945         layer tree, but that doesn't happen in the suspension-without-unparenting case. Also, we want to skip
946         all throttling in this case.
947
948         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
949         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
950         (WebKit::TiledCoreAnimationDrawingArea::scheduleCompositingLayerFlushImmediately):
951
952 2014-07-03  Gavin Barraclough  <baraclough@apple.com>
953
954         Should not take background task assertion for NetworkProcess
955         https://bugs.webkit.org/show_bug.cgi?id=134622
956
957         Reviewed by Tim Horton.
958
959         When the WebContent wants to complete a task in the background we take a process assertion on the child process, and also need to prevent the UI process from suspending.
960         However for the NetworkProcess we always just hold a process assertion, and don't want this to interfere with UIApp suspension.
961
962         * Platform/IPC/mac/ConnectionMac.mm:
963         (IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog):
964             - ProcessAssertion -> ProcessAndUIAssertion
965         * UIProcess/ProcessAssertion.cpp:
966         (WebKit::ProcessAssertion::ProcessAssertion):
967             - assignment -> initializer list.
968         (WebKit::ProcessAndUIAssertion::ProcessAndUIAssertion):
969         (WebKit::ProcessAndUIAssertion::~ProcessAndUIAssertion):
970         (WebKit::ProcessAndUIAssertion::setState):
971             - added no-op implementation.
972         (WebKit::ProcessAssertion::~ProcessAssertion): Deleted.
973         * UIProcess/ProcessAssertion.h:
974             - removed ~ProcessAssertion, added ProcessAndUIAssertion class.
975         * UIProcess/ProcessThrottler.cpp:
976         (WebKit::ProcessThrottler::didConnnectToProcess):
977             - ProcessAssertion -> ProcessAndUIAssertion
978         * UIProcess/ProcessThrottler.h:
979             - ProcessAssertion -> ProcessAndUIAssertion
980         * UIProcess/ios/ProcessAssertionIOS.mm:
981         (WebKit::ProcessAssertion::ProcessAssertion):
982             - assignment -> initializer list.
983             - moved code to manage WKProcessAssertionBackgroundTaskManager
984         (WebKit::ProcessAssertion::setState):
985             - moved code to manage WKProcessAssertionBackgroundTaskManager
986         (WebKit::ProcessAndUIAssertion::ProcessAndUIAssertion):
987         (WebKit::ProcessAndUIAssertion::~ProcessAndUIAssertion):
988         (WebKit::ProcessAndUIAssertion::setState):
989             - moved code to manage WKProcessAssertionBackgroundTaskManager from ProcessAssertion.
990         (WebKit::ProcessAssertion::~ProcessAssertion): Deleted.
991             - delete - moved code to manage WKProcessAssertionBackgroundTaskManager
992
993 2014-07-03  Simon Fraser  <simon.fraser@apple.com>
994
995         Clean up Brady's mess on iOS.
996
997         * Platform/mac/StringUtilities.h:
998         * Platform/mac/StringUtilities.mm:
999
1000 2014-07-03  Simon Fraser  <simon.fraser@apple.com>
1001
1002         [iOS WK2] Compositing layers draw outside page bounds
1003         https://bugs.webkit.org/show_bug.cgi?id=134619
1004         <rdar://problem/16953222>
1005
1006         Reviewed by Benjamin Poulain.
1007         
1008         With the new rubber-banding behavior, we no longer have the root content layer clipping all
1009         the web layers, but this resulted in web layers which were moved outside the viewport by CSS
1010         transforms not being clipped.
1011         
1012         Fix by adding a clipping layer inside the scroll view, above _rootContentView. This layer
1013         normally has the same bounds as the content, but when rubber-banding or pinching,
1014         it takes the union of the content bounds and the rect used for fixed positioning.
1015         To make scrolling work as expected in this scenario, when it has non-zero offset, it
1016         has to compensate by setting its bounds origin.
1017
1018         The bounds of the clipping layer are updated on scrolling/zooming, and when the
1019         layer commit tells us that the content size changed.
1020
1021         * UIProcess/API/Cocoa/WKWebView.mm:
1022         (-[WKWebView _updateScrollViewBackground]):
1023         * UIProcess/ios/WKContentView.mm:
1024         (-[WKContentView initWithFrame:context:configuration:webView:]):
1025         (-[WKContentView updateFixedClippingView:]):
1026         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):
1027         (-[WKContentView _didCommitLayerTree:]):
1028
1029 2014-07-03  Brady Eidson  <beidson@apple.com>
1030
1031         When showing the selection menu, include menu options for all selected phone numbers.
1032         <rdar://problem/16983434>, <rdar://problem/16874568>, and https://bugs.webkit.org/show_bug.cgi?id=134613
1033
1034         Reviewed by Tim Horton.
1035
1036         Move some telephone number menu logic from WebKitSystemInterface here.
1037         Also provide utility to get just the one menu item relevant to a telephone number.
1038         * Platform/mac/MenuUtilities.h:
1039         * Platform/mac/MenuUtilities.mm: Added.
1040         (WebKit::menuItemForTelephoneNumber):
1041         (WebKit::menuItemsForTelephoneNumber):
1042
1043         * Platform/mac/StringUtilities.h:
1044         * Platform/mac/StringUtilities.mm:
1045         (WebKit::formattedPhoneNumberString): Return a localized formatted phone number.
1046
1047         Add a member to track the selected phone numbers:
1048         * Shared/ContextMenuContextData.h:
1049         (WebKit::ContextMenuContextData::ContextMenuContextData):
1050         (WebKit::ContextMenuContextData::selectedTelephoneNumbers):
1051
1052         * UIProcess/WebPageProxy.h:
1053         * UIProcess/WebPageProxy.messages.in:
1054
1055         * UIProcess/mac/WebContextMenuProxyMac.mm:
1056         (WebKit::WebContextMenuProxyMac::setupServicesMenu): Also add menu items for each phone number that is
1057           in the selection.
1058
1059         Switch away from a WKSI method, and remove a lot of unneeded forward declarations and soft linking:
1060         * UIProcess/mac/WebPageProxyMac.mm:
1061         (WebKit::WebPageProxy::showTelephoneNumberMenu):
1062         (WebKit::WebPageProxy::showSelectionServiceMenu):
1063
1064         * WebKit2.xcodeproj/project.pbxproj:
1065
1066         * WebProcess/WebPage/mac/ServicesOverlayController.mm:
1067         (WebKit::ServicesOverlayController::drawSelectionHighlight):
1068         (WebKit::ServicesOverlayController::handleClick): Pass the phone numbers along.
1069
1070         * WebProcess/WebPage/WebPage.h:
1071         * WebProcess/WebPage/mac/WebPageMac.mm:
1072         (WebKit::WebPage::handleSelectionServiceClick): Pass the phone numbers along.
1073
1074 2014-07-03  Gavin Barraclough  <baraclough@apple.com>
1075
1076         WKProcessAssertionBackgroundTaskManager should clear member if task expires
1077         https://bugs.webkit.org/show_bug.cgi?id=134618
1078
1079         Reviewed by Anders Carlson.
1080
1081         Failure to do so results in a warning, and could result in us erroneously completing a background task too soon.
1082
1083         * UIProcess/ios/ProcessAssertionIOS.mm:
1084         (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):
1085             - remove local variable, _backgroundTask = UIBackgroundTaskInvalid;
1086
1087 2014-07-03  Joseph Pecoraro  <pecoraro@apple.com>
1088
1089         Unreviewed iOS build fix for r170774.
1090
1091         Remove some unnecessary WTF::moves on iOS:
1092         error: static_assert failed "T is not an lvalue reference; move() is unnecessary."
1093
1094         * WebProcess/WebPage/EventDispatcher.cpp:
1095         (WebKit::EventDispatcher::getQueuedTouchEventsForPage):
1096         (WebKit::EventDispatcher::touchEvent):
1097
1098 2014-07-03  Anders Carlsson  <andersca@apple.com>
1099
1100         Try to fix the iOS build.
1101
1102         Add WebPageProxyCocoa.mm for code shared between iOS and OS X. Put the recent searches save/restore code there.
1103
1104         * UIProcess/Cocoa/WebPageProxyCocoa.mm: Added.
1105         (WebKit::autosaveKey):
1106         (WebKit::WebPageProxy::saveRecentSearches):
1107         (WebKit::WebPageProxy::loadRecentSearches):
1108         * UIProcess/mac/WebPageProxyMac.mm:
1109         * WebKit2.xcodeproj/project.pbxproj:
1110
1111 2014-07-03  Dan Bernstein  <mitz@apple.com>
1112
1113         <rdar://problem/16337741> The UI process needs to track the number of HTTP subresource loads in progress (or at least whether there are any)
1114         https://bugs.webkit.org/show_bug.cgi?id=134615
1115
1116         Reviewed by Anders Carlsson.
1117
1118         Added a _networkRequestsInProgress boolean property to WKWebView.
1119
1120         * UIProcess/API/Cocoa/WKBrowsingContextController.mm: Added no-op overrides of new
1121         PageLoadStateObserver member functions.
1122
1123         * UIProcess/API/Cocoa/WKWebView.mm:
1124         (-[WKWebView _networkRequestsInProgress]): New getter that gets this state from the
1125         PageLoadState.
1126         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared new property.
1127
1128         * UIProcess/Cocoa/NavigationState.h:
1129         * UIProcess/Cocoa/NavigationState.mm:
1130         (WebKit::NavigationState::willChangeNetworkRequestsInProgress):: Override this new
1131         PageLoadState::Observer member function by sending the appropriate KVO change message to the
1132         WKWebView.
1133         (WebKit::NavigationState::didChangeNetworkRequestsInProgress): Ditto.
1134
1135         * UIProcess/PageLoadState.cpp:
1136         (WebKit::PageLoadState::commitChanges): Check for changes to networkRequestsInProgress
1137         and call the observers if needed.
1138         (WebKit::PageLoadState::reset): Reset networkRequestsInProgress in the uncommitted state.
1139         (WebKit::PageLoadState::setNetworkRequestsInProgress): Set networkRequestsInProgress in the
1140         uncommitted state.
1141         * UIProcess/PageLoadState.h:
1142         (WebKit::PageLoadState::networkRequestsInProgress): Added this getter.
1143         (WebKit::PageLoadState::Data::Data): Initialize new networkRequestsInProgress member.
1144
1145         * UIProcess/WebPageProxy.cpp:
1146         (WebKit::WebPageProxy::setNetworkRequestsInProgress): Added. Updates the PageLoadState.
1147         * UIProcess/WebPageProxy.h:
1148         * UIProcess/WebPageProxy.messages.in: Added SetNetworkRequestsInProgress message.
1149
1150         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1151         (WebKit::WebFrameLoaderClient::assignIdentifierToInitialRequest): Call
1152         WebPage::addResourceRequest.
1153         (WebKit::WebFrameLoaderClient::dispatchDidFinishLoading): Call
1154         WebPage::removeResourceRequest.
1155         (WebKit::WebFrameLoaderClient::dispatchDidFailLoading): Ditto.
1156
1157         * WebProcess/WebPage/WebPage.cpp:
1158         (WebKit::WebPage::addResourceRequest): Added. If the new request is for an HTTP-family URL,
1159         add its identifier to the set of network resourece request identifiers. If the set was
1160         previously empty, send the WebPageProxy a message.
1161         (WebKit::WebPage::removeResourceRequest): Added. Remove the identifier from the set. If it
1162         becomes empty, send the WebPageProxy a message.
1163         * WebProcess/WebPage/WebPage.h:
1164
1165 2014-07-03  Anders Carlsson  <andersca@apple.com>
1166
1167         Remove two unused functions
1168         https://bugs.webkit.org/show_bug.cgi?id=134614
1169
1170         Reviewed by Andreas Kling.
1171
1172         * UIProcess/LegacySessionStateCoding.h:
1173         * UIProcess/mac/LegacySessionStateCoding.cpp:
1174         (WebKit::encodeLegacySessionHistoryEntryData): Deleted.
1175         (WebKit::decodeLegacySessionHistoryEntryData): Deleted.
1176
1177 2014-07-03  Daniel Bates  <dabates@apple.com>
1178
1179         Add WTF::move()
1180         https://bugs.webkit.org/show_bug.cgi?id=134500
1181
1182         Rubber-stamped by Anders Carlsson.
1183
1184         Substitute WTF::move() for std::move().
1185
1186         * DatabaseProcess/DatabaseProcess.cpp:
1187         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
1188         * NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm:
1189         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
1190         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1191         * Platform/IPC/ArgumentCoders.h:
1192         * Platform/IPC/ArgumentDecoder.cpp:
1193         * Platform/IPC/Connection.cpp:
1194         * Platform/IPC/Connection.h:
1195         [...]
1196
1197 2014-07-03  Benjamin Poulain  <bpoulain@apple.com>
1198
1199         [iOS][WK2] Fix small bugs of dynamicViewportSizeUpdate that were causing inaccuracies in the computed target
1200         https://bugs.webkit.org/show_bug.cgi?id=134582
1201
1202         Reviewed by Tim Horton.
1203
1204         This patch fixes two small bugs that were causing "jumpiness" on animated resize:
1205         1) The new scale was less accurate than the target scale, making the WebProcess force a worse scale on the content.
1206         2) The code putting back the rects in view was ignoring the obscured insets, constraining the scroll position more
1207            than it should be.
1208
1209         The first problem was cause by a series of rounding issues accumulating to the fact that "scale != targetScale"
1210         was almost never true.
1211
1212         The first issue is that the unobscured content size was stored in integer coordinates. Because of that, it was
1213         impossible to determine accurately how much content is in the view.
1214         The outcome was that visibleHorizontalFraction was very inaccurate compared to what the UIProcess computed.
1215
1216         Another issue affecting the scale is that scaleAfterViewportWidthChange was computing the widthToKeepInView
1217         on floating point. Since ARM64 does all those computations on doubles in the UIProcess, the value would be quite
1218         different from the received targetScale.
1219
1220         Finally, the code uses withinEpsilon() instead of a strict equality to reduce the effect of rounding errors.
1221
1222         For the second issue, the problem was that I was bounding the exposed rect to the page bounds. It is completely
1223         valid to have an exposed rect outside the page bounds, that area is just under the obscured insets.
1224
1225         On the other hand, the unobscured rect needs to be within the bounds as we do not want to rotate to a rubberbanding
1226         position. The fix is simply to put the right rect into bounds, and the horizontal/vertical adjustement applies on
1227         both rects.
1228
1229         * WebProcess/WebPage/ios/WebPageIOS.mm:
1230         (WebKit::scaleAfterViewportWidthChange):
1231         (WebKit::WebPage::dynamicViewportSizeUpdate):
1232         (WebKit::WebPage::updateVisibleContentRects):
1233
1234 2014-07-03  Anders Carlsson  <andersca@apple.com>
1235
1236         Fix build.
1237
1238         * UIProcess/mac/WebPageProxyMac.mm:
1239
1240 2014-07-03  Anders Carlsson  <andersca@apple.com>
1241
1242         Get rid of WebPageProxyCF.cpp
1243         https://bugs.webkit.org/show_bug.cgi?id=134609
1244
1245         Reviewed by Dan Bernstein.
1246
1247         * UIProcess/cf/WebPageProxyCF.cpp: Removed.
1248         * UIProcess/mac/WebPageProxyMac.mm:
1249         (WebKit::autosaveKey):
1250         (WebKit::WebPageProxy::saveRecentSearches):
1251         (WebKit::WebPageProxy::loadRecentSearches):
1252         * WebKit2.xcodeproj/project.pbxproj:
1253
1254 2014-07-03  Tim Horton  <timothy_horton@apple.com>
1255
1256         [WK2] Revise the flat find indicator secondary highlight shadows
1257         https://bugs.webkit.org/show_bug.cgi?id=134607
1258         <rdar://problem/17554828>
1259
1260         Reviewed by Brady Eidson.
1261
1262         * WebProcess/WebPage/FindController.cpp:
1263         (WebKit::FindController::drawRect):
1264         Bring back the secondary highlight shadow, with new constants.
1265
1266 2014-07-03  Tim Horton  <timothy_horton@apple.com>
1267
1268         [iOS][WK2] Sometimes the swipe snapshot stays up too long
1269         https://bugs.webkit.org/show_bug.cgi?id=134506
1270         <rdar://problem/17496803>
1271
1272         Reviewed by Simon Fraser.
1273
1274         Implement a transaction callback mechanism.
1275         The UI process can register a callback at any point, generally immediately after sending a message to the Web process.
1276         It will then send another message (in-order) with the callback ID to the Web process, which will put it into the next transaction
1277         (scheduling a new one if needed). When the transaction comes back to the UI process, the callbacks are performed.
1278         This ensures that the callback fires alongside a commit that includes the results of whatever messages were sent before it was registered.
1279         For now, all callbacks are fired just before committing layer changes, but it's possible future patches will want post-commit callbacks.
1280         
1281         Make use of this to remove the ViewGestureControllerIOS snapshots at the right time.
1282
1283         * Shared/mac/RemoteLayerTreeTransaction.h:
1284         (WebKit::RemoteLayerTreeTransaction::callbackIDs):
1285         (WebKit::RemoteLayerTreeTransaction::setCallbackIDs):
1286         * Shared/mac/RemoteLayerTreeTransaction.mm:
1287         (WebKit::RemoteLayerTreeTransaction::encode):
1288         (WebKit::RemoteLayerTreeTransaction::decode):
1289         Add a vector of callback IDs to the transaction; encode and decode as appropriate.
1290
1291         * UIProcess/DrawingAreaProxy.h:
1292         (WebKit::DrawingAreaProxy::dispatchAfterEnsuringDrawing):
1293         (WebKit::DrawingAreaProxy::lastVisibleTransactionID): Deleted.
1294         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
1295         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
1296         (WebKit::RemoteLayerTreeDrawingAreaProxy::~RemoteLayerTreeDrawingAreaProxy):
1297         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
1298         (WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing):
1299         Add dispatchAfterEnsuringDrawing, which takes a function.
1300         When a callback is added, we send the callback ID to the Web process via the AddTransactionCallbackID message.
1301         Perform callbacks listed in the incoming transaction's vector of callback IDs.
1302
1303         * WebProcess/WebPage/DrawingArea.h:
1304         (WebKit::DrawingArea::addTransactionCallbackID):
1305         * WebProcess/WebPage/DrawingArea.messages.in:
1306         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
1307         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
1308         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
1309         (WebKit::RemoteLayerTreeDrawingArea::addTransactionCallbackID):
1310         Keep track of the pending callback IDs on the drawing area, and move them into the transaction.
1311         We schedule a flush when installing a transaction callback on the premise that
1312         sometimes the action (goToBackForwardListItem in the swipe case) might have already occurred
1313         and been committed by the time the Web process receives AddTransactionCallbackID, so we need
1314         to cause another commit to send the callbacks across. If said commit is still pending, this is a no-op.
1315
1316         * UIProcess/ios/ViewGestureControllerIOS.mm:
1317         (allViewGestureControllers):
1318         (WebKit::ViewGestureController::ViewGestureController):
1319         (WebKit::ViewGestureController::~ViewGestureController):
1320         (WebKit::ViewGestureController::endSwipeGesture):
1321         (WebKit::ViewGestureController::willCommitPostSwipeTransitionLayerTree):
1322         (WebKit::ViewGestureController::setRenderTreeSize):
1323         * UIProcess/mac/ViewGestureController.h:
1324         Keep a side-map of page IDs to ViewGestureControllers, so that we can safely get back to
1325         our ViewGestureController from the callback.
1326
1327         When the callback fires, if it succeeded, set m_shouldRemoveSnapshotWhenTargetRenderTreeSizeHit,
1328         so that the commit (which is about to occur immediately after the callback returns) which calls
1329         setRenderTreeSize will (perhaps) remove the snapshot.
1330
1331         If it failed, we remove the snapshot immediately, as this usually happens if the Web process crashed.
1332
1333 2014-07-03  Brady Eidson  <beidson@apple.com>
1334
1335         Followup to "rects sent to ServicesOverlayController are wrong"
1336         https://bugs.webkit.org/show_bug.cgi?id=134568
1337
1338         Rubberstamped by Tim Horton.
1339
1340         * WebProcess/WebPage/mac/ServicesOverlayController.mm:
1341         (WebKit::ServicesOverlayController::drawSelectionHighlight): Don’t check to see if the
1342           proposed rect intersects the dirty rect. We always need to include all rects that form
1343           the selection when creating the DDHighlight.
1344
1345 2014-07-03  Tim Horton  <timothy_horton@apple.com>
1346
1347         [WK2] RemoteLayerTreeDrawingAreaProxy re-checks a preference every commit for no reason
1348         https://bugs.webkit.org/show_bug.cgi?id=134586
1349
1350         Reviewed by Benjamin Poulain.
1351
1352         * UIProcess/DrawingAreaProxy.h:
1353         (WebKit::DrawingAreaProxy::setShouldShowDebugIndicator):
1354         (WebKit::DrawingAreaProxy::showDebugIndicator): Deleted.
1355         (WebKit::DrawingAreaProxy::isShowingDebugIndicator): Remove this, nobody is using it.
1356         * UIProcess/WebPageProxy.cpp:
1357         (WebKit::WebPageProxy::preferencesDidChange):
1358         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
1359         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
1360         (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
1361         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
1362         (WebKit::RemoteLayerTreeDrawingAreaProxy::setShouldShowDebugIndicator):
1363         (WebKit::RemoteLayerTreeDrawingAreaProxy::showDebugIndicator): Deleted.
1364         Check the debug indicator pref at construction time, and update the state when it changes.
1365         Checking it every commit was surprisingly expensive.
1366
1367 2014-07-03  Antti Koivisto  <antti@apple.com>
1368
1369         Ensure frame creation messages get through to UI process
1370         https://bugs.webkit.org/show_bug.cgi?id=134591
1371         <rdar://problem/16918218>
1372
1373         Reviewed by Anders Carlsson.
1374
1375         If we are middle of handling a synchronous message from UI process a frame creation message back gets delayed.
1376         The subsequent synchronous DecidePolicyForNavigationAction message expects that the frame creation
1377         message has arrived first and fails.
1378
1379         * WebProcess/WebPage/WebFrame.cpp:
1380         (WebKit::WebFrame::createWithCoreMainFrame):
1381         (WebKit::WebFrame::createSubframe):
1382         
1383             Send messages with DispatchMessageEvenWhenWaitingForSyncReply so they always go through in order.
1384
1385 2014-07-03  Anders Carlsson  <andersca@apple.com>
1386
1387         Get rid of DecoderAdapter and EncoderAdapter
1388         https://bugs.webkit.org/show_bug.cgi?id=134598
1389
1390         Reviewed by Andreas Kling.
1391
1392         * CMakeLists.txt:
1393         * WebKit2.xcodeproj/project.pbxproj:
1394         * WebProcess/WebPage/DecoderAdapter.cpp: Removed.
1395         * WebProcess/WebPage/DecoderAdapter.h: Removed.
1396         * WebProcess/WebPage/EncoderAdapter.cpp: Removed.
1397         * WebProcess/WebPage/EncoderAdapter.h: Removed.
1398         * WebProcess/WebPage/WebPage.cpp:
1399
1400 2014-07-02  Anders Carlsson  <andersca@apple.com>
1401
1402         Stop using EncoderAdapter/DecoderAdapter for FormData
1403         https://bugs.webkit.org/show_bug.cgi?id=134571
1404
1405         Reviewed by Andreas Kling.
1406
1407         * Shared/Network/NetworkResourceLoadParameters.cpp:
1408         (WebKit::NetworkResourceLoadParameters::encode):
1409         (WebKit::NetworkResourceLoadParameters::decode):
1410
1411 2014-07-03  Brady Eidson  <beidson@apple.com>
1412
1413         Selection rects sent to ServicesOverlayController are wrong.
1414         <rdar://problem/16727796> and https://bugs.webkit.org/show_bug.cgi?id=134568
1415
1416         Reviewed by Darin Adler (and Tim Horton and Ryosuke Niwa).
1417
1418         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1419         (WebKit::WebEditorClient::selectionRectsDidChange): Also pass the GapRects to the ServicesOverlayController.
1420         * WebProcess/WebCoreSupport/WebEditorClient.h:
1421
1422         * WebProcess/WebPage/ServicesOverlayController.h:
1423         * WebProcess/WebPage/mac/ServicesOverlayController.mm:
1424         (WebKit::expandForGap):
1425         (WebKit::compactRectsWithGapRects): Combine 3+ rects down to exactly 3 rects, then expand them based on GapRects.
1426         (WebKit::ServicesOverlayController::selectionRectsDidChange): Call compactRectsWithGapRects, then reverse the list.
1427         (WebKit::ServicesOverlayController::drawSelectionHighlight): Tell data detectors to flip this.
1428         (WebKit::ServicesOverlayController::drawTelephoneNumberHighlight): Tell data detectors to flip this.
1429         (WebKit::ServicesOverlayController::drawCurrentHighlight): No need to flip this anymore.
1430
1431 2014-07-03  Brady Eidson  <beidson@apple.com>
1432
1433         Possible crash in IconDatabase in WebCore::IconDatabase::dispatchDidRemoveAllIconsOnMainThread
1434         <rdar://problem/17437687> and https://bugs.webkit.org/show_bug.cgi?id=134517
1435
1436         Reviewed by Eric Carlson.
1437
1438         * UIProcess/WebContext.cpp:
1439         (WebKit::WebContext::~WebContext): Instead of directly deref’ing the WebIconDatabase, ask it to
1440           deref itself when appropriate.
1441
1442         * UIProcess/WebIconDatabase.cpp:
1443         (WebKit::WebIconDatabase::WebIconDatabase):
1444         (WebKit::WebIconDatabase::didClose): If this WebIconDatabase is supposed to deref itself when
1445           appropriate, do so now.
1446         (WebKit::WebIconDatabase::derefWhenAppropriate): If the WebCore::IconDatabase is still open then
1447           defer this deref.
1448         * UIProcess/WebIconDatabase.h:
1449
1450 2014-07-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1451
1452         REGRESSION(r170676): [GTK] UI process crashes when the Web Process crashes
1453         https://bugs.webkit.org/show_bug.cgi?id=134541
1454
1455         Reviewed by Gyuyoung Kim.
1456
1457         It happens when attaching a new web process, because it tries to
1458         encode a null SessionState.
1459
1460         * UIProcess/LegacySessionStateCodingNone.cpp:
1461         (WebKit::encodeLegacySessionState): Return an empty API::Data
1462         object instead of nullptr.
1463         (WebKit::encodeLegacySessionHistoryEntryData): Ditto.
1464
1465 2014-07-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1466
1467         REGRESSION(r170743): [GTK] [EFL] Build broken.
1468         https://bugs.webkit.org/show_bug.cgi?id=134585
1469
1470         Reviewed by Philippe Normand.
1471
1472         Add ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC) guards where needed.
1473
1474         * WebProcess/Plugins/PluginView.cpp:
1475         (WebKit::PluginView::initializePlugin):
1476         * WebProcess/WebPage/WebPage.cpp:
1477         (WebKit::WebPage::createPlugin):
1478
1479 2014-07-02  Benjamin Poulain  <benjamin@webkit.org>
1480
1481         [iOS][WK2] Make is safe/fast to use the animated resize API without resizing anything
1482         https://bugs.webkit.org/show_bug.cgi?id=134570
1483
1484         Reviewed by Enrica Casucci.
1485
1486         Today, if someone calls _beginAnimatedResizeWithUpdates-_endAnimatedResize, it is always a very heavy process
1487         forcing a relayout and can cause synchronous operations.
1488
1489         We should not force the caller of the API to maintain their own state tracking, we should do that for them.
1490
1491         With this patch, we track everything we need for a resize and only do the heavy lifting if anything has actually changed.
1492
1493         * UIProcess/API/Cocoa/WKWebView.mm:
1494         (activeMinimumLayoutSize):
1495         (activeMinimumLayoutSizeForMinimalUI):
1496         (activeMaximumUnobscuredSize):
1497         (activeOrientation):
1498         This code is used in both _didRelaunchProcess and _beginAnimatedResizeWithUpdates. It is moved to static functions
1499         to avoid having it in two places.
1500
1501         (-[WKWebView _didRelaunchProcess]):
1502
1503         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
1504         The updates now goes like this:
1505         1) Set _isAnimatingResize to prevent the undesired side effects updateBlock() if we really need to resize.
1506         2) Get all the original values before calling the update block.
1507         3) Call the update block.
1508         4a) If nothing useful for resize has changed, reset _isAnimatingResize to false.
1509             We also need to update the visible content rect because the update block may have changed something unrelated
1510             to the view size (scale, scroll position, etc).
1511         4b) If we really need to resize, proceed as usual.
1512
1513         (-[WKWebView _endAnimatedResize]):
1514         With the changes in _beginAnimatedResizeWithUpdates:, _isAnimatingResize is only set for real cases of animated resize,
1515         bail out early if that flag isn't set.
1516
1517         The remaining code is unchanged, it is just not indented due to the removal of the if() branch.
1518
1519 2014-07-02  Roger Fong  <roger_fong@apple.com>
1520
1521         Improve handling of primary offscreen plugins.
1522         https://bugs.webkit.org/show_bug.cgi?id=134528.
1523         <rdar://problem/17471864>
1524
1525         Reviewed by Dean Jackson.
1526
1527         * WebProcess/Plugins/PluginView.cpp: 
1528         Determine whether or not the plugin starts offscreen when the plugin is initialized.
1529         (WebKit::PluginView::initializePlugin):
1530         (WebKit::PluginView::pluginSnapshotTimerFired):
1531         * WebProcess/WebPage/WebPage.cpp:
1532         (WebKit::WebPage::createPlugin):
1533         Use the PluginProcessTypeNormal for offscreen plugins that are potentially primary plugins.
1534
1535 2014-07-02  Enrica Casucci  <enrica@apple.com>
1536
1537         REGRESSION(WK2): Undo does not work in text fields in Safari.
1538         https://bugs.webkit.org/show_bug.cgi?id=134572
1539         <rdar://problem/17542238>
1540
1541         Reviewed by Benjamin Poulain.
1542         
1543         This patch adds for iOS the same implementation we have already for OS X.
1544
1545         * UIProcess/ios/PageClientImplIOS.h:
1546         * UIProcess/ios/PageClientImplIOS.mm:
1547         (-[WKEditCommandObjC initWithWebEditCommandProxy:]):
1548         (-[WKEditCommandObjC command]):
1549         (-[WKEditorUndoTargetObjC undoEditing:]):
1550         (-[WKEditorUndoTargetObjC redoEditing:]):
1551         (WebKit::PageClientImpl::PageClientImpl):
1552         (WebKit::PageClientImpl::registerEditCommand):
1553         (WebKit::PageClientImpl::clearAllEditCommands):
1554         (WebKit::PageClientImpl::canUndoRedo):
1555         (WebKit::PageClientImpl::executeUndoRedo):
1556
1557 2014-07-02  Gavin Barraclough  <baraclough@apple.com>
1558
1559         ProcessAssertion should also prevent UIApp suspension
1560         https://bugs.webkit.org/show_bug.cgi?id=134563
1561
1562         Reviewed by Dan Bernstein.
1563
1564         If the application suspends then the child processes will, too.
1565         Use beginBackgroundTaskWithName:expirationHandler: to request that the application remain runnable
1566         while waiting for background tasks to complete.
1567
1568         * UIProcess/ProcessAssertion.cpp:
1569         (WebKit::ProcessAssertion::~ProcessAssertion):
1570             - Added destructor.
1571         * UIProcess/ProcessAssertion.h:
1572             - Added destructor.
1573         * UIProcess/ios/ProcessAssertionIOS.mm:
1574         (+[WKProcessAssertionBackgroundTaskManager shared]):
1575             - singleton WKProcessAssertionBackgroundTaskManager.
1576         (-[WKProcessAssertionBackgroundTaskManager init]):
1577         (-[WKProcessAssertionBackgroundTaskManager dealloc]):
1578             - register/remove notification handlers.
1579         (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):
1580             - if we need to be runnable make sure we're holding a BackgroundTask, if not release it.
1581         (-[WKProcessAssertionBackgroundTaskManager _applicationDidEnterBackgroundOrWillEnterForeground:]):
1582             - detect when the app enters/leaves foreground; calls to _updateBackgroundTask.
1583         (-[WKProcessAssertionBackgroundTaskManager incrementNeedsToRunInBackgroundCount]):
1584         (-[WKProcessAssertionBackgroundTaskManager decrementNeedsToRunInBackgroundCount]):
1585             - interface to update the count; calls to _updateBackgroundTask.
1586         (WebKit::ProcessAssertion::ProcessAssertion):
1587         (WebKit::ProcessAssertion::~ProcessAssertion):
1588             - count ProcessAssertions in and out of existance.
1589         (WebKit::ProcessAssertion::setState):
1590             - count when the state changes.
1591
1592 2014-07-01  Mark Rowe  <mrowe@apple.com>
1593
1594         <https://webkit.org/b/134522> Remove duplication in code that prepares the user agent string on Mac and iOS
1595
1596         Reviewed by Simon Fraser.
1597
1598         * UIProcess/ios/WebPageProxyIOS.mm:
1599         (WebKit::webKitBundleVersionString): Return the entire CFBundleVersion now that WebCore handles formatting it.
1600         (WebKit::WebPageProxy::standardUserAgent):
1601         * UIProcess/mac/WebPageProxyMac.mm:
1602         (WebKit::webKitBundleVersionString): Ditto.
1603         (WebKit::WebPageProxy::standardUserAgent):
1604
1605 2014-06-28  Oliver Hunt  <oliver@apple.com>
1606
1607        Restrict network process sandbox
1608        https://bugs.webkit.org/show_bug.cgi?id=134360
1609
1610        Reviewed by Sam Weinig.
1611
1612        Add more restrictions to the network process sandbox.
1613
1614        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1615        (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
1616          Always use the cache directory provided in the initialization parameters,
1617          and make sure we consume the cookie directory extension.
1618        * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
1619          Make the sandbox profile much more restrictive.
1620        * Shared/Network/NetworkProcessCreationParameters.cpp:
1621        (WebKit::NetworkProcessCreationParameters::encode):
1622        (WebKit::NetworkProcessCreationParameters::decode):
1623        * Shared/Network/NetworkProcessCreationParameters.h:
1624          The network process now requires an extension to access
1625          its cookie storage.
1626        * Shared/mac/SandboxUtilities.cpp:
1627        (WebKit::pathForProcessContainer):
1628        * Shared/mac/SandboxUtilities.h:
1629          We need to be able to get hold of our container so
1630          that we can get the correct cookie storage directory.
1631        * UIProcess/WebContext.cpp:
1632        (WebKit::WebContext::ensureNetworkProcess):
1633          We have to pass in the an extension for the cookie storage directory when
1634        initalising the network process
1635        * UIProcess/mac/WebContextMac.mm:
1636        (WebKit::WebContext::platformDefaultCookieStorageDirectory):
1637          Make sure we provide the correct location on IOS
1638        * WebProcess/cocoa/WebProcessCocoa.mm:
1639        (WebKit::WebProcess::platformInitializeWebProcess):
1640          Consume the cookie storage extension
1641
1642 2014-07-02  Csaba Osztrogonác  <ossy@webkit.org>
1643
1644         URTBF after r170725.
1645
1646         * CMakeLists.txt: Removed Shared/LegacySessionState.cpp.
1647
1648 2014-07-02  Csaba Osztrogonác  <ossy@webkit.org>
1649
1650         URTBF after r170719 for !CF platforms.
1651
1652         * UIProcess/WebPageProxy.cpp:
1653         (WebKit::WebPageProxy::sessionStateData): Deleted.
1654         (WebKit::WebPageProxy::restoreFromSessionStateData): Deleted.
1655
1656 2014-07-02  Mark Rowe  <mrowe@apple.com>
1657
1658         <https://webkit.org/b/134521> iOS should use shared code to determine the system marketing version
1659
1660         Reviewed by Simon Fraser.
1661
1662         * Shared/ios/ChildProcessIOS.mm: Update #import.
1663         * Shared/mac/ChildProcessMac.mm: Ditto.
1664
1665 2014-07-02  Anders Carlsson  <andersca@apple.com>
1666
1667         Rip out more dead code
1668         https://bugs.webkit.org/show_bug.cgi?id=134562
1669
1670         Reviewed by Andreas Kling.
1671
1672         * Shared/LegacySessionState.cpp: Removed.
1673         * Shared/LegacySessionState.h: Removed.
1674         * Shared/WebBackForwardListItem.cpp:
1675         (WebKit::WebBackForwardListItem::WebBackForwardListItem): Deleted.
1676         (WebKit::WebBackForwardListItem::backForwardData): Deleted.
1677         (WebKit::WebBackForwardListItem::setBackForwardData): Deleted.
1678         (WebKit::WebBackForwardListItem::encode): Deleted.
1679         (WebKit::WebBackForwardListItem::decode): Deleted.
1680         * Shared/WebBackForwardListItem.h:
1681         (WebKit::WebBackForwardListItem::create): Deleted.
1682         (WebKit::WebBackForwardListItem::setOriginalURL): Deleted.
1683         (WebKit::WebBackForwardListItem::setURL): Deleted.
1684         (WebKit::WebBackForwardListItem::setTitle): Deleted.
1685         * UIProcess/WebPageProxy.cpp:
1686         * WebKit2.xcodeproj/project.pbxproj:
1687         * WebProcess/WebPage/WebPage.cpp:
1688
1689 2014-07-02  Anders Carlsson  <andersca@apple.com>
1690
1691         RestoreSession should take a vector of BackForwardListItemStates
1692         https://bugs.webkit.org/show_bug.cgi?id=134558
1693
1694         Reviewed by Tim Horton.
1695
1696         * Scripts/webkit2/messages.py:
1697         (struct_or_class):
1698         (headers_for_type):
1699         * Shared/WebPageCreationParameters.cpp:
1700         (WebKit::WebPageCreationParameters::encode):
1701         (WebKit::WebPageCreationParameters::decode):
1702         * Shared/WebPageCreationParameters.h:
1703         * UIProcess/WebBackForwardList.cpp:
1704         (WebKit::WebBackForwardList::itemStates):
1705         * UIProcess/WebBackForwardList.h:
1706         * UIProcess/WebPageProxy.cpp:
1707         (WebKit::WebPageProxy::restoreFromSessionState):
1708         (WebKit::WebPageProxy::creationParameters):
1709         * WebProcess/WebPage/WebPage.cpp:
1710         (WebKit::WebPage::WebPage):
1711         (WebKit::WebPage::restoreSession):
1712         (WebKit::WebPage::restoreSessionAndNavigateToCurrentItem): Deleted.
1713         * WebProcess/WebPage/WebPage.h:
1714         * WebProcess/WebPage/WebPage.messages.in:
1715
1716 2014-07-02  Anders Carlsson  <andersca@apple.com>
1717
1718         Store the back forward list item id inside BackForwardListItemState
1719         https://bugs.webkit.org/show_bug.cgi?id=134557
1720
1721         Reviewed by Tim Horton.
1722
1723         * Shared/SessionState.cpp:
1724         (WebKit::BackForwardListItemState::encode):
1725         (WebKit::BackForwardListItemState::decode):
1726         * Shared/SessionState.h:
1727         * Shared/WebBackForwardListItem.cpp:
1728         (WebKit::WebBackForwardListItem::create):
1729         (WebKit::WebBackForwardListItem::WebBackForwardListItem):
1730         (WebKit::WebBackForwardListItem::encode):
1731         * Shared/WebBackForwardListItem.h:
1732         (WebKit::WebBackForwardListItem::itemID):
1733         * UIProcess/WebBackForwardList.cpp:
1734         (WebKit::WebBackForwardList::restoreFromState):
1735         * UIProcess/WebProcessProxy.cpp:
1736         (WebKit::WebProcessProxy::addBackForwardItem):
1737
1738 2014-07-02  Manuel Rego Casasnovas  <rego@igalia.com>
1739
1740         Unreviewed. EFL and GTK build fix after r170716.
1741
1742         * UIProcess/LegacySessionStateCodingNone.cpp:
1743         (WebKit::decodeLegacySessionState): Update method signature.
1744
1745 2014-07-02  Anders Carlsson  <andersca@apple.com>
1746
1747         Begin ripping out the old session state code
1748         https://bugs.webkit.org/show_bug.cgi?id=134556
1749
1750         Reviewed by Andreas Kling.
1751
1752         * UIProcess/WebBackForwardList.h:
1753         * UIProcess/WebPageProxy.h:
1754         * UIProcess/cf/WebBackForwardListCF.cpp: Removed.
1755         * UIProcess/cf/WebPageProxyCF.cpp:
1756         (WebKit::WebPageProxy::sessionStateData): Deleted.
1757         (WebKit::WebPageProxy::restoreFromSessionStateData): Deleted.
1758         * WebKit2.xcodeproj/project.pbxproj:
1759
1760 2014-07-02  Anders Carlsson  <andersca@apple.com>
1761
1762         Use legacy state coding directly in WKWebView
1763         https://bugs.webkit.org/show_bug.cgi?id=134553
1764
1765         Reviewed by Dan Bernstein.
1766
1767         * UIProcess/API/C/WKPage.cpp:
1768         (WKPageRestoreFromSessionState):
1769         * UIProcess/API/C/WKSessionStateRef.cpp:
1770         (WKSessionStateCreateFromData):
1771         * UIProcess/API/Cocoa/WKWebView.mm:
1772         (-[WKWebView _sessionStateData]):
1773         (-[WKWebView _sessionState]):
1774         (-[WKWebView _restoreFromSessionStateData:]):
1775         (-[WKWebView _restoreFromSessionState:]):
1776         (releaseNSData): Deleted.
1777         * UIProcess/LegacySessionStateCoding.h:
1778         * UIProcess/WebPageProxy.cpp:
1779         (WebKit::WebPageProxy::restoreFromSessionState):
1780         (WebKit::WebPageProxy::restoreFromState): Deleted.
1781         * UIProcess/WebPageProxy.h:
1782         * UIProcess/mac/LegacySessionStateCoding.cpp:
1783         (WebKit::decodeLegacySessionState):
1784
1785 2014-07-02  Anders Carlsson  <andersca@apple.com>
1786
1787         Add -[WKWebView _sessionStateData] and -[WKWebView _restoreFromSessionStateData:]
1788         https://bugs.webkit.org/show_bug.cgi?id=134549
1789
1790         Reviewed by Dan Bernstein.
1791
1792         * UIProcess/API/Cocoa/WKWebView.mm:
1793         (-[WKWebView _sessionState]):
1794         (-[WKWebView _sessionStateData]):
1795         (-[WKWebView _restoreFromSessionState:]):
1796         (-[WKWebView _restoreFromSessionStateData:]):
1797         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1798
1799 2014-07-02  Carlos Garcia Campos  <cgarcia@igalia.com>
1800
1801         [GTK] WebKitVersion.h should be shared between UI and Web Process APIs
1802         https://bugs.webkit.org/show_bug.cgi?id=134538
1803
1804         Reviewed by Martin Robinson.
1805
1806         To be able to check current version from web extensions too.
1807
1808         * UIProcess/API/gtk/WebKitVersion.h.in: Allow to include WebKitVersion.h also from webkit-web-extension.h.
1809         * WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h: Include WebKitVersion.h.
1810
1811 2014-07-02  Carlos Garcia Campos  <cgarcia@igalia.com>
1812
1813         [GTK] WebKitWebView::create should receive information about the navigation action
1814         https://bugs.webkit.org/show_bug.cgi?id=133680
1815
1816         Reviewed by Martin Robinson.
1817
1818         Add WebKitNavigationAction boxed type representing a navigation
1819         action to be passed as parameter of WebKitWebView::create
1820         signal. In the future it could be also for the
1821         WebKitNavigationPolicyDecision class. The class contains
1822         information about a navigation action like the navigation type,
1823         the request, the mouse button and key modifiers and whether it was
1824         started by a user gesture. This information is needed to be able
1825         to implement a proper popup blocker. Since all that information is
1826         not provided by the C API, we have switched the UI client to use a
1827         custom client derived from API::UIClient. This also avoids a lot
1828         of toAPI -> toImpl unneeded conversions.
1829
1830         * PlatformGTK.cmake: Add new files to compilation.
1831         * UIProcess/API/gtk/WebKitHitTestResult.cpp:
1832         (webkitHitTestResultCreate): Use a WebHitTestResult::Data const
1833         reference instead of a pointer to a WebHitTestResult.
1834         (webkitHitTestResultCompare): Ditto.
1835         * UIProcess/API/gtk/WebKitHitTestResultPrivate.h:
1836         * UIProcess/API/gtk/WebKitNavigationAction.cpp: Added.
1837         (webkitNavigationActionCreate): Create a WebKitNavigationAction
1838         for the given ResourceRequest and NavigationActionData.
1839         (webkit_navigation_action_copy):
1840         (webkit_navigation_action_free):
1841         (webkit_navigation_action_get_navigation_type):
1842         (webkit_navigation_action_get_mouse_button):
1843         (webkit_navigation_action_get_modifiers):
1844         (webkit_navigation_action_get_request):
1845         (webkit_navigation_action_is_user_gesture):
1846         * UIProcess/API/gtk/WebKitNavigationAction.h: Added.
1847         * UIProcess/API/gtk/WebKitNavigationActionPrivate.h: Added.
1848         * UIProcess/API/gtk/WebKitNavigationPolicyDecision.h:
1849         * UIProcess/API/gtk/WebKitPrivate.cpp:
1850         (toGdkModifiers):
1851         (toWebKitNavigationType):
1852         (toWebKitMouseButton):
1853         * UIProcess/API/gtk/WebKitPrivate.h:
1854         * UIProcess/API/gtk/WebKitUIClient.cpp:
1855         (UIClient::UIClient): Implement the UIClient using a custom class.
1856         (attachUIClientToView): Set the UIClient directly to the WebPageProxy.
1857         (createNewPage): Deleted.
1858         (showPage): Deleted.
1859         (closePage): Deleted.
1860         (runJavaScriptAlert): Deleted.
1861         (runJavaScriptConfirm): Deleted.
1862         (runJavaScriptPrompt): Deleted.
1863         (toolbarsAreVisible): Deleted.
1864         (setToolbarsAreVisible): Deleted.
1865         (menuBarIsVisible): Deleted.
1866         (setMenuBarIsVisible): Deleted.
1867         (statusBarIsVisible): Deleted.
1868         (setStatusBarIsVisible): Deleted.
1869         (isResizable): Deleted.
1870         (setIsResizable): Deleted.
1871         (getWindowFrame): Deleted.
1872         (setWindowFrame): Deleted.
1873         (mouseDidMoveOverElement): Deleted.
1874         (printFrame): Deleted.
1875         (runOpenPanel): Deleted.
1876         (decidePolicyForGeolocationPermissionRequest): Deleted.
1877         (runModal): Deleted.
1878         * UIProcess/API/gtk/WebKitWebView.cpp:
1879         (webkitWebViewCreate): Add WebKitNavigationAction parameter.
1880         (webkit_web_view_class_init): Add WebKitNavigationAction paramter
1881         to CREATE signal.
1882         (webkitWebViewCreateNewPage): Add WebKitNavigationAction parameter
1883         and pass it to the signal callbacks.
1884         (webkitWebViewMouseTargetChanged): Use a WebHitTestResult::Data
1885         const reference.
1886         (webkitWebViewPopulateContextMenu): Ditto.
1887         * UIProcess/API/gtk/WebKitWebView.h:
1888         * UIProcess/API/gtk/WebKitWebViewPrivate.h:
1889         * UIProcess/API/gtk/WebKitWindowProperties.cpp:
1890         (webkitWindowPropertiesUpdateFromWebWindowFeatures): Use a
1891         WebCore::WindowFeatures const reference.
1892         * UIProcess/API/gtk/WebKitWindowPropertiesPrivate.h:
1893         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add new section.
1894         * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new symbols.
1895         * UIProcess/API/gtk/webkit2.h: Include WebKitNavigationAction.h.
1896
1897 2014-07-01  KwangHyuk Kim  <hyuki.kim@samsung.com>
1898
1899         [EFL] Fix occurrence of two cursors on WK2 EFL.
1900         https://bugs.webkit.org/show_bug.cgi?id=134436
1901
1902         Reviewed by Anders Carlsson.
1903
1904         ecore_x_window_cursor is released when ecore_evas_object_cursor should be shown in order to avoid occurrence of two cursors.
1905
1906         * UIProcess/API/efl/EwkView.cpp:
1907         (EwkView::updateCursor):
1908
1909 2014-07-01  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1910
1911         Fix build break on EFL and GTK ports since r170683
1912         https://bugs.webkit.org/show_bug.cgi?id=134536
1913
1914         Unreviewed, build fix.
1915
1916         * CMakeLists.txt:
1917
1918 2014-07-01  Dean Jackson  <dino@apple.com>
1919
1920         Make LogsPageMessagesToSystemConsoleEnabled a global debug preference
1921         https://bugs.webkit.org/show_bug.cgi?id=134534
1922
1923         Reviewed by Joseph Pecoraro.
1924
1925         * Shared/WebPreferencesDefinitions.h:
1926
1927 2014-07-01  Tim Horton  <timothy_horton@apple.com>
1928
1929         Handle invalid data more gracefully.
1930
1931         Reviewed by Anders Carlsson.
1932
1933         * UIProcess/mac/LegacySessionStateCoding.cpp:
1934         (WebKit::decodeFormData):
1935         (WebKit::decodeBackForwardTreeNode):
1936
1937 2014-07-01  Mark Rowe  <mrowe@apple.com>
1938
1939         Add a missing return statement in WKPageCopySessionState.
1940
1941         Reviewed by Anders Carlsson.
1942
1943         * UIProcess/API/C/WKPage.cpp:
1944         (WKPageCopySessionState):
1945
1946 2014-07-01  Anders Carlsson  <andersca@apple.com>
1947
1948         Don't encode/decode the snapshot UUID
1949         https://bugs.webkit.org/show_bug.cgi?id=134532
1950
1951         Reviewed by Sam Weinig.
1952
1953         * UIProcess/mac/LegacySessionStateCoding.cpp:
1954         (WebKit::encodeSessionHistory):
1955         (WebKit::decodeSessionHistoryEntry):
1956
1957 2014-07-01  Commit Queue  <commit-queue@webkit.org>
1958
1959         Unreviewed, rolling out r170608.
1960         https://bugs.webkit.org/show_bug.cgi?id=134533
1961
1962         Safari keeps crashing on device due to sandbox violation.
1963         (Requested by enrica on #webkit).
1964
1965         Reverted changeset:
1966
1967         "Restrict network process sandbox"
1968         https://bugs.webkit.org/show_bug.cgi?id=134360
1969         http://trac.webkit.org/changeset/170608
1970
1971 2014-07-01  Pratik Solanki  <psolanki@apple.com>
1972
1973         Encode/decode CFURLRequestRefs when USE(CFNETWORK) is enabled
1974         https://bugs.webkit.org/show_bug.cgi?id=134454
1975         <rdar://problem/17510980>
1976
1977         Reviewed by Andreas Kling.
1978
1979         Use new helper methods to serialize/deserialize CFURLRequestRef directly so we can avoid
1980         creating NSURLRequest.
1981
1982         * Shared/mac/WebCoreArgumentCodersMac.mm:
1983         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
1984         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
1985
1986 2014-07-01  Benjamin Poulain  <benjamin@webkit.org>
1987
1988         [iOS][WK2] Fix a race between the short tap and long tap highlight
1989         https://bugs.webkit.org/show_bug.cgi?id=134530
1990
1991         Reviewed by Enrica Casucci.
1992
1993         There was a potential race of event that can theoretically cause WKContentViewInteraction
1994         to call [WKContentView _showTapHighlight] after all interactions have been cancelled.
1995
1996         The race would be like this:
1997         1) On a short tap, _singleTapRecognized: is called, a tap highlight ID is defined and
1998            _potentialTapInProgress is set to YES.
1999         2) For some reason, the gesture is cancelled. The method _singleTapDidReset is called, 
2000            setting _potentialTapInProgress but leaving the tap highlight ID as valid.
2001         3) The UIProcess receives the tap highlight information from the WebProcess, _didGetTapHighlightForRequest:
2002            has a valid ID, _potentialTapInProgress is false -> the highlight is shown right away as if a long tap
2003            was in progress.
2004
2005         The missing piece that causes this is _singleTapDidReset: must also invalidate the tap highlight ID. This is done
2006         in the new static function cancelPotentialTapIfNecessary().
2007
2008         Just invalidating the ID would create another race:
2009         1) Short tap gesture recognizer starts.
2010         2) The long press recognizer starts before (1) is commited.
2011         3) The long press recognizers sets up its own tap highlight ID.
2012         4) The short tap gesture recognizer resets, erasing the tap highlight ID defined in (3).
2013
2014         To avoid this, the long press gesture recognizers immediately cancels any potential tap in progress.
2015         If _singleTapDidReset: is called before (3), this does nothing. If the reset is called after (3),
2016         _singleTapDidReset does nothing.
2017
2018         * UIProcess/ios/WKContentViewInteraction.mm:
2019         (-[WKContentView _highlightLongPressRecognized:]):
2020         (cancelPotentialTapIfNecessary):
2021         (-[WKContentView _singleTapDidReset:]):
2022
2023 2014-07-01  Anders Carlsson  <andersca@apple.com>
2024
2025         Add ABI hacks to allow WKPageRef to use WKSessionStateRef
2026         https://bugs.webkit.org/show_bug.cgi?id=134529
2027
2028         Reviewed by Sam Weinig.
2029
2030         * UIProcess/API/APISessionState.h:
2031         Add a sessionState() getter.
2032         
2033         * UIProcess/API/C/WKPage.cpp:
2034         (WKPageCopySessionState):
2035         Add a hack where we return a WKSessionStateRef if the least significant bit of the context pointer
2036         is 1, and a WKDataRef otherwise.
2037
2038         (WKPageRestoreFromSessionState):
2039         Handle both WKDataRef and WKSessionStateref.
2040
2041         * UIProcess/API/C/WKPage.h:
2042         Use WKTypeRefs for state saving and restoration.
2043
2044         * UIProcess/API/C/WKSessionStateRef.cpp:
2045         (WKSessionStateCopyData):
2046         Add helper function.
2047
2048 2014-07-01  Anders Carlsson  <andersca@apple.com>
2049
2050         WKPageRestoreFromSessionState should use the new session state restore code path
2051         https://bugs.webkit.org/show_bug.cgi?id=134526
2052
2053         Reviewed by Tim Horton.
2054
2055         * UIProcess/API/C/WKPage.cpp:
2056         (WKPageRestoreFromSessionState):
2057         Use the new code path.
2058
2059         * UIProcess/WebPageProxy.cpp:
2060         (WebKit::WebPageProxy::restoreFromState):
2061         Only restore the back-forward state if we have a back-forward list.
2062
2063         * UIProcess/mac/LegacySessionStateCoding.cpp:
2064         (WebKit::encodeSessionHistory):
2065         Save the original URL string as well.
2066
2067         (WebKit::decodeV1SessionHistory):
2068         If we don't have a current index, set it to Nullopt instead of 0.
2069
2070 2014-07-01  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2071
2072         Unreviewed. EFL and GTK build fix since r170654.
2073
2074         * UIProcess/LegacySessionStateCodingNone.cpp: Add a dummy encodeLegacySessionState(const SessionState&).
2075         (WebKit::encodeLegacySessionState):
2076
2077 2014-07-01  Dan Bernstein  <mitz@apple.com>
2078
2079         Crash in WebDocumentLoader::setNavigationID
2080         https://bugs.webkit.org/show_bug.cgi?id=134520
2081
2082         Reviewed by Anders Carlsson.
2083
2084         * WebProcess/WebPage/WebFrame.cpp:
2085         (WebKit::WebFrame::didReceivePolicyDecision): Null-check the policy document loader.
2086
2087 2014-07-01  Dan Bernstein  <mitz@apple.com>
2088
2089         Build fix.
2090
2091         * UIProcess/API/APILoaderClient.h:
2092         (API::LoaderClient::didDestroyNavigation):
2093
2094 2014-07-01  Anders Carlsson  <andersca@apple.com>
2095
2096         Use the new legacy session state coding in WKPageCopySessionState
2097         https://bugs.webkit.org/show_bug.cgi?id=134516
2098
2099         Reviewed by Tim Horton.
2100
2101         * UIProcess/API/C/WKPage.cpp:
2102         (WKPageCopySessionState):
2103         Call encodeLegacySessionState.
2104
2105         * UIProcess/mac/LegacySessionStateCoding.cpp:
2106         (WebKit::encodeSessionHistoryEntryData):
2107         Use leakPtr() so we won't attempt to double-free the buffer.
2108
2109         (WebKit::createDictionary):
2110         Fix a typo.
2111
2112         (WebKit::encodeLegacySessionState):
2113         Don't encode the provisional URL if it's empty.
2114
2115 2014-07-01  Chris Fleizach  <cfleizach@apple.com>
2116
2117         AX: [iOS WebKit2] Support for Speak selection
2118         https://bugs.webkit.org/show_bug.cgi?id=134512
2119
2120         Reviewed by Darin Adler.
2121
2122         Implement a method that Speak Selection can use to retrieve the selected content.
2123
2124         * UIProcess/ios/WKContentViewInteraction.mm:
2125         (-[WKContentView accessibilityRetrieveSpeakSelectionContent]):
2126
2127 2014-07-01  Anders Carlsson  <andersca@apple.com>
2128
2129         Update the highest back-forward list item ID in the other WebBackForwardListItem constructor
2130         https://bugs.webkit.org/show_bug.cgi?id=134515
2131
2132         Reviewed by Tim Horton.
2133
2134         * Shared/WebBackForwardListItem.cpp:
2135         (WebKit::WebBackForwardListItem::WebBackForwardListItem):
2136
2137 2014-07-01  Brady Eidson  <beidson@apple.com>
2138
2139         Fix ServicesOverlayController teardown
2140         <rdar://problem/17523998> and https://bugs.webkit.org/show_bug.cgi?id=134510
2141
2142         Reviewed by Mark Rowe.
2143
2144         * WebProcess/WebPage/mac/ServicesOverlayController.mm:
2145         (WebKit::ServicesOverlayController::~ServicesOverlayController): Flipped logic on null-checking the overlay.
2146
2147 2014-07-01  Sam Weinig  <sam@webkit.org>
2148
2149         [Cocoa][Mac] WKWebView should automatically set topContentInset when beneath a toolbar
2150         <rdar://problem/17523159>
2151         https://bugs.webkit.org/show_bug.cgi?id=134496
2152
2153         Reviewed by Beth Dakin.
2154
2155         - Adds _automaticallyAdjustsContentInsets SPI to both WKView and WKWebView.
2156         - Defaults _automaticallyAdjustsContentInsets to NO for WKView to keep legacy clients working.
2157         - Defaults _automaticallyAdjustsContentInsets to YES for WKWebView.
2158
2159         * UIProcess/API/Cocoa/WKViewPrivate.h:
2160         Add _automaticallyAdjustsContentInsets SPI.
2161
2162         * UIProcess/API/Cocoa/WKWebView.mm:
2163         (-[WKWebView initWithFrame:configuration:]):
2164         Default _automaticallyAdjustsContentInsets to YES for WKWebView.
2165
2166         (-[WKWebView _setTopContentInset:]):
2167         (-[WKWebView _topContentInset]):
2168         Change to forward to the WKView, since we now do coalescing and caching there.
2169
2170         (-[WKWebView _setAutomaticallyAdjustsContentInsets:]):
2171         (-[WKWebView _automaticallyAdjustsContentInsets]):
2172         Forward to the WKView.
2173
2174         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2175         Add _automaticallyAdjustsContentInsets SPI.
2176
2177         * UIProcess/API/mac/WKView.mm:
2178         (-[WKView renewGState]):
2179         Ensure the contentInset is updated when the view changes, as its relative location to the toolbar may have changed.
2180
2181         (-[WKView addWindowObserversForWindow:]):
2182         (-[WKView removeWindowObservers]):
2183         (-[WKView observeValueForKeyPath:ofObject:change:context:]):
2184         Add observers for the contentLayoutRect and titlebarAppearsTransparent properties on the window. If either of them
2185         change, we need to recalculate the content inset.
2186
2187         (-[WKView _updateContentInsetsIfAutomatic]):
2188         If _automaticallyAdjustsContentInsets is YES, follow the same rules as AppKit in setting the top content inset. Like
2189         AppKit this is only done when:
2190             - The window's style mask has the NSFullSizeContentViewWindowMask bit.
2191             - The window does not have titlebarAppearsTransparent set.
2192             - And we are not in an enclosing NSScrollView.
2193
2194         (-[WKView _setTopContentInset:]):
2195         (-[WKView _topContentInset]):
2196         Coalesce setting the topContentInset to avoid a visual lag when resizing the window that was caused by us sending
2197         multiple topContentInsets to the WebContentProcess per runloop cycle. The reason for the lag was that at the time
2198         we observe the contentLayoutRect changing, our view may not yet be in its final position yet, so the inset will be
2199         temporarily wrong. When the view is finally positioned correctly, we will get a renewGState, at which point we will
2200         again calculate the inset, which now will be correct. Since these both happen in the same runloop iteration, we can
2201         just defer sending the inset to the WebContentProcess.
2202
2203         (-[WKView _setAutomaticallyAdjustsContentInsets:]):
2204         (-[WKView _automaticallyAdjustsContentInsets]):
2205         Add the new SPI.
2206
2207 2014-07-01  Anders Carlsson  <andersca@apple.com>
2208
2209         Add a function for restoring page state given a SessionState object
2210         https://bugs.webkit.org/show_bug.cgi?id=134509
2211
2212         Reviewed by Tim Horton.
2213
2214         * Shared/WebBackForwardListItem.h:
2215         (WebKit::WebBackForwardListItem::itemState):
2216         * UIProcess/WebBackForwardList.cpp:
2217         (WebKit::WebBackForwardList::saveState):
2218         * UIProcess/WebBackForwardList.h:
2219         * UIProcess/WebPageProxy.cpp:
2220         (WebKit::WebPageProxy::saveState):
2221         * UIProcess/WebPageProxy.h:
2222
2223 2014-07-01  Dan Bernstein  <mitz@apple.com>
2224
2225         [Cocoa] Navigation parameter in navigation delegate messages is nil for navigations started by the Web Content process
2226         https://bugs.webkit.org/show_bug.cgi?id=134482
2227
2228         Reviewed by Tim Horton.
2229
2230         * UIProcess/API/APILoaderClient.h:
2231         (API::LoaderClient::didDestroyNavigation): New client function, called when a navigation ID
2232         is not going to be used anymore.
2233
2234         * UIProcess/API/Cocoa/WKWebView.mm:
2235         (-[WKWebView _restoreFromSessionState:]): If restoring triggered a navigation, create a
2236         WKNavigation for its ID.
2237
2238         * UIProcess/Cocoa/NavigationState.h:
2239         * UIProcess/Cocoa/NavigationState.mm:
2240         (WebKit::NavigationState::createLoadRequestNavigation): Removed FIXME, because we now remove
2241         navigations from the map in LoaderClient::didDestroyNavigation.
2242         (WebKit::NavigationState::createBackForwardNavigation): Ditto.
2243         (WebKit::NavigationState::createReloadNavigation): Ditto.
2244         (WebKit::NavigationState::createLoadDataNavigation): Ditto.
2245         (WebKit::NavigationState::PolicyClient::decidePolicyForNavigationAction): If we are only
2246         getting a navigation ID now, create a WKNavigation for it. Also changed to create the
2247         NSURLRequest lazily.
2248         (WebKit::NavigationState::LoaderClient::didStartProvisionalLoadForFrame): Assert that
2249         navigationID is not zero and that it maps to an existing WKNavigation.
2250         (WebKit::NavigationState::LoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame):
2251         Ditto.
2252         (WebKit::NavigationState::LoaderClient::didFailProvisionalLoadWithErrorForFrame): Ditto.
2253         (WebKit::NavigationState::LoaderClient::didCommitLoadForFrame): Ditto.
2254         (WebKit::NavigationState::LoaderClient::didFinishDocumentLoadForFrame): Ditto.
2255         (WebKit::NavigationState::LoaderClient::didFinishLoadForFrame): Ditto.
2256         (WebKit::NavigationState::LoaderClient::didFailLoadWithErrorForFrame): Ditto.
2257         (WebKit::NavigationState::LoaderClient::didDestroyNavigation): Override the new client
2258         function to remove the navigation from the map.
2259         (WebKit::NavigationState::LoaderClient::processDidCrash): Clear the navigations map.
2260
2261         * UIProcess/WebFrameListenerProxy.cpp:
2262         (WebKit::WebFrameListenerProxy::WebFrameListenerProxy): Initialize new m_navigationID
2263         member variable.
2264         (WebKit::WebFrameListenerProxy::receivedPolicyDecision): Pass the navigation ID to
2265         WebFrame::receivedPolicyDecision.
2266         * UIProcess/WebFrameListenerProxy.h:
2267         (WebKit::WebFrameListenerProxy::navigationID): Added this accessor.
2268         (WebKit::WebFrameListenerProxy::setNavigationID): Ditto.
2269
2270         * UIProcess/WebFrameProxy.cpp:
2271         (WebKit::WebFrameProxy::receivedPolicyDecision): Added navigationID parameter, which is
2272         passed along to the WebPageProxy.
2273         * UIProcess/WebFrameProxy.h:
2274
2275         * UIProcess/WebPageProxy.cpp:
2276         (WebKit::WebPageProxy::receivedPolicyDecision): Added navigationID parameter, which is
2277         passed along in the message to the Web Content process.
2278         (WebKit::WebPageProxy::restoreFromSessionStateData): Changed to return a navigation ID of 0.
2279         (WebKit::WebPageProxy::restoreFromState): Changed to return a navigation ID if one was
2280         started.
2281         (WebKit::WebPageProxy::didDestroyNavigation): Added. Calls the new client function.
2282         (WebKit::WebPageProxy::decidePolicyForNavigationAction): Added navigationID and
2283         newNavigationID parameters. If a main-frame navigation doesn’t already have an ID, assign it
2284         a new ID and return it in the newNavigationID parmeter as well as setting it on the listener
2285         for the asynchronous case.
2286         * UIProcess/WebPageProxy.h:
2287
2288         * UIProcess/WebPageProxy.messages.in: Added navigationID and newNavigationID parameters.
2289
2290         * UIProcess/cf/WebPageProxyCF.cpp:
2291         (WebKit::WebPageProxy::restoreFromSessionStateData): Changed to return a navigation ID if
2292         one was started.
2293
2294         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2295         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse): Updated for additional
2296         parameter.
2297         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Send the navigation
2298         ID to the UI process, get the new navigation ID from the reply, and set it on the document
2299         loader.
2300
2301         * WebProcess/WebPage/WebDocumentLoader.cpp:
2302         (WebKit::WebDocumentLoader::detachFromFrame): Override to let the UI process know that the
2303         navigation ID will not be used anymore.
2304         * WebProcess/WebPage/WebDocumentLoader.h:
2305
2306         * WebProcess/WebPage/WebFrame.cpp:
2307         (WebKit::WebFrame::didReceivePolicyDecision): Added navigationID parameter, set it on the
2308         document loader.
2309         (WebKit::WebFrame::documentLoaderDetached): Pass the message along to the UI process.
2310         * WebProcess/WebPage/WebFrame.h:
2311
2312         * WebProcess/WebPage/WebPage.cpp:
2313         (WebKit::WebPage::didReceivePolicyDecision): Pass new navigationID parameter along.
2314         * WebProcess/WebPage/WebPage.h:
2315
2316         * WebProcess/WebPage/WebPage.messages.in: Added navigationID parameter.
2317
2318 2014-07-01  Anders Carlsson  <andersca@apple.com>
2319
2320         Fix build.
2321
2322         * WebKit2.xcodeproj/project.pbxproj:
2323
2324 2014-07-01  Anders Carlsson  <andersca@apple.com>
2325
2326         Temporarily encode and decode the snapshot UUID
2327         https://bugs.webkit.org/show_bug.cgi?id=134507
2328
2329         Reviewed by Tim Horton.
2330
2331         * UIProcess/mac/LegacySessionStateCoding.cpp:
2332         (WebKit::encodeSessionHistory):
2333         (WebKit::decodeSessionHistoryEntry):
2334         (WebKit::decodeSessionHistoryEntries):
2335
2336 2014-07-01  Anders Carlsson  <andersca@apple.com>
2337
2338         Implement encodeSessionHistoryEntryData
2339         https://bugs.webkit.org/show_bug.cgi?id=134505
2340
2341         Reviewed by Tim Horton.
2342
2343         * UIProcess/API/C/WKPage.cpp:
2344         (WKPageCopySessionState):
2345         Add back a missing null check for the filter pointer.
2346
2347         * UIProcess/mac/LegacySessionStateCoding.cpp:
2348         (WebKit::encodeSessionHistoryEntryData):
2349
2350 2014-07-01  Simon Fraser  <simon.fraser@apple.com>
2351
2352         [UI-side compositing] Bad spinner on news.google.com: animations need to be ordered
2353         https://bugs.webkit.org/show_bug.cgi?id=134504
2354         <rdar://problem/17507892>
2355
2356         Reviewed by Tim Horton.
2357         
2358         The layer's addedAnimations property needs to maintain order, since the order
2359         in which transforms are applied is important.
2360
2361         * Shared/mac/RemoteLayerTreeTransaction.h: Use a Vector<pair<>> for addedAnimations.
2362         * Shared/mac/RemoteLayerTreeTransaction.mm:
2363         (WebKit::dumpChangedLayers):
2364         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.h:
2365         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
2366         (WebKit::PlatformCAAnimationRemote::updateLayerAnimations):
2367         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
2368         (WebKit::PlatformCALayerRemote::addAnimationForKey): If this is a new entry, we
2369         can just append to addedAnimations, otherwise we have to find the existing one
2370         and update its properties.
2371         (WebKit::PlatformCALayerRemote::removeAnimationForKey): Do linear search to
2372         find the animation to remove (this list will normally be short).
2373
2374 2014-07-01  Anders Carlsson  <andersca@apple.com>
2375
2376         Add a encodeLegacySessionState function
2377         https://bugs.webkit.org/show_bug.cgi?id=134502
2378
2379         Reviewed by Tim Horton.
2380
2381         * UIProcess/LegacySessionStateCoding.h:
2382         * UIProcess/mac/LegacySessionStateCoding.cpp:
2383         (WebKit::encodeSessionHistoryEntryData):
2384         (WebKit::encodeLegacySessionHistoryEntryData):
2385         (WebKit::createDictionary):
2386         (WebKit::encodeSessionHistory):
2387         (WebKit::encodeLegacySessionState):
2388
2389 2014-07-01  Alexey Proskuryakov  <ap@apple.com>
2390
2391         [Cocoa] WebProcess doesn't follow localization of UI process when run as a service
2392         https://bugs.webkit.org/show_bug.cgi?id=133126
2393         <rdar://problem/13396515>
2394
2395         Patch by Alexey Proskuryakov.
2396         Reviewed by Tim Horton.
2397
2398         * Configurations/WebContentService.Development.xcconfig:
2399         * Configurations/WebContentService.xcconfig:
2400         Figure out which of the two keys to use. CFBundleAllowMixedLocalizations was
2401         a workaround before we got CFBundleFollowParentLocalization, and these cannot be
2402         used together.
2403
2404         * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::connectToService): Set up
2405         XPC bootstrap for CFBundle to use.
2406
2407         * WebKit2.xcodeproj/project.pbxproj: Added a script that applies the key to Info.plist.
2408
2409         * WebProcess/EntryPoint/mac/XPCService/WebContentService.Development/Info-OSX.plist:
2410         * WebProcess/EntryPoint/mac/XPCService/WebContentService.Development/Info-iOS.plist:
2411         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist:
2412         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist:
2413         Removed CFBundleAllowMixedLocalizations, we now add it programmatically.
2414
2415 2014-07-01  Alex Christensen  <achristensen@webkit.org>
2416
2417         [iOS] Unreviewed build fix after r170640.
2418
2419         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2420         (WebKit::WebEditorClient::selectedTelephoneNumberRangesChanged):
2421         (WebKit::WebEditorClient::selectionRectsDidChange):
2422         * WebProcess/WebCoreSupport/WebEditorClient.h:
2423         * WebProcess/WebPage/WebPage.h:
2424         Add ifdefs to make everything compile and link.
2425
2426 2014-07-01  Anders Carlsson  <andersca@apple.com>
2427
2428         Add WKSessionStateGetTypeID
2429         https://bugs.webkit.org/show_bug.cgi?id=134499
2430
2431         Reviewed by Tim Horton.
2432
2433         * UIProcess/API/C/WKSessionStateRef.cpp:
2434         (WKSessionStateGetTypeID):
2435         * UIProcess/API/C/WKSessionStateRef.h:
2436
2437 2014-07-01  Daniel Bates  <dabates@apple.com>
2438
2439         Remove unnecessary calls to std::move()
2440         https://bugs.webkit.org/show_bug.cgi?id=134493
2441
2442         Reviewed by Anders Carlsson.
2443
2444         * Shared/ShareableResource.cpp:
2445         (WebKit::ShareableResource::Handle::tryWrapInCFData):
2446         * WebProcess/WebPage/WebFrame.cpp:
2447         (WebKit::WebFrame::certificateInfo): Return a WebCore::CertificateInfo instead
2448         of const WebCore::CertificateInfo& to avoid returning a dangling reference to
2449         a local variable. Also, remove the unnecessary calls to std::move() as the compiler
2450         will invoke the move constructor for WebCore::CertificateInfo on return from the
2451         function.
2452         * WebProcess/WebPage/WebFrame.h:
2453
2454 2014-07-01  Anders Carlsson  <andersca@apple.com>
2455
2456         Add a BackForwardListItemState struct and put the snapshot UUID there
2457         https://bugs.webkit.org/show_bug.cgi?id=134497
2458
2459         Reviewed by Sam Weinig.
2460
2461         * Shared/SessionState.cpp:
2462         (WebKit::PageState::encode):
2463         (WebKit::PageState::decode):
2464         (WebKit::BackForwardListItemState::encode):
2465         (WebKit::BackForwardListItemState::decode):
2466         * Shared/SessionState.h:
2467         * Shared/WebBackForwardListItem.cpp:
2468         (WebKit::WebBackForwardListItem::create):
2469         (WebKit::WebBackForwardListItem::WebBackForwardListItem):
2470         (WebKit::WebBackForwardListItem::backForwardData):
2471         (WebKit::WebBackForwardListItem::setBackForwardData):
2472         (WebKit::WebBackForwardListItem::encode):
2473         * Shared/WebBackForwardListItem.h:
2474         (WebKit::WebBackForwardListItem::setPageState):
2475         (WebKit::WebBackForwardListItem::setOriginalURL):
2476         (WebKit::WebBackForwardListItem::originalURL):
2477         (WebKit::WebBackForwardListItem::setURL):
2478         (WebKit::WebBackForwardListItem::url):
2479         (WebKit::WebBackForwardListItem::setTitle):
2480         (WebKit::WebBackForwardListItem::title):
2481         (WebKit::WebBackForwardListItem::setSnapshotUUID):
2482         (WebKit::WebBackForwardListItem::snapshotUUID):
2483         * UIProcess/WebBackForwardList.cpp:
2484         (WebKit::WebBackForwardList::restoreFromState):
2485         * UIProcess/WebProcessProxy.cpp:
2486         (WebKit::WebProcessProxy::addBackForwardItem):
2487         * UIProcess/mac/LegacySessionStateCoding.cpp:
2488         (WebKit::decodeSessionHistoryEntries):
2489
2490 2014-07-01  Yongjun Zhang  <yongjun_zhang@apple.com>
2491
2492         Add encodeInteger and decodeInteger for remote object encoder and decoder.
2493         https://bugs.webkit.org/show_bug.cgi?id=134453
2494
2495         In 64bit system, encodeInteger/decodeInteger is by default mapped into encodeInt64/decodeInt64.  For
2496         32bit system, they are mapped to encodeInt32/decodeInt32.  However, since we don't have encodeInt32/decodeInt32
2497         implementation in WKRemoteObjectCoder, we could hit crash in 32bit systems.
2498
2499         Reviewed by Sam Weinig.
2500
2501         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
2502         (-[WKRemoteObjectEncoder encodeInteger:forKey:]): Instead of creating a new number type UInt32, use encodeInt64 for
2503             encoding NSInteger.
2504         (-[WKRemoteObjectDecoder decodeIntegerForKey:]):
2505
2506 2014-06-30  Anders Carlsson  <andersca@apple.com>
2507
2508         Use an std::function for filtering session state data
2509         https://bugs.webkit.org/show_bug.cgi?id=134481
2510
2511         Reviewed by Sam Weinig.
2512
2513         * UIProcess/API/C/WKPage.cpp:
2514         (WKPageCopySessionState):
2515         * UIProcess/API/Cocoa/WKWebView.mm:
2516         (-[WKWebView _sessionState]):
2517         * UIProcess/WebBackForwardList.h:
2518         * UIProcess/WebPageProxy.cpp:
2519         (WebKit::WebPageProxy::sessionStateData):
2520         * UIProcess/WebPageProxy.h:
2521         * UIProcess/cf/WebBackForwardListCF.cpp:
2522         (WebKit::WebBackForwardList::createCFDictionaryRepresentation):
2523         * UIProcess/cf/WebPageProxyCF.cpp:
2524         (WebKit::WebPageProxy::sessionStateData):
2525
2526 2014-07-01  Rohit Kumar  <kumar.rohit@samsung.com>
2527
2528         Clean up the WebKit build from unused parameter warning in Webkit2/UIProcess module
2529         https://bugs.webkit.org/show_bug.cgi?id=134294
2530
2531         Reviewed by Darin Adler.
2532
2533         * UIProcess/API/APIUIClient.h:
2534         (API::UIClient::reachedApplicationCacheOriginQuota):
2535
2536 2014-07-01  Brady Eidson  <beidson@apple.com>
2537
2538         Followup for: Combine the Telephone and Selection overlay controllers, updating UI behavior.
2539         https://bugs.webkit.org/show_bug.cgi?id=134461
2540
2541         Rubberstamped by Tim Horton.
2542
2543         * WebProcess/WebPage/mac/ServicesOverlayController.mm: Include the correct constant.
2544
2545 2014-07-01  Brady Eidson  <beidson@apple.com>
2546
2547         Build fix.
2548
2549         Forgot to commit locally before pushing.
2550
2551         * WebProcess/WebPage/WebPage.cpp:
2552         (WebKit::WebPage::servicesOverlayController): s/this/*this/
2553
2554 2014-07-01  Brady Eidson  <beidson@apple.com>
2555
2556         Combine the Telephone and Selection overlay controllers, updating UI behavior.
2557         https://bugs.webkit.org/show_bug.cgi?id=134461
2558
2559         Reviewed by Tim Horton.
2560
2561         * WebKit2.xcodeproj/project.pbxproj:
2562
2563         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2564         (WebKit::WebEditorClient::selectedTelephoneNumberRangesChanged):
2565         (WebKit::WebEditorClient::selectionRectsDidChange):
2566
2567         Remove the separate Selection overlay controller:
2568         * WebProcess/WebPage/SelectionOverlayController.cpp: Removed.
2569         * WebProcess/WebPage/ServicesOverlayController.h: Renamed from Source/WebKit2/WebProcess/WebPage/SelectionOverlayController.h.
2570         (WebKit::ServicesOverlayController::create):
2571         * WebProcess/WebPage/mac/SelectionOverlayControllerMac.mm: Removed.
2572
2573         Remove the separate TelephoneNumber overlay controller:
2574         * WebProcess/WebPage/TelephoneNumberOverlayController.cpp: Removed.
2575         * WebProcess/WebPage/TelephoneNumberOverlayController.h: Removed.
2576         * WebProcess/WebPage/mac/TelephoneNumberOverlayControllerMac.mm: Removed.
2577
2578         * WebProcess/WebPage/WebPage.cpp:
2579         (WebKit::WebPage::servicesOverlayController):
2580         (WebKit::WebPage::telephoneNumberOverlayController): Deleted.
2581         (WebKit::WebPage::selectionOverlayController): Deleted.
2582         (WebKit::WebPage::didChangeScrollOffsetForFrame): Deleted.
2583         * WebProcess/WebPage/WebPage.h:
2584         (WebKit::WebPage::serviceControlsEnabled): Deleted.
2585
2586         ServicesOverlayController is a combination of the old TelephoneNumber and Selection overlay controllers.
2587         A lot of code duplication is resolved, and things are generally easier to follow.
2588         It enforces displaying a telephone number highlight if precisely one telephone number is selected, or
2589         the selection highlight if the selection contains more than a single phone number
2590         * WebProcess/WebPage/mac/ServicesOverlayController.mm: Added.
2591         (WebKit::textQuadsToBoundingRectForRange):
2592         (WebKit::ServicesOverlayController::ServicesOverlayController):
2593         (WebKit::ServicesOverlayController::destroyOverlay):
2594         (WebKit::ServicesOverlayController::pageOverlayDestroyed):
2595         (WebKit::ServicesOverlayController::willMoveToWebPage):
2596         (WebKit::ServicesOverlayController::didMoveToWebPage):
2597         (WebKit::ServicesOverlayController::createOverlayIfNeeded):
2598         (WebKit::ServicesOverlayController::selectionRectsDidChange):
2599         (WebKit::ServicesOverlayController::selectedTelephoneNumberRangesChanged):
2600         (WebKit::ServicesOverlayController::clearHighlightState):
2601         (WebKit::ServicesOverlayController::drawRect):
2602         (WebKit::ServicesOverlayController::drawSelectionHighlight):
2603         (WebKit::ServicesOverlayController::drawTelephoneNumberHighlight):
2604         (WebKit::ServicesOverlayController::drawCurrentHighlight):
2605         (WebKit::ServicesOverlayController::mouseEvent):
2606         (WebKit::ServicesOverlayController::handleClick):
2607
2608 2014-07-01  Zan Dobersek  <zdobersek@igalia.com>
2609
2610         [WK2] IPC messages' arguments() method returns const std::tuple<> copies
2611         https://bugs.webkit.org/show_bug.cgi?id=131975
2612
2613         Reviewed by Darin Adler.
2614
2615         The arguments() method of the different IPC message objects should return a const reference
2616         to the std::tuple<> containing the arguments, instead of a const value. This avoids copying
2617         the std::tuple<> every time the arguments are encoded, and works best with the
2618         ArgumentEncoder::encode<std::tuple<...>>(const std::tuple<...>&) template instantiation.
2619
2620         The unit test baselines are updated accordingly.
2621
2622         * Scripts/webkit2/LegacyMessages-expected.h:
2623         (Messages::WebPage::LoadURL::arguments):
2624         (Messages::WebPage::LoadSomething::arguments):
2625         (Messages::WebPage::TouchEvent::arguments):
2626         (Messages::WebPage::AddEvent::arguments):
2627         (Messages::WebPage::LoadSomethingElse::arguments):
2628         (Messages::WebPage::DidReceivePolicyDecision::arguments):
2629         (Messages::WebPage::Close::arguments):
2630         (Messages::WebPage::PreferencesDidChange::arguments):
2631         (Messages::WebPage::SendDoubleAndFloat::arguments):
2632         (Messages::WebPage::SendInts::arguments):
2633         (Messages::WebPage::CreatePlugin::arguments):
2634         (Messages::WebPage::RunJavaScriptAlert::arguments):
2635         (Messages::WebPage::GetPlugins::arguments):
2636         (Messages::WebPage::GetPluginProcessConnection::arguments):
2637         (Messages::WebPage::TestMultipleAttributes::arguments):
2638         (Messages::WebPage::TestParameterAttributes::arguments):
2639         (Messages::WebPage::TemplateTest::arguments):
2640         (Messages::WebPage::SetVideoLayerID::arguments):
2641         (Messages::WebPage::DidCreateWebProcessConnection::arguments):
2642         (Messages::WebPage::InterpretKeyEvent::arguments):
2643         (Messages::WebPage::DeprecatedOperation::arguments):
2644         (Messages::WebPage::ExperimentalOperation::arguments):
2645         * Scripts/webkit2/Messages-expected.h:
2646         (Messages::WebPage::LoadURL::arguments):
2647         (Messages::WebPage::LoadSomething::arguments):
2648         (Messages::WebPage::TouchEvent::arguments):
2649         (Messages::WebPage::AddEvent::arguments):
2650         (Messages::WebPage::LoadSomethingElse::arguments):
2651         (Messages::WebPage::DidReceivePolicyDecision::arguments):
2652         (Messages::WebPage::Close::arguments):
2653         (Messages::WebPage::PreferencesDidChange::arguments):
2654         (Messages::WebPage::SendDoubleAndFloat::arguments):
2655         (Messages::WebPage::SendInts::arguments):
2656         (Messages::WebPage::CreatePlugin::arguments):
2657         (Messages::WebPage::RunJavaScriptAlert::arguments):
2658         (Messages::WebPage::GetPlugins::arguments):
2659         (Messages::WebPage::GetPluginProcessConnection::arguments):
2660         (Messages::WebPage::TestMultipleAttributes::arguments):
2661         (Messages::WebPage::TestParameterAttributes::arguments):
2662         (Messages::WebPage::TemplateTest::arguments):
2663         (Messages::WebPage::SetVideoLayerID::arguments):
2664         (Messages::WebPage::DidCreateWebProcessConnection::arguments):
2665         (Messages::WebPage::InterpretKeyEvent::arguments):
2666         (Messages::WebPage::DeprecatedOperation::arguments):
2667         (Messages::WebPage::ExperimentalOperation::arguments):
2668         * Scripts/webkit2/MessagesSuperclass-expected.h:
2669         (Messages::WebPage::LoadURL::arguments):
2670         * Scripts/webkit2/messages.py:
2671         (message_to_struct_declaration):
2672
2673 2014-07-01  Evan Nemerson  <evan@nemerson.com>
2674
2675         [GTK] Annotations for WebResource.get_data produce wrong signature in Vala binding
2676         https://bugs.webkit.org/show_bug.cgi?id=134476
2677
2678         Reviewed by Carlos Garcia Campos.
2679
2680         * UIProcess/API/gtk/WebKitWebResource.cpp: Add array length and
2681         element-type annotations to return value of webkit_web_resource_get_data_finish().
2682
2683 2014-07-01  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2684
2685         [WK2] Can not convert ‘sessionState.WebKit::SessionState::provisionalURL’ from ‘WebCore::URL’ to ‘bool’
2686         https://bugs.webkit.org/show_bug.cgi?id=134487
2687
2688         Rubber-stamped by Carlos Garcia Campos.
2689
2690         * UIProcess/WebPageProxy.cpp: Use isNull().
2691         (WebKit::WebPageProxy::restoreFromState):
2692
2693 2014-07-01  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2694
2695         Fix build break on EFL and GTK ports since r170611 and r170614
2696         https://bugs.webkit.org/show_bug.cgi?id=134479
2697
2698         Reviewed by Carlos Garcia Campos.
2699
2700         Add LegacySessionStateCodingNone.cpp in order to fix build break on EFL and GTK ports. Additionally
2701         SessionStateConversion.cpp is added to CMakeLists.txt as well.
2702
2703         * CMakeLists.txt:
2704         * UIProcess/LegacySessionStateCoding.h: Copied from Source/WebKit2/UIProcess/mac/LegacySessionStateCoding.h.
2705         * UIProcess/LegacySessionStateCodingNone.cpp: Renamed from Source/WebKit2/UIProcess/mac/LegacySessionStateCoding.h.
2706         (WebKit::encodeLegacySessionHistoryEntryData):
2707         (WebKit::decodeLegacySessionState):
2708         (WebKit::decodeLegacySessionHistoryEntryData):
2709         * UIProcess/WebPageProxy.cpp:
2710         (WebKit::WebPageProxy::loadFile):
2711         (WebKit::WebPageProxy::restoreFromState):
2712         * WebKit2.xcodeproj/project.pbxproj:
2713
2714 2014-06-30  Benjamin Poulain  <benjamin@webkit.org>
2715
2716         [iOS][WK2] The long press gesture recognizers should not block the pinch gesture
2717         https://bugs.webkit.org/show_bug.cgi?id=134477
2718         <rdar://problem/17514936>
2719
2720         Reviewed by Tim Horton.
2721
2722         * UIProcess/ios/WKContentViewInteraction.mm:
2723         (-[WKContentView gestureRecognizer:canPreventGestureRecognizer:]):
2724
2725 2014-06-30  Anders Carlsson  <andersca@apple.com>
2726
2727         Add WebPageProxy::restoreFromState
2728         https://bugs.webkit.org/show_bug.cgi?id=134480
2729
2730         Reviewed by Tim Horton.
2731
2732         * UIProcess/WebPageProxy.cpp:
2733         (WebKit::WebPageProxy::restoreFromState):
2734         * UIProcess/WebPageProxy.h:
2735
2736 2014-06-30  Anders Carlsson  <andersca@apple.com>
2737
2738         Add a function to restore a WebBackForwardList object from a BackForwardListState object
2739         https://bugs.webkit.org/show_bug.cgi?id=134478
2740
2741         Reviewed by Tim Horton.
2742
2743         * UIProcess/WebBackForwardList.cpp:
2744         (WebKit::generateWebBackForwardItemID):
2745         (WebKit::WebBackForwardList::restoreFromState):
2746         * UIProcess/WebBackForwardList.h:
2747         * UIProcess/cf/WebBackForwardListCF.cpp:
2748         (WebKit::generateWebBackForwardItemID): Deleted.
2749
2750 2014-06-30  Anders Carlsson  <andersca@apple.com>
2751
2752         Change the AddBackForwardItem message to take a page state object
2753         https://bugs.webkit.org/show_bug.cgi?id=134475
2754
2755         Reviewed by Andreas Kling.
2756
2757         * Scripts/webkit2/messages.py:
2758         (struct_or_class):
2759         (headers_for_type):
2760         * Shared/WebBackForwardListItem.cpp:
2761         (WebKit::WebBackForwardListItem::create):
2762         (WebKit::WebBackForwardListItem::WebBackForwardListItem):
2763         * Shared/WebBackForwardListItem.h:
2764         (WebKit::WebBackForwardListItem::setPageState):
2765         * UIProcess/WebProcessProxy.cpp:
2766         (WebKit::WebProcessProxy::addBackForwardItem):
2767         * UIProcess/WebProcessProxy.h:
2768         * UIProcess/WebProcessProxy.messages.in:
2769         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
2770         (WebKit::updateBackForwardItem):
2771
2772 2014-06-30  Tim Horton  <timothy_horton@apple.com>
2773
2774         [WK2] Add a flatter find-in-page current match indicator style
2775         https://bugs.webkit.org/show_bug.cgi?id=134434
2776         <rdar://problem/16225673>
2777
2778         Reviewed by Simon Fraser.
2779
2780         * UIProcess/FindIndicator.cpp:
2781         (WebKit::findIndicatorsForTextRectsOverlap):
2782         (WebKit::FindIndicator::frameRect):
2783         (WebKit::flatHighlightColor):
2784         (WebKit::flatRimShadowColor):
2785         (WebKit::flatDropShadowColor):
2786         (WebKit::FindIndicator::draw):
2787         Add a flatter find indicator, with a bigger shadow.
2788
2789         * WebProcess/WebPage/FindController.cpp:
2790         (WebKit::FindController::updateFindUIAfterPageScroll):
2791         (WebKit::FindController::getFindIndicatorBitmapAndRect):
2792         (WebKit::FindController::hideFindIndicator):
2793         (WebKit::FindController::drawRect):
2794         Don't paint a shadow behind the secondary matches if we're using the new style.
2795
2796 2014-06-30  Benjamin Poulain  <benjamin@webkit.org>
2797
2798         [iOS][WK2] Improve double-tap-to-scroll on image documents
2799         https://bugs.webkit.org/show_bug.cgi?id=134474
2800         <rdar://problem/17496778>
2801
2802         Reviewed by Enrica Casucci.
2803
2804         On image document, we were always rendering the center of the image as the origin, which broke
2805         double tap to scroll.
2806
2807         This patch improves on this in two ways:
2808         1) If the hit testing already got the image, only change the type to replaced (to get the right
2809            scaling behavior for images since the type is block on iOS's image document).
2810         2) If the hit testing is outside the image, only center the axis that is not in the image.
2811            This way, we "fix" the component that is not valid, and keep the vali component.
2812            This works great for viewing comics on iPad.
2813
2814         * WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
2815         (WebKit::ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture):
2816
2817 2014-06-30  Enrica Casucci  <enrica@apple.com>
2818
2819         REGRESSION (WK2): Weird selection behavior on autos.yahoo.com, en.wikipedia.org.
2820         https://bugs.webkit.org/show_bug.cgi?id=134466
2821         <rdar://problem/16817263>
2822
2823         Reviewed by Benjamin Poulain.
2824
2825         Avoid selecting blocks across frame boundaries and skip non-selectable
2826         blocks. If the only block we find is almost the same height as the
2827         visible area, we should not select at all.
2828         This patch also fixes the logic to compute the next block when
2829         shrinking the selection. When calculating the new range after shrinking,
2830         we should not include the block that corresponds to the current handle position.
2831
2832         * WebProcess/WebPage/ios/WebPageIOS.mm:
2833         (WebKit::WebPage::rangeForWebSelectionAtPosition):
2834         (WebKit::WebPage::expandedRangeFromHandle):
2835         (WebKit::WebPage::contractedRangeFromHandle):
2836         (WebKit::WebPage::updateSelectionWithTouches):
2837
2838 2014-06-30  Anders Carlsson  <andersca@apple.com>
2839
2840         WebBackForwardListItem should not store back-forward data
2841         https://bugs.webkit.org/show_bug.cgi?id=134469
2842
2843         Reviewed by Darin Adler.
2844
2845         Change WebBackForwardListItem::backForwardData to encode the main frame state lazily,
2846         and change WebBackForwardListItem::setBackForwardData to decode it into the main frame state.
2847
2848         * Shared/WebBackForwardListItem.cpp:
2849         (WebKit::WebBackForwardListItem::backForwardData):
2850         (WebKit::WebBackForwardListItem::setBackForwardData):
2851         (WebKit::WebBackForwardListItem::encode):
2852         * Shared/WebBackForwardListItem.h:
2853         (WebKit::WebBackForwardListItem::backForwardData): Deleted.
2854         * UIProcess/cf/WebBackForwardListCF.cpp:
2855         (WebKit::WebBackForwardList::createCFDictionaryRepresentation):
2856         * WebProcess/WebPage/WebPage.cpp:
2857         (WebKit::WebPage::restoreSession):
2858
2859 2014-06-30  Anders Carlsson  <andersca@apple.com>
2860
2861         WebBackForwardListItems should hold on to PageState objects
2862         https://bugs.webkit.org/show_bug.cgi?id=134467
2863
2864         Reviewed by Darin Adler.
2865
2866         * Shared/WebBackForwardListItem.cpp:
2867         (WebKit::WebBackForwardListItem::WebBackForwardListItem):
2868         (WebKit::WebBackForwardListItem::encode):
2869         * Shared/WebBackForwardListItem.h:
2870         (WebKit::WebBackForwardListItem::setOriginalURL):
2871         (WebKit::WebBackForwardListItem::originalURL):
2872         (WebKit::WebBackForwardListItem::setURL):
2873         (WebKit::WebBackForwardListItem::url):
2874         (WebKit::WebBackForwardListItem::setTitle):
2875         (WebKit::WebBackForwardListItem::title):
2876
2877 2014-06-30  Benjamin Poulain  <benjamin@webkit.org>
2878
2879         Add a missing semicolon in WKContentViewInteraction
2880
2881         * UIProcess/ios/WKContentViewInteraction.mm:
2882         (nsSizeForTapHighlightBorderRadius):
2883         I messed up this when fixing the patch on landing.
2884
2885 2014-06-30  Anders Carlsson  <andersca@apple.com>
2886
2887         Adopt the legacy session decoding inside WebPage::restoreSession for now
2888         https://bugs.webkit.org/show_bug.cgi?id=134465
2889
2890         Reviewed by Sam Weinig.
2891
2892         * UIProcess/mac/LegacySessionStateCoding.cpp:
2893         (WebKit::decodeLegacySessionHistoryEntryData):
2894         * UIProcess/mac/LegacySessionStateCoding.h:
2895         * WebProcess/WebPage/WebPage.cpp:
2896         (WebKit::WebPage::restoreSession):
2897
2898 2014-06-30  Simon Fraser  <simon.fraser@apple.com>
2899
2900         [iOS WK2] Don't crash on status bar tap with overflow scroll views
2901         https://bugs.webkit.org/show_bug.cgi?id=134459
2902
2903         Reviewed by Tim Horton.
2904         
2905         The tiled scrolling indicator parents UIViews under CALayers, but that causes
2906         those views to miss -willMoveToWindow:nil notifications on teardown. This can leave
2907         deleted UIScrollViews in UIKit's "scroll to top" list.
2908         
2909         Fix by not making UIScrollViews in the debug layer tree host.
2910
2911         * UIProcess/ios/RemoteLayerTreeHostIOS.mm:
2912         (WebKit::RemoteLayerTreeHost::createLayer):
2913
2914 2014-06-28  Oliver Hunt  <oliver@apple.com>
2915
2916        Restrict network process sandbox
2917        https://bugs.webkit.org/show_bug.cgi?id=134360
2918
2919        Reviewed by Sam Weinig.
2920
2921        Add more restrictions to the network process sandbox.
2922
2923        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2924        (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
2925          Always use the cache directory provided in the initialization parameters,
2926          and make sure we consume the cookie directory extension.
2927        * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
2928          Make the sandbox profile much more restrictive.
2929        * Shared/Network/NetworkProcessCreationParameters.cpp:
2930        (WebKit::NetworkProcessCreationParameters::encode):
2931        (WebKit::NetworkProcessCreationParameters::decode):
2932        * Shared/Network/NetworkProcessCreationParameters.h:
2933          The network process now requires an extension to access
2934          its cookie storage.
2935        * Shared/mac/SandboxUtilities.cpp:
2936        (WebKit::pathForProcessContainer):
2937        * Shared/mac/SandboxUtilities.h:
2938          We need to be able to get hold of our container so
2939          that we can get the correct cookie storage directory.
2940        * UIProcess/WebContext.cpp:
2941        (WebKit::WebContext::ensureNetworkProcess):
2942          We have to pass in the an extension for the cookie storage directory when
2943        initalising the network process
2944        * UIProcess/mac/WebContextMac.mm:
2945        (WebKit::WebContext::platformDefaultCookieStorageDirectory):
2946          Make sure we provide the correct location on IOS
2947        * WebProcess/cocoa/WebProcessCocoa.mm:
2948        (WebKit::WebProcess::platformInitializeWebProcess):
2949          Consume the cookie storage extension
2950
2951 2014-06-30  Simon Fraser  <simon.fraser@apple.com>
2952
2953         [iOS WK2] Turn off scrollsToTop on overflow UIScrollViews
2954         https://bugs.webkit.org/show_bug.cgi?id=134456
2955
2956         Reviewed by Tim Horton.
2957         
2958         Set scrollsToTop to NO on our UIScrollViews created for overflow scrolling, since
2959         we don't have a good strategy for when to allow it, and doing so would also require
2960         some smarts in the main UIScrollView.
2961
2962         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
2963         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren):
2964
2965 2014-06-30  Enrica Casucci  <enrica@apple.com>
2966
2967         REGRESSION (Okemo): The contextual menu on tap and hold does not cancel the other gestures.
2968         https://bugs.webkit.org/show_bug.cgi?id=134463
2969         <rdar://problem/17388907>
2970
2971         Reviewed by Benjamin Poulain.
2972
2973         * UIProcess/ios/WKContentViewInteraction.mm:
2974         (-[WKContentView _longPressRecognized:]):
2975
2976 2014-06-30  Anders Carlsson  <andersca@apple.com>
2977
2978         Implement the last pieces of encodeFrameStateNode
2979         https://bugs.webkit.org/show_bug.cgi?id=134460
2980
2981         Reviewed by Andreas Kling.
2982
2983         * UIProcess/mac/LegacySessionStateCoding.cpp:
2984         (WebKit::HistoryEntryDataEncoder::operator<<):
2985         (WebKit::isValidEnum):
2986         (WebKit::encodeFormDataElement):
2987         (WebKit::encodeFormData):
2988         (WebKit::encodeFrameStateNode):
2989
2990 2014-06-30  Benjamin Poulain  <bpoulain@apple.com>
2991
2992         [iOS][WK2] Move tap highlight to the inverseScaleRootView
2993         https://bugs.webkit.org/show_bug.cgi?id=134424
2994         <rdar://problem/17480880>
2995
2996         Reviewed by Tim Horton.
2997
2998         Enrica introduced the inverseScaleRootView that is a dynamic version of _highlightRootView.
2999
3000         This patch moves the tap highlight from its own inverse root to inverseScaleRootView. This provides better handling
3001         of scale, better behavior on crash, and remove one extra view from the hierarchy.
3002
3003         The code is pretty much the same, just moved around. Some of the changes:
3004
3005         Now the code needs to handle repainting live when the view scale. To do that, _showTapHighlightXXX was split in two:
3006         -_showTapHighlight to setup the view.
3007         -_updateTapHighlight to update the view based on the current scale.
3008
3009         Since the view updates live on scaling, we need to recompute the coordinates for each update. To do that, the _potentialTapHighlightInformation
3010         was generalized to handle all cases of highlight.
3011
3012         Since we can no longer test for the nullity of _potentialTapHighlightInformation,
3013         a new attribute is introduced for that: _hasTapHighlightForPotentialTap.
3014
3015         The last bit of change concern reentering the tap highlight. This becomes quite simple:
3016         1) _isTapHighlightIDValid is updated before the animation starts
3017            so that it can be set again during an animation.
3018         2) The animation checks the "finished" flags before removing the view from its superview
3019            to avoid breaking the new animation.
3020
3021         * UIProcess/API/Cocoa/WKWebView.mm:
3022         (withinEpsilon): Deleted.
3023         * UIProcess/ios/WKContentView.mm:
3024         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):
3025         Make _updateUnscaledView conditional to scale changes, that thing isn't cheap!
3026
3027         * UIProcess/ios/WKContentViewInteraction.h:
3028         (withinEpsilon):
3029         Move withinEpsilon() from WKContentView to use it from both classes.
3030
3031         * UIProcess/ios/WKContentViewInteraction.mm:
3032         (-[WKContentView cleanupInteraction]):
3033         (-[WKContentView _updateUnscaledView]):
3034         (-[WKContentView _updateTapHighlight]):
3035         (-[WKContentView _showTapHighlight]):
3036         (-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:]):
3037         (-[WKContentView _cancelInteraction]):
3038         (-[WKContentView _finishInteraction]):
3039         (-[WKContentView _singleTapDidReset:]):
3040         (-[WKContentView _singleTapCommited:]):
3041         (-[WKContentView _showTapHighlightWithColor:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:]): Deleted.
3042
3043 2014-06-30  Anders Carlsson  <andersca@apple.com>
3044
3045         Add code for encoding legacy session history entries
3046         https://bugs.webkit.org/show_bug.cgi?id=134452
3047
3048         Reviewed by Andreas Kling.
3049
3050         * UIProcess/mac/LegacySessionStateCoding.cpp:
3051         (WebKit::HistoryEntryDataEncoder::HistoryEntryDataEncoder):
3052         (WebKit::HistoryEntryDataEncoder::operator<<):
3053         (WebKit::HistoryEntryDataEncoder::finishEncoding):
3054         (WebKit::HistoryEntryDataEncoder::encodeArithmeticType):
3055         (WebKit::HistoryEntryDataEncoder::encodeFixedLengthData):
3056         (WebKit::HistoryEntryDataEncoder::grow):
3057         (WebKit::HistoryEntryDataEncoder::growCapacity):
3058         (WebKit::encodeFrameStateNode):
3059         (WebKit::encodeLegacySessionHistoryEntryData):
3060         (WebKit::decodeSessionHistoryEntryData):
3061         (WebKit::decodeLegacySessionHistoryEntryData):
3062         * UIProcess/mac/LegacySessionStateCoding.h:
3063
3064 2014-06-29  Yoav Weiss  <yoav@yoav.ws>
3065
3066         Add support for HTMLImageElement's sizes attribute
3067         https://bugs.webkit.org/show_bug.cgi?id=133620
3068
3069         Reviewed by Dean Jackson.
3070
3071         Added an ENABLE_PICTURE_SIZES compile flag.
3072
3073         * Configurations/FeatureDefines.xcconfig:
3074
3075 2014-06-28  Tim Horton  <timothy_horton@apple.com>
3076
3077         [iOS][WK2] PDFs never load inline again after the Web process crashes
3078         https://bugs.webkit.org/show_bug.cgi?id=134432
3079         <rdar://problem/17484205>
3080
3081         Reviewed by Dan Bernstein.
3082
3083         After a crash, the WebPage never gets mimeTypesWithCustomContentProviders filled back in.
3084
3085         * Shared/WebPageCreationParameters.cpp:
3086         (WebKit::WebPageCreationParameters::encode):
3087         (WebKit::WebPageCreationParameters::decode):
3088         * Shared/WebPageCreationParameters.h:
3089         * UIProcess/WebPageProxy.cpp:
3090         (WebKit::WebPageProxy::creationParameters):
3091         * WebProcess/WebPage/WebPage.cpp:
3092         (WebKit::WebPage::WebPage):
3093         Add mimeTypesWithCustomContentProviders to WebPageCreationParameters.
3094
3095         * UIProcess/Cocoa/WKWebViewContentProviderRegistry.h:
3096         * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
3097         (-[WKWebViewContentProviderRegistry addPage:]):
3098         We don't need to send the MIME types across when a page is added, because it already got them in its creation parameters.
3099
3100         (-[WKWebViewContentProviderRegistry removePage:]):
3101         (-[WKWebViewContentProviderRegistry _mimeTypesWithCustomContentProviders]):
3102         Return a vector of all registered MIME types.
3103
3104         * UIProcess/ios/PageClientImplIOS.h:
3105         * UIProcess/ios/PageClientImplIOS.mm:
3106         (WebKit::PageClientImpl::mimeTypesWithCustomContentProviders):
3107         * UIProcess/PageClient.h:
3108         Add (iOS only for now) mimeTypesWithCustomContentProviders to PageClient.
3109
3110 2014-06-28  Dan Bernstein  <mitz@apple.com>
3111
3112         REGRESSION: WebPageProxy::attributedSubstringForCharacterRangeAsync never calls its callback function
3113         https://bugs.webkit.org/show_bug.cgi?id=134429
3114
3115         Reviewed by Tim Horton.
3116
3117         * UIProcess/mac/WebPageProxyMac.mm:
3118         (WebKit::WebPageProxy::attributedSubstringForCharacterRangeAsync):
3119
3120 2014-06-27  Simon Fraser  <simon.fraser@apple.com>
3121
3122         [iOS WK2] position:fixed inside accelerated overflow:scroll is jumpy
3123         https://bugs.webkit.org/show_bug.cgi?id=134426
3124         <rdar://problem/17474523>
3125
3126         Reviewed by Tim Horton.
3127
3128         After committing a new layer tree (with possibly stale position:fixed layer
3129         positions), we need the scrolling tree to update those positions based on
3130         the current scroll offset.
3131         
3132         To achieve that, implement ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterAncestorChange()
3133         and have it add to the cumulative delta the difference between the last committed scroll
3134         position and the current scroll position.
3135         
3136         Also make sure that ScrollingTreeOverflowScrollingNodeIOS doesn't call back to scrollViewDidScroll()
3137         when we're updating its scroll position inside a scrolling tree commit.
3138
3139         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
3140         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
3141         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::ScrollingTreeOverflowScrollingNodeIOS):
3142         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren):
3143         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterAncestorChange):
3144         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollViewDidScroll):
3145
3146 2014-06-27  Antti Koivisto  <antti@apple.com>
3147
3148         Flush throttling with remote layers
3149         https://bugs.webkit.org/show_bug.cgi?id=134398
3150
3151         Reviewed by Darin Adler.
3152
3153         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3154         (WebKit::WebChromeClient::adjustLayerFlushThrottling):
3155         * WebProcess/WebCoreSupport/WebChromeClient.h:
3156         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
3157         * WebProcess/WebPage/DrawingArea.h:
3158         (WebKit::DrawingArea::adjustLayerFlushThrottling):
3159         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
3160         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
3161         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
3162         (WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
3163         (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush):
3164
3165             Delay layer flushes during page loading.
3166             If use interacts with the page the next flush in unthrottled even if loading is in progress.
3167
3168         (WebKit::RemoteLayerTreeDrawingArea::adjustLayerFlushThrottling):
3169         
3170             Compute the new delay. The first visual flush uses a shorter delay.
3171             Flush immediately when we are no longer throttling.
3172
3173         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3174         (WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
3175
3176 2014-06-27  Joseph Pecoraro  <pecoraro@apple.com>
3177
3178         [iOS][WK2] <select> tapping "next" does not save new picker value
3179         https://bugs.webkit.org/show_bug.cgi?id=134409
3180
3181         Reviewed by Enrica Casucci.
3182
3183         * UIProcess/ios/WKContentViewInteraction.mm:
3184         (-[WKContentView accessoryTab:]):
3185         We know the assisted node will change, so call endEditing
3186         before the assisted node changes in the WebProcess.
3187
3188         (-[WKContentView _stopAssistingNode]):
3189         Ensure we call endEditing to trigger controlEndEditing.
3190
3191         * UIProcess/ios/forms/WKFormSelectPicker.mm:
3192         (-[WKMultipleSelectPicker initWithView:]):
3193         (-[WKMultipleSelectPicker pickerView:row:column:checked:]):
3194         (-[WKSelectSinglePicker dealloc]):
3195         Style fixes.
3196
3197 2014-06-27  Peyton Randolph  <prandolph@apple.com>
3198
3199          Add feature flag for link long-press gesture.                                                                   
3200          https://bugs.webkit.org/show_bug.cgi?id=134262                                                                  
3201                                                                                                                          
3202          Reviewed by Enrica Casucci.                                                                                     
3203                                                                                                                          
3204          * Configurations/FeatureDefines.xcconfig:                                                                       
3205          Add ENABLE_LINK_LONG_PRESS. 
3206
3207 2014-06-26  Simon Fraser  <simon.fraser@apple.com>
3208
3209         [iOS WK2] Fix touch-scrollable elements with overflow:scroll on just one axis, and RTL scrolling
3210         https://bugs.webkit.org/show_bug.cgi?id=134377
3211         <rdar://problem/16762224>
3212
3213         Reviewed by Tim Horton.
3214
3215         Make -webkit-overflow-scrolling:touch scrolling work correctly when one axis
3216         has overflow:scroll and the other overflow:hidden. Also fix scrolling in RTL
3217         contexts.
3218         
3219         An RTL scroller with overflow-x:hidden will have a non-zero scroll origin,
3220         and needs to truncate the scrolled content on the left side. To pass the
3221         correct geometry to the UI process, we need to introduce the concept of
3222         "reachable" size as well as total content size; normally these are the same,
3223         but will differ when scrolling is only allowed on one axis but there is overflow
3224         on both axes.
3225         
3226         ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren() uses the total and
3227         reachable content sizes to set a negative edge inset on the left (for RTL) or top
3228         (for bottom-to-top) so prevent scrolling into these areas.
3229
3230         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
3231         (ArgumentCoder<ScrollingStateScrollingNode>::encode):
3232         (ArgumentCoder<ScrollingStateScrollingNode>::decode):
3233         (WebKit::RemoteScrollingTreeTextStream::dump):
3234         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
3235         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren): 
3236
3237 2014-06-27  Joseph Pecoraro  <pecoraro@apple.com>
3238
3239         Fix various leaks, RetainPtrs should adopt allocs
3240         https://bugs.webkit.org/show_bug.cgi?id=134308
3241
3242         Reviewed by Alexey Proskuryakov.
3243
3244         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
3245         (-[WKWebProcessPlugInBrowserContextController _remoteObjectRegistry]):
3246
3247 2014-06-27  Dan Bernstein  <mitz@apple.com>
3248
3249         Remove unused definitions that were mistakenly added back in r170323 and then again in r170329
3250         https://bugs.webkit.org/show_bug.cgi?id=134397
3251
3252         Reviewed by Geoff Garen.
3253
3254         * UIProcess/API/Cocoa/WKBackForwardList.mm:
3255
3256 2014-06-26  Daniel Bates  <dabates@apple.com>
3257
3258         [iOS][WK2] Distant focusable element may not be scrolled into view when focused using keyboard
3259         https://bugs.webkit.org/show_bug.cgi?id=134309
3260         <rdar://problem/17427385>
3261
3262         Reviewed by Darin Adler.
3263
3264         Fixes an issue where the focusable element may not be scrolled into view when it's focused by
3265         using the keyboard accessory (i.e. the < and > buttons). In particular, we don't scroll a
3266         keyboard focused text field into view when it's positioned significantly outside the visible region.
3267
3268         * UIProcess/ios/WKContentViewInteraction.h: Added an instance variable called _didAccessoryTabInitiateFocus
3269         to track whether an accessory tab initiated the focus of the focusable element.
3270         * UIProcess/ios/WKContentViewInteraction.mm:
3271         (-[WKContentView cleanupInteraction]): Clear _didAccessoryTabInitiateFocus so that we're in a good state
3272         should the WebProcess crash between the time the UIProcess receives the accessory tab request and the
3273         WebProcess calls back to the UIProcess to zoom/scroll to the newly focused element.
3274         (-[WKContentView _displayFormNodeInputView]): Modified to pass an empty rectangle for the selection
3275         rectangle to -_zoomToFocusRect to avoid constraining the scroll to the newly focused element when it
3276         was focused using the keyboard accessory tab buttons
3277         (-[WKContentView accessoryTab:]): Modified to set _didAccessoryTabInitiateFocus to YES. We'll set
3278         this boolean to NO in -_displayFormNodeInputView.
3279
3280 2014-06-26  Timothy Horton  <timothy_horton@apple.com>
3281
3282         [iOS][WK2] Implement WKPDFView smart magnification
3283         https://bugs.webkit.org/show_bug.cgi?id=134269
3284         <rdar://problem/17272825>
3285
3286         Reviewed by Dan Bernstein.
3287
3288         * UIProcess/API/Cocoa/WKWebView.mm:
3289         (-[WKWebView _currentContentView]):
3290         (contentZoomScale):
3291         Factor _currentContentView out of contentZoomScale.
3292
3293         (-[WKWebView _zoomToRect:WebCore::atScale:origin:WebCore::]):
3294         (-[WKWebView _scrollToRect:WebCore::origin:WebCore::minimumScrollDistance:]):
3295         (-[WKWebView _contentRectForUserInteraction]):
3296         Use it in a bunch more places so we query the right view when zooming/scrolling for smart magnification.
3297
3298         * UIProcess/ios/WKPDFView.h:
3299         * UIProcess/ios/WKPDFView.mm:
3300         (-[WKPDFView scrollViewDidScroll:]):
3301         (-[WKPDFView _revalidateViews]):
3302         (-[WKPDFView zoom:to:atPoint:kind:]):
3303         (-[WKPDFView resetZoom:]):
3304         Implement zoom:to:atPoint:kind: and resetZoom: UIPDFPageViewDelegate methods.
3305         Convert the rects/points and forward them on to the WKWebView to do the zoom.
3306         resetZoom: doesn't provide the gesture origin, so we zoom out using the view center as our origin.
3307         Avoid parenting new UIPDFPageViews while starting a zoom; they'll end up with a bizarre
3308         animation on them and go flying across the screen (even before _isAnimatingZoom is set).
3309
3310 2014-06-26  Tim Horton  <timothy_horton@apple.com>
3311
3312         [WK2] Pinch-zoom shadows can overlap headers and footers
3313         https://bugs.webkit.org/show_bug.cgi?id=134372
3314         <rdar://problem/16004095>
3315
3316         Reviewed by Simon Fraser.
3317
3318         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3319         (WebKit::shadowLayerPositionForFrame):
3320         (WebKit::shadowLayerBoundsForFrame):
3321         Compute the initial shadow layer and shadow bounds exactly as RenderLayerCompositor does
3322         (in updateRootLayerPosition and friends). Also, clip the shadow layer to the old document rect,
3323         otherwise it can extend over top of the header/footers. The content is automatically clipped to
3324         this rect by the root content layer, but the shadow is outside of that.
3325
3326         (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToLayers):
3327         (WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom):
3328         Pass all of the arguments to constrainScrollPositionForOverhang, not just half of them.
3329         There's still a bug where we constrain incorrectly with header/footer layers, but that
3330         will be addressed elsewhere.
3331
3332         (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToPage):
3333         Make use of the new helpers.
3334
3335 2014-06-26  Tim Horton  <timothy_horton@apple.com>
3336
3337         Don't leak WKBrowsingContextControllers
3338         https://bugs.webkit.org/show_bug.cgi?id=134368
3339         <rdar://problem/17476582>
3340
3341         Reviewed by Sam Weinig.
3342
3343         * UIProcess/API/mac/WKView.mm:
3344         (-[WKView browsingContextController]):
3345         Adoption is important.
3346
3347 2014-06-26  Alexey Proskuryakov  <ap@apple.com>
3348
3349         REGRESSION: Mountain Lion: Gmail's "in new window" view of mail threads is very slow to load its content
3350         https://bugs.webkit.org/show_bug.cgi?id=133882
3351         <rdar://problem/17271965>
3352
3353         Reviewed by Brady Eidson.
3354
3355         * NetworkProcess/mac/NetworkResourceLoadSchedulerMac.mm:
3356         (WebKit::NetworkResourceLoadScheduler::platformInitializeMaximumHTTPConnectionCountPerHost):
3357         Same fix as in WebCore.
3358
3359 2014-06-26  Brady Eidson  <beidson@apple.com>
3360
3361         Remove use of PlatformStrategies for Gamepad API.
3362         https://bugs.webkit.org/show_bug.cgi?id=134348
3363
3364 https://bugs.webkit.org/show_bug.cgi?id=134348
3365         * NetworkProcess/NetworkProcessPlatformStrategies.cpp:
3366         (WebKit::NetworkProcessPlatformStrategies::createGamepadStrategy): Deleted.
3367         * NetworkProcess/NetworkProcessPlatformStrategies.h:
3368
3369         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3370         (WebKit::WebPlatformStrategies::createGamepadStrategy): Deleted.
3371         (WebKit::WebPlatformStrategies::startMonitoringGamepads): Deleted.
3372         (WebKit::WebPlatformStrategies::stopMonitoringGamepads): Deleted.
3373         (WebKit::WebPlatformStrategies::platformGamepads): Deleted.
3374         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
3375
3376 2014-06-26  Dan Bernstein  <mitz@apple.com>
3377
3378         [iOS] Add API for opting into character selection granularity
3379         https://bugs.webkit.org/show_bug.cgi?id=134354
3380
3381         Reviewed by Geoff Garen.
3382
3383         * Shared/API/Cocoa/WKFoundation.h: Added a definition of WK_ENUM_AVAILABLE_IOS.
3384         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
3385         (WKSelectionGranularity): Added this enum with two values, one representing dynamic
3386         granularity( the current, default behavior) and one representing character granularity.
3387         Delcared new selectionGranularity property.
3388         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3389         (-[WKWebViewConfiguration copyWithZone:]): Copy the _selectionGranularity ivar.
3390
3391         * UIProcess/ios/WKContentViewInteraction.mm:
3392         (toUIWebSelectionMode): Added this helper function for mapping WKSelectionGranularity values
3393         to UIWebSelectionMode values.
3394         (-[WKContentView setupInteraction]): Use a selection assistant with the mode specified in
3395         the configuration.
3396         (-[WKContentView _stopAssistingKeyboard]): Ditto.
3397
3398         * WebProcess/WebPage/ios/WebPageIOS.mm:
3399         (WebKit::WebPage::selectWithGesture): Changed the behavior of the loupe gesture type in
3400         non-editable text to select a word, rather than an empty range, matching the UITextView
3401         behavior.
3402
3403 2014-06-26  Ada Chan  <adachan@apple.com>
3404
3405         Change the target membership of WKBackForwardListPrivate.h from WebKit2 to WebKit.
3406
3407         Rubber-stamped by Dan Bernstein.
3408
3409         * WebKit2.xcodeproj/project.pbxproj:
3410
3411 2014-06-26  Benjamin Poulain  <bpoulain@apple.com>
3412
3413         Remove a useless return in WebPageProxyIOS
3414
3415         * UIProcess/ios/WebPageProxyIOS.mm:
3416         (WebKit::WebPageProxy::updateVisibleContentRects):
3417         Darin caught this mistake in r170460.
3418
3419 2014-06-26  Chris Fleizach  <cfleizach@apple.com>
3420
3421         Add an undo group for each dictated utterance in WebKit
3422         https://bugs.webkit.org/show_bug.cgi?id=134086
3423
3424         Applied review comments from Sam Weinig.
3425
3426         Move the associated USE #define into Platform.h.
3427
3428         * UIProcess/PageClient.h:
3429
3430 2014-06-24  Roger Fong  <roger_fong@apple.com>
3431
3432         Don't allow sudden termination while writing to local storage.
3433         https://bugs.webkit.org/show_bug.cgi?id=134254.
3434         <rdar://problem/15093854>.
3435
3436         Reviewed by Darin Adler.
3437