618ce99666cbeb4a4ce260f9881b0d7e48e45034
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2019-01-14  Carlos Garcia Campos  <cgarcia@igalia.com>
2
3         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.23.3 release
4
5         * gtk/NEWS: Add release notes for 2.23.3.
6
7 2019-01-13  Dan Bernstein  <mitz@apple.com>
8
9         Fixed iOS builds after r239910.
10
11         * Platform/spi/ios/PDFKitSPI.h:
12
13 2019-01-13  Dan Bernstein  <mitz@apple.com>
14
15         Tried to fix the build.
16
17         * Platform/spi/ios/PDFKitSPI.h:
18
19 2019-01-13  Dan Bernstein  <mitz@apple.com>
20
21         Tried to fix USE(APPLE_INTERNAL_SDK) builds after r239901.
22
23         Patch by Keith Rollin.
24
25         * Platform/IPC/mac/ConnectionMac.mm:
26         * Shared/mac/ChildProcessMac.mm:
27         (WebKit::ChildProcess::launchServicesCheckIn):
28
29 2019-01-12  Timothy Hatcher  <timothy@apple.com>
30
31         Have prefers-color-scheme: light always match on macOS versions before Mojave.
32         https://bugs.webkit.org/show_bug.cgi?id=191655
33         rdar://problem/46074680
34
35         Reviewed by Megan Gardner.
36
37         * Configurations/FeatureDefines.xcconfig: ENABLE_DARK_MODE_CSS_macosx for all OS versions.
38         * UIProcess/Cocoa/WebViewImpl.mm:
39         (WebKit::WebViewImpl::effectiveAppearanceIsDark):
40         * UIProcess/RemoteLayerTree/mac/ScrollerMac.mm:
41
42 2019-01-12  Dan Bernstein  <mitz@apple.com>
43
44         [Cocoa] Avoid importing directly from subumbrella frameworks
45         https://bugs.webkit.org/show_bug.cgi?id=186016
46         <rdar://problem/40591038>
47
48         Reviewed by Sam Weinig.
49
50         * Configurations/BaseTarget.xcconfig: Removed -iframework options from OTHER_CFLAGS and
51           OTHER_CPLUSPLUSFLAGS.
52         * UIProcess/Automation/mac/WebAutomationSessionMac.mm: Import Carbon.h instead of an
53           HIToolbox header.
54         * UIProcess/Cocoa/WebViewImpl.mm: Ditto.
55         * UIProcess/mac/WKPrintingView.mm: Import Quartz.h instead of a PDFKit header.
56         * UIProcess/mac/WKTextInputWindowController.mm: Import Carbon.h instead of an HIToolbox
57           header.
58         * WebProcess/Plugins/PDF/PDFAnnotationTextWidgetDetails.h: Import Quartz.h instead of a
59           PDFKit header.
60         * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h: Ditto.
61         * WebProcess/Plugins/PDF/PDFPlugin.mm: Ditto.
62         * WebProcess/Plugins/PDF/PDFPluginAnnotation.mm: Ditto.
63         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm: Ditto.
64         * WebProcess/Plugins/PDF/PDFPluginPasswordField.mm: Ditto.
65         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm: Ditto.
66         * WebProcess/WebPage/mac/WebPageMac.mm: Ditto.
67
68 2019-01-11  Ryosuke Niwa  <rniwa@webkit.org>
69
70         Enable visual viewport API by default
71         https://bugs.webkit.org/show_bug.cgi?id=193376
72
73         Reviewed by Simon Fraser.
74
75         Enable this feature by default since the remaining issue on iOS is mostly about test failures,
76         not an issue with the core functionality of the API.
77
78         * Shared/WebPreferences.yaml:
79
80 2019-01-11  Brent Fulgham  <bfulgham@apple.com>
81
82         Allow WebContent process access to some drawing-related IOKit properties
83         https://bugs.webkit.org/show_bug.cgi?id=193086
84         <rdar://problem/46568088>
85
86         Reviewed by Eric Carlson.
87
88         Add one missing IOKit property, and revise the regexp used for another.
89
90         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
91
92 2019-01-11  John Wilander  <wilander@apple.com>
93
94         Compile out Web API Statistics Collection
95         https://bugs.webkit.org/show_bug.cgi?id=193370
96         <rdar://problem/45388584>
97
98         Reviewed by Brent Fulgham.
99
100         * Configurations/FeatureDefines.xcconfig:
101             Defined ENABLE_WEB_API_STATISTICS, off by default.
102         * Shared/WebCoreArgumentCoders.cpp:
103         (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
104             Skipped encoding of web API statistics.
105         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
106             Skipped decoding of web API statistics.
107
108 2019-01-11  Sihui Liu  <sihui_liu@apple.com>
109
110         IndexedDB: leak WebIDBConnectionToClient for retain cycle
111         https://bugs.webkit.org/show_bug.cgi?id=193097
112         <rdar://problem/46899601>
113
114         Reviewed by Brady Eidson.
115
116         Let WebIDBConnectionToClient hold reference to IPC::Connection instead of NetworkConnectionToWebProcess to break
117         the cycle.
118
119         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
120         (WebKit::WebIDBConnectionToClient::create):
121         (WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient):
122         (WebKit::WebIDBConnectionToClient::messageSenderConnection):
123         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
124         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
125         (WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer):
126
127 2019-01-11  Sihui Liu  <sihui_liu@apple.com>
128
129         Make "Disable Web SQL" on by default
130         https://bugs.webkit.org/show_bug.cgi?id=193354
131         <rdar://problem/46524584>
132
133         Reviewed by Geoffrey Garen.
134
135         * Shared/WebPreferences.yaml:
136
137 2019-01-11  Devin Rousso  <drousso@apple.com>
138
139         Fix style CFNetworkSPI style checker warnings from r239698
140         https://bugs.webkit.org/show_bug.cgi?id=193369
141
142         Reviewed by Joseph Pecoraro.
143
144         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
145         (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
146
147 2019-01-11  Wenson Hsieh  <wenson_hsieh@apple.com>
148
149         [iOS] Precision drop state thrashes when dragging near the top edge of an editable element
150         https://bugs.webkit.org/show_bug.cgi?id=193364
151         <rdar://problem/47214117>
152
153         Reviewed by Tim Horton.
154
155         On iOS, marking a UIDropProposal as precise offsets the hit-testing location of the drop by a small distance
156         either upwards or downwards from the actual location of the user's finger. When dragging over an editable
157         element, WebKit currently marks the drop proposal as precise; however, when dragging over the top edge of an
158         editable element, what happens is that the hit-testing location is offset to a location outside of the editable
159         element, which causes us to turn off precision drop mode; subsequently, turning off precision drop mode removes
160         the offset, which causes us to hit-test within the editable element once again and re-enable precision mode, and
161         the cycle continues.
162
163         In order to mitigate this, bail out of precision drop mode when dragging near the top or bottom edges of the
164         highest editable root that contains the current drop caret position (or, if the drop caret is inside of a text
165         form control, use the form control as the editable element instead).
166
167         * UIProcess/WebPageProxy.cpp:
168         (WebKit::WebPageProxy::didPerformDragControllerAction):
169         * UIProcess/WebPageProxy.h:
170         (WebKit::WebPageProxy::currentDragCaretEditableElementRect const):
171         * UIProcess/WebPageProxy.messages.in:
172         * UIProcess/ios/WKContentViewInteraction.mm:
173         (-[WKContentView dropInteraction:sessionDidUpdate:]):
174
175         Avoid precise mode when we're less than 25pt away from the top and bottom edge of the editable element rect.
176         Since the drag location offset amount is a fixed offset in window coordinates, we first convert this minimum
177         distance to the content view's coordinate space by dividing by the content scale factor.
178
179         * WebProcess/WebPage/WebPage.cpp:
180         (WebKit::WebPage::performDragControllerAction):
181
182 2019-01-11  Tim Horton  <timothy_horton@apple.com>
183
184         REGRESSION (PSON): Firefox app lacks Open in New Tab in menu
185         https://bugs.webkit.org/show_bug.cgi?id=193366
186         <rdar://problem/46097212>
187
188         Reviewed by Simon Fraser.
189
190         A pair of unrelated changes broke Firefox's use of WKWebView internals
191         to override the long-press menu. Maintain binary compatibility by
192         introducing linked-on-or-after checks.
193
194         * UIProcess/Cocoa/VersionChecks.h:
195         * UIProcess/WebProcessPool.cpp:
196         (WebKit::WebProcessPool::createWebPage):
197         Disable PSON in Firefox when linked against an SDK where PSON wasn't enabled by default.
198         Because gestures are very stateful, we always swap them out when swapping
199         processes (changing that behavior is fairly risky). Also, we don't always
200         inform the client when we swap processes (only when the process actually crashes),
201         so they currently don't re-adjust the gesture recognizers when a PSON swap occurs.
202
203         * UIProcess/ios/WKContentView.mm:
204         (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
205         Synchronously install gesture recognizers under -init when linked against
206         an SDK before the version that introduces lazy gesture recognizer installation.
207         r237331 is an optimization that made us lazily install gestures when the
208         view is parented, but Firefox (and potentially other clients) depend
209         on them being installed synchronously in order to find and override them.
210
211 2019-01-11  Wenson Hsieh  <wenson_hsieh@apple.com>
212
213         Introduce IDL files for runtime-enabled UndoManager and UndoItem JavaScript API
214         https://bugs.webkit.org/show_bug.cgi?id=193109
215         <rdar://problem/44807048>
216
217         Reviewed by Ryosuke Niwa.
218
219         Add a new SPI configuration flag to enable the UndoManager API. This is off by default.
220
221         * Shared/WebPreferences.yaml:
222         * UIProcess/API/Cocoa/WKWebView.mm:
223         (-[WKWebView _initializeWithConfiguration:]):
224         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
225         (-[WKWebViewConfiguration init]):
226         (-[WKWebViewConfiguration copyWithZone:]):
227         (-[WKWebViewConfiguration _setUndoManagerAPIEnabled:]):
228         (-[WKWebViewConfiguration _undoManagerAPIEnabled]):
229         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
230
231 2019-01-10  Jiewen Tan  <jiewen_tan@apple.com>
232
233         [WebAuthN] Change the nonce in the CTAP kInit command to weak random values
234         https://bugs.webkit.org/show_bug.cgi?id=192061
235         <rdar://problem/46471091>
236
237         Reviewed by Chris Dumez.
238
239         Change the nonce in the CTAP kInit command to weak random values as the nonce is mainly
240         for being a probabilistically unique global identifier for hand shakes, instead of
241         preventing replay attacks. Otherwise, it might exhaust system entropy unnecessarily.
242
243         The patch also removes all logging when debugging the test case flakiness.
244
245         * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
246         (WebKit::AuthenticatorManager::respondReceived):
247         (WebKit::AuthenticatorManager::initTimeOutTimer):
248         (WebKit::AuthenticatorManager::timeOutTimerFired):
249         * UIProcess/WebAuthentication/Cocoa/HidService.mm:
250         (WebKit::HidService::deviceAdded):
251         * UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.cpp:
252         (WebKit::MockAuthenticatorManager::respondReceivedInternal):
253         * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
254         (WebKit::MockHidConnection::send):
255         * UIProcess/WebAuthentication/fido/CtapHidAuthenticator.cpp:
256         (WebKit::CtapHidAuthenticator::makeCredential):
257         (WebKit::CtapHidAuthenticator::getAssertion):
258         * UIProcess/WebAuthentication/fido/CtapHidDriver.cpp:
259         (WebKit::CtapHidDriver::Worker::write):
260         (WebKit::CtapHidDriver::Worker::read):
261         (WebKit::CtapHidDriver::Worker::returnMessage):
262         (WebKit::CtapHidDriver::transact):
263         (WebKit::CtapHidDriver::continueAfterChannelAllocated):
264         (WebKit::CtapHidDriver::continueAfterResponseReceived):
265
266 2019-01-10  Timothy Hatcher  <timothy@apple.com>
267
268         Add WKBundlePage SPI to temporarily force light or dark appearance on a page.
269         https://bugs.webkit.org/show_bug.cgi?id=193327
270         rdar://problem/47093222
271
272         Reviewed by Tim Horton.
273
274         Tests: WebKit.ForceLightAppearanceInBundle API Test
275
276         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
277         (WKBundlePageSetUseDarkAppearance): Added.
278         (WKBundlePageIsUsingDarkAppearance): Added.
279         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
280
281 2019-01-10  Eric Carlson  <eric.carlson@apple.com>
282
283         DeviceID hash salt manager can be NULL
284         https://bugs.webkit.org/show_bug.cgi?id=193334
285         <rdar://problem/47179650>
286
287         Reviewed by Youenn Fablet.
288
289         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
290         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): No need to
291         NULL-check websiteDataStore.deviceIdHashSaltStorage, it is a Ref.
292         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Ditto.
293         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo): Ditto.
294         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Ditto.
295
296         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
297         (WebKit::WebsiteDataStore::WebsiteDataStore): m_deviceIdHashSaltStorage is a Ref.
298         (WebKit::WebsiteDataStore::fetchDataAndApply): Ditto.
299         (WebKit::WebsiteDataStore::removeData): Ditto.
300         * UIProcess/WebsiteData/WebsiteDataStore.h:
301         (WebKit::WebsiteDataStore::deviceIdHashSaltStorage): Ditto.
302
303 2019-01-10  Per Arne Vollan  <pvollan@apple.com>
304
305         [macOS] Add name of IORegistry key in sandbox.
306         https://bugs.webkit.org/show_bug.cgi?id=193335
307         <rdar://problem/47184951>
308
309         Reviewed by Alexey Proskuryakov.
310
311         The property IOGVAHEVCDecodeCapabilities was added in https://bugs.webkit.org/show_bug.cgi?id=193324.
312         Also, the property IOGVAHEVCEncodeCapabilities needs to be added.
313
314         * WebProcess/com.apple.WebProcess.sb.in:
315
316 2019-01-10  Zalan Bujtas  <zalan@apple.com>
317
318         REGRESSION (r237658): Tap highlight limits cause the highlight to no longer show with legitimate button sizes
319         https://bugs.webkit.org/show_bug.cgi?id=193294
320         <rdar://problem/46006678>
321
322         Reviewed by Simon Fraser.
323
324         Input type elements should always paint tap highlight (ignore size heuristic). 
325
326         * UIProcess/PageClient.h:
327         * UIProcess/WebPageProxy.h:
328         * UIProcess/WebPageProxy.messages.in:
329         * UIProcess/ios/PageClientImplIOS.h:
330         * UIProcess/ios/PageClientImplIOS.mm:
331         (WebKit::PageClientImpl::didGetTapHighlightGeometries):
332         * UIProcess/ios/WKContentViewInteraction.h:
333         * UIProcess/ios/WKContentViewInteraction.mm:
334         (-[WKContentView _showTapHighlight]):
335         (-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:nodeHasBuiltInClickHandling:]):
336         (-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:]): Deleted.
337         * UIProcess/ios/WebPageProxyIOS.mm:
338         (WebKit::WebPageProxy::didGetTapHighlightGeometries):
339         * WebProcess/WebPage/ios/WebPageIOS.mm:
340         (WebKit::WebPage::sendTapHighlightForNodeIfNecessary):
341
342 2019-01-10  Alexey Proskuryakov  <ap@apple.com>
343
344         Remove unneeded XPCService variant for plugin service
345         https://bugs.webkit.org/show_bug.cgi?id=193326
346
347         Reviewed by Tim Horton.
348
349         * Configurations/PluginService.32.xcconfig: Removed.
350         * Configurations/PluginService.64.xcconfig:
351         * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist: Removed.
352         * PluginProcess/EntryPoint/mac/XPCService/PluginService.64.Info.plist: Copied from Source/WebKit/PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist.
353         * WebKit.xcodeproj/project.pbxproj:
354
355 2019-01-10  Eric Carlson  <eric.carlson@apple.com>
356
357         Define page media state flags for display capture.
358         https://bugs.webkit.org/show_bug.cgi?id=193230
359         <rdar://problem/47095142>
360
361         Reviewed by Youenn Fablet.
362
363         * UIProcess/API/C/WKPage.cpp:
364         (WKPageGetMediaState):
365         * UIProcess/API/C/WKPagePrivate.h:
366         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
367         (WebKit::UserMediaCaptureManager::Source::Source):
368         (WebKit::UserMediaCaptureManager::createCaptureSource):
369
370 2019-01-10  Alex Christensen  <achristensen@webkit.org>
371
372         REGRESSION(r239815) http/tests/workers/service/serviceworker-private-browsing.https.html test times out
373         https://bugs.webkit.org/show_bug.cgi?id=193325
374
375         Reviewed by Joseph Pecoraro.
376
377         InjectedBundle::setPrivateBrowsingEnabled effectively didn't do anything when enabled was false.
378         I made it destroy the legacy private browsing session in the NetworkProcess, which caused a test to time out.
379         This functionality is only used for testing, so it's no big deal to revert that part of the patch.
380
381         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
382         (WebKit::NetworkConnectionToWebProcess::destroyLegacyPrivateBrowsingSession): Deleted.
383         * NetworkProcess/NetworkConnectionToWebProcess.h:
384         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
385         * WebProcess/InjectedBundle/InjectedBundle.cpp:
386         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
387         * WebProcess/WebProcess.cpp:
388         (WebKit::WebProcess::destroyLegacyPrivateBrowsingSessionInNetworkProcess): Deleted.
389         * WebProcess/WebProcess.h:
390
391 2019-01-10  Per Arne Vollan  <pvollan@apple.com>
392
393         [macOS] Add name of IORegistry key in sandbox.
394         https://bugs.webkit.org/show_bug.cgi?id=193324
395
396         Reviewed by Brent Fulgham.
397
398         IOGVAVTCapabilities key has been changed to IOGVAHEVCDecodeCapabilities.
399
400         * WebProcess/com.apple.WebProcess.sb.in:
401
402 2019-01-10  John Wilander  <wilander@apple.com>
403
404         Override the session configuration for cookieAcceptPolicy
405         https://bugs.webkit.org/show_bug.cgi?id=190925
406         <rdar://problem/45497382>
407
408         Reviewed by Alexey Proskuryakov and Alex Christensen.
409
410         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
411         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
412             Now sets cookieStorage._overrideSessionCookieAcceptPolicy to YES.
413
414 2019-01-09  Matt Rajca  <mrajca@apple.com>
415
416         Put per-document autoplay behavior behind runtime website policies quirk instead of a compile time flag
417         https://bugs.webkit.org/show_bug.cgi?id=193301
418
419         Reviewed by Jer Noble.
420
421         Register a new quirk that can be configured per-load for per-document media
422         autoplay behaviors.
423
424         * Shared/WebsiteAutoplayQuirk.h:
425         * Shared/WebsitePoliciesData.cpp:
426         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
427         * UIProcess/API/C/WKWebsitePolicies.cpp:
428         (WKWebsitePoliciesSetAllowedAutoplayQuirks):
429         (WKWebsitePoliciesGetAllowedAutoplayQuirks):
430         * UIProcess/API/C/WKWebsitePolicies.h:
431         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
432         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
433         (-[_WKWebsitePolicies setAllowedAutoplayQuirks:]):
434         (-[_WKWebsitePolicies allowedAutoplayQuirks]):
435
436 2019-01-10  Tim Horton  <timothy_horton@apple.com>
437
438         Rename some entitlements files to be more clear about their target platform
439         https://bugs.webkit.org/show_bug.cgi?id=193311
440
441         Reviewed by Alexey Proskuryakov.
442
443         * Configurations/Network-iOSMac.entitlements: Renamed from Source/WebKit/Configurations/Network-iOS-minimalsimulator.entitlements.
444         * Configurations/NetworkService.xcconfig:
445         * Configurations/WebContent-iOSMac.entitlements: Renamed from Source/WebKit/Configurations/WebContent-iOS-minimalsimulator.entitlements.
446         * Configurations/WebContentService.xcconfig:
447         * WebKit.xcodeproj/project.pbxproj:
448
449 2019-01-09  Brent Fulgham  <bfulgham@apple.com>
450
451         Unreviewed build fix after r239816.
452
453         Although EWS had no problem with the patch, I'm seeing build errors on the actual bots.
454         This patch corrects the problem.
455
456         * NetworkProcess/NetworkProcess.cpp:
457         (WebKit::NetworkProcess::logFrameNavigation):
458         (WebKit::NetworkProcess::logUserInteraction):
459
460 2019-01-09  Brent Fulgham  <bfulgham@apple.com>
461
462         Create a WebResourceLoadStatisticsStore attached to the NetworkSession
463         https://bugs.webkit.org/show_bug.cgi?id=193261
464         <rdar://problem/47158616>
465
466         Reviewed by Alex Christensen.
467
468         This patch modifies NetworkSession so that it owns a WebResourceLoadStatisticsStore
469         object. This object is only created if the ResourceLoadStatistics feature is turned on.
470
471         The patch also modifies WebResourceLoadStatisticsStore so that it can be constructed
472         with an owning NetworkSession as an alternative to the current practice of using a
473         WebsiteDataStore object.
474
475         Two initial messages from the WebContent process are added (logFrameNavigation and
476         logUserNavigation) that notify the network process of these actions. Currently they
477         are called in addition the calls to the WebsiteDataStore object. These redundant calls
478         will be removed in a future patch.
479
480         This patch forces the ResourceLoadStatistics code in the NetworkSession to be off by
481         default, so there should be no change in behavior with this patch.
482
483         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
484         (WebKit::ResourceLoadStatisticsMemoryStore::updateClientSideCookiesAgeCap):
485         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
486         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
487         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccessForFrame):
488         (WebKit::WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler):
489         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
490         (WebKit::WebResourceLoadStatisticsStore::callGrantStorageAccessHandler):
491         (WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess):
492         (WebKit::WebResourceLoadStatisticsStore::logFrameNavigation):
493         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
494         (WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCapForPrevalentResources):
495         (WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCap):
496         (WebKit::WebResourceLoadStatisticsStore::updatePrevalentDomainsToBlockCookiesFor):
497         (WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToBlockCookiesForHandler):
498         (WebKit::WebResourceLoadStatisticsStore::removePrevalentDomains):
499         (WebKit::WebResourceLoadStatisticsStore::callRemoveDomainsHandler):
500         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
501         * NetworkProcess/NetworkProcess.cpp:
502         (WebKit::NetworkProcess::initializeNetworkProcess):
503         (WebKit::NetworkProcess::logFrameNavigation):
504         (WebKit::NetworkProcess::logUserInteraction):
505         * NetworkProcess/NetworkProcess.h:
506         * NetworkProcess/NetworkProcess.messages.in:
507         * NetworkProcess/NetworkSession.cpp:
508         (WebKit::NetworkSession::enableResourceLoadStatistics):
509         * NetworkProcess/NetworkSession.h:
510         (WebKit::NetworkSession::resourceLoadStatistics const):
511         * NetworkProcess/NetworkSessionCreationParameters.cpp:
512         (WebKit::NetworkSessionCreationParameters::privateSessionParameters):
513         (WebKit::NetworkSessionCreationParameters::encode const):
514         (WebKit::NetworkSessionCreationParameters::decode):
515         * NetworkProcess/NetworkSessionCreationParameters.h:
516         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
517         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
518         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
519         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
520         * UIProcess/Network/NetworkProcessProxy.cpp:
521         (WebKit::NetworkProcessProxy::didLogUserInteraction):
522         * UIProcess/Network/NetworkProcessProxy.h:
523         * UIProcess/Network/NetworkProcessProxy.messages.in:
524         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
525         (WebsiteDataStore::parameters):
526         * UIProcess/WebPageProxy.cpp:
527         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
528         (WebKit::WebPageProxy::logFrameNavigation):
529         * UIProcess/WebPageProxy.h:
530         * UIProcess/WebProcessPool.cpp:
531         (WebKit::WebProcessPool::ensureNetworkProcess):
532         (WebKit::WebProcessPool::initializeNewWebProcess):
533
534 2019-01-09  Alex Christensen  <achristensen@webkit.org>
535
536         Replace SessionTracker with HashMap member of NetworkProcess
537         https://bugs.webkit.org/show_bug.cgi?id=193266
538
539         Reviewed by Joseph Pecoraro.
540
541         * NetworkProcess/Downloads/DownloadManager.cpp:
542         (WebKit::DownloadManager::startDownload):
543         * NetworkProcess/Downloads/DownloadManager.h:
544         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
545         (WebKit::Download::resume):
546         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
547         (WebKit::NetworkCORSPreflightChecker::startPreflight):
548         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
549         (WebKit::NetworkConnectionToWebProcess::preconnectTo):
550         (WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
551         (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
552         (WebKit::NetworkConnectionToWebProcess::destroyLegacyPrivateBrowsingSession):
553         * NetworkProcess/NetworkConnectionToWebProcess.h:
554         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
555         * NetworkProcess/NetworkProcess.cpp:
556         (WebKit::NetworkProcess::initializeNetworkProcess):
557         (WebKit::NetworkProcess::clearCachedCredentials):
558         (WebKit::NetworkProcess::networkSession):
559         (WebKit::NetworkProcess::setSession):
560         (WebKit::NetworkProcess::destroySession):
561         (WebKit::NetworkProcess::preconnectTo):
562         * NetworkProcess/NetworkProcess.h:
563         * NetworkProcess/NetworkResourceLoader.cpp:
564         (WebKit::NetworkResourceLoader::startNetworkLoad):
565         (WebKit::NetworkResourceLoader::didFinishLoading):
566         (WebKit::NetworkResourceLoader::sendResultForCacheEntry):
567         (WebKit::NetworkResourceLoader::shouldLogCookieInformation):
568         (WebKit::NetworkResourceLoader::logCookieInformation const):
569         (WebKit::logBlockedCookieInformation):
570         (WebKit::logCookieInformationInternal):
571         (WebKit::NetworkResourceLoader::logCookieInformation):
572         * NetworkProcess/NetworkResourceLoader.h:
573         * NetworkProcess/PingLoad.cpp:
574         (WebKit::PingLoad::loadRequest):
575         * NetworkProcess/PingLoad.h:
576         * NetworkProcess/PreconnectTask.cpp:
577         (WebKit::PreconnectTask::PreconnectTask):
578         * NetworkProcess/PreconnectTask.h:
579         * NetworkProcess/RemoteNetworkingContext.h:
580         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
581         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
582         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
583         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
584         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
585         * NetworkProcess/mac/RemoteNetworkingContext.mm:
586         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
587         * Shared/SessionTracker.cpp: Removed.
588         * Shared/SessionTracker.h: Removed.
589         * Sources.txt:
590         * WebKit.xcodeproj/project.pbxproj:
591         * WebProcess/InjectedBundle/InjectedBundle.cpp:
592         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
593         * WebProcess/Network/WebLoaderStrategy.cpp:
594         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
595         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
596         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
597         * WebProcess/WebPage/WebPage.cpp:
598         * WebProcess/WebProcess.cpp:
599         (WebKit::WebProcess::destroyLegacyPrivateBrowsingSessionInNetworkProcess):
600         * WebProcess/WebProcess.h:
601         * WebProcess/cocoa/WebProcessCocoa.mm:
602
603 2019-01-09  Alex Christensen  <achristensen@webkit.org>
604
605         Expand use of sourceApplicationAuditData
606         https://bugs.webkit.org/show_bug.cgi?id=192995
607         <rdar://problem/46627875>
608
609         Reviewed by Brady Eidson.
610
611         sourceApplicationAuditData has been used for a long time on iOS, but it's needed on more platforms.
612         I also made it return an Optional instead of a bool and returning by reference. Ahhh. So much nicer.
613         The NetworkProcess needed an additional entitlement on Mac to continue to load anything, which is desirable.
614
615         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
616         (WebKit::NetworkProcess::sourceApplicationAuditData const):
617         * Platform/IPC/Connection.h:
618         * Platform/IPC/mac/ConnectionMac.mm:
619         (IPC::Connection::getAuditToken):
620         * WebProcess/WebProcess.cpp:
621         (WebKit::WebProcess::initializeWebProcess):
622         * WebProcess/cocoa/WebProcessCocoa.mm:
623         (WebKit::WebProcess::sourceApplicationAuditData const):
624
625 2019-01-09  Brent Fulgham  <bfulgham@apple.com>
626
627         [iOS] Update sandbox profile to use iconservices instead of lsdiconservice
628         https://bugs.webkit.org/show_bug.cgi?id=193115
629         <rdar://problem/44867379>
630
631         Reviewed by Eric Carlson.
632
633         Add access to the 'com.apple.iconservices' endpoint. We will remove access to
634         the older name ('com.apple.lsdiconservices') once existing clients have completed
635         the switch.
636
637         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
638
639 2019-01-09  Antti Koivisto  <antti@apple.com>
640
641         [PSON] Flash of blank content while transitioning from page A to page B.
642         https://bugs.webkit.org/show_bug.cgi?id=193283
643
644         Reviewed by Chris Dumez.
645
646         Layer tree is not frozen during WebPage construction. If the flush timer (started for the initial
647         empty document) manages to run before the actual page load starts, we'll get a flash.
648
649         * Shared/WebPageCreationParameters.cpp:
650         (WebKit::WebPageCreationParameters::encode const):
651         (WebKit::WebPageCreationParameters::decode):
652         * Shared/WebPageCreationParameters.h:
653
654         Rename shouldDelayAttachingDrawingArea bit to isSwapFromSuspended and make it available on all platforms.
655
656         * UIProcess/RemoteLayerTree/mac/ScrollerMac.h: Removed.
657         * UIProcess/RemoteLayerTree/mac/ScrollerMac.mm: Removed.
658         * UIProcess/RemoteLayerTree/mac/ScrollerPairMac.h: Removed.
659         * UIProcess/RemoteLayerTree/mac/ScrollerPairMac.mm: Removed.
660         * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp: Removed.
661         * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.h: Removed.
662         * UIProcess/WebPageProxy.cpp:
663         (WebKit::WebPageProxy::swapToWebProcess):
664         (WebKit::WebPageProxy::finishAttachingToWebProcess):
665         (WebKit::WebPageProxy::initializeWebPage):
666         (WebKit::WebPageProxy::continueNavigationInNewProcess):
667         * UIProcess/WebPageProxy.h:
668         * WebProcess/WebPage/WebPage.cpp:
669         (WebKit::m_shouldAttachDrawingAreaOnPageTransition):
670
671         Freeze the layer tree in WebPage constructor if this is a swap from a suspended process.
672
673         (WebKit::WebPage::reinitializeWebPage):
674         (WebKit::WebPage::didCompletePageTransition):
675
676         Unfreeze on first non-initial empty document page transition.
677
678         * WebProcess/WebPage/WebPage.h:
679         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
680         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
681
682 2019-01-09  Chris Dumez  <cdumez@apple.com>
683
684         WebKit Networking process crashes if the HTTPSUpgradeList is not found in the bundle
685         https://bugs.webkit.org/show_bug.cgi?id=193285
686         <rdar://problem/47147610>
687
688         Reviewed by Geoffrey Garen.
689
690         * NetworkProcess/NetworkHTTPSUpgradeChecker.cpp:
691         (WebKit::networkHTTPSUpgradeCheckerDatabasePath):
692         (WebKit::NetworkHTTPSUpgradeChecker::NetworkHTTPSUpgradeChecker):
693
694 2019-01-09  Michael Catanzaro  <mcatanzaro@igalia.com>
695
696         [GTK] Add missing autocleanups
697         https://bugs.webkit.org/show_bug.cgi?id=193068
698
699         Reviewed by Carlos Garcia Campos.
700
701         * UIProcess/API/gtk/WebKitAutocleanups.h:
702
703 2019-01-08  Alex Christensen  <achristensen@webkit.org>
704
705         Fix CompletionHandler assertions introduced today.
706         https://bugs.webkit.org/show_bug.cgi?id=193237
707
708         This reverts part of r239710 and all of r239725, r239738, and r239748 which unsuccessfully tried to fix all the assertions.
709         This code is a mess that will have to be cleaned up later.
710
711         * NetworkProcess/NetworkResourceLoader.cpp:
712         (WebKit::NetworkResourceLoader::tryStoreAsCacheEntry):
713         * NetworkProcess/cache/CacheStorageEngine.cpp:
714         (WebKit::CacheStorage::Engine::from):
715         * NetworkProcess/cache/CacheStorageEngine.h:
716         * NetworkProcess/cache/NetworkCache.cpp:
717         (WebKit::NetworkCache::Cache::store):
718         (WebKit::NetworkCache::Cache::remove):
719         (WebKit::NetworkCache::Cache::traverse):
720         (WebKit::NetworkCache::Cache::clear):
721         (WebKit::NetworkCache::Cache::retrieveData):
722         * NetworkProcess/cache/NetworkCache.h:
723         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
724         (WebKit::NetworkCache::SpeculativeLoad::didFinishLoading):
725         * NetworkProcess/cache/NetworkCacheStorage.cpp:
726         (WebKit::NetworkCache::Storage::store):
727         (WebKit::NetworkCache::Storage::WriteOperation::~WriteOperation): Deleted.
728         * NetworkProcess/cache/NetworkCacheStorage.h:
729         (WebKit::NetworkCache::Storage::store):
730
731 2019-01-08  Jiewen Tan  <jiewen_tan@apple.com>
732
733         [Mac] Layout Test http/wpt/webauthn/public-key-credential-create-success-hid.https.html and http/wpt/webauthn/public-key-credential-get-success-hid.https.html are flaky
734         https://bugs.webkit.org/show_bug.cgi?id=192061
735
736         Reviewed by Dewei Zhu.
737
738         Part 6.
739
740         Add some additional temporary logging info to determine if data is actually sent.
741         Once the bug is determined and fixed, we should remove all logging added in this patch.
742
743         * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
744         (WebKit::MockHidConnection::send):
745
746 2019-01-08  Jiewen Tan  <jiewen_tan@apple.com>
747
748         [WebAuthN] Support U2F HID Authenticators on macOS
749         https://bugs.webkit.org/show_bug.cgi?id=191535
750         <rdar://problem/47102027>
751
752         Reviewed by Brent Fulgham.
753
754         This patch implements the support for U2F authenticators, and enables it for hid devices.
755         It follows the CTAP spec to map WebAuthN requests to U2F commands and return the responses:
756         https://fidoalliance.org/specs/fido-v2.0-id-20180227/fido-client-to-authenticator-protocol-v2.0-id-20180227.html#u2f-interoperability
757         Most of the parts are done before this patch, this patch focues on: 7.2.2 and 7.3.2.
758
759         Besides implementing the U2fHidAuthenticator, this patch also adds support in the mocking
760         environment for U2F authenticators. It is done by extending the stages in MockHidConnection
761         from 4 to indefinite as multi-round communications are expected to map WebAuthN requests
762         to U2F requests.
763
764         * Sources.txt:
765         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
766         (WKWebsiteDataStoreSetWebAuthenticationMockConfiguration):
767         * UIProcess/WebAuthentication/Cocoa/HidService.mm:
768         (WebKit::HidService::continueAddDeviceAfterGetInfo):
769         * UIProcess/WebAuthentication/fido/CtapHidDriver.cpp:
770         (WebKit::CtapHidDriver::continueAfterChannelAllocated):
771         * UIProcess/WebAuthentication/fido/CtapHidDriver.h:
772         (WebKit::CtapHidDriver::setProtocol):
773         * UIProcess/WebAuthentication/fido/U2fHidAuthenticator.cpp: Added.
774         (WebKit::U2fHidAuthenticator::U2fHidAuthenticator):
775         (WebKit::U2fHidAuthenticator::makeCredential):
776         (WebKit::U2fHidAuthenticator::checkExcludeList):
777         (WebKit::U2fHidAuthenticator::issueRegisterCommand):
778         (WebKit::U2fHidAuthenticator::getAssertion):
779         (WebKit::U2fHidAuthenticator::issueSignCommand):
780         (WebKit::U2fHidAuthenticator::issueNewCommand):
781         (WebKit::U2fHidAuthenticator::issueCommand):
782         (WebKit::U2fHidAuthenticator::responseReceived):
783         (WebKit::U2fHidAuthenticator::continueRegisterCommandAfterResponseReceived):
784         (WebKit::U2fHidAuthenticator::continueCheckOnlyCommandAfterResponseReceived):
785         (WebKit::U2fHidAuthenticator::continueBogusCommandAfterResponseReceived):
786         (WebKit::U2fHidAuthenticator::continueSignCommandAfterResponseReceived):
787         * UIProcess/WebAuthentication/fido/U2fHidAuthenticator.h: Added.
788         * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
789         (WebKit::MockHidConnection::parseRequest):
790         (WebKit::MockHidConnection::feedReports):
791         * UIProcess/WebAuthentication/Mock/MockHidConnection.h:
792         * UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h:
793         * WebKit.xcodeproj/project.pbxproj:
794
795 2019-01-08  Youenn Fablet  <youenn@apple.com>
796
797         service worker fetch handler results in bad referrer
798         https://bugs.webkit.org/show_bug.cgi?id=188248
799         <rdar://problem/47050478>
800
801         Reviewed by Alex Christensen.
802
803         NetworkDataTaskCocoa is sometimes updating the referrer on its own.
804         Instead of updating the referrer when sending the request to WebProcess for evaluation,
805         Update the referrer once the web process decides to follow the redirection.
806         This ensures that any referrer that the WebProcess will set will be updated by NetworkDataTaskCocoa.
807
808         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
809         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
810         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
811         (WebKit::NetworkDataTaskCocoa::restrictRequestReferrerToOriginIfNeeded):
812         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
813
814 2019-01-08  Alex Christensen  <achristensen@webkit.org>
815
816         Fix more assertions after r239710
817         https://bugs.webkit.org/show_bug.cgi?id=193237
818
819         * NetworkProcess/cache/NetworkCacheStorage.h:
820         (WebKit::NetworkCache::Storage::store):
821         Make default parameter an empty lambda instead of a null CompletionHandler.
822         This way it can be called once instead of thinking it has already been called.
823
824 2019-01-08  Brent Fulgham  <bfulgham@apple.com>
825
826         Move ResourceLoadStatistics files from UIProcess to NetworkProcess
827         https://bugs.webkit.org/show_bug.cgi?id=193252
828         <rdar://problem/47125401>
829
830         Reviewed by Alex Christensen.
831
832         This patch is the first part of a refactoring to move the ResourceLoadStatistics logic from the UIProcess to the NetworkProcess.
833
834         This patch moves code into different folders and adjusts necessary build files, but does not change where the code executes. These
835         changes have no impact on behavior or test results.
836
837         I also modified a few files to add missing include files uncovered by the unified build system.
838
839         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp: Renamed from Source/WebKit/UIProcess/ResourceLoadStatisticsMemoryStore.cpp.
840         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h: Renamed from Source/WebKit/UIProcess/ResourceLoadStatisticsMemoryStore.h.
841         * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.cpp: Renamed from Source/WebKit/UIProcess/ResourceLoadStatisticsPersistentStorage.cpp.
842         * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.h: Renamed from Source/WebKit/UIProcess/ResourceLoadStatisticsPersistentStorage.h.
843         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: Renamed from Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp.
844         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h: Renamed from Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.h.
845         * NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp: Renamed from Source/WebKit/UIProcess/WebResourceLoadStatisticsTelemetry.cpp.
846         * NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.h: Renamed from Source/WebKit/UIProcess/WebResourceLoadStatisticsTelemetry.h.
847         * NetworkProcess/Downloads/PendingDownload.cpp:
848         * NetworkProcess/Downloads/PendingDownload.h:
849         * CMakeLists.txt:
850         * PlatformMac.cmake:
851         * PlatformWin.cmake:
852         * Shared/PersistencyUtils.cpp: Renamed from Source/WebKit/UIProcess/PersistencyUtils.cpp.
853         * Shared/PersistencyUtils.h: Renamed from Source/WebKit/UIProcess/PersistencyUtils.h.
854         * Sources.txt:
855         * SourcesCocoa.txt:
856         * SourcesGTK.txt:
857         * SourcesWPE.txt:
858         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
859         (WKWebsiteDataStoreSetWebAuthenticationMockConfiguration): Add missing WebKit:: scope.
860         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: Add missing include.
861         * UIProcess/WebDataListSuggestionsDropdown.cpp: Ditto.
862         * UIProcess/mac/DisplayLink.cpp:
863         * UnifiedSources-input.xcfilelist:
864         * WebKit.xcodeproj/project.pbxproj:
865
866 2019-01-08  Chris Dumez  <cdumez@apple.com>
867
868         Mark SuspendedPageProxy as fast allocated
869         https://bugs.webkit.org/show_bug.cgi?id=193248
870
871         Reviewed by Alex Christensen.
872
873         * UIProcess/SuspendedPageProxy.h:
874
875 2019-01-08  Chris Dumez  <cdumez@apple.com>
876
877         Prevent cross-site top-level navigations from third-party iframes
878         https://bugs.webkit.org/show_bug.cgi?id=193076
879         <rdar://problem/36074736>
880
881         Reviewed by Alex Christensen.
882
883         Add experimental feature flag, on by default.
884
885         * Shared/WebPreferences.yaml:
886
887 2019-01-08  Alex Christensen  <achristensen@webkit.org>
888
889         Remove more use of NetworkProcess::singleton
890         https://bugs.webkit.org/show_bug.cgi?id=193244
891
892         Reviewed by Brent Fulgham.
893
894         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
895         (WebKit::NetworkCORSPreflightChecker::NetworkCORSPreflightChecker):
896         (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
897         * NetworkProcess/NetworkCORSPreflightChecker.h:
898         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
899         (WebKit::NetworkConnectionToWebProcess::loadPing):
900         * NetworkProcess/NetworkContentRuleListManager.cpp:
901         (WebKit::NetworkContentRuleListManager::NetworkContentRuleListManager):
902         (WebKit::NetworkContentRuleListManager::contentExtensionsBackend):
903         * NetworkProcess/NetworkContentRuleListManager.h:
904         * NetworkProcess/NetworkLoadChecker.cpp:
905         (WebKit::NetworkLoadChecker::NetworkLoadChecker):
906         (WebKit::NetworkLoadChecker::applyHTTPSUpgradeIfNeeded const):
907         (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
908         (WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad):
909         * NetworkProcess/NetworkLoadChecker.h:
910         * NetworkProcess/NetworkProcess.cpp:
911         (WebKit::NetworkProcess::NetworkProcess):
912         (WebKit::NetworkProcess::didReceiveMessage):
913         (WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
914         * NetworkProcess/NetworkProcess.h:
915         (WebKit::NetworkProcess::networkContentRuleListManager):
916         * NetworkProcess/NetworkResourceLoader.cpp:
917         * NetworkProcess/PingLoad.cpp:
918         (WebKit::PingLoad::PingLoad):
919         * NetworkProcess/PingLoad.h:
920         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
921         (WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
922         (WebKit::WebSWServerToContextConnection::connectionMayNoLongerBeNeeded):
923         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
924
925 2019-01-08  Alex Christensen  <achristensen@webkit.org>
926
927         Stop using NetworkProcess::singleton in NetworkCache code
928         https://bugs.webkit.org/show_bug.cgi?id=193243
929
930         Reviewed by Brent Fulgham.
931
932         * NetworkProcess/cache/NetworkCache.cpp:
933         (WebKit::NetworkCache::Cache::open):
934         (WebKit::NetworkCache::Cache::Cache):
935         * NetworkProcess/cache/NetworkCache.h:
936         (WebKit::NetworkCache::Cache::networkProcess):
937         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
938         (WebKit::NetworkCache::logSpeculativeLoadingDiagnosticMessage):
939         (WebKit::NetworkCache::SpeculativeLoadManager::canRetrieve const):
940         (WebKit::NetworkCache::SpeculativeLoadManager::addPreloadedEntry):
941         (WebKit::NetworkCache::SpeculativeLoadManager::revalidateSubresource):
942         (WebKit::NetworkCache::SpeculativeLoadManager::preloadEntry):
943         (WebKit::NetworkCache::SpeculativeLoadManager::startSpeculativeRevalidation):
944         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
945         (WebKit::NetworkCache::Statistics::recordRetrievalRequest):
946         (WebKit::NetworkCache::Statistics::recordNotUsingCacheForRequest):
947         (WebKit::NetworkCache::Statistics::recordRetrievalFailure):
948         (WebKit::NetworkCache::Statistics::recordRetrievedCachedEntry):
949         (WebKit::NetworkCache::Statistics::recordRevalidationSuccess):
950         * NetworkProcess/cache/NetworkCacheStorage.cpp:
951         (WebKit::NetworkCache::retrieveFromMemory):
952         * NetworkProcess/cache/NetworkCacheStorage.h:
953         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
954         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
955
956 2019-01-08  Alex Christensen  <achristensen@webkit.org>
957
958         Call CompletionHandler when destroying a NetworkCache::Storage::WriteOperation
959         https://bugs.webkit.org/show_bug.cgi?id=193251
960
961         Reviewed by Chris Dumez.
962
963         This fixes another assertion introduced in r239710.
964
965         * NetworkProcess/cache/NetworkCacheStorage.cpp:
966         (WebKit::NetworkCache::Storage::WriteOperation::~WriteOperation):
967
968 2019-01-08  Alex Christensen  <achristensen@webkit.org>
969
970         Stop using NetworkStorageSession in WebProcess
971         https://bugs.webkit.org/show_bug.cgi?id=193236
972
973         Reviewed by Don Olmstead.
974
975         * Shared/WebProcessCreationParameters.cpp:
976         (WebKit::WebProcessCreationParameters::encode const):
977         (WebKit::WebProcessCreationParameters::decode):
978         * Shared/WebProcessCreationParameters.h:
979         * Shared/WebsitePoliciesData.cpp:
980         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
981         * UIProcess/WebProcessPool.cpp:
982         (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
983         (WebKit::WebProcessPool::tryTakePrewarmedProcess):
984         (WebKit::WebProcessPool::initializeNewWebProcess):
985         (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
986         (WebKit::WebProcessPool::pageEndUsingWebsiteDataStore):
987         (WebKit::WebProcessPool::processForNavigationInternal):
988         * WebProcess/InjectedBundle/InjectedBundle.cpp:
989         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
990         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
991         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
992         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession): Deleted.
993         (WebKit::WebFrameNetworkingContext::storageSession const): Deleted.
994         * WebProcess/WebPage/WebPage.cpp:
995         (WebKit::WebPage::setSessionID):
996         * WebProcess/WebProcess.cpp:
997         (WebKit::WebProcess::initializeWebProcess):
998         (WebKit::WebProcess::fetchWebsiteData):
999         (WebKit::WebProcess::addWebsiteDataStore): Deleted.
1000         (WebKit::WebProcess::destroySession): Deleted.
1001         * WebProcess/WebProcess.h:
1002         * WebProcess/WebProcess.messages.in:
1003
1004 2019-01-08  Michael Catanzaro  <mcatanzaro@igalia.com>
1005
1006         Unreviewed, silence -Wformat warnings
1007
1008         * NetworkProcess/NetworkHTTPSUpgradeChecker.cpp:
1009         (WebKit::NetworkHTTPSUpgradeChecker::NetworkHTTPSUpgradeChecker):
1010         (WebKit::NetworkHTTPSUpgradeChecker::query):
1011
1012 2019-01-08  Alex Christensen  <achristensen@webkit.org>
1013
1014         Unreviewed, rolling out r239727.
1015
1016         Broke API tests
1017
1018         Reverted changeset:
1019
1020         "Stop using NetworkStorageSession in WebProcess"
1021         https://bugs.webkit.org/show_bug.cgi?id=193236
1022         https://trac.webkit.org/changeset/239727
1023
1024 2019-01-08  Brian Burg  <bburg@apple.com>
1025
1026         Remove WKPageRef-based SPI in _WKAutomationSessionDelegate
1027         https://bugs.webkit.org/show_bug.cgi?id=193202
1028         <rdar://problem/37408718>
1029
1030         Reviewed by Alex Christensen.
1031
1032         This code is no longer used, it should be deleted.
1033
1034         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
1035         * UIProcess/Cocoa/AutomationSessionClient.h:
1036         * UIProcess/Cocoa/AutomationSessionClient.mm:
1037         (WebKit::AutomationSessionClient::AutomationSessionClient):
1038         (WebKit::AutomationSessionClient::requestNewPageWithOptions):
1039         (WebKit::AutomationSessionClient::requestSwitchToPage):
1040         (WebKit::AutomationSessionClient::requestHideWindowOfPage):
1041         (WebKit::AutomationSessionClient::requestRestoreWindowOfPage):
1042         (WebKit::AutomationSessionClient::requestMaximizeWindowOfPage):
1043         (WebKit::AutomationSessionClient::isShowingJavaScriptDialogOnPage):
1044         (WebKit::AutomationSessionClient::dismissCurrentJavaScriptDialogOnPage):
1045         (WebKit::AutomationSessionClient::acceptCurrentJavaScriptDialogOnPage):
1046         (WebKit::AutomationSessionClient::messageOfCurrentJavaScriptDialogOnPage):
1047         (WebKit::AutomationSessionClient::setUserInputForCurrentJavaScriptPromptOnPage):
1048         (WebKit::AutomationSessionClient::typeOfCurrentJavaScriptDialogOnPage):
1049         Clean up the delegate bridging methods now that only one delegate implementation is possible.
1050
1051 2019-01-08  Patrick Griffis  <pgriffis@igalia.com>
1052
1053         [GTK][WPE] Remove DConf permissions from sandbox
1054         https://bugs.webkit.org/show_bug.cgi?id=193021
1055
1056         Reviewed by Michael Catanzaro.
1057
1058         The latest development releases of xdg-desktop-portal and gtk3 use a
1059         new portal for settings on Wayland org.freedesktop.portal.Settings.
1060
1061         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
1062         (WebKit::bubblewrapSpawn):
1063
1064 2019-01-08  Alex Christensen  <achristensen@webkit.org>
1065
1066         Stop using NetworkStorageSession in WebProcess
1067         https://bugs.webkit.org/show_bug.cgi?id=193236
1068
1069         Reviewed by Don Olmstead.
1070
1071         * Shared/WebProcessCreationParameters.cpp:
1072         (WebKit::WebProcessCreationParameters::encode const):
1073         (WebKit::WebProcessCreationParameters::decode):
1074         * Shared/WebProcessCreationParameters.h:
1075         * Shared/WebsitePoliciesData.cpp:
1076         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
1077         * UIProcess/WebProcessPool.cpp:
1078         (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
1079         (WebKit::WebProcessPool::tryTakePrewarmedProcess):
1080         (WebKit::WebProcessPool::initializeNewWebProcess):
1081         (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
1082         (WebKit::WebProcessPool::pageEndUsingWebsiteDataStore):
1083         (WebKit::WebProcessPool::processForNavigationInternal):
1084         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1085         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
1086         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
1087         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
1088         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession): Deleted.
1089         (WebKit::WebFrameNetworkingContext::storageSession const): Deleted.
1090         * WebProcess/WebPage/WebPage.cpp:
1091         (WebKit::WebPage::setSessionID):
1092         * WebProcess/WebProcess.cpp:
1093         (WebKit::WebProcess::initializeWebProcess):
1094         (WebKit::WebProcess::fetchWebsiteData):
1095         (WebKit::WebProcess::addWebsiteDataStore): Deleted.
1096         (WebKit::WebProcess::destroySession): Deleted.
1097         * WebProcess/WebProcess.h:
1098         * WebProcess/WebProcess.messages.in:
1099
1100 2019-01-08  Alex Christensen  <achristensen@webkit.org>
1101
1102         Always call CompletionHandler in Cache::store
1103         https://bugs.webkit.org/show_bug.cgi?id=193237
1104
1105         Reviewed by Chris Dumez.
1106
1107         No change in behavior. This just fixes an assertion introduced in r239710 when the speculative loader finishes.
1108
1109         * NetworkProcess/NetworkResourceLoader.cpp:
1110         (WebKit::NetworkResourceLoader::tryStoreAsCacheEntry):
1111         * NetworkProcess/cache/NetworkCache.cpp:
1112         (WebKit::NetworkCache::Cache::store):
1113         * NetworkProcess/cache/NetworkCache.h:
1114         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
1115         (WebKit::NetworkCache::SpeculativeLoad::didFinishLoading):
1116
1117 2019-01-08  Carlos Garcia Campos  <cgarcia@igalia.com>
1118
1119         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.23.2 release
1120
1121         * gtk/NEWS: Add release notes for 2.23.2.
1122
1123 2019-01-07  Chris Dumez  <cdumez@apple.com>
1124
1125         Cannot scoll for 5 seconds after swiping back on quoteunquoteapps.com
1126         https://bugs.webkit.org/show_bug.cgi?id=193215
1127         <rdar://problem/45108222>
1128
1129         Reviewed by Tim Horton.
1130
1131         When doing the history navigation, if the source and destination history
1132         items are clones then we will not trigger a main frame load. We may
1133         however trigger loads in subframes if needed. This was an issue for the
1134         ViewGestureController because it was expecting a main frame load after
1135         calling WebPageProxy::goToBackForwardItem() in order to determine when
1136         taking down the view snapshot is appropriate.
1137
1138         To address the problem, the ViewGestureController now takes the snapshot
1139         down as soon as the swipe gesture ends when the source and destination
1140         items are clones.
1141
1142         * Shared/WebBackForwardListItem.cpp:
1143         (WebKit::childItemWithTarget):
1144         (WebKit::WebBackForwardListItem::itemIsInSameDocument const):
1145         (WebKit::hasSameFrames):
1146         (WebKit::WebBackForwardListItem::itemIsClone):
1147         * Shared/WebBackForwardListItem.h:
1148         * UIProcess/ios/ViewGestureControllerIOS.mm:
1149         (WebKit::ViewGestureController::endSwipeGesture):
1150         * UIProcess/mac/ViewGestureControllerMac.mm:
1151         (WebKit::ViewGestureController::endSwipeGesture):
1152
1153 2019-01-07  David Kilzer  <ddkilzer@apple.com>
1154
1155         Leak of ScrollCompletionCallbackData (16 bytes) in com.apple.WebKit.WebContent running WebKit layout tests
1156         <https://webkit.org/b/193222>
1157         <rdar://problem/46862309>
1158
1159         Reviewed by Joseph Pecoraro.
1160
1161         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1162         (WKBundlePageRegisterScrollOperationCompletionCallback): Change
1163         to return true if callback will be called, else false.
1164         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
1165         (WKBundlePageRegisterScrollOperationCompletionCallback): Change
1166         to return `bool` value to denote whether callback will be called
1167         (true) or not called (false).
1168
1169 2019-01-07  Alex Christensen  <achristensen@webkit.org>
1170
1171         Remove use of NetworkProcess::singleton from CacheStorage::Engine::from
1172         https://bugs.webkit.org/show_bug.cgi?id=193220
1173
1174         Reviewed by Andy Estes.
1175
1176         This required passing the NetworkProcess& in from all its callers.
1177         While I was at it, I made them use CompletionHandlers where appropriate.
1178
1179         * NetworkProcess/NetworkProcess.cpp:
1180         (WebKit::NetworkProcess::destroySession):
1181         (WebKit::NetworkProcess::fetchWebsiteData):
1182         (WebKit::NetworkProcess::deleteWebsiteData):
1183         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
1184         (WebKit::NetworkProcess::findCacheEngine):
1185         (WebKit::NetworkProcess::ensureCacheEngine):
1186         (WebKit::NetworkProcess::removeCacheEngine):
1187         * NetworkProcess/NetworkProcess.h:
1188         * NetworkProcess/cache/CacheStorageEngine.cpp:
1189         (WebKit::CacheStorage::Engine::from):
1190         (WebKit::CacheStorage::Engine::destroyEngine):
1191         (WebKit::CacheStorage::Engine::fetchEntries):
1192         (WebKit::CacheStorage::Engine::open):
1193         (WebKit::CacheStorage::Engine::remove):
1194         (WebKit::CacheStorage::Engine::retrieveCaches):
1195         (WebKit::CacheStorage::Engine::retrieveRecords):
1196         (WebKit::CacheStorage::Engine::putRecords):
1197         (WebKit::CacheStorage::Engine::deleteMatchingRecords):
1198         (WebKit::CacheStorage::Engine::lock):
1199         (WebKit::CacheStorage::Engine::unlock):
1200         (WebKit::CacheStorage::Engine::clearMemoryRepresentation):
1201         (WebKit::CacheStorage::Engine::representation):
1202         (WebKit::CacheStorage::Engine::clearAllCaches):
1203         (WebKit::CacheStorage::Engine::clearCachesForOrigin):
1204         (WebKit::CacheStorage::globalEngineMap): Deleted.
1205         * NetworkProcess/cache/CacheStorageEngine.h:
1206         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
1207         (WebKit::CacheStorageEngineConnection::~CacheStorageEngineConnection):
1208         (WebKit::CacheStorageEngineConnection::open):
1209         (WebKit::CacheStorageEngineConnection::remove):
1210         (WebKit::CacheStorageEngineConnection::caches):
1211         (WebKit::CacheStorageEngineConnection::retrieveRecords):
1212         (WebKit::CacheStorageEngineConnection::deleteMatchingRecords):
1213         (WebKit::CacheStorageEngineConnection::putRecords):
1214         (WebKit::CacheStorageEngineConnection::reference):
1215         (WebKit::CacheStorageEngineConnection::dereference):
1216         (WebKit::CacheStorageEngineConnection::clearMemoryRepresentation):
1217         (WebKit::CacheStorageEngineConnection::engineRepresentation):
1218         * NetworkProcess/cache/NetworkCache.cpp:
1219         (WebKit::NetworkCache::Cache::store):
1220         (WebKit::NetworkCache::Cache::remove):
1221         (WebKit::NetworkCache::Cache::traverse):
1222         (WebKit::NetworkCache::Cache::clear):
1223         (WebKit::NetworkCache::Cache::retrieveData):
1224         * NetworkProcess/cache/NetworkCache.h:
1225
1226 2019-01-07  David Kilzer  <ddkilzer@apple.com>
1227
1228         Prefer RetainPtr<NSObject> to RetainPtr<NSObject *>
1229         <https://webkit.org/b/193056>
1230
1231         Reviewed by Alex Christensen.
1232
1233         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
1234         (WebKit::XPCServiceMain):
1235         * UIProcess/API/Cocoa/_WKThumbnailView.mm:
1236         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
1237         * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
1238         * UIProcess/Plugins/PluginProcessProxy.h:
1239         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
1240         (WebKit::RemoteLayerTreeHost::createEmbeddedView):
1241         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm:
1242         (WebKit::PlatformCALayerRemoteCustom::clone const):
1243         - Remove '*' from RetainPtr<> type.
1244
1245 2019-01-07  Dean Jackson  <dino@apple.com>
1246
1247         Turn on Pointer Events by default for iOS
1248         https://bugs.webkit.org/show_bug.cgi?id=193214
1249         <rdar://problem/46974878>
1250
1251         Reviewed by Wenson Hsieh.
1252
1253         Turn on Pointer Events.
1254
1255         * Shared/WebPreferences.yaml:
1256         * Shared/WebPreferencesDefaultValues.h: Make a new #define for iOS.
1257
1258 2019-01-07  Alex Christensen  <achristensen@webkit.org>
1259
1260         Remove use of NetworkProcess::singleton in ServiceWorker code
1261         https://bugs.webkit.org/show_bug.cgi?id=193209
1262
1263         Reviewed by Megan Gardner.
1264
1265         Use a member Ref<NetworkProcess> instead to avoid global singleton use.
1266
1267         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1268         (WebKit::NetworkConnectionToWebProcess::establishSWServerConnection):
1269         * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
1270         (WebKit::WebSWServerConnection::WebSWServerConnection):
1271         (WebKit::WebSWServerConnection::~WebSWServerConnection):
1272         (WebKit::WebSWServerConnection::startFetch):
1273         (WebKit::WebSWServerConnection::postMessageToServiceWorker):
1274         (WebKit::WebSWServerConnection::scheduleJobInServer):
1275         * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
1276
1277 2019-01-07  Alex Christensen  <achristensen@webkit.org>
1278
1279         Remove use of NetworkProcess::singleton in NetworkLoad/NetworkDataTask code
1280         https://bugs.webkit.org/show_bug.cgi?id=193212
1281
1282         Reviewed by Andy Estes.
1283
1284         * NetworkProcess/NetworkDataTaskBlob.cpp:
1285         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
1286         (WebKit::NetworkDataTaskBlob::download):
1287         (WebKit::NetworkDataTaskBlob::writeDownload):
1288         (WebKit::NetworkDataTaskBlob::didFailDownload):
1289         (WebKit::NetworkDataTaskBlob::didFinishDownload):
1290         * NetworkProcess/NetworkDataTaskBlob.h:
1291         * NetworkProcess/NetworkLoad.cpp:
1292         (WebKit::NetworkLoad::NetworkLoad):
1293         (WebKit::NetworkLoad::convertTaskToDownload):
1294         (WebKit::NetworkLoad::didReceiveChallenge):
1295         (WebKit::NetworkLoad::didReceiveResponse):
1296         * NetworkProcess/NetworkLoad.h:
1297
1298 2019-01-07  Alex Christensen  <achristensen@webkit.org>
1299
1300         Remove use of NetworkProcess::singleton for downloads
1301         https://bugs.webkit.org/show_bug.cgi?id=193207
1302
1303         Reviewed by Brady Eidson.
1304
1305         No change in behavior.  The DownloadManager is now a member of the NetworkProcess instead of a static singleton.
1306
1307         * NetworkProcess/Downloads/Download.cpp:
1308         (WebKit::Download::Download):
1309         (WebKit::Download::didReceiveChallenge):
1310         * NetworkProcess/Downloads/Download.h:
1311         * NetworkProcess/Downloads/DownloadManager.cpp:
1312         (WebKit::DownloadManager::startDownload):
1313         (WebKit::DownloadManager::convertNetworkLoadToDownload):
1314         * NetworkProcess/Downloads/DownloadManager.h:
1315         (WebKit::DownloadManager::client):
1316         * NetworkProcess/Downloads/PendingDownload.cpp:
1317         (WebKit::PendingDownload::PendingDownload):
1318         (WebKit::PendingDownload::messageSenderConnection):
1319         * NetworkProcess/Downloads/PendingDownload.h:
1320         * NetworkProcess/NetworkLoadChecker.cpp:
1321         * NetworkProcess/NetworkProcess.cpp:
1322         (WebKit::NetworkProcess::NetworkProcess):
1323         (WebKit::NetworkProcess::downloadManager):
1324         * NetworkProcess/NetworkProcess.h:
1325
1326 2019-01-07  Devin Rousso  <drousso@apple.com>
1327
1328         Web Inspector: Network: show secure connection details per-request
1329         https://bugs.webkit.org/show_bug.cgi?id=191539
1330         <rdar://problem/45979891>
1331
1332         Reviewed by Joseph Pecoraro.
1333
1334         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1335         (stringForSSLProtocol): Added.
1336         (stringForSSLCipher): Added.
1337         (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
1338
1339 2019-01-07  Joseph Pecoraro  <pecoraro@apple.com>
1340
1341         Web Inspector: Remote inspector can crash if attempting to navigate inspector page
1342         https://bugs.webkit.org/show_bug.cgi?id=193204
1343         <rdar://problem/45550428>
1344
1345         Reviewed by Devin Rousso.
1346
1347         * UIProcess/mac/RemoteWebInspectorProxyMac.mm:
1348         (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
1349         * UIProcess/mac/WKInspectorViewController.mm:
1350         (-[WKInspectorViewController webView:decidePolicyForNavigationAction:decisionHandler:]):
1351
1352 2019-01-07  Eric Carlson  <eric.carlson@apple.com>
1353
1354         Deactivate audio session whenever possible
1355         https://bugs.webkit.org/show_bug.cgi?id=193188
1356         <rdar://problem/42678977>
1357
1358         Reviewed by Jer Noble.
1359
1360         * WebProcess/WebPage/WebPage.cpp:
1361         (WebKit::WebPage::WebPage):
1362
1363 2019-01-07  Joseph Pecoraro  <pecoraro@apple.com>
1364
1365         [Cocoa] Add SPI to check if a WKWebView has an inspector frontend
1366         https://bugs.webkit.org/show_bug.cgi?id=193162
1367         <rdar://problem/24267143>
1368
1369         Reviewed by Alex Christensen.
1370
1371         * UIProcess/API/Cocoa/WKWebView.mm:
1372         (-[WKWebView _hasInspectorFrontend]):
1373         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1374         * UIProcess/WebPageProxy.h:
1375         (WebKit::WebPageProxy::hasInspectorFrontend const):
1376
1377 2019-01-07  Antti Koivisto  <antti@apple.com>
1378
1379         UI process side scrollbars for UI side compositing on Mac
1380         https://bugs.webkit.org/show_bug.cgi?id=193106
1381
1382         Reviewed by Tim Horton.
1383
1384         This patch implements Mac scrollbars on UI process side using the low level NSScrollerImp/NSScrollerPairImp
1385         SPIs. With this patch scrollbars mostly work for the main frame and also render (but can't be interacted with)
1386         for the subframes.
1387
1388         This is based on the similar code for web process side scrollbars in ScrollAnimatorMac. There is quite a bit of
1389         copy code as there is no way to share nicely. One of these will eventually go away anyway.
1390
1391         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
1392         (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
1393         (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
1394         * Shared/WebCoreArgumentCoders.cpp:
1395         (IPC::ArgumentCoder<ScrollableAreaParameters>::encode):
1396         (IPC::ArgumentCoder<ScrollableAreaParameters>::decode):
1397         * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h:
1398         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
1399         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
1400         (WebKit::RemoteScrollingCoordinatorProxy::handleMouseEvent):
1401         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
1402         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
1403         (WebKit::RemoteScrollingTree::createScrollingTreeNode):
1404         (WebKit::RemoteScrollingTree::handleMouseEvent):
1405         * UIProcess/RemoteLayerTree/RemoteScrollingTree.h:
1406         * UIProcess/RemoteLayerTree/mac: Added.
1407         * UIProcess/RemoteLayerTree/mac/ScrollerMac.h: Added.
1408
1409         Wraps NSScrollerImp for vertical or horizontal scrollbar.
1410
1411         (WebKit::ScrollerMac::pair):
1412         (WebKit::ScrollerMac::orientation const):
1413         (WebKit::ScrollerMac::hostLayer const):
1414         (WebKit::ScrollerMac::scrollerImp):
1415         * UIProcess/RemoteLayerTree/mac/ScrollerMac.mm: Added.
1416         (-[WKScrollbarPartAnimation initWithScroller:featureToAnimate:animateFrom:animateTo:duration:]):
1417         (-[WKScrollbarPartAnimation startAnimation]):
1418         (-[WKScrollbarPartAnimation setStartValue:]):
1419         (-[WKScrollbarPartAnimation setEndValue:]):
1420         (-[WKScrollbarPartAnimation setCurrentProgress:]):
1421         (-[WKScrollbarPartAnimation invalidate]):
1422         (-[WKScrollerImpDelegate initWithScroller:]):
1423         (-[WKScrollerImpDelegate cancelAnimations]):
1424         (-[WKScrollerImpDelegate scrollerPair]):
1425         (-[WKScrollerImpDelegate convertRectToBacking:]):
1426         (-[WKScrollerImpDelegate convertRectFromBacking:]):
1427         (-[WKScrollerImpDelegate layer]):
1428         (-[WKScrollerImpDelegate mouseLocationInScrollerForScrollerImp:]):
1429         (-[WKScrollerImpDelegate convertRectToLayer:]):
1430         (-[WKScrollerImpDelegate shouldUseLayerPerPartForScrollerImp:]):
1431         (-[WKScrollerImpDelegate effectiveAppearanceForScrollerImp:]):
1432         (-[WKScrollerImpDelegate setUpAlphaAnimation:scrollerPainter:part:animateAlphaTo:duration:]):
1433         (-[WKScrollerImpDelegate scrollerImp:animateKnobAlphaTo:duration:]):
1434         (-[WKScrollerImpDelegate scrollerImp:animateTrackAlphaTo:duration:]):
1435         (-[WKScrollerImpDelegate scrollerImp:animateUIStateTransitionWithDuration:]):
1436         (-[WKScrollerImpDelegate scrollerImp:animateExpansionTransitionWithDuration:]):
1437         (-[WKScrollerImpDelegate scrollerImp:overlayScrollerStateChangedTo:]):
1438         (-[WKScrollerImpDelegate invalidate]):
1439         (WebKit::ScrollerMac::ScrollerMac):
1440         (WebKit::ScrollerMac::~ScrollerMac):
1441         (WebKit::ScrollerMac::attach):
1442         (WebKit::ScrollerMac::setHostLayer):
1443         (WebKit::ScrollerMac::updatePosition):
1444         (WebKit::ScrollerMac::convertFromContent const):
1445         * UIProcess/RemoteLayerTree/mac/ScrollerPairMac.h: Added.
1446         (WebKit::ScrollerPairMac::verticalScroller):
1447         (WebKit::ScrollerPairMac::horizontalScroller):
1448         (WebKit::ScrollerPairMac::scrollerImpPair):
1449         (WebKit::ScrollerPairMac::lastKnownMousePosition const):
1450         * UIProcess/RemoteLayerTree/mac/ScrollerPairMac.mm: Added.
1451
1452         Wraps NSScrollerPairImp and owns the vertical and horizontal scrollers.
1453
1454         (-[WKScrollerImpPairDelegate initWithScrollerPair:]):
1455         (-[WKScrollerImpPairDelegate invalidate]):
1456         (-[WKScrollerImpPairDelegate contentAreaRectForScrollerImpPair:]):
1457         (-[WKScrollerImpPairDelegate inLiveResizeForScrollerImpPair:]):
1458         (-[WKScrollerImpPairDelegate mouseLocationInContentAreaForScrollerImpPair:]):
1459         (-[WKScrollerImpPairDelegate scrollerImpPair:convertContentPoint:toScrollerImp:]):
1460         (-[WKScrollerImpPairDelegate scrollerImpPair:setContentAreaNeedsDisplayInRect:]):
1461         (-[WKScrollerImpPairDelegate scrollerImpPair:updateScrollerStyleForNewRecommendedScrollerStyle:]):
1462         (WebKit::ScrollerPairMac::ScrollerPairMac):
1463         (WebKit::ScrollerPairMac::~ScrollerPairMac):
1464         (WebKit::ScrollerPairMac::handleWheelEvent):
1465         (WebKit::ScrollerPairMac::handleMouseEvent):
1466         (WebKit::ScrollerPairMac::updatePositions):
1467         (WebKit::ScrollerPairMac::contentsSize const):
1468         (WebKit::ScrollerPairMac::visibleContentsRect const):
1469         (WebKit::ScrollerPairMac::useDarkAppearance const):
1470         * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp: Added.
1471
1472         Special node for UI side Mac scrolling. Owns ScrollerPairMac instance.
1473
1474         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::ScrollingTreeFrameScrollingNodeRemoteMac):
1475         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::~ScrollingTreeFrameScrollingNodeRemoteMac):
1476         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::create):
1477         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::commitStateBeforeChildren):
1478         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::setScrollLayerPosition):
1479         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::handleWheelEvent):
1480         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::handleMouseEvent):
1481         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::scrollingTree const):
1482         * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.h: Added.
1483         * UIProcess/WebPageProxy.cpp:
1484         (WebKit::WebPageProxy::handleMouseEvent):
1485         * WebKit.xcodeproj/project.pbxproj:
1486
1487 2019-01-07  Brian Burg  <bburg@apple.com>
1488
1489         Unwanted page navigation after showing & dismissing contextual menu with control-click
1490         https://bugs.webkit.org/show_bug.cgi?id=192912
1491         <rdar://problem/46318508>
1492
1493         Reviewed by Timothy Hatcher.
1494
1495         After the conversion to use a mouse event queue, this behavior was observed rarely, especially
1496         when CPU is under load and lots of things are going on in the page. In other words, it's racy.
1497
1498         Based on NSEvent logging, it seems that when the system is under load, we simply take too long
1499         to enter the nested runloop that AppKit uses to handle events when the context menu is present.
1500         AppKit doesn't care whether or not the MouseDown triggered a nested runloop; on my machine it delivers
1501         the MouseUp event about 130ms after the MouseDown event. If we haven't show the context menu in
1502         that time, then the MouseUp is enqueued as a normal mouse event. If the Ctrl-click is on a link,
1503         then the MouseUp will be interpreted by EventHandler as a click event, which in the simplest case
1504         will initiate a main frame navigation. When the context menu is dismissed and the nested runloop
1505         is torn down, the navigation IPC message is handled in UIProcess and the page navigates away.
1506
1507         We can't do much to change AppKit's inherently racy behavior, but we can avoid processing
1508         mouse events that are delivered whilst we are processing the context menu-initiating event.
1509         From the WebProcess point of view, there is no race anymore because it does not receive the
1510         MouseUp event.
1511
1512         * UIProcess/WebPageProxy.cpp:
1513         (WebKit::WebPageProxy::showContextMenu):
1514         If new events come in, drop them on the floor. Based on testing, the nested runloop will discard
1515         the unpaired MouseUp event anyway, so this does not cause a change in behavior.
1516
1517 2019-01-07  Wenson Hsieh  <wenson_hsieh@apple.com>
1518
1519         Native caret shows up alongside the page's caret when requesting desktop site on jsfiddle.net
1520         https://bugs.webkit.org/show_bug.cgi?id=193180
1521         <rdar://problem/45971041>
1522
1523         Reviewed by Tim Horton.
1524
1525         JSFiddle uses CodeMirror; CodeMirror's editor works by capturing keystrokes and input in a hidden textarea
1526         element, and then drawing its own selection caret using web content. This textarea is hidden by being placed
1527         underneath an empty div with `overflow: hidden;`.
1528
1529         When requesting desktop site on iOS, both CodeMirror's caret and the native iOS caret are shown because iOS
1530         selection UI consists of native views overlaid on the page, whereas on macOS, the entire textarea (along with
1531         the caret) are occluded by the hidden overflow container. Additionally, various iOS behaviors related to
1532         selection and editing, such as zooming to reveal the focused element and showing the platform callout bar, are
1533         active when focusing this hidden editable area; these don't work as intended, and just interfere with the page's
1534         custom editing UI.
1535
1536         To fix this, we augment the text interaction suppression mechanism added in r238146 to detect when the focused
1537         element is in an empty `overflow: hidden` container, and bail out of native text editing behaviors.
1538
1539         * Shared/EditorState.cpp:
1540         (WebKit::EditorState::PostLayoutData::encode const):
1541         (WebKit::EditorState::PostLayoutData::decode):
1542         * Shared/EditorState.h:
1543
1544         Rename elementIsTransparent to elementIsTransparentOrFullyClipped.
1545
1546         * Shared/FocusedElementInformation.cpp:
1547         (WebKit::FocusedElementInformation::encode const):
1548         (WebKit::FocusedElementInformation::decode):
1549         * Shared/FocusedElementInformation.h:
1550         * UIProcess/ios/WKContentViewInteraction.h:
1551
1552         Rename FocusedElementIsTransparent to FocusedElementIsTransparentOrFullyClipped.
1553
1554         * UIProcess/ios/WKContentViewInteraction.mm:
1555         (-[WKContentView _zoomToRevealFocusedElement]):
1556         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
1557         (-[WKContentView _elementDidBlur]):
1558
1559         Make an additional tweak here to only stop suppressing text interaction assistant in `-_elementDidBlur` if we're
1560         not also in the middle of changing the focused element. Without this, focusing a hidden editable element while
1561         another hidden editable element is currently focused causes us to zoom to reveal the newly focused hidden
1562         editable element, when we should be avoiding this behavior.
1563
1564         (-[WKContentView _updateChangedSelection:]):
1565         * WebProcess/WebPage/ios/WebPageIOS.mm:
1566         (WebKit::WebPage::platformEditorState const):
1567         (WebKit::WebPage::getFocusedElementInformation):
1568
1569 2019-01-07  Alex Christensen  <achristensen@webkit.org>
1570
1571         Move identifierBase from SessionTracker to NetworkProcess/WebProcess
1572         https://bugs.webkit.org/show_bug.cgi?id=193201
1573
1574         Reviewed by Tim Horton.
1575
1576         No change in behavior.  This just reduces process-global state.
1577
1578         * NetworkProcess/NetworkProcess.h:
1579         (WebKit::NetworkProcess::uiProcessBundleIdentifier const):
1580         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1581         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
1582         * NetworkProcess/mac/RemoteNetworkingContext.mm:
1583         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
1584         * Shared/SessionTracker.cpp:
1585         (WebKit::identifierBase): Deleted.
1586         (WebKit::SessionTracker::getIdentifierBase): Deleted.
1587         (WebKit::SessionTracker::setIdentifierBase): Deleted.
1588         * Shared/SessionTracker.h:
1589         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
1590         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
1591         (WebKit::WebFrameNetworkingContext::sourceApplicationIdentifier const):
1592         * WebProcess/WebProcess.h:
1593         (WebKit::WebProcess::uiProcessBundleIdentifier const):
1594         * WebProcess/cocoa/WebProcessCocoa.mm:
1595         (WebKit::WebProcess::platformInitializeWebProcess):
1596
1597 2019-01-07  Alex Christensen  <achristensen@webkit.org>
1598
1599         Reduce use of NetworkProcess::singleton
1600         https://bugs.webkit.org/show_bug.cgi?id=193197
1601
1602         Reviewed by Brady Eidson.
1603
1604         Pass it around as a Ref<NetworkProcess> as a step towards reducing global state.
1605         Soup's WebFrameNetworkingContext no longer makes a NetworkSession like all other ports
1606         because networking is no longer done in the WebProcess.
1607
1608         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
1609         (WebKit::WebIDBConnectionToClient::create):
1610         (WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient):
1611         (WebKit::WebIDBConnectionToClient::disconnectedFromWebProcess):
1612         (WebKit::WebIDBConnectionToClient::deleteDatabase):
1613         (WebKit::WebIDBConnectionToClient::openDatabase):
1614         (WebKit::WebIDBConnectionToClient::abortTransaction):
1615         (WebKit::WebIDBConnectionToClient::commitTransaction):
1616         (WebKit::WebIDBConnectionToClient::didFinishHandlingVersionChangeTransaction):
1617         (WebKit::WebIDBConnectionToClient::createObjectStore):
1618         (WebKit::WebIDBConnectionToClient::deleteObjectStore):
1619         (WebKit::WebIDBConnectionToClient::renameObjectStore):
1620         (WebKit::WebIDBConnectionToClient::clearObjectStore):
1621         (WebKit::WebIDBConnectionToClient::createIndex):
1622         (WebKit::WebIDBConnectionToClient::deleteIndex):
1623         (WebKit::WebIDBConnectionToClient::renameIndex):
1624         (WebKit::WebIDBConnectionToClient::putOrAdd):
1625         (WebKit::WebIDBConnectionToClient::getRecord):
1626         (WebKit::WebIDBConnectionToClient::getAllRecords):
1627         (WebKit::WebIDBConnectionToClient::getCount):
1628         (WebKit::WebIDBConnectionToClient::deleteRecord):
1629         (WebKit::WebIDBConnectionToClient::openCursor):
1630         (WebKit::WebIDBConnectionToClient::iterateCursor):
1631         (WebKit::WebIDBConnectionToClient::establishTransaction):
1632         (WebKit::WebIDBConnectionToClient::databaseConnectionPendingClose):
1633         (WebKit::WebIDBConnectionToClient::databaseConnectionClosed):
1634         (WebKit::WebIDBConnectionToClient::abortOpenAndUpgradeNeeded):
1635         (WebKit::WebIDBConnectionToClient::didFireVersionChangeEvent):
1636         (WebKit::WebIDBConnectionToClient::openDBRequestCancelled):
1637         (WebKit::WebIDBConnectionToClient::confirmDidCloseFromServer):
1638         (WebKit::WebIDBConnectionToClient::getAllDatabaseNames):
1639         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
1640         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1641         (WebKit::NetworkConnectionToWebProcess::create):
1642         (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
1643         (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
1644         (WebKit::NetworkConnectionToWebProcess::didClose):
1645         (WebKit::NetworkConnectionToWebProcess::createSocketStream):
1646         (WebKit::NetworkConnectionToWebProcess::prefetchDNS):
1647         (WebKit::NetworkConnectionToWebProcess::startDownload):
1648         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
1649         (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession):
1650         (WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer):
1651         (WebKit::NetworkConnectionToWebProcess::establishSWServerConnection):
1652         * NetworkProcess/NetworkConnectionToWebProcess.h:
1653         (WebKit::NetworkConnectionToWebProcess::networkProcess):
1654         * NetworkProcess/NetworkProcess.cpp:
1655         (WebKit::NetworkProcess::singleton):
1656         (WebKit::NetworkProcess::initializeNetworkProcess):
1657         (WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
1658         (WebKit::NetworkProcess::addWebsiteDataStore):
1659         (WebKit::fetchDiskCacheEntries):
1660         (WebKit::NetworkProcess::fetchWebsiteData):
1661         (WebKit::clearDiskCacheEntries):
1662         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
1663         (WebKit::NetworkProcess::getNetworkProcessStatistics):
1664         (WebKit::NetworkProcess::idbServer):
1665         * NetworkProcess/NetworkProcess.h:
1666         * NetworkProcess/NetworkResourceLoader.cpp:
1667         (WebKit::NetworkResourceLoader::startNetworkLoad):
1668         (WebKit::NetworkResourceLoader::convertToDownload):
1669         (WebKit::NetworkResourceLoader::isAlwaysOnLoggingAllowed const):
1670         * NetworkProcess/NetworkSession.cpp:
1671         (WebKit::NetworkSession::create):
1672         (WebKit::NetworkSession::NetworkSession):
1673         * NetworkProcess/NetworkSession.h:
1674         (WebKit::NetworkSession::networkProcess):
1675         * NetworkProcess/RemoteNetworkingContext.h:
1676         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1677         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
1678         (WebKit::NetworkDataTaskCocoa::isAlwaysOnLoggingAllowed const):
1679         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1680         (WebKit::NetworkProcess::clearDiskCache):
1681         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
1682         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1683         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
1684         (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
1685         (-[WKNetworkSessionDelegate URLSession:downloadTask:didFinishDownloadingToURL:]):
1686         (-[WKNetworkSessionDelegate URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:]):
1687         (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]):
1688         (WebKit::NetworkSessionCocoa::create):
1689         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1690         * NetworkProcess/curl/NetworkSessionCurl.cpp:
1691         (WebKit::NetworkSessionCurl::NetworkSessionCurl):
1692         * NetworkProcess/curl/NetworkSessionCurl.h:
1693         * NetworkProcess/mac/RemoteNetworkingContext.mm:
1694         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
1695         * NetworkProcess/soup/NetworkSessionSoup.cpp:
1696         (WebKit::NetworkSessionSoup::NetworkSessionSoup):
1697         * NetworkProcess/soup/NetworkSessionSoup.h:
1698
1699 2019-01-07  Alex Christensen  <achristensen@webkit.org>
1700
1701         Modernize CacheModel and disk cache fetching and clearing
1702         https://bugs.webkit.org/show_bug.cgi?id=193164
1703
1704         Reviewed by Joseph Pecoraro.
1705
1706         fetchDiskCacheEntries and clearDiskCacheEntries now use an early-return model.
1707         CacheModel is now an enum class.
1708
1709         * NetworkProcess/NetworkProcess.cpp:
1710         (WebKit::NetworkProcess::NetworkProcess):
1711         (WebKit::NetworkProcess::initializeNetworkProcess):
1712         (WebKit::fetchDiskCacheEntries):
1713         (WebKit::NetworkProcess::fetchWebsiteData):
1714         (WebKit::clearDiskCacheEntries):
1715         (WebKit::NetworkProcess::setCacheModel):
1716         * NetworkProcess/NetworkProcess.h:
1717         * NetworkProcess/NetworkProcess.messages.in:
1718         * NetworkProcess/NetworkProcessCreationParameters.h:
1719         * NetworkProcess/cache/NetworkCacheEntry.cpp:
1720         (WebKit::NetworkCache::Entry::initializeShareableResourceHandleFromStorageRecord const):
1721         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1722         (WebKit::NetworkProcess::clearDiskCache):
1723         * Shared/CacheModel.cpp:
1724         (WebKit::calculateMemoryCacheSizes):
1725         (WebKit::calculateURLCacheSizes):
1726         * Shared/CacheModel.h:
1727         (): Deleted.
1728         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1729         (API::ProcessPoolConfiguration::createWithLegacyOptions):
1730         * UIProcess/API/APIProcessPoolConfiguration.h:
1731         * UIProcess/API/C/WKAPICast.h:
1732         (WebKit::toCacheModel):
1733         (WebKit::toAPI):
1734         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
1735         (-[_WKProcessPoolConfiguration pageCacheEnabled]):
1736         (-[_WKProcessPoolConfiguration setPageCacheEnabled:]):
1737         * WebProcess/WebProcess.cpp:
1738         (WebKit::WebProcess::initializeWebProcess):
1739         (WebKit::WebProcess::setCacheModel):
1740         (WebKit::WebProcess::clearResourceCaches):
1741         * WebProcess/WebProcess.h:
1742         * WebProcess/WebProcess.messages.in:
1743
1744 2019-01-06  Jiewen Tan  <jiewen_tan@apple.com>
1745
1746         [WebAuthN] Import U2F command/response converters from Chromium
1747         https://bugs.webkit.org/show_bug.cgi?id=193150
1748         <rdar://problem/47054028>
1749
1750         Reviewed by Brent Fulgham.
1751
1752         Moves helper functions to WebAuthenticationUtils.
1753
1754         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
1755         (WebKit::LocalAuthenticatorInternal::produceHashSet):
1756         (WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested):
1757         (): Deleted.
1758         (WebKit::LocalAuthenticatorInternal::buildAuthData): Deleted.
1759         * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
1760         (WebKit::MockHidConnection::feedReports):
1761
1762 2019-01-04  Joseph Pecoraro  <pecoraro@apple.com>
1763
1764         Web Inspector: Use save sheet instead of dialog where possible
1765         https://bugs.webkit.org/show_bug.cgi?id=193160
1766         <rdar://problem/37399759>
1767
1768         Reviewed by Devin Rousso.
1769
1770         * UIProcess/mac/RemoteWebInspectorProxyMac.mm:
1771         (WebKit::RemoteWebInspectorProxy::platformSave):
1772         * UIProcess/mac/WebInspectorProxyMac.mm:
1773         (WebKit::WebInspectorProxy::platformSave):
1774
1775 2019-01-04  Jer Noble  <jer.noble@apple.com>
1776
1777         [WebKitLegacy] Media playback pauses on scroll
1778         https://bugs.webkit.org/show_bug.cgi?id=192829
1779
1780         Reviewed by Eric Carlson.
1781
1782         Add a new WebPage, WebPageProxy, & WKWebView SPI to stop, suspend, and resume all
1783         existing media playback in the page.
1784
1785         * UIProcess/API/Cocoa/WKWebView.mm:
1786         (-[WKWebView _stopAllMediaPlayback]):
1787         (-[WKWebView _suspendAllMediaPlayback]):
1788         (-[WKWebView _resumeAllMediaPlayback]):
1789         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1790         * UIProcess/WebPageProxy.cpp:
1791         (WebKit::WebPageProxy::stopAllMediaPlayback):
1792         (WebKit::WebPageProxy::suspendAllMediaPlayback):
1793         (WebKit::WebPageProxy::resumeAllMediaPlayback):
1794         * UIProcess/WebPageProxy.h:
1795         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
1796         (-[WKFullScreenViewController _showPhishingAlert]):
1797         * WebProcess/WebPage/WebPage.cpp:
1798         (WebKit::WebPage::stopAllMediaPlayback):
1799         (WebKit::WebPage::suspendAllMediaPlayback):
1800         (WebKit::WebPage::resumeAllMediaPlayback):
1801         * WebProcess/WebPage/WebPage.h:
1802         * WebProcess/WebPage/WebPage.messages.in:
1803
1804 2019-01-04  Chris Dumez  <cdumez@apple.com>
1805
1806         Add support for toggling device orientation API support per site
1807         https://bugs.webkit.org/show_bug.cgi?id=193143
1808         <rdar://problem/46605724>
1809
1810         Reviewed by Alex Christensen.
1811
1812         Add support for toggling device orientation API support per site via _WKWebsitePolicies.
1813
1814         * Shared/WebsitePoliciesData.cpp:
1815         (WebKit::WebsitePoliciesData::encode const):
1816         (WebKit::WebsitePoliciesData::decode):
1817         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
1818         * Shared/WebsitePoliciesData.h:
1819         * UIProcess/API/APIWebsitePolicies.cpp:
1820         (API::WebsitePolicies::data):
1821         * UIProcess/API/APIWebsitePolicies.h:
1822         * UIProcess/API/Cocoa/WKWebView.mm:
1823         (-[WKWebView _simulateDeviceOrientationChangeWithAlpha:beta:gamma:]):
1824         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1825         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
1826         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
1827         (-[_WKWebsitePolicies setDeviceOrientationEventEnabled:]):
1828         (-[_WKWebsitePolicies deviceOrientationEventEnabled]):
1829         * UIProcess/WebPageProxy.cpp:
1830         (WebKit::WebPageProxy::simulateDeviceOrientationChange):
1831         * UIProcess/WebPageProxy.h:
1832         * WebProcess/WebPage/WebPage.cpp:
1833         (WebKit::WebPage::simulateDeviceOrientationChange):
1834         * WebProcess/WebPage/WebPage.h:
1835         * WebProcess/WebPage/WebPage.messages.in:
1836
1837 2019-01-04  Chris Dumez  <cdumez@apple.com>
1838
1839         Crash under WebPageProxy::continueNavigationInNewProcess()
1840         https://bugs.webkit.org/show_bug.cgi?id=193113
1841         <rdar://problem/46938686>
1842
1843         Reviewed by Brady Eidson.
1844
1845         The crash was happening in continueNavigationInNewProcess() when dereferencing
1846         the Optional<> value returned by API::Navigation::backForwardFrameLoadType(), after verifying
1847         that API::Navigation::targetItem() is not null.
1848
1849         When constructing an API::Navigation object with a targetItem, you HAVE to pass
1850         in a backForwardFrameLoadType as well so this normally is not possible. However,
1851         it can happen because API::Navigation::setTargetItem() can get called later on and
1852         set a target item on a Navigation object which potentially does not have a
1853         backForwardFrameLoadType. This setter was only called in one place in
1854         decidePolicyForNavigationAction() to update an existing Navigation object using
1855         the targetItem provided by a NavigationAction. This logic was added with PSON
1856         support.
1857
1858         Because I was unable to write a test case reproducing this and because I do not know
1859         how it can happen in practice that we'd have a NavigationAction with a targetItem
1860         even though the Navigation object itself is not for a back/forward navigation, I have
1861         chosen to drop the unsafe API::Navigation::setTargetItem() setter and the call site.
1862         When the call site was added, with ProcessSwap.NavigateToDataURLThenBack API test,
1863         the intention was to create a back/forward navigation object instead of a standard load
1864         navigation one if there is currently no existing Navigation object in the UIProcess.
1865         This can happen when the back/forward navigation is triggered by the WebProcess via
1866         JS (e.g. history.back()) and this is what the API test covers. The part of the logic
1867         that updates an existing Navigation object with a targetItem coming from the
1868         NavigationAction is untested and I have no evidence it does anything useful. However,
1869         we DO have evidence that it can cause crashes.
1870
1871         * UIProcess/API/APINavigation.h:
1872         * UIProcess/WebPageProxy.cpp:
1873         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1874
1875 2019-01-04  Tim Horton  <timothy_horton@apple.com>
1876
1877         Remove some nonexistent files from the WebKit Xcode project
1878
1879         * WebKit.xcodeproj/project.pbxproj:
1880         r238468 and r237205 forgot to remove some files from the project.
1881
1882 2019-01-04  Youenn Fablet  <youenn@apple.com>
1883
1884         CSP violation reports should bypass CSP checks
1885         https://bugs.webkit.org/show_bug.cgi?id=192857
1886         <rdar://problem/46887236>
1887
1888         Reviewed by Chris Dumez.
1889
1890         * WebProcess/Network/WebLoaderStrategy.cpp:
1891         (WebKit::WebLoaderStrategy::startPingLoad):
1892         * WebProcess/Network/WebLoaderStrategy.h:
1893
1894 2019-01-04  Alex Christensen  <achristensen@webkit.org>
1895
1896         Use WebsiteDataStoreParameters instead of NetworkProcessCreationParameters for IndexedDB directories
1897         https://bugs.webkit.org/show_bug.cgi?id=193114
1898
1899         Reviewed by Brady Eidson.
1900
1901         * NetworkProcess/NetworkProcess.cpp:
1902         (WebKit::NetworkProcess::initializeNetworkProcess):
1903         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1904         (WebKit::NetworkProcessCreationParameters::encode const):
1905         (WebKit::NetworkProcessCreationParameters::decode):
1906         * NetworkProcess/NetworkProcessCreationParameters.h:
1907         * UIProcess/WebProcessPool.cpp:
1908         (WebKit::WebProcessPool::ensureNetworkProcess):
1909
1910 2019-01-04  Alex Christensen  <achristensen@webkit.org>
1911
1912         Deprecate WKContextCreate
1913         https://bugs.webkit.org/show_bug.cgi?id=193118
1914
1915         Reviewed by Brady Eidson.
1916
1917         It has only one use that is being removed in rdar://problem/47030792
1918         This is a step towards removing ProcessPoolConfiguration::createWithLegacyOptions.
1919         Also make WKContextCreateWithConfiguration accept a null configuration to make it easier to use.
1920
1921         * UIProcess/API/C/WKContext.cpp:
1922         (WKContextCreateWithConfiguration):
1923         * UIProcess/API/C/WKContext.h:
1924
1925 2019-01-04  Tim Horton  <timothy_horton@apple.com>
1926
1927         Fix the build
1928
1929         * UIProcess/ios/WKContentViewInteraction.mm:
1930         (-[WKContentView cleanupInteraction]):
1931
1932 2019-01-04  Tim Horton  <timothy_horton@apple.com>
1933
1934         Share ink choice and ruler between all editable images
1935         https://bugs.webkit.org/show_bug.cgi?id=193130
1936         <rdar://problem/46826491>
1937
1938         Reviewed by Wenson Hsieh.
1939
1940         * SourcesCocoa.txt:
1941         Add WKDrawingCoordinator, which maintains WKWebView-wide drawing state,
1942         and manages a single shared ink picker.
1943
1944         * UIProcess/PageClient.h:
1945         (WebKit::PageClient::createDrawingView):
1946         * UIProcess/ios/EditableImageController.mm:
1947         (WebKit::EditableImageController::ensureEditableImage):
1948         * UIProcess/ios/PageClientImplIOS.h:
1949         * UIProcess/ios/PageClientImplIOS.mm:
1950         (WebKit::PageClientImpl::createDrawingView):
1951         Plumb WKDrawingView creation through PageClient, so that it can be instantiated
1952         with knowledge of its owning WKContentView.
1953
1954         * UIProcess/ios/WKContentViewInteraction.h:
1955         * UIProcess/ios/WKContentViewInteraction.mm:
1956         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
1957         (-[WKContentView _elementDidBlur]):
1958         (-[WKContentView _drawingCoordinator]):
1959         (-[WKContentView _installInkPickerForDrawingViewWithID:]): Deleted.
1960         (-[WKContentView _uninstallInkPicker]): Deleted.
1961         Move ink picker management into WKDrawingCoordinator.
1962
1963         * UIProcess/ios/WKDrawingView.h:
1964         * UIProcess/ios/WKDrawingView.mm:
1965         (-[WKDrawingView initWithEmbeddedViewID:contentView:]):
1966         (-[WKDrawingView _canvasViewWillBeginDrawing:]):
1967         (-[WKDrawingView invalidateAttachment]):
1968         (-[WKDrawingView didChangeRulerState:]):
1969         (-[WKDrawingView initWithEmbeddedViewID:webPageProxy:]): Deleted.
1970         (-[WKDrawingView canvasView]): Deleted.
1971         Use a shared ruler, owned by WKDrawingCoordinator.
1972         Update the editable image's ink when drawing begins. This way, we don't have
1973         to push ink changes to all drawings as they happen.
1974
1975         * UIProcess/ios/WKInkPickerView.h:
1976         * UIProcess/ios/WKInkPickerView.mm:
1977         (-[WKInkPickerView initWithContentView:]):
1978         (-[WKInkPickerView inlineInkPickerDidToggleRuler:]):
1979         (-[WKInkPickerView viewControllerForPopoverPresentationFromInlineInkPicker:]):
1980         (-[WKInkPickerView setInk:]):
1981         (-[WKInkPickerView ink]):
1982         (-[WKInkPickerView initWithDrawingView:]): Deleted.
1983         (-[WKInkPickerView didPickInk]): Deleted.
1984         (-[WKInkPickerView inlineInkPicker:didSelectTool:]): Deleted.
1985         (-[WKInkPickerView inlineInkPicker:didSelectColor:]): Deleted.
1986         * WebKit.xcodeproj/project.pbxproj:
1987
1988 2019-01-04  Wenson Hsieh  <wenson_hsieh@apple.com>
1989
1990         [Cocoa] Merge WebEditCommandProxy::nameForEditAction and undoNameForEditAction into a single function
1991         https://bugs.webkit.org/show_bug.cgi?id=193129
1992
1993         Reviewed by Tim Horton.
1994
1995         Remove WebEditCommandProxy::nameForEditAction and use WebCore::nameForUndoRedo instead.
1996
1997         * UIProcess/Cocoa/WebViewImpl.mm:
1998         (WebKit::WebViewImpl::registerEditCommand):
1999         * UIProcess/WebEditCommandProxy.cpp:
2000         (WebKit::WebEditCommandProxy::WebEditCommandProxy):
2001         (WebKit::WebEditCommandProxy::~WebEditCommandProxy):
2002         (WebKit::WebEditCommandProxy::nameForEditAction): Deleted.
2003         * UIProcess/WebEditCommandProxy.h:
2004         * UIProcess/WebPageProxy.cpp:
2005         (WebKit::WebPageProxy::addEditCommand):
2006         (WebKit::WebPageProxy::removeEditCommand):
2007         (WebKit::WebPageProxy::isValidEditCommand): Deleted.
2008
2009         Bit of drive-by refactoring: remove an unused function, and make addEditCommand and removeEditCommand take
2010         references instead of pointers, since these are assumed to be nonnull.
2011
2012         * UIProcess/WebPageProxy.h:
2013         * UIProcess/ios/PageClientImplIOS.mm:
2014         (WebKit::PageClientImpl::registerEditCommand):
2015
2016 2019-01-03  Matt Rajca  <mrajca@apple.com>
2017
2018         Make DidPlayMediaPreventedFromPlaying autoplay event more generic.
2019         https://bugs.webkit.org/show_bug.cgi?id=193128
2020         rdar://34554231
2021
2022         Reviewed by Jer Noble.
2023
2024         Today, the "DidPlayMediaPreventedFromPlaying" autoplay event is only sent for
2025         media prevented from autoplaying. It could be generalized to a "DidPlayMediaWithUserGesture"
2026         event along with a flag that indicates whether or not autoplay was actually prevented.
2027
2028         Tests: existing API tests were updated to reflect the new names. New API tests
2029         were added for the new case in which the "DidPlayMediaWithUserGesture" event is sent.
2030
2031         * Shared/WebCoreArgumentCoders.h: Take into account new flags.
2032         * UIProcess/API/C/WKPage.cpp: Ditto.
2033         (WKPageSetPageUIClient):
2034         * UIProcess/API/C/WKPageUIClient.h: Ditto.
2035         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Ditto.
2036         * UIProcess/Cocoa/UIDelegate.mm: Ditto.
2037         (WebKit::toWKAutoplayEventFlags):
2038         (WebKit::toWKAutoplayEvent):
2039
2040 2019-01-04  Fujii Hironori  <Hironori.Fujii@sony.com>
2041
2042         [curl] Move cookiePersistentStorageFile from NetworkProcessCreationParameters to NetworkSessionCreationParameters
2043         https://bugs.webkit.org/show_bug.cgi?id=192970
2044
2045         Reviewed by Alex Christensen.
2046
2047         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2048         (WebKit::NetworkProcessCreationParameters::encode const): Removed code for cookiePersistentStorageFile.
2049         (WebKit::NetworkProcessCreationParameters::decode): Ditto.
2050         * NetworkProcess/NetworkProcessCreationParameters.h: Ditto.
2051         * NetworkProcess/curl/NetworkProcessCurl.cpp:
2052         (WebKit::NetworkProcess::platformInitializeNetworkProcess): Ditto.
2053
2054         * NetworkProcess/NetworkSessionCreationParameters.cpp:
2055         (WebKit::NetworkSessionCreationParameters::privateSessionParameters): Added code for cookiePersistentStorageFile.
2056         (WebKit::NetworkSessionCreationParameters::encode const): Ditto.
2057         (WebKit::NetworkSessionCreationParameters::decode): Ditto.
2058         * NetworkProcess/NetworkSessionCreationParameters.h: Ditto.
2059         * NetworkProcess/curl/NetworkSessionCurl.cpp:
2060         (WebKit::NetworkSessionCurl::NetworkSessionCurl): Ditto.
2061
2062         * NetworkProcess/Cookies/WebCookieManager.h: Removed setCookiePersistentStorage method of curl port extension.
2063         * NetworkProcess/Cookies/curl/WebCookieManagerCurl.cpp:
2064         (WebKit::WebCookieManager::setCookiePersistentStorage): Deleted.
2065
2066 2019-01-04  Chris Dumez  <cdumez@apple.com>
2067
2068         [PSON] Calling history.back() from inside the load event handler prevents process-swapping
2069         https://bugs.webkit.org/show_bug.cgi?id=193120
2070
2071         Reviewed by Alex Christensen.
2072
2073         A HistoryItem is created only *after* we've fired the load event. As a result, if you call
2074         history.back() in JS from inside the load event handler, the current HistoryItem and and
2075         the target HistoryItem will be the same. This is normally not an issue. However, there was
2076         logic inside of WebProcessPool::processForNavigationInternal() which would compare the
2077         processID of the source and destination BackForwardListItems and which would force a process
2078         reuse if both BackForwardListItems came from the same WebContent process. So even though
2079         we swapped when doing a standard load from site A to site B, we would fail to swap if site
2080         B called history.back() from inside its load event handler.
2081
2082         To address the issue, stop relying on the source backforward item's processID. Instead, just
2083         use the WebContent process matching the destination backforward item's processID if it still
2084         exists.
2085
2086         * UIProcess/WebProcessPool.cpp:
2087         (WebKit::WebProcessPool::processForNavigationInternal):
2088
2089 2019-01-04  Keith Rollin  <krollin@apple.com>
2090
2091         Bring back parent processID for logging
2092         https://bugs.webkit.org/show_bug.cgi?id=193121
2093         <rdar://problem/47031634>
2094
2095         Reviewed by Alex Christensen.
2096
2097         Bug 192961 removes presentingApplicationPID from
2098         NetworkProcessCreationParameters because it was (a) stored in some
2099         global state, the use of which is being minimized, and (b) it was
2100         largely unused. However, it was actually still being used in some
2101         useful logging in order to tie together child processes with their
2102         parent process. Re-introduce this value in NetworkLoadParameters so
2103         that we can log it.
2104
2105         * NetworkProcess/NetworkLoadParameters.h:
2106         * NetworkProcess/NetworkResourceLoadParameters.cpp:
2107         (WebKit::NetworkResourceLoadParameters::encode const):
2108         (WebKit::NetworkResourceLoadParameters::decode):
2109         * NetworkProcess/NetworkResourceLoader.cpp:
2110         (WebKit::NetworkResourceLoader::start):
2111         * WebProcess/Network/WebLoaderStrategy.cpp:
2112         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
2113         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
2114         (WebKit::WebLoaderStrategy::startPingLoad):
2115         (WebKit::WebLoaderStrategy::preconnectTo):
2116
2117 2019-01-04  Youenn Fablet  <youenn@apple.com>
2118
2119         Make RestrictedHTTPResponseAccess an internal flag
2120         https://bugs.webkit.org/show_bug.cgi?id=193145
2121
2122         Reviewed by Chris Dumez.
2123
2124         * Shared/WebPreferences.yaml: This will ease debugging.
2125
2126 2019-01-04  Per Arne Vollan  <pvollan@apple.com>
2127
2128         [iOS] Enable logging for services in sandbox
2129         https://bugs.webkit.org/show_bug.cgi?id=192705
2130
2131         Reviewed by Brent Fulgham.
2132
2133         When running layout tests, we didn’t see 107 services being looked up through launchd. We should
2134         add logging to these services to determine which services we actually need in the sandbox.
2135
2136         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2137
2138 2019-01-04  Commit Queue  <commit-queue@webkit.org>
2139
2140         Unreviewed, rolling out r239603.
2141         https://bugs.webkit.org/show_bug.cgi?id=193146
2142
2143         Breaks shipping tests (Requested by bfulgha__ on #webkit).
2144
2145         Reverted changeset:
2146
2147         "[iOS] Update sandbox profile to use iconservices instead of
2148         lsdiconservice"
2149         https://bugs.webkit.org/show_bug.cgi?id=193115
2150         https://trac.webkit.org/changeset/239603
2151
2152 2019-01-04  Chris Dumez  <cdumez@apple.com>
2153
2154         Crash under WebProcessPool::addSuspendedPage()
2155         https://bugs.webkit.org/show_bug.cgi?id=193110
2156
2157         Reviewed by Youenn Fablet.
2158
2159         When PageCache is disabled, WebProcessPool::m_maxSuspendedPageCount is 0 and WebProcessPool::addSuspendedPage()
2160         would call m_suspendedPages.removeFirst() even though m_suspendedPages is empty, causing a crash.
2161         Do an early return when m_maxSuspendedPageCount is 0 since we do not want to add any suspended page in this
2162         case.
2163
2164         * UIProcess/WebProcessPool.cpp:
2165         (WebKit::WebProcessPool::addSuspendedPage):
2166
2167 2019-01-03  Brent Fulgham  <bfulgham@apple.com>
2168
2169         [iOS] Silently deny access to mail settings triggered by MessageUI framework
2170         https://bugs.webkit.org/show_bug.cgi?id=193123
2171         <rdar://problem/42485581>
2172
2173         Reviewed by Alexey Proskuryakov.
2174
2175         Remove unhelpful logging generated when we block access to non-WebKit preferences. These
2176         invalid checks are done by an system framework that we cannot modify.
2177
2178         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2179
2180 2019-01-03  Brent Fulgham  <bfulgham@apple.com>
2181
2182         [iOS] Update sandbox profile to use iconservices instead of lsdiconservice
2183         https://bugs.webkit.org/show_bug.cgi?id=193115
2184         <rdar://problem/44867379>
2185
2186         Reviewed by Eric Carlson.
2187
2188         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2189
2190 2019-01-03  Brent Fulgham  <bfulgham@apple.com>
2191
2192         Remove logic handling DNT header during redirects
2193         https://bugs.webkit.org/show_bug.cgi?id=193082
2194         <rdar://problem/45555965>
2195
2196         Reviewed by Chris Dumez.
2197
2198         Test: http/wpt/fetch/dnt-header-after-redirection.html.
2199
2200         Don't bother looking for (or passing along) DNT headers during redirects.
2201
2202         * NetworkProcess/NetworkLoadChecker.cpp:
2203         (WebKit::NetworkLoadChecker::check):
2204         (WebKit::NetworkLoadChecker::prepareRedirectedRequest): Deleted.
2205         * NetworkProcess/NetworkLoadChecker.h:
2206         * NetworkProcess/NetworkResourceLoader.cpp:
2207         (WebKit::NetworkResourceLoader::restartNetworkLoad):
2208         (WebKit::NetworkResourceLoader::continueWillSendRequest):
2209         * NetworkProcess/PingLoad.cpp:
2210         (WebKit::PingLoad::willPerformHTTPRedirection):
2211
2212 2019-01-03  Chris Dumez  <cdumez@apple.com>
2213
2214         Add release logging to help debug HTTPS upgrade issues
2215         https://bugs.webkit.org/show_bug.cgi?id=193075
2216
2217         Reviewed by Alex Christensen.
2218
2219         Add release logging to help debug HTTPS upgrade issues like Bug 193026.
2220
2221         * NetworkProcess/NetworkHTTPSUpgradeChecker.cpp:
2222         (WebKit::NetworkHTTPSUpgradeChecker::NetworkHTTPSUpgradeChecker):
2223         (WebKit::NetworkHTTPSUpgradeChecker::query):
2224
2225 2019-01-03  Alex Christensen  <achristensen@webkit.org>
2226
2227         NetworkProcess should initialize its default NetworkSession with parameters from the UIProcess
2228         https://bugs.webkit.org/show_bug.cgi?id=192967
2229
2230         Reviewed by Brent Fulgham.
2231
2232         I moved 3 of the NetworkProcessCreationParameters to use corresponding values of a WebsiteDataStoreParameters.
2233         More will be moved in the near future, like indexedDatabaseDirectory.
2234
2235         * NetworkProcess/NetworkProcess.cpp:
2236         (WebKit::NetworkProcess::initializeNetworkProcess):
2237         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2238         (WebKit::NetworkProcessCreationParameters::encode const):
2239         (WebKit::NetworkProcessCreationParameters::decode):
2240         * NetworkProcess/NetworkProcessCreationParameters.h:
2241         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2242         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2243         * UIProcess/WebProcessPool.cpp:
2244         (WebKit::WebProcessPool::ensureNetworkProcess):
2245
2246 2019-01-03  Wenson Hsieh  <wenson_hsieh@apple.com>
2247
2248         [iOS] REGRESSION (r239441): Tab cycling to offscreen <select> may not scroll it into view
2249         https://bugs.webkit.org/show_bug.cgi?id=193084
2250         <rdar://problem/47006882>
2251
2252         Reviewed by Simon Fraser.
2253
2254         In `WKWebView.mm`, `-_zoomToFocusRect:` will ignore the given selection rect if it is of size `{ 0, 0 }` and at
2255         the origin. Prior to r239441, when using the tab key to move focus between non-editable form controls (or any
2256         other method that doesn't involve tapping on the focused select element, with the exception of the next and
2257         previous buttons in the input accessory view), we would compute a selection rect of `{{ 0, 0 }, { 0, 0 }}`, and
2258         subsequently try to scroll the focused element to the center of the visible area, without taking the selection
2259         rect into account.
2260
2261         However, after r239441, the web process sends the element interaction location to the UI process, which then
2262         computes the selection rect by taking this location and adding a size of `{ 1, 1 }` (before r239441, this was
2263         done in `WebPage::getAssistedNodeInformation`). However, our new implementation doesn't take into account the
2264         case where the element interaction rect is null, which happens when the last interaction location is outside of
2265         the bounding rect of the element. In this case, we set the element interaction location to { 0, 0 } and end up
2266         computing a selection rect of `{{ 0, 0 }, { 1, 1 }}` instead of `{{ 0, 0 }, { 0, 0 }}` as we would have
2267         previously done. This causes us to scroll up to the origin, instead of revealing the focused element.
2268
2269         To fix this, we restore the pre-r239441 behavior. See additional comments below for details.
2270
2271         Test: fast/forms/ios/scroll-to-reveal-focused-select.html
2272
2273         * Shared/FocusedElementInformation.cpp:
2274         (WebKit::FocusedElementInformation::encode const):
2275         (WebKit::FocusedElementInformation::decode):
2276         * Shared/FocusedElementInformation.h:
2277
2278         Rename `elementInteractionLocation` to `lastInteractionLocation`. This was previously
2279         `elementInteractionLocation` due to existing logic that tries to move the interaction location into the bounding
2280         rect of the element in the case where visual viewports are disabled; however, since this feature has long been
2281         enabled by default for all modern WebKit clients (internal and external), it's simpler to just use always send
2282         the last interaction location over to the UI process, and have the UI process use `{{ 0, 0 }, { 0, 0 }}` if
2283         the interaction location is outside of the element rect.
2284
2285         In the very unlikely event that any modern WebKit client disables visual viewports, this will still behave
2286         reasonably, since we'll just use `{{ 0, 0 }, { 0, 0 }}` as the target rect and scroll to reveal the entire
2287         element rather than the top left corner of the element.
2288
2289         * UIProcess/ios/WKContentViewInteraction.mm:
2290         (rectToRevealWhenZoomingToFocusedElement):
2291         * WebProcess/WebPage/ios/WebPageIOS.mm:
2292
2293         Move the check for whether the interaction location is inside the element's bounding rect from the web process
2294         to the UI process. This relocates the logic to determine whether the selection rect should be a 1 by 1 fallback
2295         interaction rect or the zero rect (`{{ 0, 0 }, { 0, 0 }}`) closer to the code that actually uses this rect.
2296
2297         (WebKit::WebPage::getFocusedElementInformation):
2298
2299 2019-01-03  Wenson Hsieh  <wenson_hsieh@apple.com>
2300
2301         WebUndoStep's monotonically increasing identifier should be a WebUndoStepID instead of uint64_t
2302         https://bugs.webkit.org/show_bug.cgi?id=193100
2303
2304         Reviewed by Simon Fraser.
2305
2306         Add a type alias, WebUndoStepID, to represent the monotonically increasing undo step ID for each undoable
2307         editing command, and use this type alias in lieu of `uint64_t`. No change in behavior.
2308
2309         * UIProcess/WebEditCommandProxy.cpp:
2310         (WebKit::WebEditCommandProxy::WebEditCommandProxy):
2311         * UIProcess/WebEditCommandProxy.h:
2312         (WebKit::WebEditCommandProxy::create):
2313         (WebKit::WebEditCommandProxy::commandID const):
2314         * UIProcess/WebPageProxy.cpp:
2315         (WebKit::WebPageProxy::registerEditCommandForUndo):
2316         * UIProcess/WebPageProxy.h:
2317         * WebKit.xcodeproj/project.pbxproj:
2318         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2319         (WebKit::WebEditorClient::registerUndoStep):
2320
2321         Store the step ID in a temporary variable, since `webUndoStep` is now moved when calling `addWebUndoStep`.
2322
2323         * WebProcess/WebPage/WebPage.cpp:
2324         (WebKit::WebPage::webUndoStep):
2325         (WebKit::WebPage::addWebUndoStep):
2326
2327         Make this take a `Ref<WebUndoStep>&&` instead of a `WebUndoStep*`, and use move semantics to transfer the
2328         given `Ref` to the table.
2329
2330         (WebKit::WebPage::removeWebEditCommand):
2331         (WebKit::WebPage::unapplyEditCommand):
2332         (WebKit::WebPage::reapplyEditCommand):
2333
2334         Use `auto*` in a couple of places.
2335
2336         (WebKit::WebPage::didRemoveEditCommand):
2337         * WebProcess/WebPage/WebPage.h:
2338         * WebProcess/WebPage/WebUndoStep.cpp:
2339         (WebKit::generateUndoStep):
2340         * WebProcess/WebPage/WebUndoStep.h:
2341         (WebKit::WebUndoStep::stepID const):
2342         (WebKit::WebUndoStep::WebUndoStep):
2343         * WebProcess/WebPage/WebUndoStepID.h: Copied from Source/WebKit/WebProcess/WebPage/WebUndoStep.cpp.
2344
2345 2019-01-02  Wenson Hsieh  <wenson_hsieh@apple.com>
2346
2347         Add support for using the current text selection as the find string on iOS
2348         https://bugs.webkit.org/show_bug.cgi?id=193034
2349         <rdar://problem/45138739>
2350
2351         Reviewed by Tim Horton.
2352
2353         * SourcesCocoa.txt:
2354         * UIProcess/API/Cocoa/WKWebView.mm:
2355         (-[WKWebView _takeFindStringFromSelection:]):
2356
2357         Provides a way to set the find string on iOS and macOS (an aside: takeFindStringFromSelection: already exists on
2358         macOS, but there is no equivalent protocol method on iOS, so this new SPI acts as a cross-platform way for
2359         WebKit clients to take the find string from the selection across all Cocoa platforms).
2360
2361         (+[WKWebView _stringForFind]):
2362         (+[WKWebView _setStringForFind:]):
2363
2364         Call into find-in-page helper functions.
2365
2366         (-[WKWebView _findString:options:maxCount:]):
2367
2368         On iOS, additionally update the find-in-page string when exercising the _findString:options:maxCount: SPI. This
2369         mirrors macOS behavior of updating the find pasteboard every time the find string changes; however, on macOS,
2370         this is implemented by the platform (in AppKit), whereas there's no platform find pasteboard on iOS, let alone
2371         logic to update it in UIKit. As such, we directly drive updates to the find string within WebKit.
2372
2373         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2374
2375         Add some new cross-platform find-in-page SPI. See above for more details.
2376
2377         * UIProcess/Cocoa/GlobalFindInPageState.h: Added.
2378         * UIProcess/Cocoa/GlobalFindInPageState.mm: Added.
2379         (WebKit::findPasteboard):
2380         (WebKit::globalStringForFind):
2381
2382         Fetch the string to use when finding text in the page. On macOS, this accesses the AppKit find pasteboard; on
2383         iOS, this instead returns the current global find string.
2384
2385         (WebKit::updateStringForFind):
2386
2387         Sets the global find string. Uses the find pasteboard on macOS, and sets the global find string on iOS.
2388
2389         (WebKit::stringForFind):
2390         * UIProcess/WebPageProxy.h:
2391         * UIProcess/WebPageProxy.messages.in:
2392
2393         Add plumbing to allow WebEditorClient to deliver the update the global find string in the UI process.
2394
2395         * UIProcess/ios/WebPageProxyIOS.mm:
2396         (WebKit::WebPageProxy::updateStringForFind):
2397         * WebKit.xcodeproj/project.pbxproj:
2398         * WebProcess/WebCoreSupport/WebEditorClient.h:
2399         * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
2400         (WebKit::WebEditorClient::updateStringForFind):
2401         * WebProcess/WebPage/WebPage.h:
2402         * WebProcess/WebPage/ios/WebPageIOS.mm:
2403         (WebKit::WebPage::updateStringForFind):
2404
2405 2019-01-02  Brent Fulgham  <bfulgham@apple.com>
2406
2407         Allow WebContent process access to some drawing-related IOKit properties
2408         https://bugs.webkit.org/show_bug.cgi?id=193086
2409         <rdar://problem/46568088>
2410
2411         Reviewed by Eric Carlson.
2412
2413         Update the iOS WebContent process sandbox to allow access to some IOKit properties
2414         that are needed for drawing and media playback operations.
2415
2416         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2417         * WebProcess/com.apple.WebKit.WebContent.sb.in:
2418
2419 2019-01-02  Brent Fulgham  <bfulgham@apple.com>
2420
2421         Remove unused logging service 
2422         https://bugs.webkit.org/show_bug.cgi?id=193081
2423         <rdar://problem/40414815>
2424
2425         Reviewed by Alexey Proskuryakov.
2426
2427         We don't use this logging service, so don't open an exception for it.
2428
2429         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2430
2431 2019-01-02  Brent Fulgham  <bfulgham@apple.com>
2432
2433         Remove temporary workaround for CVMS code signing objects
2434         https://bugs.webkit.org/show_bug.cgi?id=193079
2435         <rdar://problem/40139202>
2436
2437         Reviewed by Alexey Proskuryakov.
2438
2439         * WebProcess/com.apple.WebProcess.sb.in:
2440
2441 2019-01-02  Wenson Hsieh  <wenson_hsieh@apple.com>
2442
2443         REGRESSION (r239441): [iOS] Selection UI sometimes doesn't change after tapping "select all" in the callout bar
2444         https://bugs.webkit.org/show_bug.cgi?id=193070
2445         <rdar://problem/46921508>
2446
2447         Reviewed by Tim Horton.
2448
2449         r239441 added logic to include an EditorState in the next layer tree commit when refocusing an element; this was
2450         done to ensure that after tapping an element that has already been programmatically focused, we still send up-
2451         to-date editor information to the UI process for the purposes of zooming to the selection rect, even if the
2452         selection in the DOM is unchanged, since other aspects of the editor state may have changed since the element
2453         was initially focused.
2454
2455         We currently try to flag the next layer tree commit by setting `m_hasPendingEditorStateUpdate` to `true`.
2456         However, this is problematic since we aren't guaranteed in all cases that a compositing flush has been
2457         scheduled. In the case where it hasn't, we'll end up in a state where the editor state update flag has been set,
2458         yet the update will not make it over to the UI process until something happens that forces a layer tree commit
2459         (e.g. scrolling, pinch zooming). Worse still, if the selection is then programmatically changed from the web
2460         process, we will bail from sending a subsequent editor state update to the UI process because `WebPage` thinks
2461         that a pending editor state has already been scheduled. This manifests in selection UI not updating after
2462         tapping "Select All" in the callout bar, if the callout bar was brought up by tapping near the selection (since
2463         this refocuses the element).
2464
2465         To fix this, we adjust this logic in `WebPage::elementDidRefocus` so that it sets the flag and then schedules a
2466         compositing flush, but only if the user is actually interacting with the focused element (i.e., if the page
2467         calls `focus` repeatedly, we won't continue to schedule compositing flushes).
2468
2469         Test: editing/selection/ios/change-selection-after-tapping-focused-element.html
2470
2471         * WebProcess/WebPage/WebPage.cpp:
2472         (WebKit::WebPage::elementDidRefocus):
2473         (WebKit::WebPage::sendEditorStateUpdate):
2474         (WebKit::WebPage::scheduleFullEditorStateUpdate):
2475
2476         Add a private helper method to schedule an editor state update by setting `m_hasPendingEditorStateUpdate` to
2477         `true` and then scheduling a compositing layer flush. Also, add a FIXME aluding to the fact that scheduling an
2478         entire compositing layer flush to send an editor state update is somewhat wasteful, and should be replaced by
2479         just scheduling this work to be done before the next frame (see: <rdar://problem/36523583> for more detail).
2480
2481         We also use this helper method in a few places where we currently turn on the editor state flag and schedule a
2482         subsequent compositing flush.
2483
2484         (WebKit::WebPage::sendPartialEditorStateAndSchedulePostLayoutUpdate):
2485         * WebProcess/WebPage/WebPage.h:
2486
2487 2019-01-02  Commit Queue  <commit-queue@webkit.org>
2488
2489         Unreviewed, rolling out r239524.
2490         https://bugs.webkit.org/show_bug.cgi?id=193083
2491
2492         basic browsing seems not to work (Requested by thorton on
2493         #webkit).
2494
2495         Reverted changeset:
2496
2497         "Expand use of sourceApplicationAuditData"
2498         https://bugs.webkit.org/show_bug.cgi?id=192995
2499         https://trac.webkit.org/changeset/239524
2500
2501 2019-01-01  Jeff Miller  <jeffm@apple.com>
2502
2503         Update user-visible copyright strings to include 2019
2504         https://bugs.webkit.org/show_bug.cgi?id=192811
2505
2506         Reviewed by Mark Lam.
2507
2508         * Info.plist:
2509         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX.plist:
2510         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-iOS.plist:
2511         * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist:
2512         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist:
2513         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist:
2514
2515 2018-12-28  Wenson Hsieh  <wenson_hsieh@apple.com>
2516
2517         Move WKEditCommandObjC and WKEditorUndoTargetObjC into a separate file
2518         https://bugs.webkit.org/show_bug.cgi?id=193049
2519
2520         Reviewed by Sam Weinig.
2521
2522         Pull common code (WKEditCommandObjC and WKEditorUndoTargetObjC) on iOS and macOS out into a separate file. No
2523         change in behavior.
2524
2525         * SourcesCocoa.txt:
2526         * UIProcess/Cocoa/WKEditCommand.h: Added.
2527         * UIProcess/Cocoa/WKEditCommand.mm: Added.
2528
2529         Rename WKEditCommandObjC to WKEditCommand, and WKEditorUndoTargetObjC to WKEditorUndoTarget. The ObjC suffix in
2530         the name seems to diverge from the common naming scheme in other parts of WebKit, where most WK- and _WK-
2531         prefixed names already refer to Objective-C objects. Additionally, mark -[WKEditCommand init] as unavailable.
2532
2533         (-[WKEditCommand initWithWebEditCommandProxy:]):
2534
2535         Make the return type instancetype instead of id, and also make this take a Ref<WebEditCommandProxy>&& instead
2536         of a RefPtr.
2537
2538         (-[WKEditCommand command]):
2539
2540         Make this return a reference to the WebEditCommandProxy, rather than a pointer, since the WebEditCommandProxy
2541         should always be non-null.
2542
2543         (-[WKEditorUndoTarget undoEditing:]):
2544         (-[WKEditorUndoTarget redoEditing:]):
2545         * UIProcess/Cocoa/WebViewImpl.h:
2546         * UIProcess/Cocoa/WebViewImpl.mm:
2547         (WebKit::WebViewImpl::WebViewImpl):
2548         (WebKit::WebViewImpl::registerEditCommand):
2549
2550         Use WTFMove instead of copying the Ref when creating a WKEditCommand.
2551
2552         (-[WKEditCommandObjC initWithWebEditCommandProxy:]): Deleted.
2553         (-[WKEditCommandObjC command]): Deleted.
2554         (-[WKEditorUndoTargetObjC undoEditing:]): Deleted.
2555         (-[WKEditorUndoTargetObjC redoEditing:]): Deleted.
2556         * UIProcess/ios/PageClientImplIOS.h:
2557         * UIProcess/ios/PageClientImplIOS.mm:
2558         (WebKit::PageClientImpl::PageClientImpl):
2559         (WebKit::PageClientImpl::registerEditCommand):
2560
2561         Use WTFMove instead of creating a new RefPtr when creating a WKEditCommand.
2562
2563         (-[WKEditCommandObjC initWithWebEditCommandProxy:]): Deleted.
2564         (-[WKEditCommandObjC command]): Deleted.
2565         (-[WKEditorUndoTargetObjC undoEditing:]): Deleted.
2566         (-[WKEditorUndoTargetObjC redoEditing:]): Deleted.
2567         * UIProcess/mac/PageClientImplMac.h:
2568         * WebKit.xcodeproj/project.pbxproj:
2569
2570 2018-12-27  Alex Christensen  <achristensen@webkit.org>
2571
2572         Resurrect Mac CMake build
2573         https://bugs.webkit.org/show_bug.cgi?id=192658
2574
2575         Reviewed by Yusuke Suzuki.
2576
2577         * PlatformMac.cmake:
2578
2579 2018-12-26  Fujii Hironori  <Hironori.Fujii@sony.com>
2580
2581         [MSVC] error C2381: 'WebKit::NetworkHTTPSUpgradeChecker::~NetworkHTTPSUpgradeChecker': redefinition; '__declspec(noreturn)' or '[[noreturn]]' differs
2582         https://bugs.webkit.org/show_bug.cgi?id=193030
2583
2584         Reviewed by Ross Kirsling.
2585
2586         Windows Debug builds are failing to compile due to
2587         NO_RETURN_DUE_TO_ASSERT inconsistency of
2588         NetworkHTTPSUpgradeChecker destructor's definition and
2589         declaration.
2590
2591         * NetworkProcess/NetworkHTTPSUpgradeChecker.h: Added
2592         NO_RETURN_DUE_TO_ASSERT to NetworkHTTPSUpgradeChecker destructor
2593         declaration.
2594         * NetworkProcess/NetworkHTTPSUpgradeChecker.cpp: Removed
2595         NO_RETURN_DUE_TO_ASSERT from the definition.
2596
2597 2018-12-24  Fujii Hironori  <Hironori.Fujii@sony.com>
2598
2599         [WebKit][Win] Remove using namespace in the global scope
2600         https://bugs.webkit.org/show_bug.cgi?id=192968
2601
2602         Reviewed by Alex Christensen.
2603
2604         Moved using namespace statements in the global scope to inside
2605         namespaces.
2606         <https://webkit.org/code-style-guidelines/#using-position>
2607
2608         * NetworkProcess/Cookies/curl/WebCookieManagerCurl.cpp:
2609         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
2610         * NetworkProcess/curl/NetworkProcessCurl.cpp:
2611         * NetworkProcess/curl/NetworkSessionCurl.cpp:
2612         * NetworkProcess/curl/RemoteNetworkingContextCurl.cpp:
2613         * Shared/Plugins/Netscape/NetscapePluginModuleNone.cpp:
2614         * Shared/WebWheelEvent.cpp:
2615         * Shared/curl/WebCoreArgumentCodersCurl.cpp:
2616         * Shared/win/NativeWebKeyboardEventWin.cpp:
2617         * Shared/win/WebEventFactory.cpp:
2618         * UIProcess/Automation/WebAutomationSession.cpp:
2619
2620 2018-12-24  Fujii Hironori  <Hironori.Fujii@sony.com>
2621
2622         Remove "using namespace std;"
2623         https://bugs.webkit.org/show_bug.cgi?id=192973
2624
2625         Reviewed by Alex Christensen.
2626
2627         * Platform/IPC/win/ConnectionWin.cpp:
2628
2629 2018-12-24  Simon Fraser  <simon.fraser@apple.com>
2630
2631         Change ScrollingNodeType to an enum class
2632         https://bugs.webkit.org/show_bug.cgi?id=193009
2633
2634         Reviewed by Zalan Bujtas.
2635
2636         Change the ScrollingNodeType enum to an enum class.
2637         
2638         No behavior change.
2639
2640         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
2641         (WebKit::encodeNodeAndDescendants):
2642         (WebKit::RemoteScrollingCoordinatorTransaction::decode):
2643         (WebKit::dump):
2644         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
2645         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
2646         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
2647         (WebKit::RemoteScrollingTree::createScrollingTreeNode):
2648         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
2649         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
2650         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
2651         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll):
2652
2653 2018-12-23  Wenson Hsieh  <wenson_hsieh@apple.com>
2654
2655         [iOS] Remove some unnecessary editing SPI after <rdar://problem/46047546>
2656         https://bugs.webkit.org/show_bug.cgi?id=193019
2657
2658         Reviewed by Dan Bernstein.
2659
2660         Remove these SPI method declarations, as well as method forwarding in WKContentView. Mail was the only adoptee
2661         of these methods; after <rdar://problem/46047546>, they have moved to the underscore-prefixed versions, so we
2662         we have no need for these erroneously-named SPI methods anymore. There is no change in behavior; verified this
2663         through existing API tests (WKWebViewEditActions), as well as building iOS Mail against WebKit with these
2664         changes to WKWebViewPrivate.h.
2665
2666         * UIProcess/API/Cocoa/WKWebView.mm:
2667         (-[WKWebView canPerformAction:withSender:]):
2668         (-[WKWebView targetForAction:withSender:]):
2669         (-[WKWebView _setFont:sender:]):
2670         (-[WKWebView _setFontSize:sender:]):
2671         (-[WKWebView _setTextColor:sender:]):
2672         (-[WKWebView setFont:sender:]): Deleted.
2673         (-[WKWebView setTextColor:sender:]): Deleted.
2674         (-[WKWebView setFontSize:sender:]): Deleted.
2675         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2676         * UIProcess/ios/WKContentViewInteraction.h:
2677         * UIProcess/ios/WKContentViewInteraction.mm:
2678         (-[WKContentView canPerformActionForWebView:withSender:]):
2679         (-[WKContentView setFontForWebView:sender:]): Deleted.
2680         (-[WKContentView setFontSizeForWebView:sender:]): Deleted.
2681         (-[WKContentView setTextColorForWebView:sender:]): Deleted.
2682
2683 2018-12-23  Wenson Hsieh  <wenson_hsieh@apple.com>
2684
2685         Fix fast/ruby/ruby-base-merge-block-children-crash-2.html after r239543
2686         https://bugs.webkit.org/show_bug.cgi?id=193015
2687         <rdar://problem/46583527>
2688
2689         Reviewed by Tim Horton.
2690
2691         Fix the crash by gracefully handling integer overflow when computing the area of a very large editable element.
2692
2693         * UIProcess/ios/WKContentViewInteraction.mm:
2694         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
2695         (-[WKContentView _updateChangedSelection:]):
2696
2697 2018-12-22  Wenson Hsieh  <wenson_hsieh@apple.com>
2698
2699         [iOS] Suppress native selection behaviors when focusing a very small editable element
2700         https://bugs.webkit.org/show_bug.cgi?id=193005
2701         <rdar://problem/46583527>
2702
2703         Reviewed by Tim Horton.
2704
2705         In r238146, I added a mechanism to detect when the selection is hidden within transparent editable elements, and
2706         used this to suppress native selection on iOS (such as selection handles, highlight, callout bar, etc.) to avoid
2707         conflicts between the page's editing UI and the platform.
2708
2709         However, one additional technique observed on some websites involves hiding the selection by moving it into a
2710         tiny (1x1) editable element. Here, we currently still present a callout bar with editing actions, as well as
2711         show a selection caret or handles on iOS. To fix this, we extend the mechanism added in r238146 by also
2712         suppressing the selection assistant in the case where the editable element's area is beneath a tiny minimum
2713         threshold.
2714
2715         Test: editing/selection/ios/hide-selection-in-tiny-contenteditable.html
2716
2717         * Shared/EditorState.cpp:
2718         (WebKit::EditorState::PostLayoutData::encode const):
2719         (WebKit::EditorState::PostLayoutData::decode):
2720         (WebKit::operator<<):
2721         * Shared/EditorState.h:
2722
2723         Rename selectionClipRect to focusedElementRect. We currently propagate the bounds of the focused element to the
2724         UI process through EditorState updates, but only for the purpose of returning it in the computed selection clip
2725         rect; instead, rename this member to something more general-purpose, so we can also use it when determining
2726         whether to suppress the selection assistant.
2727
2728         * UIProcess/API/Cocoa/WKWebView.mm:
2729         (-[WKWebView _candidateRect]):
2730         * UIProcess/Cocoa/WebViewImpl.mm:
2731         (WebKit::WebViewImpl::handleRequestedCandidates):
2732         * UIProcess/ios/WKContentViewInteraction.h:
2733
2734         Add a new SuppressSelectionAssistantReason that corresponds to focusing tiny editable elements.
2735
2736         * UIProcess/ios/WKContentViewInteraction.mm:
2737         (-[WKContentView _zoomToRevealFocusedElement]):
2738         (-[WKContentView _selectionClipRect]):
2739         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
2740         (-[WKContentView _updateChangedSelection:]):
2741
2742         Check the size of the focused element, and begin or stop suppressing the selection assistant accordingly.
2743
2744         * WebProcess/WebPage/ios/WebPageIOS.mm:
2745         (WebKit::WebPage::platformEditorState const):
2746         * WebProcess/WebPage/mac/WebPageMac.mm:
2747         (WebKit::WebPage::platformEditorState const):
2748
2749 2018-12-20  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
2750
2751         Use Ref<> as much as possible
2752         https://bugs.webkit.org/show_bug.cgi?id=192808
2753
2754         Reviewed by Alex Christensen.
2755
2756         * PluginProcess/WebProcessConnection.cpp:
2757         (WebKit::WebProcessConnection::create):
2758         * PluginProcess/WebProcessConnection.h:
2759         * UIProcess/API/Cocoa/WKConnection.mm:
2760         (-[WKConnection sendMessageWithName:body:]):
2761         * UIProcess/API/Cocoa/WKWebView.mm:
2762         (-[WKWebView takeSnapshotWithConfiguration:completionHandler:]):
2763         (-[WKWebView _takeViewSnapshot]):
2764         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
2765         * UIProcess/API/glib/WebKitGeolocationProvider.cpp:
2766         (WebKit::WebKitGeolocationProvider::notifyPositionChanged):
2767         * UIProcess/API/glib/WebKitWebContext.cpp:
2768         (webkit_web_context_allow_tls_certificate_for_host):
2769         * UIProcess/Automation/cairo/WebAutomationSessionCairo.cpp:
2770         (WebKit::WebAutomationSession::platformGetBase64EncodedPNGData):
2771         * UIProcess/Automation/cocoa/WebAutomationSessionCocoa.mm:
2772         (WebKit::WebAutomationSession::platformGetBase64EncodedPNGData):
2773         * UIProcess/BackingStore.cpp:
2774         (WebKit::BackingStore::incorporateUpdate):
2775         * UIProcess/Cocoa/NavigationState.mm:
2776         (WebKit::createErrorWithRecoveryAttempter):
2777         * UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
2778         * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
2779         (WebKit::PlaybackSessionManagerProxy::create):
2780         * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
2781         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
2782         (WebKit::VideoFullscreenManagerProxy::create):
2783         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
2784         (WebKit::WebPasteboardProxy::setPasteboardBufferForType):
2785         * UIProcess/Cocoa/WebViewImpl.mm:
2786         (WebKit::WebViewImpl::takeViewSnapshot):
2787         * UIProcess/Downloads/DownloadProxyMap.cpp:
2788         (WebKit::DownloadProxyMap::createDownloadProxy):
2789         * UIProcess/Notifications/WebNotificationManagerProxy.cpp:
2790         (WebKit::WebNotificationManagerProxy::show):
2791         * UIProcess/WebPageProxy.cpp:
2792         (WebKit::WebPageProxy::didCreateSubframe):
2793         * UIProcess/WebProcessPool.cpp:
2794         (WebKit::WebProcessPool::getStatistics):
2795         (WebKit::WebProcessPool::requestWebContentStatistics):
2796         (WebKit::WebProcessPool::requestNetworkingStatistics):
2797         * UIProcess/WebProcessPool.h:
2798         * UIProcess/gstreamer/WebPageProxyGStreamer.cpp:
2799         (WebKit::WebPageProxy::requestInstallMissingMediaPlugins):
2800         * UIProcess/gtk/RemoteWebInspectorProxyGtk.cpp:
2801         (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
2802         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
2803         (WebKit::WebInspectorProxy::platformCreateFrontendPage):
2804         * UIProcess/ios/WKGeolocationProviderIOS.mm:
2805         (-[WKGeolocationProviderIOS geolocationAuthorizationGranted]):
2806         * UIProcess/mac/PageClientImplMac.mm:
2807         (WebKit::PageClientImpl::setPromisedDataForImage):
2808         * UIProcess/win/WebInspectorProxyWin.cpp:
2809         (WebKit::WebInspectorProxy::platformCreateFrontendPage):
2810         * WebProcess/InjectedBundle/API/mac/WKDOMRange.mm:
2811         (-[WKDOMRange initWithDocument:]):
2812         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
2813         (WebKit::InjectedBundleRangeHandle::renderedImage):
2814         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp:
2815         (WebKit::InjectedBundlePageEditorClient::getPasteboardDataForRange):
2816         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
2817         (WebKit::InjectedBundlePageUIClient::mouseDidMoveOverElement):
2818         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2819         (WebKit::NetscapePlugin::snapshot):
2820         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2821         (WebKit::PDFPlugin::addArchiveResource):
2822         (WebKit::PDFPlugin::snapshot):
2823         (WebKit::PDFPlugin::writeItemsToPasteboard):
2824         * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
2825         (WebKit::PluginProcessConnectionManager::getPluginProcessConnection):
2826         * WebProcess/Plugins/PluginProxy.cpp:
2827         (WebKit::PluginProxy::snapshot):
2828         * WebProcess/Plugins/PluginView.cpp:
2829         (WebKit::PluginView::performURLRequest):
2830         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2831         (WebKit::WebChromeClient::exceededDatabaseQuota):
2832         (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
2833         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2834         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
2835         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2836         (WebKit::WebPlatformStrategies::getPathnamesForType):
2837         * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
2838         (WebKit::convertCairoSurfaceToShareableBitmap):
2839         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
2840         (WebKit::WebDragClient::declareAndWriteDragImage):
2841         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
2842         (WebKit::WebPage::dictionaryPopupInfoForRange):
2843         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2844         (WebKit::DrawingAreaImpl::display):
2845         * WebProcess/WebPage/FindController.cpp:
2846         (WebKit::FindController::updateFindIndicator):
2847         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
2848         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
2849         * WebProcess/WebPage/WebFrame.cpp:
2850         (WebKit::WebFrame::webArchiveData):
2851         * WebProcess/WebPage/WebPage.cpp:
2852         (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick):
2853         (WebKit::WebPage::performDragControllerAction):
2854         * WebProcess/WebPage/ios/FindControllerIOS.mm:
2855         (WebKit::FindController::updateFindIndicator):
2856         * WebProcess/WebPage/ios/WebPageIOS.mm:
2857         (WebKit::WebPage::replaceDictatedText):
2858         (WebKit::WebPage::getPositionInformation):
2859         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2860         (WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom):
2861         * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
2862         (WebKit::StorageNamespaceImpl::createSessionStorageNamespace):
2863         (WebKit::StorageNamespaceImpl::createEphemeralLocalStorageNamespace):
2864         (WebKit::StorageNamespaceImpl::createLocalStorageNamespace):
2865         (WebKit::StorageNamespaceImpl::createTransientLocalStorageNamespace):
2866         (WebKit::StorageNamespaceImpl::storageArea):
2867         (WebKit::StorageNamespaceImpl::ephemeralLocalStorageArea):
2868         (WebKit::StorageNamespaceImpl::copy):
2869         * WebProcess/WebStorage/StorageNamespaceImpl.h:
2870         * WebProcess/WebStorage/WebStorageNamespaceProvider.cpp:
2871         (WebKit::WebStorageNamespaceProvider::getOrCreate):
2872         (WebKit::WebStorageNamespaceProvider::createSessionStorageNamespace):
2873         (WebKit::WebStorageNamespaceProvider::createEphemeralLocalStorageNamespace):
2874         (WebKit::WebStorageNamespaceProvider::createLocalStorageNamespace):
2875         (WebKit::WebStorageNamespaceProvider::createTransientLocalStorageNamespace):
2876         * WebProcess/WebStorage/WebStorageNamespaceProvider.h:
2877         * WebProcess/cocoa/PlaybackSessionManager.mm:
2878         (WebKit::PlaybackSessionManager::createModelAndInterface):
2879         * WebProcess/cocoa/VideoFullscreenManager.mm:
2880         (WebKit::VideoFullscreenManager::createModelAndInterface):
2881
2882 2018-12-21  Chris Dumez  <cdumez@apple.com>
2883
2884         navigator.userAgent in service workers does not reflect customUserAgent set by client
2885         https://bugs.webkit.org/show_bug.cgi?id=192951
2886
2887         Reviewed by Youenn Fablet.
2888
2889         * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
2890         (WebKit::WebSWServerConnection::registerServiceWorkerClient):
2891         * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
2892         * NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in:
2893         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
2894         (WebKit::WebSWServerToContextConnection::installServiceWorkerContext):
2895         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
2896         * WebProcess/Storage/WebSWClientConnection.cpp:
2897         (WebKit::WebSWClientConnection::registerServiceWorkerClient):
2898         * WebProcess/Storage/WebSWClientConnection.h:
2899         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2900         (WebKit::WebSWContextManagerConnection::installServiceWorker):
2901         * WebProcess/Storage/WebSWContextManagerConnection.h:
2902         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
2903
2904 2018-12-21  Alex Christensen  <achristensen@webkit.org>
2905
2906         Expand use of sourceApplicationAuditData
2907         https://bugs.webkit.org/show_bug.cgi?id=192995
2908         <rdar://problem/46627875>
2909
2910         Reviewed by Brady Eidson.
2911
2912         sourceApplicationAuditData has been used for a long time on iOS, but it's needed on more platforms.
2913         I also made it return an Optional instead of a bool and returning by reference. Ahhh. So much nicer.
2914
2915         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2916         (WebKit::NetworkProcess::sourceApplicationAuditData const):
2917         * Platform/IPC/Connection.h:
2918         * Platform/IPC/mac/ConnectionMac.mm:
2919         (IPC::Connection::getAuditToken):
2920         * WebProcess/WebProcess.cpp:
2921         (WebKit::WebProcess::initializeWebProcess):
2922         * WebProcess/cocoa/WebProcessCocoa.mm:
2923         (WebKit::WebProcess::sourceApplicationAuditData const):
2924
2925 2018-12-21  Jiewen Tan  <jiewen_tan@apple.com>
2926
2927         [Mac] Layout Test http/wpt/webauthn/public-key-credential-create-success-hid.https.html and http/wpt/webauthn/public-key-credential-get-success-hid.https.html are flaky
2928         https://bugs.webkit.org/show_bug.cgi?id=192061
2929
2930         Reviewed by Dewei Zhu.
2931
2932         Part 5.
2933
2934         Add some additional temporary logging info to determine if the time out value passed to the timer is respected.
2935         Once the bug is determined and fixed, we should remove all logging added in this patch.
2936
2937         Reviewed by Dewei Zhu.
2938
2939         * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
2940         (WebKit::AuthenticatorManager::initTimeOutTimer):
2941         (WebKit::AuthenticatorManager::timeOutTimerFired):
2942
2943 2018-12-21  Keith Rollin  <krollin@apple.com>
2944
2945         Crash in com.apple.WebKit: WebKit::WebResourceLoader::willSendRequest + 223
2946         https://bugs.webkit.org/show_bug.cgi?id=192989
2947
2948         Reviewed by Chris Dumez.
2949
2950         willSendRequest is calling maybeLoadFallbackForRedirect, which can
2951         delete “this”. After that, some new logging code tries to access
2952         “this” and causes the crash. Fix this by adjusting the scope of a
2953         "protectedThis".
2954
2955         * WebProcess/Network/WebResourceLoader.cpp:
2956         (WebKit::WebResourceLoader::willSendRequest):
2957
2958 2018-12-21  Alejandro G. Castro  <alex@igalia.com>
2959
2960         [GTK][WPE] Add DeviceIdHashSaltStorage disk persistence
2961         https://bugs.webkit.org/show_bug.cgi?id=190466
2962
2963         Reviewed by Youenn Fablet.
2964
2965         Added persistency to the DeviceIdHashSaltStorage. Implemented a
2966         decoder and an encoder for the HashSaltForOrigin struct to store
2967         it in a file, this allows us to save the lastTimeUsed, the origin
2968         and the hash salt. It uses a new directory where it creates a file
2969         per hash salt, the name of the file is the hash salt to avoid
2970         leaking information in the system. The last time used and the
2971         origin are stored inside the file, it also adds a version
2972         directory used to change the structure of the file in the future,
2973         if we need to do it. In the DeviceIdHashSaltStorage class the disk
2974         operations happen in a WorkQueue, but all interactions go in the
2975         main thread. We added code to handle the operations when the load
2976         still did not finish.
2977
2978         * Platform/Logging.h:
2979         Added channel DiskPersistency..
2980         * Sources.txt: Added new files.
2981         * UIProcess/API/APIProcessPoolConfiguration.cpp: Added code to set
2982         the directory for the deviceIdHashSalts. That way we can use the
2983         configuration when creating the DeviceIdHashSaltStorage.
2984         (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
2985         (API::ProcessPoolConfiguration::ProcessPoolConfiguration):
2986         (API::ProcessPoolConfiguration::copy):
2987         * UIProcess/API/APIProcessPoolConfiguration.h:
2988         * UIProcess/API/APIWebsiteDataStore.cpp:
2989         (API::WebsiteDataStore::legacyDefaultDataStoreConfiguration):
2990         Added code to set the directory in the disk used to store the
2991         information.
2992         * UIProcess/API/APIWebsiteDataStore.h: Ditto.
2993         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm: Added dummy
2994         implementation to get the directory in cocoa.
2995         (API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory):
2996         (API::WebsiteDataStore::legacyDefaultDeviceIdHashSaltsStorageDirectory):
2997         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp: Defined the
2998         default directories used to store the information in the disk.
2999         (API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory):
3000         (API::WebsiteDataStore::legacyDefaultDeviceIdHashSaltsStorageDirectory):
3001         (API::WebsiteDataStore::defaultDataStoreConfiguration):
3002         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
3003         (webkitWebsiteDataManagerGetDataStore): Added the directory used
3004         to store the information.
3005         (webkit_website_data_manager_remove): Modified the way we use to
3006         make sure when we remove the cookies we also remove the hash salts.
3007         * UIProcess/API/win/APIWebsiteDataStoreWin.cpp: Added dummy
3008         implementations to get the directory in windows platform.
3009         (API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory):
3010         (API::WebsiteDataStore::legacyDefaultDeviceIdHashSaltsStorageDirectory):
3011         * UIProcess/API/C/WKBackForwardListItemRef.cpp: Add namespace, it
3012         seems some unified build compilation issue.
3013         * UIProcess/DeviceIdHashSaltStorage.cpp:
3014         (WebKit::DeviceIdHashSaltStorage::create): Added a create method
3015         used to pass the directory and the persistency status of the websitedatastore.
3016         (WebKit::DeviceIdHashSaltStorage::completeHandler): Added to share
3017         the code copying the origins to complete the get handler.
3018         (WebKit::DeviceIdHashSaltStorage::completeDeviceIdHashSaltForOriginCall):
3019         Added to share the code when completing the task of getting a new
3020         hash salt.
3021         (WebKit::DeviceIdHashSaltStorage::DeviceIdHashSaltStorage): Added
3022         a new constructor for the create method.
3023         (WebKit::getSecurityOriginData): Added to get the
3024         SecurityOriginData from a field in the decoder and do all the
3025         checks.
3026         (WebKit::DeviceIdHashSaltStorage::loadStorageFromDisk): Open the
3027         directory and restore all the hash salts from disk to the memory
3028         structure.
3029         (WebKit::DeviceIdHashSaltStorage::createEncoderFromData const):
3030         Creates the decoder to store the HashSaltForOrigin structure.
3031         (WebKit::DeviceIdHashSaltStorage::storeHashSaltToDisk): Write to
3032         disk a decoder object created from a HashSaltForOrigin
3033         structure. It uses the writeEncoderToDisk function.
3034         (WebKit::DeviceIdHashSaltStorage::deviceIdHashSaltForOrigin): Make
3035         sure we store in disk a new hash salt when it is generated and the
3036         WebsiteDataStore is persistent. Add a completionHandler to return
3037         the value found or generated, this way we can control if the
3038         HashMap is already loaded from disk.
3039         (WebKit::DeviceIdHashSaltStorage::getDeviceIdHashSaltOrigins):
3040         Make sure we run the get in a queue now that we store information
3041         in disk.
3042         (WebKit::DeviceIdHashSaltStorage::deleteHashSaltFromDiskIfNeeded):
3043         Added code to make sure we remove the files in disk.
3044         (WebKit::DeviceIdHashSaltStorage::deleteDeviceIdHashSaltForOrigins):
3045         Added code to use the deleteHashSaltFromDiskIfNeeded and remove the files in disk.
3046         (WebKit::DeviceIdHashSaltStorage::deleteDeviceIdHashSaltOriginsModifiedSince):
3047         Added code to use the deleteHashSaltFromDiskIfNeeded and remove the files in disk.
3048         * UIProcess/DeviceIdHashSaltStorage.h: Ditto.
3049         * UIProcess/PersistencyUtils.cpp: Added file to share the
3050         persistency code with the ResourceLoadStatisticsPersistentStorage class.
3051         (WebKit::createDecoderForFile): Ditto.
3052         (WebKit::writeEncoderToDisk): Ditto.
3053         * UIProcess/PersistencyUtils.h: Ditto.
3054         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp: Use the
3055         new PersistencyUtils functions shared with the
3056         DeviceIdHashSaltStorage class.
3057         (WebKit::ResourceLoadStatisticsPersistentStorage::refreshMemoryStoreFromDisk):
3058         (WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk):
3059         (WebKit::ResourceLoadStatisticsPersistentStorage::writeMemoryStoreToDisk):
3060         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: After
3061         changing the API of the deviceIdHashSaltForOrigin we now use a
3062         completionHandler because it could happen the HashMap is not still
3063         loaded and we would have to wait for it. We refactored the calls
3064         to the method to use this new completionHandler.
3065         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
3066         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
3067         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
3068         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3069         (WebKit::WebsiteDataStore::WebsiteDataStore): Create the
3070         DeviceIdHashSaltStorage class with the persistency information.
3071         (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary): Make
3072         sure we have the directory to store the information.
3073         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h: Add get
3074         and set functions for the deviceHashSaltStorageDirectory.
3075         * WebKit.xcodeproj/project.pbxproj: Added PersistencyUtils file to
3076         the xcode compilation.
3077
3078 2018-12-20  Alex Christensen  <achristensen@webkit.org>
3079
3080         Remove unused NetworkProcessCreationParameters
3081         https://bugs.webkit.org/show_bug.cgi?id=192961
3082
3083         Reviewed by Andy Estes.
3084
3085         loadThrottleLatency isn't used since I replaced it with NetworkSessionCreationParameters.loadThrottleLatency in r238654
3086         presentingApplicationPID has no effect because that value is only used in the WebProcess in NetworkExtensionContentFilter::initialize
3087
3088         * NetworkProcess/NetworkProcess.cpp:
3089         (WebKit::NetworkProcess::initializeNetworkProcess):
3090         * NetworkProcess/NetworkProcessCreationParameters.cpp:
3091         (WebKit::NetworkProcessCreationParameters::encode const):
3092         (WebKit::NetworkProcessCreationParameters::decode):
3093         * NetworkProcess/NetworkProcessCreationParameters.h:
3094         * UIProcess/WebProcessPool.cpp:
3095         (WebKit::WebProcessPool::ensureNetworkProcess):
3096
3097 2018-12-20  Chris Dumez  <cdumez@apple.com>
3098
3099         Use Optional::hasValue() instead of Optional::has_value()
3100         https://bugs.webkit.org/show_bug.cgi?id=192948
3101
3102         Reviewed by Tim Horton.
3103
3104         * UIProcess/Automation/WebAutomationSession.cpp:
3105         (WebKit::AutomationCommandError::toProtocolString):
3106         (WebKit::WebAutomationSession::willClosePage):
3107         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
3108         (WebKit::WebAutomationSessionProxy::computeElementLayout):
3109
3110 2018-12-20  Jeremy Jones  <jeremyj@apple.com>
3111
3112         Flicker when exiting element fullscreen.
3113         https://bugs.webkit.org/show_bug.cgi?id=192774
3114         rdar://problem/33088878
3115
3116         Reviewed by Jer Noble.
3117
3118         Fixes an issue where the web page would flicker upon exiting element fullscreen.
3119
3120         Replace WebView with a snapshot while the WebView is restyled and resized for inline.
3121
3122         * UIProcess/mac/WKFullScreenWindowController.h:
3123         * UIProcess/mac/WKFullScreenWindowController.mm:
3124         (-[WKFullScreenWindowController initWithWindow:webView:page:]):
3125         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
3126         (-[WKFullScreenWindowController completeFinishExitFullScreenAnimationAfterRepaint]):
3127
3128 2018-12-20  Chris Dumez  <cdumez@apple.com>
3129
3130         Move HTTPS_UPGRADE code behind a runtime flag, off by default
3131         https://bugs.webkit.org/show_bug.cgi?id=192937
3132
3133         Reviewed by Youenn Fablet.
3134
3135         Move HTTPS_UPGRADE code behind a runtime flag, off by default and drop the build time flag.
3136
3137         * Configurations/WebKit.xcconfig:
3138         * DerivedSources.make:
3139         * NetworkProcess/NetworkHTTPSUpgradeChecker.cpp:
3140         * NetworkProcess/NetworkHTTPSUpgradeChecker.h:
3141         * NetworkProcess/NetworkLoadChecker.cpp:
3142         (WebKit::NetworkLoadChecker::NetworkLoadChecker):
3143         (WebKit::NetworkLoadChecker::applyHTTPSUpgradeIfNeeded const):
3144         (WebKit::NetworkLoadChecker::checkRequest):
3145         * NetworkProcess/NetworkLoadChecker.h:
3146         * NetworkProcess/NetworkProcess.h:
3147         (WebKit::NetworkProcess::networkHTTPSUpgradeChecker):
3148         * NetworkProcess/NetworkResourceLoadParameters.cpp:
3149         (WebKit::NetworkResourceLoadParameters::encode const):
3150         (WebKit::NetworkResourceLoadParameters::decode):
3151         * NetworkProcess/NetworkResourceLoadParameters.h:
3152         * NetworkProcess/NetworkResourceLoader.cpp:
3153         * NetworkProcess/PingLoad.cpp:
3154         (WebKit::PingLoad::PingLoad):
3155         * Shared/WebPreferences.yaml:
3156         * WebProcess/Network/WebLoaderStrategy.cpp:
3157         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
3158         * config.h:
3159
3160 2018-12-20  Jiewen Tan  <jiewen_tan@apple.com>
3161
3162         [WebAuthN] Add a runtime flag for local authenticator
3163         https://bugs.webkit.org/show_bug.cgi?id=192792
3164         <rdar://problem/46798738>
3165
3166         Reviewed by Brent Fulgham.
3167
3168         * Shared/WebPreferences.yaml:
3169         * UIProcess/API/C/WKPreferences.cpp:
3170         (WKPreferencesSetWebAuthenticationLocalAuthenticatorEnabled):
3171         (WKPreferencesGetWebAuthenticationLocalAuthenticatorEnabled):
3172         * UIProcess/API/C/WKPreferencesRefPrivate.h:
3173         * UIProcess/WebAuthentication/Cocoa/LocalService.mm:
3174         (WebKit::LocalService::isAvailable):
3175
3176 2018-12-20  Chris Dumez  <cdumez@apple.com>
3177
3178         Use Optional::valueOr() instead of Optional::value_or()
3179         https://bugs.webkit.org/show_bug.cgi?id=192933
3180
3181         Reviewed by Geoffrey Garen.
3182
3183         * Shared/API/c/WKSecurityOriginRef.cpp:
3184         (WKSecurityOriginGetPort):
3185         * UIProcess/API/APIProcessPoolConfiguration.h:
3186         * UIProcess/API/Cocoa/WKSecurityOrigin.mm:
3187         (-[WKSecurityOrigin port]):
3188         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3189         (-[WKWebViewConfiguration _cpuLimit]):
3190         * UIProcess/API/glib/WebKitSecurityOrigin.cpp:
3191         (webkit_security_origin_get_port):
3192         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3193         (webkitWebViewBaseHandleWheelEvent):
3194         * UIProcess/Automation/SimulatedInputDispatcher.cpp:
3195         (WebKit::SimulatedInputKeyFrame::maximumDuration const):
3196         (WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
3197         * UIProcess/Automation/WebAutomationSession.cpp:
3198         (WebKit::WebAutomationSession::setWindowFrameOfBrowsingContext):
3199         (WebKit::WebAutomationSession::performInteractionSequence):
3200         * UIProcess/Automation/WebAutomationSessionMacros.h:
3201         * UIProcess/ServiceWorkerProcessProxy.cpp:
3202         (WebKit::ServiceWorkerProcessProxy::start):
3203         * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
3204         (WebKit::AuthenticatorManager::initTimeOutTimer):
3205         * UIProcess/WebPageProxy.cpp:
3206         (WebKit::WebPageProxy::deviceScaleFactor const):
3207         * UIProcess/WebPageProxy.h:
3208         (WebKit::WebPageProxy::viewportSizeForCSSViewportUnits const):
3209         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
3210         (WebKit::WebPopupMenuProxyGtk::activateItem):
3211         * UIProcess/mac/LegacySessionStateCoding.cpp:
3212         (WebKit::encodeFormDataElement):
3213         * WebProcess/Network/WebLoaderStrategy.cpp:
3214         (WebKit::WebLoaderStrategy::scheduleLoad):
3215         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3216         (WebKit::PDFPlugin::convertFromPDFViewToRootView const):
3217         (WebKit::PDFPlugin::boundsOnScreen const):
3218         (WebKit::PDFPlugin::geometryDidChange):
3219         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
3220         (WebKit::toFormData):
3221         * WebProcess/WebPage/ios/WebPageIOS.mm:
3222         (WebKit::WebPage::updateVisibleContentRects):
3223         * WebProcess/WebPage/wpe/CompositingManager.cpp:
3224         (WebKit::CompositingManager::releaseConnectionFd):
3225
3226 2018-12-20  Keith Rollin  <krollin@apple.com>
3227
3228         Improve release-level page-load logging
3229         https://bugs.webkit.org/show_bug.cgi?id=192872
3230         <rdar://problem/46850309>
3231
3232         Reviewed by Chris Dumez.
3233
3234         There are a number of reported bugs that are difficult or impossible
3235         to track down with our current level of logging. Additionally, some
3236         software groups lower in the page-loading stack have requested logging
3237         sufficient for tracking a user-visible error message down to the
3238         requested resource that caused the message. Add more-comprehensive
3239         logging to address these issues/requests.
3240
3241         * UIProcess/WebPageProxy.cpp:
3242         (WebKit::m_editableImageController):
3243         (WebKit::WebPageProxy::~WebPageProxy):
3244         (WebKit::WebPageProxy::reattachToWebProcess):
3245         (WebKit::WebPageProxy::swapToWebProcess):
3246         (WebKit::WebPageProxy::reattachToWebProcessForReload):
3247         (WebKit::WebPageProxy::reattachToWebProcessWithItem):
3248         (WebKit::WebPageProxy::close):
3249         (WebKit::WebPageProxy::tryClose):
3250         (WebKit::WebPageProxy::loadRequest):
3251         (WebKit::WebPageProxy::loadRequestWithNavigation):
3252         (WebKit::WebPageProxy::loadFile):
3253         (WebKit::WebPageProxy::loadData):
3254         (WebKit::WebPageProxy::loadDataWithNavigation):
3255         (WebKit::WebPageProxy::loadAlternateHTML):
3256         (WebKit::WebPageProxy::loadWebArchiveData):
3257         (WebKit::WebPageProxy::navigateToPDFLinkWithSimulatedClick):
3258         (WebKit::WebPageProxy::stopLoading):
3259         (WebKit::WebPageProxy::reload):
3260         (WebKit::WebPageProxy::goToBackForwardItem):
3261         (WebKit::WebPageProxy::tryRestoreScrollPosition):
3262         (WebKit::WebPageProxy::updateThrottleState):
3263         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
3264         (WebKit::WebPageProxy::continueNavigationInNewProcess):
3265         (WebKit::WebPageProxy::restoreFromSessionState):
3266         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
3267         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
3268         (WebKit::WebPageProxy::willPerformClientRedirectForFrame):
3269         (WebKit::WebPageProxy::didCancelClientRedirectForFrame):
3270         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
3271         (WebKit::WebPageProxy::didCommitLoadForFrame):
3272         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
3273         (WebKit::WebPageProxy::didFinishLoadForFrame):
3274         (WebKit::WebPageProxy::didFailLoadForFrame):
3275         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
3276         (WebKit::WebPageProxy::didNavigateWithNavigationData):
3277         (WebKit::WebPageProxy::didPerformClientRedirect):
3278         (WebKit::WebPageProxy::didPerformServerRedirect):
3279         (WebKit::WebPageProxy::processDidBecomeUnresponsive):
3280         (WebKit::WebPageProxy::processDidBecomeResponsive):
3281         (WebKit::WebPageProxy::processDidTerminate):
3282         (WebKit::WebPageProxy::dispatchProcessDidTerminate):
3283         (WebKit::WebPageProxy::tryReloadAfterProcessTermination):
3284         (WebKit::WebPageProxy::didExceedInactiveMemoryLimitWhileActive):
3285         (WebKit::WebPageProxy::didExceedBackgroundCPULimitWhileInForeground):
3286         * WebProcess/Network/WebLoaderStrategy.cpp:
3287         (WebKit::WebLoaderStrategy::scheduleLoad):
3288         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
3289         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
3290         * WebProcess/Network/WebResourceLoader.cpp:
3291         (WebKit::WebResourceLoader::willSendRequest):
3292         (WebKit::WebResourceLoader::didReceiveResponse):
3293         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3294         (WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad):
3295         (WebKit::WebFrameLoaderClient::dispatchDidFailLoad):
3296
3297 2018-12-20  Wenson Hsieh  <wenson_hsieh@apple.com>
3298
3299         [iOS] Replace "node assistance" terminology in WebKit with "focused element"
3300         https://bugs.webkit.org/show_bug.cgi?id=192936
3301
3302         Reviewed by Tim Horton.
3303
3304         Renames a few methods and data structures in WebKit, to refer to "focused elements" rather than "assisted nodes";
3305         see below for more details. No new tests, because there should be no change in behavior.
3306
3307         * Shared/FocusedElementInformation.cpp: Renamed from Source/WebKit/Shared/AssistedNodeInformation.cpp.
3308         (WebKit::OptionItem::encode const):
3309         (WebKit::OptionItem::decode):
3310         (WebKit::FocusedElementInformation::encode const):
3311         (WebKit::FocusedElementInformation::decode):
3312         * Shared/FocusedElementInformation.h: Renamed from Source/WebKit/Shared/AssistedNodeInformation.h.
3313
3314         Rename AssistedNodeInformation to FocusedElementInformation. Additionally, introduce a named type for the
3315         focusedElementIdentifier (which is currently just a `uint64_t`).
3316
3317         (WebKit::OptionItem::OptionItem):
3318         * Shared/ios/InteractionInformationAtPosition.h:
3319         * Shared/ios/InteractionInformationAtPosition.mm:
3320         (WebKit::InteractionInformationAtPosition::encode const):
3321         (WebKit::InteractionInformationAtPosition::decode):
3322         * SourcesCocoa.txt:
3323         * UIProcess/API/Cocoa/WKWebView.mm:
3324         (-[WKWebView _shouldUpdateKeyboardWithInfo:]):
3325         * UIProcess/PageClient.h:
3326         * UIProcess/WebPageProxy.cpp:
3327         (WebKit::WebPageProxy::resetStateAfterProcessExited):
3328         * UIProcess/WebPageProxy.h:
3329
3330         Rename NodeAssistanceArguments to ElementDidFocusArguments (and also add a FIXME for removing this mechanism
3331         eventually).
3332
3333         (WebKit::WebPageProxy::focusNextFocusedElement):
3334         (WebKit::WebPageProxy::focusNextAssistedNode): Deleted.
3335         * UIProcess/WebPageProxy.messages.in:
3336
3337         Rename StartAssistingNode to ElementDidFocus, and StopAssistingNode to ElementDidBlur.
3338
3339         * UIProcess/ios/PageClientImplIOS.h:
3340         * UIProcess/ios/PageClientImplIOS.mm:
3341         (WebKit::PageClientImpl::elementDidFocus):
3342         (WebKit::PageClientImpl::isFocusingElement):
3343         (WebKit::PageClientImpl::elementDidBlur):
3344         (WebKit::PageClientImpl::startAssistingNode): Deleted.
3345         (WebKit::PageClientImpl::isAssistingNode): Deleted.
3346         (WebKit::PageClientImpl::stopAssistingNode): Deleted.
3347         * UIProcess/ios/WKContentView.h:
3348         * UIProcess/ios/WKContentView.mm:
3349         (-[WKContentView isFocusingElement]):
3350         (-[WKContentView _didCommitLoadForMainFrame]):
3351         (-[WKContentView isAssistingNode]): Deleted.
3352         * UIProcess/ios/WKContentViewInteraction.h:
3353         * UIProcess/ios/WKContentViewInteraction.mm:
3354         (-[WKFocusedElementInfo initWithFocusedElementInformation:isUserInitiated:userObject:]):
3355         (hasFocusedElement):
3356         (-[WKContentView cleanupInteraction]):
3357         (-[WKContentView shouldHideSelectionWhenScrolling]):
3358         (-[WKContentView resignFirstResponderForWebView]):
3359         (-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:]):
3360         (-[WKContentView _requiresKeyboardWhenFirstResponder]):
3361         (-[WKContentView _zoomToRevealFocusedElement]):
3362         (-[WKContentView inputView]):
3363         (-[WKContentView _selectionClipRect]):
3364         (-[WKContentView gestureRecognizerShouldBegin:]):
3365         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
3366         (-[WKContentView clearSelection]):
3367         (-[WKContentView requiresAccessoryView]):
3368         (-[WKContentView canPerformActionForWebView:withSender:]):
3369         (-[WKContentView _isInteractingWithFocusedElement]):
3370         (-[WKContentView changeSelectionWithGestureAt:withGesture:withState:withFlags:]):
3371         (-[WKContentView selectPositionAtPoint:completionHandler:]):
3372         (-[WKContentView selectPositionAtBoundary:inDirection:fromPoint:completionHandler:]):
3373         (-[WKContentView selectTextWithGranularity:atPoint:completionHandler:]):
3374         (-[WKContentView updateSelectionWithExtentPoint:completionHandler:]):
3375         (-[WKContentView updateSelectionWithExtentPoint:withBoundary:completionHandler:]):
3376         (-[WKContentView accessoryTab:]):
3377         (-[WKContentView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]):
3378         (-[WKContentView accessoryClear]):
3379         (-[WKContentView _updateAccessory]):
3380         (-[WKContentView insertTextSuggestion:]):
3381         (-[WKContentView setSelectedTextRange:]):
3382         (-[WKContentView textInputTraits]):
3383         (-[WKContentView isScrollableForKeyboardScrollViewAnimator:]):
3384         (-[WKContentView focusedElementInformation]):
3385         (-[WKContentView focusedSelectElementOptions]):
3386         (rectToRevealWhenZoomingToFocusedElement):
3387         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
3388         (-[WKContentView _elementDidBlur]):
3389         (-[WKContentView _didReceiveEditorStateUpdateAfterFocus]):
3390         (-[WKContentView updateCurrentFocusedElementInformation:]):
3391         (-[WKContentView presentViewControllerForCurrentFocusedElement]):
3392         (-[WKContentView focusedFormControlViewDidSubmit:]):
3393         (-[WKContentView focusedFormControlViewDidCancel:]):
3394         (-[WKContentView focusedFormControlViewDidBeginEditing:]):
3395         (-[WKContentView rectForFocusedFormControlView:]):
3396         (-[WKContentView nextRectForFocusedFormControlView:]):
3397         (-[WKContentView previousRectForFocusedFormControlView:]):
3398         (-[WKContentView actionNameForFocusedFormControlView:]):
3399         (-[WKContentView focusedFormControlViewDidRequestNextNode:]):
3400         (-[WKContentView focusedFormControlViewDidRequestPreviousNode:]):
3401         (-[WKContentView hasNextNodeForFocusedFormControlView:]):
3402         (-[WKContentView hasPreviousNodeForFocusedFormControlView:]):
3403         (-[WKContentView selectMenu:didSelectItemAtIndex:]):
3404         (-[WKContentView numberOfItemsInSelectMenu:]):
3405         (-[WKContentView selectMenu:displayTextForItemAtIndex:]):
3406         (-[WKContentView selectMenu:didCheckItemAtIndex:checked:]):
3407         (-[WKContentView selectMenuUsesMultipleSelection:]):
3408         (-[WKContentView selectMenu:hasSelectedOptionAtIndex:]):
3409         (-[WKContentView _updateChangedSelection:]):
3410         (-[WKContentView _autofillContext]):
3411         (-[WKContentView dismissQuickboardViewControllerAndRevealFocusedFormOverlayIfNecessary:]):
3412         (-[WKContentView allowsLanguageSelectionMenuForListViewController:]):
3413         (-[WKContentView inputLabelTextForViewController:]):
3414         (-[WKContentView initialValueForViewController:]):
3415         (-[WKContentView shouldDisplayInputContextViewForListViewController:]):
3416         (-[WKContentView numericInputModeForListViewController:]):
3417         (-[WKContentView textContentTypeForListViewController:]):
3418         (-[WKContentView allowsDictationInputForListViewController:]):
3419         (-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:userObject:]): Deleted.
3420         (hasAssistedNode): Deleted.
3421
3422         Replaced with hasFocusedElement.
3423
3424         (-[WKContentView _isInteractingWithAssistedNode]): Deleted.
3425         (-[WKContentView assistedNodeInformation]): Deleted.
3426         (-[WKContentView assistedNodeSelectOptions]): Deleted.
3427         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]): Deleted.
3428         (-[WKContentView _stopAssistingNode]): Deleted.
3429         (-[WKContentView updateCurrentAssistedNodeInformation:]): Deleted.
3430         (-[WKContentView presentViewControllerForCurrentAssistedNode]): Deleted.
3431         * UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm:
3432         (-[WKDataListSuggestionsControl textAlignment]):
3433         * UIProcess/ios/WebPageProxyIOS.mm:
3434         (WebKit::WebPageProxy::focusedElementInformationCallback):
3435         (WebKit::WebPageProxy::requestFocusedElementInformation):
3436         (WebKit::WebPageProxy::computeCustomFixedPositionRect const):
3437         (WebKit::WebPageProxy::didCommitLayerTree):
3438         (WebKit::WebPageProxy::selectWithGesture):
3439         (WebKit::WebPageProxy::selectTextWithGranularityAtPoint):
3440         (WebKit::WebPageProxy::selectPositionAtBoundaryWithDirection):
3441         (WebKit::WebPageProxy::selectPositionAtPoint):
3442         (WebKit::WebPageProxy::updateSelectionWithExtentPoint):
3443         (WebKit::WebPageProxy::updateSelectionWithExtentPointAndBoundary):
3444         (WebKit::WebPageProxy::blurFocusedElement):
3445         (WebKit::WebPageProxy::elementDidFocus):
3446         (WebKit::WebPageProxy::elementDidBlur):
3447         (WebKit::WebPageProxy::focusNextFocusedElement):
3448         (WebKit::WebPageProxy::setFocusedElementValue):
3449         (WebKit::WebPageProxy::setFocusedElementValueAsNumber):
3450         (WebKit::WebPageProxy::setFocusedElementSelectedIndex):
3451         (WebKit::WebPageProxy::assistedNodeInformationCallback): Deleted.
3452         (WebKit::WebPageProxy::requestAssistedNodeInformation): Deleted.
3453         (WebKit::WebPageProxy::blurAssistedNode): Deleted.
3454         (WebKit::WebPageProxy::startAssistingNode): Deleted.
3455         (WebKit::WebPageProxy::stopAssistingNode): Deleted.
3456         (WebKit::WebPageProxy::focusNextAssistedNode): Deleted.
3457         (WebKit::WebPageProxy::setAssistedNodeValue): Deleted.
3458         (WebKit::WebPageProxy::setAssistedNodeValueAsNumber): Deleted.
3459         (WebKit::WebPageProxy::setAssistedNodeSelectedIndex): Deleted.
3460         * UIProcess/ios/forms/WKFormColorPicker.mm:
3461         (-[WKColorPicker initWithView:]):
3462         (-[WKColorPicker setControlValueFromUIColor:]):
3463         * UIProcess/ios/forms/WKFormInputControl.mm:
3464         (-[WKDateTimePicker initWithView:datePickerMode:]):
3465         (-[WKDateTimePicker shouldPresentGregorianCalendar:]):
3466         (-[WKDateTimePicker _dateChangedSetAsNumber]):
3467         (-[WKDateTimePicker _dateChangedSetAsString]):
3468         (-[WKDateTimePicker controlBeginEditing]):
3469         (-[WKFormInputControl initWithView:]):
3470         (-[WKDateTimePopover clear:]):
3471         (-[WKDateTimePopover initWithView:datePickerMode:]):
3472         * UIProcess/ios/forms/WKFormPopover.mm:
3473         (-[WKRotatingPopover presentPopoverAnimated:]):
3474         * UIProcess/ios/forms/WKFormSelectControl.h:
3475         * UIProcess/ios/forms/WKFormSelectControl.mm:
3476         (-[WKFormSelectControl initWithView:]):
3477         * UIProcess/ios/forms/WKFormSelectPicker.mm:
3478         (-[WKMultipleSelectPicker initWithView:]):
3479         (-[WKMultipleSelectPicker pickerView:viewForRow:forComponent:reusingView:]):
3480         (-[WKMultipleSelectPicker pickerView:numberOfRowsInComponent:]):
3481         (-[WKMultipleSelectPicker findItemIndexAt:]):
3482         (-[WKMultipleSelectPicker pickerView:row:column:checked:]):
3483         (-[WKSelectSinglePicker initWithView:]):
3484         (-[WKSelectSinglePicker controlEndEditing]):
3485         (-[WKSelectSinglePicker pickerView:numberOfRowsInComponent:]):
3486         (-[WKSelectSinglePicker pickerView:attributedTitleForRow:forComponent:]):
3487         (-[WKSelectSinglePicker pickerView:didSelectRow:inComponent:]):
3488         * UIProcess/ios/forms/WKFormSelectPopover.mm:
3489         (-[WKSelectTableViewController initWithView:hasGroups:]):
3490         (-[WKSelectTableViewController tableView:numberOfRowsInSection:]):
3491         (-[WKSelectTableViewController tableView:titleForHeaderInSection:]):
3492         (-[WKSelectTableViewController findItemIndexAt:]):
3493         (-[WKSelectTableViewController findItemAt:]):
3494         (-[WKSelectTableViewController tableView:cellForRowAtIndexPath:]):
3495         (-[WKSelectTableViewController tableView:didSelectRowAtIndexPath:]):
3496         (-[WKSelectPopover initWithView:hasGroups:]):
3497         * WebKit.xcodeproj/project.pbxproj:
3498         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3499         (WebKit::WebChromeClient::elementDidFocus):
3500         (WebKit::WebChromeClient::elementDidRefocus):
3501         (WebKit::WebChromeClient::elementDidBlur):
3502         * WebProcess/WebPage/WebPage.cpp:
3503         (WebKit::WebPage::didStartPageTransition):
3504         (WebKit::WebPage::setTextAsync):
3505         (WebKit::WebPage::resetFocusedElementForFrame):
3506         (WebKit::WebPage::elementDidRefocus):
3507         (WebKit::WebPage::elementDidFocus):
3508         (WebKit::WebPage::elementDidBlur):
3509         (WebKit::WebPage::didCommitLoad):
3510         (WebKit::WebPage::resetAssistedNodeForFrame): Deleted.
3511         * WebProcess/WebPage/WebPage.h:
3512
3513         Refactor elementDid{Refocus|Focus|Blur} to take `Element&` rather than `Node*`.
3514
3515         * WebProcess/WebPage/WebPage.messages.in:
3516         * WebProcess/WebPage/ios/WebPageIOS.mm:
3517
3518         Replace m_assistedNode (a `RefPtr<Node>`) with m_focusedElement (a `RefPtr<Element>`).
3519
3520         (WebKit::WebPage::platformEditorState const):
3521         (WebKit::WebPage::completeSyntheticClick):
3522         (WebKit::WebPage::requestFocusedElementInformation):
3523         (WebKit::WebPage::blurFocusedElement):
3524         (WebKit::WebPage::setFocusedElementValue):
3525         (WebKit::WebPage::setFocusedElementValueAsNumber):
3526         (WebKit::WebPage::setFocusedElementSelectedIndex):
3527         (WebKit::innerFrameQuad):
3528         (WebKit::constrainPoint):
3529         (WebKit::WebPage::selectWithGesture):
3530         (WebKit::WebPage::startAutoscrollAtPosition):
3531         (WebKit::WebPage::visiblePositionInFocusedNodeForPoint):
3532         (WebKit::WebPage::selectPositionAtPoint):
3533         (WebKit::WebPage::selectPositionAtBoundaryWithDirection):
3534         (WebKit::WebPage::rangeForGranularityAtPoint):
3535         (WebKit::WebPage::selectTextWithGranularityAtPoint):
3536         (WebKit::WebPage::updateSelectionWithExtentPointAndBoundary):
3537         (WebKit::WebPage::updateSelectionWithExtentPoint):
3538         (WebKit::WebPage::getPositionInformation):
3539         (WebKit::WebPage::focusNextFocusedElement):
3540         (WebKit::WebPage::getFocusedElementInformation):
3541         (WebKit::WebPage::autofillLoginCredentials):
3542         (WebKit::WebPage::requestAssistedNodeInformation): Deleted.
3543         (WebKit::WebPage::blurAssistedNode): Deleted.
3544         (WebKit::WebPage::setAssistedNodeValue): Deleted.
3545         (WebKit::WebPage::setAssistedNodeValueAsNumber): Deleted.
3546         (WebKit::WebPage::setAssistedNodeSelectedIndex): Deleted.
3547         (WebKit::WebPage::focusNextAssistedNode): Deleted.
3548         (WebKit::WebPage::getAssistedNodeInformation): Deleted.
3549
3550 2018-12-20  Brent Fulgham  <bfulgham@apple.com>
3551
3552         WKWebView default UA doesn't freeze the build number
3553         https://bugs.webkit.org/show_bug.cgi?id=192809
3554         <rdar://problem/44687185>
3555
3556         Reviewed by Andy Estes.
3557
3558         Always reports the frozen build number.
3559
3560         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3561         (defaultApplicationNameForUserAgent): Do not expose the actual build number through this API.
3562
3563 2018-12-20  Jer Noble  <jer.noble@apple.com>
3564
3565         Enable MediaCapabilities by default.
3566         https://bugs.webkit.org/show_bug.cgi?id=192340
3567         <rdar://problem/46435149>
3568
3569         Reviewed by Dean Jackson.
3570
3571         * Shared/WebPreferences.yaml:
3572
3573 2018-12-20  Carlos Garcia Campos  <cgarcia@igalia.com>
3574
3575         [GTK] WebDriver: tests in imported/w3c/webdriver/tests/element_clear/user_prompts.py are failing
3576         https://bugs.webkit.org/show_bug.cgi?id=192927
3577
3578         Reviewed by Michael Catanzaro.
3579
3580         Give the focus back to the web view when a dialog is dismissed.
3581
3582         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3583         (webkitWebViewBaseContainerRemove):
3584
3585 2018-12-20  Tim Horton  <timothy_horton@apple.com>
3586
3587         Unparented WKWebView can't retrieve main resource data for a main frame plugin
3588         https://bugs.webkit.org/show_bug.cgi?id=192923
3589         <rdar://problem/46859068>
3590
3591         Reviewed by Wenson Hsieh.
3592
3593         * WebProcess/Plugins/PluginView.cpp:
3594         (WebKit::PluginView::liveResourceData const):
3595         If the WKWebView is unparented, we may not immediately initialize the plugin.
3596         In that case, PluginView holds on to the backing data until the plugin
3597         is initialized. If a WKWebView API client asks for the backing data
3598         for the plugin during this time, we should return it, instead of bailing.
3599
3600 2018-12-20  Wenson Hsieh  <wenson_hsieh@apple.com>
3601
3602         [iOS] Focusing an editable element should scroll to reveal the selection
3603         https://bugs.webkit.org/show_bug.cgi?id=192802
3604         <rdar://problem/46781759>
3605
3606         Reviewed by Tim Horton.
3607
3608         Currently, when tapping on an editable element, logic in -[WKWebView _zoomToFocusRect:…:] attempts to adjust the
3609         visible viewport such that the rect containing the selection is visible. However, AssistedNodeInformation's
3610         selectionRect is used here, which (as the FIXME in WebPage::getAssistedNodeInformation notes) is either the last
3611         touch location, or the top left of the element if the touch location is outside of the element's bounding rect.
3612         This leads to confusing and undesirable behavior when tapping near the bottom of a large contenteditable element
3613         to focus it, since the actual selection will end up near the top of the element, yet we'll try to scroll to
3614         reveal the bottom of the element, which causes the visible selection to scroll offscreen. Notably, this affects
3615         scenarios involving editable web views embedded in apps, such as Mail compose.
3616
3617         Right now, we use the last touch location as an approximation for the selection rect because the selection may
3618         have not yet been updated at the moment when focus moves into an editable element. To fix this, we defer the
3619         process of zooming to the focused element rect until after the selection changes and the UI process is updated
3620         with information about the new selection rects.
3621
3622         Test: editing/selection/ios/selection-is-visible-after-focusing-editable-area.html
3623
3624         * Shared/AssistedNodeInformation.cpp:
3625         (WebKit::AssistedNodeInformation::encode const):
3626         (WebKit::AssistedNodeInformation::decode):
3627         * Shared/AssistedNodeInformation.h:
3628
3629         Rename selectionRect to elementInteractionLocation, to more accurately reflect its value and purpose. This isn't
3630         strictly always the last touch location, since we may default to the focused element location instead if the
3631         last touch location is outside of the element rect.
3632
3633         * UIProcess/API/Cocoa/WKWebView.mm:
3634         (-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
3635
3636         Tweak a constant that determines the minimum amount of margin to leave between the selection rect and the edge
3637         of the window when scrolling to reveal the focused element. Previously, this was larger than necessary to
3638         accomodate for the fact that the "selection rect" used when zooming to the focused element did not take the
3639         actual selection into account at all, and was simply a 1 by 1 rect; this meant that the margin needed to be
3640         large enough to exceed the usual height of a text caret in editable content. Since we now use the real selection
3641         rect, we can be much less generous with this margin.
3642
3643         * UIProcess/ios/WKContentViewInteraction.h:
3644         * UIProcess/ios/WKContentViewInteraction.mm:
3645         (-[WKContentView cleanupInteraction]):
3646         (-[WKContentView observeValueForKeyPath:ofObject:change:context:]):
3647
3648         Don't additionally update the selection in the middle of triggering zooming to the focused element; on
3649         particular versions of iOS, this now attempts to scroll the selection rect on-screen, which then conflicts with
3650         zooming to reveal the focused element.
3651
3652         (-[WKContentView _zoomToRevealFocusedElement]):
3653
3654         Renamed from _displayFormNodeInputView to _zoomToRevealFocusedElement, to make the purpose of this function more
3655         clear. Additionally, pull logic to update the accessory view out of this method, so that it's strictly concerned
3656         with zooming to the focused element.
3657
3658         (-[WKContentView inputView]):
3659
3660         Add a FIXME describing the implications of zooming to the focused element in the implementation of -inputView.
3661         See also: <https://bugs.webkit.org/show_bug.cgi?id=192878>.
3662
3663         (-[WKContentView accessoryTab:]):
3664
3665         Fix a subtle issue when keeping track of _didAccessoryTabInitiateFocus. Currently, this is set to YES in
3666         -accessoryTab: and unset in _displayFormNodeInputView, but since _displayFormNodeInputView may be invoked
3667         multiple times for the same focused element (see: -inputView), we might end up zooming to the focused element
3668         with _didAccessoryTabInitiateFocus set to NO, even though we initiated focus with the previous/next buttons.
3669
3670         Instead, temporarily set a different ivar, _isChangingFocusUsingAccessoryTab, to YES in -accessoryTab:, and
3671         unset it in the completion handler after the focused element has changed. Then, when we _startAssistingNode:,
3672         set _didAccessoryTabInitiateFocus to _isChangingFocusUsingAccessoryTab. This ensures that the correctness of
3673         _didAccessoryTabInitiateFocus isn't tied to the number of times -[WKContentView inputView] is invoked when
3674         focusing an element.
3675
3676         (shouldZoomToRevealSelectionRect):
3677         (rectToRevealWhenZoomingToFocusedElement):
3678
3679         Add a helper method to determine the selection rect to use when zooming to reveal the focused element. ASSERTs
3680         that we have post-layout data in the EditorState.
3681
3682         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
3683
3684         When "assisting" a focused element, immediately zoom to it if we don't need selection information to compute the
3685         rect to zoom to; otherwise, defer zooming until we receive the first editor state update in the UI process that
3686         contains information about our selection rects.
3687
3688         (-[WKContentView _stopAssistingNode]):
3689         (-[WKContentView _didReceiveEditorStateUpdateAfterFocus]):
3690
3691         If necessary, reveal the focused element by zooming.
3692
3693         (-[WKContentView _updateInitialWritingDirectionIfNecessary]):
3694
3695         Pull this initial writing direction update logic out into a separate helper method.
3696
3697         (-[WKContentView _displayFormNodeInputView]): Deleted.
3698
3699         Replaced by _zoomToRevealFocusedElement.
3700
3701         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3702         (WebKit::WebChromeClient::elementDidRefocus):
3703
3704         This currently calls WebChromeClient::elementDidFocus; instead, call the new WebPage::elementDidRefocus;
3705         additionally, make this available on all PLATFORM(COCOA), rather than just IOS_FAMILY.
3706
3707         * WebProcess/WebCoreSupport/WebChromeClient.h:
3708         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
3709         (WebKit::WebChromeClient::elementDidRefocus): Deleted.
3710
3711         Replaced by the PLATFORM(COCOA) version.
3712
3713         * WebProcess/WebPage/WebPage.cpp:
3714         (WebKit::WebPage::elementDidRefocus):
3715
3716         When refocusing an element, ensure that post-layout editor state data is sent to the UI process by including a
3717         full EditorState in the next layer tree transaction.
3718
3719         * WebProcess/WebPage/WebPage.h:
3720         * WebProcess/WebPage/ios/WebPageIOS.mm:
3721         (WebKit::WebPage::completeSyntheticClick):
3722
3723         Call elementDidRefocus instead of elementDidFocus, in the case where the existing focused element is clicked.
3724
3725         (WebKit::WebPage::getAssistedNodeInformation):
3726
3727         Adjust for the change from selectionRect to elementInteractionLocation.
3728
3729 2018-12-20  Patrick Griffis  <pgriffis@igalia.com>
3730
3731         [GTK][WPE] Grant the sandbox read access to XDG_DATA_HOME/prgname
3732         https://bugs.webkit.org/show_bug.cgi?id=192929
3733
3734         Reviewed by Michael Catanzaro.
3735
3736         * UIProcess/API/glib/WebKitWebContext.cpp:
3737         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
3738         (WebKit::bubblewrapSpawn):
3739
3740 2018-12-20  Chris Dumez  <cdumez@apple.com>
3741
3742         [PSON] SuspendedPageProxy fails to release its process assertion if the WebPage fails to enter PageCache
3743         https://bugs.webkit.org/show_bug.cgi?id=192873
3744
3745         Reviewed by Antti Koivisto.
3746
3747         SuspendedPageProxy fails to release its process assertion if the WebPage fails to enter PageCache, preventing
3748         the process from suspending on iOS.
3749
3750         * UIProcess/SuspendedPageProxy.cpp:
3751         (WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
3752         (WebKit::SuspendedPageProxy::didReceiveMessage):
3753         (WebKit::SuspendedPageProxy::didSuspend): Deleted.
3754         (WebKit::SuspendedPageProxy::didFailToSuspend): Deleted.
3755         * UIProcess/SuspendedPageProxy.h:
3756
3757 2018-12-19  Chris Dumez  <cdumez@apple.com>
3758
3759         wtf/Optional.h: move-constructor and move-assignment operator should disengage the value being moved from
3760         https://bugs.webkit.org/show_bug.cgi?id=192728
3761         <rdar://problem/46746779>
3762
3763         Reviewed by Geoff Garen.
3764
3765         * NetworkProcess/*:
3766         * Platform/*:
3767         * Scripts/*:
3768         * Shared/*:
3769         * UIProcess/*:
3770         * WebProcess/*:
3771
3772 2018-12-19  Michael Catanzaro  <mcatanzaro@igalia.com>
3773
3774         Unreviewed, silence -Wpragmas warning
3775
3776         * WebProcess/WebCoreSupport/WebAlternativeTextClient.h:
3777
3778 2018-12-19  Vivek Seth  <v_seth@apple.com>
3779
3780         HTTPS Upgrade: Use full sqlite upgrade list
3781         https://bugs.webkit.org/show_bug.cgi?id=192736
3782         <rdar://problem/45851427>
3783
3784         Reviewed by Chris Dumez.
3785
3786         * NetworkProcess/NetworkHTTPSUpgradeChecker.cpp: Added.
3787         (WebKit::NetworkHTTPSUpgradeCheckerDatabasePath):
3788         (WebKit::NetworkHTTPSUpgradeChecker::NetworkHTTPSUpgradeChecker):
3789         (WebKit::NetworkHTTPSUpgradeChecker::~NetworkHTTPSUpgradeChecker):
3790         (WebKit::NetworkHTTPSUpgradeChecker::query):
3791         (WebKit::NetworkHTTPSUpgradeChecker::isAlwaysOnLoggingAllowed const):
3792         * NetworkProcess/NetworkHTTPSUpgradeChecker.h: Added.
3793         (WebKit::NetworkHTTPSUpgradeChecker::didSetupCompleteSuccessfully const):
3794         * NetworkProcess/NetworkLoadChecker.cpp:
3795         (WebKit::NetworkLoadChecker::applyHTTPSUpgradeIfNeeded const):
3796         (WebKit::NetworkLoadChecker::checkRequest):
3797         * NetworkProcess/NetworkLoadChecker.h:
3798         * NetworkProcess/NetworkProcess.h:
3799         (WebKit::NetworkProcess::networkHTTPSUpgradeChecker):
3800         * Sources.txt:
3801         * WebKit.xcodeproj/project.pbxproj:
3802
3803 2018-12-19  Tim Horton  <timothy_horton@apple.com>
3804
3805         Use delegate instead of drawingDelegate in WKDrawingView
3806         https://bugs.webkit.org/show_bug.cgi?id=192899
3807         <rdar://problem/46733339>
3808
3809         Reviewed by Wenson Hsieh.
3810
3811         * UIProcess/ios/WKDrawingView.mm:
3812         (-[WKDrawingView initWithEmbeddedViewID:webPageProxy:]):
3813         Do the dance.
3814
3815 2018-12-19  Alex Christensen  <achristensen@webkit.org>
3816
3817         Navigations away from the SafeBrowsing interstitial show a flash of old content
3818         https://bugs.webkit.org/show_bug.cgi?id=192676
3819
3820         Reviewed by Chris Dumez.
3821
3822         When a user clicks through a safe browsing warning, do not remove the warning until content is drawn for the destination.
3823         Otherwise, the user will confusingly see the page before the warning while the navigation happens.
3824         We can only do this for warnings caused by main frame navigations, though.  Other warnings (such as those caused by iframes)
3825         need to be cleared immediately, and we still need to clear the warning immediately if the user has said to go back.
3826
3827         This change is reflected in an updated API test.
3828
3829         * UIProcess/API/Cocoa/WKWebView.mm:
3830         (-[WKWebView _showSafeBrowsingWarning:completionHandler:]):
3831         * UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm:
3832         (WebKit::SafeBrowsingWarning::SafeBrowsingWarning):
3833         * UIProcess/Cocoa/WKSafeBrowsingWarning.h:
3834         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
3835         (-[WKSafeBrowsingWarning forMainFrameNavigation]):
3836         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
3837         (WebKit::WebPageProxy::beginSafeBrowsingCheck):
3838         * UIProcess/Cocoa/WebViewImpl.h:
3839         * UIProcess/Cocoa/WebViewImpl.mm:
3840         (WebKit::WebViewImpl::showSafeBrowsingWarning):
3841         (WebKit::WebViewImpl::clearSafeBrowsingWarningIfForMainFrameNavigation):
3842         * UIProcess/PageClient.h:
3843         (WebKit::PageClient::clearSafeBrowsingWarningIfForMainFrameNavigation):
3844         * UIProcess/SafeBrowsingWarning.h:
3845         (WebKit::SafeBrowsingWarning::create):
3846         (WebKit::SafeBrowsingWarning::forMainFrameNavigation const):
3847         * UIProcess/WebPageProxy.cpp:
3848         (WebKit::WebPageProxy::didReachLayoutMilestone):
3849         (WebKit::WebPageProxy::beginSafeBrowsingCheck):
3850         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
3851         * UIProcess/WebPageProxy.h:
3852         * UIProcess/ios/PageClientImplIOS.h:
3853         * UIProcess/mac/PageClientImplMac.h:
3854         * UIProcess/mac/PageClientImplMac.mm:
3855         (WebKit::PageClientImpl::clearSafeBrowsingWarningIfForMainFrameNavigation):
3856
3857 2018-12-19  Tim Horton  <timothy_horton@apple.com>
3858
3859         UI process crash when focusing an editable image
3860         https://bugs.webkit.org/show_bug.cgi?id=192839
3861         <rdar://problem/46786670>
3862
3863         Reviewed by Wenson Hsieh.
3864
3865         * SourcesCocoa.txt:
3866         * UIProcess/ios/WKContentViewInteraction.h:
3867         * UIProcess/ios/WKContentViewInteraction.mm:
3868         (-[WKContentView _requiresKeyboardWhenFirstResponder]):
3869         (-[WKContentView inputView]):
3870         (-[WKContentView requiresAccessoryView]):
3871         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
3872         (-[WKContentView _stopAssistingNode]):
3873         (-[WKContentView _installInkPickerForDrawingViewWithID:]):
3874         (-[WKContentView _uninstallInkPicker]):
3875         * UIProcess/ios/WKInkPickerView.h: Renamed from Source/WebKit/UIProcess/ios/WKInkPickerControl.h.
3876         * UIProcess/ios/WKInkPickerView.mm: Renamed from Source/WebKit/UIProcess/ios/WKInkPickerControl.mm.
3877         (-[WKInkPickerView initWithDrawingView:]):
3878         (-[WKInkPickerView didPickInk]):
3879         (-[WKInkPickerView inlineInkPickerDidToggleRuler:]):
3880         (-[WKInkPickerView inlineInkPicker:didSelectTool:]):
3881         (-[WKInkPickerView inlineInkPicker:didSelectColor:]):
3882         (-[WKInkPickerView inkPickerSize]):
3883         (-[WKInkPickerView layoutSubviews]):
3884         (-[WKInkPickerView sizeThatFits:]):
3885         (-[WKInkPickerView viewControllerForPopoverPresentationFromInlineInkPicker:]):
3886         * WebKit.xcodeproj/project.pbxproj:
3887         Make WKInkPickerView a WKWebView subview instead of an inputView.
3888         Also, don't force the keyboard to be visible when an editable image is focused.
3889
3890 2018-12-19  Eric Carlson  <eric.carlson@apple.com>
3891
3892         [MediaStream] Force system camera/microphone TCC prompt if necessary
3893         https://bugs.webkit.org/show_bug.cgi?id=192820
3894         <rdar://problem/42680098>
3895
3896         Reviewed by Jer Noble.
3897
3898         * UIProcess/Cocoa/UIDelegate.mm:
3899         (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest): Enable TCC check 
3900         and prompt on Mojave.
3901
3902 2018-12-19  Megan Gardner  <megan_gardner@apple.com>
3903
3904         Allow clients to set the navigator platform
3905         https://bugs.webkit.org/show_bug.cgi?id=192735
3906
3907         Reviewed by Tim Horton.
3908
3909         Add private API to allow clients to override the default navigator
3910         platform. Some websites check for the platform, which 
3911         interfears with our request desktop site feature. This should
3912         help more sites function as expected.
3913
3914         * Shared/WebsitePoliciesData.cpp:
3915         (WebKit::WebsitePoliciesData::encode const):
3916         (WebKit::WebsitePoliciesData::decode):
3917         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
3918         * Shared/WebsitePoliciesData.h:
3919         * UIProcess/API/APIWebsitePolicies.cpp:
3920         (API::WebsitePolicies::data):
3921         * UIProcess/API/APIWebsitePolicies.h:
3922         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
3923         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
3924         (-[_WKWebsitePolicies setCustomNavigatorPlatform:]):
3925         (-[_WKWebsitePolicies customNavigatorPlatform]):
3926         * UIProcess/Cocoa/NavigationState.mm:
3927         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
3928
3929 2018-12-19  Truitt Savell  <tsavell@apple.com>
3930
3931         Unreviewed, rolling out r239358.
3932
3933         Revision caused imported/w3c/web-platform-tests/IndexedDB/ to
3934         crash on Debug bots
3935
3936         Reverted changeset:
3937
3938         "Clean up IndexedDB files between tests"
3939         https://bugs.webkit.org/show_bug.cgi?id=192796
3940         https://trac.webkit.org/changeset/239358
3941
3942 2018-12-18  Alex Christensen  <achristensen@webkit.org>
3943
3944         REGRESSION(r239134) iOS safe browsing warning unable to show details
3945         https://bugs.webkit.org/show_bug.cgi?id=192837
3946
3947         Reviewed by Tim Horton.
3948
3949         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
3950         (-[WKSafeBrowsingWarning addContent]):
3951         I had a fragile design that relied on the internal view heirarchy structure of UIScrollView,
3952         which I changed in r239134 by introducing a layout which changed where its scrollbars were in the view heirarchy.
3953         I now have a more robust design that saves a WeakObjCPtr to the view I need to traverse to.
3954         Testing is problematic because this had to do with scrollbars and UIScrollView internals which seem to behave
3955         differently in TestWebKitAPI, but I verified manually that this fixes the issue.
3956
3957 2018-12-18  Fujii Hironori  <Hironori.Fujii@sony.com>
3958
3959         [Win][Clang] Fix compilation warnings under Source/WebKit directory
3960         https://bugs.webkit.org/show_bug.cgi?id=192695
3961
3962         Reviewed by Alex Christensen.
3963
3964         * NetworkProcess/cache/NetworkCacheData.cpp:
3965         (makeSalt): Enclosed by #if !OS(WINDOWS).
3966         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
3967         (WebKit::NetworkCache::directoryEntryType): Ditto.
3968         * Platform/win/ModuleWin.cpp:
3969         (WebKit::Module::platformFunctionPointer const): Cast a function pointer with reinterpret_cast<void*>().
3970         * UIProcess/DrawingAreaProxyImpl.cpp:
3971         (WebKit::DrawingAreaProxyImpl::DrawingMonitor::DrawingMonitor):
3972         Moved the initializer of m_webPage in order to be encluded by #if PLATFORM(GTK).
3973         * UIProcess/DrawingAreaProxyImpl.h: Ditto.
3974         * UIProcess/Launcher/win/ProcessLauncherWin.cpp:
3975         (WebKit::processName): Removed the duplicated 'const' type qualifier.
3976         * UIProcess/win/WebInspectorProxyWin.cpp:
3977         (WebKit::WebInspectorProxy::platformAttach): Removed an unused variable.
3978         (WebKit::WebInspectorProxy::platformDetach): Ditto.
3979         * UIProcess/win/WebPopupMenuProxyWin.cpp: Ditto.
3980         * UIProcess/win/WebView.cpp:
3981         (WebKit::WebView::paint): Ditto.
3982         (WebKit::WebPopupMenu::setUpPlatformData): Ditto.
3983         * UIProcess/win/WebPopupMenuProxyWin.h: Marked override methods with 'override'.
3984         * WebProcess/WebCoreSupport/curl/WebFrameNetworkingContext.h: Ditto.
3985         * WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp: Removed an unused variable.