Update touch event tracking type on every touch
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-05-17  Jer Noble  <jer.noble@apple.com>
2
3         Turn Modern EME API on by default and remove it as an experimental feature
4         https://bugs.webkit.org/show_bug.cgi?id=185693
5         <rdar://problem/39954396>
6
7         Reviewed by Eric Carlson.
8
9         * Shared/WebPreferences.yaml:
10
11 2018-05-17  Dean Jackson  <dino@apple.com>
12
13         Safari optimized flow should be releasing viewer to prevent memory growth with subsequent launches/closes
14         https://bugs.webkit.org/show_bug.cgi?id=185722
15         <rdar://problem/40247351>
16
17         Reviewed by Antoine Quint.
18
19         I made a rookie mistake in the original patch: I was holding a strong
20         reference to "self" in a block, which was causing a retain cycle.
21         Replace that with a WeakObjCPtr.
22
23         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
24         (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
25
26 2018-05-16  Brent Fulgham  <bfulgham@apple.com>
27
28         REGRESSION(r229093)[macOS] Allow network-outbound for syslog use
29         https://bugs.webkit.org/show_bug.cgi?id=185703
30         <rdar://problem/39778918>
31
32         Reviewed by Eric Carlson.
33
34         In r229093 I removed the 'network-outbound' permission for syslog use.
35         Further testing has shown that this is still needed for subsystem
36         logging in our bundle loading code.
37
38         This patch re-enabled network-outbound for syslog.
39
40         * WebProcess/com.apple.WebProcess.sb.in:
41
42 2018-05-16  Andy VanWagoner  <andy@vanwagoner.family>
43
44         Add support for Intl NumberFormat formatToParts
45         https://bugs.webkit.org/show_bug.cgi?id=185375
46
47         Reviewed by Yusuke Suzuki.
48
49         Add flag for NumberFormat formatToParts.
50
51         * Configurations/FeatureDefines.xcconfig:
52
53 2018-05-16  Andy Estes  <aestes@apple.com>
54
55         [Wi-Fi Assertions] Adopt WiFiAssertionHolderAdditions
56         https://bugs.webkit.org/show_bug.cgi?id=185685
57         <rdar://problem/40136681>
58
59         Reviewed by Sam Weinig.
60
61         * NetworkProcess/cocoa/WiFiAssertionHolder.cpp:
62         (WebKit::WiFiAssertionHolder::WiFiAssertionHolder):
63         (WebKit::WiFiAssertionHolder::~WiFiAssertionHolder):
64         (WebKit::ensureWiFiManagerClient): Deleted.
65
66 2018-05-16  Fujii Hironori  <Hironori.Fujii@sony.com>
67
68         [Win] Implement WebPage::handleEditingKeyboardEvent
69         https://bugs.webkit.org/show_bug.cgi?id=185327
70
71         Reviewed by Alexey Proskuryakov.
72
73         * WebProcess/WebPage/win/WebPageWin.cpp:
74         (WebKit::WebPage::handleEditingKeyboardEvent): Copied from WebKitLegacy.
75
76 2018-05-16  Sihui Liu  <sihui_liu@apple.com>
77
78         Session cookies aren't reliably set when using default WKWebSiteDataStore
79         https://bugs.webkit.org/show_bug.cgi?id=185624
80         <rdar://problem/39111626>
81
82         Reviewed by Geoffrey Garen.
83
84         Session cookies of default session were set in UI Process when there was no process pool, 
85         but they were not synced (or synced slowly to) Network Process. To make these cookies visible
86         as soon as they were set through API, we could manually set those cookies in Network Process
87         during its initilization. 
88
89         * NetworkProcess/mac/RemoteNetworkingContext.mm:
90         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
91         * UIProcess/API/APIHTTPCookieStore.cpp:
92         (API::HTTPCookieStore::cookies):
93         (API::HTTPCookieStore::setCookie):
94         (API::HTTPCookieStore::deleteCookie):
95         * UIProcess/WebProcessPool.cpp:
96         (WebKit::WebProcessPool::ensureNetworkProcess):
97         (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
98         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
99         (WebKit::WebsiteDataStore::clearPendingCookies):
100         * UIProcess/WebsiteData/WebsiteDataStore.h:
101
102 2018-05-16  Chris Nardi  <cnardi@chromium.org>
103
104         Remove Document#selectedStylesheetSet/preferredStylesheetSet
105         https://bugs.webkit.org/show_bug.cgi?id=185381
106
107         Reviewed by Darin Adler.
108
109         Make API methods for Document#selectedStylesheetSet/preferredStylesheetSet do nothing.
110
111         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.h:
112         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp:
113         (webkit_dom_document_set_property):
114         (webkit_dom_document_get_property):
115         (webkit_dom_document_get_preferred_stylesheet_set):
116         (webkit_dom_document_get_selected_stylesheet_set):
117         (webkit_dom_document_set_selected_stylesheet_set):
118
119 2018-05-16  Alberto Garcia  <berto@igalia.com>
120
121         [CMake] Properly detect compiler flags, needed libs, and fallbacks for usage of 64-bit atomic operations
122         https://bugs.webkit.org/show_bug.cgi?id=182622
123
124         Reviewed by Michael Catanzaro.
125
126         Move the test to determine whether we need to link against
127         libatomic to the common file WebKitCompilerFlags.cmake so it can
128         also be used for JavaScriptCore.
129
130         * CMakeLists.txt:
131
132 2018-05-15  Yusuke Suzuki  <utatane.tea@gmail.com>
133
134         [JSC] Check TypeInfo first before calling getCallData when we would like to check whether given object is a function
135         https://bugs.webkit.org/show_bug.cgi?id=185601
136
137         Reviewed by Saam Barati.
138
139         * WebProcess/Plugins/Netscape/JSNPObject.h:
140
141 2018-05-15  Sihui Liu  <sihui_liu@apple.com>
142
143         StorageManager::deleteLocalStorageOriginsModifiedSince: database files get deleted before database connections close
144         https://bugs.webkit.org/show_bug.cgi?id=185671
145
146         Reviewed by Geoffrey Garen.
147
148         We should delete database files before closing databases.
149
150         * UIProcess/WebStorage/LocalStorageDatabase.cpp:
151         (WebKit::LocalStorageDatabase::updateDatabaseWithChangedItems):
152         * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
153         (WebKit::LocalStorageDatabaseTracker::databasesModifiedSince):
154         (WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince): Deleted.
155         * UIProcess/WebStorage/LocalStorageDatabaseTracker.h:
156         * UIProcess/WebStorage/StorageManager.cpp:
157         (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
158
159 2018-05-15  Dean Jackson  <dino@apple.com>
160
161         Launch System Preview as the download starts, rather than waiting for a response
162         https://bugs.webkit.org/show_bug.cgi?id=185669
163         <rdar://problem/40278181>
164
165         Reviewed by Tim Horton.
166
167         We were waiting for the RequestResponse to get a MIME-type before
168         launching the system preview. This causes an annoying delay.
169
170         Instead, assume that the system preview is one of the handled
171         mime types and launch the viewer immediately. If it gets something it
172         didn't expect, it will show an error.
173
174         * UIProcess/Cocoa/DownloadClient.mm:
175         (WebKit::DownloadClient::didStart):
176         (WebKit::DownloadClient::didReceiveResponse):
177         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
178         (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
179         (WebKit::SystemPreviewController::start): Small cleanup to ensure we
180         don't try to present twice (this shouldn't happen).
181
182 2018-05-15  Dean Jackson  <dino@apple.com>
183
184         Post-review cleanup for 185459
185         https://bugs.webkit.org/show_bug.cgi?id=185665
186         <rdar://problem/40276689>
187
188         Reviewed by Tim Horton.
189
190         Jon made some comments in 185459 that I'm addressing here.
191
192         * UIProcess/Cocoa/DownloadClient.h:
193         * UIProcess/Cocoa/DownloadClient.mm: Guard the activity token for iOS
194         in a way that means it will still work ok on macOS.
195         (WebKit::DownloadClient::didStart):
196         (WebKit::DownloadClient::processDidCrash):
197         (WebKit::DownloadClient::didFinish):
198         (WebKit::DownloadClient::didFail):
199         (WebKit::DownloadClient::didCancel):
200         (WebKit::DownloadClient::takeActivityToken):
201         (WebKit::DownloadClient::releaseActivityTokenIfNecessary):
202         (WebKit::DownloadClient::releaseActivityToken): Deleted.
203
204         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: Add an early return.
205         (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
206
207 2018-05-15  Tadeu Zagallo  <tzagallo@apple.com>
208
209         Update touch event tracking types on every touch
210         https://bugs.webkit.org/show_bug.cgi?id=184250
211         <rdar://problem/39145092>
212
213         Reviewed by Geoffrey Garen.
214
215         The tracking types for touch events were only update on touchstart, which meant that event
216         listeners added after the touchstart would always be treated as passive, even if explicitly
217         setting passive to false.
218
219         * UIProcess/WebPageProxy.cpp:
220         (WebKit::WebPageProxy::handleTouchEventSynchronously):
221         (WebKit::WebPageProxy::handleTouchEvent):
222
223 2018-05-15  Per Arne Vollan  <pvollan@apple.com>
224
225         Pause display links when window is not visible.
226         https://bugs.webkit.org/show_bug.cgi?id=185627
227         <rdar://problem/39401106>
228
229         Reviewed by Simon Fraser.
230
231         Pause/resume display links created in the UI process when the window is hidden/shown.
232
233         * UIProcess/WebPageProxy.cpp:
234         (WebKit::WebPageProxy::dispatchActivityStateChange):
235         * UIProcess/mac/DisplayLink.cpp:
236         (WebKit::DisplayLink::pause):
237         (WebKit::DisplayLink::resume):
238         * UIProcess/mac/DisplayLink.h:
239
240 2018-05-15  Dean Jackson  <dino@apple.com>
241
242         Provide UIView and UIImage for zoom transition
243         https://bugs.webkit.org/show_bug.cgi?id=185655
244         <rdar://problem/40267224>
245
246         Reviewed by Antoine Quint.
247
248         Provide a UIView* for the frameForPreviewItem to use as a source view.
249         Also implement the transitionImageForPreviewItem delegate, even though
250         we're returning nil.
251
252         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
253         (-[_WKPreviewControllerDelegate previewController:frameForPreviewItem:inSourceView:]):
254         (-[_WKPreviewControllerDelegate previewController:transitionImageForPreviewItem:contentRect:]):
255
256 2018-05-15  Daniel Bates  <dabates@apple.com>
257
258         Fix the Apple Internal build
259
260         Make a similar change to WebKit as I did for LegacyWebKit in r231777. See <rdar://problem/40237873> for more details.
261
262         * UIProcess/mac/WKFullScreenWindowController.mm:
263         (-[WKFullScreenWindowController enterFullScreen:]):
264         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
265         (-[WKFullScreenWindowController exitFullScreen]):
266         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
267         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
268         (-[WKFullScreenWindowController completeFinishExitFullScreenAnimationAfterRepaint]):
269         (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]):
270         (-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]):
271
272 2018-05-15  Megan Gardner  <megan_gardner@apple.com>
273
274         Clear selections from web content with single tap
275         https://bugs.webkit.org/show_bug.cgi?id=185634
276
277         Reviewed by Tim Horton.
278         
279         With the switch to the single text selection assistant, we were not correctly clearing the selection when a
280         single tap happened.
281
282         * UIProcess/ios/WKContentViewInteraction.mm:
283         (-[WKContentView _singleTapCommited:]):
284
285 2018-05-15  Antoine Quint  <graouts@apple.com>
286
287         [Web Animations] Expose Web Animations CSS integration as an experimental feature
288         https://bugs.webkit.org/show_bug.cgi?id=185647
289
290         Reviewed by Dean Jackson.
291
292         Rename the Web Animations CSS integration flag.
293
294         * Shared/WebPreferences.yaml:
295         * UIProcess/API/C/WKPreferences.cpp:
296         (WKPreferencesSetWebAnimationsCSSIntegrationEnabled):
297         (WKPreferencesGetWebAnimationsCSSIntegrationEnabled):
298         (WKPreferencesSetCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled): Deleted.
299         (WKPreferencesGetCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled): Deleted.
300         * UIProcess/API/C/WKPreferencesRefPrivate.h:
301         * UIProcess/API/Cocoa/WKPreferences.mm:
302         (-[WKPreferences _setWebAnimationsCSSIntegrationEnabled:]):
303         (-[WKPreferences _webAnimationsCSSIntegrationEnabled]):
304         (-[WKPreferences _setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled:]): Deleted.
305         (-[WKPreferences _cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled]): Deleted.
306         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
307         * WebProcess/InjectedBundle/InjectedBundle.cpp:
308         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
309         (WebKit::InjectedBundle::setWebAnimationsCSSIntegrationEnabled):
310         (WebKit::InjectedBundle::setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled): Deleted.
311         * WebProcess/InjectedBundle/InjectedBundle.h:
312
313 2018-05-15  Dean Jackson  <dino@apple.com>
314
315         Update animation when presenting QuickLook
316         https://bugs.webkit.org/show_bug.cgi?id=185648
317         <rdar://problem/39652624>
318
319         Reviewed by Antoine Quint.
320
321         Implement the QuickLook delegate on _WKPreviewControllerDelegate that
322         produces a zoom-like animation when the QLPreviewController appears.
323
324         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
325         (-[_WKPreviewControllerDelegate previewController:frameForPreviewItem:inSourceView:]):
326         * UIProcess/SystemPreviewController.h: Add a reference back to the page, so that
327         the delegate implementation can access the presentingViewController.
328         (WebKit::SystemPreviewController::page):
329
330 2018-05-14  Dean Jackson  <dino@apple.com>
331
332         Download and present System Preview
333         https://bugs.webkit.org/show_bug.cgi?id=185459
334         <rdar://problem/40079228>
335
336         Reviewed by Tim Horton.
337
338         Extend DownloadClient so that it can handle the case where
339         the download was triggered by a System Preview. In this situation
340         the result (and progress) are piped into QuickLook via the SystemPreviewController.
341
342         The DownloadProxy class is also extended to handle the destination
343         filename and the size of the content.
344
345         Lastly, SystemPreviewController is updated to have a start(), show()
346         and cancel() interface, and no longer adjusts page navigation.
347
348         * UIProcess/Cocoa/DownloadClient.h:
349         * UIProcess/Cocoa/DownloadClient.mm: Handle the SystemPreview case, which
350         doesn't have a download delegate, but instead needs to communicate with
351         the SystemPreviewController, if one exists.
352         (WebKit::DownloadClient::didStart):
353         (WebKit::DownloadClient::didReceiveResponse):
354         (WebKit::DownloadClient::didReceiveData):
355         (WebKit::DownloadClient::didCreateDestination):
356         (WebKit::DownloadClient::processDidCrash):
357         (WebKit::DownloadClient::decideDestinationWithSuggestedFilename):
358         (WebKit::DownloadClient::didFinish):
359         (WebKit::DownloadClient::didFail):
360         (WebKit::DownloadClient::didCancel):
361         (WebKit::DownloadClient::releaseActivityToken):
362
363         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: Implement the new API.
364         (-[_WKPreviewControllerDataSource initWithMIMEType:]):
365         (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
366         (-[_WKPreviewControllerDataSource setProgress:]):
367         (-[_WKPreviewControllerDataSource finish:]):
368         (-[_WKPreviewControllerDelegate previewControllerDidDismiss:]):
369         (WebKit::SystemPreviewController::start):
370         (WebKit::SystemPreviewController::updateProgress):
371         (WebKit::SystemPreviewController::finish):
372         (WebKit::SystemPreviewController::cancel):
373         (-[_WKPreviewControllerDataSource initWithURL:]): Deleted.
374         (-[_WKPreviewControllerDelegate previewControllerWillDismiss:]): Deleted.
375         (WebKit::SystemPreviewController::canPreview const): Deleted.
376         (WebKit::SystemPreviewController::showPreview): Deleted.
377         * UIProcess/Downloads/DownloadProxy.h: Track the destination file by name
378         and size. Also expose a helper to identify system preview downloads.
379         (WebKit::DownloadProxy::destinationFilename const):
380         (WebKit::DownloadProxy::setDestinationFilename):
381         (WebKit::DownloadProxy::expectedContentLength const):
382         (WebKit::DownloadProxy::setExpectedContentLength):
383         (WebKit::DownloadProxy::bytesLoaded const):
384         (WebKit::DownloadProxy::setBytesLoaded):
385         (WebKit::DownloadProxy::isSystemPreviewDownload const):
386
387         * UIProcess/SystemPreviewController.cpp: New API.
388         (WebKit::SystemPreviewController::canPreview const):
389         (WebKit::SystemPreviewController::sendPageBack): Deleted.
390         (WebKit::SystemPreviewController::showPreview): Deleted.
391         * UIProcess/SystemPreviewController.h:
392
393         * UIProcess/WebPageProxy.cpp:
394         (WebKit::m_configurationPreferenceValues):
395         (WebKit::WebPageProxy::reattachToWebProcess):
396         (WebKit::WebPageProxy::resetState):
397         * UIProcess/WebPageProxy.h:
398
399 2018-05-14  Brady Eidson  <beidson@apple.com>
400
401         Add an API test to guard against regressions while re-entering setDefersLoading:.
402         <rdar://problem/37033737> and https://bugs.webkit.org/show_bug.cgi?id=185630
403
404         Reviewed by Chris Dumez.
405
406         * UIProcess/API/Cocoa/WKWebView.mm:
407         (-[WKWebView _setDefersLoadingForTesting:]):
408         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
409
410         * UIProcess/WebPageProxy.cpp:
411         (WebKit::WebPageProxy::setDefersLoadingForTesting):
412         * UIProcess/WebPageProxy.h:
413         * WebProcess/WebPage/WebPage.messages.in:
414
415 2018-05-14  Tim Horton  <timothy_horton@apple.com>
416
417         Use the system font by default in extra zoom mode
418         https://bugs.webkit.org/show_bug.cgi?id=185638
419         <rdar://problem/40230277>
420
421         Reviewed by Wenson Hsieh.
422
423         * Shared/WebPreferencesDefaultValues.h:
424
425 2018-05-14  Michael Catanzaro  <mcatanzaro@igalia.com>
426
427         Unreviewed, rolling out r231755.
428
429         Change is not correct
430
431         Reverted changeset:
432
433         "-Wmemset-elt-size warning in LibWebRTCSocket constructor"
434         https://bugs.webkit.org/show_bug.cgi?id=185555
435         https://trac.webkit.org/changeset/231755
436
437 2018-05-14  Wenson Hsieh  <wenson_hsieh@apple.com>
438
439         [Extra zoom mode] Google search results are excessively zoomed in
440         https://bugs.webkit.org/show_bug.cgi?id=185347
441         <rdar://problem/39999778>
442
443         Reviewed by Tim Horton.
444
445         Adds a new experimental feature for the "disabled-adaptations" meta tag, and adds plumbing in WebKit to
446         propagate disabled adaptation changes to the ViewportConfiguration. The experimental feature is on by default in
447         extra zoom mode.
448
449         * Shared/WebPreferences.yaml:
450         * Shared/WebPreferencesDefaultValues.h:
451         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
452         (WebKit::WebChromeClient::dispatchDisabledAdaptationsDidChange const):
453         * WebProcess/WebCoreSupport/WebChromeClient.h:
454         * WebProcess/WebPage/WebPage.cpp:
455         (WebKit::WebPage::disabledAdaptationsDidChange):
456         * WebProcess/WebPage/WebPage.h:
457
458 2018-05-14  Chris Dumez  <cdumez@apple.com>
459
460         Overly aggressive timer throttling in service workers
461         https://bugs.webkit.org/show_bug.cgi?id=185575
462         <rdar://problem/40219038>
463
464         Reviewed by Geoff Garen.
465
466         After ~30 seconds, the system would put the service worker process in "App Nap",
467         causing its timers to get aggressively throttled. This happens because the
468         service worker processes are WebProcesses that have no visible WebPages.
469
470         To address the issue, we now disable process suppression for all service worker
471         processes. This causes those processes to construct a UserActivity which prevents
472         App Nap.
473
474         This patch also refactors the code a bit to avoid duplication. The ProcessSuppression
475         suppression logic in now all on ChildProcessProxy / ChildProcess.
476
477         * NetworkProcess/NetworkProcess.messages.in:
478         * PluginProcess/PluginProcess.messages.in:
479         * Shared/ChildProcess.messages.in:
480         * UIProcess/ChildProcessProxy.cpp:
481         (WebKit::ChildProcessProxy::setProcessSuppressionEnabled):
482         * UIProcess/ChildProcessProxy.h:
483         * UIProcess/Network/NetworkProcessProxy.h:
484         * UIProcess/Network/mac/NetworkProcessProxyMac.mm: Removed.
485         * UIProcess/Plugins/PluginProcessProxy.h:
486         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
487         * UIProcess/ServiceWorkerProcessProxy.cpp:
488         (WebKit::ServiceWorkerProcessProxy::didFinishLaunching):
489         * UIProcess/ServiceWorkerProcessProxy.h:
490         * UIProcess/WebProcessProxy.h:
491         * WebKit.xcodeproj/project.pbxproj:
492         * WebProcess/WebProcess.messages.in:
493
494 2018-05-14  Andy Estes  <aestes@apple.com>
495
496         [Wi-Fi Assertions] Allow clients to specify a context identifier
497         https://bugs.webkit.org/show_bug.cgi?id=185620
498         <rdar://problem/39915196>
499
500         Reviewed by Brady Eidson.
501
502         Added an SPI on _WKProcessPoolConfiguration that allows clients to specify a
503         context identifier.
504
505         * NetworkProcess/NetworkProcessCreationParameters.cpp:
506         (WebKit::NetworkProcessCreationParameters::encode const):
507         (WebKit::NetworkProcessCreationParameters::decode):
508         * NetworkProcess/NetworkProcessCreationParameters.h:
509         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
510         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
511         * UIProcess/API/APIProcessPoolConfiguration.cpp:
512         (API::ProcessPoolConfiguration::copy):
513         * UIProcess/API/APIProcessPoolConfiguration.h:
514         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
515         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
516         (-[_WKProcessPoolConfiguration wirelessContextIdentifier]):
517         (-[_WKProcessPoolConfiguration setWirelessContextIdentifier:]):
518         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
519         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
520
521 2018-05-11  Brian Burg  <bburg@apple.com>
522
523         Web Automation: Automation.getBrowsingContext returns window origin that differs from window.screenX/Y
524         https://bugs.webkit.org/show_bug.cgi?id=185571
525         <rdar://problem/40180785>
526
527         Reviewed by Timothy Hatcher.
528
529         This code path was refactored to use completion handlers. It seems that the window.screenX/Y
530         code path converts back to user coordinates but the WebDriver code path does not. Make them
531         consistent since that is how it is spec'd and tested.
532
533         * UIProcess/WebPageProxy.cpp:
534         (WebKit::WebPageProxy::getWindowFrameWithCallback):
535         Convert the window frame to user coordinate space so it's the same as window.screenY.
536
537 2018-05-14  Brian Burg  <bburg@apple.com>
538
539         WebDriver: W3C test case actions/key.py::test_lone_keyup_sends_no_events is failing
540         https://bugs.webkit.org/show_bug.cgi?id=185577
541         <rdar://problem/40185478>
542
543         Reviewed by Timothy Hatcher.
544
545         This test is failing because it expects Release Actions to not emit any
546         events if nothing has changed from the initial state. Because the two code paths
547         for creating empty states don't actually produce the same empty state, a difference
548         in location was detected between the two empty states. This generates a mousemove.
549
550         To fix this, unify the code that creates an empty state. For mouse input sources, always
551         initialize the location to (0, 0) so that the mouse input source always has
552         a location that is valid to click at.
553
554         * UIProcess/Automation/SimulatedInputDispatcher.h:
555         Extract the type enum out of the class to avoid circular definitions of
556         SimulatedInputSource and SimulatedInputSourceState.
557
558         * UIProcess/Automation/SimulatedInputDispatcher.cpp:
559         (WebKit::SimulatedInputSourceState::emptyStateForSourceType):
560         Take the input source type when generating an empty state. We always want location
561         set for a mouse input source, but not set it for other input sources like keys.
562
563         (WebKit::SimulatedInputKeyFrame::keyFrameToResetInputSources):
564         (WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
565         (WebKit::SimulatedInputSource::create):
566         (WebKit::SimulatedInputSource::SimulatedInputSource):
567         (WebKit::SimulatedInputSourceState::emptyState): Deleted.
568         * UIProcess/Automation/WebAutomationSession.cpp:
569         (WebKit::WebAutomationSession::WebAutomationSession):
570         (WebKit::WebAutomationSession::inputSourceForType const):
571         (WebKit::simulatedInputSourceTypeFromProtocolSourceType):
572         (WebKit::WebAutomationSession::performInteractionSequence):
573         * UIProcess/Automation/WebAutomationSession.h:
574
575 2018-05-14  Michael Catanzaro  <mcatanzaro@igalia.com>
576
577         -Wmemset-elt-size warning in LibWebRTCSocket constructor
578         https://bugs.webkit.org/show_bug.cgi?id=185555
579
580         Reviewed by Youenn Fablet.
581
582         Add missing multiplication.
583
584         * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
585         (WebKit::LibWebRTCSocket::LibWebRTCSocket):
586
587 2018-05-14  Zan Dobersek  <zdobersek@igalia.com>
588
589         [GTK] REGRESSION(r231170) Build broken with Clang 5.0
590         https://bugs.webkit.org/show_bug.cgi?id=185198
591
592         Reviewed by Michael Catanzaro.
593
594         * Shared/RTCNetwork.h: With std::optional forward declaration gone,
595         explicitly include the WTF Optional.h header.
596
597 2018-05-13  Dean Jackson  <dino@apple.com>
598
599         WebKit2_Sim-7606.1.17.4 introduced dep cycle
600         https://bugs.webkit.org/show_bug.cgi?id=185588
601         <rdar://problem/40196581>
602
603         Reviewed by Tim Horton.
604
605         Soft link AssetViewer.framework to avoid a dependency cycle.
606
607         * Configurations/WebKit.xcconfig:
608         * UIProcess/ios/WKSystemPreviewView.mm:
609         (-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]):
610
611 2018-05-11  Daniel Bates  <dabates@apple.com>
612
613         X-Frame-Options: SAMEORIGIN needs to check all ancestor frames
614         https://bugs.webkit.org/show_bug.cgi?id=185567
615         <rdar://problem/40175008>
616
617         Reviewed by Brent Fulgham.
618
619         Change the behavior of "X-Frame-Options: SAMEORIGIN" to ensure that all ancestors frames
620         are same-origin with the document that delivered this header. This prevents an intermediary
621         malicious frame from clickjacking a child frame whose document is same-origin with the top-
622         level frame. It also makes the behavior of X-Frame-Options in WebKit more closely match
623         the behavior of X-Frame-Options in other browsers, including Chrome and Firefox.
624         
625         Currently a document delivered with "X-Frame-Options: SAMEORIGIN" must only be same-origin
626         with the top-level frame's document in order to be displayed. This prevents clickjacking by
627         a malicious page that embeds a page delivered with "X-Frame-Options: SAMEORIGIN". However,
628         it does not protect against clickjacking of the "X-Frame-Options: SAMEORIGIN" page (victim)
629         if embedded by an intermediate malicious iframe, say a "rogue ad", that was embedded in a
630         document same origin with the victim page. We should protect against such attacks.
631
632         * NetworkProcess/NetworkResourceLoader.cpp:
633         (WebKit::NetworkResourceLoader::shouldInterruptLoadForXFrameOptions):
634
635 2018-05-11  Dean Jackson  <dino@apple.com>
636
637         WKWebViewContentProvider should know what MIME type it was created to handle
638         https://bugs.webkit.org/show_bug.cgi?id=185574
639         <rdar://problem/40183049>
640
641         Reviewed by Tim Horton.
642
643         Pass the MIME type of the downloaded asset into the WKWebViewContentProvider's
644         init method, so it can choose to do something based on that information. The
645         PDF and LegacyPDF views don't care because they, clearly, only handle PDF. But
646         a WKSystemPreviewView can handle multiple types.
647
648         * UIProcess/API/Cocoa/WKWebView.mm:
649         (-[WKWebView _setHasCustomContentView:loadedMIMEType:]): Send the MIME type on
650         to the WKWebViewContentProvider.
651         * UIProcess/Cocoa/WKWebViewContentProvider.h: Add a new parameter to web_initWithFrame.
652         * UIProcess/ios/WKLegacyPDFView.mm:
653         (-[WKLegacyPDFView web_initWithFrame:webView:mimeType:]):
654         (-[WKLegacyPDFView web_initWithFrame:webView:]): Deleted.
655         * UIProcess/ios/WKPDFView.mm:
656         (-[WKPDFView web_initWithFrame:webView:mimeType:]):
657         (-[WKPDFView web_initWithFrame:webView:]): Deleted.
658         * UIProcess/ios/WKSystemPreviewView.mm:
659         (-[WKSystemPreviewView web_initWithFrame:webView:mimeType:]):
660         (-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]): Actually use
661         the MIME type to tell QuickLook what it will be getting, rather than basing it on
662         the file extension.
663         (-[WKSystemPreviewView web_initWithFrame:webView:]): Deleted.
664
665 2018-05-11  Brent Fulgham  <bfulgham@apple.com>
666
667         Allow the WebContent process to read global ViewBridge preferences
668         https://bugs.webkit.org/show_bug.cgi?id=185569
669         <rdar://problem/40164339>
670
671         Reviewed by Eric Carlson.
672
673         Allow reads of the global /Library/Preferences/com.apple.ViewBridge.plist preference file.
674
675         * WebProcess/com.apple.WebProcess.sb.in:
676
677 2018-05-11  Megan Gardner  <megan_gardner@apple.com>
678
679         Cleanup canPerformActionForWebView in relation to the webSelectionAssistant being removed
680         https://bugs.webkit.org/show_bug.cgi?id=185536
681
682         Reviewed by Tim Horton.
683         
684         The _webSelectionAssistant is now always nil, therefor many of these checks are unnecessary.
685         Remove the check for a webSelection and clean up the logic surrounding those checks.
686
687         * UIProcess/ios/WKContentViewInteraction.mm:
688         (-[WKContentView canPerformActionForWebView:withSender:]):
689
690 2018-05-11  Brady Eidson  <beidson@apple.com>
691
692         Followup to: Make sure history navigations reuse the existing process when necessary.
693         https://bugs.webkit.org/show_bug.cgi?id=185532
694
695         Reviewed by Andy Estes.
696
697         * UIProcess/WebProcessPool.cpp:
698         (WebKit::WebProcessPool::processForNavigationInternal): When re-using the same process,
699           don't change the policy action.
700
701 2018-05-11  Charles Vazac  <cvazac@gmail.com>
702
703         Runtime feature flag for Server-Timing
704         https://bugs.webkit.org/show_bug.cgi?id=184758
705
706         Reviewed by Youenn Fablet.
707
708         * Shared/WebPreferences.yaml: Added ServerTimingEnabled.
709         * UIProcess/API/C/WKPreferences.cpp:
710         (WKPreferencesGetServerTimingEnabled):
711         * UIProcess/API/C/WKPreferencesRefPrivate.h: WK_EXPORT for WKPreferencesSetServerTimingEnabled.
712         * WebProcess/Storage/WebSWContextManagerConnection.cpp: Call setServerTimingEnabled.
713
714 2018-05-11  Antti Koivisto  <antti@apple.com>
715
716         Network process should not stat() all cache files on startup to find their sizes
717         https://bugs.webkit.org/show_bug.cgi?id=185542
718         <rdar://problem/40092953>
719
720         Reviewed by Chris Dumez.
721
722         This is done to compute how much disk space a cache is using. While the operation happens
723         in a background priority thread it is still quite a bit of work.
724
725         Large bodies are saved in separate blob files so record file sizes are capped. We can avoid work by
726         estimating their size instead of counting it exactly.
727
728         * NetworkProcess/cache/NetworkCacheStorage.cpp:
729         (WebKit::NetworkCache::estimateRecordsSize):
730         (WebKit::NetworkCache::Storage::synchronize):
731
732             Use size estimation if blob storage is in use.
733             Remove the code that would delete empty files. Normal cache shrinking handles this.
734
735         (WebKit::NetworkCache::Storage::shouldStoreBodyAsBlob):
736
737 2018-05-11  Brady Eidson  <beidson@apple.com>
738
739         Make sure history navigations reuse the existing process when necessary.
740         <rdar://problem/39746516> and https://bugs.webkit.org/show_bug.cgi?id=185532
741
742         Reviewed by Ryosuke Niwa.
743
744         If a view navigates to either a data: or blob: URL, it reuses the existing process.
745  
746         In such cases we need to also ensure that history navigations back will also reuse the existing process.
747
748         * Shared/NavigationActionData.cpp:
749         (WebKit::NavigationActionData::encode const):
750         (WebKit::NavigationActionData::decode):
751         * Shared/NavigationActionData.h:
752
753         * UIProcess/API/APINavigation.h:
754         (API::Navigation::setTargetItem):
755
756         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
757         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
758         (-[_WKProcessPoolConfiguration pageCacheEnabled]):
759         (-[_WKProcessPoolConfiguration setPageCacheEnabled:]):
760
761         * UIProcess/WebPageProxy.cpp:
762         (WebKit::WebPageProxy::receivedPolicyDecision):
763         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
764
765         * UIProcess/WebProcessPool.cpp:
766         (WebKit::WebProcessPool::processForNavigationInternal): If the current and target back/forward items both
767           came from the same process, then reuse the existing process.
768
769         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
770         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
771
772 2018-05-10  Brent Fulgham  <bfulgham@apple.com>
773
774         REGRESSION(r231057): Encrypted media content playback failures
775         https://bugs.webkit.org/show_bug.cgi?id=185537
776         <rdar://problem/40038478>
777
778         Reviewed by Eric Carlson.
779
780         Put access to the SecurityServer back in the sandbox so we can validate the
781         signatures of media encoder/decoders.
782
783         * WebProcess/com.apple.WebProcess.sb.in:
784
785 2018-05-11  Youenn Fablet  <youenn@apple.com>
786
787         NetworkCORSPreflightChecker should proceed when having a ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested challenge
788         https://bugs.webkit.org/show_bug.cgi?id=185522
789         <rdar://problem/39987152>
790
791         Reviewed by Brent Fulgham.
792
793         In case of such challenge, refuse to proceed with authentication since preflight is not using credentials.
794         Previously, we were failing right away which is not right in case preflight is the request triggering the connection.
795
796         Manually tested.
797
798         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
799         (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
800
801 2018-05-10  Daniel Bates  <dabates@apple.com>
802
803         Use PlatformStrategies to switch between WebKit and WebKitLegacy checking of CSP frame-ancestors and X-Frame-Options
804         https://bugs.webkit.org/show_bug.cgi?id=185412
805
806         Reviewed by Ryosuke Niwa.
807
808         Update code for renaming and write in terms of WebLoaderStrategy::shouldPerformSecurityChecks()
809         instead of explicitly querying RuntimeEnabledFeatures::sharedFeatures().restrictedHTTPResponseAccess().
810
811         * WebProcess/Network/WebLoaderStrategy.cpp:
812         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
813         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
814         (WebKit::WebLoaderStrategy::startPingLoad):
815         (WebKit::WebLoaderStrategy::preconnectTo):
816         (WebKit::WebLoaderStrategy::shouldPerformSecurityChecks const):
817         (WebKit::WebLoaderStrategy::havePerformedSecurityChecks const):
818         (WebKit::WebLoaderStrategy::isDoingLoadingSecurityChecks const): Deleted.
819         * WebProcess/Network/WebLoaderStrategy.h:
820         * WebProcess/WebPage/WebPage.cpp:
821
822 2018-05-10  Timothy Horton  <timothy_horton@apple.com>
823
824         Fix the build after r231393
825         ​https://bugs.webkit.org/show_bug.cgi?id=185519
826         <rdar://problem/40131741>
827
828         * Configurations/WebKit.xcconfig:
829
830 2018-05-10  John Wilander  <wilander@apple.com>
831
832         Storage Access API: Extend lifetime of cookies on successful user approval
833         https://bugs.webkit.org/show_bug.cgi?id=185534
834         <rdar://problem/40064547>
835
836         Reviewed by Brent Fulgham.
837
838         * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
839         (WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):
840             Picks up the experimental feature flag.
841         * UIProcess/WebResourceLoadStatisticsStore.cpp:
842         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccessInternal):
843             Now updates the domain's user interaction timestamp if the user was
844             prompted for this access.
845         * UIProcess/WebResourceLoadStatisticsStore.h:
846
847 2018-05-10  Chris Dumez  <cdumez@apple.com>
848
849         [iOS] Release page load process assertion if the screen is locked
850         https://bugs.webkit.org/show_bug.cgi?id=185333
851
852         Reviewed by Geoff Garen.
853
854         We normally take a background process assertion during page loads to allow them to complete
855         even if the tab / app is backgrounded. We should however avoid doing so when the backgrounding
856         is caused by the screen locking. Keeping the process assertion in this case would prevent the
857         whole device from sleeping longer than it should, thus negatively impacting power.
858
859         * UIProcess/Cocoa/NavigationState.h:
860         * UIProcess/Cocoa/NavigationState.mm:
861         (WebKit::NavigationState::NavigationState):
862         (WebKit::NavigationState::releaseNetworkActivityToken):
863         (WebKit::NavigationState::didChangeIsLoading):
864         * UIProcess/ios/WebPageProxyIOS.mm:
865         (WebKit::WebPageProxy::applicationDidEnterBackground):
866
867 2018-05-10  Megan Gardner  <megan_gardner@apple.com>
868
869         Remove Unused Chinese/Japanese Reanalyze code
870         https://bugs.webkit.org/show_bug.cgi?id=185529
871
872         Reviewed by Wenson Hsieh.
873         
874         The code for this has actually been completely removed from UIKit. This is unreachable 
875         dead code that should be removed if just for cleanliness. 
876
877         * Platform/spi/ios/UIKitSPI.h:
878         * UIProcess/API/Cocoa/WKWebViewInternal.h:
879         * UIProcess/ios/WKContentViewInteraction.h:
880         * UIProcess/ios/WKContentViewInteraction.mm:
881         (-[WKContentView canPerformActionForWebView:withSender:]):
882         (-[WKContentView _reanalyzeForWebView:]): Deleted.
883
884 2018-05-10  Chris Dumez  <cdumez@apple.com>
885
886         [iOS] Apps that are not visible may not get suspended if they trigger page loads while in the background
887         https://bugs.webkit.org/show_bug.cgi?id=185318
888
889         Reviewed by Geoffrey Garen.
890
891         Whenever there is a page load going on, we take a background process assertion to delay process
892         suspension until this load completes. However, there is also a 3 seconds grace period after
893         a load is complete to allow the app to trigger a new load shortly after. This grace period was
894         introduced to support use cases where a visible app does loads in an offscreen view. However,
895         it can be abused by apps running in the background as they could trigger new page loads while
896         in the background to delay process suspension. This patch tightens the policy so that only
897         apps that are currently visible get to use this grace period. Apps that are in the background
898         get to finish their current load and will then get suspended.
899
900         * UIProcess/Cocoa/NavigationState.mm:
901         (WebKit::NavigationState::didChangeIsLoading):
902
903 2018-05-10  Chris Dumez  <cdumez@apple.com>
904
905         'Cross-Origin-Options header implementation follow-up
906         https://bugs.webkit.org/show_bug.cgi?id=185520
907
908         Reviewed by Ryosuke Niwa.
909
910         * WebProcess/WebPage/WebPage.cpp:
911         (WebKit::WebPage::frameBecameRemote):
912
913 2018-05-10  Per Arne Vollan  <pvollan@apple.com>
914
915         Drop-down Control borders missing.
916         https://bugs.webkit.org/show_bug.cgi?id=185500
917         <rdar://problem/40093461>
918
919         Reviewed by Brent Fulgham.
920
921         Open sandbox for reading of some files in temp folder.
922
923         * WebProcess/com.apple.WebProcess.sb.in:
924
925 2018-05-10  Eric Carlson  <eric.carlson@apple.com>
926
927         [MediaStream, iOS] Don't check authorizationStatusForMediaType when using mock capture devices
928         https://bugs.webkit.org/show_bug.cgi?id=185516
929         <rdar://problem/36328191>
930
931         Reviewed by Youenn Fablet.
932
933         * UIProcess/Cocoa/UIDelegate.mm:
934         (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest): Don't check
935         +[AVCaptureDevice authorizationStatusForMediaType:] when using mock capture devices.
936
937 2018-05-10  Brent Fulgham  <bfulgham@apple.com>
938
939         REGRESSION(r230323): UIProcess needs to notify WebContent process of Accessibility setting changes
940         https://bugs.webkit.org/show_bug.cgi?id=185515
941         <rdar://problem/39627764>
942
943         Reviewed by Chris Fleizach.
944
945         The UIProcess needs to register for relevant Accessibility preference updates so that it can notify the
946         WebContent processes that screen properties have changed.
947
948         This is represented by NSWorkspaceAccessibilityDisplayOptionsDidChangeNotification.
949
950         Tested manually with the Accessibility preferences pane.
951
952         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
953         (WebKit::WebProcessPool::registerNotificationObservers): Add notification observer. When the notification
954         is received, call 'screenPropertiesStateChanged' to message the information to the WebContent processes.
955         (WebKit::WebProcessPool::unregisterNotificationObservers): Clean up observer.
956         * UIProcess/WebProcessPool.cpp:
957         (WebKit::WebProcessPool::screenPropertiesStateChanged): Added helper function.
958         * UIProcess/WebProcessPool.h:
959
960 2018-05-09  Carlos Garcia Campos  <cgarcia@igalia.com>
961
962         WebDriver: implement advance user interactions
963         https://bugs.webkit.org/show_bug.cgi?id=174616
964
965         Reviewed by Brian Burg.
966
967         Handle origin in case of mouse move transitions.
968
969         * UIProcess/Automation/Automation.json: Add MouseMoveOrigin enum and pass it as parameter of InputSourceState
970         together with optional node handle. Also pass the frame handle to performInteractionSequence command to find the
971         node in the current browsing context.
972         * UIProcess/Automation/SimulatedInputDispatcher.cpp:
973         (WebKit::SimulatedInputKeyFrame::keyFrameToResetInputSources): Ensure we reset the location.
974         (WebKit::SimulatedInputDispatcher::resolveLocation): Helper to resolve destination location based on current
975         location and mouse move origin.
976         (WebKit::SimulatedInputDispatcher::transitionInputSourceToState): Use resolveLocation() in mouse transitions.
977         (WebKit::SimulatedInputDispatcher::run): Receive and save the frame ID.
978         (WebKit::SimulatedInputDispatcher::finishDispatching): Reset the frame ID.
979         * UIProcess/Automation/SimulatedInputDispatcher.h:
980         * UIProcess/Automation/WebAutomationSession.cpp:
981         (WebKit::WebAutomationSession::computeElementLayout): Use even numbers for the callback ID to not conflict with
982         viewportInViewCenterPointOfElement() callbacks.
983         (WebKit::WebAutomationSession::didComputeElementLayout): Handle computeElementLayout() or
984         viewportInViewCenterPointOfElement() requests by calling the right callback depending on whether the ID is odd
985         or even number.
986         (WebKit::WebAutomationSession::viewportInViewCenterPointOfElement): Send ComputeElementLayout message to the
987         WebProcess using odd numbers for the callback ID to not conflict with computeElementLayout() callbacks.
988         (WebKit::WebAutomationSession::performInteractionSequence): Handle the mouse origin and element handle.
989         (WebKit::WebAutomationSession::cancelInteractionSequence): Pass the frame ID to the input dispatcher.
990         * UIProcess/Automation/WebAutomationSession.h:
991         * UIProcess/Automation/WebAutomationSessionMacros.h:
992
993 2018-05-09  Tim Horton  <timothy_horton@apple.com>
994
995         Remove the unused HAVE_OS_ACTIVITY
996         https://bugs.webkit.org/show_bug.cgi?id=185501
997
998         Reviewed by Wenson Hsieh.
999
1000         * config.h:
1001
1002 2018-05-09  Chris Dumez  <cdumez@apple.com>
1003
1004         Add initial support for 'Cross-Origin-Options' HTTP response header
1005         https://bugs.webkit.org/show_bug.cgi?id=184996
1006         <rdar://problem/39664620>
1007
1008         Reviewed by Geoff Garen.
1009
1010         * Shared/WebPreferences.yaml:
1011         Add this as an experimental feature, on by default.
1012
1013         * WebProcess/WebPage/WebPage.cpp:
1014         (WebKit::WebPage::frameBecameRemote):
1015         Make sure we pass the cross-origin options from the local Window
1016         to the remote one when transitioning.
1017
1018 2018-05-09  Wenson Hsieh  <wenson_hsieh@apple.com>
1019
1020         [Extra zoom mode] fast/viewport/extrazoom/viewport-change-min-device-width.html sometimes fails
1021         https://bugs.webkit.org/show_bug.cgi?id=185490
1022         <rdar://problem/40097629>
1023
1024         Reviewed by Tim Horton.
1025
1026         This test is currently flaky due to incorrect logic when computing the unobscured content rect, in the slice of
1027         time after a frame load has been committed, and before the first visible content rect update from the UI process
1028         after the frame load has been committed.
1029
1030         * WebProcess/WebPage/ios/WebPageIOS.mm:
1031         (WebKit::WebPage::viewportConfigurationChanged):
1032
1033         In the case where !m_hasReceivedVisibleContentRectsAfterDidCommitLoad, we try to set the unobscured content size
1034         to be the view size divided by the initial scale. However, in extra zoom mode, `ViewportConfiguration`'s
1035         `minimumLayoutSize()` is the layout size, which is larger than the size of the view by default, so dividing this
1036         by the initial scale yields a bogus value. Instead, use `viewLayoutSize()` instead.
1037
1038         (WebKit::WebPage::updateViewportSizeForCSSViewportUnits):
1039
1040         We also try to divide the view size by the initial scale when computing the effective viewport size for `vw` and
1041         `vh`. Additionally, fix the misleading name of a variable (largestUnobscuredRect) that stores a size.
1042
1043 2018-05-09  Brent Fulgham  <bfulgham@apple.com>
1044
1045         Restrict unarchiving of bundle parameters to a set of known classes
1046         https://bugs.webkit.org/show_bug.cgi?id=185489
1047         <rdar://problem/21912401>
1048
1049         Reviewed by Ryosuke Niwa.
1050
1051         Stop accepting anything derived from NSObject, and instead only agree to unarchive objects
1052         from a set of things we actually pass as InjectedBundle parameters.
1053
1054         * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
1055         (WebKit::InjectedBundle::setBundleParameter):
1056
1057 2018-05-09  Richard Houle  <rhoule@apple.com>
1058
1059         [Cocoa] Some fields are not identified as [WKWebProcessPlugInNodeHandle isTextField]
1060         https://bugs.webkit.org/show_bug.cgi?id=185260
1061         <rdar://problem/39290394>
1062
1063         INPUT element are not considered to be text fields when
1064         calling -[WKWebProcessPlugInNodeHandle isTextField]
1065         when they are of type number.
1066
1067         Reviewed by Tim Horton.
1068
1069         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
1070         (WebKit::InjectedBundleNodeHandle::isTextField const):
1071
1072 2018-05-09  Youenn Fablet  <youenn@apple.com>
1073
1074         Allow WebResourceLoader to cancel a load served from a service worker
1075         https://bugs.webkit.org/show_bug.cgi?id=185274
1076
1077         Reviewed by Chris Dumez.
1078
1079         Use FetchIdentifier instead of uint64_t.
1080         Add IPC support for cancelling a fetch from WebProcess to service worker process.
1081         Ask service worker process to cancel the fetch when its corresponding WebResourceLoader is cancelled.
1082         No change of behavior as once a WebResourceLoader is cancelled, any related IPC is not processed.
1083         A follow-up patch should try to cancel the FetchResponse load, meaning to either cancel the network load
1084         or to abort reading the readable stream.
1085
1086         * Scripts/webkit/messages.py:
1087         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1088         (WebKit::WebSWServerConnection::cancelFetch):
1089         (WebKit::WebSWServerConnection::startFetch):
1090         (WebKit::WebSWServerConnection::didReceiveFetchResponse):
1091         (WebKit::WebSWServerConnection::didReceiveFetchData):
1092         (WebKit::WebSWServerConnection::didReceiveFetchFormData):
1093         (WebKit::WebSWServerConnection::didFinishFetch):
1094         (WebKit::WebSWServerConnection::didFailFetch):
1095         (WebKit::WebSWServerConnection::didNotHandleFetch):
1096         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1097         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
1098         * StorageProcess/StorageProcess.cpp:
1099         (WebKit::StorageProcess::didFailFetch):
1100         (WebKit::StorageProcess::didNotHandleFetch):
1101         (WebKit::StorageProcess::didReceiveFetchResponse):
1102         (WebKit::StorageProcess::didReceiveFetchData):
1103         (WebKit::StorageProcess::didReceiveFetchFormData):
1104         (WebKit::StorageProcess::didFinishFetch):
1105         * StorageProcess/StorageProcess.h:
1106         * StorageProcess/StorageProcess.messages.in:
1107         * WebProcess/Network/WebLoaderStrategy.cpp:
1108         (WebKit::WebLoaderStrategy::remove):
1109         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
1110         (WebKit::ServiceWorkerClientFetch::create):
1111         (WebKit::ServiceWorkerClientFetch::ServiceWorkerClientFetch):
1112         (WebKit::ServiceWorkerClientFetch::start):
1113         (WebKit::ServiceWorkerClientFetch::cancel):
1114         * WebProcess/Storage/ServiceWorkerClientFetch.h:
1115         * WebProcess/Storage/WebSWClientConnection.cpp:
1116         (WebKit::WebSWClientConnection::startFetch):
1117         (WebKit::WebSWClientConnection::cancelFetch):
1118         * WebProcess/Storage/WebSWClientConnection.h:
1119         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1120         (WebKit::WebSWContextManagerConnection::cancelFetch):
1121         (WebKit::WebSWContextManagerConnection::startFetch):
1122         * WebProcess/Storage/WebSWContextManagerConnection.h:
1123         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
1124         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
1125         (WebKit::WebServiceWorkerFetchTaskClient::WebServiceWorkerFetchTaskClient):
1126         (WebKit::WebServiceWorkerFetchTaskClient::cancel):
1127         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:
1128         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
1129         (WebKit::WebServiceWorkerProvider::handleFetch):
1130         (WebKit::WebServiceWorkerProvider::cancelFetch):
1131         (WebKit::WebServiceWorkerProvider::fetchFinished):
1132         * WebProcess/Storage/WebServiceWorkerProvider.h:
1133
1134 2018-05-09  Andy Estes  <aestes@apple.com>
1135
1136         [iOS] Consider the annotation bounds when positioning action sheets near long-pressed PDF links
1137         https://bugs.webkit.org/show_bug.cgi?id=185472
1138         <rdar://problem/39967092>
1139
1140         Reviewed by Daniel Bates.
1141
1142         Adopted new PDFHostViewControllerDelegate methods that include annotation rects
1143         when URLs and page indices are long-pressed. This allows us to avoid obscuring
1144         annotations when positioning action sheet popovers.
1145
1146         We also no longer need to convert the press location into host view coordinate
1147         space, as PDFKit now does that for us.
1148
1149         * UIProcess/ios/WKPDFView.mm:
1150         (-[WKPDFView _showActionSheetForURL:atLocation:withAnnotationRect:]):
1151         (-[WKPDFView pdfHostViewController:didLongPressURL:atLocation:withAnnotationRect:]):
1152         (-[WKPDFView pdfHostViewController:didLongPressPageIndex:atLocation:withAnnotationRect:]):
1153         (-[WKPDFView _showActionSheetForURL:atLocation:]): Deleted.
1154         (-[WKPDFView pdfHostViewController:didLongPressURL:atLocation:]): Deleted.
1155         (-[WKPDFView pdfHostViewController:didLongPressPageIndex:atLocation:]): Deleted.
1156
1157 2018-05-09  Andy Estes  <aestes@apple.com>
1158
1159         [iOS] Tell PDFHostViewController when animated resizes begin and end
1160         https://bugs.webkit.org/show_bug.cgi?id=185477
1161         <rdar://problem/39875372>
1162
1163         Reviewed by Anders Carlsson.
1164
1165         * UIProcess/API/Cocoa/WKWebView.mm:
1166         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
1167         (-[WKWebView _endAnimatedResize]):
1168         * UIProcess/Cocoa/WKWebViewContentProvider.h:
1169         * UIProcess/ios/WKPDFView.mm:
1170         (-[WKPDFView web_beginAnimatedResize]):
1171         (-[WKPDFView web_endAnimatedResize]):
1172
1173 2018-05-09  Michael Catanzaro  <mcatanzaro@igalia.com>
1174
1175         Unreviewed. Update OptionsWPE.cmake and NEWS for 2.21.1 release.
1176
1177         * wpe/NEWS: Added. Add release notes for 2.21.1.
1178
1179 2018-05-09  Michael Catanzaro  <mcatanzaro@igalia.com>
1180
1181         [WPE] Build cleanly with GCC 8 and ICU 60
1182         https://bugs.webkit.org/show_bug.cgi?id=185462
1183
1184         Reviewed by Carlos Alberto Lopez Perez.
1185
1186         * Platform/IPC/glib/GSocketMonitor.cpp:
1187         (IPC::GSocketMonitor::start): Silence -Wcast-function-type warning.
1188         * Shared/API/glib/WebKitContextMenu.cpp:
1189         (webkit_context_menu_new_with_items): Ditto.
1190
1191 2018-05-08  Sihui Liu  <sihui_liu@apple.com>
1192
1193         Adopt new async _savecookies SPI for keeping networking process active during flushing cookies
1194         https://bugs.webkit.org/show_bug.cgi?id=185261
1195         <rdar://problem/37214391>
1196
1197         Reviewed by Chris Dumez.
1198
1199         By adopting new async SPI _savecookies, we can keep networking process active(not suspended)
1200         until cookies are fully synced to disk with process assertion.
1201
1202         * NetworkProcess/NetworkProcess.cpp:
1203         (WebKit::NetworkProcess::didSyncAllCookies):
1204         * NetworkProcess/NetworkProcess.h:
1205         * NetworkProcess/NetworkProcess.messages.in:
1206         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1207         (WebKit::NetworkProcess::syncAllCookies):
1208         * UIProcess/Network/NetworkProcessProxy.cpp:
1209         (WebKit::NetworkProcessProxy::didClose):
1210         (WebKit::NetworkProcessProxy::syncAllCookies):
1211         (WebKit::NetworkProcessProxy::didSyncAllCookies):
1212         * UIProcess/Network/NetworkProcessProxy.h:
1213         * UIProcess/Network/NetworkProcessProxy.messages.in:
1214         * UIProcess/WebProcessPool.cpp:
1215         (WebKit::WebProcessPool::syncNetworkProcessCookies):
1216
1217 2018-05-08  Per Arne Vollan  <pvollan@apple.com>
1218
1219         Set colorspace in the PDF plugin.
1220         https://bugs.webkit.org/show_bug.cgi?id=185445
1221         <rdar://problem/40030981>
1222
1223         Reviewed by Simon Fraser.
1224
1225         * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h:
1226         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1227         (WebKit::PDFPlugin::PDFPlugin):
1228
1229 2018-05-08  Megan Gardner  <megan_gardner@apple.com>
1230
1231         Don't clear selection until we are actually interacting with a Node.
1232         https://bugs.webkit.org/show_bug.cgi?id=185455
1233
1234         Reviewed by Wenson Hsieh.
1235         
1236         The presence of TextInteractionAssistant should not be used as a proxy for it we are actually editing content.
1237         We need to check to see if we have an active node, and then we should clear the selection.
1238
1239         * UIProcess/ios/WKContentViewInteraction.mm:
1240         (-[WKContentView setSelectedTextRange:]):
1241
1242 2018-05-08  Ryan Haddad  <ryanhaddad@apple.com>
1243
1244         Unreviewed, rolling out r231486.
1245
1246         Caused service worker LayoutTest failures on macOS Debug WK2.
1247
1248         Reverted changeset:
1249
1250         "Allow WebResourceLoader to cancel a load served from a
1251         service worker"
1252         https://bugs.webkit.org/show_bug.cgi?id=185274
1253         https://trac.webkit.org/changeset/231486
1254
1255 2018-05-08  Andy Estes  <aestes@apple.com>
1256
1257         [iOS] _WKWebViewPrintFormatter should return a page count of 0 for PDF documents that do not allow printing
1258         https://bugs.webkit.org/show_bug.cgi?id=185133
1259
1260         Reviewed by Andreas Kling.
1261
1262         * UIProcess/ios/WKPDFView.mm:
1263         (-[WKPDFView _ensureDocumentForPrinting]):
1264         (-[WKPDFView _wk_pageCountForPrintFormatter:]):
1265         (-[WKPDFView _wk_printedDocument]):
1266
1267 2018-05-08  Andy Estes  <aestes@apple.com>
1268
1269         [iOS] WKPDFView remains in the view hierarchy after navigating away
1270         https://bugs.webkit.org/show_bug.cgi?id=185449
1271         <rdar://problem/39693469>
1272
1273         Reviewed by Tim Horton.
1274
1275         WKPDFView removes the PDF host view from the view hierarchy in its -dealloc
1276         method, and relies on WKWebView releasing its last reference in
1277         -_setHasCustomContentView:loadedMIMEType: when the user navigates.
1278
1279         However, WKWPDFView was capturing a strong reference to self in the block passed
1280         to +[PDFHostViewController createHostView:forExtensionIdentifier:], and PDFKit
1281         (actually UIKit) is retaining this block beyond its being called. This results in
1282         the PDF host view remaining as a child of the WKScrollView even after the user
1283         navigates to another page.
1284
1285         Changed the aforementioned block to a lambda that captures a weak reference to
1286         self to prevent WKPDFView from outliving the current navigation.
1287
1288         * UIProcess/ios/WKPDFView.mm:
1289         (-[WKPDFView retain]):
1290         (-[WKPDFView web_setContentProviderData:suggestedFilename:]):
1291
1292 2018-05-08  John Wilander  <wilander@apple.com>
1293
1294         Storage Access API: Make user opt-in sticky
1295         https://bugs.webkit.org/show_bug.cgi?id=185454
1296         <rdar://problem/40003946>
1297
1298         Reviewed by Alex Christensen.
1299
1300         This patch persists the user's choice to opt-in to access under specific domains.
1301         Such storage access should age out with the accessing domain's cookies and website
1302         data. The opt-in prompt is still an experimental feature.
1303
1304         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1305         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
1306         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
1307         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
1308         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
1309         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccessInternal):
1310         (WebKit::WebResourceLoadStatisticsStore::hasUserGrantedStorageAccessThroughPrompt const):
1311         (WebKit::WebResourceLoadStatisticsStore::hasHadUnexpiredRecentUserInteraction const):
1312         * UIProcess/WebResourceLoadStatisticsStore.h:
1313
1314 2018-05-08  Daniel Bates  <dabates@apple.com>
1315
1316         Do not apply X-Frame-Options and CSP frame-ancestors to Quick Look-applicable responses in NetworkProcess
1317         https://bugs.webkit.org/show_bug.cgi?id=185442
1318         <rdar://problem/40067209>
1319
1320         Reviewed by Andy Estes.
1321
1322         Just as we exempt responses in WebContent process that will be handled by Quick Look from the Content
1323         Security Policy frame-ancestors directive and X-Frame-Options checking we need to do the same when
1324         such checks are performed in NetworkProcess following r231479.
1325
1326         HTTP responses that will be previewed using Quick Look are not considered web pages and are subject
1327         to the security model for Quick Look documents. That is, they are exempt from Content Security Policy
1328         and X-Frame-Options processing.
1329
1330         * NetworkProcess/NetworkResourceLoader.cpp:
1331         (WebKit::NetworkResourceLoader::shouldInterruptLoadForCSPFrameAncestorsOrXFrameOptions):
1332
1333 2018-05-08  Brian Burg  <bburg@apple.com>
1334
1335         REGRESSION(r230743): Mousemove events are not coalesced properly, mousemove/drag is very laggy
1336         https://bugs.webkit.org/show_bug.cgi?id=185425
1337         <rdar://problem/39323336>
1338
1339         Reviewed by Simon Fraser.
1340
1341         When mousemove events come in faster than they can be processed, we should coalesce
1342         pending mousemoves that have not yet been sent to WebProcess. This has the effect of
1343         processing the most recent mousemove location, which is the old behavior that regressed.
1344
1345         * UIProcess/WebPageProxy.cpp:
1346         (WebKit::WebPageProxy::handleMouseEvent):
1347         If there is >1 event in the mouse queue, then the first one is being processed by WebProcess
1348         and the second one is eligible for coalescing. Replace it if the last event and new event
1349         are both mousemoves.
1350
1351 2018-05-08  Per Arne Vollan  <pvollan@apple.com>
1352
1353         The PDF context menu should not be created in the WebContent process.
1354         https://bugs.webkit.org/show_bug.cgi?id=185401
1355
1356         Reviewed by Tim Horton.
1357
1358         Send a sync IPC message from the WebContent process to the UI process with the necessary context
1359         menu information when the menu is requested. The NSMenu will then be created and shown in the
1360         UI process. The reply will contain the selected menu item index.
1361
1362         * Shared/mac/PDFContextMenu.h: Added.
1363         (WebKit::PDFContextMenuItem::encode const):
1364         (WebKit::PDFContextMenuItem::decode):
1365         (WebKit::PDFContextMenu::encode const):
1366         (WebKit::PDFContextMenu::decode):
1367         * UIProcess/WebPageProxy.h:
1368         * UIProcess/WebPageProxy.messages.in:
1369         * UIProcess/mac/WebPageProxyMac.mm:
1370         (-[WKPDFMenuTarget menuItem]):
1371         (-[WKPDFMenuTarget contextMenuAction:]):
1372         (WebKit::WebPageProxy::showPDFContextMenu):
1373         * WebKit.xcodeproj/project.pbxproj:
1374         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1375         (WebKit::PDFPlugin::handleContextMenuEvent):
1376
1377 2018-05-08  Dean Jackson  <dino@apple.com>
1378
1379         System Preview links should trigger a download
1380         https://bugs.webkit.org/show_bug.cgi?id=185439
1381         <rdar://problem/40065545>
1382
1383         Reviewed by Jon Lee.
1384
1385         Encode the new field identifying a system preview. And
1386         if you encounter such a resource request, trigger
1387         a download.
1388
1389         * Shared/WebCoreArgumentCoders.cpp:
1390         (IPC::ArgumentCoder<ResourceRequest>::encode):
1391         (IPC::ArgumentCoder<ResourceRequest>::decode):
1392         * UIProcess/WebPageProxy.cpp:
1393         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1394
1395 2018-05-08  John Wilander  <wilander@apple.com>
1396
1397         Storage Access API: Add a request roundtrip to check whether prompting is needed
1398         https://bugs.webkit.org/show_bug.cgi?id=185368
1399         <rdar://problem/40011556>
1400
1401         Reviewed by Alex Christensen and Youenn Fablet.
1402
1403         This patch adds an enum WebKit::StorageAccessStatus to handle our three access
1404         states:
1405         - WebKit::StorageAccessStatus::CannotRequestAccess.
1406             This means the domain is blocked from cookie access.
1407         - WebKit::StorageAccessStatus::RequiresUserPrompt.
1408             This means that access has not been granted yet and a prompt is required.
1409         - WebKit::StorageAccessStatus::HasAccess.
1410             This either means that this domain does not need to ask for access,
1411             access was already granted, or access was granted now.
1412
1413         If the call to WebResourceLoadStatisticsStore::requestStorageAccess() comes
1414         back as WebKit::StorageAccessStatus::RequiresUserPrompt, the WebPageProxy
1415         prompts the user and if the user said yes, calls a direct
1416         WebResourceLoadStatisticsStore::grantStorageAccess().
1417
1418         Existing test cases pass because requestStorageAccessConfirm in WKPage.cpp
1419         does not have m_client.requestStorageAccessConfirm and thus returns true.
1420
1421         * UIProcess/Network/NetworkProcessProxy.messages.in:
1422             Added a missing #endif.
1423         * UIProcess/WebPageProxy.cpp:
1424         (WebKit::WebPageProxy::requestStorageAccess):
1425             Here we now handle the various cases encoded in WebKit::StorageAccessStatus.
1426         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1427         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
1428             Now covers the optional prompt case.
1429         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
1430         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
1431         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccessInternal):
1432             Granting access is broken out to allow WebKit::WebPageProxy to call it
1433             directly.
1434         * UIProcess/WebResourceLoadStatisticsStore.h:
1435         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1436         (WebKit::WebsiteDataStore::requestStorageAccess):
1437         (WebKit::WebsiteDataStore::grantStorageAccess):
1438             Piping through calls from from WebKit::WebResourceLoadStatisticsStore
1439             to WebKit::WebPageProxy.
1440         * UIProcess/WebsiteData/WebsiteDataStore.h:
1441
1442 2018-05-08  Chris Dumez  <cdumez@apple.com>
1443
1444         Unreviewed, rolling out r231376 and r231458.
1445
1446         Caused some API tests failures on iOS
1447
1448         Reverted changesets:
1449
1450         "[iOS] Apps that are not visible may not get suspended if they
1451         trigger page loads while in the background"
1452         https://bugs.webkit.org/show_bug.cgi?id=185318
1453         https://trac.webkit.org/changeset/231376
1454
1455         "[iOS] Release page load process assertion if the screen is
1456         locked"
1457         https://bugs.webkit.org/show_bug.cgi?id=185333
1458         https://trac.webkit.org/changeset/231458
1459
1460 2018-05-08  Dean Jackson  <dino@apple.com>
1461
1462         Use thumbnails in System Previews
1463         https://bugs.webkit.org/show_bug.cgi?id=185397
1464         <rdar://problem/40039376>
1465
1466         Reviewed by Jon Lee.
1467
1468         A system preview that goes through the WKWebViewContentProvider will
1469         show a static thumbnail/snapshot of the item, rather than jumping
1470         directly to QuickLook.
1471
1472         This means we have to link to the AssetViewer framework. That provides
1473         a ASVThumbnailView that will trigger QuickLook for us.
1474
1475         * Configurations/WebKit.xcconfig: Link to AssetViewer.
1476
1477         * UIProcess/ios/WKSystemPreviewView.h: Better macro use. Remove some unneeded protocols.
1478         * UIProcess/ios/WKSystemPreviewView.mm:
1479         (-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]): Update this
1480         to use an ASVThumbnailView, when on the internal SDK (because it is private).
1481         (-[WKSystemPreviewView _layoutThumbnailView]): Use the content insets to put
1482         the thumbnail in the right place.
1483         (-[WKSystemPreviewView thumbnailView:wantsToPresentPreviewController:forItem:]):
1484         Delegate method.
1485         (-[WKSystemPreviewView web_contentView]):
1486         (-[WKSystemPreviewView web_computedContentInsetDidChange]):
1487         (-[WKSystemPreviewView numberOfPreviewItemsInPreviewController:]): Deleted.
1488         (-[WKSystemPreviewView previewController:previewItemAtIndex:]): Deleted.
1489         (-[WKSystemPreviewView previewControllerWillDismiss:]): Deleted.
1490
1491 2018-05-08  Youenn Fablet  <youenn@apple.com>
1492
1493         Allow WebResourceLoader to cancel a load served from a service worker
1494         https://bugs.webkit.org/show_bug.cgi?id=185274
1495
1496         Reviewed by Chris Dumez.
1497
1498         Use FetchIdentifier instead of uint64_t.
1499         Add IPC support for cancelling a fetch from WebProcess to service worker process.
1500         Ask service worker process to cancel the fetch when its corresponding WebResourceLoader is cancelled.
1501         No change of behavior as once a WebResourceLoader is cancelled, any related IPC is not processed.
1502         A follow-up patch should try to cancel the FetchResponse load, meaning to either cancel the network load
1503         or to abort reading the readable stream.
1504
1505         * Scripts/webkit/messages.py:
1506         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1507         (WebKit::WebSWServerConnection::cancelFetch):
1508         (WebKit::WebSWServerConnection::startFetch):
1509         (WebKit::WebSWServerConnection::didReceiveFetchResponse):
1510         (WebKit::WebSWServerConnection::didReceiveFetchData):
1511         (WebKit::WebSWServerConnection::didReceiveFetchFormData):
1512         (WebKit::WebSWServerConnection::didFinishFetch):
1513         (WebKit::WebSWServerConnection::didFailFetch):
1514         (WebKit::WebSWServerConnection::didNotHandleFetch):
1515         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1516         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
1517         * StorageProcess/StorageProcess.cpp:
1518         (WebKit::StorageProcess::didFailFetch):
1519         (WebKit::StorageProcess::didNotHandleFetch):
1520         (WebKit::StorageProcess::didReceiveFetchResponse):
1521         (WebKit::StorageProcess::didReceiveFetchData):
1522         (WebKit::StorageProcess::didReceiveFetchFormData):
1523         (WebKit::StorageProcess::didFinishFetch):
1524         * StorageProcess/StorageProcess.h:
1525         * StorageProcess/StorageProcess.messages.in:
1526         * WebProcess/Network/WebLoaderStrategy.cpp:
1527         (WebKit::WebLoaderStrategy::remove):
1528         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
1529         (WebKit::ServiceWorkerClientFetch::create):
1530         (WebKit::ServiceWorkerClientFetch::ServiceWorkerClientFetch):
1531         (WebKit::ServiceWorkerClientFetch::start):
1532         (WebKit::ServiceWorkerClientFetch::cancel):
1533         * WebProcess/Storage/ServiceWorkerClientFetch.h:
1534         * WebProcess/Storage/WebSWClientConnection.cpp:
1535         (WebKit::WebSWClientConnection::startFetch):
1536         (WebKit::WebSWClientConnection::cancelFetch):
1537         * WebProcess/Storage/WebSWClientConnection.h:
1538         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1539         (WebKit::WebSWContextManagerConnection::cancelFetch):
1540         (WebKit::WebSWContextManagerConnection::startFetch):
1541         * WebProcess/Storage/WebSWContextManagerConnection.h:
1542         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
1543         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
1544         (WebKit::WebServiceWorkerFetchTaskClient::WebServiceWorkerFetchTaskClient):
1545         (WebKit::WebServiceWorkerFetchTaskClient::cancel):
1546         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:
1547         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
1548         (WebKit::WebServiceWorkerProvider::handleFetch):
1549         (WebKit::WebServiceWorkerProvider::cancelFetch):
1550         (WebKit::WebServiceWorkerProvider::fetchFinished):
1551         * WebProcess/Storage/WebServiceWorkerProvider.h:
1552
1553 2018-05-08  Antti Koivisto  <antti@apple.com>
1554
1555         Don't use mapped cache files in case of Class A/B protected app
1556         https://bugs.webkit.org/show_bug.cgi?id=185422
1557         <rdar://problem/34001688>
1558
1559         Reviewed by Chris Dumez.
1560
1561         Currently we don't use shared memory maps in these cases. This still leaves us open for crashes
1562         in the network process when the device is locked.
1563
1564         This patch disables use of blob storage (mapped cache files) in apps that use class A/B protection.
1565         Normally we use blobs for resources > 16KB. Since use of shared memory is already disabled,
1566         the only optimization lost for these apps is body data deduplication.
1567
1568         Any existing cache entries with blobs are ignored and deleted. New entries are created with
1569         body data inlined with the metadata.
1570
1571         * NetworkProcess/cache/NetworkCache.cpp:
1572         (WebKit::NetworkCache::Cache::store):
1573         * NetworkProcess/cache/NetworkCache.h:
1574         (WebKit::NetworkCache::Cache::canUseSharedMemoryForBodyData const): Deleted.
1575         * NetworkProcess/cache/NetworkCacheEntry.cpp:
1576         (WebKit::NetworkCache::Entry::initializeShareableResourceHandleFromStorageRecord const):
1577
1578             Remove the code the prevented use of shared memory in these cases. Non-mapped Data objects
1579             are never shareable.
1580
1581         (WebKit::NetworkCache::Entry::setNeedsValidation):
1582         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
1583         (WebKit::NetworkCache::isSafeToUseMemoryMapForPath):
1584         (WebKit::NetworkCache::canUseSharedMemoryForPath): Deleted.
1585         * NetworkProcess/cache/NetworkCacheFileSystem.h:
1586         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1587         (WebKit::NetworkCache::Storage::Storage):
1588         (WebKit::NetworkCache::Storage::mayContainBlob const):
1589         (WebKit::NetworkCache::Storage::shouldStoreBodyAsBlob):
1590         (WebKit::NetworkCache::shouldStoreBodyAsBlob): Deleted.
1591         * NetworkProcess/cache/NetworkCacheStorage.h:
1592         (WebKit::NetworkCache::Storage::canUseSharedMemoryForBodyData const): Deleted.
1593
1594 2018-05-07  Carlos Garcia Campos  <cgarcia@igalia.com>
1595
1596         Unreviewed. Add missing exit not included in r231298.
1597
1598         * WebProcess/WebProcess.cpp:
1599         (WebKit::WebProcess::ensureWebToStorageProcessConnection):
1600
1601 2018-05-07  Daniel Bates  <dabates@apple.com>
1602
1603         Check X-Frame-Options and CSP frame-ancestors in network process
1604         https://bugs.webkit.org/show_bug.cgi?id=185410
1605         <rdar://problem/37733934>
1606
1607         Reviewed by Ryosuke Niwa.
1608
1609         * NetworkProcess/NetworkResourceLoadParameters.cpp:
1610         (WebKit::NetworkResourceLoadParameters::encode const): Always encode the frame ancestor origins.
1611         (WebKit::NetworkResourceLoadParameters::decode): Always decode the frame ancestor origins.
1612         * NetworkProcess/NetworkResourceLoader.cpp:
1613         (WebKit::NetworkResourceLoader::shouldInterruptLoadForXFrameOptions): Added.
1614         (WebKit::NetworkResourceLoader::shouldInterruptLoadForCSPFrameAncestorsOrXFrameOptions): Added.
1615         (WebKit::NetworkResourceLoader::didReceiveResponse): Check if the load needs to be interrupted due
1616         to a violation of the CSP frame-ancestors directive or X-Frame-Options. If there is a violation
1617         then stop the load.
1618         (WebKit::NetworkResourceLoader::didRetrieveCacheEntry): Ditto.
1619         (NetworkResourceLoader::addConsoleMessage): Added.
1620         (NetworkResourceLoader::sendCSPViolationReport): Added.
1621         * NetworkProcess/NetworkResourceLoader.h:
1622         * Scripts/webkit/messages.py: Teach the generator about data types MessageLevel and MessageSource
1623         as they are both defined in file JavaScriptCore/ConsoleTypes.h as opposed to independent headers.
1624         Also tell the generator that these types should not be forward declared so that we can use these
1625         types without their JSC:: prefix in WebPage.messages.in.
1626         * WebProcess/Network/NetworkProcessConnection.cpp:
1627         (WebKit::NetworkProcessConnection::didReceiveMessage): Route WebPage messages to the appropriate
1628         web page.
1629         * WebProcess/Network/WebLoaderStrategy.cpp:
1630         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): Added message StopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied.
1631         * WebProcess/Network/WebResourceLoader.cpp:
1632         (WebKit::WebResourceLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied): Added.
1633         * WebProcess/Network/WebResourceLoader.h:
1634         * WebProcess/Network/WebResourceLoader.messages.in:
1635         * WebProcess/WebPage/WebFrame.cpp:
1636         (WebKit::WebFrame::addConsoleMessage):
1637         * WebProcess/WebPage/WebFrame.h:
1638         * WebProcess/WebPage/WebPage.cpp:
1639         (WebKit::WebPage::addConsoleMessage): Added.
1640         (WebKit::WebPage::sendCSPViolationReport): Added.
1641         * WebProcess/WebPage/WebPage.h:
1642         * WebProcess/WebPage/WebPage.messages.in: Add messages AddConsoleMessage and SendCSPViolationReport
1643         for adding a console message to Web Inspector and sending a CSP report, respectively.
1644
1645 2018-05-07  Daniel Bates  <dabates@apple.com>
1646
1647         Abstract logic to log console messages and send CSP violation reports into a client
1648         https://bugs.webkit.org/show_bug.cgi?id=185393
1649         <rdar://problem/40036053>
1650
1651         Reviewed by Brent Fulgham.
1652
1653         For now, build a URL from the source origin associated with the NetworkResourceLoader
1654         and pass this to the ContentSecurityPolicy constructor.
1655
1656         Additionally, make NetworkLoadChecker::contentSecurityPolicy() non-const since it returns
1657         a non-const pointer to a ContentSecurityPolicy object; => callers can mutate this object
1658         right from under NetworkLoadChecker. Making this non-const makes this clear to a reader.
1659         Also remove the mutable keyword from the definition of NetworkLoadChecker::m_contentSecurityPolicy.
1660
1661         * NetworkProcess/NetworkLoadChecker.cpp:
1662         (WebKit::NetworkLoadChecker::contentSecurityPolicy):
1663         (WebKit::NetworkLoadChecker::contentSecurityPolicy const): Deleted.
1664         * NetworkProcess/NetworkLoadChecker.h:
1665
1666 2018-05-07  Alex Christensen  <achristensen@webkit.org>
1667
1668         WebResourceLoadStatisticsStore::requestStorageAccess should call its completion handler on the main thread
1669         https://bugs.webkit.org/show_bug.cgi?id=185403
1670
1671         Reviewed by Brent Fulgham.
1672
1673         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1674         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
1675
1676 2018-05-07  Chris Dumez  <cdumez@apple.com>
1677
1678         [iOS] Release page load process assertion if the screen is locked
1679         https://bugs.webkit.org/show_bug.cgi?id=185333
1680
1681         Reviewed by Geoffrey Garen.
1682
1683         We normally take a background process assertion during page loads to allow them to complete
1684         even if the tab / app is backgrounded. We should however avoid doing so when the backgrounding
1685         is caused by the screen locking. Keeping the process assertion in this case would prevent the
1686         whole device from sleeping longer than it should, thus negatively impacting power.
1687
1688         * UIProcess/Cocoa/NavigationState.h:
1689         * UIProcess/Cocoa/NavigationState.mm:
1690         (WebKit::NavigationState::NavigationState):
1691         (WebKit::NavigationState::releaseNetworkActivityToken):
1692         (WebKit::NavigationState::didChangeIsLoading):
1693         * UIProcess/ios/WebPageProxyIOS.mm:
1694         (WebKit::WebPageProxy::applicationDidEnterBackground):
1695
1696 2018-05-07  Brent Fulgham  <bfulgham@apple.com>
1697
1698         Add experimental feature to prompt for Storage Access API use
1699         https://bugs.webkit.org/show_bug.cgi?id=185335
1700         <rdar://problem/39994649>
1701
1702         Reviewed by Alex Christensen and Youenn Fablet.
1703
1704         Create a new experimental feature that gates the ability of WebKit clients to prompt the user when
1705         Storage Access API is invoked.
1706
1707         Currently this feature doesn't have any user-visible impact.
1708
1709         * Shared/API/APIObject.h:
1710         * Shared/API/c/WKBase.h:
1711         * Shared/WebPreferences.yaml:
1712         * UIProcess/API/APIUIClient.h:
1713         (API::UIClient::requestStorageAccessConfirm):
1714         * UIProcess/API/C/WKPage.cpp:
1715         (WebKit::RequestStorageAccessConfirmResultListener::create):
1716         (WebKit::RequestStorageAccessConfirmResultListener::~RequestStorageAccessConfirmResultListener):
1717         (WebKit::RequestStorageAccessConfirmResultListener::call):
1718         (WebKit::RequestStorageAccessConfirmResultListener::RequestStorageAccessConfirmResultListener):
1719         (WKPageRequestStorageAccessConfirmResultListenerGetTypeID):
1720         (WKPageRequestStorageAccessConfirmResultListenerCall):
1721         (WKPageSetPageUIClient):
1722         * UIProcess/API/C/WKPageUIClient.h:
1723         * UIProcess/API/Cocoa/WKPreferences.mm:
1724         (-[WKPreferences _storageAccessPromptsEnabled]):
1725         (-[WKPreferences _setStorageAccessPromptsEnabled:]):
1726         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1727         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1728         * UIProcess/Cocoa/UIDelegate.h:
1729         * UIProcess/Cocoa/UIDelegate.mm:
1730         (WebKit::UIDelegate::setDelegate):
1731         (WebKit::UIDelegate::UIClient::requestStorageAccessConfirm):
1732         * UIProcess/WebPageProxy.cpp:
1733         (WebKit::WebPageProxy::requestStorageAccessConfirm):
1734         * UIProcess/WebPageProxy.h:
1735         * UIProcess/WebPageProxy.messages.in:
1736         * UIProcess/WebPreferences.cpp:
1737         (WebKit::WebPreferences::update):
1738         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1739         (WebKit::WebChromeClient::requestStorageAccess):
1740
1741 2018-05-07  Dean Jackson  <dino@apple.com>
1742
1743         Use a dark gray for system preview bbackground
1744         https://bugs.webkit.org/show_bug.cgi?id=185391
1745         <rdar://problem/40035120>
1746
1747         Reviewed by Eric Carlson.
1748
1749         Throw some darker shade at this view.
1750
1751         * UIProcess/ios/WKSystemPreviewView.mm:
1752         (-[WKSystemPreviewView web_initWithFrame:webView:]):
1753
1754 2018-05-07  Don Olmstead  <don.olmstead@sony.com>
1755
1756         [Win] Add missing methods to WebChromeClient
1757         https://bugs.webkit.org/show_bug.cgi?id=185325
1758
1759         Reviewed by Brent Fulgham.
1760
1761         * WebProcess/WebCoreSupport/WebChromeClient.h:
1762
1763 2018-05-07  Megan Gardner  <megan_gardner@apple.com>
1764
1765         Allow Web Touch events to timeout
1766         https://bugs.webkit.org/show_bug.cgi?id=185282
1767
1768         Reviewed by Tim Horton.
1769         
1770         This is backwards, fixing.
1771
1772         * UIProcess/WebPageProxy.cpp:
1773         (WebKit::WebPageProxy::handleTouchEventSynchronously):
1774
1775 2018-05-07  Don Olmstead  <don.olmstead@sony.com>
1776
1777         [Win] LoggingWin is missing includes
1778         https://bugs.webkit.org/show_bug.cgi?id=185326
1779
1780         Reviewed by Per Arne Vollan.
1781
1782         * Platform/win/LoggingWin.cpp:
1783
1784 2018-05-07  Daniel Bates  <dabates@apple.com>
1785
1786         CSP should be passed the referrer
1787         https://bugs.webkit.org/show_bug.cgi?id=185367
1788
1789         Reviewed by Per Arne Vollan.
1790
1791         Pass the referrer through NetworkLoadChecker so that it can pass it to the ContentSecurityPolicy
1792         object it instantiates.
1793
1794         * NetworkProcess/NetworkLoadChecker.cpp:
1795         (WebKit::NetworkLoadChecker::NetworkLoadChecker):
1796         (WebKit::NetworkLoadChecker::contentSecurityPolicy const):
1797         * NetworkProcess/NetworkLoadChecker.h:
1798         (WebKit::NetworkLoadChecker::create):
1799         * NetworkProcess/NetworkResourceLoader.cpp:
1800         * NetworkProcess/PingLoad.cpp:
1801         (WebKit::PingLoad::PingLoad):
1802
1803 2018-05-07  Daniel Bates  <dabates@apple.com>
1804
1805         Substitute CrossOriginPreflightResultCache::clear() for CrossOriginPreflightResultCache::empty()
1806         https://bugs.webkit.org/show_bug.cgi?id=185170
1807
1808         Reviewed by Per Arne Vollan.
1809
1810         * WebProcess/WebProcess.cpp:
1811         (WebKit::WebProcess::clearResourceCaches):
1812         (WebKit::WebProcess::deleteWebsiteData):
1813
1814 2018-05-07  Brian Burg  <bburg@apple.com>
1815
1816         Web Inspector: opt out of process swap on navigation if a Web Inspector frontend is connected
1817         https://bugs.webkit.org/show_bug.cgi?id=184861
1818         <rdar://problem/39153768>
1819
1820         Reviewed by Timothy Hatcher.
1821
1822         We need to track how many frontends are attached to the web page (both local and remote).
1823         InspectorController propagates this out to WebKit via InspectorClient. This is then
1824         kept in UIProcess as a member of WebPageProxy. When making a decision whether to use a
1825         new process for a navigation, return early with "no" if any frontends are open for the
1826         page being navigated.
1827
1828         * UIProcess/WebPageProxy.h:
1829         (WebKit::WebPageProxy::didChangeInspectorFrontendCount):
1830         (WebKit::WebPageProxy::inspectorFrontendCount const):
1831         * UIProcess/WebPageProxy.messages.in:
1832         * UIProcess/WebProcessPool.cpp:
1833         (WebKit::WebProcessPool::processForNavigation):
1834         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
1835         (WebKit::WebInspectorClient::frontendCountChanged):
1836         * WebProcess/WebCoreSupport/WebInspectorClient.h:
1837         * WebProcess/WebPage/WebPage.cpp:
1838         (WebKit::WebPage::inspectorFrontendCountChanged):
1839         * WebProcess/WebPage/WebPage.h:
1840
1841 2018-05-04  Tim Horton  <timothy_horton@apple.com>
1842
1843         Shift to a lower-level framework for simplifying URLs
1844         https://bugs.webkit.org/show_bug.cgi?id=185334
1845
1846         Reviewed by Dan Bernstein.
1847
1848         * Configurations/WebKit.xcconfig:
1849         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
1850         (-[WKFullScreenWindowController _updateLocationInfo]):
1851
1852 2018-05-04  Per Arne Vollan  <pvollan@apple.com>
1853
1854         Shutdown WindowServer connections after checking in with launch services
1855         https://bugs.webkit.org/show_bug.cgi?id=185082
1856         <rdar://problem/39613173>
1857
1858         Reviewed by Brent Fulgham.
1859
1860         When WindowServer access is blocked in the WebContent process, we should shutdown all connections
1861         after checking in with launch services.
1862
1863         * WebProcess/cocoa/WebProcessCocoa.mm:
1864         (WebKit::WebProcess::platformInitializeProcess):
1865
1866 2018-05-04  Don Olmstead  <don.olmstead@sony.com>
1867
1868         [Win][WebKit] Fix forwarding headers for Windows build
1869         https://bugs.webkit.org/show_bug.cgi?id=184412
1870
1871         Reviewed by Alex Christensen.
1872
1873         * PlatformWin.cmake:
1874         * UIProcess/API/APIAttachment.h:
1875         * UIProcess/API/APIContextMenuClient.h:
1876         * UIProcess/API/C/WKProcessTerminationReason.h:
1877         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
1878
1879 2018-05-04  Chris Dumez  <cdumez@apple.com>
1880
1881         [iOS] Apps that are not visible may not get suspended if they trigger page loads while in the background
1882         https://bugs.webkit.org/show_bug.cgi?id=185318
1883
1884         Reviewed by Geoffrey Garen.
1885
1886         Whenever there is a page load going on, we take a background process assertion to delay process
1887         suspension until this load completes. However, there is also a 3 seconds grace period after
1888         a load is complete to allow the app to trigger a new load shortly after. This grace period was
1889         introduced to support use cases where a visible app does loads in an offscreen view. However,
1890         it can be abused by apps running in the background as they could trigger new page loads while
1891         in the background to delay process suspension. This patch tightens the policy so that only
1892         apps that are currently visible get to use this grace period. Apps that are in the background
1893         get to finish their current load and will then get suspended.
1894
1895         * UIProcess/Cocoa/NavigationState.mm:
1896         (WebKit::NavigationState::didChangeIsLoading):
1897
1898 2018-05-04  Per Arne Vollan  <pvollan@apple.com>
1899
1900         Adjust sandbox profile for simulator.
1901         https://bugs.webkit.org/show_bug.cgi?id=185319
1902
1903         Reviewed by Brent Fulgham.
1904
1905         Disable Kerberos rules, as well as rules related to NSApplication initialization.
1906
1907         * WebProcess/com.apple.WebProcess.sb.in:
1908
1909 2018-05-04  Tim Horton  <timothy_horton@apple.com>
1910
1911         Wasted time dlopening Lookup when tearing down a WKWebView
1912         https://bugs.webkit.org/show_bug.cgi?id=185310
1913         <rdar://problem/39934085>
1914
1915         Reviewed by Wenson Hsieh.
1916
1917         * UIProcess/Cocoa/WebViewImpl.h:
1918         * UIProcess/Cocoa/WebViewImpl.mm:
1919         (-[WKWindowVisibilityObserver dealloc]):
1920         (-[WKWindowVisibilityObserver startObservingLookupDismissalIfNeeded]):
1921         (WebKit::WebViewImpl::prepareForDictionaryLookup):
1922         (-[WKWindowVisibilityObserver startObservingLookupDismissal]): Deleted.
1923         Avoid un-registering as a Lookup dismissal observer if we never
1924         registered in the first place, because that involves dlopening Lookup.
1925
1926 2018-05-04  Megan Gardner  <megan_gardner@apple.com>
1927
1928         Allow Web Touch events to timeout
1929         https://bugs.webkit.org/show_bug.cgi?id=185282
1930         <rdar://problem/38728319>
1931
1932         Reviewed by Tim Horton.
1933         
1934         Web Touch events currently never time out, which blocks the user from interacting with the UI Process at all.
1935         We should allow these events to time out so that the user can interact with the rest of the UI.
1936
1937         * UIProcess/WebPageProxy.cpp:
1938         (WebKit::WebPageProxy::handleTouchEventSynchronously):
1939
1940 2018-05-04  Wenson Hsieh  <whsieh@berkeley.edu>
1941
1942         REGRESSION: [ios-simulator] 3 WKWebViewAutofillTests API test failures seen with 11.3 SDK
1943         https://bugs.webkit.org/show_bug.cgi?id=184196
1944         <rdar://problem/39054481>
1945
1946         Reviewed by Tim Horton.
1947
1948         Remove an unnecessary call to NSClassFromString, now that trunk WebKit only supports iOS 11.3+.
1949
1950         * UIProcess/ios/WKContentViewInteraction.mm:
1951         (-[WKContentView insertTextSuggestion:]):
1952
1953 2018-05-04  Youenn Fablet  <youenn@apple.com>
1954
1955         NetworkProcessProxy::didReceiveAuthenticationChallenge should take an AuthenticationChallenge r-value
1956         https://bugs.webkit.org/show_bug.cgi?id=185302
1957
1958         Reviewed by Geoffrey Garen.
1959
1960         Pass AuthenticationChallenge as an r-value since it comes from IPC.
1961         No change of behavior.
1962
1963         * UIProcess/Authentication/AuthenticationChallengeProxy.cpp:
1964         (WebKit::AuthenticationChallengeProxy::AuthenticationChallengeProxy):
1965         * UIProcess/Authentication/AuthenticationChallengeProxy.h:
1966         (WebKit::AuthenticationChallengeProxy::create):
1967         * UIProcess/Downloads/DownloadProxy.cpp:
1968         (WebKit::DownloadProxy::didReceiveAuthenticationChallenge):
1969         * UIProcess/Downloads/DownloadProxy.h:
1970         * UIProcess/Network/NetworkProcessProxy.cpp:
1971         (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
1972         * UIProcess/Network/NetworkProcessProxy.h:
1973
1974 2018-05-04  Sihui Liu  <sihui_liu@apple.com>
1975
1976         Assertion failure in NetworkStorageSession::setCookie: privilege of UI process is not set
1977         https://bugs.webkit.org/show_bug.cgi?id=185262
1978
1979         Reviewed by Chris Dumez.
1980
1981         Fix an assertion failure by setting UI process privileges in constructor of WebsiteDataStore
1982         because UI process may use the cookie API before creating a WebView.
1983
1984         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1985         (WebKit::WebsiteDataStore::WebsiteDataStore):
1986
1987 2018-05-04  Per Arne Vollan  <pvollan@apple.com>
1988
1989         Adjust sandbox rules for simulator.
1990         https://bugs.webkit.org/show_bug.cgi?id=185275
1991
1992         Reviewed by Brent Fulgham.
1993
1994         Enable rules related to CoreMedia for minimal simulator.
1995
1996         * WebProcess/com.apple.WebProcess.sb.in:
1997
1998 2018-05-04  Carlos Garcia Campos  <cgarcia@igalia.com>
1999
2000         [GTK] Epiphany (GNOME Web) says "Error downloading: Service Unavailable." when trying to download an image from discogs.com
2001         https://bugs.webkit.org/show_bug.cgi?id=174730
2002
2003         Reviewed by Michael Catanzaro.
2004
2005         The problem is that we don't send any User-Agent HTTP header for downloads started by WebProcessPool::download().
2006
2007         * UIProcess/API/glib/WebKitDownload.cpp:
2008         (webkitDownloadUpdateRequest): Helper to update the cached request.
2009         (webkitDownloadStarted): Updated the cached request if we have one.
2010         (webkit_download_get_request): Use webkitDownloadUpdateRequest().
2011         * UIProcess/API/glib/WebKitDownloadClient.cpp:
2012         * UIProcess/API/glib/WebKitDownloadPrivate.h:
2013         * UIProcess/WebProcessPool.cpp:
2014         (WebKit::WebProcessPool::download): Set the User-Agent HTTP header if there isn't any.
2015
2016 2018-05-04  Carlos Garcia Campos  <cgarcia@igalia.com>
2017
2018         [GTK] Some event tests failing after r230817
2019         https://bugs.webkit.org/show_bug.cgi?id=185072
2020
2021         Reviewed by Michael Catanzaro.
2022
2023         Do not send mouse move events to the WebProcess for crossing events during testing. WTR never generates crossing
2024         events and they can confuse tests.
2025
2026         Fixes: editing/pasteboard/drag-link-with-data-transfer-adds-trusted-link-to-pasteboard.html
2027                fast/css/user-drag-none.html
2028                fast/events/context-activated-by-key-event.html
2029                fast/events/drag-selects-image.html
2030                fast/events/dropzone-005.html
2031                fast/events/mouse-click-events.html
2032                fast/events/mouse-cursor-change.html
2033
2034         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2035         (webkitWebViewBaseCrossingNotifyEvent):
2036
2037 2018-05-03  Chris Dumez  <cdumez@apple.com>
2038
2039         More aggressively terminate child processes when the connection to their parent process is severed
2040         https://bugs.webkit.org/show_bug.cgi?id=177972
2041         <rdar://problem/33317607>
2042
2043         Reviewed by Geoff Garen.
2044
2045         More aggressively terminate child processes when the connection to their parent process is severed.
2046         Previously, we would dispatch to the main thread and then exit the process. This would sometimes
2047         cause the process to say alive for 10 seconds until our watchdog would forcefully terminate the
2048         process. This could happen in particular when the main thread is blocked on a synchronous IPC.
2049
2050         * NetworkProcess/NetworkProcess.cpp:
2051         (WebKit::NetworkProcess::didClose): Deleted.
2052         * NetworkProcess/NetworkProcess.h:
2053         * PluginProcess/PluginProcess.cpp:
2054         (WebKit::PluginProcess::didClose): Deleted.
2055         * PluginProcess/PluginProcess.h:
2056         * Shared/ChildProcess.cpp:
2057         (WebKit::ChildProcess::didClose):
2058         (WebKit::didCloseOnConnectionWorkQueue):
2059         (WebKit::ChildProcess::terminationTimerFired):
2060         * Shared/ChildProcess.h:
2061         * StorageProcess/StorageProcess.cpp:
2062         (WebKit::StorageProcess::didClose): Deleted.
2063         * StorageProcess/StorageProcess.h:
2064         * WebProcess/WebProcess.cpp:
2065         (WebKit::WebProcess::didClose): Deleted.
2066         * WebProcess/WebProcess.h:
2067
2068 2018-05-03  Yusuke Suzuki  <utatane.tea@gmail.com>
2069
2070         Use default std::optional if it is provided
2071         https://bugs.webkit.org/show_bug.cgi?id=185159
2072
2073         Reviewed by Michael Catanzaro.
2074
2075         * Shared/SandboxExtension.h:
2076         (WebKit::SandboxExtension::Handle::decode):
2077         * Shared/TouchBarMenuItemData.cpp:
2078         (WebKit::TouchBarMenuItemData::decode):
2079
2080 2018-05-03  Justin Fan  <justin_fan@apple.com>
2081
2082         [WebGL] Add runtime flag for enabling ASTC support in WebGL
2083         https://bugs.webkit.org/show_bug.cgi?id=184840
2084
2085         Reviewed by Myles C. Maxfield.
2086
2087         Added runtime flag for ASTC support in WebGL, to turn on/off when extension is implemented.
2088
2089         * Shared/WebPreferences.yaml:
2090
2091 2018-05-03  Keith Rollin  <krollin@apple.com>
2092
2093         Unreviewed build fix after <https://trac.webkit.org/changeset/231282>.
2094
2095         * NetworkProcess/NetworkActivityTracker.h:
2096
2097 2018-05-03  Wenson Hsieh  <wenson_hsieh@apple.com>
2098
2099         Ads in NYTimes app are shifted downwards by the scroll view's top content inset
2100         https://bugs.webkit.org/show_bug.cgi?id=185251
2101         <rdar://problem/39062357>
2102
2103         Reviewed by Tim Horton.
2104
2105         The NYTimes app embeds advertisements in each article's WKWebView by adding views in the WKScrollView's view
2106         hierarchy. These views are positioned using the bounding client rects of elements in the DOM (via Element
2107         ::getBoundingClientRect). Prior to r229641, WebKit would report bounding client rects inset by the content
2108         insets of WKScrollView, which means that if a top content inset X is specified on the scroll view, an element
2109         that is flush against the top of the viewport will have a bounding client rect top of -X (when it should really
2110         be 0).
2111
2112         To account for this, NYTimes adds the scroll view content insets back to the bounding client rect when
2113         determining the position of each advertisement which, after r229641, causes these views to be shifted downwards
2114         by an amount equal to the scroll view content inset top.
2115
2116         This new behavior does not affect Safari, since Safari uses SPI to explicitly set obscured insets. As such, we
2117         address this by gating the scroll view content inset fix with a linked-on-or-after check.
2118
2119         * UIProcess/API/Cocoa/WKWebView.mm:
2120         (-[WKWebView _computedObscuredInset]):
2121         * UIProcess/Cocoa/VersionChecks.h:
2122
2123 2018-05-03  Chris Dumez  <cdumez@apple.com>
2124
2125         Load hangs if the WebProcess fails to launch
2126         https://bugs.webkit.org/show_bug.cgi?id=185225
2127         <rdar://problem/38249058>
2128
2129         Reviewed by Geoff Garen.
2130
2131         When a process fails to launch, ChildProcessProxy::didFinishLaunching() gets called with an
2132         invalid connection identifier. While NetworkProcessProxy::didFinishLaunching() properly deals with
2133         this situation, WebProcessProxy::didFinishLaunching() does not. As a result, we do not attempt to
2134         relaunch the process, we do not notify the client and WebPageProxy::m_isValid stays true.
2135
2136         This patch thus updates WebProcessProxy::didFinishLaunching() to check if the connection identifier
2137         is valid and treats it as a crash. As a result, the WebPageProxies properly reset their state and
2138         the client gets notified of the crash so that it can attempt to reload.
2139
2140         * UIProcess/API/Cocoa/WKProcessPool.mm:
2141         (-[WKProcessPool _makeNextWebProcessLaunchFailForTesting]):
2142         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2143         * UIProcess/Launcher/ProcessLauncher.h:
2144         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2145         (WebKit::ProcessLauncher::launchProcess):
2146         Add SPI to make the next WebProcess launch fail, for the purpose of API testing.
2147
2148         * UIProcess/WebProcessPool.h:
2149         * UIProcess/WebProcessProxy.cpp:
2150         (WebKit::WebProcessProxy::getLaunchOptions):
2151         (WebKit::WebProcessProxy::didClose):
2152         (WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
2153         (WebKit::WebProcessProxy::didFinishLaunching):
2154         * UIProcess/WebProcessProxy.h:
2155
2156 2018-05-03  Commit Queue  <commit-queue@webkit.org>
2157
2158         Unreviewed, rolling out r231223 and r231288.
2159         https://bugs.webkit.org/show_bug.cgi?id=185256
2160
2161         The change in r231223 breaks internal builds, and r231288 is a
2162         dependent change. (Requested by ryanhaddad on #webkit).
2163
2164         Reverted changesets:
2165
2166         "Use default std::optional if it is provided"
2167         https://bugs.webkit.org/show_bug.cgi?id=185159
2168         https://trac.webkit.org/changeset/231223
2169
2170         "Use pointer instead of
2171         std::optional<std::reference_wrapper<>>"
2172         https://bugs.webkit.org/show_bug.cgi?id=185186
2173         https://trac.webkit.org/changeset/231288
2174
2175 2018-05-03  Per Arne Vollan  <pvollan@apple.com>
2176
2177         An error message is written to stderr when the WebContent process is blocking WindowServer access.
2178         https://bugs.webkit.org/show_bug.cgi?id=184701
2179
2180         Reviewed by Brent Fulgham.
2181
2182         Calling 'setApplicationIsDaemon(true)' instead of 'CGSSetDenyWindowServerConnections(true)' to disable
2183         access to the WindowServer in the WebContent process, will remove this error message. After this change,
2184         the url of the WebContent process is still showing up in Activity Monitor, which previously was a
2185         problem when calling 'setApplicationIsDaemon(true)'.
2186
2187         * WebProcess/WebProcess.cpp:
2188         (WebKit::WebProcess::initializeProcess):
2189         * WebProcess/cocoa/WebProcessCocoa.mm:
2190         (WebKit::WebProcess::platformInitializeProcess):
2191
2192 2018-05-03  Ryan Haddad  <ryanhaddad@apple.com>
2193
2194         Unreviewed, rolling out r231253.
2195
2196         The API test added with this change is crashing on the bots.
2197
2198         Reverted changeset:
2199
2200         "Web Inspector: opt out of process swap on navigation if a Web
2201         Inspector frontend is connected"
2202         https://bugs.webkit.org/show_bug.cgi?id=184861
2203         https://trac.webkit.org/changeset/231253
2204
2205 2018-05-03  Brent Fulgham  <bfulgham@apple.com>
2206
2207         Re-eneable Network Extension support in the WebContent process
2208         https://bugs.webkit.org/show_bug.cgi?id=185236
2209         <rdar://problem/39883004>
2210
2211         Reviewed by Eric Carlson.
2212
2213         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2214         * WebProcess/com.apple.WebProcess.sb.in:
2215
2216 2018-05-03  Tim Horton  <timothy_horton@apple.com>
2217
2218         REGRESSION (r231014): Entitlements are not applied to XPC services on macOS
2219         https://bugs.webkit.org/show_bug.cgi?id=185241
2220
2221         Reviewed by Dan Bernstein.
2222
2223         * Configurations/BaseXPCService.xcconfig:
2224         * Configurations/WebContentService.Development.xcconfig:
2225         * Configurations/WebContentService.xcconfig:
2226
2227 2018-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>
2228
2229         REGRESSION(r222772): [GTK][WPE] WebProcess from WebKitGtk+ 2.19.9x SIGSEVs in WebKit::WebProcess::ensureNetworkProcessConnection() at Source/WebKit/WebProcess/WebProcess.cpp:1127
2230         https://bugs.webkit.org/show_bug.cgi?id=183348
2231
2232         Reviewed by Michael Catanzaro.
2233
2234         When connection doesn't exit in case of sync message failure, always exit in case of failing to send
2235         GetNetworkProcessConnection or GetStorageProcessConnection messages. This can happen when the WebView is created
2236         and destroyed quickly.
2237
2238         * WebProcess/WebProcess.cpp:
2239         (WebKit::WebProcess::ensureNetworkProcessConnection):
2240         (WebKit::WebProcess::ensureWebToStorageProcessConnection):
2241
2242 2018-05-02  Nan Wang  <n_wang@apple.com>
2243
2244         AX: Missing kAXSWebAccessibilityEventsEnabledNotification causes a crash
2245         https://bugs.webkit.org/show_bug.cgi?id=185237
2246
2247         Reviewed by Dan Bernstein.
2248
2249         When libAccessibility.dylib is missing, the compiler would optimize out the global
2250         notification and lead to a crash. Fixed it by using the isNullFunction check instead,
2251         since we are sure the global notification would be there when the corresponding function 
2252         is available.
2253
2254         * UIProcess/API/Cocoa/WKWebView.mm:
2255         (-[WKWebView _initializeWithConfiguration:]):
2256
2257 2018-05-02  Keith Rollin  <krollin@apple.com>
2258
2259         Add facility for tracking times and results of page and resource loading
2260         https://bugs.webkit.org/show_bug.cgi?id=184838
2261         <rdar://problem/36548974>
2262
2263         Reviewed by Brent Fulgham.
2264
2265         Add NetworkActivityTracker. The idea behind this facility is to create
2266         and destroy them around networking activity that we want to track for
2267         the purpose of measuring overall network health. They can be created
2268         around the loading of pages or individual resources, and can be
2269         arranged in a parent/child hierarchy to indicate what pages the
2270         resources are part of. The NetworkActivity tracker tracks load times
2271         and results. On Cocoa, it can be integrated with CFNetwork in order to
2272         associate WebKit activity with low-level networking activity.
2273
2274         * CMakeLists.txt:
2275         * Configurations/WebKit.xcconfig:
2276         * NetworkProcess/NetworkActivityTracker.cpp: Copied from Source/WebKit/NetworkProcess/NetworkLoadParameters.h.
2277         (WebKit::NetworkActivityTracker::NetworkActivityTracker):
2278         (WebKit::NetworkActivityTracker::~NetworkActivityTracker):
2279         (WebKit::NetworkActivityTracker::setParent):
2280         (WebKit::NetworkActivityTracker::start):
2281         (WebKit::NetworkActivityTracker::complete):
2282         * NetworkProcess/NetworkActivityTracker.h: Added.
2283         (WebKit::NetworkActivityTracker::getPlatformObject):
2284         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2285         (WebKit::NetworkConnectionToWebProcess::didClose):
2286         (WebKit::NetworkConnectionToWebProcess::pageLoadCompleted):
2287         (WebKit::networkActivityTrackingEnabled):
2288         (WebKit::NetworkConnectionToWebProcess::startTrackingResourceLoad):
2289         (WebKit::NetworkConnectionToWebProcess::stopTrackingResourceLoad):
2290         (WebKit::NetworkConnectionToWebProcess::stopAllNetworkActivityTracking):
2291         (WebKit::NetworkConnectionToWebProcess::stopAllNetworkActivityTrackingForPage):
2292         (WebKit::NetworkConnectionToWebProcess::findRootNetworkActivity):
2293         (WebKit::NetworkConnectionToWebProcess::findNetworkActivityTracker):
2294         * NetworkProcess/NetworkConnectionToWebProcess.h:
2295         (WebKit::NetworkConnectionToWebProcess::ResourceNetworkActivityTracker::ResourceNetworkActivityTracker):
2296         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2297         * NetworkProcess/NetworkDataTask.cpp:
2298         (WebKit::NetworkDataTask::create):
2299         * NetworkProcess/NetworkLoadParameters.h:
2300         * NetworkProcess/NetworkProcess.cpp:
2301         (WebKit::NetworkProcess::initializeNetworkProcess):
2302         * NetworkProcess/NetworkProcess.h:
2303         (WebKit::NetworkProcess::trackNetworkActivity const):
2304         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2305         (WebKit::NetworkProcessCreationParameters::encode const):
2306         (WebKit::NetworkProcessCreationParameters::decode):
2307         * NetworkProcess/NetworkProcessCreationParameters.h:
2308         * NetworkProcess/NetworkResourceLoader.cpp:
2309         (WebKit::NetworkResourceLoader::start):
2310         (WebKit::NetworkResourceLoader::cleanup):
2311         (WebKit::NetworkResourceLoader::abort):
2312         (WebKit::NetworkResourceLoader::didFinishLoading):
2313         (WebKit::NetworkResourceLoader::didFailLoading):
2314         (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
2315         (WebKit::NetworkResourceLoader::continueProcessingCachedEntryAfterDidReceiveResponse):
2316         * NetworkProcess/NetworkResourceLoader.h:
2317         * NetworkProcess/cocoa/NetworkActivityTrackerCocoa.mm: Added.
2318         (WebKit::NetworkActivityTracker::NetworkActivityTracker):
2319         (WebKit::NetworkActivityTracker::~NetworkActivityTracker):
2320         (WebKit::NetworkActivityTracker::setParent):
2321         (WebKit::NetworkActivityTracker::start):
2322         (WebKit::NetworkActivityTracker::complete):
2323         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
2324         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2325         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
2326         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2327         (API::ProcessPoolConfiguration::copy):
2328         * UIProcess/API/APIProcessPoolConfiguration.h:
2329         * UIProcess/API/C/WKContextConfigurationRef.cpp:
2330         (WKContextConfigurationTrackNetworkActivity):
2331         (WKContextConfigurationSetTrackNetworkActivity):
2332         * UIProcess/API/C/WKContextConfigurationRef.h:
2333         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
2334         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
2335         (-[_WKProcessPoolConfiguration trackNetworkActivity]):
2336         (-[_WKProcessPoolConfiguration setTrackNetworkActivity:]):
2337         * UIProcess/WebProcessPool.cpp:
2338         (WebKit::WebProcessPool::ensureNetworkProcess):
2339         * WebKit.xcodeproj/project.pbxproj:
2340         * WebProcess/Network/WebLoaderStrategy.cpp:
2341         (WebKit::WebLoaderStrategy::pageLoadCompleted):
2342         * WebProcess/Network/WebLoaderStrategy.h:
2343
2344 2018-05-02  Jer Noble  <jer.noble@apple.com>
2345
2346         Open audio/video sandbox services for minimal simulator
2347         https://bugs.webkit.org/show_bug.cgi?id=185217
2348         <rdar://problem/39918909>
2349
2350         Reviewed by Per Arne Vollan.
2351
2352         * WebKit.xcodeproj/project.pbxproj:
2353         * WebProcess/com.apple.WebProcess.sb.in:
2354
2355 2018-05-02  Daniel Bates  <dabates@apple.com>
2356
2357         Cleanup NetworkResourceLoader::didReceiveResponse()
2358         https://bugs.webkit.org/show_bug.cgi?id=185209
2359
2360         Reviewed by Chris Dumez.
2361
2362         Use early returns to make the control flow easier to read and reason about. Disregarding a
2363         From-Origin violation, NetworkResourceLoader::didReceiveResponse() only returns NetworkLoadClient::ShouldContinueDidReceiveResponse::No
2364         when the load is for a main resource and hence it must wait for the embedding client to allow
2365         the load before continuing with it. With regards to a From-Origin violation, the network
2366         process schedules to fail the load in a subsequent turn of the event loop before returning
2367         NetworkLoadClient::ShouldContinueDidReceiveResponse::No. It return NetworkLoadClient::ShouldContinueDidReceiveResponse::No
2368         solely to tell the NetworkLoadClient to defer assuming the load is allowed (because we will
2369         fail it on the next turn of the event loop).
2370
2371         Additionally, remove all logging about the return value as we no longer have a need for
2372         such logging.
2373
2374         * NetworkProcess/NetworkResourceLoader.cpp:
2375         (WebKit::NetworkResourceLoader::didReceiveResponse):
2376
2377 2018-05-02  Alex Christensen  <achristensen@webkit.org>
2378
2379         Add WKWebsiteDataStorePrivate._proxyConfiguration SPI
2380         https://bugs.webkit.org/show_bug.cgi?id=185179
2381
2382         Reviewed by Andy Estes.
2383
2384         * NetworkProcess/NetworkSessionCreationParameters.h:
2385         (WebKit::NetworkSessionCreationParameters::encode const):
2386         (WebKit::NetworkSessionCreationParameters::decode):
2387         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2388         (WebKit::NetworkDataTaskCocoa::applySniffingPoliciesAndBindRequestToInferfaceIfNeeded):
2389         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
2390         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2391         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
2392         * Shared/WebsiteDataStoreParameters.cpp:
2393         (WebKit::WebsiteDataStoreParameters::privateSessionParameters):
2394         * Shared/cf/ArgumentCodersCF.cpp:
2395         (IPC::encode):
2396         (IPC::decode):
2397         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2398         (-[WKWebsiteDataStore _setProxyConfiguration:]):
2399         (-[WKWebsiteDataStore _proxyConfiguration]):
2400         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
2401         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
2402         (WebKit::WebsiteDataStore::parameters):
2403         * UIProcess/WebsiteData/WebsiteDataStore.h:
2404         (WebKit::WebsiteDataStore::setProxyConfiguration):
2405         (WebKit::WebsiteDataStore::proxyConfiguration):
2406
2407 2018-05-02  Youenn Fablet  <youenn@apple.com>
2408
2409         Use NetworkLoadChecker for navigation loads
2410         https://bugs.webkit.org/show_bug.cgi?id=184892
2411         <rdar://problem/39652686>
2412
2413         Reviewed by Chris Dumez.
2414
2415         Compute whether a response is same origin in no-cors case.
2416         This allows providing more precise filtering.
2417         In case of navigate loads, set the tainting to basic which will make filtering to the minimum.
2418
2419         Pass the sourceOrigin for navigation loads as well.
2420         Enable to restrict HTTP response access for navigation load.
2421
2422         Content Blockers are disabled for now in NetworkLoadChecker for navigation loads.
2423         They should be reenabled as a follow-up.
2424
2425         Add a specific case to allow any redirection to about:// URLs.
2426         While this does not conform with the spec, this keeps the existing WebKit behavior.
2427
2428         * NetworkProcess/NetworkLoadChecker.cpp:
2429         (WebKit::NetworkLoadChecker::NetworkLoadChecker):
2430         (WebKit::NetworkLoadChecker::validateResponse):
2431         (WebKit::NetworkLoadChecker::continueCheckingRequest):
2432         (WebKit::NetworkLoadChecker::doesNotNeedCORSCheck const):
2433         * NetworkProcess/NetworkResourceLoader.cpp:
2434         (WebKit::NetworkResourceLoader::sanitizeResponseIfPossible):
2435         * WebProcess/Network/WebLoaderStrategy.cpp:
2436         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
2437         (WebKit::WebLoaderStrategy::isDoingLoadingSecurityChecks const):
2438         We only do security checks if this runtime flag is on.
2439         * WebProcess/Network/WebLoaderStrategy.h:
2440
2441 2018-05-02  Jer Noble  <jer.noble@apple.com>
2442
2443         Make EncryptedMediaAPIEnabled an experimental feature
2444         https://bugs.webkit.org/show_bug.cgi?id=185212
2445
2446         Reviewed by Eric Carlson.
2447
2448         * Shared/WebPreferences.yaml:
2449
2450 2018-05-02  Per Arne Vollan  <pvollan@apple.com>
2451
2452         Adjust sandbox profile in simulator mode.
2453         https://bugs.webkit.org/show_bug.cgi?id=185172
2454         <rdar://problem/39876860>
2455
2456         Reviewed by Brent Fulgham.
2457
2458         Fix some sandbox violations.
2459
2460         * WebProcess/com.apple.WebProcess.sb.in:
2461
2462 2018-05-02  Brian Burg  <bburg@apple.com>
2463
2464         Web Inspector: opt out of process swap on navigation if a Web Inspector frontend is connected
2465         https://bugs.webkit.org/show_bug.cgi?id=184861
2466         <rdar://problem/39153768>
2467
2468         Reviewed by Ryosuke Niwa.
2469
2470         We need to track how many frontends are attached to the web page (both local and remote).
2471         InspectorController propagates this out to WebKit via InspectorClient. This is then
2472         kept in UIProcess as a member of WebPageProxy. When making a decision whether to use a
2473         new process for a navigation, return early with "no" if any frontends are open for the
2474         page being navigated.
2475
2476         * UIProcess/WebPageProxy.h:
2477         (WebKit::WebPageProxy::didChangeInspectorFrontendCount):
2478         (WebKit::WebPageProxy::inspectorFrontendCount const):
2479         * UIProcess/WebPageProxy.messages.in:
2480         * UIProcess/WebProcessPool.cpp:
2481         (WebKit::WebProcessPool::processForNavigation):
2482         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
2483         (WebKit::WebInspectorClient::frontendCountChanged):
2484         * WebProcess/WebCoreSupport/WebInspectorClient.h:
2485         * WebProcess/WebPage/WebPage.cpp:
2486         (WebKit::WebPage::inspectorFrontendCountChanged):
2487         * WebProcess/WebPage/WebPage.h:
2488
2489 2018-05-02  Jer Noble  <jer.noble@apple.com>
2490
2491         Adopt -destinationWindowToExitFullScreenForWindow:
2492         https://bugs.webkit.org/show_bug.cgi?id=185204
2493         <rdar://problem/22486621>
2494
2495         Reviewed by Eric Carlson.
2496
2497         * UIProcess/mac/WKFullScreenWindowController.mm:
2498         (-[WKFullScreenWindowController destinationWindowToExitFullScreenForWindow:]):
2499
2500 2018-05-02  Per Arne Vollan  <pvollan@apple.com>
2501
2502         Disable Media capture rules in sandbox for simulator.
2503         https://bugs.webkit.org/show_bug.cgi?id=185206
2504         <rdar://problem/39910015>
2505
2506         Reviewed by Eric Carlson.
2507
2508         These rules are not relevant in this case.
2509
2510         * WebProcess/com.apple.WebProcess.sb.in:
2511
2512 2018-05-02  Eric Carlson  <eric.carlson@apple.com>
2513
2514         [iOS] Provide audio route information when invoking AirPlay picker
2515         https://bugs.webkit.org/show_bug.cgi?id=185199
2516         <rdar://problem/39853103>
2517
2518         Reviewed by Jer Noble.
2519
2520         * Scripts/webkit/messages.py:
2521         * UIProcess/PageClient.h:
2522         * UIProcess/WebPageProxy.h:
2523         * UIProcess/WebPageProxy.messages.in:
2524         * UIProcess/ios/PageClientImplIOS.h:
2525         * UIProcess/ios/PageClientImplIOS.mm:
2526         (WebKit::PageClientImpl::showPlaybackTargetPicker):  Pass route sharing policy and routing context UID.
2527
2528         * UIProcess/ios/WKContentViewInteraction.h:
2529         * UIProcess/ios/WKContentViewInteraction.mm:
2530         (-[WKContentView _showPlaybackTargetPicker:fromRect:routeSharingPolicy:routingContextUID:]): Take same.
2531         (-[WKContentView _showPlaybackTargetPicker:fromRect:]): Deleted.
2532
2533         * UIProcess/ios/WebPageProxyIOS.mm:
2534         (WebKit::WebPageProxy::showPlaybackTargetPicker): Pass route sharing policy and routing context UID.
2535
2536         * UIProcess/ios/forms/WKAirPlayRoutePicker.h:
2537         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
2538         (-[WKAirPlayRoutePicker showFromView:routeSharingPolicy:routingContextUID:]): Take same.
2539         (-[WKAirPlayRoutePicker showFromView:]): Deleted.
2540
2541         * WebProcess/WebCoreSupport/WebChromeClient.h:
2542         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
2543         (WebKit::WebChromeClient::showPlaybackTargetPicker):
2544
2545 2018-05-02  Jer Noble  <jer.noble@apple.com>
2546
2547         Get the WebKit.framework bundle by asking for WKWebView
2548         https://bugs.webkit.org/show_bug.cgi?id=185175
2549
2550         Reviewed by Tim Horton.
2551
2552         * NetworkProcess/mac/NetworkProcessMac.mm:
2553         (WebKit::NetworkProcess::initializeSandbox):
2554         * Shared/mac/ChildProcessMac.mm:
2555         (WebKit::ChildProcess::initializeSandbox):
2556         * StorageProcess/mac/StorageProcessMac.mm:
2557         (WebKit::StorageProcess::initializeSandbox):
2558
2559 2018-05-02  Youenn Fablet  <youenn@apple.com>
2560
2561         Cannot gather srflx or relay ICE candidates on IPv6 network (ICE agent hangs?)
2562         https://bugs.webkit.org/show_bug.cgi?id=181009
2563         <rdar://problem/36144555>
2564
2565         Reviewed by Eric Carlson.
2566
2567         On iOS/IPv6 networks, STUN servers name resolution returns a zero IPv6 IP address.
2568         No error is raised which leads to sending STUN requests with that IP address.
2569         Once the request times out, the ICE candidate gathering finishes with host candidates only.
2570
2571         This patch makes WebRTC DNS resolver to send only IPv4 resolved addresses.
2572         STUN is used for NAT traversal which is for IPv4 addresses.
2573         Not sending IPv6 addresses allows terminating ICE candidate gathering sooner.
2574
2575         Manually tested on iOS with IPv4/IPv6 and IPv6 networks.
2576
2577         * NetworkProcess/webrtc/NetworkRTCResolverCocoa.cpp:
2578         (WebKit::resolvedName):
2579
2580 2018-05-02  Youenn Fablet  <youenn@apple.com>
2581
2582         CacheStorage::Engine should keep a list of initialization callback
2583         https://bugs.webkit.org/show_bug.cgi?id=185184
2584         <rdar://problem/38875651>
2585
2586         Reviewed by Antti Koivisto.
2587
2588         Keep each initialize callback in a Vector so as to compute the salt only once.
2589         Call all callbacks then in a loop.
2590
2591         * NetworkProcess/cache/CacheStorageEngine.cpp:
2592         (WebKit::CacheStorage::Engine::~Engine):
2593         (WebKit::CacheStorage::Engine::initialize):
2594         * NetworkProcess/cache/CacheStorageEngine.h:
2595
2596 2018-05-02  Jer Noble  <jer.noble@apple.com>
2597
2598         Pipe volume through PlaybackSessionManager/Proxy.
2599         https://bugs.webkit.org/show_bug.cgi?id=185182
2600
2601         Reviewed by Eric Carlson.
2602
2603         * UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
2604         * UIProcess/Cocoa/PlaybackSessionManagerProxy.messages.in:
2605         * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
2606         (WebKit::PlaybackSessionModelContext::setVolume):
2607         (WebKit::PlaybackSessionModelContext::volumeChanged):
2608         (WebKit::PlaybackSessionManagerProxy::volumeChanged):
2609         (WebKit::PlaybackSessionManagerProxy::setVolume):
2610         * WebProcess/cocoa/PlaybackSessionManager.h:
2611         * WebProcess/cocoa/PlaybackSessionManager.messages.in:
2612         * WebProcess/cocoa/PlaybackSessionManager.mm:
2613         (WebKit::PlaybackSessionInterfaceContext::volumeChanged):
2614         (WebKit::PlaybackSessionManager::volumeChanged):
2615         (WebKit::PlaybackSessionManager::setVolume):
2616
2617 2018-05-01  Yusuke Suzuki  <utatane.tea@gmail.com>
2618
2619         Use default std::optional if it is provided
2620         https://bugs.webkit.org/show_bug.cgi?id=185159
2621
2622         Reviewed by JF Bastien.
2623
2624         * Shared/SandboxExtension.h:
2625         (WebKit::SandboxExtension::Handle::decode):
2626         * Shared/TouchBarMenuItemData.cpp:
2627         (WebKit::TouchBarMenuItemData::decode):
2628
2629 2018-05-01  Jer Noble  <jer.noble@apple.com>
2630
2631         Production build error in Migrate Header phase when WK_ALTERNATE_FRAMEWORKS_DIR is set to non-empty value
2632         https://bugs.webkit.org/show_bug.cgi?id=185171
2633
2634         Reviewed by Timothy Hatcher.
2635
2636         * Configurations/BaseTarget.xcconfig:
2637
2638 2018-05-01  Per Arne Vollan  <pvollan@apple.com>
2639
2640         Use correct runloop type in the WebContent process.
2641         https://bugs.webkit.org/show_bug.cgi?id=185140
2642
2643         Reviewed by Brent Fulgham.
2644
2645         Use WK_MACOS_* machinery to determine runloop type for the WebContent process.
2646
2647         * Configurations/WebContentService.xcconfig:
2648
2649 2018-05-01  Oleksandr Skachkov  <gskachkov@gmail.com>
2650
2651         WebAssembly: add support for stream APIs - JavaScript API
2652         https://bugs.webkit.org/show_bug.cgi?id=183442
2653
2654         Reviewed by Yusuke Suzuki and JF Bastien.
2655
2656         Add WEBASSEMBLY_STREAMING_API feature flag
2657
2658         * Configurations/FeatureDefines.xcconfig:
2659
2660 2018-04-30  Per Arne Vollan  <pvollan@apple.com>
2661
2662         Use correct runloop type in the WebContent process.
2663         https://bugs.webkit.org/show_bug.cgi?id=185140
2664         <rdar://problem/39585037>
2665
2666         Reviewed by Brent Fulgham.
2667
2668         The macOS target version should be used to determine the runloop type.
2669
2670         * Configurations/WebContentService.xcconfig:
2671
2672 2018-04-30  Michael Saboff  <msaboff@apple.com>
2673
2674         Eliminate WebProcessShim.dylib
2675         https://bugs.webkit.org/show_bug.cgi?id=185147
2676
2677         Reviewed by Ryosuke Niwa.
2678
2679         * Configurations/WebContentService.xcconfig:
2680         * Configurations/WebProcessShim.xcconfig: Removed.
2681         * WebKit.xcodeproj/project.pbxproj:
2682
2683 2018-04-30  Michael Saboff  <msaboff@apple.com>
2684
2685         Remove unused mac/CookieStorageShimLibrary
2686         https://bugs.webkit.org/show_bug.cgi?id=185146
2687
2688         Reviewed by Alex Christensen.
2689
2690         * Shared/mac/CookieStorageShimLibrary.cpp: Removed.
2691         * Shared/mac/CookieStorageShimLibrary.h: Removed.
2692         * WebKit.xcodeproj/project.pbxproj:
2693
2694 2018-04-30  Alex Christensen  <achristensen@webkit.org>
2695
2696         Add WKUIDelegatePrivate equivalent of WKPageContextMenuClient getContextMenuFromProposedMenuAsync
2697         https://bugs.webkit.org/show_bug.cgi?id=180955
2698
2699         Reviewed by Andy Estes.
2700
2701         * UIProcess/API/APIContextMenuClient.h:
2702         (API::ContextMenuClient::menuFromProposedMenu):
2703         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2704         * UIProcess/Cocoa/UIDelegate.h:
2705         * UIProcess/Cocoa/UIDelegate.mm:
2706         (WebKit::UIDelegate::setDelegate):
2707         (WebKit::UIDelegate::ContextMenuClient::menuFromProposedMenu):
2708         * UIProcess/mac/WebContextMenuProxyMac.mm:
2709         (WebKit::WebContextMenuProxyMac::showContextMenuWithItems):
2710
2711 2018-04-30  JF Bastien  <jfbastien@apple.com>
2712
2713         Use some C++17 features
2714         https://bugs.webkit.org/show_bug.cgi?id=185135
2715
2716         Reviewed by Alex Christensen.
2717
2718         As discussed here [0] let's move WebKit to a subset of C++17. We
2719         now require GCC 6 [1] which means that, according to [2] we can
2720         use the following C++17 language features (I removed some
2721         uninteresting ones):
2722
2723          - New auto rules for direct-list-initialization
2724          - static_assert with no message
2725          - typename in a template template parameter
2726          - Nested namespace definition
2727          - Attributes for namespaces and enumerators
2728          - u8 character literals
2729          - Allow constant evaluation for all non-type template arguments
2730          - Fold Expressions
2731          - Unary fold expressions and empty parameter packs
2732          - __has_include in preprocessor conditional
2733          - Differing begin and end types in range-based for
2734          - Improving std::pair and std::tuple
2735
2736         Consult the Tony Tables [3] to see before / after examples.
2737
2738         Of course we can use any library feature if we're willing to
2739         import them to WTF (and they don't require language support).
2740
2741
2742           [0]: https://lists.webkit.org/pipermail/webkit-dev/2018-March/029922.html
2743           [1]: https://trac.webkit.org/changeset/231152/webkit
2744           [2]: https://en.cppreference.com/w/cpp/compiler_support
2745           [3]: https://github.com/tvaneerd/cpp17_in_TTs/blob/master/ALL_IN_ONE.md
2746
2747         * Configurations/Base.xcconfig:
2748         * DerivedSources.make:
2749         * PlatformMac.cmake:
2750
2751 2018-04-30  Wenson Hsieh  <wenson_hsieh@apple.com>
2752
2753         [Extra zoom mode] Respect the existing shrink-to-fit attribute instead of using min-device-width
2754         https://bugs.webkit.org/show_bug.cgi?id=185132
2755         <rdar://problem/39834562>
2756
2757         Reviewed by Tim Horton.
2758
2759         Remove the experimental feature for `min-device-width`.
2760
2761         * Shared/WebPreferences.yaml:
2762
2763 2018-04-30  Keith Rollin  <krollin@apple.com>
2764
2765         Include breadcrumb for tracking resource loading into CFNetwork
2766         https://bugs.webkit.org/show_bug.cgi?id=184837
2767         rdar://problem/39575411
2768
2769         Reviewed by Brent Fulgham.
2770
2771         When starting the network-based loading of a resource, log the
2772         description provided by NetworkDataTask. On Cocoa, this is implemented
2773         to return the description property in NSURLSessionTask. This
2774         information better allows us to track a resource load through the
2775         WebContent process, the Networking process, and the Cocoa networking
2776         layers.
2777
2778         * NetworkProcess/NetworkDataTask.cpp:
2779         (WebKit::NetworkDataTask::description const):
2780         * NetworkProcess/NetworkDataTask.h:
2781         * NetworkProcess/NetworkLoad.cpp:
2782         (WebKit::NetworkLoad::description const):
2783         * NetworkProcess/NetworkLoad.h:
2784         * NetworkProcess/NetworkResourceLoader.cpp:
2785         (WebKit::NetworkResourceLoader::startNetworkLoad):
2786         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
2787         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2788         (WebKit::NetworkDataTaskCocoa::description const):
2789
2790 2018-04-30  Andy Estes  <aestes@apple.com>
2791
2792         [iOS] Try to unlock PDF documents before printing them
2793         https://bugs.webkit.org/show_bug.cgi?id=185084
2794         <rdar://problem/39356622>
2795
2796         Reviewed by Dan Bernstein.
2797
2798         * UIProcess/ios/WKPDFView.mm:
2799         (-[WKPDFView pdfHostViewController:documentDidUnlockWithPassword:]):
2800
2801         Stored the password that successfully unlocked the current PDF document.
2802
2803         (-[WKPDFView _wk_printedDocument]):
2804
2805         Used the stored password to unlock the CGPDFDocument we create for printing.
2806
2807 2018-04-28  Andy Estes  <aestes@apple.com>
2808
2809         [iOS] Present an action sheet when long-pressing on PDF links
2810         https://bugs.webkit.org/show_bug.cgi?id=185093
2811         <rdar://problem/39356651>
2812
2813         Reviewed by Dan Bernstein.
2814
2815         * UIProcess/ios/WKPDFView.mm:
2816         (-[WKPDFView dealloc]):
2817
2818         Called -[WKActionSheetAssistant cleanupSheet].
2819
2820         (-[WKPDFView web_setContentProviderData:suggestedFilename:]):
2821
2822         Created a WKActionSheetAssistant with the host view as the assistant view and
2823         ourselves as the delegate.
2824
2825         (-[WKPDFView _URLWithPageIndex:]):
2826
2827         Added. Creates a URL to the current page with a page number fragment appended.
2828
2829         (-[WKPDFView _goToURL:atLocation:]):
2830
2831         Added. Navigates to a URL with a synthetic mouse click at a location in host view
2832         coordinates.
2833
2834         (-[WKPDFView pdfHostViewController:goToURL:]):
2835         (-[WKPDFView pdfHostViewController:goToPageIndex:withViewFrustum:]):
2836
2837         Called -_goToURL:atLocation:. Used -_URLWithPageIndex: to construct an NSURL from
2838         a page index.
2839
2840         (-[WKPDFView _showActionSheetForURL:atLocation:]):
2841
2842         Added. Populates _positionInformation with a URL and location and calls
2843         -[WKActionSheetAssistant showLinkSheet].
2844
2845         (-[WKPDFView pdfHostViewController:didLongPressURL:atLocation:]):
2846         (-[WKPDFView pdfHostViewController:didLongPressPageIndex:atLocation:]):
2847
2848         Called -_showActionSheetForURL:atLocation:. Used -_URLWithPageIndex: to construct
2849         an NSURL from a page index.
2850
2851         (-[WKPDFView positionInformationForActionSheetAssistant:]):
2852
2853         Returned _positionInformation.
2854
2855         (-[WKPDFView actionSheetAssistant:performAction:]):
2856
2857         Populated the pasteboard with plain text and URL representations of
2858         _positionInformation.url.
2859
2860         (-[WKPDFView actionSheetAssistant:openElementAtLocation:]):
2861
2862         Called -_goToURL:atLocation.
2863
2864         (-[WKPDFView actionSheetAssistant:shareElementWithURL:rect:]):
2865
2866         Created a UIWKSelectionAssistant and called -showShareSheetFor:fromRect:.
2867
2868         (-[WKPDFView actionSheetAssistant:shouldIncludeAppLinkActionsForElement:]):
2869
2870         Returned API::UIClient::shouldIncludeAppLinkActionsForElement().
2871
2872         (-[WKPDFView actionSheetAssistant:decideActionsForElement:defaultActions:]):
2873
2874         Returned API::UIClient::actionsForElement()l
2875
2876 2018-04-28  Andy Estes  <aestes@apple.com>
2877
2878         [iOS] Allow com.apple.WebKit.Networking to look up com.apple.wifi.manager
2879         https://bugs.webkit.org/show_bug.cgi?id=185114
2880         <rdar://problem/39808763>
2881
2882         Reviewed by Wenson Hsieh.
2883
2884         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
2885
2886 2018-04-28  Brent Fulgham  <bfulgham@apple.com>
2887
2888         Revise sandboxes to allow additional IOKit property access
2889         https://bugs.webkit.org/show_bug.cgi?id=185095
2890         <rdar://problem/39809455>
2891
2892         Reviewed by Eric Carlson.
2893
2894         Update the WebContent and Plugin processes to allow additional IOKit property access.
2895
2896         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
2897         * WebProcess/com.apple.WebProcess.sb.in:
2898
2899 2018-04-28  Carlos Garcia Campos  <cgarcia@igalia.com>
2900
2901         [GTK] WebProcess from WebKitGtk+ 2.19.92 SIGSEVs in WebCore::TextureMapperGL::~TextureMapperGL
2902         https://bugs.webkit.org/show_bug.cgi?id=184040
2903
2904         Reviewed by Michael Catanzaro.
2905
2906         This can happen when using single shared process model or when the process limit is reached in multiple process
2907         model. In this case, all pages in the same web process with accelerated compositing enabled share the same
2908         compositing thread. Every page sets its GL context as current when rendering a frame, but not when invalidating
2909         the threaded compositor when the page is closed. So, if a hidden tab is closed, the threaded compositor is
2910         invalidated and the GL resources of the current context (the visible page) are destroyed. This is also causing
2911         the blank pages issue when closing a tab related to another one, the current one stops rendering anything because
2912         its GL context has been released. We should make the threaded compositor context current when invalidating it.
2913
2914         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
2915         (WebKit::ThreadedCompositor::invalidate):
2916
2917 2018-04-27  Timothy Hatcher  <timothy@apple.com>
2918
2919         REGRESSION: Touch events fail to dispatch to the page in all cases.
2920
2921         https://bugs.webkit.org/show_bug.cgi?id=185097
2922         rdar://problem/39731995
2923
2924         Reviewed by Tim Horton.
2925
2926         * UIProcess/ios/WKContentViewInteraction.mm:
2927         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
2928         Consult internal gesture recognizers, otherwise NO might get returned.
2929
2930 2018-04-26  Ryosuke Niwa  <rniwa@webkit.org>
2931
2932         PSON: Triggering a navigation to an invalid URL creates a new WebContent process
2933         https://bugs.webkit.org/show_bug.cgi?id=185066
2934
2935         Reviewed by Youenn Fablet.
2936
2937         Don't create a new WebContent process when the target URL is invalid as well as when the source URL is invalid.
2938
2939         * UIProcess/WebProcessPool.cpp:
2940         (WebKit::WebProcessPool::processForNavigationInternal):
2941
2942 2018-04-27  Youenn Fablet  <youenn@apple.com>
2943
2944         Use NetworkLoadChecker for XHR/fetch loads
2945         https://bugs.webkit.org/show_bug.cgi?id=184741
2946
2947         Reviewed by Chris Dumez.
2948
2949         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
2950         (WebKit::NetworkCORSPreflightChecker::didCompleteWithError):
2951         Pass the preflight error as completion error if any.
2952         * NetworkProcess/NetworkLoad.cpp:
2953         (WebKit::NetworkLoad::willPerformHTTPRedirection):
2954         Set response source to Network so that checks relying on that are correct.
2955         * NetworkProcess/NetworkLoadChecker.cpp:
2956         (WebKit::NetworkLoadChecker::validateResponse):
2957         Adding Oppaqueredirect tainting.
2958         (NetworkLoadChecker::doesNotNeedCORSCheck):
2959         Adding a check to only activate CORS checks for CORS enabled schemes.
2960         Non CORS enabled schemes loads should have failed in WebProcess already.
2961         (WebKit::NetworkLoadChecker::checkCORSRedirectedRequest):
2962         Remove Authorization header as done by SubresourceLoader.
2963         (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
2964         If error is cancellation, we still want to call the completion handler.
2965         * NetworkProcess/NetworkResourceLoader.cpp:
2966         Activate network load checker for all types of loads.
2967         (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
2968         Handle manual redirection by directly calling didReceiveResponse.
2969
2970 2018-04-27  Wenson Hsieh  <wenson_hsieh@apple.com>
2971
2972         Add an experimental feature flag for viewport "min-device-width"
2973         https://bugs.webkit.org/show_bug.cgi?id=185050
2974         <rdar://problem/39624038>
2975
2976         Reviewed by Tim Horton.
2977
2978         Add MinDeviceWidthEnabled as a new experimental feature, on by default in extra zoom mode and off elsewhere.
2979
2980         * Shared/WebPreferences.yaml:
2981         * Shared/WebPreferencesDefaultValues.h:
2982
2983 2018-04-27  Daniel Bates  <dabates@apple.com>
2984
2985         UIDelegate::UIClient::didResignInputElementStrongPasswordAppearance() is applicable to both Mac and iOS
2986         https://bugs.webkit.org/show_bug.cgi?id=185079
2987         <rdar://problem/39794960>
2988
2989         I inadvertently forgot to move the UIDelegate field webViewDidResignInputElementStrongPasswordAppearanceWithUserInfo
2990         outside the PLATFORM(MAC)-guard.
2991
2992         * UIProcess/Cocoa/UIDelegate.h:
2993
2994 2018-04-27  Daniel Bates  <dabates@apple.com>
2995
2996         UIDelegate::UIClient::didResignInputElementStrongPasswordAppearance() is applicable to both Mac and iOS
2997         https://bugs.webkit.org/show_bug.cgi?id=185079
2998         <rdar://problem/39794960>
2999
3000         Reviewed by Andy Estes.
3001
3002         * UIProcess/Cocoa/UIDelegate.h:
3003         * UIProcess/Cocoa/UIDelegate.mm:
3004         (WebKit::UIDelegate::setDelegate):
3005         (WebKit::UIDelegate::UIClient::didResignInputElementStrongPasswordAppearance):
3006
3007 2018-04-27  Wenson Hsieh  <wenson_hsieh@apple.com>
3008
3009         Rename minimumLayoutSize to viewLayoutSize
3010         https://bugs.webkit.org/show_bug.cgi?id=185050
3011         <rdar://problem/39624038>
3012
3013         Reviewed by Tim Horton.
3014
3015         Renames minimumLayoutSize to viewLayoutSize, since the minimum layout size in ViewportConfiguration is now
3016         different from the minimum layout size that is currently pushed down from the UI process (e.g. WKWebView SPI) in
3017         the case where `min-device-width` is used to override the minimum layout size.
3018
3019         * Shared/WebPageCreationParameters.cpp:
3020         (WebKit::WebPageCreationParameters::encode const):
3021         (WebKit::WebPageCreationParameters::decode):
3022         * Shared/WebPageCreationParameters.h:
3023         * UIProcess/API/Cocoa/WKWebView.mm:
3024         (-[WKWebView _processDidExit]):
3025         (-[WKWebView activeViewLayoutSize:]):
3026         (-[WKWebView _dispatchSetViewLayoutSize:]):
3027         (-[WKWebView _frameOrBoundsChanged]):
3028         (-[WKWebView _minimumLayoutSizeOverride]):
3029         (-[WKWebView _setViewLayoutSizeOverride:]):
3030         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
3031         (-[WKWebView _endAnimatedResize]):
3032         (-[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:maximumUnobscuredSizeOverride:]):
3033         (-[WKWebView _clearOverrideLayoutParameters]):
3034         (-[WKWebView _minimumLayoutWidth]):
3035         (-[WKWebView _setMinimumLayoutWidth:]):
3036         (-[WKWebView activeMinimumLayoutSize:]): Deleted.
3037         (-[WKWebView _dispatchSetMinimumLayoutSize:]): Deleted.
3038         (-[WKWebView _setMinimumLayoutSizeOverride:]): Deleted.
3039         (-[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:minimumLayoutSizeForMinimalUI:maximumUnobscuredSizeOverride:]): Deleted.
3040
3041         Remove unused SPI that has been deprecated since iOS 9, has a simple drop-in replacement, and no longer has any
3042         internal clients.
3043
3044         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3045         * UIProcess/Cocoa/WebViewImpl.mm:
3046         (WebKit::WebViewImpl::setMinimumSizeForAutoLayout):
3047         (WebKit::WebViewImpl::minimumSizeForAutoLayout const):
3048         (WebKit::WebViewImpl::setIntrinsicContentSize):
3049         * UIProcess/DrawingAreaProxy.h:
3050         (WebKit::DrawingAreaProxy::viewLayoutSizeDidChange):
3051         (WebKit::DrawingAreaProxy::minimumLayoutSizeDidChange): Deleted.
3052         * UIProcess/WebPageProxy.cpp:
3053         (WebKit::WebPageProxy::creationParameters):
3054         (WebKit::WebPageProxy::setViewLayoutSize):
3055         (WebKit::WebPageProxy::setMinimumLayoutSize): Deleted.
3056         * UIProcess/WebPageProxy.h:
3057         (WebKit::WebPageProxy::viewLayoutSize const):
3058         (WebKit::WebPageProxy::minimumLayoutSize const): Deleted.
3059         * UIProcess/ios/WebPageProxyIOS.mm:
3060         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
3061         (WebKit::WebPageProxy::setViewportConfigurationViewLayoutSize):
3062         (WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSize): Deleted.
3063         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
3064         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
3065         (WebKit::TiledCoreAnimationDrawingAreaProxy::viewLayoutSizeDidChange):
3066         (WebKit::TiledCoreAnimationDrawingAreaProxy::didUpdateGeometry):
3067         (WebKit::TiledCoreAnimationDrawingAreaProxy::intrinsicContentSizeDidChange):
3068         (WebKit::TiledCoreAnimationDrawingAreaProxy::willSendUpdateGeometry):
3069         (WebKit::TiledCoreAnimationDrawingAreaProxy::minimumLayoutSizeDidChange): Deleted.
3070         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3071         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
3072         * WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
3073         (WebKit::ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture):
3074         * WebProcess/WebPage/WebPage.cpp:
3075         (WebKit::m_credentialsMessenger):
3076         (WebKit::WebPage::setViewLayoutSize):
3077         (WebKit::WebPage::setMinimumLayoutSize): Deleted.
3078         * WebProcess/WebPage/WebPage.h:
3079         (WebKit::WebPage::viewLayoutSize const):
3080         (WebKit::WebPage::minimumLayoutSize const): Deleted.
3081         * WebProcess/WebPage/WebPage.messages.in:
3082         * WebProcess/WebPage/ios/WebPageIOS.mm:
3083         (WebKit::WebPage::setViewportConfigurationViewLayoutSize):
3084         (WebKit::WebPage::dynamicViewportSizeUpdate):
3085         (WebKit::WebPage::setViewportConfigurationMinimumLayoutSize): Deleted.
3086         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3087         (WebKit::TiledCoreAnimationDrawingArea::updateIntrinsicContentSizeIfNeeded):
3088         (WebKit::TiledCoreAnimationDrawingArea::updateGeometry):
3089
3090 2018-04-27  Wenson Hsieh  <wenson_hsieh@apple.com>
3091
3092         [Extra zoom mode] Add a mechanism to override default viewport behaviors in extra zoom mode
3093         https://bugs.webkit.org/show_bug.cgi?id=185050
3094         <rdar://problem/39624038>
3095
3096         Reviewed by Tim Horton.
3097
3098         Remove the forceHorizontalViewportShrinkToFit and minimumAllowedLayoutWidth SPI hooks from WebKit, and
3099         additionally remove all logic for plumbing viewSize to WebCore. See WebCore/ChangeLog for more information.
3100
3101         * Shared/VisibleContentRectUpdateInfo.cpp:
3102         (WebKit::VisibleContentRectUpdateInfo::encode const):
3103         (WebKit::VisibleContentRectUpdateInfo::decode):
3104         (WebKit::operator<<):
3105         * Shared/VisibleContentRectUpdateInfo.h:
3106         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
3107         (WebKit::VisibleContentRectUpdateInfo::allowShrinkToFit const):
3108         (WebKit::operator==):
3109         (WebKit::VisibleContentRectUpdateInfo::forceHorizontalShrinkToFit const): Deleted.
3110         * UIProcess/API/Cocoa/WKWebView.mm:
3111         (-[WKWebView _initializeWithConfiguration:]):
3112         (-[WKWebView activeMinimumLayoutSize:]):
3113         (-[WKWebView _dispatchSetMinimumLayoutSize:]):
3114         (-[WKWebView _frameOrBoundsChanged]):
3115         (-[WKWebView _setMinimumLayoutSizeOverride:]):
3116         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
3117         (-[WKWebView _endAnimatedResize]):
3118         (-[WKWebView _minimumAllowedLayoutWidth]): Deleted.
3119         (-[WKWebView _setMinimumAllowedLayoutWidth:]): Deleted.
3120         (-[WKWebView activeMinimumLayoutSizes:]): Deleted.
3121         (-[WKWebView _dispatchSetMinimumLayoutSize:viewSize:]): Deleted.
3122         (-[WKWebView _setForceHorizontalViewportShrinkToFit:]): Deleted.
3123         (-[WKWebView _forceHorizontalViewportShrinkToFit]): Deleted.
3124         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3125         * UIProcess/WebPageProxy.cpp:
3126         (WebKit::WebPageProxy::creationParameters):
3127         * UIProcess/WebPageProxy.h:
3128         * UIProcess/ios/WKContentView.mm:
3129         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
3130         * UIProcess/ios/WebPageProxyIOS.mm:
3131         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
3132         (WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSize):
3133         * WebProcess/WebPage/WebPage.cpp:
3134         (WebKit::m_credentialsMessenger):
3135         * WebProcess/WebPage/WebPage.h:
3136         * WebProcess/WebPage/WebPage.messages.in:
3137         * WebProcess/WebPage/ios/WebPageIOS.mm:
3138         (WebKit::WebPage::setViewportConfigurationMinimumLayoutSize):
3139         (WebKit::WebPage::dynamicViewportSizeUpdate):
3140         (WebKit::WebPage::updateVisibleContentRects):
3141
3142 2018-04-27  Carlos Garcia Campos  <cgarcia@igalia.com>
3143
3144         REGRESSION(r230812): [WPE][GTK] WebKitWebViewSessionState.cpp throws away encoded BackForwardList identifier
3145         https://bugs.webkit.org/show_bug.cgi?id=184823
3146
3147         Reviewed by Michael Catanzaro.
3148
3149         Bump session sate format version to 2 and stop encoding the backfoward list item identifier, since it's always
3150         regenerated.
3151
3152         * UIProcess/API/glib/WebKitWebViewSessionState.cpp:
3153         (encodeBackForwardListItemState): Always encode version 2.
3154         (encodeBackForwardListState): Ditto.
3155         (encodeSessionState): Ditto.
3156         (decodeBackForwardListItemStateV1): Decode list item state for version 1.
3157         (decodeBackForwardListItemState): Receive the version and call decodeBackForwardListItemStateV1() if it's 1 or
3158         use the version 2 otherwise.
3159         (decodeSessionState): Load data for known formats and use the one that worked to decode it.
3160
3161 2018-04-26  Megan Gardner  <megan_gardner@apple.com>
3162
3163         Add timeout for ensurePositionInformationIsUpToDate
3164         https://bugs.webkit.org/show_bug.cgi?id=184567
3165
3166         Reviewed by Wenson Hsieh.
3167         
3168         We are having long hang times for WebKit, and this is one of the culprits.
3169         If we do not get an answer for positionInformation in a reasonable amount of time, we should timeout,
3170         so as to not hang the UI.
3171
3172         * UIProcess/ios/WKContentViewInteraction.mm:
3173         (-[WKContentView ensurePositionInformationIsUpToDate:]):
3174
3175 2018-04-26  Andy Estes  <aestes@apple.com>
3176
3177         Try again to fix the iOS build after r231063.
3178
3179         * Configurations/Base.xcconfig:
3180
3181 2018-04-26  Jer Noble  <jer.noble@apple.com>
3182
3183         WK_COCOA_TOUCH the WK_ACCESSIBILITY_LDFLAGS
3184         https://bugs.webkit.org/show_bug.cgi?id=185007
3185         <rdar://problem/39735943>
3186
3187         Reviewed by Timothy Hatcher.
3188
3189         * Configurations/WebKit.xcconfig:
3190
3191 2018-04-26  Jer Noble  <jer.noble@apple.com>
3192
3193         Unreviewed build fix; fix iOS TAPI build step after r231063.
3194
3195         * Configurations/WebKit.xcconfig:
3196
3197 2018-04-26  Jer Noble  <jer.noble@apple.com>
3198
3199         WK_COCOA_TOUCH all the things.
3200         https://bugs.webkit.org/show_bug.cgi?id=185006
3201
3202         Reviewed by Tim Horton.
3203
3204         * Configurations/BaseTarget.xcconfig:
3205         * Configurations/WebKit.xcconfig:
3206
3207 2018-04-26  Daniel Bates  <dabates@apple.com>
3208
3209         Remove WebCore::-qualifier in NetworkLoadChecker.cpp
3210         https://bugs.webkit.org/show_bug.cgi?id=185037
3211
3212         Reviewed by Youenn Fablet.
3213
3214         It is unncesssary to qualify WebCore types in NetworkLoadChecker.cpp as it has a
3215         "using namespace WebCore" directive.
3216
3217         * NetworkProcess/NetworkLoadChecker.cpp:
3218         (WebKit::NetworkLoadChecker::NetworkLoadChecker):
3219         (WebKit::NetworkLoadChecker::checkRedirection):
3220         (WebKit::NetworkLoadChecker::validateResponse):
3221         (WebKit::NetworkLoadChecker::continueCheckingRequest): Removed extra space character and unnecessary
3222         parentheses from the right-hand side of the assignment to m_storedCredentialsPolicy.
3223         (WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad):
3224
3225 2018-04-26  Daniel Bates  <dabates@apple.com>
3226
3227         Rename NetworkLoadChecker::returnError() to NetworkLoadChecker::accessControlErrorForValidationHandler()
3228         https://bugs.webkit.org/show_bug.cgi?id=185035
3229
3230         Reviewed by Youenn Fablet.
3231
3232         Substitute NetworkLoadChecker::accessControlErrorForValidationHandler() for NetworkLoadChecker::returnError()
3233         to better describe that it is a convenience function that returns a wrapped ResourceError object,
3234         that represents an access control error, suitable to be passed directly to a validation handler.
3235
3236         * NetworkProcess/NetworkLoadChecker.cpp:
3237         (WebKit::NetworkLoadChecker::checkRedirection): Update as needed for renaming.
3238         (WebKit::NetworkLoadChecker::accessControlErrorForValidationHandler): Use auto -> syntax to avoid the need to
3239         class-qualify the return type. Also renamed parameter from error to message as it represents the message/description
3240         for the access control error.
3241         (WebKit::NetworkLoadChecker::checkRequest): Update as needed for renaming. Also substitute "message" for "error"
3242         to match the argument of accessControlErrorForValidationHandler() with the same name.
3243         (WebKit::NetworkLoadChecker::continueCheckingRequest): Update as needed for renaming.
3244         (WebKit::NetworkLoadChecker::returnError): Deleted; renamed to accessControlErrorForValidationHandler().
3245         * NetworkProcess/NetworkLoadChecker.h:
3246
3247 2018-04-26  Jiewen Tan  <jiewen_tan@apple.com>
3248
3249         Remove access to keychain from the WebContent process
3250         https://bugs.webkit.org/show_bug.cgi?id=184428
3251         <rdar://problem/13150903>
3252
3253         Part 3.
3254
3255         Tighten WebContent Process' sandbox profile to all Security.framework services.
3256
3257         Reviewed by Brent Fulgham.
3258
3259         * WebProcess/com.apple.WebProcess.sb.in:
3260
3261 2018-04-26  Youenn Fablet  <youenn@apple.com>
3262
3263         Make cross origin redirection error messages consistent between SubresourceLoader and NetworkLoadChecker
3264         https://bugs.webkit.org/show_bug.cgi?id=185023
3265
3266         Reviewed by Chris Dumez.
3267
3268         Align NetworkLoadChecker with what SubresourceLoader is doing so that we can keep WK1 and WK2 error messages as consistent as possible.
3269
3270         * NetworkProcess/NetworkLoadChecker.cpp:
3271         (WebKit::NetworkLoadChecker::checkRedirection):
3272         (WebKit::NetworkLoadChecker::validateResponse):
3273
3274 2018-04-25  Megan Gardner  <megan_gardner@apple.com>
3275
3276         Activate selection when interacting with editable content
3277         https://bugs.webkit.org/show_bug.cgi?id=185017
3278
3279         Reviewed by Tim Horton.
3280         
3281         Fixes a regression from r231016 where selection now does not work when interacting with
3282         editable content. When we go into editable content, we should turn on the assistant.
3283         This fulfills the requirement of user interaction as well, so any javascript selections
3284         after this point should be valid.
3285
3286         * UIProcess/ios/WKContentViewInteraction.mm:
3287         (-[WKContentView _startAssistingKeyboard]):
3288         (-[WKContentView _stopAssistingKeyboard]):
3289
3290 2018-04-26  Per Arne Vollan  <pvollan@apple.com>
3291
3292         Disable content filtering in minimal simulator mode
3293         https://bugs.webkit.org/show_bug.cgi?id=185027
3294         <rdar://problem/39736091>
3295
3296         Reviewed by Jer Noble.
3297
3298         * Configurations/FeatureDefines.xcconfig:
3299
3300 2018-04-26  Brady Eidson  <beidson@apple.com>
3301
3302         Add a setting for keeping around all processes and always reusing them per-origin.
3303         <rdar://problem/39695798> and https://bugs.webkit.org/show_bug.cgi?id=185020
3304
3305         Reviewed by Andy Estes.
3306
3307         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3308         (API::ProcessPoolConfiguration::copy):
3309         * UIProcess/API/APIProcessPoolConfiguration.h:
3310
3311         * UIProcess/API/C/WKContextConfigurationRef.cpp:
3312         (WKContextConfigurationAlwaysKeepAndReuseSwappedProcesses):
3313         (WKContextConfigurationSetAlwaysKeepAndReuseSwappedProcesses):
3314         * UIProcess/API/C/WKContextConfigurationRef.h:
3315
3316         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
3317         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
3318         (-[_WKProcessPoolConfiguration setAlwaysKeepAndReuseSwappedProcesses:]):
3319         (-[_WKProcessPoolConfiguration alwaysKeepAndReuseSwappedProcesses]):
3320
3321         * UIProcess/SuspendedPageProxy.cpp:
3322         (WebKit::SuspendedPageProxy::webProcessDidClose):
3323         (WebKit::SuspendedPageProxy::destroyWebPageInWebProcess):
3324         * UIProcess/SuspendedPageProxy.h:
3325
3326         * UIProcess/WebPageProxy.cpp:
3327         (WebKit::WebPageProxy::suspendedPageClosed):
3328         (WebKit::WebPageProxy::suspendedPageProcessClosed): Deleted.
3329         * UIProcess/WebPageProxy.h:
3330         (WebKit::WebPageProxy::suspendedPage const):
3331
3332         * UIProcess/WebProcessPool.cpp:
3333         (WebKit::WebProcessPool::shouldTerminate):
3334         (WebKit::WebProcessPool::disconnectProcess):
3335         (WebKit::WebProcessPool::addProcessToOriginCacheSet):
3336         (WebKit::WebProcessPool::removeProcessFromOriginCacheSet):
3337         (WebKit::WebProcessPool::processForNavigation): If a swap will occur, cache the old process.
3338         (WebKit::WebProcessPool::processForNavigationInternal): Consider re-using a previously cached process.
3339         * UIProcess/WebProcessPool.h:
3340
3341         * WebProcess/WebPage/WebPage.cpp:
3342         (WebKit::m_credentialsMessenger):
3343
3344 2018-04-26  Andy VanWagoner  <thetalecrafter@gmail.com>
3345
3346         [INTL] Implement Intl.PluralRules
3347         https://bugs.webkit.org/show_bug.cgi?id=184312
3348
3349         Reviewed by JF Bastien.
3350
3351         Added Intl.PluralRules feature flag.
3352
3353         * Configurations/FeatureDefines.xcconfig:
3354
3355 2018-04-26  Zan Dobersek  <zdobersek@igalia.com>
3356
3357         [GTK][WPE] Initial ASYNC_SCROLLING support
3358         https://bugs.webkit.org/show_bug.cgi?id=184961
3359
3360         Reviewed by Carlos Garcia Campos.
3361
3362         Guard RemoteScrollingCoordinator and RemoteScrollingCoordinatorProxy
3363         usage in WebChromeClient and WebPageProxy, respectively, with
3364         PLATFORM(COCOA) in addition to the ASYNC_SCROLLING guards.
3365
3366         Despite enabling the code at build-time, the feature (as intended) is
3367         not yet used because of the DrawingArea rejection in the WebPage
3368         constructor.
3369
3370         * UIProcess/WebPageProxy.cpp:
3371         (WebKit::WebPageProxy::initializeWebPage):
3372         (WebKit::WebPageProxy::handleWheelEvent):
3373         (WebKit::WebPageProxy::updateTouchEventTracking):
3374         * UIProcess/WebPageProxy.h:
3375         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3376         (WebKit::WebChromeClient::createScrollingCoordinator const):
3377
3378 2018-04-25  Michael Catanzaro  <mcatanzaro@igalia.com>
3379
3380         [WPE] Build and link against latest WPEBackend and WPEBackend-fdo
3381         https://bugs.webkit.org/show_bug.cgi?id=184643
3382
3383         Reviewed by Žan Doberšek.
3384
3385         Adapt to single-header WPE includes.
3386
3387         Null-initialize padding to silence -Wmissing-field-initializers. (Yuck.)
3388
3389         * Shared/NativeWebTouchEvent.h:
3390         * Shared/wpe/WebEventFactory.cpp:
3391         * UIProcess/API/glib/WebKitPrivate.cpp:
3392         * UIProcess/API/wpe/CompositingManagerProxy.cpp:
3393         * UIProcess/API/wpe/ScrollGestureController.h:
3394         * UIProcess/API/wpe/WPEView.cpp:
3395         (WKWPE::m_backend):
3396         * UIProcess/API/wpe/WebKitWebViewBackend.h:
3397         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
3398         * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp:
3399         (WebKit::AcceleratedSurfaceWPE::initialize):
3400
3401 2018-04-25  Saam Barati  <sbarati@apple.com>
3402
3403         dlopen the bundle's executable before calling -[NSBundle load] since that will also do a bunch of other things we don't need
3404         https://bugs.webkit.org/show_bug.cgi?id=184904
3405
3406         Reviewed by Geoffrey Garen.
3407
3408         Loading an NSBundle does a lot of work to find the principal class inside
3409         the bundle. This means it walks all the objective C class names loaded
3410         by the bundle. Doing this is *really* expensive.
3411         
3412         Some users of the injected bundle define a WKBundleInitialize function.
3413         In such a case, we don't need the principal class, so we can skip loading
3414         the NSBundle. Now, before we load the bundle, we dlopen and dlsym looking
3415         for the WKBundleInitialize function. If we find it, we skip loading
3416         the bundle. If we don't find the WKBundleInitialize function, we fall
3417         back to loading the bundle and finding the principal class.
3418         
3419         This speeds up initializeWebProcess by ~70ms on my MBP.
3420
3421         * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
3422         (WebKit::InjectedBundle::initialize):
3423
3424 2018-04-25  Youenn Fablet  <youenn@apple.com>
3425
3426         Use NetworkLoadChecker for all subresource loads except fetch/XHR
3427         https://bugs.webkit.org/show_bug.cgi?id=184870
3428         <rdar://problem/39370034>
3429
3430         Reviewed by Chris Dumez.
3431
3432         Relax rules to check for non HTTP(s) redirections to throw only when WebProcess says to load it after redirection.
3433         This allows WebProcess to load redirected non HTTP(s) URLs, such as data URLs.
3434         We keep these checks when WebProcess asks to continue the load and for all PingLoads.
3435
3436         Update error messages to be more consistent with WK1.
3437
3438         * NetworkProcess/NetworkLoadChecker.cpp:
3439         (WebKit::NetworkLoadChecker::checkRedirection):
3440         (WebKit::NetworkLoadChecker::continueCheckingRequest):
3441         (WebKit::NetworkLoadChecker::validateResourceResponse):
3442         (WebKit::NetworkLoadChecker::continueCheckingRequest):
3443         * NetworkProcess/NetworkLoadChecker.h:
3444         (WebKit::NetworkLoadChecker::validateResponse):
3445         * NetworkProcess/NetworkResourceLoader.cpp:
3446         (WebKit::shouldUseNetworkLoadChecker):
3447         (WebKit::NetworkResourceLoader::continueWillSendRequest):
3448
3449 2018-04-25  Ryosuke Niwa  <rniwa@webkit.org>
3450
3451         PSON: Don't create a new process when navigating to a blob URL, data URL, and about:blank
3452         https://bugs.webkit.org/show_bug.cgi?id=184962
3453
3454         Reviewed by Youenn Fablet.
3455         <rdar://problem/39715044>
3456
3457         Build fix. Revert the change in r231019 to remove the empty URL and about:blank check here.
3458         These checks are for the source / originating URL, not the target URL.
3459
3460         * UIProcess/WebProcessPool.cpp:
3461         (WebKit::WebProcessPool::processForNavigation):
3462
3463 2018-04-25  Youenn Fablet  <youenn@apple.com>
3464
3465         WebLoaderStrategy::networkMetricsFromResourceLoadIdentifier should use DoNotProcessIncomingMessagesWhenWaitingForSyncReply
3466         https://bugs.webkit.org/show_bug.cgi?id=184978
3467         <rdar://problem/39667094>
3468
3469         Reviewed by Simon Fraser.
3470
3471         Use DoNotProcessIncomingMessagesWhenWaitingForSyncReply to keep a consistent state after the sync IPC call.
3472
3473         * WebProcess/Network/WebLoaderStrategy.cpp:
3474         (WebKit::WebLoaderStrategy::responseFromResourceLoadIdentifier):
3475         (WebKit::WebLoaderStrategy::networkMetricsFromResourceLoadIdentifier):
3476
3477 2018-04-25  Jiewen Tan  <jiewen_tan@apple.com>
3478
3479         Remove access to keychain from the WebContent process
3480         https://bugs.webkit.org/show_bug.cgi?id=184428
3481         <rdar://problem/13150903>
3482
3483         Reviewed by Brent Fulgham.
3484
3485         This patch does the followings:
3486         1. Added necessary support to move HTMLKeygenElement's operation from WebContent Process to UI Process.
3487         2. Craft new SPI copySignedPublicKeyAndChallengeString to supply HTMLKeygenElement with dummy data such
3488         that WebKitTestRunner tests will not modify the underlying key store (e.g., the macOS Keychain).
3489
3490         * UIProcess/API/APINavigationClient.h:
3491         (API::NavigationClient::signedPublicKeyAndChallengeString):
3492         * UIProcess/API/C/WKPage.cpp:
3493         (WKPageSetPageNavigationClient):
3494         * UIProcess/API/C/WKPageNavigationClient.h:
3495         * UIProcess/Cocoa/NavigationState.h:
3496         * UIProcess/Cocoa/NavigationState.mm:
3497         (WebKit::NavigationState::NavigationClient::signedPublicKeyAndChallengeString):
3498         * UIProcess/WebPageProxy.cpp:
3499         (WebKit::WebPageProxy::signedPublicKeyAndChallengeString):
3500         * UIProcess/WebPageProxy.h:
3501         * UIProcess/WebPageProxy.messages.in:
3502         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3503         (WebKit::WebChromeClient::signedPublicKeyAndChallengeString const):
3504         * WebProcess/WebCoreSupport/WebChromeClient.h:
3505
3506 2018-04-25  Wenson Hsieh  <wenson_hsieh@apple.com>
3507
3508         [Extra zoom mode] The search field on www.bing.com is missing label text
3509         https://bugs.webkit.org/show_bug.cgi?id=184975
3510         <rdar://problem/39723081>
3511
3512         Reviewed by Tim Horton.
3513
3514         Adds support for displaying the "aria-label" attribute as the input view's label text in extra zoom mode. Also
3515         adds support for grabbing the input label's text for testing.
3516
3517         Test: fast/forms/extrazoom/form-control-label-text.html
3518
3519         * Shared/AssistedNodeInformation.cpp:
3520         (WebKit::AssistedNodeInformation::encode const):
3521         (WebKit::AssistedNodeInformation::decode):
3522         * Shared/AssistedNodeInformation.h:
3523         * UIProcess/API/Cocoa/WKWebView.mm:
3524         (-[WKWebView formInputLabel]):
3525         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3526         * UIProcess/ios/WKContentViewInteraction.h:
3527         * UIProcess/ios/WKContentViewInteraction.mm:
3528         (-[WKContentView formInputLabel]):
3529         * WebProcess/WebPage/ios/WebPageIOS.mm:
3530         (WebKit::WebPage::getAssistedNodeInformation):
3531
3532 2018-04-25  Ryosuke Niwa  <rniwa@webkit.org>
3533
3534         PSON: Don't create a new process when navigating to a blob URL, data URL, and about:blank
3535         https://bugs.webkit.org/show_bug.cgi?id=184962
3536
3537         Reviewed by Youenn Fablet.
3538
3539         Don't create a new WebContent process when navigating to a blob object URL since doing so
3540         can result in a race condition in which the blog URL is removed from the blob registry of
3541         the network process by the time the navigation gets commited. This causes a failure in
3542         fast/dom/HTMLAnchorElement/anchor-download-unset.html and oher layout tests.
3543
3544         In the future, the network process should verify that a given WebContent process has access
3545         to a given blob URL. For now, we rely on WebContent process to tell us whether it can
3546         navigate to a given blob URL or not.
3547
3548         * Shared/NavigationActionData.cpp:
3549         (WebKit::NavigationActionData::encode const): Encode newly added treatAsSameOriginNavigation.
3550         (WebKit::NavigationActionData::decode): Ditto for decoding.
3551         * Shared/NavigationActionData.h:
3552         (WebKit::NavigationActionData::treatAsSameOriginNavigation): Added.
3553         * UIProcess/API/APINavigation.h:
3554         (API::Navigation::setTreatAsSameOriginNavigation): Added.
3555         (API::Navigation::treatAsSameOriginNavigation const): Added.
3556         * UIProcess/API/APIProcessPoolConfiguration.h:
3557         * UIProcess/WebPageProxy.cpp:
3558         (WebKit::WebPageProxy::decidePolicyForNavigationAction): Use the current process when
3559         treatAsSameOriginNavigation is set to true; i.e. when navigating to a blob URL the current
3560         document has access.
3561         * UIProcess/WebProcessPool.cpp:
3562         (WebKit::WebProcessPool::processForNavigation):
3563         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3564         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
3565
3566 2018-04-25  Megan Gardner  <megan_gardner@apple.com>
3567
3568         Don't activate Selection Assistant unless it is actually needed.
3569         https://bugs.webkit.org/show_bug.cgi?id=184944
3570         <rdar://problem/39469671>
3571
3572         Reviewed by Tim Horton.
3573         
3574         Don't activate the selection unless we need to. Activating on init is overeager and allowing Javascript to 
3575         activate selections without user input.
3576
3577         * UIProcess/ios/WKContentViewInteraction.mm:
3578         (-[WKContentView useSelectionAssistantWithGranularity:]):
3579
3580 2018-04-25  Wenson Hsieh  <wenson_hsieh@apple.com>
3581
3582         Fix entitlements and sandbox configurations in WebKit after r230778
3583         https://bugs.webkit.org/show_bug.cgi?id=184960
3584         <rdar://problem/39662827>
3585
3586         Reviewed by Tim Horton.
3587
3588         Build fixes for watchOS and tvOS after r230778.
3589
3590         * Configurations/BaseXPCService.xcconfig:
3591         * Configurations/NetworkService.xcconfig:
3592         * Configurations/WebContentService.xcconfig:
3593
3594 2018-04-25  Brent Fulgham  <bfulgham@apple.com>
3595
3596         Unreviewed build fix after r231008.
3597
3598         * NetworkProcess/NetworkDataTask.cpp:
3599         (WebKit::NetworkDataTask::create): Forgot to remove an unneeded constructor argument.
3600
3601 2018-04-25  Brent Fulgham  <bfulgham@apple.com>
3602
3603         Don't Block First Party Cookies on Redirects
3604         https://bugs.webkit.org/show_bug.cgi?id=184948
3605         <rdar://problem/39534099>
3606
3607         Reviewed by Youenn Fablet.
3608
3609         Top-level navigations should not be subject to cookie blocking behavior. When performing redirects for main frame
3610         navigation we are blocking cookies, leading to site breakage.
3611         
3612         We need to keep track of which NetworkDataTasks are due to a main frame navigation. When a redirect is performed
3613         on the main frame, we should treat the new origin as the 'first party for cookies' and avoid blocking cookies for
3614         that URL.
3615
3616         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3617         (WebKit::NetworkConnectionToWebProcess::preconnectTo): Use the correct parameter type. We actually serialize
3618         NetworkResourceLoadParameters over IPC, so we should get access to all the members of this child class.
3619         * NetworkProcess/NetworkConnectionToWebProcess.h:
3620         * NetworkProcess/NetworkDataTask.cpp:
3621         (WebKit::NetworkDataTask::create): Pass new 'loadIsForNavigation' flag to create methods. 
3622         (WebKit::NetworkDataTask::NetworkDataTask): Capture 'loadIsForNavigation' in constructor.
3623         * NetworkProcess/NetworkDataTask.h:
3624         (WebKit::NetworkDataTask::isTopLevelNavigation const): Added.
3625         * NetworkProcess/NetworkDataTaskBlob.cpp:
3626         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob): Accept new constructor argument.
3627         * NetworkProcess/NetworkDataTaskBlob.h:
3628         * NetworkProcess/NetworkLoad.cpp:
3629         (WebKit::NetworkLoad::willPerformHTTPRedirection): Retain requester value from old request during redirect.
3630         * NetworkProcess/NetworkResourceLoadParameters.cpp:
3631         (NetworkResourceLoadParameters::decode): Update to pass new flag.
3632         (NetworkResourceLoadParameters::encode): Ditto.
3633         * NetworkProcess/NetworkLoadParameters.h:
3634         * NetworkProcess/capture/NetworkDataTaskReplay.cpp:
3635         (WebKit::NetworkCapture::NetworkDataTaskReplay::NetworkDataTaskReplay): Accept new constructor argument.
3636         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
3637         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3638         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): Accept new constructor argument.
3639         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
3640         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
3641         (WebKit::NetworkDataTaskCurl::NetworkDataTaskCurl): Accept new constructor argument.
3642         * NetworkProcess/curl/NetworkDataTaskCurl.h:
3643         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
3644         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup): Accept new constructor argument.
3645         * NetworkProcess/soup/NetworkDataTaskSoup.h:
3646
3647 2018-04-25  Youenn Fablet  <youenn@apple.com>
3648
3649         Ensure DNT is set for redirections handled in NetworkProcess
3650         https://bugs.webkit.org/show_bug.cgi?id=184890
3651
3652         Reviewed by Ryosuke Niwa.
3653
3654         Compute whether DNT header should be set on requests based on:
3655         - request has a DNT header
3656         - session is ephemeral (aka private browsing mode)
3657         In both cases, we ensure a DNT header is added for any request triggered by a redirection.
3658
3659         Covered by http/wpt/fetch/dnt-header-after-redirection.html.
3660
3661         * NetworkProcess/NetworkLoadChecker.cpp:
3662         (WebKit::NetworkLoadChecker::check):
3663         (WebKit::NetworkLoadChecker::prepareRedirectedRequest):
3664         * NetworkProcess/NetworkLoadChecker.h:
3665         * NetworkProcess/NetworkResourceLoader.cpp:
3666         (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
3667         (WebKit::NetworkResourceLoader::continueWillSendRequest):
3668         * NetworkProcess/PingLoad.cpp:
3669         (WebKit::PingLoad::willPerformHTTPRedirection):
3670         * WebProcess/Network/WebLoaderStrategy.cpp:
3671         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
3672
3673 2018-04-25  Michael Catanzaro  <mcatanzaro@igalia.com>
3674
3675         [WPE] Remove deprecated functions and properties from the API
3676         https://bugs.webkit.org/show_bug.cgi?id=179295
3677
3678         Reviewed by Žan Doberšek.
3679
3680         * UIProcess/API/glib/WebKitCookieManager.cpp:
3681         * UIProcess/API/glib/WebKitFormSubmissionRequest.cpp:
3682         * UIProcess/API/glib/WebKitNavigationPolicyDecision.cpp:
3683         (webkitNavigationPolicyDecisionGetProperty):
3684         (webkit_navigation_policy_decision_class_init):
3685         * UIProcess/API/glib/WebKitSettings.cpp:
3686         (webKitSettingsSetProperty):
3687         (webKitSettingsGetProperty):
3688         (webkit_settings_class_init):
3689         * UIProcess/API/glib/WebKitWebContext.cpp:
3690         (webkitWebContextGetProperty):
3691         (webkitWebContextSetProperty):
3692         (webkit_web_context_class_init):
3693         * UIProcess/API/glib/WebKitWebView.cpp:
3694         (webkit_web_view_class_init):
3695         (webkitWebViewHandleAuthenticationChallenge):
3696         (webkitWebViewWebProcessTerminated):
3697         * UIProcess/API/wpe/WebKitCookieManager.h:
3698         * UIProcess/API/wpe/WebKitFormSubmissionRequest.h:
3699         * UIProcess/API/wpe/WebKitNavigationPolicyDecision.h:
3700         * UIProcess/API/wpe/WebKitSettings.h:
3701         * UIProcess/API/wpe/WebKitWebContext.h:
3702
3703 2018-04-25  Michael Catanzaro  <mcatanzaro@igalia.com>
3704
3705         Unreviewed, silence -Wreturn-type warning
3706         https://bugs.webkit.org/show_bug.cgi?id=184560
3707
3708         * NetworkProcess/NetworkResourceLoader.cpp:
3709         (WebKit::shouldCancelCrossOriginLoad):
3710
3711 2018-04-25  Michael Catanzaro  <mcatanzaro@igalia.com>
3712
3713         [GTK] Miscellaneous build cleanups
3714         https://bugs.webkit.org/show_bug.cgi?id=184399
3715
3716         Reviewed by Žan Doberšek.
3717
3718         * PlatformGTK.cmake:
3719
3720 2018-04-25  Dean Jackson  <dino@apple.com>
3721
3722         Make a better flag for system preview, and disable it where necessary
3723         https://bugs.webkit.org/show_bug.cgi?id=184968
3724         <rdar://problem/39686506>
3725
3726         Reviewed by Eric Carlson.
3727
3728         Use USE(SYSTEM_PREVIEW).
3729
3730         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
3731         * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
3732         (-[WKWebViewContentProviderRegistry init]):
3733         * UIProcess/ios/WKSystemPreviewView.mm:
3734
3735 2018-04-25  Carlos Garcia Campos  <cgarcia@igalia.com>
3736
3737         [GTK] Implement MouseEvent.buttons
3738         https://bugs.webkit.org/show_bug.cgi?id=184913
3739
3740         Reviewed by Žan Doberšek.
3741
3742         It's currently returning always 0.
3743
3744         * Shared/gtk/WebEventFactory.cpp:
3745         (WebKit::pressedMouseButtons): Helper function to get the pressed mouse buttons.
3746         (WebKit::WebEventFactory::createWebMouseEvent): Pass presssed mouse buttons to constructor instead of 0.
3747         * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
3748         (WebKit::WebAutomationSession::platformSimulateMouseInteraction): Include the mouse buttons state in automation
3749         synthesized events and update m_currentModifiers with the mouse buttons state.
3750         (WebKit::keyCodeForVirtualKey): Do not set the state here.
3751         (WebKit::modifiersForKeyCode): Helper to get the modifiers for a key code.
3752         (WebKit::WebAutomationSession::platformSimulateKeyboardInteraction): Initialize the modifiers also when
3753         virtualKey is std::nullopt;
3754
3755 2018-04-24  Nan Wang  <n_wang@apple.com>
3756
3757         AX: soft link libAccessibility.dylb
3758         https://bugs.webkit.org/show_bug.cgi?id=184919
3759
3760         Reviewed by Dan Bernstein.
3761
3762         Weakly linked libAccessibility.dylib on macOS.
3763
3764         * Configurations/WebKit.xcconfig:
3765         * UIProcess/API/Cocoa/WKWebView.mm:
3766         (-[WKWebView _initializeWithConfiguration:]):
3767         (-[WKWebView _updateAccessibilityEventsEnabled]):
3768
3769 2018-04-24  Fujii Hironori  <Hironori.Fujii@sony.com>
3770
3771         [WinCairo] Add WKView and WKAPI
3772         https://bugs.webkit.org/show_bug.cgi?id=182869
3773
3774         Reviewed by Alex Christensen.
3775
3776         Resurrected source files for WebKit for Windows port which was
3777         removed in r139003.
3778
3779         * PlatformWin.cmake: Renamed the output name of WebKit to WebKit2
3780         not to conflict WebKitLegacy. Added source files and include paths.
3781         * UIProcess/API/C/WKAPICast.h:
3782         * UIProcess/API/C/win/WKAPICastWin.h: Added.
3783         * UIProcess/API/C/win/WKView.cpp: Added.
3784         (WKViewCreate):
3785         (WKViewGetWindow):
3786         (WKViewGetPage):
3787         (WKViewSetParentWindow):
3788         (WKViewWindowAncestryDidChange):
3789         (WKViewSetIsInWindow):
3790         (WKViewSetScrollOffsetOnNextResize):
3791         * UIProcess/API/C/win/WKView.h: Added.
3792         * UIProcess/API/win/APIWebsiteDataStoreWin.cpp: Added.
3793         (API::WebsiteDataStore::defaultApplicationCacheDirectory):
3794         (API::WebsiteDataStore::defaultCacheStorageDirectory):
3795         (API::WebsiteDataStore::defaultNetworkCacheDirectory):
3796         (API::WebsiteDataStore::defaultIndexedDBDatabaseDirectory):
3797         (API::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory):
3798         (API::WebsiteDataStore::defaultLocalStorageDirectory):
3799         (API::WebsiteDataStore::defaultMediaKeysStorageDirectory):
3800         (API::WebsiteDataStore::defaultWebSQLDatabaseDirectory):
3801         (API::WebsiteDataStore::defaultResourceLoadStatisticsDirectory):
3802         (API::WebsiteDataStore::cacheDirectoryFileSystemRepresentation):
3803         (API::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation):
3804         (API::WebsiteDataStore::defaultDataStoreConfiguration):
3805         * UIProcess/Launcher/ProcessLauncher.h:
3806         * UIProcess/Launcher/win/ProcessLauncherWin.cpp: Added.
3807         (WebKit::processName):
3808         (WebKit::ProcessLauncher::launchProcess):
3809         (WebKit::ProcessLauncher::terminateProcess):
3810         (WebKit::ProcessLauncher::platformInvalidate):
3811         * UIProcess/Network/NetworkProcessProxy.cpp:
3812         (WebKit::NetworkProcessProxy::networkProcessFailedToLaunch):
3813         (WebKit::NetworkProcessProxy::didCreateNetworkConnectionToWebProcess):
3814         * UIProcess/WebsiteData/win/WebsiteDataStoreWin.cpp: Added.
3815         (WebKit::WebsiteDataStore::platformInitialize):
3816         (WebKit::WebsiteDataStore::platformDestroy):
3817         (WebKit::WebsiteDataStore::platformRemoveRecentSearches):
3818         * UIProcess/win/PageClientImpl.cpp: Added.
3819         (WebKit::PageClientImpl::PageClientImpl):
3820         (WebKit::PageClientImpl::createDrawingAreaProxy):
3821         (WebKit::PageClientImpl::setViewNeedsDisplay):
3822         (WebKit::PageClientImpl::requestScroll):
3823         (WebKit::PageClientImpl::viewScrollPosition):
3824         (WebKit::PageClientImpl::viewSize):
3825         (WebKit::PageClientImpl::isViewWindowActive):
3826         (WebKit::PageClientImpl::isViewFocused):
3827         (WebKit::PageClientImpl::isViewVisible):
3828         (WebKit::PageClientImpl::isViewInWindow):
3829         (WebKit::PageClientImpl::PageClientImpl::processDidExit):
3830         (WebKit::PageClientImpl::didRelaunchProcess):
3831         (WebKit::PageClientImpl::toolTipChanged):
3832         (WebKit::PageClientImpl::setCursor):
3833         (WebKit::PageClientImpl::setCursorHiddenUntilMouseMoves):
3834         (WebKit::PageClientImpl::didChangeViewportProperties):
3835         (WebKit::PageClientImpl::registerEditCommand):
3836         (WebKit::PageClientImpl::clearAllEditCommands):
3837         (WebKit::PageClientImpl::canUndoRedo):
3838         (WebKit::PageClientImpl::executeUndoRedo):
3839         (WebKit::PageClientImpl::convertToDeviceSpace):
3840         (WebKit::PageClientImpl::convertToUserSpace):
3841         (WebKit::PageClientImpl::screenToRootView):
3842         (WebKit::PageClientImpl::rootViewToScreen):
3843         (WebKit::PageClientImpl::doneWithKeyEvent):
3844         (WebKit::PageClientImpl::createPopupMenuProxy):
3845         (WebKit::PageClientImpl::createContextMenuProxy):
3846         (WebKit::createColorPicker):
3847         (WebKit::PageClientImpl::enterAcceleratedCompositingMode):
3848         (WebKit::PageClientImpl::exitAcceleratedCompositingMode):
3849         (WebKit::PageClientImpl::updateAcceleratedCompositingMode):
3850         (WebKit::PageClientImpl::pageClosed):
3851         (WebKit::PageClientImpl::preferencesDidChange):
3852         (WebKit::PageClientImpl::didChangeContentSize):
3853         (WebKit::PageClientImpl::handleDownloadRequest):
3854         (WebKit::PageClientImpl::didCommitLoadForMainFrame):
3855         (WebKit::PageClientImpl::fullScreenManagerProxyClient):
3856         (WebKit::PageClientImpl::closeFullScreenManager):
3857         (WebKit::PageClientImpl::isFullScreen):
3858         (WebKit::PageClientImpl::enterFullScreen):
3859         (WebKit::PageClientImpl::exitFullScreen):
3860         (WebKit::PageClientImpl::beganEnterFullScreen):
3861         (WebKit::PageClientImpl::beganExitFullScreen):
3862         (WebKit::PageClientImpl::doneWithTouchEvent):
3863         (WebKit::PageClientImpl::wheelEventWasNotHandledByWebCore):
3864         (WebKit::PageClientImpl::didFinishLoadingDataForCustomContentProvider):
3865         (WebKit::PageClientImpl::navigationGestureDidBegin):
3866         (WebKit::PageClientImpl::navigationGestureWillEnd):
3867         (WebKit::PageClientImpl::navigationGestureDidEnd):
3868         (WebKit::PageClientImpl::willRecordNavigationSnapshot):
3869         (WebKit::PageClientImpl::didRemoveNavigationGestureSnapshot):
3870         (WebKit::PageClientImpl::didFirstVisuallyNonEmptyLayoutForMainFrame):
3871         (WebKit::PageClientImpl::didFinishLoadForMainFrame):
3872         (WebKit::PageClientImpl::didSameDocumentNavigationForMainFrame):
3873         (WebKit::PageClientImpl::didChangeBackgroundColor):
3874         (WebKit::PageClientImpl::isPlayingAudioWillChange):
3875         (WebKit::PageClientImpl::isPlayingAudioDidChange):
3876         (WebKit::PageClientImpl::refView):
3877         (WebKit::PageClientImpl::derefView):
3878         * UIProcess/win/PageClientImpl.h: Added.
3879         * UIProcess/win/TextCheckerWin.cpp: Added.
3880         (WebKit::checkerState):
3881         (WebKit::TextChecker::state):
3882         (WebKit::TextChecker::setTestingMode):
3883         (WebKit::TextChecker::isTestingMode):
3884         (WebKit::TextChecker::isContinuousSpellCheckingAllowed):
3885         (WebKit::TextChecker::setContinuousSpellCheckingEnabled):
3886         (WebKit::TextChecker::setGrammarCheckingEnabled):
3887         (WebKit::TextChecker::continuousSpellCheckingEnabledStateChanged):
3888         (WebKit::TextChecker::grammarCheckingEnabledStateChanged):
3889         (WebKit::TextChecker::uniqueSpellDocumentTag):
3890         (WebKit::TextChecker::closeSpellDocumentWithTag):
3891         (WebKit::TextChecker::checkSpellingOfString):
3892         (WebKit::TextChecker::checkGrammarOfString):
3893         (WebKit::TextChecker::spellingUIIsShowing):
3894         (WebKit::TextChecker::toggleSpellingUIIsShowing):
3895         (WebKit::TextChecker::updateSpellingUIWithMisspelledWord):
3896         (WebKit::TextChecker::updateSpellingUIWithGrammarString):
3897         (WebKit::TextChecker::getGuessesForWord):
3898         (WebKit::TextChecker::learnWord):
3899         (WebKit::TextChecker::ignoreWord):
3900         (WebKit::TextChecker::requestCheckingOfString):
3901         (WebKit::TextChecker::checkTextOfParagraph):
3902         * UIProcess/win/WebContextMenuProxyWin.cpp: Added.
3903         (WebKit::WebContextMenuProxyWin::show):
3904         (WebKit::WebContextMenuProxyWin::showContextMenuWithItems):
3905         (WebKit::WebContextMenuProxyWin::WebContextMenuProxyWin):
3906         (WebKit::WebContextMenuProxyWin::~WebContextMenuProxyWin):
3907         * UIProcess/win/WebContextMenuProxyWin.h: Added.
3908         (WebKit::WebContextMenuProxyWin::create):
3909         * UIProcess/win/WebInspectorProxyWin.cpp: Added.
3910         (WebKit::WebInspectorProxy::platformCreateFrontendPage):
3911         (WebKit::WebInspectorProxy::platformCreateFrontendWindow):
3912         (WebKit::WebInspectorProxy::platformCloseFrontendPageAndWindow):
3913         (WebKit::WebInspectorProxy::platformDidCloseForCrash):
3914         (WebKit::WebInspectorProxy::platformInvalidate):
3915         (WebKit::WebInspectorProxy::platformHide):
3916         (WebKit::WebInspectorProxy::platformBringToFront):
3917         (WebKit::WebInspectorProxy::platformBringInspectedPageToFront):
3918         (WebKit::WebInspectorProxy::platformIsFront):
3919         (WebKit::WebInspectorProxy::platformInspectedURLChanged):
3920         (WebKit::WebInspectorProxy::inspectorPageURL):
3921         (WebKit::WebInspectorProxy::inspectorTestPageURL):
3922         (WebKit::WebInspectorProxy::inspectorBaseURL):
3923         (WebKit::WebInspectorProxy::platformInspectedWindowHeight):
3924         (WebKit::WebInspectorProxy::platformInspectedWindowWidth):
3925         (WebKit::WebInspectorProxy::platformAttach):
3926         (WebKit::WebInspectorProxy::platformDetach):
3927         (WebKit::WebInspectorProxy::platformSetAttachedWindowHeight):
3928         (WebKit::WebInspectorProxy::platformSetAttachedWindowWidth):
3929         (WebKit::WebInspectorProxy::platformStartWindowDrag):
3930         (WebKit::WebInspectorProxy::platformSave):
3931         (WebKit::WebInspectorProxy::platformAppend):
3932         (WebKit::WebInspectorProxy::platformAttachAvailabilityChanged):
3933         * UIProcess/win/WebPageProxyWin.cpp: Added.
3934         (WebKit::WebPageProxy::platformInitialize):
3935         (WebKit::WebPageProxy::standardUserAgent):
3936         (WebKit::WebPageProxy::saveRecentSearches):
3937         (WebKit::WebPageProxy::loadRecentSearches):
3938         (WebKit::WebPageProxy::editorStateChanged):
3939         * UIProcess/win/WebPreferencesWin.cpp: Added.
3940         (WebKit::WebPreferences::platformInitializeStore):
3941         (WebKit::WebPreferences::platformUpdateStringValueForKey):
3942         (WebKit::WebPreferences::platformUpdateBoolValueForKey):
3943         (WebKit::WebPreferences::platformUpdateUInt32ValueForKey):
3944         (WebKit::WebPreferences::platformUpdateDoubleValueForKey):
3945         (WebKit::WebPreferences::platformUpdateFloatValueForKey):
3946         (WebKit::WebPreferences::platformGetStringUserValueForKey):
3947         (WebKit::WebPreferences::platformGetBoolUserValueForKey):
3948         (WebKit::WebPreferences::platformGetUInt32UserValueForKey):
3949         (WebKit::WebPreferences::platformGetDoubleUserValueForKey):
3950         * UIProcess/win/WebProcessPoolWin.cpp: Added.
3951         (WebKit::WebProcessPool::platformInitialize):
3952         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
3953         (WebKit::WebProcessPool::platformInitializeWebProcess):
3954         (WebKit::WebProcessPool::platformInvalidateContext):
3955         (WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory):
3956         (WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory):
3957         (WebKit::WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory):
3958         (WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory):
3959         (WebKit::WebProcessPool::legacyPlatformDefaultLocalStorageDirectory):
3960         (WebKit::WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory):
3961         (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
3962         (WebKit::WebProcessPool::legacyPlatformDefaultJavaScriptConfigurationDirectory):
3963         (WebKit::WebProcessPool::platformResolvePathsForSandboxExtensions):
3964         * UIProcess/win/WebView.cpp: Added.
3965         (WebKit::WebView::WebViewWndProc):
3966         (WebKit::WebView::wndProc):
3967         (WebKit::WebView::registerWebViewWindowClass):
3968         (WebKit::WebView::WebView):
3969         (WebKit::WebView::~WebView):
3970         (WebKit::WebView::initialize):
3971         (WebKit::WebView::setParentWindow):
3972         (WebKit::findTopLevelParentWindow):
3973         (WebKit::WebView::windowAncestryDidChange):
3974         (WebKit::WebView::onMouseEvent):
3975         (WebKit::WebView::onWheelEvent):
3976         (WebKit::WebView::onHorizontalScroll):
3977         (WebKit::WebView::onVerticalScroll):
3978         (WebKit::WebView::onKeyEvent):
3979         (WebKit::drawPageBackground):
3980         (WebKit::WebView::paint):
3981         (WebKit::WebView::onPaintEvent):
3982         (WebKit::WebView::onPrintClientEvent):
3983         (WebKit::WebView::onSizeEvent):
3984         (WebKit::WebView::onWindowPositionChangedEvent):
3985         (WebKit::WebView::onSetFocusEvent):
3986         (WebKit::WebView::onKillFocusEvent):
3987         (WebKit::WebView::onTimerEvent):
3988         (WebKit::WebView::onShowWindowEvent):
3989         (WebKit::WebView::onSetCursor):
3990         (WebKit::WebView::updateActiveState):
3991         (WebKit::WebView::updateActiveStateSoon):
3992         (WebKit::initCommonControls):
3993         (WebKit::WebView::initializeToolTipWindow):
3994         (WebKit::WebView::startTrackingMouseLeave):
3995         (WebKit::WebView::stopTrackingMouseLeave):
3996         (WebKit::WebView::shouldInitializeTrackPointHack):
3997         (WebKit::WebView::close):
3998         (WebKit::WebView::cursorToShow const):
3999         (WebKit::WebView::updateNativeCursor):
4000         (WebKit::WebView::setOverrideCursor):
4001         (WebKit::WebView::setIsInWindow):
4002         (WebKit::WebView::setIsVisible):
4003         (WebKit::WebView::isWindowActive):
4004         (WebKit::WebView::isFocused):
4005         (WebKit::WebView::isVisible):
4006         (WebKit::WebView::isInWindow):
4007         (WebKit::WebView::setScrollOffsetOnNextResize):
4008         (WebKit::WebView::setViewNeedsDisplay):
4009         (WebKit::WebView::createColorChooserProxy):
4010         (WebKit::WebView::didCommitLoadForMainFrame):
4011         (WebKit::WebView::customRepresentationZoomFactor):
4012         (WebKit::WebView::setCustomRepresentationZoomFactor):
4013         (WebKit::WebView::findStringInCustomRepresentation):
4014         (WebKit::WebView::countStringMatchesInCustomRepresentation):
4015         (WebKit::WebView::nativeWindow):
4016         (WebKit::WebView::windowReceivedMessage):
4017         * UIProcess/win/WebView.h: Added.
4018         (WebKit::WebView::create):
4019         (WebKit::WebView::window const):
4020         (WebKit::WebView::page const):
4021         (WebKit::WebView::drawingArea):
4022         (WebKit::WebView::setWasActivatedByMouseEvent):
4023
4024 2018-04-24  Fujii Hironori  <Hironori.Fujii@sony.com>
4025
4026         Implement Same-Site cookies
4027         https://bugs.webkit.org/show_bug.cgi?id=159464
4028         <rdar://problem/27196358>
4029
4030         Unreviewed build fix.
4031
4032         WinCairo WebKit2 can't compile since r230921.
4033
4034         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
4035         (WebKit::NetworkDataTaskCurl::appendCookieHeader):
4036         CookieJarCurlDatabase::cookieRequestHeaderFieldValue needs
4037         SameSiteInfo.
4038
4039 2018-04-24  Simon Fraser  <simon.fraser@apple.com>
4040
4041         Add a new "color-filter" CSS property as an experimental feature
4042         https://bugs.webkit.org/show_bug.cgi?id=184940
4043
4044         Reviewed by Jon Lee.
4045         
4046         Add the color-filter property as an experimental feature.
4047
4048         * Shared/WebPreferences.yaml:
4049
4050 2018-04-24  Saam Barati  <sbarati@apple.com>