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