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