38d47a02fe21fb53bec5055d4b16cb7f2b48e72e
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-05-02  Jer Noble  <jer.noble@apple.com>
2
3         Make EncryptedMediaAPIEnabled an experimental feature
4         https://bugs.webkit.org/show_bug.cgi?id=185212
5
6         Reviewed by Eric Carlson.
7
8         * Shared/WebPreferences.yaml:
9
10 2018-05-02  Per Arne Vollan  <pvollan@apple.com>
11
12         Adjust sandbox profile in simulator mode.
13         https://bugs.webkit.org/show_bug.cgi?id=185172
14         <rdar://problem/39876860>
15
16         Reviewed by Brent Fulgham.
17
18         Fix some sandbox violations.
19
20         * WebProcess/com.apple.WebProcess.sb.in:
21
22 2018-05-02  Brian Burg  <bburg@apple.com>
23
24         Web Inspector: opt out of process swap on navigation if a Web Inspector frontend is connected
25         https://bugs.webkit.org/show_bug.cgi?id=184861
26         <rdar://problem/39153768>
27
28         Reviewed by Ryosuke Niwa.
29
30         We need to track how many frontends are attached to the web page (both local and remote).
31         InspectorController propagates this out to WebKit via InspectorClient. This is then
32         kept in UIProcess as a member of WebPageProxy. When making a decision whether to use a
33         new process for a navigation, return early with "no" if any frontends are open for the
34         page being navigated.
35
36         * UIProcess/WebPageProxy.h:
37         (WebKit::WebPageProxy::didChangeInspectorFrontendCount):
38         (WebKit::WebPageProxy::inspectorFrontendCount const):
39         * UIProcess/WebPageProxy.messages.in:
40         * UIProcess/WebProcessPool.cpp:
41         (WebKit::WebProcessPool::processForNavigation):
42         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
43         (WebKit::WebInspectorClient::frontendCountChanged):
44         * WebProcess/WebCoreSupport/WebInspectorClient.h:
45         * WebProcess/WebPage/WebPage.cpp:
46         (WebKit::WebPage::inspectorFrontendCountChanged):
47         * WebProcess/WebPage/WebPage.h:
48
49 2018-05-02  Jer Noble  <jer.noble@apple.com>
50
51         Adopt -destinationWindowToExitFullScreenForWindow:
52         https://bugs.webkit.org/show_bug.cgi?id=185204
53         <rdar://problem/22486621>
54
55         Reviewed by Eric Carlson.
56
57         * UIProcess/mac/WKFullScreenWindowController.mm:
58         (-[WKFullScreenWindowController destinationWindowToExitFullScreenForWindow:]):
59
60 2018-05-02  Per Arne Vollan  <pvollan@apple.com>
61
62         Disable Media capture rules in sandbox for simulator.
63         https://bugs.webkit.org/show_bug.cgi?id=185206
64         <rdar://problem/39910015>
65
66         Reviewed by Eric Carlson.
67
68         These rules are not relevant in this case.
69
70         * WebProcess/com.apple.WebProcess.sb.in:
71
72 2018-05-02  Eric Carlson  <eric.carlson@apple.com>
73
74         [iOS] Provide audio route information when invoking AirPlay picker
75         https://bugs.webkit.org/show_bug.cgi?id=185199
76         <rdar://problem/39853103>
77
78         Reviewed by Jer Noble.
79
80         * Scripts/webkit/messages.py:
81         * UIProcess/PageClient.h:
82         * UIProcess/WebPageProxy.h:
83         * UIProcess/WebPageProxy.messages.in:
84         * UIProcess/ios/PageClientImplIOS.h:
85         * UIProcess/ios/PageClientImplIOS.mm:
86         (WebKit::PageClientImpl::showPlaybackTargetPicker):  Pass route sharing policy and routing context UID.
87
88         * UIProcess/ios/WKContentViewInteraction.h:
89         * UIProcess/ios/WKContentViewInteraction.mm:
90         (-[WKContentView _showPlaybackTargetPicker:fromRect:routeSharingPolicy:routingContextUID:]): Take same.
91         (-[WKContentView _showPlaybackTargetPicker:fromRect:]): Deleted.
92
93         * UIProcess/ios/WebPageProxyIOS.mm:
94         (WebKit::WebPageProxy::showPlaybackTargetPicker): Pass route sharing policy and routing context UID.
95
96         * UIProcess/ios/forms/WKAirPlayRoutePicker.h:
97         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
98         (-[WKAirPlayRoutePicker showFromView:routeSharingPolicy:routingContextUID:]): Take same.
99         (-[WKAirPlayRoutePicker showFromView:]): Deleted.
100
101         * WebProcess/WebCoreSupport/WebChromeClient.h:
102         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
103         (WebKit::WebChromeClient::showPlaybackTargetPicker):
104
105 2018-05-02  Jer Noble  <jer.noble@apple.com>
106
107         Get the WebKit.framework bundle by asking for WKWebView
108         https://bugs.webkit.org/show_bug.cgi?id=185175
109
110         Reviewed by Tim Horton.
111
112         * NetworkProcess/mac/NetworkProcessMac.mm:
113         (WebKit::NetworkProcess::initializeSandbox):
114         * Shared/mac/ChildProcessMac.mm:
115         (WebKit::ChildProcess::initializeSandbox):
116         * StorageProcess/mac/StorageProcessMac.mm:
117         (WebKit::StorageProcess::initializeSandbox):
118
119 2018-05-02  Youenn Fablet  <youenn@apple.com>
120
121         Cannot gather srflx or relay ICE candidates on IPv6 network (ICE agent hangs?)
122         https://bugs.webkit.org/show_bug.cgi?id=181009
123         <rdar://problem/36144555>
124
125         Reviewed by Eric Carlson.
126
127         On iOS/IPv6 networks, STUN servers name resolution returns a zero IPv6 IP address.
128         No error is raised which leads to sending STUN requests with that IP address.
129         Once the request times out, the ICE candidate gathering finishes with host candidates only.
130
131         This patch makes WebRTC DNS resolver to send only IPv4 resolved addresses.
132         STUN is used for NAT traversal which is for IPv4 addresses.
133         Not sending IPv6 addresses allows terminating ICE candidate gathering sooner.
134
135         Manually tested on iOS with IPv4/IPv6 and IPv6 networks.
136
137         * NetworkProcess/webrtc/NetworkRTCResolverCocoa.cpp:
138         (WebKit::resolvedName):
139
140 2018-05-02  Youenn Fablet  <youenn@apple.com>
141
142         CacheStorage::Engine should keep a list of initialization callback
143         https://bugs.webkit.org/show_bug.cgi?id=185184
144         <rdar://problem/38875651>
145
146         Reviewed by Antti Koivisto.
147
148         Keep each initialize callback in a Vector so as to compute the salt only once.
149         Call all callbacks then in a loop.
150
151         * NetworkProcess/cache/CacheStorageEngine.cpp:
152         (WebKit::CacheStorage::Engine::~Engine):
153         (WebKit::CacheStorage::Engine::initialize):
154         * NetworkProcess/cache/CacheStorageEngine.h:
155
156 2018-05-02  Jer Noble  <jer.noble@apple.com>
157
158         Pipe volume through PlaybackSessionManager/Proxy.
159         https://bugs.webkit.org/show_bug.cgi?id=185182
160
161         Reviewed by Eric Carlson.
162
163         * UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
164         * UIProcess/Cocoa/PlaybackSessionManagerProxy.messages.in:
165         * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
166         (WebKit::PlaybackSessionModelContext::setVolume):
167         (WebKit::PlaybackSessionModelContext::volumeChanged):
168         (WebKit::PlaybackSessionManagerProxy::volumeChanged):
169         (WebKit::PlaybackSessionManagerProxy::setVolume):
170         * WebProcess/cocoa/PlaybackSessionManager.h:
171         * WebProcess/cocoa/PlaybackSessionManager.messages.in:
172         * WebProcess/cocoa/PlaybackSessionManager.mm:
173         (WebKit::PlaybackSessionInterfaceContext::volumeChanged):
174         (WebKit::PlaybackSessionManager::volumeChanged):
175         (WebKit::PlaybackSessionManager::setVolume):
176
177 2018-05-01  Yusuke Suzuki  <utatane.tea@gmail.com>
178
179         Use default std::optional if it is provided
180         https://bugs.webkit.org/show_bug.cgi?id=185159
181
182         Reviewed by JF Bastien.
183
184         * Shared/SandboxExtension.h:
185         (WebKit::SandboxExtension::Handle::decode):
186         * Shared/TouchBarMenuItemData.cpp:
187         (WebKit::TouchBarMenuItemData::decode):
188
189 2018-05-01  Jer Noble  <jer.noble@apple.com>
190
191         Production build error in Migrate Header phase when WK_ALTERNATE_FRAMEWORKS_DIR is set to non-empty value
192         https://bugs.webkit.org/show_bug.cgi?id=185171
193
194         Reviewed by Timothy Hatcher.
195
196         * Configurations/BaseTarget.xcconfig:
197
198 2018-05-01  Per Arne Vollan  <pvollan@apple.com>
199
200         Use correct runloop type in the WebContent process.
201         https://bugs.webkit.org/show_bug.cgi?id=185140
202
203         Reviewed by Brent Fulgham.
204
205         Use WK_MACOS_* machinery to determine runloop type for the WebContent process.
206
207         * Configurations/WebContentService.xcconfig:
208
209 2018-05-01  Oleksandr Skachkov  <gskachkov@gmail.com>
210
211         WebAssembly: add support for stream APIs - JavaScript API
212         https://bugs.webkit.org/show_bug.cgi?id=183442
213
214         Reviewed by Yusuke Suzuki and JF Bastien.
215
216         Add WEBASSEMBLY_STREAMING_API feature flag
217
218         * Configurations/FeatureDefines.xcconfig:
219
220 2018-04-30  Per Arne Vollan  <pvollan@apple.com>
221
222         Use correct runloop type in the WebContent process.
223         https://bugs.webkit.org/show_bug.cgi?id=185140
224         <rdar://problem/39585037>
225
226         Reviewed by Brent Fulgham.
227
228         The macOS target version should be used to determine the runloop type.
229
230         * Configurations/WebContentService.xcconfig:
231
232 2018-04-30  Michael Saboff  <msaboff@apple.com>
233
234         Eliminate WebProcessShim.dylib
235         https://bugs.webkit.org/show_bug.cgi?id=185147
236
237         Reviewed by Ryosuke Niwa.
238
239         * Configurations/WebContentService.xcconfig:
240         * Configurations/WebProcessShim.xcconfig: Removed.
241         * WebKit.xcodeproj/project.pbxproj:
242
243 2018-04-30  Michael Saboff  <msaboff@apple.com>
244
245         Remove unused mac/CookieStorageShimLibrary
246         https://bugs.webkit.org/show_bug.cgi?id=185146
247
248         Reviewed by Alex Christensen.
249
250         * Shared/mac/CookieStorageShimLibrary.cpp: Removed.
251         * Shared/mac/CookieStorageShimLibrary.h: Removed.
252         * WebKit.xcodeproj/project.pbxproj:
253
254 2018-04-30  Alex Christensen  <achristensen@webkit.org>
255
256         Add WKUIDelegatePrivate equivalent of WKPageContextMenuClient getContextMenuFromProposedMenuAsync
257         https://bugs.webkit.org/show_bug.cgi?id=180955
258
259         Reviewed by Andy Estes.
260
261         * UIProcess/API/APIContextMenuClient.h:
262         (API::ContextMenuClient::menuFromProposedMenu):
263         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
264         * UIProcess/Cocoa/UIDelegate.h:
265         * UIProcess/Cocoa/UIDelegate.mm:
266         (WebKit::UIDelegate::setDelegate):
267         (WebKit::UIDelegate::ContextMenuClient::menuFromProposedMenu):
268         * UIProcess/mac/WebContextMenuProxyMac.mm:
269         (WebKit::WebContextMenuProxyMac::showContextMenuWithItems):
270
271 2018-04-30  JF Bastien  <jfbastien@apple.com>
272
273         Use some C++17 features
274         https://bugs.webkit.org/show_bug.cgi?id=185135
275
276         Reviewed by Alex Christensen.
277
278         As discussed here [0] let's move WebKit to a subset of C++17. We
279         now require GCC 6 [1] which means that, according to [2] we can
280         use the following C++17 language features (I removed some
281         uninteresting ones):
282
283          - New auto rules for direct-list-initialization
284          - static_assert with no message
285          - typename in a template template parameter
286          - Nested namespace definition
287          - Attributes for namespaces and enumerators
288          - u8 character literals
289          - Allow constant evaluation for all non-type template arguments
290          - Fold Expressions
291          - Unary fold expressions and empty parameter packs
292          - __has_include in preprocessor conditional
293          - Differing begin and end types in range-based for
294          - Improving std::pair and std::tuple
295
296         Consult the Tony Tables [3] to see before / after examples.
297
298         Of course we can use any library feature if we're willing to
299         import them to WTF (and they don't require language support).
300
301
302           [0]: https://lists.webkit.org/pipermail/webkit-dev/2018-March/029922.html
303           [1]: https://trac.webkit.org/changeset/231152/webkit
304           [2]: https://en.cppreference.com/w/cpp/compiler_support
305           [3]: https://github.com/tvaneerd/cpp17_in_TTs/blob/master/ALL_IN_ONE.md
306
307         * Configurations/Base.xcconfig:
308         * DerivedSources.make:
309         * PlatformMac.cmake:
310
311 2018-04-30  Wenson Hsieh  <wenson_hsieh@apple.com>
312
313         [Extra zoom mode] Respect the existing shrink-to-fit attribute instead of using min-device-width
314         https://bugs.webkit.org/show_bug.cgi?id=185132
315         <rdar://problem/39834562>
316
317         Reviewed by Tim Horton.
318
319         Remove the experimental feature for `min-device-width`.
320
321         * Shared/WebPreferences.yaml:
322
323 2018-04-30  Keith Rollin  <krollin@apple.com>
324
325         Include breadcrumb for tracking resource loading into CFNetwork
326         https://bugs.webkit.org/show_bug.cgi?id=184837
327         rdar://problem/39575411
328
329         Reviewed by Brent Fulgham.
330
331         When starting the network-based loading of a resource, log the
332         description provided by NetworkDataTask. On Cocoa, this is implemented
333         to return the description property in NSURLSessionTask. This
334         information better allows us to track a resource load through the
335         WebContent process, the Networking process, and the Cocoa networking
336         layers.
337
338         * NetworkProcess/NetworkDataTask.cpp:
339         (WebKit::NetworkDataTask::description const):
340         * NetworkProcess/NetworkDataTask.h:
341         * NetworkProcess/NetworkLoad.cpp:
342         (WebKit::NetworkLoad::description const):
343         * NetworkProcess/NetworkLoad.h:
344         * NetworkProcess/NetworkResourceLoader.cpp:
345         (WebKit::NetworkResourceLoader::startNetworkLoad):
346         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
347         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
348         (WebKit::NetworkDataTaskCocoa::description const):
349
350 2018-04-30  Andy Estes  <aestes@apple.com>
351
352         [iOS] Try to unlock PDF documents before printing them
353         https://bugs.webkit.org/show_bug.cgi?id=185084
354         <rdar://problem/39356622>
355
356         Reviewed by Dan Bernstein.
357
358         * UIProcess/ios/WKPDFView.mm:
359         (-[WKPDFView pdfHostViewController:documentDidUnlockWithPassword:]):
360
361         Stored the password that successfully unlocked the current PDF document.
362
363         (-[WKPDFView _wk_printedDocument]):
364
365         Used the stored password to unlock the CGPDFDocument we create for printing.
366
367 2018-04-28  Andy Estes  <aestes@apple.com>
368
369         [iOS] Present an action sheet when long-pressing on PDF links
370         https://bugs.webkit.org/show_bug.cgi?id=185093
371         <rdar://problem/39356651>
372
373         Reviewed by Dan Bernstein.
374
375         * UIProcess/ios/WKPDFView.mm:
376         (-[WKPDFView dealloc]):
377
378         Called -[WKActionSheetAssistant cleanupSheet].
379
380         (-[WKPDFView web_setContentProviderData:suggestedFilename:]):
381
382         Created a WKActionSheetAssistant with the host view as the assistant view and
383         ourselves as the delegate.
384
385         (-[WKPDFView _URLWithPageIndex:]):
386
387         Added. Creates a URL to the current page with a page number fragment appended.
388
389         (-[WKPDFView _goToURL:atLocation:]):
390
391         Added. Navigates to a URL with a synthetic mouse click at a location in host view
392         coordinates.
393
394         (-[WKPDFView pdfHostViewController:goToURL:]):
395         (-[WKPDFView pdfHostViewController:goToPageIndex:withViewFrustum:]):
396
397         Called -_goToURL:atLocation:. Used -_URLWithPageIndex: to construct an NSURL from
398         a page index.
399
400         (-[WKPDFView _showActionSheetForURL:atLocation:]):
401
402         Added. Populates _positionInformation with a URL and location and calls
403         -[WKActionSheetAssistant showLinkSheet].
404
405         (-[WKPDFView pdfHostViewController:didLongPressURL:atLocation:]):
406         (-[WKPDFView pdfHostViewController:didLongPressPageIndex:atLocation:]):
407
408         Called -_showActionSheetForURL:atLocation:. Used -_URLWithPageIndex: to construct
409         an NSURL from a page index.
410
411         (-[WKPDFView positionInformationForActionSheetAssistant:]):
412
413         Returned _positionInformation.
414
415         (-[WKPDFView actionSheetAssistant:performAction:]):
416
417         Populated the pasteboard with plain text and URL representations of
418         _positionInformation.url.
419
420         (-[WKPDFView actionSheetAssistant:openElementAtLocation:]):
421
422         Called -_goToURL:atLocation.
423
424         (-[WKPDFView actionSheetAssistant:shareElementWithURL:rect:]):
425
426         Created a UIWKSelectionAssistant and called -showShareSheetFor:fromRect:.
427
428         (-[WKPDFView actionSheetAssistant:shouldIncludeAppLinkActionsForElement:]):
429
430         Returned API::UIClient::shouldIncludeAppLinkActionsForElement().
431
432         (-[WKPDFView actionSheetAssistant:decideActionsForElement:defaultActions:]):
433
434         Returned API::UIClient::actionsForElement()l
435
436 2018-04-28  Andy Estes  <aestes@apple.com>
437
438         [iOS] Allow com.apple.WebKit.Networking to look up com.apple.wifi.manager
439         https://bugs.webkit.org/show_bug.cgi?id=185114
440         <rdar://problem/39808763>
441
442         Reviewed by Wenson Hsieh.
443
444         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
445
446 2018-04-28  Brent Fulgham  <bfulgham@apple.com>
447
448         Revise sandboxes to allow additional IOKit property access
449         https://bugs.webkit.org/show_bug.cgi?id=185095
450         <rdar://problem/39809455>
451
452         Reviewed by Eric Carlson.
453
454         Update the WebContent and Plugin processes to allow additional IOKit property access.
455
456         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
457         * WebProcess/com.apple.WebProcess.sb.in:
458
459 2018-04-28  Carlos Garcia Campos  <cgarcia@igalia.com>
460
461         [GTK] WebProcess from WebKitGtk+ 2.19.92 SIGSEVs in WebCore::TextureMapperGL::~TextureMapperGL
462         https://bugs.webkit.org/show_bug.cgi?id=184040
463
464         Reviewed by Michael Catanzaro.
465
466         This can happen when using single shared process model or when the process limit is reached in multiple process
467         model. In this case, all pages in the same web process with accelerated compositing enabled share the same
468         compositing thread. Every page sets its GL context as current when rendering a frame, but not when invalidating
469         the threaded compositor when the page is closed. So, if a hidden tab is closed, the threaded compositor is
470         invalidated and the GL resources of the current context (the visible page) are destroyed. This is also causing
471         the blank pages issue when closing a tab related to another one, the current one stops rendering anything because
472         its GL context has been released. We should make the threaded compositor context current when invalidating it.
473
474         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
475         (WebKit::ThreadedCompositor::invalidate):
476
477 2018-04-27  Timothy Hatcher  <timothy@apple.com>
478
479         REGRESSION: Touch events fail to dispatch to the page in all cases.
480
481         https://bugs.webkit.org/show_bug.cgi?id=185097
482         rdar://problem/39731995
483
484         Reviewed by Tim Horton.
485
486         * UIProcess/ios/WKContentViewInteraction.mm:
487         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
488         Consult internal gesture recognizers, otherwise NO might get returned.
489
490 2018-04-26  Ryosuke Niwa  <rniwa@webkit.org>
491
492         PSON: Triggering a navigation to an invalid URL creates a new WebContent process
493         https://bugs.webkit.org/show_bug.cgi?id=185066
494
495         Reviewed by Youenn Fablet.
496
497         Don't create a new WebContent process when the target URL is invalid as well as when the source URL is invalid.
498
499         * UIProcess/WebProcessPool.cpp:
500         (WebKit::WebProcessPool::processForNavigationInternal):
501
502 2018-04-27  Youenn Fablet  <youenn@apple.com>
503
504         Use NetworkLoadChecker for XHR/fetch loads
505         https://bugs.webkit.org/show_bug.cgi?id=184741
506
507         Reviewed by Chris Dumez.
508
509         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
510         (WebKit::NetworkCORSPreflightChecker::didCompleteWithError):
511         Pass the preflight error as completion error if any.
512         * NetworkProcess/NetworkLoad.cpp:
513         (WebKit::NetworkLoad::willPerformHTTPRedirection):
514         Set response source to Network so that checks relying on that are correct.
515         * NetworkProcess/NetworkLoadChecker.cpp:
516         (WebKit::NetworkLoadChecker::validateResponse):
517         Adding Oppaqueredirect tainting.
518         (NetworkLoadChecker::doesNotNeedCORSCheck):
519         Adding a check to only activate CORS checks for CORS enabled schemes.
520         Non CORS enabled schemes loads should have failed in WebProcess already.
521         (WebKit::NetworkLoadChecker::checkCORSRedirectedRequest):
522         Remove Authorization header as done by SubresourceLoader.
523         (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
524         If error is cancellation, we still want to call the completion handler.
525         * NetworkProcess/NetworkResourceLoader.cpp:
526         Activate network load checker for all types of loads.
527         (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
528         Handle manual redirection by directly calling didReceiveResponse.
529
530 2018-04-27  Wenson Hsieh  <wenson_hsieh@apple.com>
531
532         Add an experimental feature flag for viewport "min-device-width"
533         https://bugs.webkit.org/show_bug.cgi?id=185050
534         <rdar://problem/39624038>
535
536         Reviewed by Tim Horton.
537
538         Add MinDeviceWidthEnabled as a new experimental feature, on by default in extra zoom mode and off elsewhere.
539
540         * Shared/WebPreferences.yaml:
541         * Shared/WebPreferencesDefaultValues.h:
542
543 2018-04-27  Daniel Bates  <dabates@apple.com>
544
545         UIDelegate::UIClient::didResignInputElementStrongPasswordAppearance() is applicable to both Mac and iOS
546         https://bugs.webkit.org/show_bug.cgi?id=185079
547         <rdar://problem/39794960>
548
549         I inadvertently forgot to move the UIDelegate field webViewDidResignInputElementStrongPasswordAppearanceWithUserInfo
550         outside the PLATFORM(MAC)-guard.
551
552         * UIProcess/Cocoa/UIDelegate.h:
553
554 2018-04-27  Daniel Bates  <dabates@apple.com>
555
556         UIDelegate::UIClient::didResignInputElementStrongPasswordAppearance() is applicable to both Mac and iOS
557         https://bugs.webkit.org/show_bug.cgi?id=185079
558         <rdar://problem/39794960>
559
560         Reviewed by Andy Estes.
561
562         * UIProcess/Cocoa/UIDelegate.h:
563         * UIProcess/Cocoa/UIDelegate.mm:
564         (WebKit::UIDelegate::setDelegate):
565         (WebKit::UIDelegate::UIClient::didResignInputElementStrongPasswordAppearance):
566
567 2018-04-27  Wenson Hsieh  <wenson_hsieh@apple.com>
568
569         Rename minimumLayoutSize to viewLayoutSize
570         https://bugs.webkit.org/show_bug.cgi?id=185050
571         <rdar://problem/39624038>
572
573         Reviewed by Tim Horton.
574
575         Renames minimumLayoutSize to viewLayoutSize, since the minimum layout size in ViewportConfiguration is now
576         different from the minimum layout size that is currently pushed down from the UI process (e.g. WKWebView SPI) in
577         the case where `min-device-width` is used to override the minimum layout size.
578
579         * Shared/WebPageCreationParameters.cpp:
580         (WebKit::WebPageCreationParameters::encode const):
581         (WebKit::WebPageCreationParameters::decode):
582         * Shared/WebPageCreationParameters.h:
583         * UIProcess/API/Cocoa/WKWebView.mm:
584         (-[WKWebView _processDidExit]):
585         (-[WKWebView activeViewLayoutSize:]):
586         (-[WKWebView _dispatchSetViewLayoutSize:]):
587         (-[WKWebView _frameOrBoundsChanged]):
588         (-[WKWebView _minimumLayoutSizeOverride]):
589         (-[WKWebView _setViewLayoutSizeOverride:]):
590         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
591         (-[WKWebView _endAnimatedResize]):
592         (-[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:maximumUnobscuredSizeOverride:]):
593         (-[WKWebView _clearOverrideLayoutParameters]):
594         (-[WKWebView _minimumLayoutWidth]):
595         (-[WKWebView _setMinimumLayoutWidth:]):
596         (-[WKWebView activeMinimumLayoutSize:]): Deleted.
597         (-[WKWebView _dispatchSetMinimumLayoutSize:]): Deleted.
598         (-[WKWebView _setMinimumLayoutSizeOverride:]): Deleted.
599         (-[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:minimumLayoutSizeForMinimalUI:maximumUnobscuredSizeOverride:]): Deleted.
600
601         Remove unused SPI that has been deprecated since iOS 9, has a simple drop-in replacement, and no longer has any
602         internal clients.
603
604         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
605         * UIProcess/Cocoa/WebViewImpl.mm:
606         (WebKit::WebViewImpl::setMinimumSizeForAutoLayout):
607         (WebKit::WebViewImpl::minimumSizeForAutoLayout const):
608         (WebKit::WebViewImpl::setIntrinsicContentSize):
609         * UIProcess/DrawingAreaProxy.h:
610         (WebKit::DrawingAreaProxy::viewLayoutSizeDidChange):
611         (WebKit::DrawingAreaProxy::minimumLayoutSizeDidChange): Deleted.
612         * UIProcess/WebPageProxy.cpp:
613         (WebKit::WebPageProxy::creationParameters):
614         (WebKit::WebPageProxy::setViewLayoutSize):
615         (WebKit::WebPageProxy::setMinimumLayoutSize): Deleted.
616         * UIProcess/WebPageProxy.h:
617         (WebKit::WebPageProxy::viewLayoutSize const):
618         (WebKit::WebPageProxy::minimumLayoutSize const): Deleted.
619         * UIProcess/ios/WebPageProxyIOS.mm:
620         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
621         (WebKit::WebPageProxy::setViewportConfigurationViewLayoutSize):
622         (WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSize): Deleted.
623         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
624         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
625         (WebKit::TiledCoreAnimationDrawingAreaProxy::viewLayoutSizeDidChange):
626         (WebKit::TiledCoreAnimationDrawingAreaProxy::didUpdateGeometry):
627         (WebKit::TiledCoreAnimationDrawingAreaProxy::intrinsicContentSizeDidChange):
628         (WebKit::TiledCoreAnimationDrawingAreaProxy::willSendUpdateGeometry):
629         (WebKit::TiledCoreAnimationDrawingAreaProxy::minimumLayoutSizeDidChange): Deleted.
630         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
631         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
632         * WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
633         (WebKit::ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture):
634         * WebProcess/WebPage/WebPage.cpp:
635         (WebKit::m_credentialsMessenger):
636         (WebKit::WebPage::setViewLayoutSize):
637         (WebKit::WebPage::setMinimumLayoutSize): Deleted.
638         * WebProcess/WebPage/WebPage.h:
639         (WebKit::WebPage::viewLayoutSize const):
640         (WebKit::WebPage::minimumLayoutSize const): Deleted.
641         * WebProcess/WebPage/WebPage.messages.in:
642         * WebProcess/WebPage/ios/WebPageIOS.mm:
643         (WebKit::WebPage::setViewportConfigurationViewLayoutSize):
644         (WebKit::WebPage::dynamicViewportSizeUpdate):
645         (WebKit::WebPage::setViewportConfigurationMinimumLayoutSize): Deleted.
646         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
647         (WebKit::TiledCoreAnimationDrawingArea::updateIntrinsicContentSizeIfNeeded):
648         (WebKit::TiledCoreAnimationDrawingArea::updateGeometry):
649
650 2018-04-27  Wenson Hsieh  <wenson_hsieh@apple.com>
651
652         [Extra zoom mode] Add a mechanism to override default viewport behaviors in extra zoom mode
653         https://bugs.webkit.org/show_bug.cgi?id=185050
654         <rdar://problem/39624038>
655
656         Reviewed by Tim Horton.
657
658         Remove the forceHorizontalViewportShrinkToFit and minimumAllowedLayoutWidth SPI hooks from WebKit, and
659         additionally remove all logic for plumbing viewSize to WebCore. See WebCore/ChangeLog for more information.
660
661         * Shared/VisibleContentRectUpdateInfo.cpp:
662         (WebKit::VisibleContentRectUpdateInfo::encode const):
663         (WebKit::VisibleContentRectUpdateInfo::decode):
664         (WebKit::operator<<):
665         * Shared/VisibleContentRectUpdateInfo.h:
666         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
667         (WebKit::VisibleContentRectUpdateInfo::allowShrinkToFit const):
668         (WebKit::operator==):
669         (WebKit::VisibleContentRectUpdateInfo::forceHorizontalShrinkToFit const): Deleted.
670         * UIProcess/API/Cocoa/WKWebView.mm:
671         (-[WKWebView _initializeWithConfiguration:]):
672         (-[WKWebView activeMinimumLayoutSize:]):
673         (-[WKWebView _dispatchSetMinimumLayoutSize:]):
674         (-[WKWebView _frameOrBoundsChanged]):
675         (-[WKWebView _setMinimumLayoutSizeOverride:]):
676         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
677         (-[WKWebView _endAnimatedResize]):
678         (-[WKWebView _minimumAllowedLayoutWidth]): Deleted.
679         (-[WKWebView _setMinimumAllowedLayoutWidth:]): Deleted.
680         (-[WKWebView activeMinimumLayoutSizes:]): Deleted.
681         (-[WKWebView _dispatchSetMinimumLayoutSize:viewSize:]): Deleted.
682         (-[WKWebView _setForceHorizontalViewportShrinkToFit:]): Deleted.
683         (-[WKWebView _forceHorizontalViewportShrinkToFit]): Deleted.
684         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
685         * UIProcess/WebPageProxy.cpp:
686         (WebKit::WebPageProxy::creationParameters):
687         * UIProcess/WebPageProxy.h:
688         * UIProcess/ios/WKContentView.mm:
689         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
690         * UIProcess/ios/WebPageProxyIOS.mm:
691         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
692         (WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSize):
693         * WebProcess/WebPage/WebPage.cpp:
694         (WebKit::m_credentialsMessenger):
695         * WebProcess/WebPage/WebPage.h:
696         * WebProcess/WebPage/WebPage.messages.in:
697         * WebProcess/WebPage/ios/WebPageIOS.mm:
698         (WebKit::WebPage::setViewportConfigurationMinimumLayoutSize):
699         (WebKit::WebPage::dynamicViewportSizeUpdate):
700         (WebKit::WebPage::updateVisibleContentRects):
701
702 2018-04-27  Carlos Garcia Campos  <cgarcia@igalia.com>
703
704         REGRESSION(r230812): [WPE][GTK] WebKitWebViewSessionState.cpp throws away encoded BackForwardList identifier
705         https://bugs.webkit.org/show_bug.cgi?id=184823
706
707         Reviewed by Michael Catanzaro.
708
709         Bump session sate format version to 2 and stop encoding the backfoward list item identifier, since it's always
710         regenerated.
711
712         * UIProcess/API/glib/WebKitWebViewSessionState.cpp:
713         (encodeBackForwardListItemState): Always encode version 2.
714         (encodeBackForwardListState): Ditto.
715         (encodeSessionState): Ditto.
716         (decodeBackForwardListItemStateV1): Decode list item state for version 1.
717         (decodeBackForwardListItemState): Receive the version and call decodeBackForwardListItemStateV1() if it's 1 or
718         use the version 2 otherwise.
719         (decodeSessionState): Load data for known formats and use the one that worked to decode it.
720
721 2018-04-26  Megan Gardner  <megan_gardner@apple.com>
722
723         Add timeout for ensurePositionInformationIsUpToDate
724         https://bugs.webkit.org/show_bug.cgi?id=184567
725
726         Reviewed by Wenson Hsieh.
727         
728         We are having long hang times for WebKit, and this is one of the culprits.
729         If we do not get an answer for positionInformation in a reasonable amount of time, we should timeout,
730         so as to not hang the UI.
731
732         * UIProcess/ios/WKContentViewInteraction.mm:
733         (-[WKContentView ensurePositionInformationIsUpToDate:]):
734
735 2018-04-26  Andy Estes  <aestes@apple.com>
736
737         Try again to fix the iOS build after r231063.
738
739         * Configurations/Base.xcconfig:
740
741 2018-04-26  Jer Noble  <jer.noble@apple.com>
742
743         WK_COCOA_TOUCH the WK_ACCESSIBILITY_LDFLAGS
744         https://bugs.webkit.org/show_bug.cgi?id=185007
745         <rdar://problem/39735943>
746
747         Reviewed by Timothy Hatcher.
748
749         * Configurations/WebKit.xcconfig:
750
751 2018-04-26  Jer Noble  <jer.noble@apple.com>
752
753         Unreviewed build fix; fix iOS TAPI build step after r231063.
754
755         * Configurations/WebKit.xcconfig:
756
757 2018-04-26  Jer Noble  <jer.noble@apple.com>
758
759         WK_COCOA_TOUCH all the things.
760         https://bugs.webkit.org/show_bug.cgi?id=185006
761
762         Reviewed by Tim Horton.
763
764         * Configurations/BaseTarget.xcconfig:
765         * Configurations/WebKit.xcconfig:
766
767 2018-04-26  Daniel Bates  <dabates@apple.com>
768
769         Remove WebCore::-qualifier in NetworkLoadChecker.cpp
770         https://bugs.webkit.org/show_bug.cgi?id=185037
771
772         Reviewed by Youenn Fablet.
773
774         It is unncesssary to qualify WebCore types in NetworkLoadChecker.cpp as it has a
775         "using namespace WebCore" directive.
776
777         * NetworkProcess/NetworkLoadChecker.cpp:
778         (WebKit::NetworkLoadChecker::NetworkLoadChecker):
779         (WebKit::NetworkLoadChecker::checkRedirection):
780         (WebKit::NetworkLoadChecker::validateResponse):
781         (WebKit::NetworkLoadChecker::continueCheckingRequest): Removed extra space character and unnecessary
782         parentheses from the right-hand side of the assignment to m_storedCredentialsPolicy.
783         (WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad):
784
785 2018-04-26  Daniel Bates  <dabates@apple.com>
786
787         Rename NetworkLoadChecker::returnError() to NetworkLoadChecker::accessControlErrorForValidationHandler()
788         https://bugs.webkit.org/show_bug.cgi?id=185035
789
790         Reviewed by Youenn Fablet.
791
792         Substitute NetworkLoadChecker::accessControlErrorForValidationHandler() for NetworkLoadChecker::returnError()
793         to better describe that it is a convenience function that returns a wrapped ResourceError object,
794         that represents an access control error, suitable to be passed directly to a validation handler.
795
796         * NetworkProcess/NetworkLoadChecker.cpp:
797         (WebKit::NetworkLoadChecker::checkRedirection): Update as needed for renaming.
798         (WebKit::NetworkLoadChecker::accessControlErrorForValidationHandler): Use auto -> syntax to avoid the need to
799         class-qualify the return type. Also renamed parameter from error to message as it represents the message/description
800         for the access control error.
801         (WebKit::NetworkLoadChecker::checkRequest): Update as needed for renaming. Also substitute "message" for "error"
802         to match the argument of accessControlErrorForValidationHandler() with the same name.
803         (WebKit::NetworkLoadChecker::continueCheckingRequest): Update as needed for renaming.
804         (WebKit::NetworkLoadChecker::returnError): Deleted; renamed to accessControlErrorForValidationHandler().
805         * NetworkProcess/NetworkLoadChecker.h:
806
807 2018-04-26  Jiewen Tan  <jiewen_tan@apple.com>
808
809         Remove access to keychain from the WebContent process
810         https://bugs.webkit.org/show_bug.cgi?id=184428
811         <rdar://problem/13150903>
812
813         Part 3.
814
815         Tighten WebContent Process' sandbox profile to all Security.framework services.
816
817         Reviewed by Brent Fulgham.
818
819         * WebProcess/com.apple.WebProcess.sb.in:
820
821 2018-04-26  Youenn Fablet  <youenn@apple.com>
822
823         Make cross origin redirection error messages consistent between SubresourceLoader and NetworkLoadChecker
824         https://bugs.webkit.org/show_bug.cgi?id=185023
825
826         Reviewed by Chris Dumez.
827
828         Align NetworkLoadChecker with what SubresourceLoader is doing so that we can keep WK1 and WK2 error messages as consistent as possible.
829
830         * NetworkProcess/NetworkLoadChecker.cpp:
831         (WebKit::NetworkLoadChecker::checkRedirection):
832         (WebKit::NetworkLoadChecker::validateResponse):
833
834 2018-04-25  Megan Gardner  <megan_gardner@apple.com>
835
836         Activate selection when interacting with editable content
837         https://bugs.webkit.org/show_bug.cgi?id=185017
838
839         Reviewed by Tim Horton.
840         
841         Fixes a regression from r231016 where selection now does not work when interacting with
842         editable content. When we go into editable content, we should turn on the assistant.
843         This fulfills the requirement of user interaction as well, so any javascript selections
844         after this point should be valid.
845
846         * UIProcess/ios/WKContentViewInteraction.mm:
847         (-[WKContentView _startAssistingKeyboard]):
848         (-[WKContentView _stopAssistingKeyboard]):
849
850 2018-04-26  Per Arne Vollan  <pvollan@apple.com>
851
852         Disable content filtering in minimal simulator mode
853         https://bugs.webkit.org/show_bug.cgi?id=185027
854         <rdar://problem/39736091>
855
856         Reviewed by Jer Noble.
857
858         * Configurations/FeatureDefines.xcconfig:
859
860 2018-04-26  Brady Eidson  <beidson@apple.com>
861
862         Add a setting for keeping around all processes and always reusing them per-origin.
863         <rdar://problem/39695798> and https://bugs.webkit.org/show_bug.cgi?id=185020
864
865         Reviewed by Andy Estes.
866
867         * UIProcess/API/APIProcessPoolConfiguration.cpp:
868         (API::ProcessPoolConfiguration::copy):
869         * UIProcess/API/APIProcessPoolConfiguration.h:
870
871         * UIProcess/API/C/WKContextConfigurationRef.cpp:
872         (WKContextConfigurationAlwaysKeepAndReuseSwappedProcesses):
873         (WKContextConfigurationSetAlwaysKeepAndReuseSwappedProcesses):
874         * UIProcess/API/C/WKContextConfigurationRef.h:
875
876         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
877         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
878         (-[_WKProcessPoolConfiguration setAlwaysKeepAndReuseSwappedProcesses:]):
879         (-[_WKProcessPoolConfiguration alwaysKeepAndReuseSwappedProcesses]):
880
881         * UIProcess/SuspendedPageProxy.cpp:
882         (WebKit::SuspendedPageProxy::webProcessDidClose):
883         (WebKit::SuspendedPageProxy::destroyWebPageInWebProcess):
884         * UIProcess/SuspendedPageProxy.h:
885
886         * UIProcess/WebPageProxy.cpp:
887         (WebKit::WebPageProxy::suspendedPageClosed):
888         (WebKit::WebPageProxy::suspendedPageProcessClosed): Deleted.
889         * UIProcess/WebPageProxy.h:
890         (WebKit::WebPageProxy::suspendedPage const):
891
892         * UIProcess/WebProcessPool.cpp:
893         (WebKit::WebProcessPool::shouldTerminate):
894         (WebKit::WebProcessPool::disconnectProcess):
895         (WebKit::WebProcessPool::addProcessToOriginCacheSet):
896         (WebKit::WebProcessPool::removeProcessFromOriginCacheSet):
897         (WebKit::WebProcessPool::processForNavigation): If a swap will occur, cache the old process.
898         (WebKit::WebProcessPool::processForNavigationInternal): Consider re-using a previously cached process.
899         * UIProcess/WebProcessPool.h:
900
901         * WebProcess/WebPage/WebPage.cpp:
902         (WebKit::m_credentialsMessenger):
903
904 2018-04-26  Andy VanWagoner  <thetalecrafter@gmail.com>
905
906         [INTL] Implement Intl.PluralRules
907         https://bugs.webkit.org/show_bug.cgi?id=184312
908
909         Reviewed by JF Bastien.
910
911         Added Intl.PluralRules feature flag.
912
913         * Configurations/FeatureDefines.xcconfig:
914
915 2018-04-26  Zan Dobersek  <zdobersek@igalia.com>
916
917         [GTK][WPE] Initial ASYNC_SCROLLING support
918         https://bugs.webkit.org/show_bug.cgi?id=184961
919
920         Reviewed by Carlos Garcia Campos.
921
922         Guard RemoteScrollingCoordinator and RemoteScrollingCoordinatorProxy
923         usage in WebChromeClient and WebPageProxy, respectively, with
924         PLATFORM(COCOA) in addition to the ASYNC_SCROLLING guards.
925
926         Despite enabling the code at build-time, the feature (as intended) is
927         not yet used because of the DrawingArea rejection in the WebPage
928         constructor.
929
930         * UIProcess/WebPageProxy.cpp:
931         (WebKit::WebPageProxy::initializeWebPage):
932         (WebKit::WebPageProxy::handleWheelEvent):
933         (WebKit::WebPageProxy::updateTouchEventTracking):
934         * UIProcess/WebPageProxy.h:
935         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
936         (WebKit::WebChromeClient::createScrollingCoordinator const):
937
938 2018-04-25  Michael Catanzaro  <mcatanzaro@igalia.com>
939
940         [WPE] Build and link against latest WPEBackend and WPEBackend-fdo
941         https://bugs.webkit.org/show_bug.cgi?id=184643
942
943         Reviewed by Žan Doberšek.
944
945         Adapt to single-header WPE includes.
946
947         Null-initialize padding to silence -Wmissing-field-initializers. (Yuck.)
948
949         * Shared/NativeWebTouchEvent.h:
950         * Shared/wpe/WebEventFactory.cpp:
951         * UIProcess/API/glib/WebKitPrivate.cpp:
952         * UIProcess/API/wpe/CompositingManagerProxy.cpp:
953         * UIProcess/API/wpe/ScrollGestureController.h:
954         * UIProcess/API/wpe/WPEView.cpp:
955         (WKWPE::m_backend):
956         * UIProcess/API/wpe/WebKitWebViewBackend.h:
957         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
958         * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp:
959         (WebKit::AcceleratedSurfaceWPE::initialize):
960
961 2018-04-25  Saam Barati  <sbarati@apple.com>
962
963         dlopen the bundle's executable before calling -[NSBundle load] since that will also do a bunch of other things we don't need
964         https://bugs.webkit.org/show_bug.cgi?id=184904
965
966         Reviewed by Geoffrey Garen.
967
968         Loading an NSBundle does a lot of work to find the principal class inside
969         the bundle. This means it walks all the objective C class names loaded
970         by the bundle. Doing this is *really* expensive.
971         
972         Some users of the injected bundle define a WKBundleInitialize function.
973         In such a case, we don't need the principal class, so we can skip loading
974         the NSBundle. Now, before we load the bundle, we dlopen and dlsym looking
975         for the WKBundleInitialize function. If we find it, we skip loading
976         the bundle. If we don't find the WKBundleInitialize function, we fall
977         back to loading the bundle and finding the principal class.
978         
979         This speeds up initializeWebProcess by ~70ms on my MBP.
980
981         * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
982         (WebKit::InjectedBundle::initialize):
983
984 2018-04-25  Youenn Fablet  <youenn@apple.com>
985
986         Use NetworkLoadChecker for all subresource loads except fetch/XHR
987         https://bugs.webkit.org/show_bug.cgi?id=184870
988         <rdar://problem/39370034>
989
990         Reviewed by Chris Dumez.
991
992         Relax rules to check for non HTTP(s) redirections to throw only when WebProcess says to load it after redirection.
993         This allows WebProcess to load redirected non HTTP(s) URLs, such as data URLs.
994         We keep these checks when WebProcess asks to continue the load and for all PingLoads.
995
996         Update error messages to be more consistent with WK1.
997
998         * NetworkProcess/NetworkLoadChecker.cpp:
999         (WebKit::NetworkLoadChecker::checkRedirection):
1000         (WebKit::NetworkLoadChecker::continueCheckingRequest):
1001         (WebKit::NetworkLoadChecker::validateResourceResponse):
1002         (WebKit::NetworkLoadChecker::continueCheckingRequest):
1003         * NetworkProcess/NetworkLoadChecker.h:
1004         (WebKit::NetworkLoadChecker::validateResponse):
1005         * NetworkProcess/NetworkResourceLoader.cpp:
1006         (WebKit::shouldUseNetworkLoadChecker):
1007         (WebKit::NetworkResourceLoader::continueWillSendRequest):
1008
1009 2018-04-25  Ryosuke Niwa  <rniwa@webkit.org>
1010
1011         PSON: Don't create a new process when navigating to a blob URL, data URL, and about:blank
1012         https://bugs.webkit.org/show_bug.cgi?id=184962
1013
1014         Reviewed by Youenn Fablet.
1015         <rdar://problem/39715044>
1016
1017         Build fix. Revert the change in r231019 to remove the empty URL and about:blank check here.
1018         These checks are for the source / originating URL, not the target URL.
1019
1020         * UIProcess/WebProcessPool.cpp:
1021         (WebKit::WebProcessPool::processForNavigation):
1022
1023 2018-04-25  Youenn Fablet  <youenn@apple.com>
1024
1025         WebLoaderStrategy::networkMetricsFromResourceLoadIdentifier should use DoNotProcessIncomingMessagesWhenWaitingForSyncReply
1026         https://bugs.webkit.org/show_bug.cgi?id=184978
1027         <rdar://problem/39667094>
1028
1029         Reviewed by Simon Fraser.
1030
1031         Use DoNotProcessIncomingMessagesWhenWaitingForSyncReply to keep a consistent state after the sync IPC call.
1032
1033         * WebProcess/Network/WebLoaderStrategy.cpp:
1034         (WebKit::WebLoaderStrategy::responseFromResourceLoadIdentifier):
1035         (WebKit::WebLoaderStrategy::networkMetricsFromResourceLoadIdentifier):
1036
1037 2018-04-25  Jiewen Tan  <jiewen_tan@apple.com>
1038
1039         Remove access to keychain from the WebContent process
1040         https://bugs.webkit.org/show_bug.cgi?id=184428
1041         <rdar://problem/13150903>
1042
1043         Reviewed by Brent Fulgham.
1044
1045         This patch does the followings:
1046         1. Added necessary support to move HTMLKeygenElement's operation from WebContent Process to UI Process.
1047         2. Craft new SPI copySignedPublicKeyAndChallengeString to supply HTMLKeygenElement with dummy data such
1048         that WebKitTestRunner tests will not modify the underlying key store (e.g., the macOS Keychain).
1049
1050         * UIProcess/API/APINavigationClient.h:
1051         (API::NavigationClient::signedPublicKeyAndChallengeString):
1052         * UIProcess/API/C/WKPage.cpp:
1053         (WKPageSetPageNavigationClient):
1054         * UIProcess/API/C/WKPageNavigationClient.h:
1055         * UIProcess/Cocoa/NavigationState.h:
1056         * UIProcess/Cocoa/NavigationState.mm:
1057         (WebKit::NavigationState::NavigationClient::signedPublicKeyAndChallengeString):
1058         * UIProcess/WebPageProxy.cpp:
1059         (WebKit::WebPageProxy::signedPublicKeyAndChallengeString):
1060         * UIProcess/WebPageProxy.h:
1061         * UIProcess/WebPageProxy.messages.in:
1062         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1063         (WebKit::WebChromeClient::signedPublicKeyAndChallengeString const):
1064         * WebProcess/WebCoreSupport/WebChromeClient.h:
1065
1066 2018-04-25  Wenson Hsieh  <wenson_hsieh@apple.com>
1067
1068         [Extra zoom mode] The search field on www.bing.com is missing label text
1069         https://bugs.webkit.org/show_bug.cgi?id=184975
1070         <rdar://problem/39723081>
1071
1072         Reviewed by Tim Horton.
1073
1074         Adds support for displaying the "aria-label" attribute as the input view's label text in extra zoom mode. Also
1075         adds support for grabbing the input label's text for testing.
1076
1077         Test: fast/forms/extrazoom/form-control-label-text.html
1078
1079         * Shared/AssistedNodeInformation.cpp:
1080         (WebKit::AssistedNodeInformation::encode const):
1081         (WebKit::AssistedNodeInformation::decode):
1082         * Shared/AssistedNodeInformation.h:
1083         * UIProcess/API/Cocoa/WKWebView.mm:
1084         (-[WKWebView formInputLabel]):
1085         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1086         * UIProcess/ios/WKContentViewInteraction.h:
1087         * UIProcess/ios/WKContentViewInteraction.mm:
1088         (-[WKContentView formInputLabel]):
1089         * WebProcess/WebPage/ios/WebPageIOS.mm:
1090         (WebKit::WebPage::getAssistedNodeInformation):
1091
1092 2018-04-25  Ryosuke Niwa  <rniwa@webkit.org>
1093
1094         PSON: Don't create a new process when navigating to a blob URL, data URL, and about:blank
1095         https://bugs.webkit.org/show_bug.cgi?id=184962
1096
1097         Reviewed by Youenn Fablet.
1098
1099         Don't create a new WebContent process when navigating to a blob object URL since doing so
1100         can result in a race condition in which the blog URL is removed from the blob registry of
1101         the network process by the time the navigation gets commited. This causes a failure in
1102         fast/dom/HTMLAnchorElement/anchor-download-unset.html and oher layout tests.
1103
1104         In the future, the network process should verify that a given WebContent process has access
1105         to a given blob URL. For now, we rely on WebContent process to tell us whether it can
1106         navigate to a given blob URL or not.
1107
1108         * Shared/NavigationActionData.cpp:
1109         (WebKit::NavigationActionData::encode const): Encode newly added treatAsSameOriginNavigation.
1110         (WebKit::NavigationActionData::decode): Ditto for decoding.
1111         * Shared/NavigationActionData.h:
1112         (WebKit::NavigationActionData::treatAsSameOriginNavigation): Added.
1113         * UIProcess/API/APINavigation.h:
1114         (API::Navigation::setTreatAsSameOriginNavigation): Added.
1115         (API::Navigation::treatAsSameOriginNavigation const): Added.
1116         * UIProcess/API/APIProcessPoolConfiguration.h:
1117         * UIProcess/WebPageProxy.cpp:
1118         (WebKit::WebPageProxy::decidePolicyForNavigationAction): Use the current process when
1119         treatAsSameOriginNavigation is set to true; i.e. when navigating to a blob URL the current
1120         document has access.
1121         * UIProcess/WebProcessPool.cpp:
1122         (WebKit::WebProcessPool::processForNavigation):
1123         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1124         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1125
1126 2018-04-25  Megan Gardner  <megan_gardner@apple.com>
1127
1128         Don't activate Selection Assistant unless it is actually needed.
1129         https://bugs.webkit.org/show_bug.cgi?id=184944
1130         <rdar://problem/39469671>
1131
1132         Reviewed by Tim Horton.
1133         
1134         Don't activate the selection unless we need to. Activating on init is overeager and allowing Javascript to 
1135         activate selections without user input.
1136
1137         * UIProcess/ios/WKContentViewInteraction.mm:
1138         (-[WKContentView useSelectionAssistantWithGranularity:]):
1139
1140 2018-04-25  Wenson Hsieh  <wenson_hsieh@apple.com>
1141
1142         Fix entitlements and sandbox configurations in WebKit after r230778
1143         https://bugs.webkit.org/show_bug.cgi?id=184960
1144         <rdar://problem/39662827>
1145
1146         Reviewed by Tim Horton.
1147
1148         Build fixes for watchOS and tvOS after r230778.
1149
1150         * Configurations/BaseXPCService.xcconfig:
1151         * Configurations/NetworkService.xcconfig:
1152         * Configurations/WebContentService.xcconfig:
1153
1154 2018-04-25  Brent Fulgham  <bfulgham@apple.com>
1155
1156         Unreviewed build fix after r231008.
1157
1158         * NetworkProcess/NetworkDataTask.cpp:
1159         (WebKit::NetworkDataTask::create): Forgot to remove an unneeded constructor argument.
1160
1161 2018-04-25  Brent Fulgham  <bfulgham@apple.com>
1162
1163         Don't Block First Party Cookies on Redirects
1164         https://bugs.webkit.org/show_bug.cgi?id=184948
1165         <rdar://problem/39534099>
1166
1167         Reviewed by Youenn Fablet.
1168
1169         Top-level navigations should not be subject to cookie blocking behavior. When performing redirects for main frame
1170         navigation we are blocking cookies, leading to site breakage.
1171         
1172         We need to keep track of which NetworkDataTasks are due to a main frame navigation. When a redirect is performed
1173         on the main frame, we should treat the new origin as the 'first party for cookies' and avoid blocking cookies for
1174         that URL.
1175
1176         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1177         (WebKit::NetworkConnectionToWebProcess::preconnectTo): Use the correct parameter type. We actually serialize
1178         NetworkResourceLoadParameters over IPC, so we should get access to all the members of this child class.
1179         * NetworkProcess/NetworkConnectionToWebProcess.h:
1180         * NetworkProcess/NetworkDataTask.cpp:
1181         (WebKit::NetworkDataTask::create): Pass new 'loadIsForNavigation' flag to create methods. 
1182         (WebKit::NetworkDataTask::NetworkDataTask): Capture 'loadIsForNavigation' in constructor.
1183         * NetworkProcess/NetworkDataTask.h:
1184         (WebKit::NetworkDataTask::isTopLevelNavigation const): Added.
1185         * NetworkProcess/NetworkDataTaskBlob.cpp:
1186         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob): Accept new constructor argument.
1187         * NetworkProcess/NetworkDataTaskBlob.h:
1188         * NetworkProcess/NetworkLoad.cpp:
1189         (WebKit::NetworkLoad::willPerformHTTPRedirection): Retain requester value from old request during redirect.
1190         * NetworkProcess/NetworkResourceLoadParameters.cpp:
1191         (NetworkResourceLoadParameters::decode): Update to pass new flag.
1192         (NetworkResourceLoadParameters::encode): Ditto.
1193         * NetworkProcess/NetworkLoadParameters.h:
1194         * NetworkProcess/capture/NetworkDataTaskReplay.cpp:
1195         (WebKit::NetworkCapture::NetworkDataTaskReplay::NetworkDataTaskReplay): Accept new constructor argument.
1196         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
1197         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1198         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): Accept new constructor argument.
1199         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
1200         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
1201         (WebKit::NetworkDataTaskCurl::NetworkDataTaskCurl): Accept new constructor argument.
1202         * NetworkProcess/curl/NetworkDataTaskCurl.h:
1203         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1204         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup): Accept new constructor argument.
1205         * NetworkProcess/soup/NetworkDataTaskSoup.h:
1206
1207 2018-04-25  Youenn Fablet  <youenn@apple.com>
1208
1209         Ensure DNT is set for redirections handled in NetworkProcess
1210         https://bugs.webkit.org/show_bug.cgi?id=184890
1211
1212         Reviewed by Ryosuke Niwa.
1213
1214         Compute whether DNT header should be set on requests based on:
1215         - request has a DNT header
1216         - session is ephemeral (aka private browsing mode)
1217         In both cases, we ensure a DNT header is added for any request triggered by a redirection.
1218
1219         Covered by http/wpt/fetch/dnt-header-after-redirection.html.
1220
1221         * NetworkProcess/NetworkLoadChecker.cpp:
1222         (WebKit::NetworkLoadChecker::check):
1223         (WebKit::NetworkLoadChecker::prepareRedirectedRequest):
1224         * NetworkProcess/NetworkLoadChecker.h:
1225         * NetworkProcess/NetworkResourceLoader.cpp:
1226         (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
1227         (WebKit::NetworkResourceLoader::continueWillSendRequest):
1228         * NetworkProcess/PingLoad.cpp:
1229         (WebKit::PingLoad::willPerformHTTPRedirection):
1230         * WebProcess/Network/WebLoaderStrategy.cpp:
1231         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
1232
1233 2018-04-25  Michael Catanzaro  <mcatanzaro@igalia.com>
1234
1235         [WPE] Remove deprecated functions and properties from the API
1236         https://bugs.webkit.org/show_bug.cgi?id=179295
1237
1238         Reviewed by Žan Doberšek.
1239
1240         * UIProcess/API/glib/WebKitCookieManager.cpp:
1241         * UIProcess/API/glib/WebKitFormSubmissionRequest.cpp:
1242         * UIProcess/API/glib/WebKitNavigationPolicyDecision.cpp:
1243         (webkitNavigationPolicyDecisionGetProperty):
1244         (webkit_navigation_policy_decision_class_init):
1245         * UIProcess/API/glib/WebKitSettings.cpp:
1246         (webKitSettingsSetProperty):
1247         (webKitSettingsGetProperty):
1248         (webkit_settings_class_init):
1249         * UIProcess/API/glib/WebKitWebContext.cpp:
1250         (webkitWebContextGetProperty):
1251         (webkitWebContextSetProperty):
1252         (webkit_web_context_class_init):
1253         * UIProcess/API/glib/WebKitWebView.cpp:
1254         (webkit_web_view_class_init):
1255         (webkitWebViewHandleAuthenticationChallenge):
1256         (webkitWebViewWebProcessTerminated):
1257         * UIProcess/API/wpe/WebKitCookieManager.h:
1258         * UIProcess/API/wpe/WebKitFormSubmissionRequest.h:
1259         * UIProcess/API/wpe/WebKitNavigationPolicyDecision.h:
1260         * UIProcess/API/wpe/WebKitSettings.h:
1261         * UIProcess/API/wpe/WebKitWebContext.h:
1262
1263 2018-04-25  Michael Catanzaro  <mcatanzaro@igalia.com>
1264
1265         Unreviewed, silence -Wreturn-type warning
1266         https://bugs.webkit.org/show_bug.cgi?id=184560
1267
1268         * NetworkProcess/NetworkResourceLoader.cpp:
1269         (WebKit::shouldCancelCrossOriginLoad):
1270
1271 2018-04-25  Michael Catanzaro  <mcatanzaro@igalia.com>
1272
1273         [GTK] Miscellaneous build cleanups
1274         https://bugs.webkit.org/show_bug.cgi?id=184399
1275
1276         Reviewed by Žan Doberšek.
1277
1278         * PlatformGTK.cmake:
1279
1280 2018-04-25  Dean Jackson  <dino@apple.com>
1281
1282         Make a better flag for system preview, and disable it where necessary
1283         https://bugs.webkit.org/show_bug.cgi?id=184968
1284         <rdar://problem/39686506>
1285
1286         Reviewed by Eric Carlson.
1287
1288         Use USE(SYSTEM_PREVIEW).
1289
1290         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
1291         * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
1292         (-[WKWebViewContentProviderRegistry init]):
1293         * UIProcess/ios/WKSystemPreviewView.mm:
1294
1295 2018-04-25  Carlos Garcia Campos  <cgarcia@igalia.com>
1296
1297         [GTK] Implement MouseEvent.buttons
1298         https://bugs.webkit.org/show_bug.cgi?id=184913
1299
1300         Reviewed by Žan Doberšek.
1301
1302         It's currently returning always 0.
1303
1304         * Shared/gtk/WebEventFactory.cpp:
1305         (WebKit::pressedMouseButtons): Helper function to get the pressed mouse buttons.
1306         (WebKit::WebEventFactory::createWebMouseEvent): Pass presssed mouse buttons to constructor instead of 0.
1307         * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
1308         (WebKit::WebAutomationSession::platformSimulateMouseInteraction): Include the mouse buttons state in automation
1309         synthesized events and update m_currentModifiers with the mouse buttons state.
1310         (WebKit::keyCodeForVirtualKey): Do not set the state here.
1311         (WebKit::modifiersForKeyCode): Helper to get the modifiers for a key code.
1312         (WebKit::WebAutomationSession::platformSimulateKeyboardInteraction): Initialize the modifiers also when
1313         virtualKey is std::nullopt;
1314
1315 2018-04-24  Nan Wang  <n_wang@apple.com>
1316
1317         AX: soft link libAccessibility.dylb
1318         https://bugs.webkit.org/show_bug.cgi?id=184919
1319
1320         Reviewed by Dan Bernstein.
1321
1322         Weakly linked libAccessibility.dylib on macOS.
1323
1324         * Configurations/WebKit.xcconfig:
1325         * UIProcess/API/Cocoa/WKWebView.mm:
1326         (-[WKWebView _initializeWithConfiguration:]):
1327         (-[WKWebView _updateAccessibilityEventsEnabled]):
1328
1329 2018-04-24  Fujii Hironori  <Hironori.Fujii@sony.com>
1330
1331         [WinCairo] Add WKView and WKAPI
1332         https://bugs.webkit.org/show_bug.cgi?id=182869
1333
1334         Reviewed by Alex Christensen.
1335
1336         Resurrected source files for WebKit for Windows port which was
1337         removed in r139003.
1338
1339         * PlatformWin.cmake: Renamed the output name of WebKit to WebKit2
1340         not to conflict WebKitLegacy. Added source files and include paths.
1341         * UIProcess/API/C/WKAPICast.h:
1342         * UIProcess/API/C/win/WKAPICastWin.h: Added.
1343         * UIProcess/API/C/win/WKView.cpp: Added.
1344         (WKViewCreate):
1345         (WKViewGetWindow):
1346         (WKViewGetPage):
1347         (WKViewSetParentWindow):
1348         (WKViewWindowAncestryDidChange):
1349         (WKViewSetIsInWindow):
1350         (WKViewSetScrollOffsetOnNextResize):
1351         * UIProcess/API/C/win/WKView.h: Added.
1352         * UIProcess/API/win/APIWebsiteDataStoreWin.cpp: Added.
1353         (API::WebsiteDataStore::defaultApplicationCacheDirectory):
1354         (API::WebsiteDataStore::defaultCacheStorageDirectory):
1355         (API::WebsiteDataStore::defaultNetworkCacheDirectory):
1356         (API::WebsiteDataStore::defaultIndexedDBDatabaseDirectory):
1357         (API::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory):
1358         (API::WebsiteDataStore::defaultLocalStorageDirectory):
1359         (API::WebsiteDataStore::defaultMediaKeysStorageDirectory):
1360         (API::WebsiteDataStore::defaultWebSQLDatabaseDirectory):
1361         (API::WebsiteDataStore::defaultResourceLoadStatisticsDirectory):
1362         (API::WebsiteDataStore::cacheDirectoryFileSystemRepresentation):
1363         (API::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation):
1364         (API::WebsiteDataStore::defaultDataStoreConfiguration):
1365         * UIProcess/Launcher/ProcessLauncher.h:
1366         * UIProcess/Launcher/win/ProcessLauncherWin.cpp: Added.
1367         (WebKit::processName):
1368         (WebKit::ProcessLauncher::launchProcess):
1369         (WebKit::ProcessLauncher::terminateProcess):
1370         (WebKit::ProcessLauncher::platformInvalidate):
1371         * UIProcess/Network/NetworkProcessProxy.cpp:
1372         (WebKit::NetworkProcessProxy::networkProcessFailedToLaunch):
1373         (WebKit::NetworkProcessProxy::didCreateNetworkConnectionToWebProcess):
1374         * UIProcess/WebsiteData/win/WebsiteDataStoreWin.cpp: Added.
1375         (WebKit::WebsiteDataStore::platformInitialize):
1376         (WebKit::WebsiteDataStore::platformDestroy):
1377         (WebKit::WebsiteDataStore::platformRemoveRecentSearches):
1378         * UIProcess/win/PageClientImpl.cpp: Added.
1379         (WebKit::PageClientImpl::PageClientImpl):
1380         (WebKit::PageClientImpl::createDrawingAreaProxy):
1381         (WebKit::PageClientImpl::setViewNeedsDisplay):
1382         (WebKit::PageClientImpl::requestScroll):
1383         (WebKit::PageClientImpl::viewScrollPosition):
1384         (WebKit::PageClientImpl::viewSize):
1385         (WebKit::PageClientImpl::isViewWindowActive):
1386         (WebKit::PageClientImpl::isViewFocused):
1387         (WebKit::PageClientImpl::isViewVisible):
1388         (WebKit::PageClientImpl::isViewInWindow):
1389         (WebKit::PageClientImpl::PageClientImpl::processDidExit):
1390         (WebKit::PageClientImpl::didRelaunchProcess):
1391         (WebKit::PageClientImpl::toolTipChanged):
1392         (WebKit::PageClientImpl::setCursor):
1393         (WebKit::PageClientImpl::setCursorHiddenUntilMouseMoves):
1394         (WebKit::PageClientImpl::didChangeViewportProperties):
1395         (WebKit::PageClientImpl::registerEditCommand):
1396         (WebKit::PageClientImpl::clearAllEditCommands):
1397         (WebKit::PageClientImpl::canUndoRedo):
1398         (WebKit::PageClientImpl::executeUndoRedo):
1399         (WebKit::PageClientImpl::convertToDeviceSpace):
1400         (WebKit::PageClientImpl::convertToUserSpace):
1401         (WebKit::PageClientImpl::screenToRootView):
1402         (WebKit::PageClientImpl::rootViewToScreen):
1403         (WebKit::PageClientImpl::doneWithKeyEvent):
1404         (WebKit::PageClientImpl::createPopupMenuProxy):
1405         (WebKit::PageClientImpl::createContextMenuProxy):
1406         (WebKit::createColorPicker):
1407         (WebKit::PageClientImpl::enterAcceleratedCompositingMode):
1408         (WebKit::PageClientImpl::exitAcceleratedCompositingMode):
1409         (WebKit::PageClientImpl::updateAcceleratedCompositingMode):
1410         (WebKit::PageClientImpl::pageClosed):
1411         (WebKit::PageClientImpl::preferencesDidChange):
1412         (WebKit::PageClientImpl::didChangeContentSize):
1413         (WebKit::PageClientImpl::handleDownloadRequest):
1414         (WebKit::PageClientImpl::didCommitLoadForMainFrame):
1415         (WebKit::PageClientImpl::fullScreenManagerProxyClient):
1416         (WebKit::PageClientImpl::closeFullScreenManager):
1417         (WebKit::PageClientImpl::isFullScreen):
1418         (WebKit::PageClientImpl::enterFullScreen):
1419         (WebKit::PageClientImpl::exitFullScreen):
1420         (WebKit::PageClientImpl::beganEnterFullScreen):
1421         (WebKit::PageClientImpl::beganExitFullScreen):
1422         (WebKit::PageClientImpl::doneWithTouchEvent):
1423         (WebKit::PageClientImpl::wheelEventWasNotHandledByWebCore):
1424         (WebKit::PageClientImpl::didFinishLoadingDataForCustomContentProvider):
1425         (WebKit::PageClientImpl::navigationGestureDidBegin):
1426         (WebKit::PageClientImpl::navigationGestureWillEnd):
1427         (WebKit::PageClientImpl::navigationGestureDidEnd):
1428         (WebKit::PageClientImpl::willRecordNavigationSnapshot):
1429         (WebKit::PageClientImpl::didRemoveNavigationGestureSnapshot):
1430         (WebKit::PageClientImpl::didFirstVisuallyNonEmptyLayoutForMainFrame):
1431         (WebKit::PageClientImpl::didFinishLoadForMainFrame):
1432         (WebKit::PageClientImpl::didSameDocumentNavigationForMainFrame):
1433         (WebKit::PageClientImpl::didChangeBackgroundColor):
1434         (WebKit::PageClientImpl::isPlayingAudioWillChange):
1435         (WebKit::PageClientImpl::isPlayingAudioDidChange):
1436         (WebKit::PageClientImpl::refView):
1437         (WebKit::PageClientImpl::derefView):
1438         * UIProcess/win/PageClientImpl.h: Added.
1439         * UIProcess/win/TextCheckerWin.cpp: Added.
1440         (WebKit::checkerState):
1441         (WebKit::TextChecker::state):
1442         (WebKit::TextChecker::setTestingMode):
1443         (WebKit::TextChecker::isTestingMode):
1444         (WebKit::TextChecker::isContinuousSpellCheckingAllowed):
1445         (WebKit::TextChecker::setContinuousSpellCheckingEnabled):
1446         (WebKit::TextChecker::setGrammarCheckingEnabled):
1447         (WebKit::TextChecker::continuousSpellCheckingEnabledStateChanged):
1448         (WebKit::TextChecker::grammarCheckingEnabledStateChanged):
1449         (WebKit::TextChecker::uniqueSpellDocumentTag):
1450         (WebKit::TextChecker::closeSpellDocumentWithTag):
1451         (WebKit::TextChecker::checkSpellingOfString):
1452         (WebKit::TextChecker::checkGrammarOfString):
1453         (WebKit::TextChecker::spellingUIIsShowing):
1454         (WebKit::TextChecker::toggleSpellingUIIsShowing):
1455         (WebKit::TextChecker::updateSpellingUIWithMisspelledWord):
1456         (WebKit::TextChecker::updateSpellingUIWithGrammarString):
1457         (WebKit::TextChecker::getGuessesForWord):
1458         (WebKit::TextChecker::learnWord):
1459         (WebKit::TextChecker::ignoreWord):
1460         (WebKit::TextChecker::requestCheckingOfString):
1461         (WebKit::TextChecker::checkTextOfParagraph):
1462         * UIProcess/win/WebContextMenuProxyWin.cpp: Added.
1463         (WebKit::WebContextMenuProxyWin::show):
1464         (WebKit::WebContextMenuProxyWin::showContextMenuWithItems):
1465         (WebKit::WebContextMenuProxyWin::WebContextMenuProxyWin):
1466         (WebKit::WebContextMenuProxyWin::~WebContextMenuProxyWin):
1467         * UIProcess/win/WebContextMenuProxyWin.h: Added.
1468         (WebKit::WebContextMenuProxyWin::create):
1469         * UIProcess/win/WebInspectorProxyWin.cpp: Added.
1470         (WebKit::WebInspectorProxy::platformCreateFrontendPage):
1471         (WebKit::WebInspectorProxy::platformCreateFrontendWindow):
1472         (WebKit::WebInspectorProxy::platformCloseFrontendPageAndWindow):
1473         (WebKit::WebInspectorProxy::platformDidCloseForCrash):
1474         (WebKit::WebInspectorProxy::platformInvalidate):
1475         (WebKit::WebInspectorProxy::platformHide):
1476         (WebKit::WebInspectorProxy::platformBringToFront):
1477         (WebKit::WebInspectorProxy::platformBringInspectedPageToFront):
1478         (WebKit::WebInspectorProxy::platformIsFront):
1479         (WebKit::WebInspectorProxy::platformInspectedURLChanged):
1480         (WebKit::WebInspectorProxy::inspectorPageURL):
1481         (WebKit::WebInspectorProxy::inspectorTestPageURL):
1482         (WebKit::WebInspectorProxy::inspectorBaseURL):
1483         (WebKit::WebInspectorProxy::platformInspectedWindowHeight):
1484         (WebKit::WebInspectorProxy::platformInspectedWindowWidth):
1485         (WebKit::WebInspectorProxy::platformAttach):
1486         (WebKit::WebInspectorProxy::platformDetach):
1487         (WebKit::WebInspectorProxy::platformSetAttachedWindowHeight):
1488         (WebKit::WebInspectorProxy::platformSetAttachedWindowWidth):
1489         (WebKit::WebInspectorProxy::platformStartWindowDrag):
1490         (WebKit::WebInspectorProxy::platformSave):
1491         (WebKit::WebInspectorProxy::platformAppend):
1492         (WebKit::WebInspectorProxy::platformAttachAvailabilityChanged):
1493         * UIProcess/win/WebPageProxyWin.cpp: Added.
1494         (WebKit::WebPageProxy::platformInitialize):
1495         (WebKit::WebPageProxy::standardUserAgent):
1496         (WebKit::WebPageProxy::saveRecentSearches):
1497         (WebKit::WebPageProxy::loadRecentSearches):
1498         (WebKit::WebPageProxy::editorStateChanged):
1499         * UIProcess/win/WebPreferencesWin.cpp: Added.
1500         (WebKit::WebPreferences::platformInitializeStore):
1501         (WebKit::WebPreferences::platformUpdateStringValueForKey):
1502         (WebKit::WebPreferences::platformUpdateBoolValueForKey):
1503         (WebKit::WebPreferences::platformUpdateUInt32ValueForKey):
1504         (WebKit::WebPreferences::platformUpdateDoubleValueForKey):
1505         (WebKit::WebPreferences::platformUpdateFloatValueForKey):
1506         (WebKit::WebPreferences::platformGetStringUserValueForKey):
1507         (WebKit::WebPreferences::platformGetBoolUserValueForKey):
1508         (WebKit::WebPreferences::platformGetUInt32UserValueForKey):
1509         (WebKit::WebPreferences::platformGetDoubleUserValueForKey):
1510         * UIProcess/win/WebProcessPoolWin.cpp: Added.
1511         (WebKit::WebProcessPool::platformInitialize):
1512         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
1513         (WebKit::WebProcessPool::platformInitializeWebProcess):
1514         (WebKit::WebProcessPool::platformInvalidateContext):
1515         (WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory):
1516         (WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory):
1517         (WebKit::WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory):
1518         (WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory):
1519         (WebKit::WebProcessPool::legacyPlatformDefaultLocalStorageDirectory):
1520         (WebKit::WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory):
1521         (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
1522         (WebKit::WebProcessPool::legacyPlatformDefaultJavaScriptConfigurationDirectory):
1523         (WebKit::WebProcessPool::platformResolvePathsForSandboxExtensions):
1524         * UIProcess/win/WebView.cpp: Added.
1525         (WebKit::WebView::WebViewWndProc):
1526         (WebKit::WebView::wndProc):
1527         (WebKit::WebView::registerWebViewWindowClass):
1528         (WebKit::WebView::WebView):
1529         (WebKit::WebView::~WebView):
1530         (WebKit::WebView::initialize):
1531         (WebKit::WebView::setParentWindow):
1532         (WebKit::findTopLevelParentWindow):
1533         (WebKit::WebView::windowAncestryDidChange):
1534         (WebKit::WebView::onMouseEvent):
1535         (WebKit::WebView::onWheelEvent):
1536         (WebKit::WebView::onHorizontalScroll):
1537         (WebKit::WebView::onVerticalScroll):
1538         (WebKit::WebView::onKeyEvent):
1539         (WebKit::drawPageBackground):
1540         (WebKit::WebView::paint):
1541         (WebKit::WebView::onPaintEvent):
1542         (WebKit::WebView::onPrintClientEvent):
1543         (WebKit::WebView::onSizeEvent):
1544         (WebKit::WebView::onWindowPositionChangedEvent):
1545         (WebKit::WebView::onSetFocusEvent):
1546         (WebKit::WebView::onKillFocusEvent):
1547         (WebKit::WebView::onTimerEvent):
1548         (WebKit::WebView::onShowWindowEvent):
1549         (WebKit::WebView::onSetCursor):
1550         (WebKit::WebView::updateActiveState):
1551         (WebKit::WebView::updateActiveStateSoon):
1552         (WebKit::initCommonControls):
1553         (WebKit::WebView::initializeToolTipWindow):
1554         (WebKit::WebView::startTrackingMouseLeave):
1555         (WebKit::WebView::stopTrackingMouseLeave):
1556         (WebKit::WebView::shouldInitializeTrackPointHack):
1557         (WebKit::WebView::close):
1558         (WebKit::WebView::cursorToShow const):
1559         (WebKit::WebView::updateNativeCursor):
1560         (WebKit::WebView::setOverrideCursor):
1561         (WebKit::WebView::setIsInWindow):
1562         (WebKit::WebView::setIsVisible):
1563         (WebKit::WebView::isWindowActive):
1564         (WebKit::WebView::isFocused):
1565         (WebKit::WebView::isVisible):
1566         (WebKit::WebView::isInWindow):
1567         (WebKit::WebView::setScrollOffsetOnNextResize):
1568         (WebKit::WebView::setViewNeedsDisplay):
1569         (WebKit::WebView::createColorChooserProxy):
1570         (WebKit::WebView::didCommitLoadForMainFrame):
1571         (WebKit::WebView::customRepresentationZoomFactor):
1572         (WebKit::WebView::setCustomRepresentationZoomFactor):
1573         (WebKit::WebView::findStringInCustomRepresentation):
1574         (WebKit::WebView::countStringMatchesInCustomRepresentation):
1575         (WebKit::WebView::nativeWindow):
1576         (WebKit::WebView::windowReceivedMessage):
1577         * UIProcess/win/WebView.h: Added.
1578         (WebKit::WebView::create):
1579         (WebKit::WebView::window const):
1580         (WebKit::WebView::page const):
1581         (WebKit::WebView::drawingArea):
1582         (WebKit::WebView::setWasActivatedByMouseEvent):
1583
1584 2018-04-24  Fujii Hironori  <Hironori.Fujii@sony.com>
1585
1586         Implement Same-Site cookies
1587         https://bugs.webkit.org/show_bug.cgi?id=159464
1588         <rdar://problem/27196358>
1589
1590         Unreviewed build fix.
1591
1592         WinCairo WebKit2 can't compile since r230921.
1593
1594         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
1595         (WebKit::NetworkDataTaskCurl::appendCookieHeader):
1596         CookieJarCurlDatabase::cookieRequestHeaderFieldValue needs
1597         SameSiteInfo.
1598
1599 2018-04-24  Simon Fraser  <simon.fraser@apple.com>
1600
1601         Add a new "color-filter" CSS property as an experimental feature
1602         https://bugs.webkit.org/show_bug.cgi?id=184940
1603
1604         Reviewed by Jon Lee.
1605         
1606         Add the color-filter property as an experimental feature.
1607
1608         * Shared/WebPreferences.yaml:
1609
1610 2018-04-24  Saam Barati  <sbarati@apple.com>
1611
1612         Keep around a pre-warmed process when doing process swap on navigation
1613         https://bugs.webkit.org/show_bug.cgi?id=184765
1614         <rdar://problem/39685099>
1615
1616         Reviewed by Ryosuke Niwa and Brady Eidson.
1617
1618         This patch makes it so that WebProcessPool prewarms a process when process
1619         swap on navigation is turned on. When we do a process swap on navigation,
1620         we first try to grab a prewarmed process before creating a new one.
1621         
1622         We try to be smart about when to create these processes. The initial heuristic
1623         that this patch chooses is when we reach the DidFirstVisuallyNonEmptyLayout
1624         layout milestone. We're going to try to improve on this heuristic in:
1625         https://bugs.webkit.org/show_bug.cgi?id=184899
1626         
1627         This is a 40% progression on PLT with process swap on navigation turned on.
1628
1629         * UIProcess/API/Cocoa/WKProcessPool.mm:
1630         (-[WKProcessPool _prewarmedWebProcessCount]):
1631         (-[WKProcessPool _webProcessCountIgnoringPrewarmed]):
1632         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1633         * UIProcess/ServiceWorkerProcessProxy.cpp:
1634         (WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
1635         * UIProcess/WebPageProxy.cpp:
1636         (WebKit::WebPageProxy::notifyProcessPoolToPrewarm):
1637         (WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame):
1638         * UIProcess/WebPageProxy.h:
1639         * UIProcess/WebProcessPool.cpp:
1640         (WebKit::WebProcessPool::createNewWebProcess):
1641         (WebKit::WebProcessPool::tryTakePrewarmedProcess):
1642         (WebKit::WebProcessPool::warmInitialProcess):
1643         (WebKit::WebProcessPool::disconnectProcess):
1644         (WebKit::WebProcessPool::createWebPage):
1645         (WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
1646         (WebKit::WebProcessPool::processForNavigation):
1647         * UIProcess/WebProcessPool.h:
1648         * UIProcess/WebProcessProxy.cpp:
1649         (WebKit::WebProcessProxy::create):
1650         (WebKit::WebProcessProxy::WebProcessProxy):
1651         (WebKit::m_isInPrewarmedPool):
1652         (WebKit::m_userMediaCaptureManagerProxy): Deleted.
1653         * UIProcess/WebProcessProxy.h:
1654         (WebKit::WebProcessProxy::isInPrewarmedPool const):
1655         (WebKit::WebProcessProxy::setIsInPrewarmedPool):
1656
1657 2018-04-24  Commit Queue  <commit-queue@webkit.org>
1658
1659         Unreviewed, rolling out r230971.
1660         https://bugs.webkit.org/show_bug.cgi?id=184939
1661
1662         This fix was not appropriate (Requested by n_wang on #webkit).
1663
1664         Reverted changeset:
1665
1666         "AX: soft link libAccessibility.dylb"
1667         https://bugs.webkit.org/show_bug.cgi?id=184919
1668         https://trac.webkit.org/changeset/230971
1669
1670 2018-04-24  Nan Wang  <n_wang@apple.com>
1671
1672         AX: soft link libAccessibility.dylb
1673         https://bugs.webkit.org/show_bug.cgi?id=184919
1674
1675         Reviewed by Chris Fleizach.
1676
1677         Make sure we soft link the library so that it won't crash
1678         if it's missing in the system.
1679
1680         * Configurations/WebKit.xcconfig:
1681         * UIProcess/API/Cocoa/WKWebView.mm:
1682         (-[WKWebView _initializeWithConfiguration:]):
1683         (-[WKWebView _updateAccessibilityEventsEnabled]):
1684
1685 2018-04-24  John Wilander  <wilander@apple.com>
1686
1687         From-Origin: Support for 'same' and 'same-site' response header, nested frame origin check
1688         https://bugs.webkit.org/show_bug.cgi?id=184560
1689         <rdar://problem/38901344>
1690
1691         Reviewed by Youenn Fablet and Daniel Bates.
1692
1693         This patch implements significant parts of https://github.com/whatwg/fetch/issues/687.
1694         We consume the From-Origin response header and only load the resource if:
1695         - The header is non-existent, empty, or invalid.
1696         - The header specifies 'same' and the resource's origin matches the originating
1697           document's origin and the origins up the frame tree.
1698         - The header specifies 'same-site' and the resource's eTLD+1 matches the originating
1699           document's eTLD+1 and the eTLD+1 of the documents up the frame tree.
1700
1701         This feature is experimental and off by default.
1702
1703         * NetworkProcess/NetworkResourceLoadParameters.cpp:
1704         (WebKit::NetworkResourceLoadParameters::encode const):
1705         (WebKit::NetworkResourceLoadParameters::decode):
1706             Support for the two new load parameters:
1707             - shouldEnableFromOriginResponseHeader
1708             - frameAncestorOrigins
1709         * NetworkProcess/NetworkResourceLoadParameters.h:
1710         * NetworkProcess/NetworkResourceLoader.cpp:
1711         (WebKit::areFrameAncestorsSameSite):
1712         (WebKit::areFrameAncestorsSameOrigin):
1713         (WebKit::shouldCancelCrossOriginLoad):
1714             The three functions above implement the new blocking logic.
1715         (WebKit::fromOriginResourceError):
1716             Convenience function that returns an error with the From-Origin error message.
1717         (WebKit::NetworkResourceLoader::didReceiveResponse):
1718             Now checks for a From-Origin response header.
1719         (WebKit::NetworkResourceLoader::didFailLoading):
1720             Now checks for a From-Origin response header.
1721         (WebKit::NetworkResourceLoader::continueWillSendRedirectedRequest):
1722             Now checks for a From-Origin response header.
1723         (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
1724             Now checks for a From-Origin response header.
1725         (WebKit::NetworkResourceLoader::dispatchWillSendRequestForCacheEntry):
1726             Now checks for a From-Origin response header.
1727         * Shared/WebCoreArgumentCoders.cpp:
1728         (IPC::ArgumentCoder<Vector<RefPtr<SecurityOrigin>>>::encode):
1729         (IPC::ArgumentCoder<Vector<RefPtr<SecurityOrigin>>>::decode):
1730             Now encodes and decodes vectors of RefPtr<WebCore::SecurityOrigin>.
1731         * Shared/WebCoreArgumentCoders.h:
1732         * Shared/WebPreferences.yaml:
1733             Added From-Origin support as an experimental feature.
1734         * UIProcess/API/C/WKPreferences.cpp:
1735         (WKPreferencesSetFromOriginResponseHeaderEnabled):
1736         (WKPreferencesGetFromOriginResponseHeaderEnabled):
1737         * UIProcess/API/C/WKPreferencesRef.h:
1738         * WebProcess/Network/WebLoaderStrategy.cpp:
1739         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
1740             Sets the two new load parameters:
1741             - shouldEnableFromOriginResponseHeader
1742             - frameAncestorOrigins
1743
1744 2018-04-24  Jer Noble  <jer.noble@apple.com>
1745
1746         Don't add system framework paths to FRAMEWORK_SEARCH_PATHS
1747         https://bugs.webkit.org/show_bug.cgi?id=184786
1748
1749         Reviewed by Tim Horton.
1750
1751         * Configurations/BaseTarget.xcconfig:
1752         * DerivedSources.make:
1753
1754 2018-04-24  Ryan Haddad  <ryanhaddad@apple.com>
1755
1756         Unreviewed, rolling out r230938.
1757
1758         Introduced two ProcessSwap API test failures.
1759
1760         Reverted changeset:
1761
1762         "Keep around a pre-warmed process when doing process swap on
1763         navigation"
1764         https://bugs.webkit.org/show_bug.cgi?id=184765
1765         https://trac.webkit.org/changeset/230938
1766
1767 2018-04-24  Zan Dobersek  <zdobersek@igalia.com>
1768
1769         [CoordGraphics] Remove dead fixed layer code
1770         https://bugs.webkit.org/show_bug.cgi?id=184912
1771
1772         Reviewed by Michael Catanzaro.
1773
1774         Drop the unused fixed layer handling  code in CoordinatedGraphicsScene.
1775         The m_fixedLayers container can be removed, along with the
1776         adjustPositionForFixedLayers() method that operated on that container.
1777
1778         This was the only method that operated with the m_scrollPosition member
1779         variable and the contentsPosition argument that's passed to the
1780         CoordinatedGraphicsScene::paintToCurrentGLContext() method. Both of
1781         these are removed, along with the scrollPosition attribute on the
1782         CoordinatedGraphicsState struct.
1783
1784         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1785         (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
1786         (WebKit::CoordinatedGraphicsScene::setLayerState):
1787         (WebKit::CoordinatedGraphicsScene::deleteLayer):
1788         (WebKit::CoordinatedGraphicsScene::commitSceneState):
1789         (WebKit::CoordinatedGraphicsScene::purgeGLResources):
1790         (WebKit::CoordinatedGraphicsScene::adjustPositionForFixedLayers): Deleted.
1791         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
1792         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1793         (WebKit::ThreadedCompositor::renderLayerTree):
1794         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
1795         (WebKit::CompositingCoordinator::flushPendingLayerChanges):
1796
1797 2018-04-24  Zan Dobersek  <zdobersek@igalia.com>
1798
1799         REGRESSION(r230950): Faulty commit sequencing in CoordinatedGraphicsScene
1800         https://bugs.webkit.org/show_bug.cgi?id=184917
1801
1802         Reviewed by Michael Catanzaro.
1803
1804         After r230950, current animation state for a given layer is also taken
1805         into account when determining whether or not the layer requires a
1806         backing store. For that to work properly, all the animation state has
1807         to be updated before the backing store work. This patch changes the
1808         order of helper method invocations in
1809         CoordinatedGraphicsScene::setLayerState() to address that.
1810
1811         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1812         (WebKit::CoordinatedGraphicsScene::setLayerState):
1813
1814 2018-04-24  Zan Dobersek  <zdobersek@igalia.com>
1815
1816         [CoordGraphics] Remove unused fixed layout functionality
1817         https://bugs.webkit.org/show_bug.cgi?id=184908
1818
1819         Reviewed by Carlos Garcia Campos.
1820
1821         Ports using the CoordinatedGraphics subsystem don't expose fixed layout
1822         support. As such, we're able to remove a lot of unused code and
1823         unnecessary USE(COORDINATED_GRAPHICS) special cases in generic sections
1824         in both WebCore and WebKit.
1825
1826         Remove USE(COORDINATED_GRAPHICS) special-casing from the
1827         WebPage::setUseFixedLayout() method. This is not possible to enable for
1828         the GTK+ and WPE ports that use the CoordinatedGraphics subsytem via
1829         API. Removing all this unlocks removing considerable amounts of dead
1830         code and complexities in CoordinatedGraphics.
1831
1832         WebChromeClient::delegatedScrollRequested() method is removed, along
1833         with the WebPage::pageDidRequestScroll() method that was only called
1834         from there.
1835
1836         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1837         (WebKit::WebChromeClient::delegatedScrollRequested): Deleted.
1838         * WebProcess/WebCoreSupport/WebChromeClient.h:
1839         * WebProcess/WebPage/WebPage.cpp:
1840         (WebKit::WebPage::setUseFixedLayout):
1841         (WebKit::WebPage::pageDidRequestScroll): Deleted.
1842         * WebProcess/WebPage/WebPage.h:
1843
1844 2018-04-24  Zan Dobersek  <zdobersek@igalia.com>
1845
1846         [CoordGraphics] Avoid painting backing stores for zero-opacity layers
1847         https://bugs.webkit.org/show_bug.cgi?id=184143
1848
1849         Reviewed by Carlos Garcia Campos.
1850
1851         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1852         (WebKit::layerShouldHaveBackingStore):
1853         Mirror CoordinatedGraphicsLayer's backing store requirements.
1854
1855 2018-04-23  Daniel Bates  <dabates@apple.com>
1856
1857         Implement Same-Site cookies
1858         https://bugs.webkit.org/show_bug.cgi?id=159464
1859         <rdar://problem/27196358>
1860
1861         Reviewed by Brent Fulgham.
1862
1863         Pass the Same-Site info through the WebKit abstractions.
1864
1865         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1866         (WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
1867         (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
1868         (WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue):
1869         (WebKit::NetworkConnectionToWebProcess::getRawCookies):
1870         * NetworkProcess/NetworkConnectionToWebProcess.h:
1871         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1872         * NetworkProcess/NetworkResourceLoader.cpp:
1873         (WebKit::NetworkResourceLoader::logCookieInformation const):
1874         (WebKit::logBlockedCookieInformation):
1875         (logCookieInformationInternal):
1876         (NetworkResourceLoader::logCookieInformation):
1877         * NetworkProcess/NetworkResourceLoader.h:
1878         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
1879         (WebKit::NetworkCache::constructRevalidationRequest):
1880         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
1881         (WebKit::NetworkCache::SubresourceInfo::encode const):
1882         (WebKit::NetworkCache::SubresourceInfo::decode):
1883         (WebKit::NetworkCache::SubresourceInfo::SubresourceInfo):
1884         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
1885         (WebKit::NetworkCache::SubresourceInfo::isSameSite const):
1886         (WebKit::NetworkCache::SubresourceInfo::isTopSite const): Returns false; subresources do not represent
1887         a top-level navigation.
1888         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1889         (WebKit::NetworkDataTaskCocoa::isThirdPartyRequest):
1890         (WebKit::updateTaskWithFirstPartyForSameSiteCookies):
1891         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
1892         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
1893         * UIProcess/WebProcessPool.cpp:
1894         (WebKit::WebProcessPool::download):
1895         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1896         (WebKit::WebPlatformStrategies::cookiesForDOM):
1897         (WebKit::WebPlatformStrategies::setCookiesFromDOM):
1898         (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue):
1899         (WebKit::WebPlatformStrategies::getRawCookies):
1900         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1901
1902 2018-04-23  Youenn Fablet  <youenn@apple.com>
1903
1904         Make WebLoaderStrategy send to NetworkResourceLoader necessary parameters to handle full loads in NetworkProcess
1905         https://bugs.webkit.org/show_bug.cgi?id=184763
1906
1907         Reviewed by Chris Dumez.
1908
1909         Set all required NetworkResourceLoadParameters for asynchronous loads.
1910         This includes preflight policy, CSP response headers, SecurityOrigin and content blockers identifier.
1911
1912         Update NetworkLoadChecker to handle preflight policy.
1913         This is not needed right now since sync XHR and ping loads are using the default ConsiderPreflight policy.
1914         But this will be needed for XHR/fetch/EventSource loads. 
1915
1916         * NetworkProcess/NetworkLoadChecker.cpp:
1917         (WebKit::NetworkLoadChecker::NetworkLoadChecker):
1918         (WebKit::NetworkLoadChecker::checkRedirection):
1919         (WebKit::NetworkLoadChecker::validateResponse):
1920         (WebKit::NetworkLoadChecker::checkCORSRequest):
1921         * NetworkProcess/NetworkLoadChecker.h:
1922         (WebKit::NetworkLoadChecker::create):
1923         * NetworkProcess/NetworkResourceLoadParameters.cpp:
1924         (WebKit::NetworkResourceLoadParameters::encode const):
1925         (WebKit::NetworkResourceLoadParameters::decode):
1926         * NetworkProcess/NetworkResourceLoadParameters.h:
1927         * NetworkProcess/NetworkResourceLoader.cpp:
1928         * NetworkProcess/PingLoad.cpp:
1929         (WebKit::PingLoad::PingLoad):
1930         * WebProcess/Network/WebLoaderStrategy.cpp:
1931         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
1932
1933 2018-04-23  Wenson Hsieh  <wenson_hsieh@apple.com>
1934
1935         [Extra zoom mode] REGRESSION(230860) Unable to change time input values using UI
1936         https://bugs.webkit.org/show_bug.cgi?id=184901
1937         <rdar://problem/39664797>
1938
1939         Reviewed by Tim Horton.
1940
1941         Fixes the bug by falling back to setting the value of the focused input element in the case where the selection
1942         is not editable. Also adds plumbing to make time pickers testable in extra zoom mode.
1943
1944         * UIProcess/API/Cocoa/WKWebView.mm:
1945         (-[WKWebView setTimePickerValueToHour:minute:]):
1946         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1947         * UIProcess/ios/WKContentViewInteraction.h:
1948         * UIProcess/ios/WKContentViewInteraction.mm:
1949         (-[WKContentView setTimePickerValueToHour:minute:]):
1950
1951         Add plumbing to make it possible for WebKitTestRunner to simulate picking a time from the given hours and
1952         minutes. This is currently only implemented for extra zoom mode, but may be implemented for UIKit's time picker
1953         as well in the future by adjusting -[WKContentView setTimePickerValueToHour:minute:].
1954
1955         * WebProcess/WebPage/WebPage.cpp:
1956         (WebKit::WebPage::setTextAsync):
1957
1958 2018-04-23  Saam Barati  <sbarati@apple.com>
1959
1960         Keep around a pre-warmed process when doing process swap on navigation
1961         https://bugs.webkit.org/show_bug.cgi?id=184765
1962
1963         Reviewed by Ryosuke Niwa.
1964
1965         This patch makes it so that WebProcessPool prewarms a process when process
1966         swap on navigation is turned on. When we do a process swap on navigation,
1967         we first try to grab a prewarmed process before creating a new one.
1968         
1969         We try to be smart about when to create these processes. The initial heuristic
1970         that this patch chooses is when we reach the DidFirstVisuallyNonEmptyLayout
1971         layout milestone. We're going to try to improve on this heuristic in:
1972         https://bugs.webkit.org/show_bug.cgi?id=184899
1973         
1974         This is a 40% progression on PLT with process swap on navigation turned on.
1975
1976         * UIProcess/ServiceWorkerProcessProxy.cpp:
1977         (WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
1978         * UIProcess/WebPageProxy.cpp:
1979         (WebKit::WebPageProxy::notifyProcessPoolToPrewarm):
1980         (WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame):
1981         * UIProcess/WebPageProxy.h:
1982         * UIProcess/WebProcessPool.cpp:
1983         (WebKit::WebProcessPool::createNewWebProcess):
1984         (WebKit::WebProcessPool::tryTakePrewarmedProcess):
1985         (WebKit::WebProcessPool::warmInitialProcess):
1986         (WebKit::WebProcessPool::disconnectProcess):
1987         (WebKit::WebProcessPool::createWebPage):
1988         (WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
1989         (WebKit::WebProcessPool::processForNavigation):
1990         * UIProcess/WebProcessPool.h:
1991         * UIProcess/WebProcessProxy.cpp:
1992         (WebKit::WebProcessProxy::create):
1993         (WebKit::WebProcessProxy::WebProcessProxy):
1994         (WebKit::m_isInPrewarmedPool):
1995         (WebKit::m_userMediaCaptureManagerProxy): Deleted.
1996         * UIProcess/WebProcessProxy.h:
1997         (WebKit::WebProcessProxy::isInPrewarmedPool const):
1998         (WebKit::WebProcessProxy::setIsInPrewarmedPool):
1999
2000 2018-04-23  Michael Catanzaro  <mcatanzaro@igalia.com>
2001
2002         [WPE][GTK] Remove WlUniquePtr<wl_display> footgun
2003         https://bugs.webkit.org/show_bug.cgi?id=184405
2004
2005         Reviewed by Carlos Garcia Campos.
2006
2007         Switch to std::unique_ptr.
2008
2009         * UIProcess/gtk/WaylandCompositor.cpp:
2010         (WebKit::WaylandCompositor::WaylandCompositor):
2011         * UIProcess/gtk/WaylandCompositor.h:
2012         (WebKit::WaylandCompositor::DisplayDeleter::operator()):
2013
2014 2018-04-23  Daniel Bates  <dabates@apple.com>
2015
2016         Attempt to fix the Apple Internal build following r230921
2017         (https://bugs.webkit.org/show_bug.cgi?id=159464)
2018
2019         Forward declare some SPI. Add availability guard.
2020
2021         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2022
2023 2018-04-23  Zalan Bujtas  <zalan@apple.com>
2024
2025         [LayoutFormattingContext] Initial commit.
2026         https://bugs.webkit.org/show_bug.cgi?id=184896
2027
2028         Reviewed by Antti Koivisto.
2029
2030         * Configurations/FeatureDefines.xcconfig:
2031
2032 2018-04-23  Daniel Bates  <dabates@apple.com>
2033
2034         Implement Same-Site cookies
2035         https://bugs.webkit.org/show_bug.cgi?id=159464
2036         <rdar://problem/27196358>
2037
2038         Reviewed by Brent Fulgham.
2039
2040         Pass the Same-Site info through the WebKit abstractions.
2041
2042         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2043         (WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
2044         (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
2045         (WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue):
2046         (WebKit::NetworkConnectionToWebProcess::getRawCookies):
2047         * NetworkProcess/NetworkConnectionToWebProcess.h:
2048         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2049         * NetworkProcess/NetworkResourceLoader.cpp:
2050         (WebKit::NetworkResourceLoader::logCookieInformation const):
2051         (WebKit::logBlockedCookieInformation):
2052         (logCookieInformationInternal):
2053         (NetworkResourceLoader::logCookieInformation):
2054         * NetworkProcess/NetworkResourceLoader.h:
2055         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
2056         (WebKit::NetworkCache::constructRevalidationRequest):
2057         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
2058         (WebKit::NetworkCache::SubresourceInfo::encode const):
2059         (WebKit::NetworkCache::SubresourceInfo::decode):
2060         (WebKit::NetworkCache::SubresourceInfo::SubresourceInfo):
2061         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
2062         (WebKit::NetworkCache::SubresourceInfo::isSameSite const):
2063         (WebKit::NetworkCache::SubresourceInfo::isTopSite const): Returns false; subresources do not represent
2064         a top-level navigation.
2065         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2066         (WebKit::NetworkDataTaskCocoa::isThirdPartyRequest):
2067         (WebKit::updateTaskWithFirstPartyForSameSiteCookies):
2068         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
2069         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
2070         * UIProcess/WebProcessPool.cpp:
2071         (WebKit::WebProcessPool::download):
2072         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2073         (WebKit::WebPlatformStrategies::cookiesForDOM):
2074         (WebKit::WebPlatformStrategies::setCookiesFromDOM):
2075         (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue):
2076         (WebKit::WebPlatformStrategies::getRawCookies):
2077         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
2078
2079 2018-04-23  Chris Dumez  <cdumez@apple.com>
2080
2081         WebProcessProxy frequently re-takes a process assertion for the network process even though is already has one
2082         https://bugs.webkit.org/show_bug.cgi?id=184889
2083         <rdar://problem/38151530>
2084
2085         Reviewed by Brady Eidson.
2086
2087         In ProcessThrottler::updateAssertionNow(), if the new process assertion state is the same
2088         as the existing one, then return early. Otherwise, we would end up calling WebProcessProxy::didSetAssertionState()
2089         for the same assertion state, which would cause duplicate logging but also some unnecessary work.
2090
2091         * UIProcess/ProcessThrottler.cpp:
2092         (WebKit::ProcessThrottler::updateAssertionNow):
2093
2094 2018-04-23  Zan Dobersek  <zdobersek@igalia.com>
2095
2096         [CoordGraphics] Remove unused trajectory cruft in CoordinatedLayerTreeHost, CoordinatedGraphicsLayer
2097         https://bugs.webkit.org/show_bug.cgi?id=184881
2098
2099         Reviewed by Michael Catanzaro.
2100
2101         The CompositingCoordinator::setVisibleContentsRect() method is always
2102         called with a (0,0) FloatPoint value as the trajectory vector parameter,
2103         which is already the default value in TiledBackingStore where this ends
2104         up. Removing this call chain also enables removing some unnecessary and
2105         odd code in the CoordinatedGraphicsLayer class.
2106
2107         This doesn't yet touch the trajectory logic in the TiledBackingStore
2108         class since it's not yet a given this won't be used in the future. But
2109         if that will be necessary, hope is to not use it this way.
2110
2111         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
2112         (WebKit::CompositingCoordinator::setVisibleContentsRect):
2113         (WebKit::CompositingCoordinator::mainContentsLayer): Deleted.
2114         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
2115         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
2116         (WebKit::CoordinatedLayerTreeHost::setVisibleContentsRect):
2117         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
2118         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
2119         (WebKit::ThreadedCoordinatedLayerTreeHost::didChangeViewport):
2120
2121 2018-04-23  Fujii Hironori  <Hironori.Fujii@sony.com>
2122
2123         [Win][WK2] REGRESSION(r230834) 'getpid': identifier not found
2124         https://bugs.webkit.org/show_bug.cgi?id=184877
2125
2126         Reviewed by Yusuke Suzuki.
2127
2128         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
2129         (WebKit::WebBackForwardListProxy::addItem): Use WTF::getCurrentProcessID() instead of getpid().
2130         * WebProcess/WebPage/WebPage.cpp:
2131         (WebKit::WebPage::goToBackForwardItem): Ditto.
2132
2133 2018-04-23  Zan Dobersek  <zdobersek@igalia.com>
2134
2135         [TexMap] Drop RefCounted inheritance off of TextureMapperBackingStore
2136         https://bugs.webkit.org/show_bug.cgi?id=184810
2137
2138         Reviewed by Carlos Garcia Campos.
2139
2140         CoordinatedBackingStore should inherit directly from RefCounted<> now
2141         that TextureMapperBackingStore doesn't anymore.
2142
2143         * Shared/CoordinatedGraphics/CoordinatedBackingStore.h:
2144         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
2145         (WebKit::CoordinatedGraphicsScene::createBackingStoreIfNeeded):
2146
2147 2018-04-22  Zan Dobersek  <zdobersek@igalia.com>
2148
2149         [CoordinatedGraphics] Unused contentsSize, coveredRect attributes in CoordinatedGraphicsState
2150         https://bugs.webkit.org/show_bug.cgi?id=184811
2151
2152         Reviewed by Carlos Garcia Campos.
2153
2154         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
2155         (WebKit::CompositingCoordinator::flushPendingLayerChanges): Stop setting
2156         the removed contentsSize and coveredRect attributes. These were only
2157         ever set to the appropriate values, but were then never used anywhere.
2158
2159 2018-04-22  Matt Baker  <mattbaker@apple.com>
2160
2161         Web Inspector: WebInspectorProxy releases WKWebInspectorProxyObjCAdapter without removing corresponding observer
2162         https://bugs.webkit.org/show_bug.cgi?id=184865
2163         <rdar://problem/37764960>
2164
2165         Reviewed by Brian Burg.
2166
2167         Replace the early return removed in https://bugs.webkit.org/show_bug.cgi?id=177661,
2168         so that WKWebInspectorProxyObjCAdapter and the view controller can be reused
2169         when reopening the Inspector while the WebView is still alive.
2170
2171         * UIProcess/mac/WebInspectorProxyMac.mm:
2172         (WebKit::WebInspectorProxy::platformCreateFrontendPage):
2173
2174 2018-04-22  Paul Knight  <pknight@apple.com>
2175
2176         Add -[WKInputDelegate _webView:decidePolicyForFocusedElement:] so clients can request default focusing behavior
2177         https://bugs.webkit.org/show_bug.cgi?id=184844
2178
2179         Reviewed by Dan Bernstein.
2180
2181         If a client doesn't implement -[_WKInputDelegate _webView:focusShouldStartInputSession:] the default
2182         focus behavior only brings up the keyboard if it's already onscreen, the interaction is user driven,
2183         and other factors that even depend on what feature flags are enabled.
2184
2185         If a client implements _webView:focusShouldStartInputSession:, they don't have a good way to specifiy
2186         they'd like to fall back to the default behavior. This makes it difficult for a client to use the
2187         default in most cases, but sometimes allow programmatic focus from the page, for example.
2188
2189         Add a new delegate method -_webView:decidePolicyForFocusedElement: that returns a new enum type
2190         _WKFocusStartsInputSessionPolicy. Clients can return _WKFocusStartsInputSessionPolicyAuto to request
2191         the default behavior, or _WKFocusStartsInputSessionPolicyAllow / Disallow to directly control whether
2192         the keyboard appears to assist the focused node.
2193
2194         * UIProcess/API/Cocoa/_WKInputDelegate.h:
2195         * UIProcess/ios/WKContentViewInteraction.mm:
2196         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
2197
2198 2018-04-21  Jeremy Jones  <jeremyj@apple.com>
2199
2200         Disable backward and forward navigation swipes while in fullscreen.
2201         https://bugs.webkit.org/show_bug.cgi?id=184656
2202         rdar://problem/36057535
2203
2204         Reviewed by Tim Horton.
2205
2206         Disable navigation swipes while in fullscreen.
2207
2208         * UIProcess/Cocoa/ViewGestureController.cpp:
2209         (WebKit::ViewGestureController::canSwipeInDirection const):
2210
2211 2018-04-21  Youenn Fablet  <youenn@apple.com>
2212
2213         Activate NetworkLoadChecker for media loads
2214         https://bugs.webkit.org/show_bug.cgi?id=184841
2215
2216         Reviewed by Eric Carlson.
2217
2218         Instantiate a NetworkLoadChecker for NetworkResourceLoader for audio/video loads.
2219
2220         Move CORS checks for response after handling of 304 checks.
2221         For 304 checks, we need to do the CORS checks on the validated cached response, not the 304 received response.
2222
2223         Updated ResourceError argument coder to explicitly pass the error type
2224         as some errors created by NetworkLoadChecker would otherwise be received as General errors by WebProcess.
2225         Updated platform data encoding of ResourceError accordingly.
2226
2227         All changes are covered by regular media loading layout tests.
2228
2229         * NetworkProcess/NetworkResourceLoader.cpp:
2230         (WebKit::shouldUseNetworkLoadChecker):
2231         (WebKit::NetworkResourceLoader::didReceiveResponse):
2232         * Shared/WebCoreArgumentCoders.cpp:
2233         (IPC::ArgumentCoder<ResourceError>::encode):
2234         (IPC::ArgumentCoder<ResourceError>::decode):
2235         * Shared/mac/WebCoreArgumentCodersMac.mm:
2236         (IPC::ArgumentCoder<ResourceError>::encodePlatformData):
2237         (IPC::ArgumentCoder<ResourceError>::decodePlatformData):
2238         We need to set the type after decoding the NSError as ResourceError tries to guess the type from NSError data.
2239         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
2240         (IPC::ArgumentCoder<ResourceError>::encodePlatformData):
2241         (IPC::ArgumentCoder<ResourceError>::decodePlatformData):
2242
2243 2018-04-20  Carlos Garcia Campos  <cgarcia@igalia.com>
2244
2245         [SOUP] Do TLS error checking on GTlsConnection::accept-certificate
2246         https://bugs.webkit.org/show_bug.cgi?id=184480
2247
2248         Reviewed by Michael Catanzaro.
2249
2250         Connect to GTlsConnection::accept-certificate signal instead of SoupMessage::notify::tls-errors to perform the
2251         TLS errors check.
2252
2253         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
2254         (WebKit::NetworkDataTaskSoup::createRequest): Do not connect to SoupMessage::notify::tls-errors.
2255         (WebKit::NetworkDataTaskSoup::tlsConnectionAcceptCertificateCallback): Call tlsConnectionAcceptCertificate() is
2256         the task is still ongoing.
2257         (WebKit::NetworkDataTaskSoup::tlsConnectionAcceptCertificate): Check TLS errors here.
2258         (WebKit::NetworkDataTaskSoup::networkEventCallback): Pass the stream to networkEvent.
2259         (WebKit::NetworkDataTaskSoup::networkEvent): Connect to GTlsConnection::accept-certificate.
2260         * NetworkProcess/soup/NetworkDataTaskSoup.h:
2261
2262 2018-04-20  Timothy Hatcher  <timothy@apple.com>
2263
2264         NULL dereference crash sometimes under [super initWithCoder:] in WebView
2265
2266         https://bugs.webkit.org/show_bug.cgi?id=184851
2267         rdar://problem/39611236
2268
2269         Reviewed by Tim Horton.
2270
2271         * UIProcess/API/Cocoa/WKWebView.mm:
2272         (-[WKWebView _initializeWithConfiguration:]):
2273         (-[WKWebView effectiveAppearanceDidChange]):
2274         Added a null check and call the code later in initialization.
2275
2276 2018-04-20  Tim Horton  <timothy_horton@apple.com>
2277
2278         Adjust geolocation feature flag
2279         https://bugs.webkit.org/show_bug.cgi?id=184856
2280
2281         Reviewed by Wenson Hsieh.
2282
2283         * Configurations/FeatureDefines.xcconfig:
2284
2285 2018-04-20  Chris Dumez  <cdumez@apple.com>
2286
2287         Unreviewed attempt to fix GTK build after r230867.
2288
2289         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
2290         (webkit_dom_dom_window_get_self):
2291         (webkit_dom_dom_window_get_window):
2292         (webkit_dom_dom_window_get_frames):
2293         (webkit_dom_dom_window_get_opener):
2294         (webkit_dom_dom_window_get_parent):
2295         (webkit_dom_dom_window_get_top):
2296
2297 2018-04-20  Commit Queue  <commit-queue@webkit.org>
2298
2299         Unreviewed, rolling out r230873.
2300         https://bugs.webkit.org/show_bug.cgi?id=184857
2301
2302         Broke the iOS build (Requested by cdumez on #webkit).
2303
2304         Reverted changeset:
2305
2306         "Disable backward and forward navigation swipes while in
2307         fullscreen."
2308         https://bugs.webkit.org/show_bug.cgi?id=184656
2309         https://trac.webkit.org/changeset/230873
2310
2311 2018-04-20  Chris Dumez  <cdumez@apple.com>
2312
2313         REGRESSION (r229828): web view doesn’t update or respond to resizing until client calls policy decision handler
2314         https://bugs.webkit.org/show_bug.cgi?id=184210
2315         <rdar://problem/39072354>
2316
2317         Reviewed by Wenson Hsieh.
2318
2319         r229828 tried to have some API tests happy on iOS by freezing the layer tree
2320         during the navigation policy decision. However, this is observable by the client
2321         application and a regression from when the policy delegate was synchronous.
2322
2323         To address the issue, this patch reverts r229828 and instead updates the iOS
2324         API tests to wait for the next presentation update after navigating
2325         before interacting with the view.
2326
2327         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2328         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
2329         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2330         (WebKit::WebFrameLoaderClient::cancelPolicyCheck):
2331         (WebKit::WebFrameLoaderClient::provisionalLoadStarted):
2332         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2333         * WebProcess/WebPage/WebPage.cpp:
2334         * WebProcess/WebPage/WebPage.h:
2335
2336 2018-04-20  Brent Fulgham  <bfulgham@apple.com>
2337
2338         Limit cookie header access to Network process
2339         https://bugs.webkit.org/show_bug.cgi?id=184764
2340         <rdar://problem/36785285>
2341
2342         Reviewed by Youenn Fablet.
2343
2344         Revise the handling of cookie request headers so that we don't interact with them in the
2345         WebContent process. They are only needed for interaction with the server and the network
2346         process, so we should limit their scope to just the Network process.
2347
2348         Instead, we should handle a token that represents the cookie headers in the WebContent
2349         process, which can be converted to the relevant cookie data in the network process when
2350         needed.
2351
2352         * NetworkProcess/NetworkSocketStream.cpp:
2353         (WebKit::NetworkSocketStream::sendHandshake):
2354         * NetworkProcess/NetworkSocketStream.h:
2355         * NetworkProcess/NetworkSocketStream.messages.in:
2356         * WebProcess/Network/WebSocketStream.cpp:
2357         (WebKit::WebSocketStream::networkProcessCrashed):
2358         (WebKit::WebSocketStream::platformSendHandshake):
2359         (WebKit::WebSocketStream::didSendHandshake):
2360         * WebProcess/Network/WebSocketStream.h:
2361         * WebProcess/Network/WebSocketStream.messages.in:
2362
2363 2018-04-20  Jeremy Jones  <jeremyj@apple.com>
2364
2365         Disable backward and forward navigation swipes while in fullscreen.
2366         https://bugs.webkit.org/show_bug.cgi?id=184656
2367         rdar://problem/36057535
2368
2369         Reviewed by Tim Horton.
2370
2371         Disable navigation swipes while in fullscreen.
2372
2373         * UIProcess/Cocoa/ViewGestureController.cpp:
2374         (WebKit::ViewGestureController::canSwipeInDirection const):
2375
2376 2018-04-20  Jeremy Jones  <jeremyj@apple.com>
2377
2378         Element fullscreen, expose WKWebView _fullScreenPlaceholderView as iOS SPI
2379         https://bugs.webkit.org/show_bug.cgi?id=184826
2380         rdar://problem/39600825
2381
2382         Reviewed by Tim Horton.
2383
2384         Add _fullScreenPlaceholderView for iOS similar to the one for Mac.
2385
2386         * UIProcess/API/Cocoa/WKWebView.mm:
2387         (-[WKWebView _fullScreenPlaceholderView]):
2388         (-[WKWebView closeFullScreenWindowController]):
2389         (-[WKWebView fullScreenPlaceholderView]): Deleted.
2390         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2391         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2392         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.h:
2393         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
2394         (-[WKFullScreenWindowController webViewPlaceholder]):
2395
2396 2018-04-20  Wenson Hsieh  <wenson_hsieh@apple.com>
2397
2398         [Extra zoom mode] Injected bundle form client should be notified when editing text fields
2399         https://bugs.webkit.org/show_bug.cgi?id=184822
2400         <rdar://problem/38807319>
2401
2402         Reviewed by Tim Horton.
2403
2404         Fixes the bug by making a couple of tweaks: (1) don't use a separate codepath for inserting text in text inputs,
2405         and (2) force a user typing gesture when inserting text using this codepath (i.e. WKTextInputListViewController).
2406         Also adds plumbing to enable testing text entry with WKTextInputListViewController in extra zoom mode.
2407
2408         * UIProcess/API/Cocoa/WKWebView.mm:
2409         (-[WKWebView _simulateTextEntered:]):
2410         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2411
2412         Introduce testing SPI to simulate text entry. Additionally, add a missing availability annotation around testing
2413         SPI added in 2017 to help test drag and drop for iOS 11.
2414
2415         * UIProcess/ios/WKContentViewInteraction.h:
2416         * UIProcess/ios/WKContentViewInteraction.mm:
2417         (-[WKContentView _simulateTextEntered:]):
2418         * WebProcess/WebPage/WebPage.cpp:
2419         (WebKit::WebPage::setTextAsync):
2420
2421 2018-04-20  Jeremy Jones  <jeremyj@apple.com>
2422
2423         EnterFullscreen must update the minimum and maximum layout sizes.
2424         https://bugs.webkit.org/show_bug.cgi?id=184828
2425         rdar://problem/38435829
2426
2427         Reviewed by Jon Lee.
2428
2429         Without this, the WKWebView won't layout to the full size in fullscreen mode.
2430
2431         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
2432         (-[WKFullScreenWindowController enterFullScreen]):
2433
2434 2018-04-18  Jer Noble  <jer.noble@apple.com>
2435
2436         Don't put build products into WK_ALTERNATE_WEBKIT_SDK_PATH for engineering builds
2437         https://bugs.webkit.org/show_bug.cgi?id=184762
2438
2439         Reviewed by Dan Bernstein.
2440
2441         * Configurations/BaseTarget.xcconfig:
2442
2443 2018-04-20  Youenn Fablet  <youenn@apple.com>
2444
2445         Refactor NetworkResourceLoader to check for m_networkLoadChecker presence before using it
2446         https://bugs.webkit.org/show_bug.cgi?id=184755
2447
2448         Reviewed by Chris Dumez.
2449
2450         Make NetworkResourceLoader always use m_networkLoadChecker if there is one.
2451         This is only used now for synchronous loads but will be used in the future for asynchronous loads as well.
2452
2453         Since we call didFail asynchronously to make sync/async handling more consistent,
2454         We need to keep track of whether we will do clean-up twice.
2455         A boolean is added for that purpose in NetworkResourceLoader.
2456
2457         There is a small change of behavior in the way we return an error.
2458         Instead of returning a platformBadResponseError, we are now returning the error as computed by NetworkLoadChecker.
2459         This allows getting some more error logging in the JS console.
2460
2461         * NetworkProcess/NetworkResourceLoader.cpp:
2462         (WebKit::NetworkResourceLoader::didReceiveResponse):
2463         (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
2464         (WebKit::NetworkResourceLoader::continueWillSendRedirectedRequest):
2465         (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
2466         * NetworkProcess/NetworkResourceLoader.h:
2467
2468 2018-04-20  Timothy Hatcher  <timothy@apple.com>
2469
2470         Include missing files in WKContentViewInteraction.{mm,h}
2471
2472         https://bugs.webkit.org/show_bug.cgi?id=184832
2473         rdar://problem/35377120
2474
2475         Reviewed by Wenson Hsieh.
2476
2477         Some WebDriver files were missing and should be included.
2478
2479         * UIProcess/ios/WKContentViewInteraction.h:
2480         * UIProcess/ios/WKContentViewInteraction.mm:
2481         (-[WKContentView setupInteraction]):
2482         (-[WKContentView cleanupInteraction]):
2483         (-[WKContentView _removeDefaultGestureRecognizers]):
2484         (-[WKContentView _addDefaultGestureRecognizers]):
2485
2486 2018-04-20  Youenn Fablet  <youenn@apple.com>
2487
2488         WebPage sometimes incorrectly rules out PDF as a mime type that can be showed
2489         https://bugs.webkit.org/show_bug.cgi?id=184369
2490
2491         Reviewed by Chris Dumez.
2492
2493         Use API to check for plugin availability for response at navigation time.
2494
2495         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2496         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
2497         * WebProcess/WebPage/WebPage.cpp:
2498         (WebKit::WebPage::canShowResponse const):
2499         (WebKit::WebPage::canShowMIMEType const):
2500         * WebProcess/WebPage/WebPage.h:
2501
2502 2018-04-20  Daniel Bates  <dabates@apple.com>
2503
2504         Remove Strong Password decoration when text field type changes
2505         https://bugs.webkit.org/show_bug.cgi?id=184795
2506         <rdar://problem/38325108>
2507
2508         Reviewed by Antti Koivisto.
2509
2510         Add injected bundle API and WebKit UI delegate SPI to notify the embedding client when the
2511         Strong Password appearance of an HTML input element is resigned.
2512
2513         We add C SPI for Safari on Mac.
2514
2515         * UIProcess/API/APIUIClient.h:
2516         (API::UIClient::didResignInputElementStrongPasswordAppearance):
2517         * UIProcess/API/C/WKPage.cpp:
2518         (WKPageSetPageUIClient):
2519         * UIProcess/API/C/WKPageUIClient.h:
2520         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2521         * UIProcess/Cocoa/UIDelegate.h:
2522         * UIProcess/Cocoa/UIDelegate.mm:
2523         (WebKit::UIDelegate::setDelegate):
2524         (WebKit::UIDelegate::UIClient::didResignInputElementStrongPasswordAppearance):
2525         * UIProcess/WebPageProxy.cpp:
2526         (WebKit::WebPageProxy::didResignInputElementStrongPasswordAppearance):
2527         * UIProcess/WebPageProxy.h:
2528         * UIProcess/WebPageProxy.messages.in:
2529         * WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h:
2530         (API::InjectedBundle::PageUIClient::didResignInputElementStrongPasswordAppearance):
2531         * WebProcess/InjectedBundle/API/c/WKBundlePageUIClient.h:
2532         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
2533         (WebKit::InjectedBundlePageUIClient::didResignInputElementStrongPasswordAppearance):
2534         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
2535         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2536         (WebKit::WebChromeClient::inputElementDidResignStrongPasswordAppearance):
2537         * WebProcess/WebCoreSupport/WebChromeClient.h:
2538
2539 2018-04-20  Megan Gardner  <megan_gardner@apple.com>
2540
2541         Fixes for failing tests associated with switching Text Selection Assistants
2542         https://bugs.webkit.org/show_bug.cgi?id=184806
2543         <rdar://problem/39367905>
2544
2545         Reviewed by Beth Dakin and Wenson Hsieh.
2546         
2547         The major fix is the disabling the double tap noneditable text selection gesture.
2548         The other fixes are small tweaks that shouldn't even be run into with the fix to 
2549         the double tap gesture, but they are incorrect, so I am taking the opportunity to 
2550         fix them now, in case we run into them again.
2551
2552         * UIProcess/ios/WKContentViewInteraction.mm:
2553         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
2554         We should not be allowing a double tap text gestures in non-editable web content.
2555         We didn't have one with the old assistant. Fortunately, this is easily disabled.
2556         (-[WKContentView canPerformActionForWebView:withSender:]):
2557         We should not allow the lookup action if we do not actually have a selection.
2558         It is meaningless without one.
2559         (-[WKContentView selectedTextRange]):
2560         We should not return a selection to UIKit if all we have is caret selection
2561         in non-editable content. We have this for selections on Mac, but UIKit does
2562         not know how to properly handle this, and will have incorrect behavior if we 
2563         return a valid selection.
2564
2565 2018-04-20  Timothy Hatcher  <timothy@apple.com>
2566
2567         WebEvent fails to convert synthetic WebMouseEvent for automation
2568
2569         https://bugs.webkit.org/show_bug.cgi?id=184824
2570         rdar://problem/35377120
2571
2572         Reviewed by Brian Burg.
2573
2574         Add WebEvent conversions that existed in PlatformEventFactoryIOS for legacy WebKit,
2575         but never got added in WebIOSEventFactory and NativeWebMouseEvent for modern WebKit.
2576         This affected WebDriver, and some events not being deliverd to the page.
2577
2578         * Shared/NativeWebMouseEvent.h:
2579         (WebKit::NativeWebMouseEvent::nativeEvent const):
2580         * Shared/ios/NativeWebMouseEventIOS.mm: Added.
2581         (WebKit::NativeWebMouseEvent::NativeWebMouseEvent):
2582         * Shared/ios/WebIOSEventFactory.h:
2583         * Shared/ios/WebIOSEventFactory.mm:
2584         (WebIOSEventFactory::createWebMouseEvent):
2585         * WebKit.xcodeproj/project.pbxproj:
2586
2587 2018-04-20  Michael Catanzaro  <mcatanzaro@igalia.com>
2588
2589         Unreviewed, fix -Wformat warning
2590
2591         * UIProcess/WebPageProxy.cpp:
2592         (WebKit::WebPageProxy::didFinishLoadForFrame):
2593
2594 2018-04-20  Youenn Fablet  <youenn@apple.com>
2595
2596         Make PluginData cache its web visible plugins
2597         https://bugs.webkit.org/show_bug.cgi?id=184421
2598
2599         Reviewed by Chris Dumez.
2600
2601         Rename methods.
2602         Pass an URL instead of relying on Page URL as the page URL
2603         might not always be the URL we want to check against plugins.
2604         In particular when navigation is on-going, we want to check the
2605         plugins against the being navigated URL.
2606
2607         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
2608         (WebKit::WebPluginInfoProvider::pluginInfo):
2609         (WebKit::WebPluginInfoProvider::webVisiblePluginInfo):
2610         * WebProcess/Plugins/WebPluginInfoProvider.h:
2611
2612 2018-04-19  Carlos Garcia Campos  <cgarcia@igalia.com>
2613
2614         Unreviewed. Fix GTK+ build after r230830.
2615
2616         Add SimulatedInputDispatcher.cpp to the build.
2617
2618         * CMakeLists.txt:
2619
2620 2018-04-19  Brady Eidson  <beidson@apple.com>
2621
2622         Make back forward cache work with process swapping.
2623         <rdar://problem/38676604> and https://bugs.webkit.org/show_bug.cgi?id=184793
2624
2625         Reviewed by Chris Dumez.
2626
2627         We previously saved old processes in "SuspendedPageProxy" objects.
2628         Now we reuse them when going back or forward.
2629
2630         * Platform/Logging.h:
2631
2632         * Shared/WebBackForwardListItem.cpp:
2633         (WebKit::WebBackForwardListItem::setSuspendedPage):
2634         (WebKit::WebBackForwardListItem::loggingString):
2635         * Shared/WebBackForwardListItem.h:
2636         (WebKit::WebBackForwardListItem::suspendedPage const):
2637
2638         Teach Navigation objects their source WebBackForwardListItems:
2639         * UIProcess/API/APINavigation.cpp:
2640         (API::Navigation::Navigation):
2641         (API::Navigation::loggingString const):
2642         * UIProcess/API/APINavigation.h:
2643         (API::Navigation::create):
2644         (API::Navigation::targetItem const):
2645         (API::Navigation::fromItem const):
2646         (API::Navigation::backForwardListItem): Deleted.
2647
2648         * UIProcess/Cocoa/NavigationState.mm:
2649         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
2650
2651         * UIProcess/SuspendedPageProxy.cpp:
2652         (WebKit::messageNamesToIgnoreWhileSuspended):
2653         (WebKit::SuspendedPageProxy::SuspendedPageProxy):
2654         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
2655         (WebKit::SuspendedPageProxy::webProcessDidClose):
2656         (WebKit::SuspendedPageProxy::didReceiveMessage):
2657         (WebKit::SuspendedPageProxy::loggingString const):
2658         * UIProcess/SuspendedPageProxy.h:
2659         (WebKit::SuspendedPageProxy::origin const):
2660
2661         * UIProcess/WebBackForwardList.cpp:
2662         (WebKit::WebBackForwardList::WebBackForwardList):
2663         (WebKit::WebBackForwardList::~WebBackForwardList):
2664         (WebKit::WebBackForwardList::pageClosed):
2665         (WebKit::WebBackForwardList::addItem):
2666         (WebKit::WebBackForwardList::goToItem):
2667         (WebKit::WebBackForwardList::removeAllItems):
2668         (WebKit::WebBackForwardList::clear):
2669         (WebKit::WebBackForwardList::restoreFromState):
2670         (WebKit::WebBackForwardList::filteredItemStates const):
2671         (WebKit::WebBackForwardList::itemStates const):
2672         (WebKit::WebBackForwardList::loggingString):
2673         * UIProcess/WebBackForwardList.h:
2674
2675         * UIProcess/WebNavigationState.cpp:
2676         (WebKit::WebNavigationState::createLoadRequestNavigation):
2677         (WebKit::WebNavigationState::createBackForwardNavigation):
2678         * UIProcess/WebNavigationState.h:
2679
2680         * UIProcess/WebPageProxy.cpp:
2681         (WebKit::WebPageProxy::reattachToWebProcess):
2682         (WebKit::WebPageProxy::maybeCreateSuspendedPage):
2683         (WebKit::WebPageProxy::reattachToWebProcessWithItem):
2684         (WebKit::WebPageProxy::loadRequest):
2685         (WebKit::WebPageProxy::loadFile):
2686         (WebKit::WebPageProxy::goToBackForwardItem):
2687         (WebKit::WebPageProxy::receivedPolicyDecision):
2688         (WebKit::WebPageProxy::continueNavigationInNewProcess):
2689         (WebKit::WebPageProxy::didCreateMainFrame):
2690         (WebKit::WebPageProxy::didCreateSubframe):
2691         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
2692         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
2693         (WebKit::WebPageProxy::didCommitLoadForFrame):
2694         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2695         (WebKit::WebPageProxy::connectionWillOpen):
2696         (WebKit::WebPageProxy::attachToProcessForNavigation): Deleted.
2697         * UIProcess/WebPageProxy.h:
2698
2699         * UIProcess/WebProcessLifetimeTracker.cpp:
2700         (WebKit::WebProcessLifetimeTracker::webPageEnteringWebProcess):
2701         (WebKit::WebProcessLifetimeTracker::connectionWillOpen): Deleted.
2702         * UIProcess/WebProcessLifetimeTracker.h:
2703
2704         * UIProcess/WebProcessPool.cpp:
2705         (WebKit::WebProcessPool::processForNavigation):
2706         (WebKit::WebProcessPool::registerSuspendedPageProxy):
2707         (WebKit::WebProcessPool::unregisterSuspendedPageProxy):
2708         * UIProcess/WebProcessPool.h:
2709
2710         * UIProcess/WebProcessProxy.cpp:
2711         (WebKit::WebProcessProxy::suspendWebPageProxy):
2712         (WebKit::WebProcessProxy::updateBackForwardItem):
2713         (WebKit::WebProcessProxy::frameCreated):
2714         * UIProcess/WebProcessProxy.h:
2715
2716         * WebProcess/WebPage/DrawingArea.h:
2717         (WebKit::DrawingArea::attachDrawingArea):
2718
2719         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
2720         (WebKit::WebBackForwardListProxy::addItemFromUIProcess):
2721         (WebKit::WebBackForwardListProxy::addItem):
2722         * WebProcess/WebPage/WebBackForwardListProxy.h:
2723
2724         * WebProcess/WebPage/WebPage.cpp:
2725         (WebKit::m_credentialsMessenger):
2726         (WebKit::WebPage::reinitializeWebPage):
2727         (WebKit::WebPage::goToBackForwardItem):
2728         (WebKit::WebPage::restoreSessionInternal):
2729         (WebKit::WebPage::restoreSession):
2730         (WebKit::WebPage::updateBackForwardListForReattach):
2731         * WebProcess/WebPage/WebPage.h:
2732         * WebProcess/WebPage/WebPage.messages.in:
2733
2734         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
2735         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2736         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
2737         (WebKit::TiledCoreAnimationDrawingArea::attachDrawingArea): Force a reattachment of the drawing
2738           area from a resumed WebProcess to the UIProcess (to make the page cache work)
2739
2740 2018-04-19  Brian Burg  <bburg@apple.com>
2741
2742         Web Automation: add support for mouse/keyboard interaction sequences
2743         https://bugs.webkit.org/show_bug.cgi?id=184603
2744         <rdar://problem/39421839>
2745
2746         Reviewed by Timothy Hatcher.
2747
2748         Add new protocol methods and WebKit support for implementing the W3C Actions API.
2749         This is a generic command for sending low-level mouse, key, and touch events to
2750         test page behavior when performing drag-and-drop, gestures, or specific keydown/keyups.
2751
2752         To implement this functionality, this patch adds SimulatedInputDispatcher, a class
2753         for dispatching input events asynchronously. Similar to the WebDriver specification,
2754         this is designed as a keyframing API. Callers set up several "input sources" such
2755         as keyboard or mouse, and then specify the states of that input source over time. The
2756         dispatcher calculates diffs between the previous and current keyframes and generates
2757         the appropriate events that would happen if a user caused the state transition.
2758
2759         For example, if a mouse input source's state changes, the dispatcher sends synthetic mousemove,
2760         mousedown, or mouseup events depending on the pre- and post-state. This is uninteresting
2761         and overcomplicated for simple key and mouse presses, but it's really designed with an
2762         eye towards supporting mousemove interpolation and touch event interpolation in later patches.
2763
2764         The strategy for dispatching events depends on the input source type; right now, these
2765         map directly to the existing platformSimulate{Mouse, Keyboard}Interaction methods. In
2766         the future, the dispatch strategy may be elaborated for interpolated mousemove events.
2767
2768         This patch depends on support added in bug 184462.
2769
2770         No tests yet. When this command is hooked up to a driver, the code will be exercised by
2771         W3C actions test suite, which is fairly complex at this point relative to end-user code.
2772
2773         * UIProcess/Automation/Automation.json: Add new types and commands.
2774
2775         * UIProcess/Automation/SimulatedInputDispatcher.h: Added.
2776         (WebKit::SimulatedInputSourceState::emptyState):
2777         (WebKit::SimulatedInputSource::create):
2778         (WebKit::SimulatedInputSource::SimulatedInputSource):
2779         (WebKit::SimulatedInputDispatcher::Client::~Client):
2780         Add structs for input source, source state, and keyframe.
2781         The dispatcher's client interface is implemented by WebAutomationSession.
2782
2783         (WebKit::SimulatedInputDispatcher::create):
2784         * UIProcess/Automation/SimulatedInputDispatcher.cpp: Added.
2785         (WebKit::SimulatedInputKeyFrame::SimulatedInputKeyFrame):
2786         (WebKit::SimulatedInputKeyFrame::maximumDuration const):
2787         (WebKit::SimulatedInputKeyFrame::keyFrameFromStateOfInputSources):
2788         (WebKit::SimulatedInputKeyFrame::keyFrameToResetInputSources):
2789         (WebKit::SimulatedInputDispatcher::SimulatedInputDispatcher):
2790         (WebKit::SimulatedInputDispatcher::~SimulatedInputDispatcher):
2791         (WebKit::SimulatedInputDispatcher::isActive const):
2792         (WebKit::SimulatedInputDispatcher::keyFrameTransitionDurationTimerFired):
2793         (WebKit::SimulatedInputDispatcher::isKeyFrameTransitionComplete const):
2794         (WebKit::SimulatedInputDispatcher::transitionToNextKeyFrame):
2795         (WebKit::SimulatedInputDispatcher::transitionToNextInputSourceState):
2796         (WebKit::SimulatedInputDispatcher::transitionBetweenKeyFrames):
2797         (WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
2798         (WebKit::SimulatedInputDispatcher::run):
2799         (WebKit::SimulatedInputDispatcher::cancel):
2800         (WebKit::SimulatedInputDispatcher::finishDispatching):
2801         The dispatcher handles one interaction at a time. The interaction is described
2802         by an array of keyframes, and each keyframe has an array of states. The dispatcher
2803         transitions between keyframes by sequentially and asynchronously emitting events
2804         that cause each input source state to transition as desired. Keyframe transitions
2805         are additionally gated by a "maximum duration" timer. Each step that the dispatcher
2806         executes is asynchronous, so the dispatcher keeps most state in members and uses
2807         error argument lambdas as completion handlers for various async things.
2808
2809         * UIProcess/Automation/WebAutomationSession.h:
2810         * UIProcess/Automation/WebAutomationSession.cpp:
2811         (WebKit::WebAutomationSession::WebAutomationSession):
2812         (WebKit::WebAutomationSession::inputDispatcherForPage):
2813         (WebKit::WebAutomationSession::inputSourceForType const):
2814         Add canonical input sources that are used to keep track of state across
2815         interaction sequences.
2816
2817         (WebKit::WebAutomationSession::isSimulatingUserInteraction const):
2818         (WebKit::WebAutomationSession::mouseEventsFlushedForPage):
2819         (WebKit::WebAutomationSession::keyboardEventsFlushedForPage):
2820         Remove m_simulatingUserInteraction since it can be computed based on other members.
2821
2822         (WebKit::WebAutomationSession::willClosePage):
2823         If the page is being torn down, stop the dispatcher if needed and cancel any
2824         callbacks waiting for mouse/key events to be retired.
2825
2826         (WebKit::WebAutomationSession::simulateMouseInteraction):
2827         (WebKit::WebAutomationSession::simulateKeyboardInteraction):
2828         Add easy-to-use async methods for simulating mouse and key events. These are
2829         hooked up to SimulatedInputDispatcher using async completion handlers.
2830
2831         (WebKit::protocolMouseButtonToWebMouseEventButton):
2832         (WebKit::WebAutomationSession::performMouseInteraction):
2833         (WebKit::WebAutomationSession::performKeyboardInteractions):
2834         Adjust some naming.
2835
2836         (WebKit::simulatedInputSourceTypeFromProtocolSourceType):
2837         (WebKit::WebAutomationSession::performInteractionSequence):
2838         (WebKit::WebAutomationSession::cancelInteractionSequence):
2839         Add command handlers for the new action commands in Automation protocol.
2840
2841         * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
2842         (WebKit::mouseButtonToGdkButton):
2843         (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
2844         (WebKit::WebAutomationSession::platformSimulateKeyboardInteraction):
2845         (WebKit::WebAutomationSession::platformSimulateKeyStroke): Deleted.
2846         * UIProcess/Automation/ios/WebAutomationSessionIOS.mm:
2847         (WebKit::WebAutomationSession::platformSimulateKeyboardInteraction):
2848         (WebKit::WebAutomationSession::platformSimulateKeyStroke): Deleted.
2849         Rename the keyboard platform method to match the naming of the mouse platform method.
2850         Take advantage of the 'using' alias to make the tedious switches easier to read.
2851
2852         * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
2853         (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
2854         (WebKit::virtualKeyHasStickyModifier):
2855         (WebKit::keyCodeForVirtualKey):
2856         (WebKit::eventModifierFlagsForVirtualKey):
2857         (WebKit::WebAutomationSession::platformSimulateKeyboardInteraction):
2858         (WebKit::WebAutomationSession::platformSimulateKeySequence):
2859         (WebKit::keyHasStickyModifier): Deleted.
2860         (WebKit::WebAutomationSession::platformSimulateKeyStroke): Deleted.
2861         Allow the keyboard simulation method to take a virtual key and unichar to better
2862         match how this is used by the Perform Actions command and its machinery.
2863
2864         * WebKit.xcodeproj/project.pbxproj:
2865
2866 2018-04-19  Jiewen Tan  <jiewen_tan@apple.com>
2867
2868         Remove access to keychain from the WebContent process
2869         https://bugs.webkit.org/show_bug.cgi?id=184428
2870         <rdar://problem/13150903>
2871
2872         Reviewed by Brent Fulgham.
2873
2874         Part 1.
2875
2876         Remove com.apple.identities from WebContent-iOS.entitlements, which is needed to encode/decode NSError’s userInfo[NSErrorClientCertificateChainKey]
2877         when the corresponding NSErorr is relayed through WebContent Process from Networking Process to UI Process after a HTTPS client certificate
2878         authentication is rejected becuase of bad certificates. This patch implements corresponding workarounds as well. The workaround works for mac, too.
2879
2880         Sadly, this change can only be tested manually at this moment. Please refer to the radar for testing steps.
2881
2882         * Configurations/WebContent-iOS.entitlements:
2883         * Shared/mac/WebCoreArgumentCodersMac.mm:
2884         (IPC::encodeNSError):
2885         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2886         (WebKit::WebProcessPool::platformInitialize):
2887
2888 2018-04-19  David Kilzer  <ddkilzer@apple.com>
2889
2890         Enable Objective-C weak references
2891         <https://webkit.org/b/184789>
2892         <rdar://problem/39571716>
2893
2894         Reviewed by Dan Bernstein.
2895
2896         * Configurations/Base.xcconfig:
2897         (CLANG_ENABLE_OBJC_WEAK): Enable.
2898
2899 2018-04-19  Youenn Fablet  <youenn@apple.com>
2900
2901         Web Inspector backend should get headers & cookies from network process separately from resource requests
2902         https://bugs.webkit.org/show_bug.cgi?id=184396
2903         <rdar://problem/38877384>
2904
2905         Reviewed by Brian Burg.
2906
2907         Add support for storing response and network metrics for every resource load.
2908         This is made conditional on inspector being activated.
2909         NetworkConnectionToWebProcess keeps a response and network metrics for every load.
2910         This is cleared when inspector is going away or when a web process requests
2911         the data.
2912
2913         WebLoaderStrategy gets this data through synchronous IPC.
2914         Synchronous IPC is a temporary implementation until Inspector code gets refactored.
2915
2916         Updated WebLoaderStrategy to pass the sourceOrigin for every NetworkResourceLoader.
2917         This activates additional sanitization based on cross origin status.
2918
2919         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2920         (WebKit::NetworkConnectionToWebProcess::setCaptureExtraNetworkLoadMetricsEnabled):
2921         * NetworkProcess/NetworkConnectionToWebProcess.h:
2922         (WebKit::NetworkConnectionToWebProcess::takeNetworkLoadInformationResponse):
2923         (WebKit::NetworkConnectionToWebProcess::takeNetworkLoadInformationMetrics):
2924         (WebKit::NetworkConnectionToWebProcess::addNetworkLoadInformationResponse):
2925         (WebKit::NetworkConnectionToWebProcess::addNetworkLoadInformationMetrics):
2926         (WebKit::NetworkConnectionToWebProcess::removeNetworkLoadInformation):
2927         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2928         * NetworkProcess/NetworkResourceLoader.cpp:
2929         (WebKit::NetworkResourceLoader::didReceiveResponse):
2930         (WebKit::NetworkResourceLoader::didFinishLoading):
2931         (WebKit::NetworkResourceLoader::didFailLoading):
2932         * WebProcess/Network/WebLoaderStrategy.cpp:
2933         (WebKit::WebLoaderStrategy::responseFromResourceLoadIdentifier):
2934         (WebKit::WebLoaderStrategy::networkMetricsFromResourceLoadIdentifier):
2935         * WebProcess/Network/WebLoaderStrategy.h:
2936         * WebProcess/Network/WebResourceLoader.cpp:
2937         (WebKit::WebResourceLoader::didReceiveResponse):
2938
2939 2018-04-19  Wenson Hsieh  <wenson_hsieh@apple.com>
2940
2941         [Extra zoom mode] Add a mechanism to extend the height of the layout viewport in extra zoom mode
2942         https://bugs.webkit.org/show_bug.cgi?id=184782
2943         <rdar://problem/38346712>
2944
2945         Reviewed by Tim Horton.
2946
2947         In extra zoom mode, at initial scale, fixed position elements may take up a large portion of the viewport. This
2948         leaves little room for non-fixed-position elements; to improve this experience, we introduce a mechanism to
2949         extend the height of the layout viewport. By default, the layout viewport size is determined by the FrameView's
2950         baseLayoutViewportSize, and passed into FrameView::computeUpdatedLayoutViewportRect in the client layer; in
2951         extra zoom mode, if the layout viewport is shorter than the document width, we try to double the height of the
2952         layout viewport and clamp to the document height if necessary.
2953
2954         * Shared/WebPreferences.yaml:
2955
2956         Add a new preference to determine the factor by which we should expand the height of the layout viewport. By
2957         default, this is 0 (no increase in layout viewport height); in extra zoom mode, this is 1, which means we'll
2958         increase the layout viewport's height by 1x the default height.
2959
2960         * Shared/WebPreferencesDefaultValues.h:
2961         * UIProcess/API/Cocoa/WKWebView.mm:
2962         (-[WKWebView activeMinimumLayoutSizes:]):
2963
2964         Fixes a bug when computing the active minimum layout size. If a minimum allowed layout width is specified, we
2965         clamp the active layout width (normally the view size) so that it is no less than the minimum allowed layout
2966         width. However, the height is currently unaffected, which causes FrameView::baseLayoutViewportSize to return a
2967         bogus size, where the width is scaled to 320px but the height isn't. Instead, we should scale the layout height
2968         to match the new width here.
2969
2970         * UIProcess/ios/WebPageProxyIOS.mm:
2971         (WebKit::WebPageProxy::computeCustomFixedPositionRect const):
2972
2973         Expand the base viewport layout size if necessary, given the expansion factor in WebPreferences.
2974
2975         * WebProcess/WebPage/WebPage.cpp:
2976         (WebKit::WebPage::updatePreferences):
2977         * WebProcess/WebPage/ios/WebPageIOS.mm:
2978         (WebKit::WebPage::dynamicViewportSizeUpdate):
2979
2980         Expand the base viewport layout size if necessary, given the expansion factor in Settings.
2981
2982 2018-04-19  Brian Burg  <bburg@apple.com>
2983
2984         Web Automation: simulated mouse interactions should not be done until associated DOM events have been dispatched
2985         https://bugs.webkit.org/show_bug.cgi?id=184462
2986         <rdar://problem/39323336>
2987
2988         Reviewed by Carlos Garcia Campos and Tim Horton.
2989
2990         Covered by existing layout tests and actions endpoints in WebDriver test suite.
2991
2992         In preparation for implementing the W3C WebDriver command "Perform Actions", we need a way to
2993         know when a simulated mouse event has been fully processed by WebProcess and it is okay to continue
2994         to dispatch more simulated events.
2995
2996         This patch makes mouse events go through a queue as they are delivered to WebPageProxy. The approach
2997         is very similar to how key events are handled. In the key event case, lots of WebEvents can come out
2998         of typing one keystroke, so these need to be queued up and retired one by one when the WebProcess has
2999         finished handling each event. In some mouse event cases---particularly fake mouse moves---there can
3000         also be more than one mouse event waiting to be handled by WebProcess.
3001
3002         In the past, these queued mouse events were tracked with several member variables as different
3003         use cases emerged. These are all replaced with ordinary deque operations, such as peeking or
3004         checking the queue length.
3005
3006         * Platform/Logging.h: Add logging channel for mouse events.
3007         * UIProcess/Automation/WebAutomationSession.cpp:
3008         (WebKit::AutomationCommandError::toProtocolString): Add type-safe helper class for command errors.
3009         In future patches we can hide knowledge of how this is sent over the protocol by relying more on
3010         the convenience constructors and .toProtocolString() method.
3011
3012         (WebKit::WebAutomationSession::willShowJavaScriptDialog):
3013         This section needs adjustments. Since performMouseInteraction now depends on key events being processed
3014         prior to returning from the command, we need to abort any key event callbacks that are pending if an
3015         alert pops up as a result of sending a mousedown event. Any mouse events that are still queued will
3016         be handled when the alert is dismissed and the nested run loop exits.
3017
3018         (WebKit::WebAutomationSession::mouseEventsFlushedForPage):
3019         (WebKit::WebAutomationSession::keyboardEventsFlushedForPage):
3020         Modernize this a bit. Don't spread knowledge about how commands are sent back out into event handling code.
3021         Our wrapper callbacks in performXXXInteraction handle the protocol-specific details of the response.
3022
3023         (WebKit::WebAutomationSession::performMouseInteraction):
3024         Add code similar to performKeyboardInteractions so that the command doesn't finish until the mouse
3025         event has been fully handled. Unlike keyboards, sometimes mouse interactions don't turn into WebEvents
3026         so we also need to handle the case where there is nothing to be waited on because hit testing did
3027         not return a target to deliver the event to.
3028
3029         (WebKit::WebAutomationSession::performKeyboardInteractions):
3030         Modernize a little bit to use generic callbacks rather than protocol-generated callbacks in the
3031         event waiting/handling code. Now it matches the types used for the mouse event case.
3032
3033         * UIProcess/Automation/WebAutomationSession.h:
3034         (WebKit::AutomationCommandError::AutomationCommandError):
3035         Add a helper struct to hold an enumerated error name and an optional free-form error message.
3036
3037         * UIProcess/WebPageProxy.h:
3038         * UIProcess/WebPageProxy.cpp:
3039         (WebKit::webMouseEventTypeString):
3040         (WebKit::webKeyboardEventTypeString):
3041         (WebKit::WebPageProxy::handleMouseEvent):
3042         (WebKit::WebPageProxy::processNextQueuedMouseEvent):
3043         Split the old method into handleMouseEvent (called by other code) and processNextQueuedMouseEvent.
3044         The latter sends the next mouse event to WebProcess, and can be triggered in didReceiveEvent
3045         if there are more mouse events to be sent to WebProcess.
3046
3047         (WebKit::WebPageProxy::isProcessingMouseEvents const): Added.
3048         (WebKit::WebPageProxy::currentlyProcessedMouseDownEvent): Reimplemented on top of the deque.
3049         (WebKit::WebPageProxy::didReceiveEvent):
3050         Unify the code paths for different mouse event types to all use the deque. They also will
3051         notify the automation session if there are no more mouse events to send (i.e., interaction is over).
3052
3053         (WebKit::WebPageProxy::resetStateAfterProcessExited): Add handling for new map.
3054
3055 2018-04-19  Andy Estes  <aestes@apple.com>
3056
3057         [iOS] Implement find-in-page in the new WKPDFView
3058         https://bugs.webkit.org/show_bug.cgi?id=184654
3059         <rdar://problem/39331654>
3060
3061         Reviewed by Tim Horton.
3062
3063         This is theoretically covered by existing WKPDFView API tests, but that's currently blocked
3064         by <rdar://problem/39475542>.
3065
3066         * UIProcess/ios/WKPDFView.mm:
3067         (stringCompareOptions):
3068
3069         Mapped _WKFindOptions to NSStringCompareOptions.
3070
3071         (-[WKPDFView _resetFind]):
3072
3073         Cancelled an in-progress search and reset the search state.
3074
3075         (-[WKPDFView _findString:withOptions:maxCount:completion:]):
3076
3077         Stored the completion block, find string, and max count, then called
3078         -[PDFHostViewController findString:withOptions:].
3079
3080         (-[WKPDFView web_countStringMatches:options:maxCount:]):
3081
3082         Called -_findString:withOptions:maxCount:completion: with a completion block that calls
3083         FindClient::didCountStringMatches() with _findStringCount.
3084
3085         (-[WKPDFView _computeFocusedSearchResultIndexWithOptions:didWrapAround:]):
3086
3087         Computed the focused search result index, taking _findStringCount and wrap-around into
3088         account. There are two interesting cases to mention here:
3089
3090         1. We can't change focus while a search is in progress, because we can't properly handle
3091         wrap-around without a _findStringCount. If a search is in progress, store the requested
3092         focus change in _focusedSearchResultPendingOffset, which will be applied once the search
3093         finishes.
3094
3095         2. If wrap-around is about to happen but the find options do not allow it, we need to call
3096         FindClient::didFailToFindString(). Handle this by returning NO, which will tell
3097         -_focusOnSearchResultWithOptions: to call didFailToFindString() if a search is not in
3098         progress.
3099
3100         (-[WKPDFView _focusOnSearchResultWithOptions:]):
3101
3102         If -_computeFocusedSearchResultIndexWithOptions:didWrapAround: failed while a search is in
3103         progress, just return early. Otherwise, call FindClient::didFailToFindString(). If
3104         computing the index did not fail, call -[PDFHostViewController focusOnSearchResultAtIndex:]
3105         to change focus and then call FindClient::didFindString() to inform the client.
3106
3107         (-[WKPDFView web_findString:options:maxCount:]):
3108
3109         If the find string is equal to _findString, change focus. Otherwise, start a new search.
3110
3111         (-[WKPDFView web_hideFindUI]):
3112
3113         Called -_resetFind.
3114
3115         (-[WKPDFView pdfHostViewController:findStringUpdate:done:]):
3116
3117         Stored the count in _findStringCount and called _findCompletion once the search is done.
3118
3119 2018-04-17  Filip Pizlo  <fpizlo@apple.com>
3120
3121         The InternalFunction hierarchy should be in IsoSubspaces
3122         https://bugs.webkit.org/show_bug.cgi?id=184721
3123
3124         Reviewed by Saam Barati.
3125
3126         * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
3127         (WebKit::JSNPMethod::subspaceForImpl):
3128         * WebProcess/Plugins/Netscape/JSNPMethod.h:
3129         (WebKit::JSNPMethod::create): Deleted.
3130         (WebKit::JSNPMethod::npIdentifier const): Deleted.
3131         (WebKit::JSNPMethod::createStructure): Deleted.
3132         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
3133         (WebKit::JSNPObject::subspaceForImpl):
3134         * WebProcess/Plugins/Netscape/JSNPObject.h:
3135         (WebKit::JSNPObject::create): Deleted.
3136         (WebKit::JSNPObject::npObject const): Deleted.
3137         (WebKit::JSNPObject::createStructure): Deleted.
3138
3139 2018-04-19  Brady Eidson  <beidson@apple.com>
3140
3141         Add globally-unique HistoryItem identifiers (and have WebKit2 adopt them).
3142         <rdar://problem/39533949> and https://bugs.webkit.org/show_bug.cgi?id=184750
3143
3144         Reviewed by Ryosuke Niwa.
3145
3146         With process swapping, the assumption that "back/forward items belong to a process" is invalid.
3147
3148         All HistoryItem/WebBackForwardListItems now need to be uniquely identified across all processes,
3149         no matter which process they originated from, so there will never be a collision in the UIProcess.
3150
3151         This allows us to:
3152         - Have the UIProcess to keep a single process-wide map of all WebBackForwardListItems
3153         - Get rid of the per-WebProcess WebBackForwardListItem map
3154         - Simplify a lot of WebBackForwardList(Proxy) code that no longer needs to keep that per-process
3155           map in sync
3156         - Get rid of a lot of other ancillary code
3157
3158         * Shared/SessionState.cpp:
3159         (WebKit::BackForwardListItemState::decode):
3160         * Shared/SessionState.h:
3161
3162         * Shared/WebBackForwardListItem.cpp:
3163         (WebKit::WebBackForwardListItem::WebBackForwardListItem):
3164         (WebKit::WebBackForwardListItem::~WebBackForwardListItem):
3165         (WebKit::WebBackForwardListItem::itemForID):
3166         (WebKit::WebBackForwardListItem::highestUsedItemID): Deleted.
3167         * Shared/WebBackForwardListItem.h:
3168         (WebKit::WebBackForwardListItem::itemID const):
3169
3170         * Shared/WebPageCreationParameters.cpp:
3171         (WebKit::WebPageCreationParameters::encode const):
3172         (WebKit::WebPageCreationParameters::decode):
3173         * Shared/WebPageCreationParameters.h:
3174
3175         * UIProcess/WebBackForwardList.cpp:
3176         (WebKit::WebBackForwardList::itemForID):
3177         (WebKit::WebBackForwardList::pageClosed):
3178         (WebKit::WebBackForwardList::addItem):
3179         (WebKit::WebBackForwardList::restoreFromState):
3180         (WebKit::generateWebBackForwardItemID): Deleted.
3181         * UIProcess/WebBackForwardList.h:
3182
3183         * UIProcess/WebPageProxy.cpp:
3184         (WebKit::WebPageProxy::maybeCreateSuspendedPage):
3185         (WebKit::WebPageProxy::initializeWebPage):
3186         (WebKit::WebPageProxy::willGoToBackForwardListItem):
3187         (WebKit::WebPageProxy::restoreFromSessionState):
3188         (WebKit::WebPageProxy::backForwardAddItem):
3189         (WebKit::WebPageProxy::backForwardGoToItem):
3190         (WebKit::WebPageProxy::backForwardItemAtIndex):
3191         (WebKit::WebPageProxy::creationParameters):
3192         (WebKit::WebPageProxy::backForwardRemovedItem):
3193         * UIProcess/WebPageProxy.h:
3194         * UIProcess/WebPageProxy.messages.in:
3195  
3196         * UIProcess/WebProcessPool.cpp: Explicitly set the UIProcess Process::Identifier so it starts
3197           at "1" and then the first child process starts at "2", etc etc.
3198
3199         * UIProcess/WebProcessProxy.cpp:
3200         (WebKit::WebProcessProxy::removeWebPage):
3201         (WebKit::WebProcessProxy::checkURLReceivedFromWebProcess):
3202         (WebKit::WebProcessProxy::updateBackForwardItem):
3203         (WebKit::WebProcessProxy::webBackForwardItem const): Deleted.
3204         (WebKit::WebProcessProxy::registerNewWebBackForwardListItem): Deleted.
3205         (WebKit::WebProcessProxy::removeBackForwardItem): Deleted.
3206         (WebKit::WebProcessProxy::addOrUpdateBackForwardItem): Deleted.
3207         * UIProcess/WebProcessProxy.h:
3208         * UIProcess/WebProcessProxy.messages.in:
3209
3210         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
3211         (WebKit::toBackForwardListItemState):
3212         (WebKit::applyFrameState):
3213         (WebKit::toHistoryItem):
3214         (WebKit::toPageState): Deleted.
3215         * WebProcess/WebCoreSupport/SessionStateConversion.h:
3216
3217         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3218         (WebKit::WebFrameLoaderClient::shouldGoToHistoryItem const):
3219
3220         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
3221         (WebKit::WebBackForwardListProxy::addItemFromUIProcess):
3222         (WebKit::WK2NotifyHistoryItemChanged):
3223         (WebKit::WebBackForwardListProxy::itemForID):
3224         (WebKit::WebBackForwardListProxy::removeItem):
3225         (WebKit::WebBackForwardListProxy::addItem): Previously this was a two-step process of adding an item
3226           to the process and then associating it with the page. Now it's just directly adding it to the page,
3227           so we don't need to call updateBackForwardItem first.
3228         (WebKit::WebBackForwardListProxy::goToItem):
3229         (WebKit::WebBackForwardListProxy::itemAtIndex):
3230         (WebKit::WebBackForwardListProxy::close):
3231         (WebKit::historyItemToIDMap): Deleted.
3232         (WebKit::generateHistoryItemID): Deleted.
3233         (WebKit::WebBackForwardListProxy::setHighestItemIDFromUIProcess): Deleted.
3234         (WebKit::updateBackForwardItem): Deleted.
3235         (WebKit::WebBackForwardListProxy::idForItem): Deleted.
3236         * WebProcess/WebPage/WebBackForwardListProxy.h:
3237
3238         * WebProcess/WebPage/WebPage.cpp:
3239         (WebKit::m_credentialsMessenger):
3240         (WebKit::WebPage::goToBackForwardItem):
3241         (WebKit::WebPage::restoreSessionInternal):
3242         (WebKit::WebPage::didRemoveBackForwardItem):
3243         * WebProcess/WebPage/WebPage.h:
3244         * WebProcess/WebPage/WebPage.messages.in:
3245
3246 2018-04-19  Youenn Fablet  <youenn@apple.com>
3247
3248         NetworkProcess should use CSP/content blockers for sync XHR
3249         https://bugs.webkit.org/show_bug.cgi?id=184760
3250
3251         Reviewed by Chris Dumez.
3252
3253         Setting CSP/ContentBlockers parameters for sync XHR loads.
3254         * NetworkProcess/NetworkResourceLoader.cpp:
3255
3256 2018-04-19  Nan Wang  <n_wang@apple.com>
3257
3258         AX: AOM: respect the accessibility setting for dispatching the accessible events
3259         https://bugs.webkit.org/show_bug.cgi?id=184619
3260
3261         Reviewed by Ryosuke Niwa.
3262
3263         Linked libAccessibility on iOS and macOS to use the platform accessibility settings
3264         for allowing dispatching the accessibility events.
3265
3266         * Configurations/WebKit.xcconfig:
3267         * UIProcess/API/Cocoa/WKWebView.mm:
3268         (-[WKWebView _initializeWithConfiguration:]):
3269         (accessibilityEventsEnabledChangedCallback):
3270         (-[WKWebView _updateAccessibilityEventsEnabled]):
3271         * UIProcess/API/Cocoa/WKWebViewInternal.h:
3272         * UIProcess/WebPageProxy.cpp:
3273         (WebKit::WebPageProxy::updateAccessibilityEventsEnabled):
3274         * UIProcess/WebPageProxy.h:
3275         * WebProcess/WebPage/WebPage.cpp:
3276         (WebKit::WebPage::updateAccessibilityEventsEnabled):
3277         * WebProcess/WebPage/WebPage.h:
3278         * WebProcess/WebPage/WebPage.messages.in:
3279
3280 2018-04-18  Chris Dumez  <cdumez@apple.com>
3281
3282         Rename WindowProxyController to WindowProxy
3283         https://bugs.webkit.org/show_bug.cgi?id=184756
3284
3285         Reviewed by Sam Weinig.
3286
3287         Rename WindowProxyController to WindowProxy for clarity. When the IDL uses WindowProxy, the implementation
3288         needed use WindowProxyController type, which was a bit confusing.
3289
3290         * WebProcess/Plugins/PluginView.cpp:
3291         (WebKit::PluginView::windowScriptNPObject):
3292         * WebProcess/WebPage/WebPage.cpp:
3293         (WebKit::WebPage::frameBecameRemote):
3294
3295 2018-04-18  Youenn Fablet  <youenn@apple.com>
3296
3297         Allow SameOrigin credentials handling for synchronous XHR
3298         https://bugs.webkit.org/show_bug.cgi?id=184723
3299
3300         Reviewed by Alex Christensen.
3301
3302         In case of SameOrigin credentials, we need to stop the current load
3303         in case of cross origin redirection to restart a load with a different session.
3304         Covered by updated WK2 tests.
3305         Rebased WK1 tests since this is Wk1 only.
3306
3307         * NetworkProcess/NetworkResourceLoader.cpp:
3308         (WebKit::NetworkResourceLoader::startNetworkLoad):
3309         (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
3310         * NetworkProcess/NetworkResourceLoader.h:
3311
3312 2018-04-18  Chris Dumez  <cdumez@apple.com>
3313
3314         Set RemoteDOMWindow's initial opener
3315         https://bugs.webkit.org/show_bug.cgi?id=184716
3316
3317         Reviewed by Sam Weinig.
3318
3319         When a frame becomes remote, transfer the frame opener from the old
3320         frame to the new remote one.
3321
3322         * WebProcess/WebPage/WebPage.cpp:
3323         (WebKit::WebPage::frameBecameRemote):
3324
3325 2018-04-18  Youenn Fablet  <youenn@apple.com>
3326
3327         NetworkResourceLoader should not clean itself inside didReceiveResponse
3328         https://bugs.webkit.org/show_bug.cgi?id=184754
3329
3330         Reviewed by Chris Dumez.
3331
3332         Delay the cleanup to after the didReceiveResponse call so that NetworkLoad can terminate its work.
3333         Covered by XHR sync tests no longer crashing on GuardMalloc bots.
3334
3335         * NetworkProcess/NetworkResourceLoader.cpp:
3336         (WebKit::NetworkResourceLoader::didReceiveResponse):
3337
3338 2018-04-18  Jer Noble  <jer.noble@apple.com>
3339
3340         Fix rendering of WKRemoteView layers in the simulator
3341         https://bugs.webkit.org/show_bug.cgi?id=184752
3342
3343         Reviewed by Tim Horton.
3344
3345         * Platform/mac/LayerHostingContext.mm:
3346         (WebKit::LayerHostingContext::createForExternalHostingProcess):
3347
3348 2018-04-18  Jer Noble  <jer.noble@apple.com>
3349
3350         Fix entitlements and sandboxing for iphoneminimalsimulator
3351         https://bugs.webkit.org/show_bug.cgi?id=184692
3352
3353         Reviewed by Tim Horton.
3354
3355         Use the correct implementations for ChildProcess and NetworkProcess
3356         when building for iphoneminimalsimulator. Stub out imlementations
3357         which rely on methods not available in the iphoneminimalsimulator SDK.
3358
3359         * Configurations/Network-OSX.entitlements: Added.
3360         * Configurations/NetworkService.xcconfig:
3361         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3362         (WebKit::NetworkProcess::sourceApplicationAuditData const):
3363         * NetworkProcess/ios/NetworkProcessIOS.mm:
3364         * NetworkProcess/mac/NetworkProcessMac.mm:
3365         (WebKit::NetworkProcess::initializeProcessName):
3366         (WebKit::overrideSystemProxies):
3367         * Shared/ios/ChildProcessIOS.mm:
3368         (WebKit::ChildProcess::initializeSandbox):
3369         * Shared/mac/ChildProcessMac.mm:
3370         (WebKit::ChildProcess::setApplicationIsDaemon):
3371         (WebKit::enableSandboxStyleFileQuarantine):
3372         (WebKit::ChildProcess::initializeSandbox):
3373         (WebKit::ChildProcess::platformStopRunLoop):
3374         * Shared/mac/CodeSigning.mm:
3375         * WebKit.xcodeproj/project.pbxproj:
3376         * WebProcess/cocoa/WebProcessCocoa.mm:
3377         (WebKit::WebProcess::initializeSandbox):
3378
3379 2018-04-18  Commit Queue  <commit-queue@webkit.org>
3380
3381         Unreviewed, rolling out r230743.
3382         https://bugs.webkit.org/show_bug.cgi?id=184747
3383
3384         causes mouse clicks to not work on some platforms (Requested
3385         by brrian on #webkit).
3386
3387         Reverted changeset:
3388
3389         "Web Automation: simulated mouse interactions should not be
3390         done until associated DOM events have been dispatched"
3391         https://bugs.webkit.org/show_bug.cgi?id=184462
3392         https://trac.webkit.org/changeset/230743
3393
3394 2018-04-18  Brent Fulgham  <bfulgham@apple.com>
3395
3396         Avoid crash if ITP Debug mode is on, but ResourceLoadStatistics are not being used
3397         https://bugs.webkit.org/show_bug.cgi?id=184739
3398         <rdar://problem/39287964>
3399
3400         Reviewed by David Kilzer.
3401
3402         If a user has the ResourceLoadStatistics logic turned off, but has the ITP Debug experimental
3403         flag turned on, you can cause a crash.
3404
3405         This is because the WebsiteDataStore for the process doesn't bother creating a ResourceLoadStatisticsStore
3406         if the statistics machinery is not running. The ITP debug flag was being blindly set without checking
3407         if the statistics store exists or not, which can cause a crash.
3408
3409         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3410         (WebKit::WebsiteDataStore::setResourceLoadStatisticsDebugMode): Check if the statistics store exists
3411         before calling functions on it.
3412
3413 2018-04-18  Paul Knight  <pknight@apple.com>
3414
3415         Add -[_WKInputDelegateDelegate willStartInputSession:] for clients that want to configure input session before assisting form node
3416         https://bugs.webkit.org/show_bug.cgi?id=184662
3417
3418         Reviewed by Beth Dakin.
3419
3420         Clients may wish to configure a WKInputSession before we start assisting
3421         a node. Add a -[_WKInputDelegateDelegate _webView:willStartInputSession:]
3422         callback.
3423
3424         For example, clients that wish to present a custom input view will want
3425         to configure the WKFormInputSession's customInputView before the
3426         keyboard is presented. Otherwise the standard keyboard will begin to
3427         animate and then the custom input view will swap in later.
3428
3429         * UIProcess/API/Cocoa/_WKInputDelegate.h:
3430         * UIProcess/ios/WKContentViewInteraction.mm:
3431         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
3432             Call -_webView:willStartInputSession: before assisting the node.
3433             Only create the form session if the delegate implements either
3434             the willStart or didStartInputSession callbacks.
3435
3436 2018-04-18  Chris Dumez  <cdumez@apple.com>
3437
3438         Add support for converting a local window to a remote window
3439         https://bugs.webkit.org/show_bug.cgi?id=184515
3440         <rdar://problem/39011318>
3441
3442         Reviewed by Ryosuke Niwa.
3443
3444         Add initial support for process-swapping when navigating cross-origin as a result
3445         of a window.open(). The window object returned by window.open() is initially same
3446         origin and is for about:blank. The navigation cross-origin then happens and the
3447         JS wrappers for the window then point to a cross-origin window which is remote (i.e.
3448         hosted in another WebProcess).
3449
3450         The RemoteDOMWindow exposed to JS looks like a regular cross-origin Window with a few
3451         exceptions due to our incomplete implementation (e.g. w.location returns null) and
3452         most of its API is currently not functional. The RemoteDOMWindow API will be implemented
3453         in a follow-up by relying on IPC.
3454
3455         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3456         (API::ProcessPoolConfiguration::copy):
3457         * UIProcess/API/APIProcessPoolConfiguration.h: