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