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