Data interaction should register type identifiers in order of priority
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2017-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>
2
3         Data interaction should register type identifiers in order of priority
4         https://bugs.webkit.org/show_bug.cgi?id=170428
5         <rdar://problem/30633296>
6
7         Reviewed by Tim Horton.
8
9         Serialize PasteboardWebContent.dataInAttributedStringFormat when sending over IPC. Refer to WebCore ChangeLog
10         for more details.
11
12         * Shared/WebCoreArgumentCoders.cpp:
13         (IPC::ArgumentCoder<PasteboardWebContent>::encode):
14         (IPC::ArgumentCoder<PasteboardWebContent>::decode):
15         * UIProcess/API/Cocoa/WKWebView.mm:
16
17 2017-04-03  Joseph Pecoraro  <pecoraro@apple.com>
18
19         Remove no longer needed forward declarations
20         https://bugs.webkit.org/show_bug.cgi?id=170415
21
22         Reviewed by Dan Bernstein.
23
24         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
25
26 2017-04-03  Anders Carlsson  <andersca@apple.com>
27
28         Tweak ApplePaySession API
29         https://bugs.webkit.org/show_bug.cgi?id=170409
30         rdar://problem/31405459
31
32         Reviewed by Tim Horton.
33
34         Update for WebCore changes.
35
36         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
37         (WebKit::toNSError):
38
39 2017-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
40
41         [SOUP] URI Fragment is lost after redirect
42         https://bugs.webkit.org/show_bug.cgi?id=170058
43
44         Reviewed by Michael Catanzaro.
45
46         In case of redirection check if the current request has a fragment identifier and apply it to the redirection
47         only when it doesn't have a fragment identifier yet.
48
49         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
50         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
51         (WebKit::NetworkDataTaskSoup::createRequest):
52         (WebKit::NetworkDataTaskSoup::continueHTTPRedirection):
53         * NetworkProcess/soup/NetworkDataTaskSoup.h:
54
55 2017-04-03  Antti Koivisto  <antti@apple.com>
56
57         Mutex may be freed too late in NetworkCache::Storage::traverse
58         https://bugs.webkit.org/show_bug.cgi?id=170400
59         <rdar://problem/30515865>
60
61         Reviewed by Carlos Garcia Campos and Andreas Kling.
62
63         Fix a race.
64
65         * NetworkProcess/cache/NetworkCacheStorage.cpp:
66         (WebKit::NetworkCache::Storage::traverse):
67
68             Ensure the mutex is not accessed after we dispatch to the main thread.
69             The main thread call deletes the owning TraverseOperation.
70
71 2017-04-01  Dan Bernstein  <mitz@apple.com>
72
73         [iOS] <input type=file> label should be specified using plural rules
74         https://bugs.webkit.org/show_bug.cgi?id=170388
75
76         Reviewed by Alexey Proskuryakov.
77
78         * UIProcess/ios/forms/WKFileUploadPanel.mm:
79         (-[WKFileUploadPanel _processMediaInfoDictionaries:atIndex:processedResults:processedImageCount:processedVideoCount:successBlock:failureBlock:]):
80           Instead of calling -_displayStringForPhotos:videos:, use
81           +[NSString localizedStringWithFormat:] with the new format string "%lu photo(s) and
82           %lu video(s)" for which there are plural rules.
83         (-[WKFileUploadPanel _displayStringForPhotos:videos:]): Deleted.
84
85 2017-04-01  Dan Bernstein  <mitz@apple.com>
86
87         [Xcode] In engineering builds, linker warns about libwebrtc.dylib’s install name being invalid
88         https://bugs.webkit.org/show_bug.cgi?id=170385
89
90         Reviewed by Tim Horton.
91
92         * Configurations/WebKit.xcconfig: When WebKit is relocatable, tell the linker that it’s
93           not going to be in the shared cache, even if its install name implies that it might be.
94
95 2017-03-31  Simon Fraser  <simon.fraser@apple.com>
96
97         Remove a logging statement left in by mistake.
98
99         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
100         (WebKit::WebFrameLoaderClient::restoreViewState):
101
102 2017-03-31  Wenson Hsieh  <wenson_hsieh@apple.com>
103
104         Address post-review feedback after r214692
105         https://bugs.webkit.org/show_bug.cgi?id=170328
106
107         Reviewed by Dan Bernstein.
108
109         Clearing the selection when UIKit calls into WKContentView to set its selected text range to nil is a rule
110         that should be applied when using a text interaction assistant, not just when using character granularity
111         for selecting text.
112
113         * UIProcess/ios/WKContentViewInteraction.mm:
114         (-[WKContentView setSelectedTextRange:]):
115
116 2017-03-31  Wenson Hsieh  <wenson_hsieh@apple.com>
117
118         [WK2] Tapping away to dismiss the selection does not update the selected DOM range using character granularity
119         https://bugs.webkit.org/show_bug.cgi?id=170328
120         <rdar://problem/30904558>
121
122         Reviewed by Tim Horton.
123
124         When UIKit clears the selection while in text interaction mode, it notifies its document view (i.e., the
125         WKContentView) by setting its selected text range to nil. When character granularity selection is enabled, use
126         this as a cue to notify the web process that the selection is being cleared out.
127
128         -setSelectedTextRange: is a noop in the general case because the web process acts as the source of truth for what
129         the selection currently consists of, and notifies the UI process and UIKit via WKTextPosition and WKTextRange.
130         However, in the case of character granularity selections, tapping away to clear the selection is handled by
131         UIKit's text gesture recognizer cluster, which then informs the document (via -setSelectedTextRange:) that the
132         selection should be cleared out.
133
134         Adds a new Layout test: editing/selection/character-granularity-selected-range-after-dismissing-selection.html.
135
136         * UIProcess/ios/WKContentViewInteraction.mm:
137         (-[WKContentView setSelectedTextRange:]):
138
139 2017-03-31  Wenson Hsieh  <wenson_hsieh@apple.com>
140
141         [WK2] Tapping editable text inside of a range selection no longer changes the selection to a caret
142         https://bugs.webkit.org/show_bug.cgi?id=170327
143         <rdar://problem/31363816>
144
145         Reviewed by Tim Horton.
146
147         Currently, we're forcing all text interaction gestures to duck in lieu of data interaction gestures
148         when we should only be doing so for gestures that begin a loupe. This prevents other gestures, such as
149         single taps, from changing the selection when they should be allowed to.
150
151         Hooks into new UIKit SPI to make this tweak.
152         Introduces a new LayoutTest: editing/selection/caret-after-tap-in-editable-selection.html.
153
154         * UIProcess/ios/WKContentViewInteraction.mm:
155         (-[WKContentView pointIsInAssistedNode:]):
156         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
157
158 2017-03-31  Tim Horton  <timothy_horton@apple.com>
159
160         Mail can get stuck underneath FindController::findStringMatches after searching in a long message
161         https://bugs.webkit.org/show_bug.cgi?id=170326
162         <rdar://problem/30330395>
163
164         Reviewed by Simon Fraser.
165
166         * UIProcess/mac/WKTextFinderClient.mm:
167         (-[WKTextFinderClient findMatchesForString:relativeToMatch:findOptions:maxResults:resultCollector:]):
168         Cap the number of find matches at 1000, the same maximum that Safari uses.
169
170 2017-03-31  Brady Eidson  <beidson@apple.com>
171
172         Clean up the "StorageType" enum.
173         https://bugs.webkit.org/show_bug.cgi?id=170349
174
175         Reviewed by Tim Horton.
176
177         * WebProcess/Storage/StorageAreaMap.cpp:
178         (WebKit::StorageAreaMap::StorageAreaMap):
179         (WebKit::StorageAreaMap::dispatchStorageEvent):
180         (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
181         (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
182         
183         * WebProcess/Storage/StorageNamespaceImpl.cpp:
184         (WebKit::StorageNamespaceImpl::createSessionStorageNamespace):
185         (WebKit::StorageNamespaceImpl::createLocalStorageNamespace):
186         (WebKit::StorageNamespaceImpl::createTransientLocalStorageNamespace):
187
188 2017-03-31  Tim Horton  <timothy_horton@apple.com>
189
190         Remove bundle checks for attachmentElementEnabled
191         https://bugs.webkit.org/show_bug.cgi?id=170329
192         <rdar://problem/25135244>
193
194         Reviewed by Simon Fraser.
195
196         * UIProcess/API/Cocoa/WKWebView.mm:
197         (-[WKWebView _initializeWithConfiguration:]):
198         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
199         (-[WKWebViewConfiguration init]):
200         Remove bundle checks.
201
202 2017-03-29  Anders Carlsson  <andersca@apple.com>
203
204         Adopt PKCanMakePaymentsWithMerchantIdentifierAndDomainAndSourceApplication
205         https://bugs.webkit.org/show_bug.cgi?id=170257
206         rdar://problem/31289764
207
208         Reviewed by Beth Dakin.
209
210         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
211         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
212
213 2017-03-31  Csaba Osztrogonác  <ossy@webkit.org>
214
215         Mac cmake buildfix after r214403
216         https://bugs.webkit.org/show_bug.cgi?id=170346
217
218         Unreviewed speculative buildfix.
219
220         * UIProcess/API/Cocoa/WKWebView.mm:
221
222 2017-03-31  Brady Eidson  <beidson@apple.com>
223
224         Remove erroneously committed changes from r214078
225
226         Unreviewed.
227
228         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
229         (WebKit::WebProcessPool::platformInitializeNetworkProcess): Whoops!
230
231 2017-03-31  Carlos Garcia Campos  <cgarcia@igalia.com>
232
233         Modern media controls should never be enabled in non cocoa ports
234         https://bugs.webkit.org/show_bug.cgi?id=170338
235
236         Reviewed by Michael Catanzaro.
237
238         It's currently enabled, because it uses the default value for all other runtime features, but modern media
239         controls are not a cross-platform feature. I think this is why media/video-click-dblckick-standalone.html
240         started to fail in GTK+ port after r214426. I can't reprouduce the failure locally, so I can't confirm it,
241         though.
242
243         * Shared/WebPreferencesDefinitions.h:
244
245 2017-03-30  Zan Dobersek  <zdobersek@igalia.com>
246
247         Unreviewed GTK+ build fix. List WebCore before JavaScriptCore as the
248         two WebKit2 dependency libraries to avoid WTF directiories being
249         listed for inclusion before WebCore directories at compile-time.
250
251         * CMakeLists.txt:
252
253 2017-03-30  Megan Gardner  <megan_gardner@apple.com>
254
255         Allow for extended color in snapshots
256         https://bugs.webkit.org/show_bug.cgi?id=170314
257         <rdar://problem/28676092> WKImageCreateCGImage should support WideGamut in WebKit2 on macOS
258
259         Reviewed by Simon Fraser.
260
261         Piping options through snapshots to allow for wide gamut support.
262
263         * Shared/API/c/WKImage.h:
264         * Shared/API/c/WKSharedAPICast.h:
265         (WebKit::snapshotOptionsFromImageOptions):
266         * Shared/ImageOptions.h:
267         (WebKit::snapshotOptionsToImageOptions):
268         * Shared/WebImage.cpp:
269         (WebKit::WebImage::create):
270
271 2017-03-30  Sam Weinig  <sam@webkit.org>
272
273         Expose the WKView SPI, _prepareForMoveToWindow:withCompletionHandler as WKWebView SPI
274         <rdar://problem/31350588>
275         https://bugs.webkit.org/show_bug.cgi?id=170315
276
277         Reviewed by Simon Fraser.
278
279         * UIProcess/API/Cocoa/WKWebView.mm:
280         (-[WKWebView _prepareForMoveToWindow:completionHandler:]):
281         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
282         Copy SPI to WKWebView. Remove 'with' prefix to match conventions.
283
284 2017-03-30  Wenson Hsieh  <wenson_hsieh@apple.com>
285
286         [WK2] Touches should not cancel when showing a custom action sheet while data interaction is active
287         https://bugs.webkit.org/show_bug.cgi?id=170291
288         <rdar://problem/31301388>
289
290         Reviewed by Tim Horton.
291
292         Currently, when presenting a custom popover, we will cancel all touches in the application. This makes data
293         interaction when a custom popover is shown impossible -- to address this, we should only cancel touches when
294         the view is not an active data interaction source.
295
296         New API test: DataInteractionTests.CustomActionSheetPopover.
297
298         * UIProcess/ios/WKContentViewInteraction.mm:
299         (-[WKContentView actionSheetAssistant:showCustomSheetForElement:]):
300
301 2017-03-30  Youenn Fablet  <youenn@apple.com>
302
303         NetworkConnectionToWebProcess should stop web sockets when being destroyed
304         https://bugs.webkit.org/show_bug.cgi?id=170286
305
306         Reviewed by Brady Eidson.
307
308         * NetworkProcess/NetworkSocketStream.cpp:
309         (WebKit::NetworkSocketStream::~NetworkSocketStream): Stopping the socket handle if not done already.
310         * NetworkProcess/NetworkSocketStream.h:
311
312 2017-03-29  Tim Horton  <timothy_horton@apple.com>
313
314         Remove unused PageClient::removeNavigationGestureSnapshot
315         https://bugs.webkit.org/show_bug.cgi?id=170249
316
317         Reviewed by Beth Dakin.
318
319         * UIProcess/PageClient.h:
320         * UIProcess/WebPageProxy.cpp:
321         (WebKit::WebPageProxy::removeNavigationGestureSnapshot): Deleted.
322         * UIProcess/WebPageProxy.h:
323         * UIProcess/mac/PageClientImpl.h:
324         * UIProcess/mac/PageClientImpl.mm:
325         (WebKit::PageClientImpl::removeNavigationGestureSnapshot): Deleted.
326
327 2017-03-29  Antti Koivisto  <antti@apple.com>
328
329         Increment the last stable network cache version on Mac
330         https://bugs.webkit.org/show_bug.cgi?id=170248
331         <rdar://problem/31326040>
332
333         Reviewed by Chris Dumez.
334
335         Bump to the latest release.
336
337         * NetworkProcess/cache/NetworkCacheStorage.h:
338
339 2017-03-28  Timothy Horton  <timothy_horton@apple.com>
340
341         Stop overriding scroll view inset defaults
342         https://bugs.webkit.org/show_bug.cgi?id=170221
343         <rdar://problem/31260325>
344
345         Reviewed by Simon Fraser.
346
347         * Platform/spi/ios/UIKitSPI.h:
348         * UIProcess/API/Cocoa/WKWebView.mm:
349         (-[WKWebView _initializeWithConfiguration:]):
350         The default behavior is sufficient for us.
351
352 2017-03-28  Timothy Horton  <timothy_horton@apple.com>
353
354         Safari crashes when attempting to close tab that is displaying PDF
355         https://bugs.webkit.org/show_bug.cgi?id=170201
356         <rdar://problem/31242019>
357
358         Reviewed by Wenson Hsieh.
359
360         * UIProcess/API/Cocoa/WKWebView.mm:
361         (-[WKWebView _doAfterNextStablePresentationUpdate:]):
362         Adopt BlockPtr to fix a leak.
363
364         (-[WKWebView _firePresentationUpdateForPendingStableStatePresentationCallbacks]):
365         dispatch_async in the doAfterNextPresentationUpdate callback; since this
366         recursively calls itself, in cases where doAfterNextPresentationUpdate
367         returns synchronously (e.g. if the Web Process is missing), we would
368         recurse infinitely.
369
370 2017-03-27  Youenn Fablet  <youenn@apple.com>
371
372         Remove WebPage::m_shouldDoICECandidateFiltering
373         https://bugs.webkit.org/show_bug.cgi?id=170150
374
375         Reviewed by Sam Weinig.
376
377         It is redundant with RTCController::m_shouldFilterICECandidates.
378         Manually tested on webrtc test samples.
379         This code path is currently untested by rwt as we hook it to getUserMedia which is mocked in rwt.
380         Additional testing will be added as a follow-up patch.
381
382         * WebProcess/WebPage/WebPage.cpp:
383         (WebKit::WebPage::disableICECandidateFiltering):
384         (WebKit::WebPage::enableICECandidateFiltering):
385         * WebProcess/WebPage/WebPage.h:
386
387 2017-03-27  Wenson Hsieh  <wenson_hsieh@apple.com>
388
389         [WK2] UIKit assertion when rotating device after dismissing popover
390         https://bugs.webkit.org/show_bug.cgi?id=170159
391         <rdar://problem/31283829>
392
393         Reviewed by Tim Horton.
394
395         Ensure that when we are finished presenting a WKActionSheet, we unregister with the shared notifications center.
396
397         * UIProcess/ios/WKActionSheet.mm:
398         (-[WKActionSheet dealloc]):
399         (-[WKActionSheet _cleanup]):
400         (-[WKActionSheet doneWithSheet:]):
401
402 2017-03-27  Andy Estes  <aestes@apple.com>
403
404         [iOS] Suppress page count recalc when setting a snapshot paper rect
405         https://bugs.webkit.org/show_bug.cgi?id=170156
406         <rdar://problem/30787872>
407
408         Reviewed by Tim Horton.
409
410         When _WKWebViewPrintFormatter computes a page count for snapshotting, it updates the paper
411         rect, which triggers UIKit to ask for the page count again while we're in the middle of
412         printing, putting us in a bad state.
413
414         Suppress page count recalc while setting the new paper rect, since we know this will not
415         cause it to change.
416
417         * UIProcess/_WKWebViewPrintFormatter.mm:
418         (-[_WKWebViewPrintFormatter _setSnapshotPaperRect:]): Temporarily set
419         _suppressPageCountRecalc to YES before updating the paper rect.
420         (-[_WKWebViewPrintFormatter _setNeedsRecalc]): Only call [super _setNeedsRecalc] if
421         _suppressPageCountRecalc is NO.
422         * UIProcess/_WKWebViewPrintFormatterInternal.h: Declared -_setNeedsRecalc.
423
424 2017-03-26  Wenson Hsieh  <wenson_hsieh@apple.com>
425
426         [WK2] Callout Bar should be dismissed during data interaction
427         https://bugs.webkit.org/show_bug.cgi?id=170109
428         <rdar://problem/31171570>
429
430         Reviewed by Tim Horton.
431
432         Minor tweak to get the callout bar to duck during data interaction. Import a new UIKit SPI header in WebKit2.
433
434         * Platform/spi/ios/UIKitSPI.h:
435
436 2017-03-27  Keith Rollin  <krollin@apple.com>
437
438         Update NetworkResourceLoader logging statement
439         https://bugs.webkit.org/show_bug.cgi?id=170126
440
441         Reviewed by Alex Christensen.
442
443         NetworkResourceLoader contains a logging statement that prints, in
444         part: "start: Retrieving resource from cache". This is misleading,
445         since it's not necessarily the case that the resource will be loaded
446         from the cache. What is actually happening at the point where that is
447         logged is that the cache is being checked for the resource. It still
448         remains to be seen if the resource will be found in it. To address
449         this, change the logging to say "start: Checking cache for resource".
450
451         * NetworkProcess/NetworkResourceLoader.cpp:
452         (WebKit::NetworkResourceLoader::start):
453
454 2017-03-27  Joseph Pecoraro  <pecoraro@apple.com>
455
456         Web Inspector: Saving files should not suggest the top level directory
457         https://bugs.webkit.org/show_bug.cgi?id=170085
458         <rdar://problem/30197794>
459
460         Reviewed by Matt Baker.
461
462         * UIProcess/mac/RemoteWebInspectorProxyMac.mm:
463         (WebKit::RemoteWebInspectorProxy::platformSave):
464         * UIProcess/mac/WebInspectorProxyMac.mm:
465         (WebKit::WebInspectorProxy::platformSave):
466         Don't set panel.directoryURL unless we have a good suggestion.
467
468 2017-03-27  Yongjun Zhang  <yongjun_zhang@apple.com>
469
470         Add delegate method to let an WebKit client provide a custom image preview controller.
471         https://bugs.webkit.org/show_bug.cgi?id=170076
472         rdar://problem/31153051
473
474         Add a new delegate method (_webView:previewViewControllerForImage:alternateURL:defaultActions:elementInfo:) to
475         WKUIDelegatePrivate, an client can use this method to provide a custom image preview view controller if the image
476         has alternated URL or custom image info.
477
478         Reviewed by Beth Dakin.
479
480         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Add delegate method _webView:previewViewControllerForImage:alternateURL:defaultActions:elementInfo:.
481         * UIProcess/ios/WKContentViewInteraction.mm:
482         (-[WKContentView _presentedViewControllerForPreviewItemController:]): If the image has alternated URL or custom info, try to use the client-provided
483             preview view controller. Otherwise, use the default WKImagePreviewViewController.
484
485 2017-03-27  Anders Carlsson  <andersca@apple.com>
486
487         Fix uses of deprecated API
488         https://bugs.webkit.org/show_bug.cgi?id=170138
489         rdar://problem/28882449
490
491         Reviewed by Tim Horton.
492
493         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
494         (WebKit::toPKContactFields):
495         (WebKit::toPKAddressField):
496         (WebKit::toPKPaymentRequest):
497         Don't use deprecated APIs.
498
499         (WebKit::toNSError):
500         Don't try to insert nil in a dictionary.
501
502 2017-03-27  Alex Christensen  <achristensen@webkit.org>
503
504         Make WebSockets work in network process
505         https://bugs.webkit.org/show_bug.cgi?id=169930
506
507         Reviewed by Youenn Fablet.
508
509         This adds WebSocketStream, which is a SocketStreamHandle that sends asynchronous 
510         messages to a NetworkSocketStream in the NetworkProcess.  WebKit1 uses a SocketStreamHandleImpl
511         still, but WebKit2 now has a SocketStreamHandleImpl in the NetworkProcess owned by the 
512         NetworkSocketStream, which is a SocketStreamHandleClient that sends asynchronous messages back
513         to the WebProcess.  WebSocketStream's implementation of SocketStreamHandle::platformSend is special
514         because it stores the completion handler in a map and asynchronously reports to the caller whether
515         it succeeded or not.  If the network processes crashes before the completion handlers are called,
516         then they are called indicating failure and an error is reported, but that never happens, right?
517
518         * CMakeLists.txt:
519         * DerivedSources.make:
520         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
521         (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
522         (WebKit::NetworkConnectionToWebProcess::createSocketStream):
523         (WebKit::NetworkConnectionToWebProcess::destroySocketStream):
524         * NetworkProcess/NetworkConnectionToWebProcess.h:
525         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
526         * NetworkProcess/NetworkProcess.cpp:
527         (WebKit::NetworkProcess::setAllowsAnySSLCertificateForWebSocket):
528         * NetworkProcess/NetworkProcess.h:
529         * NetworkProcess/NetworkProcess.messages.in:
530         * NetworkProcess/NetworkSocketStream.cpp: Added.
531         (WebKit::NetworkSocketStream::create):
532         (WebKit::NetworkSocketStream::NetworkSocketStream):
533         (WebKit::NetworkSocketStream::sendData):
534         (WebKit::NetworkSocketStream::close):
535         (WebKit::NetworkSocketStream::didOpenSocketStream):
536         (WebKit::NetworkSocketStream::didCloseSocketStream):
537         (WebKit::NetworkSocketStream::didReceiveSocketStreamData):
538         (WebKit::NetworkSocketStream::didFailToReceiveSocketStreamData):
539         (WebKit::NetworkSocketStream::didUpdateBufferedAmount):
540         (WebKit::NetworkSocketStream::didFailSocketStream):
541         (WebKit::NetworkSocketStream::messageSenderConnection):
542         (WebKit::NetworkSocketStream::messageSenderDestinationID):
543         * NetworkProcess/NetworkSocketStream.h: Added.
544         * NetworkProcess/NetworkSocketStream.messages.in: Added.
545         * UIProcess/API/C/WKContext.cpp:
546         (WKContextSetAllowsAnySSLCertificateForWebSocketTesting):
547         (WKContextTerminateNetworkProcess):
548         * UIProcess/API/C/WKContextPrivate.h:
549         * UIProcess/WebProcessPool.cpp:
550         (WebKit::WebProcessPool::sendSyncToNetworkingProcess):
551         (WebKit::WebProcessPool::setAllowsAnySSLCertificateForWebSocket):
552         (WebKit::WebProcessPool::terminateNetworkProcess):
553         * UIProcess/WebProcessPool.h:
554         * WebKit2.xcodeproj/project.pbxproj:
555         * WebProcess/Network/NetworkProcessConnection.cpp:
556         (WebKit::NetworkProcessConnection::didReceiveMessage):
557         * WebProcess/Network/WebSocketProvider.cpp:
558         (WebKit::WebSocketProvider::createSocketStreamHandle):
559         * WebProcess/Network/WebSocketStream.cpp: Added.
560         (WebKit::globalWebSocketStreamMap):
561         (WebKit::WebSocketStream::streamWithIdentifier):
562         (WebKit::WebSocketStream::networkProcessCrashed):
563         (WebKit::WebSocketStream::create):
564         (WebKit::WebSocketStream::WebSocketStream):
565         (WebKit::WebSocketStream::~WebSocketStream):
566         (WebKit::WebSocketStream::messageSenderConnection):
567         (WebKit::WebSocketStream::messageSenderDestinationID):
568         (WebKit::WebSocketStream::platformSend):
569         (WebKit::WebSocketStream::didSendData):
570         (WebKit::WebSocketStream::platformClose):
571         (WebKit::WebSocketStream::bufferedAmount):
572         (WebKit::WebSocketStream::didOpenSocketStream):
573         (WebKit::WebSocketStream::didCloseSocketStream):
574         (WebKit::WebSocketStream::didReceiveSocketStreamData):
575         (WebKit::WebSocketStream::didFailToReceiveSocketStreamData):
576         (WebKit::WebSocketStream::didUpdateBufferedAmount):
577         (WebKit::WebSocketStream::didFailSocketStream):
578         * WebProcess/Network/WebSocketStream.h: Added.
579         * WebProcess/Network/WebSocketStream.messages.in: Added.
580         * WebProcess/WebProcess.cpp:
581         (WebKit::WebProcess::networkProcessConnectionClosed):
582
583 2017-03-27  Adrian Perez de Castro  <aperez@igalia.com>
584
585         [GTK] NetscapePluginX11::m_windowID is unused/unneeded
586         https://bugs.webkit.org/show_bug.cgi?id=170115
587
588         Reviewed by Michael Catanzaro.
589
590         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
591         (WebKit::NetscapePluginX11::NetscapePluginX11):
592         Remove the unneeded NetscapePluginX11::m_windowID member.
593         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.h:
594         Remove the unneeded NetscapePluginX11::m_windowID member.
595
596 2017-03-25  Andy Estes  <aestes@apple.com>
597
598         [iOS] Use snapshotting instead of printing to draw single-page PDFs
599         https://bugs.webkit.org/show_bug.cgi?id=170103
600         <rdar://problem/30542960>
601
602         Reviewed by Tim Horton.
603
604         * WebProcess/WebPage/WebPage.cpp:
605         (WebKit::paintSnapshotAtSize): Moved the painting logic from WebPage::snapshotAtSize() to here.
606         (WebKit::WebPage::snapshotAtSize): Changed to call paintSnapshotAtSize() with the
607         WebImage's graphics context.
608         (WebKit::WebPage::pdfSnapshotAtSize): Created a CGPDFGraphicsContext, passed it to
609         paintSnapshotAtSize(), and returned the context's data.
610         * WebProcess/WebPage/WebPage.h: Made snapshotAtSize() and snapshotNode() private, changed
611         their return values from PassRefPtr to RefPtr, and declared pdfSnapshotAtSize().
612         * WebProcess/WebPage/ios/WebPageIOS.mm:
613         (WebKit::WebPage::computePagesForPrintingAndDrawToPDF): If snapshotting the first page,
614         returned a page count of 1 and created a PDF using pdfSnapshotAtSize().
615
616 2017-03-25  John Wilander  <wilander@apple.com>
617
618         Re-enable the web process' keychain access to fix client certificate authentication
619         https://bugs.webkit.org/show_bug.cgi?id=170074
620         <rdar://problem/31095987>
621
622         Reviewed by Brent Fulgham.
623
624         This is a follow-up patch to
625         https://trac.webkit.org/changeset/214389/webkit
626         since according to Alexey Proskuryakov, resource
627         loading has always required identical sandbox
628         rules in WebContent and Networking processes.
629
630         * WebProcess/com.apple.WebProcess.sb.in:
631             Reverted remaining change from
632             https://trac.webkit.org/changeset/208702/webkit and
633             https://trac.webkit.org/changeset/208707/webkit.
634
635 2017-03-24  Wenson Hsieh  <wenson_hsieh@apple.com>
636
637         [WK2] Add a UI delegate SPI hook to enable or disable navigation on drop
638         https://bugs.webkit.org/show_bug.cgi?id=169168
639         <rdar://problem/30688374>
640
641         Reviewed by Tim Horton.
642
643         Support customizing the set of allowed actions on drop in WebKit2 by introducing a new method to WKUIDelegatePrivate
644         that returns a WKDragDestinationAction given platform dragging info. These flags are then used to initialize the
645         DragData sent over to the web process, where they update DragController's view of the allowed destination actions.
646
647         Moving forward, the default action mask for WKWebViews will include everything except WKDragDestinationActionLoad,
648         though for applciations linked on or before 10.12, we will still default to WKDragDestinationActionAny to mitigate
649         any compatibility risk.
650
651         * Shared/API/Cocoa/WKDragDestinationAction.h:
652
653         Introduce WK2 client-facing versions of WebCore::DragDestinationAction flags.
654
655         * Shared/WebCoreArgumentCoders.cpp:
656         (IPC::ArgumentCoder<DragData>::encode):
657         (IPC::ArgumentCoder<DragData>::decode):
658
659         Serialize DragData's destination actions when sending DragData over IPC.
660
661         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
662         * UIProcess/API/Cocoa/WKWebView.mm:
663         (-[WKWebView _web_dragDestinationActionForDraggingInfo:]):
664
665         For WKWebView, allow all drag destination actions except for loading (i.e. drop-to-navigate).
666
667         * UIProcess/API/mac/WKView.mm:
668         (-[WKView _web_dragDestinationActionForDraggingInfo:]):
669
670         For WKView, allow all types of drag destination actions.
671
672         * UIProcess/Cocoa/VersionChecks.h:
673         * UIProcess/Cocoa/WebViewImpl.h:
674         * UIProcess/Cocoa/WebViewImpl.mm:
675         (WebKit::WebViewImpl::draggingEntered):
676         (WebKit::WebViewImpl::draggingUpdated):
677         * WebKit2.xcodeproj/project.pbxproj:
678         * WebProcess/WebCoreSupport/WebDragClient.cpp:
679         (WebKit::WebDragClient::actionMaskForDrag):
680         * WebProcess/WebCoreSupport/WebDragClient.h:
681
682 2017-03-24  Simon Fraser  <simon.fraser@apple.com>
683
684         [iOS WK2] Move from a pre-commit handler to dispatch_async for visible content rect updates
685         https://bugs.webkit.org/show_bug.cgi?id=170091
686         rdar://problem/30682584
687
688         Reviewed by Tim Horton.
689         
690         [CATransaction addCommitHandler:forPhase:] is sometimes not called when running inside another
691         commit callback (rdar://problem/31253952), and we don't yet have a reliable way to detect this.
692
693         So dispatch_async() to postpone the call to [CATransaction addCommitHandler:forPhase:] to a known-
694         good time.
695
696         * UIProcess/API/Cocoa/WKWebView.mm:
697         (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]):
698
699 2017-03-24  John Wilander  <wilander@apple.com>
700
701         Re-enable the network process' keychain access to fix client certificate authentication
702         https://bugs.webkit.org/show_bug.cgi?id=170074
703         <rdar://problem/31095987>
704
705         Reviewed by Brent Fulgham.
706
707         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
708             Reverted remaining change from
709             https://trac.webkit.org/changeset/208702/webkit and
710             https://trac.webkit.org/changeset/208707/webkit.
711
712 2017-03-24  Eric Carlson  <eric.carlson@apple.com>
713
714         [MediaStream] "ideal" constraints passed to getUserMedia should affect fitness score
715         https://bugs.webkit.org/show_bug.cgi?id=170056
716
717         Reviewed by Youenn Fablet.
718
719         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
720         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): When
721         short-circuiting the user prompt because the page is already authorized, return the first
722         audio and/or video device because so the page gets the one with the best fitness distance.
723
724 2017-03-24  Simon Fraser  <simon.fraser@apple.com>
725
726         Make UI-side compositing on macOS a bit more usable
727         https://bugs.webkit.org/show_bug.cgi?id=170073
728
729         Reviewed by Tim Horton.
730         
731         Mach port as layer contents doesn't work on macOS, so don't use it there.
732
733         Also remove two assertions that hit with UI-side compositing in MiniBrowser.
734
735         * UIProcess/DrawingAreaProxy.cpp:
736         (WebKit::DrawingAreaProxy::createFence):
737         * UIProcess/mac/PageClientImpl.mm:
738         (WebKit::PageClientImpl::requestScroll):
739         * UIProcess/mac/RemoteLayerTreeHost.mm:
740         (WebKit::RemoteLayerTreeHost::updateLayerTree):
741
742 2017-03-24  Alex Christensen  <achristensen@webkit.org>
743
744         Fix assertions after r214358.
745         https://bugs.webkit.org/show_bug.cgi?id=169167
746
747         * UIProcess/API/APIContentExtensionStore.cpp:
748         (API::ContentExtensionStore::compileContentExtension):
749         AtomicString::init must be called for the first time from the main thread.
750         We were calling it for the first time from a non-main thread sometimes.
751         Call it from the main thread before initiating compiling on another thread.
752
753 == Rolled over to ChangeLog-2017-03-23 ==