b0c78392524e10a903328dcef9b2f7d3c265ff4b
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-06-03  Andy Estes  <aestes@apple.com>
2
3         [Wi-Fi Assertions] Resume assertions when NetworkProcess::cancelPrepareToSuspend is called
4         https://bugs.webkit.org/show_bug.cgi?id=186247
5
6         Reviewed by Tim Horton.
7
8         Since we suspended assertions in prepareToSuspend, we need to resume them if
9         cancelPrepareToSuspend is called.
10
11         * NetworkProcess/NetworkProcess.cpp:
12         (WebKit::NetworkProcess::cancelPrepareToSuspend):
13
14 2018-06-03  Andy Estes  <aestes@apple.com>
15
16         [iOS] Add a needed networking process entitlement
17         https://bugs.webkit.org/show_bug.cgi?id=186246
18         <rdar://problem/39578861>
19
20         Reviewed by Brent Fulgham.
21
22         Also sorted the existing entitlements.
23
24         * Configurations/Network-iOS.entitlements:
25
26 2018-06-03  Brent Fulgham  <bfulgham@apple.com>
27
28         Make sure that the fencePort received over IPC has the expected disposition (SEND)
29         https://bugs.webkit.org/show_bug.cgi?id=186211
30         <rdar://problem/37814171>
31
32         Reviewed by Geoffrey Garen.
33
34         It is possible (though very unlikely) for a message to be recevied that has the wrong mach port disposition.
35         If this happens, we shouldn't manipulate the passed mach_port_t or pass it on to other API. We already
36         drop messages that violate this expectation in the IPC layer, but code handling IPC::Attachment data types
37         are not checking this value.
38
39         * WebProcess/WebPage/WebPage.cpp:
40         (WebKit::WebPage::setTopContentInsetFenced):
41         * WebProcess/cocoa/VideoFullscreenManager.mm:
42         (WebKit::VideoFullscreenManager::setVideoLayerFrameFenced):
43
44 2018-06-02  Chris Dumez  <cdumez@apple.com>
45
46         Unreviewed, rolling out r232275.
47
48         May have caused a ~1% PLT regression on iOS
49
50         Reverted changeset:
51
52         "Store 0-lifetime stylesheets / scripts into the disk cache
53         for faster history navigations"
54         https://bugs.webkit.org/show_bug.cgi?id=186060
55         https://trac.webkit.org/changeset/232275
56
57 2018-06-02  Jeremy Jones  <jeremyj@apple.com>
58
59         Make WKWebView firstResponder after entering or exiting fullscreen.
60         https://bugs.webkit.org/show_bug.cgi?id=186088
61         rdar://problem/40387859
62
63         Reviewed by Jer Noble.
64
65         Update first responder when WKWebView moves to a new window, otherwise there won't be a first responder.
66
67         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
68         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
69         (-[WKFullScreenWindowController _completedExitFullScreen]):
70
71 2018-06-02  Jeremy Jones  <jeremyj@apple.com>
72
73         Exit fullscreen when javascript alerts are presented.
74         https://bugs.webkit.org/show_bug.cgi?id=185619
75         rdar://problem/35724264
76
77         Reviewed by Jer Noble.
78
79         Prevent users from being trapped in fullscreen by alert cycles.
80         Prevent fullscreen from becoming unresponsive due to alerts hidden behind fullscreen.
81
82         Fullscreen exit is initiated here in the UI process so that fullscreen UI is torn down immediately,
83         before the alert is shown.
84
85         * UIProcess/WebPageProxy.cpp:
86         (WebKit::WebPageProxy::exitFullscreenImmediately):
87         (WebKit::WebPageProxy::runJavaScriptAlert):
88         (WebKit::WebPageProxy::runJavaScriptConfirm):
89         (WebKit::WebPageProxy::runJavaScriptPrompt):
90         * UIProcess/WebPageProxy.h:
91
92 2018-06-02  Youenn Fablet  <youenn@apple.com>
93
94         Add a sandbox profile for com.cisco.webex.plugin.gpc64 plugin
95         https://bugs.webkit.org/show_bug.cgi?id=186110
96
97         Reviewed by Brent Fulgham.
98
99         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: Webex needs to create some symlinks.
100         * Resources/PlugInSandboxProfiles/com.cisco.webex.plugin.gpc64.sb: Added.
101         * WebKit.xcodeproj/project.pbxproj:
102
103 2018-06-01  Wenson Hsieh  <wenson_hsieh@apple.com>
104
105         [Extra zoom mode] The user should always be able to double tap to zoom to a scale of at least 1
106         https://bugs.webkit.org/show_bug.cgi?id=186209
107         <rdar://problem/40529255>
108
109         Reviewed by Tim Horton.
110
111         Tweaks the way double-tap-to-zoom scales are determined in extra zoom mode. Rather than zooming to make the 50th
112         and 90th percentiles of text in the document legible, only consider the 90th percentile of text size when
113         determining zoom scale, and fix the other potential zoom scale at 1; additionally, if the zoom scales are close
114         (within 0.3 of each other), snap the lower zoom scale to the higher value.
115
116         This results in the following changes in behavior:
117         -   Enables double tap to zoom in cases where all the text in the page is already legible.
118         -   On pages with mobile viewports, usually allows the user to toggle between initial scale and a scale of 1.
119         -   If a significant portion of text is unusually small, the zoomed-in scale may exceed 1.
120
121         Test: fast/events/extrazoom/double-tap-to-zoom-with-large-text.html
122
123         * WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
124         (WebKit::ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture):
125         (WebKit::ViewGestureGeometryCollector::computeTextLegibilityScales):
126
127 2018-06-01  Jeremy Jones  <jeremyj@apple.com>
128
129         Keyboard focus should exit fullscreen.
130         https://bugs.webkit.org/show_bug.cgi?id=185617
131         rdar://problem/34697938
132
133         Reviewed by Ryosuke Niwa.
134
135         While in element fullscreen, initiating keyboard focus should exit fullscreen in iOS.
136
137         * WebProcess/WebPage/WebPage.cpp:
138         (WebKit::WebPage::elementDidFocus):
139
140 2018-06-01  Chris Dumez  <cdumez@apple.com>
141
142         Regression(r230567): Unable to log into twitter.com in private sessions
143         https://bugs.webkit.org/show_bug.cgi?id=186205
144         <rdar://problem/40670799>
145
146         Reviewed by Youenn Fablet.
147
148         We were using the same SWServer for all private sessions and the SWServer's sessionID would
149         be legacyPrivateSessionID(). As a result, the service worker's sessionID would be legacyPrivateSessionID()
150         as well and would not match the sessionID of its client pages. This sessionID mismatch was 
151         causing the breakage.
152
153         Instead of using the same SWServer of all private sessions, we now go back to using a SWServer
154         per private session. However, we now make sure that the SWServer gets destroyed whenever its
155         corresponding session gets destroyed.
156
157         * NetworkProcess/NetworkProcess.cpp:
158         (WebKit::NetworkProcess::destroySession):
159         * NetworkProcess/cache/CacheStorageEngine.cpp:
160         (WebKit::CacheStorage::Engine::from):
161         * StorageProcess/StorageProcess.cpp:
162         (WebKit::StorageProcess::destroySession):
163         (WebKit::StorageProcess::swServerForSession):
164         * StorageProcess/StorageProcess.h:
165         * StorageProcess/StorageProcess.messages.in:
166         * UIProcess/WebProcessPool.cpp:
167         (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
168         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
169         (WebKit::WebsiteDataStore::~WebsiteDataStore):
170
171         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
172         * UIProcess/WebsiteData/WebsiteDataStore.h:
173         (WebKit::WebsiteDataStore::weakPtrFactory const):
174         Fix memory leak caused by a reference cycle between the WebsiteDataStore and its
175         WebResourceLoadStatisticsStore, by using WeakPtr to break the cycle. This was causing
176         us to leak WebsiteDataStore objects, which would prevent the destruction of sessions.
177
178
179 2018-06-01  Youenn Fablet  <youenn@apple.com>
180
181         Add an option to restrict communication to localhost sockets
182         https://bugs.webkit.org/show_bug.cgi?id=186208
183
184         Reviewed by Eric Carlson.
185
186         Implement restriction to localhost sockets by setting any IP address to 127.0.0.1.
187         This is done on WebProcess side just before requesting to open the socket by NetworkProcess.
188
189         * WebProcess/Network/webrtc/LibWebRTCNetwork.h:
190         (WebKit::LibWebRTCNetwork::disableNonLocalhostConnections):
191         * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
192         (WebKit::LibWebRTCProvider::disableNonLocalhostConnections):
193         (WebKit::LibWebRTCProvider::registerMDNSName):
194         * WebProcess/Network/webrtc/LibWebRTCProvider.h:
195         * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
196         (WebKit::prepareSocketAddress):
197         (WebKit::LibWebRTCSocketFactory::CreateServerTcpSocket):
198         (WebKit::LibWebRTCSocketFactory::CreateUdpSocket):
199         (WebKit::LibWebRTCSocketFactory::CreateClientTcpSocket):
200         * WebProcess/Network/webrtc/LibWebRTCSocketFactory.h:
201
202 2018-06-01  Chris Dumez  <cdumez@apple.com>
203
204         Regression(r230876): Swipe navigation snapshot may get removed too early
205         https://bugs.webkit.org/show_bug.cgi?id=186168
206         <rdar://problem/39743617>
207
208         Reviewed by Tim Horton.
209
210         The swipe navigation snapshot would get removed too early when receiving a paint
211         event after requesting a history navigation but before the provisional load has
212         actually started. This is because of the asynchronous navigation policy decision
213         which occurs after requesting to navigate. To address the issue, we now start
214         listening for events only after the provisional load has started.
215
216         * UIProcess/API/Cocoa/WKWebView.mm:
217         (-[WKWebView _didStartProvisionalLoadForMainFrame]):
218         * UIProcess/API/Cocoa/WKWebViewInternal.h:
219         * UIProcess/Cocoa/ViewGestureController.cpp:
220         (WebKit::ViewGestureController::didStartProvisionalLoadForMainFrame):
221         (WebKit::ViewGestureController::didReachMainFrameLoadTerminalState):
222         (WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame):
223         * UIProcess/Cocoa/ViewGestureController.h:
224         * UIProcess/ios/PageClientImplIOS.mm:
225         (WebKit::PageClientImpl::didStartProvisionalLoadForMainFrame):
226         * UIProcess/ios/ViewGestureControllerIOS.mm:
227         (WebKit::ViewGestureController::endSwipeGesture):
228         * UIProcess/mac/PageClientImplMac.h:
229         * UIProcess/mac/PageClientImplMac.mm:
230         (WebKit::PageClientImpl::didStartProvisionalLoadForMainFrame):
231         * UIProcess/mac/ViewGestureControllerMac.mm:
232         (WebKit::ViewGestureController::endSwipeGesture):
233
234 2018-06-01  Jiewen Tan  <jiewen_tan@apple.com>
235
236         Unreviewed, build fix for r232276.
237
238         iOS sandbox profiles don't preprocess macros. Therefore, remove the whole
239         macro condition block.
240
241         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
242
243 2018-06-01  Sihui Liu  <sihui_liu@apple.com>
244
245         Stop using StorageTracker.db in LocalStorageDatabaseTracker
246         https://bugs.webkit.org/show_bug.cgi?id=186104
247
248         Reviewed by Geoffrey Garen.
249
250         Stop using StorageTracker.db and stop caching origins in LocalStorageDatabaseTracker for efficiency 
251         and simplicity. Since functions in LocalStorageDatabaseTracker are not frequently called, we get 
252         little benefits from caching origins.
253
254         * Platform/Logging.h:
255         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
256         (WKKeyValueStorageManagerGetStorageDetailsByOrigin):
257         * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
258         (WebKit::LocalStorageDatabaseTracker::LocalStorageDatabaseTracker):
259         (WebKit::LocalStorageDatabaseTracker::didOpenDatabaseWithOrigin):
260         (WebKit::LocalStorageDatabaseTracker::deleteDatabaseWithOrigin):
261         (WebKit::LocalStorageDatabaseTracker::deleteAllDatabases):
262         (WebKit::LocalStorageDatabaseTracker::databasesModifiedSince):
263         (WebKit::LocalStorageDatabaseTracker::origins const):
264         (WebKit::LocalStorageDatabaseTracker::originDetails):
265         (WebKit::LocalStorageDatabaseTracker::databasePath const):
266         (WebKit::fileCreationTime): Deleted.
267         (WebKit::fileModificationTime): Deleted.
268         (WebKit::LocalStorageDatabaseTracker::trackerDatabasePath const): Deleted.
269         (WebKit::LocalStorageDatabaseTracker::openTrackerDatabase): Deleted.
270         (WebKit::LocalStorageDatabaseTracker::importOriginIdentifiers): Deleted.
271         (WebKit::LocalStorageDatabaseTracker::updateTrackerDatabaseFromLocalStorageDatabaseFiles): Deleted.
272         (WebKit::LocalStorageDatabaseTracker::addDatabaseWithOriginIdentifier): Deleted.
273         (WebKit::LocalStorageDatabaseTracker::removeDatabaseWithOriginIdentifier): Deleted.
274         (WebKit::LocalStorageDatabaseTracker::pathForDatabaseWithOriginIdentifier): Deleted.
275         * UIProcess/WebStorage/LocalStorageDatabaseTracker.h:
276         * UIProcess/WebStorage/StorageManager.h:
277
278 2018-06-01  Michael Catanzaro  <mcatanzaro@igalia.com>
279
280         [GTK] Crash in WebKitFaviconDatabase when pageURL is unset
281         https://bugs.webkit.org/show_bug.cgi?id=186164
282
283         Reviewed by Carlos Garcia Campos.
284
285         PageURL can legitimately be null here if JavaScript does something silly with window.open.
286
287         * UIProcess/API/glib/WebKitFaviconDatabase.cpp:
288         (webkitFaviconDatabaseSetIconURLForPageURL):
289         (webkitFaviconDatabaseSetIconForPageURL):
290
291 2018-05-31  Brian Burg  <bburg@apple.com>
292
293         [Cocoa] Web Automation: use the session delegate to perform window maximize
294         https://bugs.webkit.org/show_bug.cgi?id=186167
295         <rdar://problem/40544391>
296
297         Reviewed by Timothy Hatcher.
298
299         Add plumbing to hand off window maximizing to the session delegate.
300
301         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
302         * UIProcess/Cocoa/AutomationSessionClient.h:
303         * UIProcess/Cocoa/AutomationSessionClient.mm:
304         (WebKit::AutomationSessionClient::AutomationSessionClient):
305         (WebKit::AutomationSessionClient::requestMaximizeWindowOfPage):
306
307 2018-06-01  Carlos Garcia Campos  <cgarcia@igalia.com>
308
309         Unreviewed. Try to fix GTK+ build with old versions of GTK+ after r232390.
310
311         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
312         (WebKit::WebPopupMenuProxyGtk::showPopupMenu):
313
314 2018-06-01  Carlos Garcia Campos  <cgarcia@igalia.com>
315
316         [GTK] Switch to use a popup window with a tree view instead of a menu for option menu default implementation
317         https://bugs.webkit.org/show_bug.cgi?id=186146
318
319         Reviewed by Michael Catanzaro.
320
321         It's more convenient to use than the menu.
322
323         * UIProcess/API/gtk/WebKitPopupMenu.cpp:
324         (WebKit::menuCloseCallback):
325         (WebKit::WebKitPopupMenu::activateItem):
326         * UIProcess/API/gtk/WebKitPopupMenu.h:
327         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
328         (WebKit::WebPopupMenuProxyGtk::WebPopupMenuProxyGtk):
329         (WebKit::WebPopupMenuProxyGtk::selectItem):
330         (WebKit::WebPopupMenuProxyGtk::activateItem):
331         (WebKit::WebPopupMenuProxyGtk::activateItemAtPath):
332         (WebKit::WebPopupMenuProxyGtk::treeViewRowActivatedCallback):
333         (WebKit::WebPopupMenuProxyGtk::treeViewButtonReleaseEventCallback):
334         (WebKit::WebPopupMenuProxyGtk::buttonPressEventCallback):
335         (WebKit::WebPopupMenuProxyGtk::keyPressEventCallback):
336         (WebKit::WebPopupMenuProxyGtk::createPopupMenu):
337         (WebKit::WebPopupMenuProxyGtk::show):
338         (WebKit::WebPopupMenuProxyGtk::showPopupMenu):
339         (WebKit::WebPopupMenuProxyGtk::hidePopupMenu):
340         (WebKit::WebPopupMenuProxyGtk::cancelTracking):
341         (WebKit::WebPopupMenuProxyGtk::typeAheadFindIndex):
342         (WebKit::WebPopupMenuProxyGtk::typeAheadFind):
343         * UIProcess/gtk/WebPopupMenuProxyGtk.h:
344
345 2018-05-31  Per Arne Vollan  <pvollan@apple.com>
346
347         Add OpenGL display mask to WebPage creation parameters.
348         https://bugs.webkit.org/show_bug.cgi?id=186163
349         <rdar://problem/40634504>
350
351         Reviewed by Brent Fulgham.
352
353         To make sure the OpenGL display mask is always available, include it in the WebPage creation parameters.
354         The OpenGL display mask is sent to the WebProcess when the platform display ID changes, but that is not
355         early enough in all cases. If the OpenGL display mask is not set, only OpenGL software rendering is offered
356         on some hardware configurations.
357
358         * Shared/WebPageCreationParameters.cpp:
359         (WebKit::WebPageCreationParameters::encode const):
360         (WebKit::WebPageCreationParameters::decode):
361         * Shared/WebPageCreationParameters.h:
362         * UIProcess/WebPageProxy.cpp:
363         (WebKit::WebPageProxy::creationParameters):
364         * WebProcess/WebPage/WebPage.cpp:
365         (WebKit::m_credentialsMessenger):
366
367 2018-05-31  Brent Fulgham  <bfulgham@apple.com>
368
369         Add a rule to allow reading files with prefix /private/var/db/CVMS/cvmsCodeSignObj
370         https://bugs.webkit.org/show_bug.cgi?id=186157
371         <rdar://problem/40666437>
372
373         Reviewed by Eric Carlson.
374
375         * WebProcess/com.apple.WebProcess.sb.in:
376
377 2018-05-31  Megan Gardner  <megan_gardner@apple.com>
378
379         Add setting to allow override screen size to be disabled.
380         https://bugs.webkit.org/show_bug.cgi?id=186109
381
382         Reviewed by Andy Estes.
383
384         Pipe the needed settings through to WebCore.
385
386         * Shared/WebPreferences.yaml:
387         * UIProcess/WebPageProxy.cpp:
388         (WebKit::m_configurationPreferenceValues):
389
390 2018-05-31  Brent Fulgham  <bfulgham@apple.com>
391
392         [macOS] Add JIT entitlements to WebContent process and plugin process on macOS
393         https://bugs.webkit.org/show_bug.cgi?id=184485
394         <rdar://problem/37556535>
395
396         Reviewed by Dan Bernstein.
397
398         This patch builds on the changes from Bug 185526 to add support for a JIT entitlement. It makes the
399         following changes:
400
401         1. Adds a new 'WebContent-OSX.entitlements file that unconditionally adds the JIT entitlement for all builds.
402         2. Modifies the PluginService.entitlements to unconditionally add the JIT entitlement.
403
404         * Configurations/PluginService.entitlements: Updated to add the JIT entitlement.
405         * Configurations/WebContent-OSX.entitlements: Updated to add the JIT entitlement.
406         * Configurations/WebContentService.xcconfig: Updated to use the new 'WebContent-OSX.entitlements' file.
407         * WebKit.xcodeproj/project.pbxproj:
408
409 2018-05-31  Brent Fulgham  <bfulgham@apple.com>
410
411         Don't attempt to extend sandbox when running tests with mock media devices
412         https://bugs.webkit.org/show_bug.cgi?id=186150
413         <rdar://problem/40690875>
414
415         Reviewed by Alexey Proskuryakov.
416
417         Avoid attempting to issue a sandbox extension to actual media devices when
418         running with Mock capture devices.
419
420         Also handle the 'denyNextRequest' test state outside of the USE(APPLE_INTERNAL_SDK)
421         guards, since it is needed for Open Source builds as well.
422
423         * UIProcess/UserMediaProcessManager.cpp:
424         (WebKit::UserMediaProcessManager::willCreateMediaStream):
425
426 2018-05-31  Antti Koivisto  <antti@apple.com>
427
428         WebKit memory management: Safari jetsams on some websites when zooming and scrolling
429         https://bugs.webkit.org/show_bug.cgi?id=186091
430         <rdar://problem/36315010>
431
432         Reviewed by Geoff Garen.
433
434         When zooming a page rapidly the visible rect and the page zoom level may get momentarily out of sync.
435         When this happens we may generate tiles for a much larger area than needed and run out of memory
436         building the next layer tree transaction. Running out of memory is more likely if the page has lots of
437         tiled layers in addition to the main content layer.
438
439         We already have code for dealing with the scale mismatch for zoom-out case (where this would cause
440         visibly missing tiles). This patch enables the same exact adjustment for zoom-in case (where the
441         symptom is creating too many tiles).
442
443         * WebProcess/WebPage/ios/WebPageIOS.mm:
444         (WebKit::adjustExposedRectForNewScale):
445
446         Do some renames to make it clear that this can both expand and contract the visible rect.
447         Bail out if there is nothing to do.
448
449         (WebKit::WebPage::updateVisibleContentRects):
450
451         Call adjustExposedRectForNewScale directly and unconditionally.
452
453         (WebKit::adjustExposedRectForBoundedScale): Deleted.
454
455 2018-05-30  Yusuke Suzuki  <utatane.tea@gmail.com>
456
457         [JSC] Pass VM& parameter as much as possible
458         https://bugs.webkit.org/show_bug.cgi?id=186085
459
460         Reviewed by Saam Barati.
461
462         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
463         (WebKit::NPJSObject::hasMethod):
464         (WebKit::NPJSObject::construct):
465         (WebKit::NPJSObject::invoke):
466
467 2018-05-30  Brent Fulgham  <bfulgham@apple.com>
468
469         [macOS] WebProcess needs TCC entitlements for media capture (Take 2)
470         https://bugs.webkit.org/show_bug.cgi?id=185526
471         <rdar://problem/36674649>
472
473         Reviewed by Alexey Proskuryakov.
474
475         In Bug 181995 I added TCC entitlements for media capture to the macOS entitlements used for
476         relocatable builds. These changes also need to apply to system builds of WebKit.
477
478         Previously we had not needed an entitlements file for system builds of WebKit, so only provided
479         an entitlements file for our relocatable build targets. Now we need entitlements when building
480         on recent macOS targets using internal SDKs.
481
482         Since these various scenarios are beginning to multiple, this patch dynamically generates the
483         entitlements file.
484
485         This patch does the following:
486
487         1. Changes the "WebContent-OSX.entitlements" to hold the TCC entitlements needed for media capture, and rename
488            to "WebContent-OSX-restricted.entitlements".
489         2. Removes the unneeded "com.apple.private.xpc.domain-extension" from WebContent-OSX.entitlement, and dynamically
490            adds it using a new build step using the script 'process-webcontent-entitlements.sh'
491         3. Updates DebugRelease.xcconfig to use the 'Safari Engineering' signing key for internal builds.
492         4. Updates WebContentService.xcconfig to remove the CODE_SIGN_ENTITLEMENTS_OSX_WITH_XPC_DOMAIN_EXTENSION_YES target
493            since we no longer need a custom entitlement file for this case.
494         5. Updates WebContentService.Development.xcconfig to remove CODE_SIGN_ENTITLEMENTS_COCOA_TOUCH_NO since it is no
495            longer needed.
496         6. Deletes the file Configurations/WebContent.Development.entitlements since it is no longer needed.
497         7. Revises the WebContent process sandbox to allow camera and microphone access without needing TCC
498            entitlements, since those cannot be applied without an internal SDK.
499         8. Revises the UserMediaProcessManager to not pass dynamic sandbox extensions to the WebContent process
500            when building with the public SDK since those entitlements cannot be added or consumed in Open
501            Source builds.
502
503         We want to use the TCC entitlements when building with the internal SDK on recent macOS builds.
504
505         * Configurations/Base.xcconfig:
506         * Configurations/DebugRelease.xcconfig:
507         * Configurations/WebContent-OSX-restricted.entitlements: Renamed from Source/WebKit/Configurations/WebContent-OSX.entitlements.
508         * Configurations/WebContent.Development.entitlements: Removed.
509         * Configurations/WebContentService.Development.xcconfig:
510         * Configurations/WebContentService.xcconfig:
511         * Scripts/process-webcontent-entitlements.sh: Added.
512         * UIProcess/UserMediaProcessManager.cpp:
513         (WebKit::UserMediaProcessManager::willCreateMediaStream): Don't bother creating and sending sandbox extensions for
514         camera and microphone control for builds that cannot support them.
515         * WebKit.xcodeproj/project.pbxproj:
516
517 2018-05-30  Daniel Bates  <dabates@apple.com>
518
519         NavigationAction does not need to hold initiating DOM Event
520         https://bugs.webkit.org/show_bug.cgi?id=185958
521         <rdar://problem/40531539>
522
523         Reviewed by Simon Fraser.
524
525         Write in terms of NavigationAction::{keyStateEventData, mouseEventDataForFirstMouseEvent}().
526
527         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
528         (WebKit::mouseButtonForMouseEventData):
529         (WebKit::syntheticClickTypeForMouseEventData):
530         (WebKit::clickLocationInRootViewCoordinatesForMouseEventData):
531         (WebKit::InjectedBundleNavigationAction::modifiersForNavigationAction):
532         (WebKit::InjectedBundleNavigationAction::mouseButtonForNavigationAction):
533         (WebKit::InjectedBundleNavigationAction::syntheticClickTypeForNavigationAction):
534         (WebKit::InjectedBundleNavigationAction::clickLocationInRootViewCoordinatesForNavigationAction):
535         (WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction):
536         (WebKit::mouseEventForNavigationAction): Deleted.
537         (WebKit::mouseButtonForMouseEvent): Deleted.
538         (WebKit::syntheticClickTypeForMouseEvent): Deleted.
539         (WebKit::clickLocationInRootViewCoordinatesForMouseEvent): Deleted.
540
541 2018-05-30  Andy Estes  <aestes@apple.com>
542
543         [Cocoa] Add an SPI to suppress connection termination errors from CFNetwork when network interfaces change
544         https://bugs.webkit.org/show_bug.cgi?id=186107
545         <rdar://problem/39338957>
546
547         Reviewed by Brady Eidson.
548
549         Added an SPI which configures a process pool's networking process to set the
550         kCFStreamPropertyAutoErrorOnSystemChange to NO on its NSURLSessionConfigurations.
551         This instructs CFNetwork to not terminate active connections when the system's
552         network interfaces change.
553
554         * NetworkProcess/NetworkProcess.h:
555         (WebKit::NetworkProcess::suppressesConnectionTerminationOnSystemChange const):
556         * NetworkProcess/NetworkProcessCreationParameters.cpp:
557         (WebKit::NetworkProcessCreationParameters::encode const):
558         (WebKit::NetworkProcessCreationParameters::decode):
559         * NetworkProcess/NetworkProcessCreationParameters.h:
560         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
561         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
562         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
563         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
564         * UIProcess/API/APIProcessPoolConfiguration.cpp:
565         (API::ProcessPoolConfiguration::copy):
566         * UIProcess/API/APIProcessPoolConfiguration.h:
567         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
568         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
569         (-[_WKProcessPoolConfiguration suppressesConnectionTerminationOnSystemChange]):
570         (-[_WKProcessPoolConfiguration setSuppressesConnectionTerminationOnSystemChange:]):
571         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
572         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
573
574 2018-05-30  Youenn Fablet  <youenn@apple.com>
575
576         Rename FromOrigin runtime flag to CrossOriginResourcePolicy and enable it by default
577         https://bugs.webkit.org/show_bug.cgi?id=186082
578
579         Reviewed by Chris Dumez.
580
581         * NetworkProcess/NetworkResourceLoadParameters.cpp:
582         (WebKit::NetworkResourceLoadParameters::encode const):
583         (WebKit::NetworkResourceLoadParameters::decode):
584         * NetworkProcess/NetworkResourceLoadParameters.h:
585         * Shared/WebPreferences.yaml:
586         * UIProcess/API/C/WKPreferences.cpp:
587         (WKPreferencesSetCrossOriginResourcePolicyEnabled):
588         (WKPreferencesGetCrossOriginResourcePolicyEnabled):
589         (WKPreferencesSetFromOriginResponseHeaderEnabled): Deleted.
590         (WKPreferencesGetFromOriginResponseHeaderEnabled): Deleted.
591         * UIProcess/API/C/WKPreferencesRef.h:
592         * WebProcess/Network/WebLoaderStrategy.cpp:
593         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
594
595 2018-05-30  Youenn Fablet  <youenn@apple.com>
596
597         Rename CrossOriginResourcePolicy same to same-origin
598         https://bugs.webkit.org/show_bug.cgi?id=186080
599
600         Reviewed by Chris Dumez.
601
602         * NetworkProcess/NetworkLoadChecker.cpp:
603         (WebKit::NetworkLoadChecker::shouldCrossOriginResourcePolicyPolicyCancelLoad):
604
605 2018-05-30  David Kilzer  <ddkilzer@apple.com>
606
607         [iOS] -[WKFullScreenViewController viewWillAppear:] should call [super viewWillAppeear:]
608         <https://webkit.org/b/186103>
609         <rdar://problem/40655695>
610
611         Reviewed by Eric Carlson.
612
613         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
614         (WKFullScreenViewControllerPlaybackSessionModelClient::setInterface):
615         Drive-by clean up.  For consistency, we always use the same
616         variable in the body of the `if` statement that was used in the
617         condition.
618         (-[WKFullScreenViewController viewWillAppear:]): Call
619         [super viewWillAppeear:] to fulfill API contract.
620
621 2018-05-30  Chris Dumez  <cdumez@apple.com>
622
623         Take a background process assertion in WebPageProxy::callAfterNextPresentationUpdate()
624         https://bugs.webkit.org/show_bug.cgi?id=186097
625         <rdar://problem/40651225>
626
627         Reviewed by Dan Bernstein.
628
629         Refactor fix landed in r232298 so that we rely on the existing Callback infrastructure
630         to take a background process assertion.
631
632         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
633         (WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing):
634         * UIProcess/WebPageProxy.cpp:
635         (WebKit::WebPageProxy::callAfterNextPresentationUpdate):
636
637 2018-05-30  Aditya Keerthi  <akeerthi@apple.com>
638
639         Fix the ENABLE(DATALIST_ELEMENT) build
640         https://bugs.webkit.org/show_bug.cgi?id=186105
641
642         Reviewed by Wenson Hsieh.
643
644         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
645
646 2018-05-30  Jiewen Tan  <jiewen_tan@apple.com>
647
648         Unreviewed, a quick build fix for r232276.
649
650         Enabled SecItemShim again as it turns out to be useful for CFNetwork APIs that
651         query Keychains underneath us.
652
653         * NetworkProcess/ios/NetworkProcessIOS.mm:
654         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
655         * NetworkProcess/mac/NetworkProcessMac.mm:
656         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
657
658 2018-05-30  Jer Noble  <jer.noble@apple.com>
659
660         Auto-pip should use main content heuristic.
661         https://bugs.webkit.org/show_bug.cgi?id=186065
662         <rdar://problem/35862502>
663
664         Reviewed by Eric Carlson.
665
666         Make the m_pipStandbyElement clearable, which will allow the auto-pip mechanism to be torn down. Add
667         a WebProcess-side notification when the main content changes, to facilitate this.
668
669         * WebProcess/FullScreen/WebFullScreenManager.cpp:
670         (WebKit::WebFullScreenManager::videoControlsManagerDidChange):
671         (WebKit::WebFullScreenManager::setPIPStandbyElement):
672         (WebKit::WebFullScreenManager::didEnterFullScreen):
673         (WebKit::WebFullScreenManager::willExitFullScreen):
674         * WebProcess/FullScreen/WebFullScreenManager.h:
675         * WebProcess/WebPage/WebPage.cpp:
676         (WebKit::WebPage::videoControlsManagerDidChange):
677         * WebProcess/WebPage/WebPage.h:
678         * WebProcess/cocoa/PlaybackSessionManager.h:
679         * WebProcess/cocoa/PlaybackSessionManager.mm:
680         (WebKit::PlaybackSessionManager::setUpPlaybackControlsManager):
681         (WebKit::PlaybackSessionManager::clearPlaybackControlsManager):
682         (WebKit::PlaybackSessionManager::currentPlaybackControlsElement const):
683
684 2018-05-30  Jer Noble  <jer.noble@apple.com>
685
686         Fix a few issues in WKFullScreenViewController
687         https://bugs.webkit.org/show_bug.cgi?id=186067
688         <rdar://problem/40630944>
689
690         Reviewed by Darin Adler.
691
692         The check in setInterface() is checking the wrong pointer:
693         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
694         (WKFullScreenViewControllerPlaybackSessionModelClient::setInterface):
695
696         The check in -_effectiveFullscreenInsetTop is backwards:
697         (-[WKFullScreenViewController _effectiveFullscreenInsetTop]):
698
699 2018-05-30  Chris Dumez  <cdumez@apple.com>
700
701         Take a background process assertion in WebPageProxy::callAfterNextPresentationUpdate()
702         https://bugs.webkit.org/show_bug.cgi?id=186097
703         <rdar://problem/40651225>
704
705         Reviewed by Tim Horton.
706
707         Take a background process assertion in WebPageProxy::callAfterNextPresentationUpdate(). Otherwise,
708         apps may get stuck on _doAfterNextPresentationUpdate because the WebProcess got suspended.
709
710         * UIProcess/WebPageProxy.cpp:
711         (WebKit::WebPageProxy::callAfterNextPresentationUpdate):
712
713 2018-05-29  Tim Horton  <timothy_horton@apple.com>
714
715         Fix the build
716         https://bugs.webkit.org/show_bug.cgi?id=186078
717
718         Unreviewed build fix.
719
720         * UIProcess/API/Cocoa/WKWebView.mm:
721         (-[WKWebView _denyNextUserMediaRequest]):
722
723 2018-05-29  Andy Estes  <aestes@apple.com>
724
725         [Wi-Fi Assertions] Track whether WiFiAssertionHolder should actually hold a Wi-Fi assertion
726         https://bugs.webkit.org/show_bug.cgi?id=185983
727         <rdar://problem/40205486>
728
729         Reviewed by Tim Horton.
730
731         * Configurations/Network-iOS.entitlements:
732
733         Added a needed entitlement.
734
735         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
736         * NetworkProcess/cocoa/WiFiAssertionHolder.h:
737         (WebKit::WiFiAssertionHolder::shouldHoldWiFiAssertion const):
738
739         Track whether WiFiAssertionHolder should actually hold a Wi-Fi assertion.
740
741         * NetworkProcess/cocoa/WiFiAssertionHolder.mm: Renamed from Source/WebKit/NetworkProcess/cocoa/WiFiAssertionHolder.cpp.
742         (holdWiFiAssertion):
743         (releaseWiFiAssertion):
744         (WebKit::WiFiAssertionHolder::WiFiAssertionHolder):
745         (WebKit::WiFiAssertionHolder::~WiFiAssertionHolder):
746
747         Changed holdWiFiAssertion() and releaseWiFiAssertion() to take the
748         WiFiAssertionHolder as an argument.
749
750         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
751
752         Added a needed sandbox extension.
753
754         * WebKit.xcodeproj/project.pbxproj:
755
756 2018-05-29  Youenn Fablet  <youenn@apple.com>
757
758         Add a consistency check between URL and CFURL
759         https://bugs.webkit.org/show_bug.cgi?id=186057
760         <rdar://problem/40258457>
761
762         Reviewed by Geoff Garen.
763
764         * Shared/Cocoa/WKNSURLExtras.mm:
765         (+[NSURL _web_URLWithWTFString:relativeToURL:]):
766         (urlWithWTFString): Deleted.
767         (+[NSURL _web_URLWithWTFString:]): Deleted.
768
769 2018-05-29  Alex Christensen  <achristensen@webkit.org>
770
771         Remove unused WebPage::dummy
772         https://bugs.webkit.org/show_bug.cgi?id=186068
773
774         Reviewed by Sam Weinig.
775
776         * WebProcess/WebPage/WebPage.cpp:
777         (WebKit::WebPage::dummy): Deleted.
778         * WebProcess/WebPage/WebPage.h:
779         * WebProcess/WebPage/WebPage.messages.in:
780
781 2018-05-29  Per Arne Vollan  <pvollan@apple.com>
782
783         Create typedef for HashMap<PlatformDisplayID, ScreenProperties>
784         https://bugs.webkit.org/show_bug.cgi?id=186056
785
786         Reviewed by Brent Fulgham.
787
788         * Shared/WebProcessCreationParameters.cpp:
789         (WebKit::WebProcessCreationParameters::decode):
790         * Shared/WebProcessCreationParameters.h:
791
792 2018-05-25  Jiewen Tan  <jiewen_tan@apple.com>
793
794         Tighten sandbox profiles for Networking Processes to restrict accesses to macOS/iOS Keychains
795         https://bugs.webkit.org/show_bug.cgi?id=162948
796         <rdar://problem/40558894>
797
798         Reviewed by Brent Fulgham.
799
800         The patch conditionally tighten sandbox profiles for Networking Processes to remove Keychain related
801         permissions and some security permisssions that are not needed. Also it conditionally remove the
802         Process Privilege for Networking Processes to access Credentials.
803
804         In addition, it remove process privilege assertions for SecItemShim as it is supposed to work in processes
805         that don't have privileges to access Keychains and delegate all operations to UI Process via IPC. Also,
806         the patch disables SecItemShim for Networking Process conditionally.
807
808         * Configurations/Network-iOS.entitlements:
809         * NetworkProcess/NetworkProcess.cpp:
810         (WebKit::NetworkProcess::initializeNetworkProcess):
811         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
812         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
813         * Shared/mac/SecItemShim.cpp:
814         (WebKit::sendSecItemRequest):
815         (WebKit::webSecItemCopyMatching):
816         (WebKit::webSecItemAdd):
817         (WebKit::webSecItemUpdate):
818         (WebKit::webSecItemDelete):
819         (WebKit::initializeSecItemShim):
820
821 2018-05-29  Chris Dumez  <cdumez@apple.com>
822
823         Store 0-lifetime stylesheets / scripts into the disk cache for faster history navigations
824         https://bugs.webkit.org/show_bug.cgi?id=186060
825         <rdar://problem/40627270>
826
827         Reviewed by Geoffrey Garen.
828
829         Tweak our storeUnconditionallyForHistoryNavigation logic to match resources whose priority
830         is High, not just VeryHigh. Per logic in CachedResource::defaultPriorityForResourceType(Type),
831         This now matches stylesheets and scripts in addition to main resources.
832
833         I found that in case of a history navigation to apple.com, a significant number of scripts
834         and stylesheets had to be loaded from the network because our previous heuristic decided
835         not to store them (because their priority was not VeryHigh and because their max-age was
836         0).
837
838         * NetworkProcess/cache/NetworkCache.cpp:
839         (WebKit::NetworkCache::makeStoreDecision):
840
841 2018-05-28  Jeff Miller  <jeffm@apple.com>
842
843         Expose additional WKMenuItemIdentifier strings
844         https://bugs.webkit.org/show_bug.cgi?id=186041
845
846         Reviewed by Dan Bernstein.
847
848         Expose identifiers for media-related menu items.
849
850         * UIProcess/API/Cocoa/WKMenuItemIdentifiers.mm:
851         Define new identifiers.
852
853         * UIProcess/API/Cocoa/WKMenuItemIdentifiersPrivate.h:
854         Declare new identifiers.
855
856         * UIProcess/mac/WebContextMenuProxyMac.mm:
857         (WebKit::menuItemIdentifier):
858         Map to new identifiers.
859
860 2018-05-29  Geoffrey Garen  <ggaren@apple.com>
861
862         Removed some unused WebSQL trackers
863         https://bugs.webkit.org/show_bug.cgi?id=186026
864
865         Reviewed by Dan Bernstein.
866
867         * NetworkProcess/NetworkProcess.cpp:
868         (WebKit::NetworkProcess::NetworkProcess):
869         * NetworkProcess/NetworkProcess.h:
870         * WebProcess/WebProcess.cpp:
871         (WebKit::m_nonVisibleProcessCleanupTimer):
872         (WebKit::m_webSQLiteDatabaseTracker): Deleted.
873         * WebProcess/WebProcess.h:
874
875 2018-05-29  Per Arne Vollan  <pvollan@apple.com>
876
877         Follow-up fixes after r228907.
878         https://bugs.webkit.org/show_bug.cgi?id=183338
879
880         Reviewed by Brent Fulgham.
881
882         Add screen properties to the WebProcess creation parameters, instead of sending
883         them in a message to the WebProcess just after starting it up.
884
885         * Shared/WebProcessCreationParameters.cpp:
886         (WebKit::WebProcessCreationParameters::encode const):
887         (WebKit::WebProcessCreationParameters::decode):
888         * Shared/WebProcessCreationParameters.h:
889         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
890         (WebKit::WebProcessPool::platformInitializeWebProcess):
891         * UIProcess/WebProcessPool.cpp:
892         (WebKit::WebProcessPool::initializeNewWebProcess):
893         * WebProcess/cocoa/WebProcessCocoa.mm:
894         (WebKit::WebProcess::platformInitializeWebProcess):
895
896 2018-05-29  Sihui Liu  <sihui_liu@apple.com>
897
898         Unable to remove IndexedDB Databases with Cocoa API removeDataOfTypes
899         https://bugs.webkit.org/show_bug.cgi?id=185835
900         <rdar://problem/39142257>
901
902         Reviewed by Chris Dumez.
903
904         Fix a wrong if condition: databases should be closed and deleted if websiteDataTypes contains 
905         WebsiteDataType::IndexedDBDatabases.
906
907         * StorageProcess/StorageProcess.cpp:
908         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
909
910 2018-05-28  Sam Weinig  <sam@webkit.org>
911
912         Modernize SVGRenderStyleDefs.h
913         https://bugs.webkit.org/show_bug.cgi?id=186024
914
915         Reviewed by Daniel Bates.
916
917         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
918         (WebKit::applyPropertiesToLayer):
919         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
920         (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
921         Update for new enum names.
922
923 2018-05-28  Carlos Garcia Campos  <cgarcia@igalia.com>
924
925         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.21.3 release.
926
927         * gtk/NEWS: Add release notes for 2.21.3.
928
929 2018-05-27  Dan Bernstein  <mitz@apple.com>
930
931         Reverted the changes made for https://webkit.org/b/186016
932
933         They broke the USE(APPLE_INTERNAL_SDK) Sierra build.
934
935 2018-05-27  David Kilzer  <ddkilzer@apple.com>
936
937         [iOS] Fix warnings about leaks found by clang static analyzer
938         <https://webkit.org/b/186009>
939         <rdar://problem/40574267>
940
941         Reviewed by Daniel Bates.
942
943         * UIProcess/Automation/ios/WebAutomationSessionIOS.mm:
944         (WebKit::WebAutomationSession::platformSimulateKeySequence): Fix
945         leak of two WebEvent objects that happened in a loop.
946         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
947         (-[_WKPreviewControllerDelegate previewController:transitionImageForPreviewItem:contentRect:]):
948         Fix leak of a UIImage.
949
950 2018-05-27  Dan Bernstein  <mitz@apple.com>
951
952         [Cocoa] Avoid importing directly from subumbrella frameworks
953         https://bugs.webkit.org/show_bug.cgi?id=186016
954
955         Reviewed by Sam Weinig.
956
957         * Configurations/BaseTarget.xcconfig: Removed -iframework options from OTHER_CFLAGS and
958           OTHER_CPLUSPLUSFLAGS.
959         * UIProcess/Automation/mac/WebAutomationSessionMac.mm: Import Carbon.h instead of an
960           HIToolbox header.
961         * UIProcess/Cocoa/WebViewImpl.mm: Ditto.
962         * UIProcess/mac/WKPrintingView.mm: Import Quartz.h instead of a PDFKit header.
963         * UIProcess/mac/WKTextInputWindowController.mm: Import Carbon.h instead of an HIToolbox
964           header.
965         * WebProcess/Plugins/PDF/PDFAnnotationTextWidgetDetails.h: Import Quartz.h instead of a
966           PDFKit header.
967         * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h: Ditto.
968         * WebProcess/Plugins/PDF/PDFPlugin.mm: Ditto.
969         * WebProcess/Plugins/PDF/PDFPluginAnnotation.mm: Ditto.
970         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm: Ditto.
971         * WebProcess/Plugins/PDF/PDFPluginPasswordField.mm: Ditto.
972         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm: Ditto.
973         * WebProcess/WebPage/mac/WebPageMac.mm: Ditto.
974
975 2018-05-25  Timothy Hatcher  <timothy@apple.com>
976
977         Setting drawsBackground to YES on a WKView doesn't take effect immediately
978         https://bugs.webkit.org/show_bug.cgi?id=185885
979         rdar://problem/39706506
980
981         Reviewed by Simon Fraser.
982
983         * UIProcess/API/Cocoa/WKWebView.mm:
984         (-[WKWebView _initializeWithConfiguration:]): Removed setBackgroundExtendsBeyondPage(true)
985         since it is now the default.
986         * UIProcess/Cocoa/WebViewImpl.mm:
987         (WebKit::WebViewImpl::setDrawsBackground): Make sure updateLayer gets called on the web view
988         by calling setNeedsDisplay:YES.
989         (WebKit::WebViewImpl::setBackgroundColor): Ditto.
990         (WebKit::WebViewImpl::updateLayer): Removed dead code.
991         * UIProcess/WebPageProxy.h: Make m_backgroundExtendsBeyondPage default to true. WebKit was
992         always turning this on during WKWebView initializtion, which would cause the scroll
993         shadow layer to be created, flash black because of no background, then destroyed soon
994         after once WebKit's message to turn it on got delivered.
995         * WebProcess/WebPage/WebPage.cpp:
996         (WebPage::WebPage): Call setBackgroundExtendsBeyondPage earlier to avoid creating the scroll
997         shadow layer, since backgroundShouldExtendBeyondPage defautls to false in WebCore for WK1.
998         (WebKit::WebPage::setDrawsBackground): Use updateBackgroundRecursively to propagate the
999         correct base background color.
1000
1001 2018-05-25  Youenn Fablet  <youenn@apple.com>
1002
1003         Migrate From-Origin to Cross-Origin-Resource-Policy
1004         https://bugs.webkit.org/show_bug.cgi?id=185840
1005
1006         Reviewed by Chris Dumez.
1007
1008         Do Cross-Origin-Resource-Policy (CORP) checks in NetworkLoadChecker instead of NetworkResourceLoader directly.
1009         Make sure CORP only applies to no-cors loads.
1010         Remove ancestor checks and only consider the document origin making the load.
1011         This means that in case of cross-origin redirection to same-origin, the redirection will be CORP-checked,
1012         the final response will not be CORP-checked but will be opaque.
1013
1014         * NetworkProcess/NetworkLoadChecker.cpp:
1015         (WebKit::NetworkLoadChecker::validateCrossOriginResourcePolicyPolicy):
1016         (WebKit::NetworkLoadChecker::validateResponse):
1017         * NetworkProcess/NetworkLoadChecker.h:
1018         * NetworkProcess/NetworkResourceLoader.cpp:
1019         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
1020         (WebKit::NetworkResourceLoader::didReceiveResponse):
1021         (WebKit::NetworkResourceLoader::continueWillSendRedirectedRequest):
1022         (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
1023         (WebKit::NetworkResourceLoader::dispatchWillSendRequestForCacheEntry):
1024         * NetworkProcess/NetworkResourceLoader.h:
1025         * WebProcess/Network/WebLoaderStrategy.cpp:
1026         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
1027         Send ancestor information for navigation loads only.
1028
1029 2018-05-25  Daniel Bates  <dabates@apple.com>
1030
1031         NavigationAction should not hold a strong reference to a Document
1032         https://bugs.webkit.org/show_bug.cgi?id=185712
1033         <rdar://problem/40320916>
1034
1035         Reviewed by Brent Fulgham.
1036
1037         Update code to make use of NavigationAction::requester().
1038
1039         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1040         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1041
1042 2018-05-25  Tim Horton  <timothy_horton@apple.com>
1043
1044         Ensure that the Web Content process doesn't sleep during initialization
1045         https://bugs.webkit.org/show_bug.cgi?id=185975
1046         <rdar://problem/40548159>
1047
1048         Reviewed by Geoffrey Garen.
1049
1050         WebProcessPool::warmInitialProcess isn't worth much (or at least, as much
1051         as it could be) if the Web Content process goes to sleep in the middle
1052         of initializeWebProcess.
1053
1054         Keep the Web Content process alive until it has handled all messages
1055         sent from WebProcessPool::initializeNewWebProcess.
1056
1057         This is a significant speedup on some benchmarks I've been running
1058         that involve prewarming a process long before any content is loaded.
1059
1060         * UIProcess/WebProcessPool.cpp:
1061         (WebKit::WebProcessPool::initializeNewWebProcess):
1062
1063 2018-05-25  Chris Dumez  <cdumez@apple.com>
1064
1065         WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback() unexpectedly constructs a process pool
1066         https://bugs.webkit.org/show_bug.cgi?id=185992
1067
1068         Reviewed by Geoffrey Garen.
1069
1070         Update enableResourceLoadStatisticsAndSetTestingCallback() to pass the right parameter to processPools()
1071         to avoid constructing a process pool when none exist. Also drop the 'resourceLoadStatisticsEnabled'
1072         flag on the WebProcessPool and have it query its data store instead to know if the feature is enabled.
1073
1074         * UIProcess/WebProcessPool.cpp:
1075         (WebKit::WebProcessPool::initializeNewWebProcess):
1076         (WebKit::WebProcessPool::setResourceLoadStatisticsEnabled):
1077         * UIProcess/WebProcessPool.h:
1078         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1079         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
1080
1081 2018-05-25  Chris Dumez  <cdumez@apple.com>
1082
1083         Drop support for NSURLCache in WebKit2
1084         https://bugs.webkit.org/show_bug.cgi?id=185990
1085
1086         Reviewed by Geoffrey Garen.
1087
1088         Drop support for NSURLCache in WebKit2 now that the WebKit network cache is stable.
1089
1090         * NetworkProcess/NetworkProcess.cpp:
1091         (WebKit::NetworkProcess::setCacheModel):
1092         * NetworkProcess/NetworkProcess.h:
1093         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1094         (WebKit::NetworkProcessCreationParameters::encode const):
1095         (WebKit::NetworkProcessCreationParameters::decode):
1096         * NetworkProcess/NetworkProcessCreationParameters.h:
1097         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1098         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
1099         (WebKit::NetworkProcess::clearDiskCache):
1100         (WebKit::NetworkProcess::platformSetURLCacheSize): Deleted.
1101         (WebKit::clearNSURLCache): Deleted.
1102         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
1103         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1104         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1105         (): Deleted.
1106         (WebKit::NetworkSessionCocoa::setUsesNetworkCache): Deleted.
1107         * NetworkProcess/curl/NetworkProcessCurl.cpp:
1108         (WebKit::NetworkProcess::platformSetURLCacheSize): Deleted.
1109         * NetworkProcess/soup/NetworkProcessSoup.cpp:
1110         (WebKit::NetworkProcess::platformSetURLCacheSize): Deleted.
1111         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1112         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
1113         (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
1114         (WebKit::WebProcessPool::isNetworkCacheEnabled): Deleted.
1115         * UIProcess/WebProcessPool.h:
1116         * WebProcess/WebPage/WebFrame.cpp:
1117         (WebKit::WebFrame::suggestedFilenameForResourceWithURL const):
1118         (WebKit::WebFrame::mimeTypeForResourceWithURL const):
1119         * WebProcess/WebPage/WebPage.cpp:
1120         (WebKit::WebPage::getResourceDataFromFrame):
1121         (WebKit::WebPage::hasLocalDataForURL):
1122         * WebProcess/WebPage/WebPage.h:
1123         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
1124         (WebKit::WebPage::platformHasLocalDataForURL): Deleted.
1125         (WebKit::WebPage::cachedResponseMIMETypeForURL): Deleted.
1126         (WebKit::WebPage::cachedSuggestedFilenameForURL): Deleted.
1127         (WebKit::WebPage::cachedResponseDataForURL): Deleted.
1128         * WebProcess/WebPage/ios/WebPageIOS.mm:
1129         (WebKit::WebPage::platformHasLocalDataForURL): Deleted.
1130         (WebKit::WebPage::cachedSuggestedFilenameForURL): Deleted.
1131         (WebKit::WebPage::cachedResponseMIMETypeForURL): Deleted.
1132         (WebKit::WebPage::cachedResponseDataForURL): Deleted.
1133         * WebProcess/WebPage/mac/WebPageMac.mm:
1134         (WebKit::WebPage::accessibilityRemoteObject):
1135         (WebKit::WebPage::platformHasLocalDataForURL): Deleted.
1136         (WebKit::cachedResponseForURL): Deleted.
1137         (WebKit::WebPage::cachedSuggestedFilenameForURL): Deleted.
1138         (WebKit::WebPage::cachedResponseMIMETypeForURL): Deleted.
1139         (WebKit::WebPage::cachedResponseDataForURL): Deleted.
1140         * WebProcess/WebPage/win/WebPageWin.cpp:
1141         (WebKit::WebPage::platformHasLocalDataForURL): Deleted.
1142         (WebKit::WebPage::cachedResponseMIMETypeForURL): Deleted.
1143         (WebKit::WebPage::cachedSuggestedFilenameForURL): Deleted.
1144         (WebKit::WebPage::cachedResponseDataForURL): Deleted.
1145         * WebProcess/WebPage/wpe/WebPageWPE.cpp:
1146         (WebKit::WebPage::platformHasLocalDataForURL): Deleted.
1147         (WebKit::WebPage::cachedResponseMIMETypeForURL): Deleted.
1148         (WebKit::WebPage::cachedSuggestedFilenameForURL): Deleted.
1149         (WebKit::WebPage::cachedResponseDataForURL): Deleted.
1150         * WebProcess/cocoa/WebProcessCocoa.mm:
1151         (WebKit::WebProcess::platformInitializeWebProcess):
1152
1153 2018-05-25  Alex Christensen  <achristensen@webkit.org>
1154
1155         Fix internal iOS builds after r232198
1156         https://bugs.webkit.org/show_bug.cgi?id=185986
1157
1158         * WebProcess/WebPage/ios/WebPageIOS.mm:
1159         (WebKit::WebPage::sendTapHighlightForNodeIfNecessary):
1160
1161 2018-05-25  Alex Christensen  <achristensen@webkit.org>
1162
1163         URL::host should return a StringView to reduce allocations
1164         https://bugs.webkit.org/show_bug.cgi?id=185986
1165
1166         Reviewed by Geoff Garen.
1167
1168         * NetworkProcess/NetworkProcess.cpp:
1169         (WebKit::fetchDiskCacheEntries):
1170         * NetworkProcess/NetworkResourceLoader.cpp:
1171         (WebKit::areFrameAncestorsSameSite):
1172         * NetworkProcess/mac/NetworkProcessMac.mm:
1173         (WebKit::overrideSystemProxies):
1174         * Shared/API/APIURL.h:
1175         (API::URL::host const):
1176         * UIProcess/Automation/WebAutomationSession.cpp:
1177         (WebKit::WebAutomationSession::addSingleCookie):
1178         (WebKit::WebAutomationSession::deleteAllCookies):
1179         * UIProcess/WebProcessProxy.cpp:
1180         (WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
1181         * WebProcess/Plugins/PluginView.cpp:
1182         (WebKit::PluginView::pluginDidReceiveUserInteraction):
1183         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
1184         (WebKit::WebPluginInfoProvider::populatePluginCache):
1185         * WebProcess/WebPage/WebPage.cpp:
1186         (WebKit::needsHiddenContentEditableQuirk):
1187         (WebKit::needsPlainTextQuirk):
1188         (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
1189
1190 2018-05-25  Adrian Perez de Castro  <aperez@igalia.com>
1191
1192         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.21.2 release.
1193
1194         * wpe/NEWS: Add release notes for the 2.21.2 release.
1195
1196 2018-05-25  Chris Dumez  <cdumez@apple.com>
1197
1198         Minor ApplicationCacheStorage clean up
1199         https://bugs.webkit.org/show_bug.cgi?id=185984
1200
1201         Reviewed by Youenn Fablet.
1202
1203         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1204         (WebKit::WebsiteDataStore::fetchDataAndApply):
1205         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1206         (WKBundlePageCopyOriginsWithApplicationCache):
1207
1208 2018-05-25  Chris Dumez  <cdumez@apple.com>
1209
1210         Avoid triggering network cache speculative revalidation for loads allowing expired content
1211         https://bugs.webkit.org/show_bug.cgi?id=185985
1212
1213         Reviewed by Antti Koivisto.
1214
1215         Avoid triggering network cache speculative revalidation for loads allowing expired content
1216         (e.g. history loads, restoring pages after crash or safari relaunch). This causes us to do
1217         unnecessary revalidations, it is both wasteful and bad for performance.
1218
1219         * NetworkProcess/cache/NetworkCache.cpp:
1220         (WebKit::NetworkCache::Cache::retrieve):
1221
1222 2018-05-25  David Kilzer  <ddkilzer@apple.com>
1223
1224         Fix issues with -dealloc methods found by clang static analyzer
1225         <https://webkit.org/b/185887>
1226
1227         Reviewed by Joseph Pecoraro.
1228
1229         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: Drive-by fix
1230         to use `copy` for `mimeType` property.
1231         (-[_WKPreviewControllerDataSource initWithMIMEType:]): Drive-by
1232         fix to use `instancetype` instead of `id`.  Use -copy for
1233         `mimeType` argument to match property definition.
1234         (-[_WKPreviewControllerDataSource dealloc]): Add.  Release
1235         `_completionHandler` and `_mimeType` to fix leaks.
1236         * UIProcess/ios/WKPasswordView.mm:
1237         (-[WKPasswordView dealloc]): Add.  Release
1238         `_userDidEnterPassword` to fix leak.
1239         * UIProcess/ios/fullscreen/WKFullScreenViewController.h:
1240         Drive-by clean-up to make `location` property `copy` instead of
1241         `retain`.
1242         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
1243         (-[WKFullScreenViewController dealloc]): Release `_target` and
1244         `_location` to fix leaks.
1245         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
1246         (-[WKFullscreenAnimationController dealloc]): Add.  Release
1247         `_viewController` to fix leak.
1248         * UIProcess/ios/fullscreen/WKFullscreenStackView.mm:
1249         (@property secondaryMaterialOverlayView): Mark explicitly as
1250         `assign` since this isn't a retained variable.
1251         (@property secondaryMaterialOverlayViewConstraints): Mark
1252         explicitly as `retain` since there is nothing to keep this
1253         object alive.
1254         (+[WKFullscreenStackView secondaryMaterialOverlayView]): Fix
1255         leak by autoreleasing the return value.
1256         (-[WKFullscreenStackView dealloc]): Release retained instance
1257         variables to fix leaks.  Note that `_stackView` and
1258         `_visualEffectView` are internally retained despite their
1259         @property declarations.
1260         (-[WKFullscreenStackView setTargetViewForSecondaryMaterialOverlay:]):
1261         Retain @property targetViewForSecondaryMaterialOverlay to match
1262         its declaration.
1263
1264 2018-05-23  Antoine Quint  <graouts@apple.com>
1265
1266         [Web Animations] Use DEFAULT_EXPERIMENTAL_FEATURES_ENABLED for Web Animations experimental features
1267         https://bugs.webkit.org/show_bug.cgi?id=185919
1268
1269         Reviewed by Dean Jackson.
1270
1271         * Shared/WebPreferences.yaml:
1272
1273 2018-05-24  Dan Bernstein  <mitz@apple.com>
1274
1275         ProcessLauncherMac.mm contains a couple of meaningless #ifndef directives
1276         https://bugs.webkit.org/show_bug.cgi?id=185973
1277
1278         Reviewed by Tim Horton.
1279
1280         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1281         (WebKit::ProcessLauncher::launchProcess): Use #if !ASSERT_DISABLED to guard statements that
1282           are only needed for an assertion, instead of #ifndef _NDEBUG, which is always true.
1283
1284 2018-05-24  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1285
1286         [GTK][WPE] Memory pressure monitor doesn't reliable notify all the subprocesses
1287         https://bugs.webkit.org/show_bug.cgi?id=184261
1288
1289         Reviewed by Carlos Garcia Campos.
1290
1291         On Linux we had two implementations for getting notifications about memory pressure events:
1292         - The memory cgroup (called systemd here).
1293         - The UIProcess memory monitor (which delivered events via a shared eventfd)
1294
1295         The problem with the first is that it was usually not working on a standard machine due to
1296         the special permissions or configurations required for memory cgroups, so the second one
1297         (eventfd) was used as a fall-back in that case.
1298         But this eventfd method is racy with more than one WebKit child process and it wasn't
1299         reliably delivering the notifications.
1300
1301         This patch removes the memory cgroup implementation and modifies the UIProcess memory monitor
1302         to deliver the events via WebKit IPC. This simplifies the code a lot and allows us to have
1303         only one implementation that should work in any Linux machine.
1304
1305         The implementation now also triggers the event with information about the criticalness of it.
1306
1307         Previously a critical event was triggered always at a 95% of pressure.
1308         Now a non-critical one is triggered at 90% and critical remains at a 95%.
1309
1310         Start triggering events early should compensate the fact than triggering the event via WebKit IPC is
1311         a bit slower than doing that via an eventfd (or than listening on the memory cgroup event controller).
1312
1313         The events are delivered to all WebKit childs: WebProcess, NetworkProcess, StorageProcess, PluginProcess.
1314
1315         In the case of the StorageProcess a dummy controller is installed, which currently does nothing,
1316         but leaves a note for a future implementation and at least allows to trigger platformReleaseMemory()
1317         that on Linux/glibc should end calling malloc_trim()
1318
1319         * NetworkProcess/NetworkProcess.cpp:
1320         (WebKit::NetworkProcess::initializeNetworkProcess):
1321         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1322         (WebKit::NetworkProcessCreationParameters::encode const):
1323         (WebKit::NetworkProcessCreationParameters::decode):
1324         * NetworkProcess/NetworkProcessCreationParameters.h:
1325         * PluginProcess/PluginProcess.cpp:
1326         (WebKit::PluginProcess::didReceiveMessage):
1327         (WebKit::PluginProcess::initializePluginProcess):
1328         * Shared/ChildProcess.cpp:
1329         (WebKit::ChildProcess::didReceiveMemoryPressureEvent):
1330         * Shared/ChildProcess.h:
1331         * Shared/ChildProcess.messages.in:
1332         * Shared/Plugins/PluginProcessCreationParameters.cpp:
1333         (WebKit::PluginProcessCreationParameters::encode const):
1334         (WebKit::PluginProcessCreationParameters::decode):
1335         * Shared/Plugins/PluginProcessCreationParameters.h:
1336         * Shared/WebProcessCreationParameters.cpp:
1337         (WebKit::WebProcessCreationParameters::encode const):
1338         (WebKit::WebProcessCreationParameters::decode):
1339         * Shared/WebProcessCreationParameters.h:
1340         * StorageProcess/StorageProcess.cpp:
1341         (WebKit::StorageProcess::initializeProcess):
1342         * UIProcess/Plugins/PluginProcessManager.cpp:
1343         (WebKit::PluginProcessManager::sendMemoryPressureEvent):
1344         * UIProcess/Plugins/PluginProcessManager.h:
1345         * UIProcess/Plugins/PluginProcessProxy.cpp:
1346         (WebKit::PluginProcessProxy::sendMemoryPressureEvent):
1347         (WebKit::PluginProcessProxy::didFinishLaunching):
1348         * UIProcess/Plugins/PluginProcessProxy.h:
1349         * UIProcess/WebProcessPool.cpp:
1350         (WebKit::WebProcessPool::sendMemoryPressureEvent):
1351         (WebKit::WebProcessPool::ensureNetworkProcess):
1352         (WebKit::WebProcessPool::initializeNewWebProcess):
1353         * UIProcess/WebProcessPool.h:
1354         (WebKit::WebProcessPool::sendToStorageProcess):
1355         * UIProcess/linux/MemoryPressureMonitor.cpp:
1356         (WebKit::pollIntervalForUsedMemoryPercentage): Fix equation for calculating the interval percentage.
1357         (WebKit::MemoryPressureMonitor::singleton):
1358         (WebKit::MemoryPressureMonitor::start):
1359         * UIProcess/linux/MemoryPressureMonitor.h:
1360         * WebProcess/WebProcess.cpp:
1361         (WebKit::WebProcess::initializeWebProcess):
1362
1363 2018-05-24  Youenn Fablet  <youenn@apple.com>
1364
1365         Update plugin search path to look for user installed plugins
1366         https://bugs.webkit.org/show_bug.cgi?id=185960
1367
1368         Reviewed by Brent Fulgham.
1369
1370         Now that UIProcess may be sandboxed, the home directory is no longer the user home directory.
1371         Update the path to still look for plugins in the user home directory.
1372
1373         * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
1374         (WebKit::PluginInfoStore::pluginsDirectories):
1375
1376 2018-05-24  Jiewen Tan  <jiewen_tan@apple.com>
1377
1378         Adopt SecKeyProxy SPI in certificate based challenge response code
1379         https://bugs.webkit.org/show_bug.cgi?id=185848
1380         <rdar://problem/34586181>
1381
1382         Reviewed by Alex Christensen.
1383
1384         This patch adopts SecKeyProxy SPI in HTTPS client certificate authentication code.
1385         1) SecKeyProxy is a new SPI to relay crypto operations from one process to another. The owner process of the proxy
1386         will behave like a server, and other owners of the SecKeys created from the proxy's endpoints will then behave
1387         like clients. This client-server model allows more restricted sandbox for client processes, and meanwhile permits
1388         them to relay crypto operations to the server process while maintaining the same SecKey interfaces as used for local operations.
1389         2) Because of the client-server model, the server process, i.e. the UI Process in our case, needs to keep the proxy
1390         object alive long enough for the client process, i.e. Network Processes in our case, to finish all operations, and then destroy
1391         the proxy object afterward. The ideal place to hold such a proxy is WebsiteDataStore such that proxies could live with the
1392         corresponding network session.
1393         3) A new class called SecKeyProxyStore is then created to bind the lifetime of SecKeyProxy to the WebsiteDataStore while initializing
1394         it correctly. At the time the authentication process reaches WebPageProxy::didReceiveAuthenticationChallengeProxy where we have
1395         accesses to the WebsiteDataStore, we haven't yet been able to determine the Credential to authenticate the challenge. Therefore, we
1396         have to reserve a place in the WebsiteDataStore ahead and then fill it with the right Credential. That's why SecKeyProxyStore exists.
1397         In WebPageProxy::didReceiveAuthenticationChallengeProxy, we create a strong reference of SecKeyProxyStore which will eventually hold
1398         a strong reference of the SecKeyProxy, and move it to the WebsiteDataStore. We also create a weak reference to SecKeyProxyStore
1399         and move it to the AuthenticationChallenge. In this way, we indirectly bind the lifetime of SecKeyProxy to the WebsiteDataStore through
1400         the strong reference and also we can initialize the proxy through the weak reference while a credential is finally determined.
1401         4) Endpoints of the SecKeyProxy will be passed to the Network Process for creating the 'remote' SecKey. However, those endpoints are
1402         of NSXPCListenerEndpoint type, which can only be passed with xpc connections and are not compatible with our IPC mechanism. In order
1403         to pass endpoints around, this patch reuses the xpc connection that is used to bootstrap Network Processes from the UI Process. To do
1404         so, it sends xpc messages at the place where original IPC messages are sent and overwrites the boostrap listener of the xpc connection
1405         when Network Process is initialized. From the listener, it continues the original authentication code path.
1406         5) Tests, again, are manually covered by tlstestwebkit.org. Noted, the prompting Keychain dialog in macOS should say Safari instead of
1407         "com.apple.WebKit.Networking*" now.
1408
1409         * Shared/AuthenticationManagerCocoa.mm: Added.
1410         (WebKit::AuthenticationManager::initializeConnection):
1411         * Shared/Authentication/cocoa/AuthenticationManager.h:
1412         * Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.h:
1413         * UIProcess/Authentication/AuthenticationChallengeProxy.cpp:
1414         (WebKit::AuthenticationChallengeProxy::useCredential):
1415         (WebKit::AuthenticationChallengeProxy::setSecKeyProxyStore):
1416         * UIProcess/Authentication/AuthenticationChallengeProxy.h:
1417         * UIProcess/Authentication/cocoa/AuthenticationChallengeProxyCocoa.mm: Added.
1418         (WebKit::AuthenticationChallengeProxy::sendClientCertificateCredentialOverXpc const):
1419         * UIProcess/Authentication/cocoa/SecKeyProxyStore.h: Added.
1420         (WebKit::SecKeyProxyStore::create):
1421         (WebKit::SecKeyProxyStore::isInitialized const):
1422         (WebKit::SecKeyProxyStore::get const):
1423         (WebKit::SecKeyProxyStore::weakPtrFactory const):
1424         * UIProcess/Authentication/cocoa/SecKeyProxyStore.mm: Added.
1425         (WebKit::SecKeyProxyStore::initialize):
1426         * UIProcess/WebPageProxy.cpp:
1427         (WebKit::WebPageProxy::didReceiveAuthenticationChallengeProxy):
1428         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1429         (WebKit::WebsiteDataStore::addSecKeyProxyStore):
1430         * UIProcess/WebsiteData/WebsiteDataStore.h:
1431         * WebKit.xcodeproj/project.pbxproj:
1432
1433 2018-05-24  Megan Gardner  <megan_gardner@apple.com>
1434
1435         Fix Issues with Loupe Gesture
1436         https://bugs.webkit.org/show_bug.cgi?id=185926
1437
1438         Reviewed by Tim Horton.
1439
1440         The loupe gesture was not giving us the correct selection in some situations.
1441
1442         * UIProcess/ios/WKContentViewInteraction.mm:
1443         (-[WKContentView gestureRecognizer:canBePreventedByGestureRecognizer:]):
1444         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
1445         (-[WKContentView setSelectedTextRange:]):
1446         * WebProcess/WebPage/WebPage.h:
1447         * WebProcess/WebPage/ios/WebPageIOS.mm:
1448         (WebKit::WebPage::selectWithGesture):
1449         (WebKit::WebPage::clearSelection):
1450
1451 2018-05-24  Keith Rollin  <krollin@apple.com>
1452
1453         Don't track resource load milestones in private sessions
1454         https://bugs.webkit.org/show_bug.cgi?id=185828
1455         <rdar://problem/40424197>
1456
1457         Reviewed by Brent Fulgham.
1458
1459         Bug 184838 adds the facility for tracing the beginning and ending of
1460         resources loads and reporting so that historical information can be
1461         gathered to assess the health of the networking stack. Disable this
1462         facility for private browsing sessions.
1463
1464         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1465         (WebKit::NetworkConnectionToWebProcess::startTrackingResourceLoad):
1466         (WebKit::NetworkConnectionToWebProcess::stopTrackingResourceLoad):
1467         * NetworkProcess/NetworkConnectionToWebProcess.h:
1468         * NetworkProcess/NetworkResourceLoader.cpp:
1469         (WebKit::NetworkResourceLoader::start):
1470
1471 2018-05-24  Brent Fulgham  <bfulgham@apple.com>
1472
1473         REGRESSION(r224908): [macOS] Media playback not honoring custom caption styles
1474         https://bugs.webkit.org/show_bug.cgi?id=185955
1475         <rdar://problem/40339278>
1476
1477         Reviewed by Eric Carlson.
1478
1479         In r224908 I removed access to the MediaAccessibility mach port, as well as
1480         read/write access to various preferences associated with that process, as it
1481         was no longer needed by modern WebKit media routines.
1482
1483         Detailed testing reveals that read access is still needed to these preferences
1484         to properly handle custom caption styles.
1485
1486         This patch re-enables access to the media accessibility preferences.
1487
1488         * WebProcess/com.apple.WebProcess.sb.in:
1489
1490 2018-05-24  Brent Fulgham  <bfulgham@apple.com>
1491
1492         REGRESSION(r230269): ASSERTION FAILED: sendRightCount == 1 at ProcessLauncherMac.mm(218)
1493         https://bugs.webkit.org/show_bug.cgi?id=185687
1494         <rdar://problem/39386361>
1495
1496         Reviewed by Brady Eidson.
1497
1498         In r230269 I added an assertion to help identify cases where we were doing bad
1499         bookkeeping in our port send rights. I assumed that because we were adding
1500         one send right, that when we went to close down the connection that we should
1501         have only one send right.
1502         
1503         I have since discovered that this assumption is invalid, and that I should
1504         only be checking that we have AT LEAST ONE send right at the time we attempt
1505         to remove it.
1506
1507         This patch changes the assertion to confirm that we have at least one send
1508         right before we remove the send right.
1509
1510         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1511         (WebKit::ProcessLauncher::launchProcess):
1512
1513 2018-05-24  Chris Dumez  <cdumez@apple.com>
1514
1515         Some of the work in initializeLogChannelsIfNecessary() is unnecessary for release builds
1516         https://bugs.webkit.org/show_bug.cgi?id=185951
1517
1518         Reviewed by Geoffrey Garen.
1519
1520         Some of the work in initializeLogChannelsIfNecessary() is unnecessary for release builds and slows down
1521         launch time. In particular, it is unnecessary to read NSDefaults to figure out which logging channels
1522         should be enabled.
1523
1524         * Platform/foundation/LoggingFoundation.mm:
1525         (WebKit::logLevelString):
1526         * Platform/unix/LoggingUnix.cpp:
1527         (WebKit::logLevelString):
1528         * Platform/win/LoggingWin.cpp:
1529         (WebKit::logLevelString):
1530
1531 2018-05-24  Per Arne Vollan  <pvollan@apple.com>
1532
1533         Crash under WebKit::PluginProxy::destroy()
1534         https://bugs.webkit.org/show_bug.cgi?id=185841
1535         <rdar://problem/39936896>
1536
1537         Reviewed by Brent Fulgham.
1538
1539         A release assert in Connection::sencSync is failing since scripts are not allowed in this context,
1540         and the WebKit process is allowed to process incoming messages while waiting for the sync reply.
1541         In this context, scripts are disallowed in the method Element::addShadowRoot. To make sure the
1542         WebContent process will not wait indefinitely for a reply from the Plugin process, use a timeout
1543         of 1 second when sending the message.
1544
1545         * WebProcess/Plugins/PluginProxy.cpp:
1546         (WebKit::PluginProxy::destroy):
1547
1548 2018-05-24  Carlos Garcia Campos  <cgarcia@igalia.com>
1549
1550         Unreviewed. Fix GTK+ input method unit tests after r232049.
1551
1552         Unit tests don't use a WebPageProxy.
1553
1554         * UIProcess/gtk/InputMethodFilter.cpp:
1555         (WebKit::InputMethodFilter::isViewFocused const):
1556         (WebKit::InputMethodFilter::setEnabled):
1557         * UIProcess/gtk/InputMethodFilter.h:
1558
1559 2018-05-24  Carlos Garcia Campos  <cgarcia@igalia.com>
1560
1561         WebDriver: implement maximize, minimize and fullscreen window commands
1562         https://bugs.webkit.org/show_bug.cgi?id=180398
1563
1564         Reviewed by Brian Burg.
1565
1566         * UIProcess/API/APIAutomationSessionClient.h:
1567         (API::AutomationSessionClient::requestMaximizeWindowOfPage): Added to allow clients maximize the window.
1568         * UIProcess/API/glib/WebKitAutomationSession.cpp:
1569         * UIProcess/API/glib/WebKitWebViewPrivate.h:
1570         * UIProcess/API/gtk/WebKitWebViewGtk.cpp:
1571         (WindowStateEvent::WindowStateEvent): Struct to handle window state events.
1572         (WindowStateEvent::~WindowStateEvent): Complete the event.
1573         (WindowStateEvent::complete): Call the completion handler is not called already.
1574         (windowStateEventCallback): Handle window state event changes.
1575         (webkitWebViewMaximizeWindow): Try to maximize the window and wait for the event.
1576         (webkitWebViewMinimizeWindow): Try to minimize the window and wait for the event.
1577         (webkitWebViewRestoreWindow): Try to unmaximize or unminimize the window and wait for the event.
1578         * UIProcess/API/wpe/WebKitWebViewWPE.cpp:
1579         (webkitWebViewMaximizeWindow):
1580         (webkitWebViewMinimizeWindow):
1581         (webkitWebViewRestoreWindow):
1582         * UIProcess/Automation/Automation.json:
1583         * UIProcess/Automation/WebAutomationSession.cpp:
1584         (WebKit::WebAutomationSession::maximizeWindowOfBrowsingContext): Exit fullscreen, restore the window and then
1585         maximize it.
1586         (WebKit::WebAutomationSession::maximizeWindowForPage): Ask the client to maximize the window of page.
1587         * UIProcess/Automation/WebAutomationSession.h:
1588         * UIProcess/Automation/atoms/EnterFullscreen.js:
1589         (enterFullscreen): Return early if fullscreen is disabled or if window is already in fullscreen.
1590
1591 2018-05-23  Eric Carlson  <eric.carlson@apple.com>
1592
1593         Avoid loading AVFoundation to check supported MIME types if possible
1594         https://bugs.webkit.org/show_bug.cgi?id=185839
1595         <rdar://problem/40182010>
1596
1597         Reviewed by Jer Noble.
1598         
1599         * Shared/WebProcessCreationParameters.cpp:
1600         (WebKit::WebProcessCreationParameters::encode const): Encode mediaMIMETypes.
1601         (WebKit::WebProcessCreationParameters::decode): Decode mediaMIMETypes.
1602         * Shared/WebProcessCreationParameters.h:
1603
1604         * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
1605         (WebKit::mediaTypeCache): Static Vector of media MIME types.
1606         (WebKit::WebProcessProxy::cacheMediaMIMETypes): Cache the type list and pass it to every other
1607         process proxy.
1608         (WebKit::WebProcessProxy::cacheMediaMIMETypesInternal): Cache the type list and pass it to the
1609         web process.
1610         (WebKit::WebProcessProxy::mediaMIMETypes): Return the cached type list.
1611
1612         * UIProcess/WebProcessPool.cpp:
1613         (WebKit::WebProcessPool::initializeNewWebProcess): Set parameters.mediaMIMETypes.
1614
1615         * UIProcess/WebProcessProxy.h:
1616         * UIProcess/WebProcessProxy.messages.in: Add CacheMediaMIMETypes.
1617
1618         * WebProcess/WebProcess.h:
1619         * WebProcess/WebProcess.messages.in: Add SetMediaMIMETypes.
1620
1621         * WebProcess/cocoa/WebProcessCocoa.mm:
1622         (WebKit::WebProcess::platformInitializeWebProcess): Cache the MIME types if the list isn't
1623         empty, else register with AVFoundationMIMETypeCache to be notified when it loads types.
1624         AVFoundationMIMETypeCache to 
1625         (WebKit::WebProcess::platformTerminate): Unregister with AVFoundationMIMETypeCache.
1626         (WebKit::WebProcess::setMediaMIMETypes): Pass list of types to AVFoundationMIMETypeCache.
1627
1628 2018-05-23  Brian Burg  <bburg@apple.com>
1629
1630         Web Automation: disable process swap on navigation when an automation session is active
1631         https://bugs.webkit.org/show_bug.cgi?id=185552
1632
1633         Reviewed by Tim Horton.
1634
1635         * UIProcess/WebProcessPool.cpp:
1636         (WebKit::WebProcessPool::processForNavigationInternal):
1637         This is not intended to work right now. Opt out to avoid crashing
1638         later when a process is deallocated unexpectedly.
1639
1640 2018-05-23  Youenn Fablet  <youenn@apple.com>
1641
1642         NetworkLoadChecker should check cached redirections
1643         https://bugs.webkit.org/show_bug.cgi?id=185849
1644
1645         Reviewed by Chris Dumez.
1646
1647         * NetworkProcess/NetworkLoadChecker.cpp:
1648         (WebKit::NetworkLoadChecker::checkRedirection):
1649         Set the resource error url as done by WebCore SubresourceLoader.
1650         * NetworkProcess/NetworkResourceLoader.cpp:
1651         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
1652         Pass the resource request to dispatchWillSendRedirectedRequest now needs it.
1653         (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
1654         Make sure that m_networkLoad is not null before cancelling it since we might be checking a cached redirection.
1655         (WebKit::NetworkResourceLoader::continueWillSendRedirectedRequest):
1656         Ensure the redirect response is coming from the Network before adding it to the cache.
1657         (WebKit::NetworkResourceLoader::dispatchWillSendRequestForCacheEntry):
1658         Call willSendRedirectedRequest to make sure the cached redirect is validated.
1659         * NetworkProcess/NetworkResourceLoader.h:
1660
1661 2018-05-23  Carlos Garcia Campos  <cgarcia@igalia.com>
1662
1663         [GTK] WebDriver: implement AutomationSessionClient::didDisconnectFromRemote
1664         https://bugs.webkit.org/show_bug.cgi?id=185866
1665
1666         Reviewed by Brian Burg.
1667
1668         To handle the case of the session being closed by the browser, for example in case of a network process
1669         crash. This is currently causing WebDriver tests to timeout in the bot.
1670
1671         * UIProcess/API/glib/WebKitAutomationSession.cpp: Add an implementation of didDisconnectFromRemote() to notify
1672         the WebContext that the session will be closed.
1673         * UIProcess/API/glib/WebKitWebContext.cpp: Remove the automation session when closed.
1674         * UIProcess/API/glib/WebKitWebContextPrivate.h:
1675
1676 2018-05-22  Brent Fulgham  <bfulgham@apple.com>
1677
1678         Close access to "lsopen" for non-UI process
1679         https://bugs.webkit.org/show_bug.cgi?id=185890
1680         <rdar://problem/39686511>
1681
1682         Reviewed by Alexey Proskuryakov.
1683
1684         Close down access to 'lsopen' in the iOS sandboxes. These operations are
1685         performed by the UIProcess on behalf of these helper processes.
1686
1687         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
1688         * Resources/SandboxProfiles/ios/com.apple.WebKit.Storage.sb:
1689         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1690
1691 2018-05-22  Dean Jackson  <dino@apple.com>
1692
1693         Optimized path zoom animation needs a valid UIImage and CGRect
1694         https://bugs.webkit.org/show_bug.cgi?id=185883
1695         <rdar://problem/40306056>
1696
1697         Reviewed by Jon Lee.
1698
1699         Take the rectangle that was passed into the ResourceRequest and
1700         use it for the origin of an animation into QuickLook.
1701
1702         * Shared/WebCoreArgumentCoders.cpp:
1703         (IPC::ArgumentCoder<ResourceRequest>::encode):
1704         (IPC::ArgumentCoder<ResourceRequest>::decode):
1705         * UIProcess/Cocoa/DownloadClient.mm:
1706         (WebKit::DownloadClient::didStart):
1707         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
1708         (-[_WKPreviewControllerDelegate initWithSystemPreviewController:fromRect:]):
1709         (-[_WKPreviewControllerDelegate presentingViewController]):
1710         (-[_WKPreviewControllerDelegate previewController:frameForPreviewItem:inSourceView:]):
1711         (-[_WKPreviewControllerDelegate previewController:transitionImageForPreviewItem:contentRect:]):
1712         (WebKit::SystemPreviewController::start):
1713         (-[_WKPreviewControllerDelegate initWithSystemPreviewController:]): Deleted.
1714         * UIProcess/Downloads/DownloadProxy.h:
1715         (WebKit::DownloadProxy::systemPreviewDownloadRect const):
1716         * UIProcess/SystemPreviewController.h:
1717         * UIProcess/WebPageProxy.cpp:
1718         (WebKit::WebPageProxy::syncRootViewToScreen):
1719         * UIProcess/WebPageProxy.h:
1720
1721 2018-05-22  Sihui Liu  <sihui_liu@apple.com>
1722
1723         [iOS] TestWebKitAPI.WebKit.WKHTTPCookieStoreWithoutProcessPool fails because cookies use different files with/without processpool
1724         https://bugs.webkit.org/show_bug.cgi?id=185831
1725
1726         Reviewed by Chris Dumez.
1727
1728         Started to use uiProcessCookieStorageIdentifier for iOS: make sure cookies handled without 
1729         processpool would use the same storage file as when processpool exists.
1730
1731         * NetworkProcess/NetworkProcess.h:
1732         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1733         (WebKit::NetworkProcessCreationParameters::encode const):
1734         (WebKit::NetworkProcessCreationParameters::decode):
1735         * NetworkProcess/NetworkProcessCreationParameters.h:
1736         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1737         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
1738         * Shared/WebProcessCreationParameters.cpp:
1739         (WebKit::WebProcessCreationParameters::encode const):
1740         (WebKit::WebProcessCreationParameters::decode):
1741         * Shared/WebProcessCreationParameters.h:
1742         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1743         (WebKit::WebProcessPool::platformInitializeWebProcess):
1744         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
1745
1746 2018-05-22  Chris Dumez  <cdumez@apple.com>
1747
1748         Regression(AsyncPolicyDelegates): Box.app login Window is blank
1749         https://bugs.webkit.org/show_bug.cgi?id=185832
1750         <rdar://problem/40307871>
1751
1752         Reviewed by Geoffrey Garen.
1753
1754         Moved WeakObjCPtr.h header from WebKit/ to wtf/ so that it can be used in
1755         WebKitLegacy code.
1756
1757         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
1758         * UIProcess/API/Cocoa/WKBrowsingContextControllerInternal.h:
1759         * UIProcess/API/Cocoa/WKConnection.mm:
1760         * UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
1761         * UIProcess/API/Cocoa/WKProcessGroup.mm:
1762         * UIProcess/API/Cocoa/WKProcessPool.mm:
1763         * UIProcess/API/Cocoa/WKScriptMessage.mm:
1764         * UIProcess/API/Cocoa/WKWebView.mm:
1765         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1766         * UIProcess/API/Cocoa/_WKAutomationSession.mm:
1767         * UIProcess/API/Cocoa/_WKDownload.mm:
1768         * UIProcess/API/Cocoa/_WKElementAction.mm:
1769         * UIProcess/ApplicationStateTracker.h:
1770         * UIProcess/Cocoa/AutomationClient.h:
1771         * UIProcess/Cocoa/AutomationSessionClient.h:
1772         * UIProcess/Cocoa/DiagnosticLoggingClient.h:
1773         * UIProcess/Cocoa/DownloadClient.h:
1774         * UIProcess/Cocoa/FindClient.h:
1775         * UIProcess/Cocoa/FullscreenClient.h:
1776         * UIProcess/Cocoa/IconLoadingDelegate.h:
1777         * UIProcess/Cocoa/NavigationState.h:
1778         * UIProcess/Cocoa/UIDelegate.h:
1779         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
1780         * UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm:
1781         * UIProcess/Cocoa/WebViewImpl.h:
1782         * UIProcess/ios/ViewGestureControllerIOS.mm:
1783         * UIProcess/ios/WKActionSheetAssistant.mm:
1784         * UIProcess/ios/WKContentViewInteraction.mm:
1785         * UIProcess/ios/WKPDFView.mm:
1786         (-[WKPDFView web_setContentProviderData:suggestedFilename:]):
1787         * UIProcess/ios/WKScrollView.mm:
1788         * UIProcess/mac/WKInspectorViewController.mm:
1789         * UIProcess/mac/WKInspectorWKWebView.mm:
1790         * WebKit.xcodeproj/project.pbxproj:
1791         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
1792
1793 2018-05-22  Sihui Liu  <sihui_liu@apple.com>
1794
1795         Conversion between SecurityOriginData and DatabaseIdentifier is asymmetric when port is null
1796         https://bugs.webkit.org/show_bug.cgi?id=185715
1797
1798         Reviewed by Geoffrey Garen.
1799
1800         Add getter for origins in WKWebsiteDataRecord for testing.
1801
1802         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
1803         (-[WKWebsiteDataRecord _originsString]):
1804         * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h:
1805
1806
1807 2018-05-22  Brady Eidson  <beidson@apple.com>
1808
1809         Rename the "Web content is visible" process assertion.
1810         https://bugs.webkit.org/show_bug.cgi?id=185878
1811
1812         Reviewed by Chris Dumez.
1813
1814         * UIProcess/ios/ProcessAssertionIOS.mm:
1815         (WebKit::ProcessAssertion::ProcessAssertion):
1816
1817 2018-05-22  Andy Estes  <aestes@apple.com>
1818
1819         [Wi-Fi Assertions] Drop assertions on process suspension
1820         https://bugs.webkit.org/show_bug.cgi?id=185844
1821         <rdar://problem/40352319>
1822
1823         Reviewed by Daniel Bates.
1824
1825         * NetworkProcess/NetworkProcess.cpp:
1826         (WebKit::NetworkProcess::actualPrepareToSuspend):
1827         (WebKit::NetworkProcess::processDidResume):
1828         * NetworkProcess/NetworkProcess.h:
1829         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1830         (WebKit::NetworkProcess::platformPrepareToSuspend):
1831         (WebKit::NetworkProcess::platformProcessDidResume):
1832
1833 2018-05-22  Brent Fulgham  <bfulgham@apple.com>
1834
1835         REGRESSION(r229093): Re-enable Network Extension support in the WebContent process (Take 2)
1836         https://bugs.webkit.org/show_bug.cgi?id=185874
1837         <rdar://problem/40454404>
1838
1839         Reviewed by Eric Carlson.
1840
1841         Add back a necessary XPC connection after locking down the network features in r229093.
1842
1843         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1844         * WebProcess/com.apple.WebProcess.sb.in:
1845
1846 2018-05-22  Ryan Haddad  <ryanhaddad@apple.com>
1847
1848         Unreviewed, rolling out r232052.
1849
1850         Breaks internal builds.
1851
1852         Reverted changeset:
1853
1854         "Use more C++17"
1855         https://bugs.webkit.org/show_bug.cgi?id=185176
1856         https://trac.webkit.org/changeset/232052
1857
1858 2018-05-22  Alberto Garcia  <berto@igalia.com>
1859
1860         [CMake] Properly detect compiler flags, needed libs, and fallbacks for usage of 64-bit atomic operations
1861         https://bugs.webkit.org/show_bug.cgi?id=182622
1862         <rdar://problem/40292317>
1863
1864         Reviewed by Michael Catanzaro.
1865
1866         Move the test to determine whether we need to link against
1867         libatomic to the common file WebKitCompilerFlags.cmake so it can
1868         also be used for JavaScriptCore.
1869
1870         * CMakeLists.txt:
1871
1872 2018-05-22  Michael Catanzaro  <mcatanzaro@igalia.com>
1873
1874         Unreviewed, rolling out r231843.
1875
1876         Broke cross build
1877
1878         Reverted changeset:
1879
1880         "[CMake] Properly detect compiler flags, needed libs, and
1881         fallbacks for usage of 64-bit atomic operations"
1882         https://bugs.webkit.org/show_bug.cgi?id=182622
1883         https://trac.webkit.org/changeset/231843
1884
1885 2018-05-22  Carlos Garcia Campos  <cgarcia@igalia.com>
1886
1887         Crash when loading a SVG image
1888         https://bugs.webkit.org/show_bug.cgi?id=185819
1889
1890         Reviewed by Brent Fulgham.
1891
1892         This is happening in WebLoaderStrategy::scheduleLoad() when getting the value of
1893         FrameLoaderClient::pageID(). SVGImage uses the empty clients for the loader, and
1894         EmptyFrameLoaderClient::pageID() returns std::nullopt. The same happens with the frameID. This changed in
1895         r225934, when pageID() and frameID() were changed to return std::optional, EmptyFrameLoaderClient was updated to
1896         return std::nullopt instead of 0.
1897
1898         * WebProcess/Network/WebLoaderStrategy.cpp:
1899         (WebKit::WebLoaderStrategy::scheduleLoad): Use value_or(0) instead of value() to get pageID and frameID from
1900         FrameLoaderClient.
1901
1902 2018-05-21  Yusuke Suzuki  <utatane.tea@gmail.com>
1903
1904         Use more C++17
1905         https://bugs.webkit.org/show_bug.cgi?id=185176
1906
1907         Reviewed by JF Bastien.
1908
1909         * Configurations/Base.xcconfig:
1910         * DerivedSources.make:
1911
1912 2018-05-21  Carlos Garcia Campos  <cgarcia@igalia.com>
1913
1914         [GTK][Wayland] UI process crash when closing the window
1915         https://bugs.webkit.org/show_bug.cgi?id=185818
1916
1917         Reviewed by Michael Catanzaro.
1918
1919         This happens when a page containing a text field is loaded but the focus remains in the url bar when the window
1920         is closed. This is because we are sending a notify-in to the IM context, but the focus is still in the URL
1921         bar. That confuses the wayland input method manager that tries to free the text of the web view IM context that has
1922         already been deleted.
1923
1924         * UIProcess/gtk/InputMethodFilter.cpp:
1925         (WebKit::InputMethodFilter::setEnabled): Only send notify-in if the view is actually focused.
1926
1927 2018-05-21  Ryosuke Niwa  <rniwa@webkit.org>
1928
1929         Remove unused and no-op WKContextSetCookieStorageDirectory
1930         https://bugs.webkit.org/show_bug.cgi?id=185857
1931
1932         Reviewed by Youenn Fablet.
1933
1934         Deleted C API which didn't do anything useful, and consequently not used by anyone.
1935
1936         * UIProcess/API/C/WKContext.cpp:
1937         (WKContextSetCookieStorageDirectory): Deleted.
1938         * UIProcess/API/C/WKContextPrivate.h:
1939         * UIProcess/WebProcessPool.h:
1940
1941 2018-05-21  Chris Nardi  <cnardi@chromium.org>
1942
1943         Remove dead exception in MediaList.appendMedium
1944         https://bugs.webkit.org/show_bug.cgi?id=185278
1945
1946         Reviewed by Chris Dumez.
1947
1948         Remove code pertaining to an exception being thrown by appendMedium().
1949
1950         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.cpp:
1951         (webkit_dom_media_list_append_medium):
1952
1953 2018-05-21  Aditya Keerthi  <akeerthi@apple.com>
1954
1955         [iOS] Click events only fire once when editing
1956         https://bugs.webkit.org/show_bug.cgi?id=185777
1957
1958         Reviewed by Tim Horton.
1959
1960         gestureRecognizerShouldBegin: was returning false for the single tap gesture when a node was being
1961         edited. This is an artifact of how the gesture was previously handled with the text selection assistant.
1962         This condition is now removed, allowing the single tap gesture to go through and correctly propagate the
1963         click event.
1964
1965         Also added an early return to _didGetTapHighlightForRequest: in order to prevent the tap highlight from
1966         being shown when the node is already being assisted.
1967
1968         * UIProcess/ios/WKContentViewInteraction.mm:
1969         (-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:]):
1970         (-[WKContentView gestureRecognizerShouldBegin:]):
1971
1972 2018-05-21  Daniel Bates  <dabates@apple.com>
1973
1974         REGRESSION (r231107): CSP report-only policies are ignored for beacon, importScripts, fetch(), EventSource, and XHR
1975         https://bugs.webkit.org/show_bug.cgi?id=185789
1976         <rdar://problem/40380175>
1977
1978         Reviewed by Andy Estes.
1979
1980         Have NetworkLoadChecker implement the ContentSecurityPolicyClient interface and support logging
1981         console messages, sending CSP reports, and dispatching SecurityPolicyViolation events.
1982
1983         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1984         (WebKit::NetworkConnectionToWebProcess::loadPing):
1985         * NetworkProcess/NetworkLoadChecker.cpp:
1986         (WebKit::NetworkLoadChecker::NetworkLoadChecker): Modified to take a reference to the NetworkConnectionToWebProcess,
1987         the web page ID, the web frame ID, and the resource load identifier. These details are necessary
1988         in order to implement the ContentSecurityPolicyClient interface.
1989         (WebKit::NetworkLoadChecker::isAllowedByContentSecurityPolicy): Added.
1990         (WebKit::NetworkLoadChecker::continueCheckingRequest): Write in terms of isAllowedByContentSecurityPolicy().
1991         (WebKit::NetworkLoadChecker::contentSecurityPolicy): Pass ourself as the client so that we receive
1992         delegate callbacks.
1993         (WebKit::NetworkLoadChecker::addConsoleMessage): Added.
1994         (WebKit::NetworkLoadChecker::sendCSPViolationReport): Added.
1995         (WebKit::NetworkLoadChecker::enqueueSecurityPolicyViolationEvent): Added.
1996         * NetworkProcess/NetworkLoadChecker.h:
1997         * NetworkProcess/NetworkResourceLoader.cpp:
1998         (NetworkResourceLoader::enqueueSecurityPolicyViolationEvent): Added.
1999         * NetworkProcess/NetworkResourceLoader.h:
2000         * NetworkProcess/PingLoad.cpp:
2001         (WebKit::PingLoad::PingLoad): Modified to take a reference to the NetworkConnectionToWebProcess and pass
2002         this through to the NetworkLoadChecker along with the web page ID, web frame ID and resource load identifier.
2003         * NetworkProcess/PingLoad.h:
2004         * WebProcess/WebPage/WebPage.cpp:
2005         (WebKit::WebPage::enqueueSecurityPolicyViolationEvent): Added.
2006         * WebProcess/WebPage/WebPage.h:
2007         * WebProcess/WebPage/WebPage.messages.in: Add message EnqueueSecurityPolicyViolationEvent.
2008
2009 2018-05-21  Brian Burg  <bburg@apple.com>
2010
2011         Web Automation: always return an empty cookie list if document.cookieURL() is empty
2012         https://bugs.webkit.org/show_bug.cgi?id=185838
2013         <rdar://problem/37737526>
2014
2015         Reviewed by Tim Horton.
2016
2017         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
2018         (WebKit::WebAutomationSessionProxy::getCookiesForFrame):
2019         This crashes in CFNetwork code because an empty cookie URL is not a valid input.
2020         Just return an empty list since there couldn't be any cookies returned.
2021
2022 2018-05-21  Brian Burg  <bburg@apple.com>
2023
2024         Web Automation: terminate the automation session if the network or storage process crashes
2025         https://bugs.webkit.org/show_bug.cgi?id=185827
2026         <rdar://problem/40424020>
2027
2028         Reviewed by Tim Horton.
2029
2030         If one of the processes crashes, the page may be in an undefined state and
2031         automation will fail in unpredictable ways. It's better to just give up immediately.
2032
2033         * UIProcess/WebProcessPool.cpp:
2034         (WebKit::WebProcessPool::networkProcessFailedToLaunch):
2035         (WebKit::WebProcessPool::storageProcessCrashed):
2036
2037 2018-05-21  Sihui Liu  <sihui_liu@apple.com>
2038
2039         Add a diskCacheSizeOverride accessor function on WKContextConfigurationRef
2040         https://bugs.webkit.org/show_bug.cgi?id=185826
2041         <rdar://problem/39732113>
2042
2043         Reviewed by Alex Christensen.
2044
2045         * UIProcess/API/C/WKContextConfigurationRef.cpp:
2046         (WKContextConfigurationDiskCacheSizeOverride):
2047         (WKContextConfigurationSetDiskCacheSizeOverride):
2048         * UIProcess/API/C/WKContextConfigurationRef.h:
2049
2050 2018-05-21  Jer Noble  <jer.noble@apple.com>
2051
2052         Complete fix for enabling modern EME by default
2053         https://bugs.webkit.org/show_bug.cgi?id=185770
2054         <rdar://problem/40368220>
2055
2056         Reviewed by Eric Carlson.
2057
2058         * Configurations/FeatureDefines.xcconfig:
2059
2060 2018-05-21  Sam Weinig  <sam@webkit.org>
2061
2062         Modernize RenderStyleConstants.h - Part 1
2063         https://bugs.webkit.org/show_bug.cgi?id=185809
2064
2065         Reviewed by Yusuke Suzuki.
2066
2067         * WebProcess/WebPage/ios/WebPageIOS.mm:
2068         (WebKit::WebPage::rangeForWebSelectionAtPosition):
2069         (WebKit::WebPage::getPositionInformation):
2070         Update for new enum names.
2071
2072 2018-05-21  Carlos Garcia Campos  <cgarcia@igalia.com>
2073
2074         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.21.2 release.
2075
2076         * gtk/NEWS: Add release notes for 2.21.2.
2077
2078 2018-05-21  Carlos Garcia Campos  <cgarcia@igalia.com>
2079
2080         Unreviewed, rolling out r222967.
2081
2082         It's not ready yet
2083
2084         Reverted changeset:
2085
2086         "[GTK][WPE] Add API to configure and enable resource load
2087         statistics"
2088         https://bugs.webkit.org/show_bug.cgi?id=177943
2089         https://trac.webkit.org/changeset/222967
2090
2091 2018-05-18  Commit Queue  <commit-queue@webkit.org>
2092
2093         Unreviewed, rolling out r231982.
2094         https://bugs.webkit.org/show_bug.cgi?id=185793
2095
2096         Caused layout test failures (Requested by realdawei on
2097         #webkit).
2098
2099         Reverted changeset:
2100
2101         "Complete fix for enabling modern EME by default"
2102         https://bugs.webkit.org/show_bug.cgi?id=185770
2103         https://trac.webkit.org/changeset/231982
2104
2105 2018-05-18  Brian Burg  <bburg@apple.com>
2106
2107         [Cocoa] Add missing nullability annotations to _WKAutomationSessionDelegate
2108         https://bugs.webkit.org/show_bug.cgi?id=185791
2109         <rdar://problem/40279891>
2110
2111         Reviewed by Tim Horton.
2112
2113         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h: If there is no dialog shown,
2114         then the delegate methods to return the dialog text may return a nil NSString.
2115
2116 2018-05-18  Youenn Fablet  <youenn@apple.com>
2117
2118         NetworkLoadChecker should cancel its content extension retrieval task when being destroyed
2119         https://bugs.webkit.org/show_bug.cgi?id=185661
2120         <rdar://problem/39985509>
2121
2122         Reviewed by Chris Dumez.
2123
2124         Make sure that the Content Extension retrieval callback checks that NetworkLoadChecker is alive.
2125         This allows stopping NetworkLoadChecker be ref counted.
2126         This in turns allows NetworkResourceLoader to delete its NetworkLoadChecker when being deleted as well.
2127         By doing so, we simplify the memory management of NetworkResourceLoader and NetworkLoadChecker.
2128
2129         * NetworkProcess/NetworkLoadChecker.cpp:
2130         (WebKit::NetworkLoadChecker::checkRequest):
2131         (WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad):
2132         * NetworkProcess/NetworkLoadChecker.h:
2133         (WebKit::NetworkLoadChecker::weakPtrFactory):
2134         * NetworkProcess/NetworkResourceLoader.cpp:
2135         * NetworkProcess/NetworkResourceLoader.h:
2136         * NetworkProcess/PingLoad.cpp:
2137         (WebKit::PingLoad::PingLoad):
2138         * NetworkProcess/PingLoad.h:
2139
2140 2018-05-18  Per Arne Vollan  <pvollan@apple.com>
2141
2142         WebProcess fails to launch
2143         https://bugs.webkit.org/show_bug.cgi?id=185140
2144
2145         Reviewed by Geoffrey Garen.
2146
2147         If the NSApplication runloop is not used in the WebContent process, launchServicesCheckIn() needs to be called
2148         in order for enableSandboxStyleFileQuarantine() to succeed. Determine at runtime if launchServicesCheckIn()
2149         should be called by checking if the NSApplication event loop is running.
2150
2151         * WebProcess/cocoa/WebProcessCocoa.mm:
2152         (WebKit::WebProcess::platformInitializeProcess):
2153
2154 2018-05-18  Jer Noble  <jer.noble@apple.com>
2155
2156         Complete fix for enabling modern EME by default
2157         https://bugs.webkit.org/show_bug.cgi?id=185770
2158         <rdar://problem/40368220>
2159
2160         Reviewed by Eric Carlson.
2161
2162         * Configurations/FeatureDefines.xcconfig:
2163
2164 2018-05-18  Brent Fulgham  <bfulgham@apple.com>
2165
2166         Convert ProcessPrivilege assertions to regular debug-only assertions
2167         https://bugs.webkit.org/show_bug.cgi?id=185775
2168         <rdar://problem/40372286>
2169
2170         Reviewed by Geoffrey Garen.
2171
2172         In Bug 184322 I added a number of RELEASE_ASSERT checks that certain
2173         UI-only calls were not being made in the WebContent process.
2174
2175         Measurements have shown that these RELEASE_ASSERTs have regressed performance
2176         by around 1% on some benchmarks, so we should convert them to normal asserts.
2177
2178         This patch changes the RELEASE_ASSERTs into ASSERTs.
2179
2180         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2181         (WebKit::WebProcessPool::platformInitializeWebProcess):
2182         * UIProcess/Cocoa/WebViewImpl.mm:
2183         (WebKit::WebViewImpl::WebViewImpl):
2184         (WebKit::WebViewImpl::becomeFirstResponder):
2185         (WebKit::WebViewImpl::pluginFocusOrWindowFocusChanged):
2186         (WebKit::WebViewImpl::validateUserInterfaceItem):
2187         (WebKit::WebViewImpl::startSpeaking):
2188         (WebKit::WebViewImpl::stopSpeaking):
2189         (WebKit::applicationFlagsForDrag):
2190         (WebKit::WebViewImpl::doneWithKeyEvent):
2191         * UIProcess/Gamepad/mac/UIGamepadProviderMac.mm:
2192         (WebKit::UIGamepadProvider::platformWebPageProxyForGamepadInput):
2193         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
2194         (WebKit::PluginProcessProxy::enterFullscreen):
2195         (WebKit::PluginProcessProxy::beginModal):
2196         (WebKit::PluginProcessProxy::endModal):
2197         * UIProcess/mac/DisplayLink.cpp:
2198         (WebKit::DisplayLink::DisplayLink):
2199         (WebKit::DisplayLink::~DisplayLink):
2200         * UIProcess/mac/WebPageProxyMac.mm:
2201         (WebKit::WebPageProxy::getIsSpeaking):
2202         (WebKit::WebPageProxy::speak):
2203         (WebKit::WebPageProxy::stopSpeaking):
2204         (WebKit::WebPageProxy::startDisplayLink):
2205         * UIProcess/mac/WebPopupMenuProxyMac.mm:
2206         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
2207
2208 2018-05-18  Eric Carlson  <eric.carlson@apple.com>
2209
2210         Handle failure to extend sandbox gracefully
2211         https://bugs.webkit.org/show_bug.cgi?id=185779
2212         <rdar://problem/40316349>
2213
2214         Reviewed by Brent Fulgham.
2215
2216         * UIProcess/API/Cocoa/WKWebView.mm:
2217         (-[WKWebView _denyNextUserMediaRequest]): 
2218         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2219
2220         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2221         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Don't append
2222         the request to m_grantedRequests if it failed.
2223         (WebKit::UserMediaPermissionRequestManagerProxy::grantAccess): Deny request if willCreateMediaStream
2224         fails.
2225         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
2226
2227         * UIProcess/UserMediaProcessManager.cpp:
2228         (WebKit::UserMediaProcessManager::willCreateMediaStream): Don't try to extend sandbox if
2229         we fail to allocate all necessary handles.
2230         * UIProcess/UserMediaProcessManager.h:
2231         (WebKit::UserMediaProcessManager::denyNextUserMediaRequest): New, for testing.
2232
2233 2018-05-18  Antoine Quint  <graouts@apple.com>
2234
2235         [Web Animations] Turn Web Animations with CSS integration on for test runners
2236         https://bugs.webkit.org/show_bug.cgi?id=184819
2237         <rdar://problem/39597337>
2238
2239         Unreviewed. Rolling out the patch for this bug, it caused some flaky timeouts for animation suspension tests.
2240
2241         * Shared/WebPreferences.yaml:
2242
2243 2018-05-18  Wenson Hsieh  <wenson_hsieh@apple.com>
2244
2245         [Extra zoom mode] Clearing text fields should dispatch input events of type "deleteContent"
2246         https://bugs.webkit.org/show_bug.cgi?id=185769
2247         <rdar://problem/40368261>
2248
2249         Reviewed by Tim Horton.
2250
2251         When setting the text of the currently focused element to the empty string, just delete the text instead of
2252         pretending to insert an empty string. This mimics deleting content using the delete key on macOS, and fires an
2253         input event with inputType "deleteContent" instead of "insertText".
2254
2255         Test: fast/forms/extrazoom/delete-content-in-text-field.html
2256
2257         * WebProcess/WebPage/WebPage.cpp:
2258         (WebKit::WebPage::setTextAsync):
2259
2260 2018-05-18  Keith Rollin  <krollin@apple.com>
2261
2262         Renamed "trackNetworkActivity" to "tracksResourceLoadMilestones"
2263         https://bugs.webkit.org/show_bug.cgi?id=185523
2264         <rdar://problem/40136361>
2265
2266         Reviewed by Geoffrey Garen.
2267
2268         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2269         (WebKit::networkActivityTrackingEnabled):
2270         * NetworkProcess/NetworkProcess.cpp:
2271         (WebKit::NetworkProcess::initializeNetworkProcess):
2272         * NetworkProcess/NetworkProcess.h:
2273         (WebKit::NetworkProcess::tracksResourceLoadMilestones const):
2274         (WebKit::NetworkProcess::trackNetworkActivity const): Deleted.
2275         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2276         (WebKit::NetworkProcessCreationParameters::encode const):
2277         (WebKit::NetworkProcessCreationParameters::decode):
2278         * NetworkProcess/NetworkProcessCreationParameters.h:
2279         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2280         (API::ProcessPoolConfiguration::copy):
2281         * UIProcess/API/APIProcessPoolConfiguration.h:
2282         * UIProcess/API/C/WKContextConfigurationRef.cpp:
2283         (WKContextConfigurationTracksResourceLoadMilestones):
2284         (WKContextConfigurationSetTracksResourceLoadMilestones):
2285         (WKContextConfigurationTrackNetworkActivity): Deleted.
2286         (WKContextConfigurationSetTrackNetworkActivity): Deleted.
2287         * UIProcess/API/C/WKContextConfigurationRef.h:
2288         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
2289         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
2290         (-[_WKProcessPoolConfiguration tracksResourceLoadMilestones]):
2291         (-[_WKProcessPoolConfiguration setTracksResourceLoadMilestones:]):
2292         (-[_WKProcessPoolConfiguration trackNetworkActivity]): Deleted.
2293         (-[_WKProcessPoolConfiguration setTrackNetworkActivity:]): Deleted.
2294         * UIProcess/WebProcessPool.cpp:
2295         (WebKit::WebProcessPool::ensureNetworkProcess):
2296
2297 2018-05-18  Chris Dumez  <cdumez@apple.com>
2298
2299         Avoid keeping the frame alive when ref'ing a WindowProxy
2300         https://bugs.webkit.org/show_bug.cgi?id=185737
2301         <rdar://problem/40004666>
2302
2303         Reviewed by Sam Weinig.
2304
2305         * WebProcess/Plugins/PluginView.cpp:
2306         (WebKit::PluginView::windowScriptNPObject):
2307
2308 2018-05-18  Youenn Fablet  <youenn@apple.com>
2309
2310         -Wmemset-elt-size warning in LibWebRTCSocket constructor
2311         https://bugs.webkit.org/show_bug.cgi?id=185555
2312         <rdar://problem/40217250>
2313
2314         Reviewed by Darin Adler.
2315
2316         GetOption implementation was broken in that it was not initializing properly its array of options.
2317         This patch fixes it by using an array of optional<int> which are initialized by default.
2318         When no value is set, we return the error code -1.
2319         In theory, we should go to NetworkProcess to get the actual value.
2320         Since GetOption is not used in practice, we just do this best effort implementation of storing previously set values.
2321
2322         * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
2323         (WebKit::LibWebRTCSocket::LibWebRTCSocket):
2324         (WebKit::LibWebRTCSocket::GetOption):
2325         * WebProcess/Network/webrtc/LibWebRTCSocket.h:
2326
2327 2018-05-18  Antoine Quint  <graouts@apple.com>
2328
2329         [Web Animations] Turn Web Animations with CSS integration on for test runners
2330         https://bugs.webkit.org/show_bug.cgi?id=184819
2331         <rdar://problem/39597337>
2332
2333         Reviewed by Jon Lee.
2334
2335         * Shared/WebPreferences.yaml: Leave Web Animations off by default, it's up to clients
2336         to turn it on.
2337
2338 2018-05-18  Fujii Hironori  <Hironori.Fujii@sony.com>
2339
2340         [Curl] Remove unused SystemProxyWin.cpp
2341         https://bugs.webkit.org/show_bug.cgi?id=185224
2342
2343         Reviewed by Antti Koivisto.
2344
2345         SystemProxyWin is not used at the moment. Remove it.
2346
2347         * NetworkProcess/win/SystemProxyWin.cpp: Removed.
2348         * NetworkProcess/win/SystemProxyWin.h: Removed.
2349         * PlatformWin.cmake: Removed SystemProxyWin.cpp.
2350
2351 2018-05-17  Nan Wang  <n_wang@apple.com>
2352
2353         AX: [macOS] Expose the primary screen height through AX API
2354         https://bugs.webkit.org/show_bug.cgi?id=185742
2355
2356         Reviewed by Chris Fleizach.
2357
2358         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
2359         (-[WKAccessibilityWebPageObject accessibilityAttributeNames]):
2360         (-[WKAccessibilityWebPageObject accessibilityAttributeValue:]):
2361
2362 2018-05-17  Alex Christensen  <achristensen@webkit.org>
2363
2364         Use CompletionHandlers for DelayedReplies
2365         https://bugs.webkit.org/show_bug.cgi?id=182269
2366
2367         Reviewed by Youenn Fablet.
2368
2369         DelayedReplies should be a noncopyable, non-refcountable type.  They should be
2370         called once and only once.  This is what CompletionHandlers are for.
2371
2372         No change in behavior.  Just cleaner code.
2373
2374         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2375         (WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
2376         * NetworkProcess/NetworkConnectionToWebProcess.h:
2377         * NetworkProcess/NetworkResourceLoader.cpp:
2378         (WebKit::NetworkResourceLoader::SynchronousLoadData::SynchronousLoadData):
2379         (WebKit::sendReplyToSynchronousRequest):
2380         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
2381         * NetworkProcess/NetworkResourceLoader.h:
2382         * Platform/IPC/HandleMessage.h:
2383         (IPC::callMemberFunctionImpl):
2384         (IPC::callMemberFunction):
2385         (IPC::handleMessageDelayed):
2386         * PluginProcess/PluginControllerProxy.cpp:
2387         (WebKit::PluginControllerProxy::setInitializationReply):
2388         (WebKit::PluginControllerProxy::takeInitializationReply):
2389         * PluginProcess/PluginControllerProxy.h:
2390         * PluginProcess/WebProcessConnection.cpp:
2391         (WebKit::WebProcessConnection::destroyPlugin):
2392         (WebKit::WebProcessConnection::createPlugin):
2393         (WebKit::WebProcessConnection::createPluginAsynchronously):
2394         * PluginProcess/WebProcessConnection.h:
2395         * Scripts/webkit/LegacyMessageReceiver-expected.cpp:
2396         (Messages::WebPage::GetPluginProcessConnection::send):
2397         (Messages::WebPage::TestMultipleAttributes::send):
2398         (Messages::WebPage::GetPluginProcessConnection::DelayedReply::DelayedReply): Deleted.
2399         (Messages::WebPage::GetPluginProcessConnection::DelayedReply::~DelayedReply): Deleted.
2400         (Messages::WebPage::GetPluginProcessConnection::DelayedReply::send): Deleted.
2401         (Messages::WebPage::TestMultipleAttributes::DelayedReply::DelayedReply): Deleted.
2402         (Messages::WebPage::TestMultipleAttributes::DelayedReply::~DelayedReply): Deleted.
2403         (Messages::WebPage::TestMultipleAttributes::DelayedReply::send): Deleted.
2404         * Scripts/webkit/LegacyMessages-expected.h:
2405         * Scripts/webkit/MessageReceiver-expected.cpp:
2406         (Messages::WebPage::GetPluginProcessConnection::send):
2407         (Messages::WebPage::TestMultipleAttributes::send):
2408         (Messages::WebPage::GetPluginProcessConnection::DelayedReply::DelayedReply): Deleted.
2409         (Messages::WebPage::GetPluginProcessConnection::DelayedReply::~DelayedReply): Deleted.
2410         (Messages::WebPage::GetPluginProcessConnection::DelayedReply::send): Deleted.
2411         (Messages::WebPage::TestMultipleAttributes::DelayedReply::DelayedReply): Deleted.
2412         (Messages::WebPage::TestMultipleAttributes::DelayedReply::~DelayedReply): Deleted.
2413         (Messages::WebPage::TestMultipleAttributes::DelayedReply::send): Deleted.
2414         * Scripts/webkit/Messages-expected.h:
2415         * Scripts/webkit/messages.py:
2416         * UIProcess/Network/NetworkProcessProxy.cpp:
2417         (WebKit::NetworkProcessProxy::getNetworkProcessConnection):
2418         (WebKit::NetworkProcessProxy::networkProcessCrashed):
2419         (WebKit::NetworkProcessProxy::networkProcessFailedToLaunch):
2420         (WebKit::NetworkProcessProxy::didCreateNetworkConnectionToWebProcess):
2421         * UIProcess/Network/NetworkProcessProxy.h:
2422         * UIProcess/Plugins/PluginProcessManager.cpp:
2423         (WebKit::PluginProcessManager::getPluginProcessConnection):
2424         * UIProcess/Plugins/PluginProcessManager.h:
2425         * UIProcess/Plugins/PluginProcessProxy.cpp:
2426         (WebKit::PluginProcessProxy::getPluginProcessConnection):
2427         (WebKit::PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch):
2428         (WebKit::PluginProcessProxy::didCreateWebProcessConnection):
2429         * UIProcess/Plugins/PluginProcessProxy.h:
2430         * UIProcess/Storage/StorageProcessProxy.cpp:
2431         (WebKit::StorageProcessProxy::getStorageProcessConnection):
2432         (WebKit::StorageProcessProxy::didClose):
2433         (WebKit::StorageProcessProxy::didCreateStorageToWebProcessConnection):
2434         * UIProcess/Storage/StorageProcessProxy.h:
2435         * UIProcess/WebPageProxy.cpp:
2436         (WebKit::ExceededDatabaseQuotaRecords::createRecord):
2437         (WebKit::WebPageProxy::receivedPolicyDecision):
2438         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
2439         (WebKit::WebPageProxy::createNewPage):
2440         (WebKit::WebPageProxy::runJavaScriptAlert):
2441         (WebKit::WebPageProxy::runJavaScriptConfirm):
2442         (WebKit::WebPageProxy::runJavaScriptPrompt):
2443         (WebKit::WebPageProxy::webGLPolicyForURL):
2444         (WebKit::WebPageProxy::resolveWebGLPolicyForURL):
2445         (WebKit::WebPageProxy::getToolbarsAreVisible):
2446         (WebKit::WebPageProxy::getMenuBarIsVisible):
2447         (WebKit::WebPageProxy::getStatusBarIsVisible):
2448         (WebKit::WebPageProxy::getWindowFrame):
2449         (WebKit::WebPageProxy::screenToRootView):
2450         (WebKit::WebPageProxy::rootViewToScreen):
2451         (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel):
2452         (WebKit::WebPageProxy::exceededDatabaseQuota):
2453         (WebKit::WebPageProxy::reachedApplicationCacheOriginQuota):
2454         * UIProcess/WebPageProxy.h:
2455         * UIProcess/WebProcessPool.cpp:
2456         (WebKit::WebProcessPool::networkProcessCrashed):
2457         (WebKit::WebProcessPool::getNetworkProcessConnection):
2458         (WebKit::WebProcessPool::getStorageProcessConnection):
2459         * UIProcess/WebProcessPool.h:
2460         * UIProcess/WebProcessProxy.cpp:
2461         (WebKit::WebProcessProxy::getPluginProcessConnection):
2462         (WebKit::WebProcessProxy::getNetworkProcessConnection):
2463         (WebKit::WebProcessProxy::getStorageProcessConnection):
2464         * UIProcess/WebProcessProxy.h:
2465         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2466         (WebKit::WebSWContextManagerConnection::syncTerminateWorker):
2467         * WebProcess/Storage/WebSWContextManagerConnection.h:
2468         * WebProcess/WebPage/WebPage.h:
2469         * WebProcess/WebPage/ios/WebPageIOS.mm:
2470         (WebKit::WebPage::computePagesForPrintingAndDrawToPDF):
2471
2472 2018-05-17  Jer Noble  <jer.noble@apple.com>
2473
2474         CRASH in -[WKFullScreenViewController _manager]
2475         https://bugs.webkit.org/show_bug.cgi?id=185745
2476         <rdar://problem/39195241>
2477
2478         Reviewed by Eric Carlson.
2479
2480         Protect against WKFullScreenViewController outliving WKWebView by making its
2481         _webView property weak. Additionally, add a sanity-check RetainPtr where _webView
2482         is referenced multiple times within a function.
2483
2484         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
2485         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
2486         (-[WKFullScreenWindowController initWithWebView:]):
2487         (-[WKFullScreenWindowController enterFullScreen]):
2488         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
2489         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
2490         (-[WKFullScreenWindowController _completedExitFullScreen]):
2491         (-[WKFullScreenWindowController close]):
2492         (-[WKFullScreenWindowController webViewDidRemoveFromSuperviewWhileInFullscreen]):
2493         (-[WKFullScreenWindowController _exitFullscreenImmediately]):
2494         (-[WKFullScreenWindowController _isSecure]):
2495         (-[WKFullScreenWindowController _serverTrust]):
2496         (-[WKFullScreenWindowController _updateLocationInfo]):
2497         (-[WKFullScreenWindowController _manager]):
2498         (-[WKFullScreenWindowController _startToDismissFullscreenChanged:]):
2499
2500 2018-05-17  Brent Fulgham  <bfulgham@apple.com>
2501
2502         Correct default for StorageAccess API
2503         https://bugs.webkit.org/show_bug.cgi?id=185748
2504         <rdar://problem/40220659>
2505
2506         Reviewed by Dean Jackson.
2507
2508         Flip the default state to 'true' so that the new "sticky" state
2509         for Storage Access API and attributing user interaction for
2510         Storage Access API use is applied by default.
2511
2512         * Shared/WebPreferences.yaml:
2513
2514 2018-05-17  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2515
2516         [WPE] Implement and enable FULLSCREEN_API
2517         https://bugs.webkit.org/show_bug.cgi?id=185676
2518
2519         Reviewed by Žan Doberšek.
2520
2521         Do the initial implementation of FULLSCREEN_API for WPE and
2522         enable the CMake option by default.
2523
2524         Most of the layout tests (55 of 58) are passing and the feature
2525         seems to work fine on different websites that use it.
2526
2527         * UIProcess/API/wpe/PageClientImpl.cpp:
2528         (WebKit::PageClientImpl::fullScreenManagerProxyClient):
2529         (WebKit::PageClientImpl::closeFullScreenManager):
2530         (WebKit::PageClientImpl::isFullScreen):
2531         (WebKit::PageClientImpl::enterFullScreen):
2532         (WebKit::PageClientImpl::exitFullScreen):
2533         (WebKit::PageClientImpl::beganEnterFullScreen):
2534         (WebKit::PageClientImpl::beganExitFullScreen):
2535         * UIProcess/API/wpe/PageClientImpl.h:
2536         * UIProcess/API/wpe/WPEView.h:
2537         (WKWPE::View::isFullScreen):
2538         (WKWPE::View::setFullScreen):
2539
2540 2018-05-17  Jiewen Tan  <jiewen_tan@apple.com>
2541
2542         Convert CertificateInfo into Credential in UI Process instead of Networking Process
2543         https://bugs.webkit.org/show_bug.cgi?id=185662
2544         <rdar://problem/40275561>
2545
2546         Reviewed by Alex Christensen.
2547
2548         Right now we convert CertificateInfo into Credential in the very last stage of client certificate authentication process
2549         when it reaches Networking Process. This patch moves that conversion earlier in UI Process such that we don't have to
2550         pass both Credential and CertificateInfo to Networking Process.
2551
2552         CertificateInfo is only used in macOS for C API specifically. WK2 includes macOS/iOS relies on NSURLCredential/WebCore::Credential
2553         solely. WK2 has already exercised the ability of using WebCore::Credential to do client certficate authentication. This patch therefore
2554         takes advantage of that. It converts CertficateInfo objects into Credential objects right after WebCredential is initialized, and then merge
2555         any code paths that utilizes CertficateInfo into ones that uses WebCore::Credential.
2556
2557         Covered by existing tests.
2558
2559         * Shared/Authentication/AuthenticationManager.cpp:
2560         (WebKit::AuthenticationManager::useCredentialForChallenge):
2561         (WebKit::AuthenticationManager::useCredentialForSingleChallenge):
2562         (WebKit::AuthenticationManager::tryUseCertificateInfoForChallenge): Deleted.
2563         * Shared/Authentication/AuthenticationManager.h:
2564         * Shared/Authentication/AuthenticationManager.messages.in:
2565         * UIProcess/Authentication/AuthenticationChallengeProxy.cpp:
2566         (WebKit::AuthenticationChallengeProxy::useCredential):
2567         * UIProcess/Authentication/WebCredential.cpp:
2568         (WebKit::WebCredential::WebCredential):
2569         (WebKit::WebCredential::certificateInfo): Deleted.
2570         * UIProcess/Authentication/WebCredential.h:
2571         (WebKit::WebCredential::create):
2572         * UIProcess/Authentication/mac/WebCredentialMac.mm: Renamed from Source/WebKit/Shared/Authentication/mac/AuthenticationManager.mac.mm.
2573         (WebKit::leafCertificate):
2574         (WebKit::chain):
2575         (WebKit::WebCredential::WebCredential):
2576         * WebKit.xcodeproj/project.pbxproj:
2577
2578 2018-05-17  Jeremy Jones  <jeremyj@apple.com>
2579
2580         Ensure valid rects for fullsceen animation.
2581         https://bugs.webkit.org/show_bug.cgi?id=185736
2582         rdar://problem/40320174
2583
2584         Reviewed by Jer Noble.
2585
2586         Protect against zero width and height since those can make for NANs in the animation transforms.
2587
2588         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
2589         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
2590         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
2591
2592 2018-05-17  Jer Noble  <jer.noble@apple.com>
2593
2594         Turn Modern EME API on by default and remove it as an experimental feature
2595         https://bugs.webkit.org/show_bug.cgi?id=185693
2596         <rdar://problem/39954396>
2597
2598         Reviewed by Eric Carlson.
2599
2600         * Shared/WebPreferences.yaml:
2601
2602 2018-05-17  Dean Jackson  <dino@apple.com>
2603
2604         Safari optimized flow should be releasing viewer to prevent memory growth with subsequent launches/closes
2605         https://bugs.webkit.org/show_bug.cgi?id=185722
2606         <rdar://problem/40247351>
2607
2608         Reviewed by Antoine Quint.
2609
2610         I made a rookie mistake in the original patch: I was holding a strong
2611         reference to "self" in a block, which was causing a retain cycle.
2612         Replace that with a WeakObjCPtr.
2613
2614         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
2615         (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
2616
2617 2018-05-16  Brent Fulgham  <bfulgham@apple.com>
2618
2619         REGRESSION(r229093)[macOS] Allow network-outbound for syslog use
2620         https://bugs.webkit.org/show_bug.cgi?id=185703
2621         <rdar://problem/39778918>
2622
2623         Reviewed by Eric Carlson.
2624
2625         In r229093 I removed the 'network-outbound' permission for syslog use.
2626         Further testing has shown that this is still needed for subsystem
2627         logging in our bundle loading code.
2628
2629         This patch re-enabled network-outbound for syslog.
2630
2631         * WebProcess/com.apple.WebProcess.sb.in:
2632
2633 2018-05-16  Andy VanWagoner  <andy@vanwagoner.family>
2634
2635         Add support for Intl NumberFormat formatToParts
2636         https://bugs.webkit.org/show_bug.cgi?id=185375
2637
2638         Reviewed by Yusuke Suzuki.
2639
2640         Add flag for NumberFormat formatToParts.
2641
2642         * Configurations/FeatureDefines.xcconfig:
2643
2644 2018-05-16  Andy Estes  <aestes@apple.com>
2645
2646         [Wi-Fi Assertions] Adopt WiFiAssertionHolderAdditions
2647         https://bugs.webkit.org/show_bug.cgi?id=185685
2648         <rdar://problem/40136681>
2649
2650         Reviewed by Sam Weinig.
2651
2652         * NetworkProcess/cocoa/WiFiAssertionHolder.cpp:
2653         (WebKit::WiFiAssertionHolder::WiFiAssertionHolder):
2654         (WebKit::WiFiAssertionHolder::~WiFiAssertionHolder):
2655         (WebKit::ensureWiFiManagerClient): Deleted.
2656
2657 2018-05-16  Fujii Hironori  <Hironori.Fujii@sony.com>
2658
2659         [Win] Implement WebPage::handleEditingKeyboardEvent
2660         https://bugs.webkit.org/show_bug.cgi?id=185327
2661
2662         Reviewed by Alexey Proskuryakov.
2663
2664         * WebProcess/WebPage/win/WebPageWin.cpp:
2665         (WebKit::WebPage::handleEditingKeyboardEvent): Copied from WebKitLegacy.
2666
2667 2018-05-16  Sihui Liu  <sihui_liu@apple.com>
2668
2669         Session cookies aren't reliably set when using default WKWebSiteDataStore
2670         https://bugs.webkit.org/show_bug.cgi?id=185624
2671         <rdar://problem/39111626>
2672
2673         Reviewed by Geoffrey Garen.
2674
2675         Session cookies of default session were set in UI Process when there was no process pool, 
2676         but they were not synced (or synced slowly to) Network Process. To make these cookies visible
2677         as soon as they were set through API, we could manually set those cookies in Network Process
2678         during its initilization. 
2679
2680         * NetworkProcess/mac/RemoteNetworkingContext.mm:
2681         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
2682         * UIProcess/API/APIHTTPCookieStore.cpp:
2683         (API::HTTPCookieStore::cookies):
2684         (API::HTTPCookieStore::setCookie):
2685         (API::HTTPCookieStore::deleteCookie):
2686         * UIProcess/WebProcessPool.cpp:
2687         (WebKit::WebProcessPool::ensureNetworkProcess):
2688         (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
2689         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2690         (WebKit::WebsiteDataStore::clearPendingCookies):
2691         * UIProcess/WebsiteData/WebsiteDataStore.h:
2692
2693 2018-05-16  Chris Nardi  <cnardi@chromium.org>
2694
2695         Remove Document#selectedStylesheetSet/preferredStylesheetSet
2696         https://bugs.webkit.org/show_bug.cgi?id=185381
2697
2698         Reviewed by Darin Adler.
2699
2700         Make API methods for Document#selectedStylesheetSet/preferredStylesheetSet do nothing.
2701
2702         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.h:
2703         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp:
2704         (webkit_dom_document_set_property):
2705         (webkit_dom_document_get_property):
2706         (webkit_dom_document_get_preferred_stylesheet_set):
2707         (webkit_dom_document_get_selected_stylesheet_set):
2708         (webkit_dom_document_set_selected_stylesheet_set):
2709
2710 2018-05-16  Alberto Garcia  <berto@igalia.com>
2711
2712         [CMake] Properly detect compiler flags, needed libs, and fallbacks for usage of 64-bit atomic operations
2713         https://bugs.webkit.org/show_bug.cgi?id=182622
2714
2715         Reviewed by Michael Catanzaro.
2716
2717         Move the test to determine whether we need to link against
2718         libatomic to the common file WebKitCompilerFlags.cmake so it can
2719         also be used for JavaScriptCore.
2720
2721         * CMakeLists.txt:
2722
2723 2018-05-15  Yusuke Suzuki  <utatane.tea@gmail.com>
2724
2725         [JSC] Check TypeInfo first before calling getCallData when we would like to check whether given object is a function
2726         https://bugs.webkit.org/show_bug.cgi?id=185601
2727
2728         Reviewed by Saam Barati.
2729
2730         * WebProcess/Plugins/Netscape/JSNPObject.h:
2731
2732 2018-05-15  Sihui Liu  <sihui_liu@apple.com>
2733
2734         StorageManager::deleteLocalStorageOriginsModifiedSince: database files get deleted before database connections close
2735         https://bugs.webkit.org/show_bug.cgi?id=185671
2736
2737         Reviewed by Geoffrey Garen.
2738
2739         We should delete database files before closing databases.
2740
2741         * UIProcess/WebStorage/LocalStorageDatabase.cpp:
2742         (WebKit::LocalStorageDatabase::updateDatabaseWithChangedItems):
2743         * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
2744         (WebKit::LocalStorageDatabaseTracker::databasesModifiedSince):
2745         (WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince): Deleted.
2746         * UIProcess/WebStorage/LocalStorageDatabaseTracker.h:
2747         * UIProcess/WebStorage/StorageManager.cpp:
2748         (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
2749
2750 2018-05-15  Dean Jackson  <dino@apple.com>
2751
2752         Launch System Preview as the download starts, rather than waiting for a response
2753         https://bugs.webkit.org/show_bug.cgi?id=185669
2754         <rdar://problem/40278181>
2755
2756         Reviewed by Tim Horton.
2757
2758         We were waiting for the RequestResponse to get a MIME-type before
2759         launching the system preview. This causes an annoying delay.
2760
2761         Instead, assume that the system preview is one of the handled
2762         mime types and launch the viewer immediately. If it gets something it
2763         didn't expect, it will show an error.
2764
2765         * UIProcess/Cocoa/DownloadClient.mm:
2766         (WebKit::DownloadClient::didStart):
2767         (WebKit::DownloadClient::didReceiveResponse):
2768         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
2769         (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
2770         (WebKit::SystemPreviewController::start): Small cleanup to ensure we
2771         don't try to present twice (this shouldn't happen).
2772
2773 2018-05-15  Dean Jackson  <dino@apple.com>
2774
2775         Post-review cleanup for 185459
2776         https://bugs.webkit.org/show_bug.cgi?id=185665
2777         <rdar://problem/40276689>
2778
2779         Reviewed by Tim Horton.
2780
2781         Jon made some comments in 185459 that I'm addressing here.
2782
2783         * UIProcess/Cocoa/DownloadClient.h:
2784         * UIProcess/Cocoa/DownloadClient.mm: Guard the activity token for iOS
2785         in a way that means it will still work ok on macOS.
2786         (WebKit::DownloadClient::didStart):
2787         (WebKit::DownloadClient::processDidCrash):
2788         (WebKit::DownloadClient::didFinish):
2789         (WebKit::DownloadClient::didFail):
2790         (WebKit::DownloadClient::didCancel):
2791         (WebKit::DownloadClient::takeActivityToken):
2792         (WebKit::DownloadClient::releaseActivityTokenIfNecessary):
2793         (WebKit::DownloadClient::releaseActivityToken): Deleted.
2794
2795         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: Add an early return.
2796         (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
2797
2798 2018-05-15  Tadeu Zagallo  <tzagallo@apple.com>
2799
2800         Update touch event tracking types on every touch
2801         https://bugs.webkit.org/show_bug.cgi?id=184250
2802         <rdar://problem/39145092>
2803
2804         Reviewed by Geoffrey Garen.
2805
2806         The tracking types for touch events were only update on touchstart, which meant that event
2807         listeners added after the touchstart would always be treated as passive, even if explicitly
2808         setting passive to false.
2809
2810         * UIProcess/WebPageProxy.cpp:
2811         (WebKit::WebPageProxy::handleTouchEventSynchronously):
2812         (WebKit::WebPageProxy::handleTouchEvent):
2813
2814 2018-05-15  Per Arne Vollan  <pvollan@apple.com>
2815
2816         Pause display links when window is not visible.
2817         https://bugs.webkit.org/show_bug.cgi?id=185627
2818         <rdar://problem/39401106>
2819
2820         Reviewed by Simon Fraser.
2821
2822         Pause/resume display links created in the UI process when the window is hidden/shown.
2823
2824         * UIProcess/WebPageProxy.cpp:
2825         (WebKit::WebPageProxy::dispatchActivityStateChange):
2826         * UIProcess/mac/DisplayLink.cpp:
2827         (WebKit::DisplayLink::pause):
2828         (WebKit::DisplayLink::resume):
2829         * UIProcess/mac/DisplayLink.h:
2830
2831 2018-05-15  Dean Jackson  <dino@apple.com>
2832
2833         Provide UIView and UIImage for zoom transition
2834         https://bugs.webkit.org/show_bug.cgi?id=185655
2835         <rdar://problem/40267224>
2836
2837         Reviewed by Antoine Quint.
2838
2839         Provide a UIView* for the frameForPreviewItem to use as a source view.
2840         Also implement the transitionImageForPreviewItem delegate, even though
2841         we're returning nil.
2842
2843         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
2844         (-[_WKPreviewControllerDelegate previewController:frameForPreviewItem:inSourceView:]):
2845         (-[_WKPreviewControllerDelegate previewController:transitionImageForPreviewItem:contentRect:]):
2846
2847 2018-05-15  Daniel Bates  <dabates@apple.com>
2848
2849         Fix the Apple Internal build
2850
2851         Make a similar change to WebKit as I did for LegacyWebKit in r231777. See <rdar://problem/40237873> for more details.
2852
2853         * UIProcess/mac/WKFullScreenWindowController.mm:
2854         (-[WKFullScreenWindowController enterFullScreen:]):
2855         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
2856         (-[WKFullScreenWindowController exitFullScreen]):
2857         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
2858         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
2859         (-[WKFullScreenWindowController completeFinishExitFullScreenAnimationAfterRepaint]):
2860         (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]):
2861         (-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]):
2862
2863 2018-05-15  Megan Gardner  <megan_gardner@apple.com>
2864
2865         Clear selections from web content with single tap
2866         https://bugs.webkit.org/show_bug.cgi?id=185634
2867
2868         Reviewed by Tim Horton.
2869         
2870         With the switch to the single text selection assistant, we were not correctly clearing the selection when a
2871         single tap happened.
2872
2873         * UIProcess/ios/WKContentViewInteraction.mm:
2874         (-[WKContentView _singleTapCommited:]):
2875
2876 2018-05-15  Antoine Quint  <graouts@apple.com>
2877
2878         [Web Animations] Expose Web Animations CSS integration as an experimental feature
2879         https://bugs.webkit.org/show_bug.cgi?id=185647
2880
2881         Reviewed by Dean Jackson.
2882
2883         Rename the Web Animations CSS integration flag.
2884
2885         * Shared/WebPreferences.yaml:
2886         * UIProcess/API/C/WKPreferences.cpp:
2887         (WKPreferencesSetWebAnimationsCSSIntegrationEnabled):
2888         (WKPreferencesGetWebAnimationsCSSIntegrationEnabled):
2889         (WKPreferencesSetCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled): Deleted.
2890         (WKPreferencesGetCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled): Deleted.
2891         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2892         * UIProcess/API/Cocoa/WKPreferences.mm:
2893         (-[WKPreferences _setWebAnimationsCSSIntegrationEnabled:]):
2894         (-[WKPreferences _webAnimationsCSSIntegrationEnabled]):
2895         (-[WKPreferences _setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled:]): Deleted.
2896         (-[WKPreferences _cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled]): Deleted.
2897         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2898         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2899         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2900         (WebKit::InjectedBundle::setWebAnimationsCSSIntegrationEnabled):
2901         (WebKit::InjectedBundle::setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled): Deleted.
2902         * WebProcess/InjectedBundle/InjectedBundle.h:
2903
2904 2018-05-15  Dean Jackson  <dino@apple.com>
2905
2906         Update animation when presenting QuickLook
2907         https://bugs.webkit.org/show_bug.cgi?id=185648
2908         <rdar://problem/39652624>
2909
2910         Reviewed by Antoine Quint.
2911
2912         Implement the QuickLook delegate on _WKPreviewControllerDelegate that
2913         produces a zoom-like animation when the QLPreviewController appears.
2914
2915         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
2916         (-[_WKPreviewControllerDelegate previewController:frameForPreviewItem:inSourceView:]):
2917         * UIProcess/SystemPreviewController.h: Add a reference back to the page, so that
2918         the delegate implementation can access the presentingViewController.
2919         (WebKit::SystemPreviewController::page):
2920
2921 2018-05-14  Dean Jackson  <dino@apple.com>
2922
2923         Download and present System Preview
2924         https://bugs.webkit.org/show_bug.cgi?id=185459
2925         <rdar://problem/40079228>
2926
2927         Reviewed by Tim Horton.
2928
2929         Extend DownloadClient so that it can handle the case where
2930         the download was triggered by a System Preview. In this situation
2931         the result (and progress) are piped into QuickLook via the SystemPreviewController.
2932
2933         The DownloadProxy class is also extended to handle the destination
2934         filename and the size of the content.
2935
2936         Lastly, SystemPreviewController is updated to have a start(), show()
2937         and cancel() interface, and no longer adjusts page navigation.
2938
2939         * UIProcess/Cocoa/DownloadClient.h:
2940         * UIProcess/Cocoa/DownloadClient.mm: Handle the SystemPreview case, which
2941         doesn't have a download delegate, but instead needs to communicate with
2942         the SystemPreviewController, if one exists.
2943         (WebKit::DownloadClient::didStart):
2944         (WebKit::DownloadClient::didReceiveResponse):
2945         (WebKit::DownloadClient::didReceiveData):
2946         (WebKit::DownloadClient::didCreateDestination):
2947         (WebKit::DownloadClient::processDidCrash):
2948         (WebKit::DownloadClient::decideDestinationWithSuggestedFilename):
2949         (WebKit::DownloadClient::didFinish):
2950         (WebKit::DownloadClient::didFail):
2951         (WebKit::DownloadClient::didCancel):
2952         (WebKit::DownloadClient::releaseActivityToken):
2953
2954         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: Implement the new API.
2955         (-[_WKPreviewControllerDataSource initWithMIMEType:]):
2956         (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
2957         (-[_WKPreviewControllerDataSource setProgress:]):
2958         (-[_WKPreviewControllerDataSource finish:]):
2959         (-[_WKPreviewControllerDelegate previewControllerDidDismiss:]):
2960         (WebKit::SystemPreviewController::start):
2961         (WebKit::SystemPreviewController::updateProgress):
2962         (WebKit::SystemPreviewController::finish):
2963         (WebKit::SystemPreviewController::cancel):
2964         (-[_WKPreviewControllerDataSource initWithURL:]): Deleted.
2965         (-[_WKPreviewControllerDelegate previewControllerWillDismiss:]): Deleted.
2966         (WebKit::SystemPreviewController::canPreview const): Deleted.
2967         (WebKit::SystemPreviewController::showPreview): Deleted.
2968         * UIProcess/Downloads/DownloadProxy.h: Track the destination file by name
2969         and size. Also expose a helper to identify system preview downloads.
2970         (WebKit::DownloadProxy::destinationFilename const):
2971         (WebKit::DownloadProxy::setDestinationFilename):
2972         (WebKit::DownloadProxy::expectedContentLength const):
2973         (WebKit::DownloadProxy::setExpectedContentLength):
2974         (WebKit::DownloadProxy::bytesLoaded const):
2975         (WebKit::DownloadProxy::setBytesLoaded):
2976         (WebKit::DownloadProxy::isSystemPreviewDownload const):
2977
2978         * UIProcess/SystemPreviewController.cpp: New API.
2979         (WebKit::SystemPreviewController::canPreview const):
2980         (WebKit::SystemPreviewController::sendPageBack): Deleted.
2981         (WebKit::SystemPreviewController::showPreview): Deleted.
2982         * UIProcess/SystemPreviewController.h:
2983
2984         * UIProcess/WebPageProxy.cpp:
2985         (WebKit::m_configurationPreferenceValues):
2986         (WebKit::WebPageProxy::reattachToWebProcess):
2987         (WebKit::WebPageProxy::resetState):
2988         * UIProcess/WebPageProxy.h:
2989
2990 2018-05-14  Brady Eidson  <beidson@apple.com>
2991
2992         Add an API test to guard against regressions while re-entering setDefersLoading:.
2993         <rdar://problem/37033737> and https://bugs.webkit.org/show_bug.cgi?id=185630
2994
2995         Reviewed by Chris Dumez.
2996
2997         * UIProcess/API/Cocoa/WKWebView.mm:
2998         (-[WKWebView _setDefersLoadingForTesting:]):
2999         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3000
3001         * UIProcess/WebPageProxy.cpp:
3002         (WebKit::WebPageProxy::setDefersLoadingForTesting):
3003         * UIProcess/WebPageProxy.h:
3004         * WebProcess/WebPage/WebPage.messages.in:
3005
3006 2018-05-14  Tim Horton  <timothy_horton@apple.com>
3007
3008         Use the system font by default in extra zoom mode
3009         https://bugs.webkit.org/show_bug.cgi?id=185638
3010         <rdar://problem/40230277>
3011
3012         Reviewed by Wenson Hsieh.
3013
3014         * Shared/WebPreferencesDefaultValues.h:
3015
3016 2018-05-14  Michael Catanzaro  <mcatanzaro@igalia.com>
3017
3018         Unreviewed, rolling out r231755.
3019
3020         Change is not correct
3021
3022         Reverted changeset:
3023
3024         "-Wmemset-elt-size warning in LibWebRTCSocket constructor"
3025         https://bugs.webkit.org/show_bug.cgi?id=185555
3026         https://trac.webkit.org/changeset/231755
3027
3028 2018-05-14  Wenson Hsieh  <wenson_hsieh@apple.com>
3029
3030         [Extra zoom mode] Google search results are excessively zoomed in
3031         https://bugs.webkit.org/show_bug.cgi?id=185347
3032         <rdar://problem/39999778>
3033
3034         Reviewed by Tim Horton.
3035
3036         Adds a new experimental feature for the "disabled-adaptations" meta tag, and adds plumbing in WebKit to
3037         propagate disabled adaptation changes to the ViewportConfiguration. The experimental feature is on by default in
3038         extra zoom mode.
3039
3040         * Shared/WebPreferences.yaml:
3041         * Shared/WebPreferencesDefaultValues.h:
3042         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3043         (WebKit::WebChromeClient::dispatchDisabledAdaptationsDidChange const):
3044         * WebProcess/WebCoreSupport/WebChromeClient.h:
3045         * WebProcess/WebPage/WebPage.cpp:
3046         (WebKit::WebPage::disabledAdaptationsDidChange):
3047         * WebProcess/WebPage/WebPage.h:
3048
3049 2018-05-14  Chris Dumez  <cdumez@apple.com>
3050
3051         Overly aggressive timer throttling in service workers
3052         https://bugs.webkit.org/show_bug.cgi?id=185575
3053         <rdar://problem/40219038>
3054
3055         Reviewed by Geoff Garen.
3056
3057         After ~30 seconds, the system would put the service worker process in "App Nap",
3058         causing its timers to get aggressively throttled. This happens because the
3059         service worker processes are WebProcesses that have no visible WebPages.
3060
3061         To address the issue, we now disable process suppression for all service worker
3062         processes. This causes those processes to construct a UserActivity which prevents
3063         App Nap.
3064
3065         This patch also refactors the code a bit to avoid duplication. The ProcessSuppression
3066         suppression logic in now all on ChildProcessProxy / ChildProcess.
3067
3068         * NetworkProcess/NetworkProcess.messages.in:
3069         * PluginProcess/PluginProcess.messages.in:
3070         * Shared/ChildProcess.messages.in:
3071         * UIProcess/ChildProcessProxy.cpp:
3072         (WebKit::ChildProcessProxy::setProcessSuppressionEnabled):
3073         * UIProcess/ChildProcessProxy.h:
3074         * UIProcess/Network/NetworkProcessProxy.h:
3075         * UIProcess/Network/mac/NetworkProcessProxyMac.mm: Removed.
3076         * UIProcess/Plugins/PluginProcessProxy.h:
3077         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
3078         * UIProcess/ServiceWorkerProcessProxy.cpp:
3079         (WebKit::ServiceWorkerProcessProxy::didFinishLaunching):
3080         * UIProcess/ServiceWorkerProcessProxy.h:
3081         * UIProcess/WebProcessProxy.h:
3082         * WebKit.xcodeproj/project.pbxproj:
3083         * WebProcess/WebProcess.messages.in:
3084
3085 2018-05-14  Andy Estes  <aestes@apple.com>
3086
3087         [Wi-Fi Assertions] Allow clients to specify a context identifier
3088         https://bugs.webkit.org/show_bug.cgi?id=185620
3089         <rdar://problem/39915196>
3090
3091         Reviewed by Brady Eidson.
3092
3093         Added an SPI on _WKProcessPoolConfiguration that allows clients to specify a
3094         context identifier.
3095
3096         * NetworkProcess/NetworkProcessCreationParameters.cpp:
3097         (WebKit::NetworkProcessCreationParameters::encode const):
3098         (WebKit::NetworkProcessCreationParameters::decode):
3099         * NetworkProcess/NetworkProcessCreationParameters.h:
3100         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3101         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
3102         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3103         (API::ProcessPoolConfiguration::copy):
3104         * UIProcess/API/APIProcessPoolConfiguration.h:
3105         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
3106         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
3107         (-[_WKProcessPoolConfiguration wirelessContextIdentifier]):
3108         (-[_WKProcessPoolConfiguration setWirelessContextIdentifier:]):
3109         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3110         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
3111
3112 2018-05-11  Brian Burg  <bburg@apple.com>
3113
3114         Web Automation: Automation.getBrowsingContext returns window origin that differs from window.screenX/Y
3115         https://bugs.webkit.org/show_bug.cgi?id=185571
3116         <rdar://problem/40180785>
3117
3118         Reviewed by Timothy Hatcher.
3119
3120         This code path was refactored to use completion handlers. It seems that the window.screenX/Y
3121         code path converts back to user coordinates but the WebDriver code path does not. Make them
3122         consistent since that is how it is spec'd and tested.
3123
3124         * UIProcess/WebPageProxy.cpp:
3125         (WebKit::WebPageProxy::getWindowFrameWithCallback):
3126         Convert the window frame to user coordinate space so it's the same as window.screenY.
3127
3128 2018-05-14  Brian Burg  <bburg@apple.com>
3129
3130         WebDriver: W3C test case actions/key.py::test_lone_keyup_sends_no_events is failing
3131         https://bugs.webkit.org/show_bug.cgi?id=185577
3132         <rdar://problem/40185478>
3133
3134         Reviewed by Timothy Hatcher.
3135
3136         This test is failing because it expects Release Actions to not emit any
3137         events if nothing has changed from the initial state. Because the two code paths
3138         for creating empty states don't actually produce the same empty state, a difference
3139         in location was detected between the two empty states. This generates a mousemove.
3140
3141         To fix this, unify the code that creates an empty state. For mouse input sources, always
3142         initialize the location to (0, 0) so that the mouse input source always has
3143         a location that is valid to click at.
3144
3145         * UIProcess/Automation/SimulatedInputDispatcher.h:
3146         Extract the type enum out of the class to avoid circular definitions of
3147         SimulatedInputSource and SimulatedInputSourceState.
3148
3149         * UIProcess/Automation/SimulatedInputDispatcher.cpp:
3150         (WebKit::SimulatedInputSourceState::emptyStateForSourceType):
3151         Take the input source type when generating an empty state. We always want location
3152         set for a mouse input source, but not set it for other input sources like keys.
3153
3154         (WebKit::SimulatedInputKeyFrame::keyFrameToResetInputSources):
3155         (WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
3156         (WebKit::SimulatedInputSource::create):
3157         (WebKit::SimulatedInputSource::SimulatedInputSource):
3158         (WebKit::SimulatedInputSourceState::emptyState): Deleted.
3159         * UIProcess/Automation/WebAutomationSession.cpp:
3160         (WebKit::WebAutomationSession::WebAutomationSession):
3161         (WebKit::WebAutomationSession::inputSourceForType const):
3162         (WebKit::simulatedInputSourceTypeFromProtocolSourceType):
3163         (WebKit::WebAutomationSession::performInteractionSequence):
3164         * UIProcess/Automation/WebAutomationSession.h:
3165
3166 2018-05-14  Michael Catanzaro  <mcatanzaro@igalia.com>
3167
3168         -Wmemset-elt-size warning in LibWebRTCSocket constructor
3169         https://bugs.webkit.org/show_bug.cgi?id=185555
3170
3171         Reviewed by Youenn Fablet.
3172
3173         Add missing multiplication.
3174
3175         * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
3176         (WebKit::LibWebRTCSocket::LibWebRTCSocket):
3177
3178 2018-05-14  Zan Dobersek  <zdobersek@igalia.com>
3179
3180         [GTK] REGRESSION(r231170) Build broken with Clang 5.0
3181         https://bugs.webkit.org/show_bug.cgi?id=185198
3182
3183         Reviewed by Michael Catanzaro.
3184
3185         * Shared/RTCNetwork.h: With std::optional forward declaration gone,
3186         explicitly include the WTF Optional.h header.
3187
3188 2018-05-13  Dean Jackson  <dino@apple.com>
3189
3190         WebKit2_Sim-7606.1.17.4 introduced dep cycle
3191         https://bugs.webkit.org/show_bug.cgi?id=185588
3192         <rdar://problem/40196581>
3193
3194         Reviewed by Tim Horton.
3195
3196         Soft link AssetViewer.framework to avoid a dependency cycle.
3197
3198         * Configurations/WebKit.xcconfig:
3199         * UIProcess/ios/WKSystemPreviewView.mm:
3200         (-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]):
3201
3202 2018-05-11  Daniel Bates  <dabates@apple.com>
3203
3204         X-Frame-Options: SAMEORIGIN needs to check all ancestor frames
3205         https://bugs.webkit.org/show_bug.cgi?id=185567
3206         <rdar://problem/40175008>
3207
3208         Reviewed by Brent Fulgham.
3209
3210         Change the behavior of "X-Frame-Options: SAMEORIGIN" to ensure that all ancestors frames
3211         are same-origin with the document that delivered this header. This prevents an intermediary
3212         malicious frame from clickjacking a child frame whose document is same-origin with the top-
3213         level frame. It also makes the behavior of X-Frame-Options in WebKit more closely match
3214         the behavior of X-Frame-Options in other browsers, including Chrome and Firefox.
3215         
3216         Currently a document delivered with "X-Frame-Options: SAMEORIGIN" must only be same-origin
3217         with the top-level frame's document in order to be displayed. This prevents clickjacking by
3218         a malicious page that embeds a page delivered with "X-Frame-Options: SAMEORIGIN". However,
3219         it does not protect against clickjacking of the "X-Frame-Options: SAMEORIGIN" page (victim)
3220         if embedded by an intermediate malicious iframe, say a "rogue ad", that was embedded in a
3221         document same origin with the victim page. We should protect against such attacks.
3222
3223         * NetworkProcess/NetworkResourceLoader.cpp:
3224         (WebKit::NetworkResourceLoader::shouldInterruptLoadForXFrameOptions):
3225
3226 2018-05-11  Dean Jackson  <dino@apple.com>
3227
3228         WKWebViewContentProvider should know what MIME type it was created to handle
3229         https://bugs.webkit.org/show_bug.cgi?id=185574
3230         <rdar://problem/40183049>
3231
3232         Reviewed by Tim Horton.
3233
3234         Pass the MIME type of the downloaded asset into the WKWebViewContentProvider's
3235         init method, so it can choose to do something based on that information. The
3236         PDF and LegacyPDF views don't care because they, clearly, only handle PDF. But
3237         a WKSystemPreviewView can handle multiple types.
3238
3239         * UIProcess/API/Cocoa/WKWebView.mm:
3240         (-[WKWebView _setHasCustomContentView:loadedMIMEType:]): Send the MIME type on
3241         to the WKWebViewContentProvider.
3242         * UIProcess/Cocoa/WKWebViewContentProvider.h: Add a new parameter to web_initWithFrame.
3243         * UIProcess/ios/WKLegacyPDFView.mm:
3244         (-[WKLegacyPDFView web_initWithFrame:webView:mimeType:]):
3245         (-[WKLegacyPDFView web_initWithFrame:webView:]): Deleted.
3246         * UIProcess/ios/WKPDFView.mm:
3247         (-[WKPDFView web_initWithFrame:webView:mimeType:]):
3248         (-[WKPDFView web_initWithFrame:webView:]): Deleted.
3249         * UIProcess/ios/WKSystemPreviewView.mm:
3250         (-[WKSystemPreviewView web_initWithFrame:webView:mimeType:]):
3251         (-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]): Actually use
3252         the MIME type to tell QuickLook what it will be getting, rather than basing it on
3253         the file extension.
3254         (-[WKSystemPreviewView web_initWithFrame:webView:]): Deleted.
3255
3256 2018-05-11  Brent Fulgham  <bfulgham@apple.com>
3257
3258         Allow the WebContent process to read global ViewBridge preferences
3259         https://bugs.webkit.org/show_bug.cgi?id=185569
3260         <rdar://problem/40164339>
3261
3262         Reviewed by Eric Carlson.
3263
3264         Allow reads of the global /Library/Preferences/com.apple.ViewBridge.plist preference file.
3265
3266         * WebProcess/com.apple.WebProcess.sb.in:
3267
3268 2018-05-11  Megan Gardner  <megan_gardner@apple.com>
3269
3270         Cleanup canPerformActionForWebView in relation to the webSelectionAssistant being removed
3271         https://bugs.webkit.org/show_bug.cgi?id=185536
3272
3273         Reviewed by Tim Horton.
3274         
3275         The _webSelectionAssistant is now always nil, therefor many of these checks are unnecessary.
3276         Remove the check for a webSelection and clean up the logic surrounding those checks.
3277
3278         * UIProcess/ios/WKContentViewInteraction.mm:
3279         (-[WKContentView canPerformActionForWebView:withSender:]):
3280
3281 2018-05-11  Brady Eidson  <beidson@apple.com>
3282
3283         Followup to: Make sure history navigations reuse the existing process when necessary.
3284         https://bugs.webkit.org/show_bug.cgi?id=185532
3285
3286         Reviewed by Andy Estes.
3287
3288         * UIProcess/WebProcessPool.cpp:
3289         (WebKit::WebProcessPool::processForNavigationInternal): When re-using the same process,
3290           don't change the policy action.
3291
3292 2018-05-11  Charles Vazac  <cvazac@gmail.com>
3293
3294         Runtime feature flag for Server-Timing
3295         https://bugs.webkit.org/show_bug.cgi?id=184758
3296
3297         Reviewed by Youenn Fablet.
3298
3299         * Shared/WebPreferences.yaml: Added ServerTimingEnabled.
3300         * UIProcess/API/C/WKPreferences.cpp:
3301         (WKPreferencesGetServerTimingEnabled):
3302         * UIProcess/API/C/WKPreferencesRefPrivate.h: WK_EXPORT for WKPreferencesSetServerTimingEnabled.
3303         * WebProcess/Storage/WebSWContextManagerConnection.cpp: Call setServerTimingEnabled.
3304
3305 2018-05-11  Antti Koivisto  <antti@apple.com>
3306
3307         Network process should not stat() all cache files on startup to find their sizes
3308         https://bugs.webkit.org/show_bug.cgi?id=185542
3309         <rdar://problem/40092953>
3310
3311         Reviewed by Chris Dumez.
3312
3313         This is done to compute how much disk space a cache is using. While the operation happens
3314         in a background priority thread it is still quite a bit of work.
3315
3316         Large bodies are saved in separate blob files so record file sizes are capped. We can avoid work by
3317         estimating their size instead of counting it exactly.
3318
3319         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3320         (WebKit::NetworkCache::estimateRecordsSize):
3321         (WebKit::NetworkCache::Storage::synchronize):
3322
3323             Use size estimation if blob storage is in use.
3324             Remove the code that would delete empty files. Normal cache shrinking handles this.
3325
3326         (WebKit::NetworkCache::Storage::shouldStoreBodyAsBlob):
3327
3328 2018-05-11  Brady Eidson  <beidson@apple.com>
3329
3330         Make sure history navigations reuse the existing process when necessary.
3331         <rdar://problem/39746516> and https://bugs.webkit.org/show_bug.cgi?id=185532
3332
3333         Reviewed by Ryosuke Niwa.
3334
3335         If a view navigates to either a data: or blob: URL, it reuses the existing process.
3336  
3337         In such cases we need to also ensure that history navigations back will also reuse the existing process.
3338
3339         * Shared/NavigationActionData.cpp:
3340         (WebKit::NavigationActionData::encode const):
3341         (WebKit::NavigationActionData::decode):
3342         * Shared/NavigationActionData.h:
3343
3344         * UIProcess/API/APINavigation.h:
3345         (API::Navigation::setTargetItem):
3346
3347         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
3348         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
3349         (-[_WKProcessPoolConfiguration pageCacheEnabled]):
3350         (-[_WKProcessPoolConfiguration setPageCacheEnabled:]):
3351
3352         * UIProcess/WebPageProxy.cpp:
3353         (WebKit::WebPageProxy::receivedPolicyDecision):
3354         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
3355
3356         * UIProcess/WebProcessPool.cpp:
3357         (WebKit::WebProcessPool::processForNavigationInternal): If the current and target back/forward items both
3358           came from the same process, then reuse the existing process.
3359
3360         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3361         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
3362
3363 2018-05-10  Brent Fulgham  <bfulgham@apple.com>
3364
3365         REGRESSION(r231057): Encrypted media content playback failures
3366         https://bugs.webkit.org/show_bug.cgi?id=185537
3367         <rdar://problem/40038478>
3368
3369         Reviewed by Eric Carlson.
3370
3371         Put access to the SecurityServer back in the sandbox so we can validate the
3372         signatures of media encoder/decoders.
3373
3374         * WebProcess/com.apple.WebProcess.sb.in:
3375
3376 2018-05-11  Youenn Fablet  <youenn@apple.com>
3377
3378         NetworkCORSPreflightChecker should proceed when having a ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested challenge
3379         https://bugs.webkit.org/show_bug.cgi?id=185522
3380         <rdar://problem/39987152>
3381
3382         Reviewed by Brent Fulgham.
3383
3384         In case of such challenge, refuse to proceed with authentication since preflight is not using credentials.
3385         Previously, we were failing right away which is not right in case preflight is the request triggering the connection.
3386
3387         Manually tested.
3388
3389         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
3390         (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
3391
3392 2018-05-10  Daniel Bates  <dabates@apple.com>
3393
3394         Use PlatformStrategies to switch between WebKit and WebKitLegacy checking of CSP frame-ancestors and X-Frame-Options
3395         https://bugs.webkit.org/show_bug.cgi?id=185412
3396
3397         Reviewed by Ryosuke Niwa.
3398
3399         Update code for renaming and write in terms of WebLoaderStrategy::shouldPerformSecurityChecks()
3400         instead of explicitly querying RuntimeEnabledFeatures::sharedFeatures().restrictedHTTPResponseAccess().
3401
3402         * WebProcess/Network/WebLoaderStrategy.cpp:
3403         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
3404         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
3405         (WebKit::WebLoaderStrategy::startPingLoad):
3406         (WebKit::WebLoaderStrategy::preconnectTo):
3407         (WebKit::WebLoaderStrategy::shouldPerformSecurityChecks const):
3408         (WebKit::WebLoaderStrategy::havePerformedSecurityChecks const):
3409         (WebKit::WebLoaderStrategy::isDoingLoadingSecurityChecks const): Deleted.
3410         * WebProcess/Network/WebLoaderStrategy.h:
3411         * WebProcess/WebPage/WebPage.cpp:
3412
3413 2018-05-10  Timothy Horton  <timothy_horton@apple.com>
3414
3415         Fix the build after r231393
3416         ​https://bugs.webkit.org/show_bug.cgi?id=185519
3417         <rdar://problem/40131741>
3418
3419         * Configurations/WebKit.xcconfig:
3420
3421 2018-05-10  John Wilander  <wilander@apple.com>
3422
3423         Storage Access API: Extend lifetime of cookies on successful user approval
3424         https://bugs.webkit.org/show_bug.cgi?id=185534
3425         <rdar://problem/40064547>
3426
3427         Reviewed by Brent Fulgham.
3428
3429         * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
3430         (WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):
3431             Picks up the experimental feature flag.
3432         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3433         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccessInternal):
3434             Now updates the domain's user interaction timestamp if the user was
3435             prompted for this access.
3436         * UIProcess/WebResourceLoadStatisticsStore.h:
3437
3438 2018-05-10  Chris Dumez  <cdumez@apple.com>
3439
3440         [iOS] Release page load process assertion if the screen is locked
3441         https://bugs.webkit.org/show_bug.cgi?id=185333
3442
3443         Reviewed by Geoff Garen.
3444
3445         We normally take a background process assertion during page loads to allow them to complete
3446         even if the tab / app is backgrounded. We should however avoid doing so when the backgrounding
3447         is caused by the screen locking. Keeping the process assertion in this case would prevent the
3448         whole device from sleeping longer than it should, thus negatively impacting power.
3449
3450         * UIProcess/Cocoa/NavigationState.h:
3451         * UIProcess/Cocoa/NavigationState.mm:
3452         (WebKit::NavigationState::NavigationState):
3453         (WebKit::NavigationState::releaseNetworkActivityToken):
3454         (WebKit::NavigationState::didChangeIsLoading):
3455         * UIProcess/ios/WebPageProxyIOS.mm:
3456         (WebKit::WebPageProxy::applicationDidEnterBackground):
3457
3458 2018-05-10  Megan Gardner  <megan_gardner@apple.com>
3459
3460         Remove Unused Chinese/Japanese Reanalyze code
3461         https://bugs.webkit.org/show_bug.cgi?id=185529
3462
3463         Reviewed by Wenson Hsieh.
3464         
3465         The code for this has actually been completely removed from UIKit. This is unreachable 
3466         dead code that should be removed if just for cleanliness. 
3467
3468         * Platform/spi/ios/UIKitSPI.h:
3469         * UIProcess/API/Cocoa/WKWebViewInternal.h: