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