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