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