569edc12d9e7f51e060931418c7904c478f264b9
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-11-13  Ross Kirsling  <ross.kirsling@sony.com>
2
3         Unreviewed correction to previous build fix to avoid any internal/downstream repercussions.
4
5         * WebProcess/Network/webrtc/LibWebRTCProvider.h:
6
7 2018-11-13  Ross Kirsling  <ross.kirsling@sony.com>
8
9         Unreviewed GTK/WPE build fix for r238159. 
10
11         * WebProcess/Network/webrtc/LibWebRTCProvider.h:
12
13 2018-11-13  Timothy Hatcher  <timothy@apple.com>
14
15         Use a light scrollbar for transparent web views in dark mode.
16         https://bugs.webkit.org/show_bug.cgi?id=191559
17         rdar://problem/46000489
18
19         Reviewed by Dean Jackson.
20
21         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
22         (WebKit::InjectedBundleRangeHandle::renderedImage): Use FrameView's useDarkAppaearance().
23         * WebProcess/WebPage/WebPage.cpp:
24         (WebKit::WebPage::drawRect): Ditto.
25
26 2018-11-13  Wenson Hsieh  <wenson_hsieh@apple.com>
27
28         [iOS] Do not show selection UI for editable elements with opacity near zero
29         https://bugs.webkit.org/show_bug.cgi?id=191442
30         <rdar://problem/45958625>
31
32         Reviewed by Simon Fraser.
33
34         Add support for suppressing native selection UI (for instance, selection highlight views, selection handles, and
35         selection-related gestures) when the selection is inside a transparent editable element. This helps maintain
36         compatibility with text editors that work by capturing key events and input events hidden contenteditable
37         elements, and reflect these changes in different document or different part of the document.
38
39         Since selection UI is rendered in the UI process on iOS using element geometry propagated from the web process,
40         selection rendering is entirely decoupled from the process of painting in the web process. This means that if
41         the editable root has an opacity of 0, we would correctly hide the caret and selection on macOS, but draw over
42         the transparent element on iOS. When these hidden editable elements are focused, this often results in unwanted
43         behaviors, such as double caret painting, native and custom selection UI from the page being drawn on top of one
44         another, and the ability to change selection via tap and loupe gestures within hidden text.
45
46         To fix this, we compute whether the focused element is transparent when an element is focused, or when the
47         selection changes, and send this information over to the UI process via `AssistedNodeInformation` and
48         `EditorState`. In the UI process, we then respect this information by suppressing the selection assistant if the
49         focused element is transparent; this disables showing and laying out selection views, as well as gestures
50         associated with selection overlays. However, this still allows for contextual autocorrection and spell checking.
51
52         * Shared/AssistedNodeInformation.cpp:
53         (WebKit::AssistedNodeInformation::encode const):
54         (WebKit::AssistedNodeInformation::decode):
55         * Shared/AssistedNodeInformation.h:
56         * Shared/EditorState.cpp:
57         (WebKit::EditorState::PostLayoutData::encode const):
58         (WebKit::EditorState::PostLayoutData::decode):
59         * Shared/EditorState.h:
60
61         Add `elementIsTransparent` flags, and also add boilerplate IPC code.
62
63         * UIProcess/ios/WKContentViewInteraction.mm:
64         (-[WKContentView _displayFormNodeInputView]):
65
66         Prevent zooming to the focused element if the focused element is hidden.
67
68         (-[WKContentView hasSelectablePositionAtPoint:]):
69         (-[WKContentView pointIsNearMarkedText:]):
70         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
71
72         Don't allow these text interaction gestures to begin while suppressing the selection assistant.
73
74         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
75
76         When an element is focused, begin suppressing the selection assistant if the element is fully transparent.
77
78         (-[WKContentView _stopAssistingNode]):
79
80         When the focused element is blurred, reset state by ending selection assistant suppression (additionally
81         reactivating the selection assistant if needed). This ensures that selection in non-editable text isn't broken
82         after focusing a hidden editable element.
83
84         (-[WKContentView _updateChangedSelection:]):
85
86         If needed, suppress or un-suppress the selection assistant when the selection changes. On certain rich text
87         editors, a combination of custom selection UI and native selection UI is used. For instance, on Microsoft Office
88         365, caret selections are rendered using the native caret view, but as soon as the selection becomes ranged, the
89         editable root becomes fully transparent, and Office's selection UI takes over.
90
91         (-[WKContentView _shouldSuppressSelectionCommands]):
92
93         Override this UIKit SPI hook to suppress selection commands (e.g. the callout bar) when suppressing the
94         selection assistant.
95
96         * WebProcess/WebPage/ios/WebPageIOS.mm:
97         (WebKit::WebPage::platformEditorState const):
98         (WebKit::WebPage::getAssistedNodeInformation):
99
100         Compute and set `elementIsTransparent` using the assisted node.
101
102 2018-11-13  Ryan Haddad  <ryanhaddad@apple.com>
103
104         Unreviewed, rolling out r238137.
105
106         Introduced API test failures on macOS.
107
108         Reverted changeset:
109
110         "Enable process swap on cross-site navigation by default on
111         macOS"
112         https://bugs.webkit.org/show_bug.cgi?id=191572
113         https://trac.webkit.org/changeset/238137
114
115 2018-11-13  Ryosuke Niwa  <rniwa@webkit.org>
116
117         Enable process swap on cross-site navigation by default on macOS
118         https://bugs.webkit.org/show_bug.cgi?id=191572
119
120         Reviewed by Chris Dumez.
121
122         Enabled the feature by default on macOS.
123
124         * Shared/WebPreferences.yaml:
125         * Shared/WebPreferencesDefaultValues.h:
126
127 2018-11-13  Daniel Bates  <dabates@apple.com>
128
129         Consolidate WebKit UIKitSPI.h and UIKitTestSPI.h
130         https://bugs.webkit.org/show_bug.cgi?id=173341
131         <rdar://problem/32752890>
132
133         Reviewed by Simon Fraser.
134
135         * Platform/spi/ios/UIKitSPI.h:
136
137 2018-11-13  Alex Christensen  <achristensen@webkit.org>
138
139         Fix internal builds after r238115
140         https://bugs.webkit.org/show_bug.cgi?id=191441
141
142         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
143         (-[WKSafeBrowsingTextView intrinsicContentSize]):
144         Some iOS-like operating systems don't have safe browsing.  Don't use symbols that don't exist on those systems.
145
146 2018-11-13  Ali Juma  <ajuma@chromium.org>
147
148         Turn Intersection Observer on by default
149         https://bugs.webkit.org/show_bug.cgi?id=191569
150
151         Reviewed by Simon Fraser.
152
153         * Shared/WebPreferences.yaml:
154
155 2018-11-12  Darshan Kadu  <darsh7807@gmail.com>
156
157         Implement Cache API support for WPE/GTK
158         https://bugs.webkit.org/show_bug.cgi?id=178316
159
160         Reviewed by Michael Catanzaro.
161
162         Added a new API function WKWebsiteDataStoreSetCacheStoragePerOriginQuota which sets the
163         cache limit per origin.
164
165         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
166         (WKWebsiteDataStoreSetCacheStoragePerOriginQuota):
167         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
168
169 2018-11-12  Alex Christensen  <achristensen@webkit.org>
170
171         [iOS] Implement safe browsing in WebKit
172         https://bugs.webkit.org/show_bug.cgi?id=191441
173
174         Reviewed by Tim Horton.
175
176         In r237863 I implemented this for Mac.  This refines the UI and implements it for iOS.
177
178         * Shared/WebPreferences.yaml:
179         * Shared/WebPreferencesDefaultValues.h:
180         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
181         (WKContextHandlesSafeBrowsing):
182         * UIProcess/API/Cocoa/WKWebView.mm:
183         (-[WKWebView _showSafeBrowsingWarning:completionHandler:]):
184         (-[WKWebView _clearSafeBrowsingWarning]):
185         (-[WKWebView layoutSubviews]):
186         (-[WKWebView setFrameSize:]):
187         (+[WKWebView _handlesSafeBrowsing]):
188         (-[WKWebView _safeBrowsingWarningForTesting]):
189         * UIProcess/API/Cocoa/WKWebViewInternal.h:
190         * UIProcess/Cocoa/PageClientImplCocoa.h:
191         * UIProcess/Cocoa/PageClientImplCocoa.mm:
192         (WebKit::PageClientImplCocoa::allocFileWrapperInstance const):
193         (WebKit::PageClientImplCocoa::serializableFileWrapperClasses const):
194         * UIProcess/Cocoa/WKSafeBrowsingWarning.h:
195         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
196         (confirmMalwareSentinel):
197         (visitUnsafeWebsiteSentinel):
198         (colorForItem):
199         (addLinkAndReplace):
200         (-[WKSafeBrowsingExclamationPoint drawRect:]):
201         (makeButton):
202         (makeTitleLabel):
203         (setBackground):
204         (-[WKSafeBrowsingWarning initWithFrame:safeBrowsingResult:completionHandler:]):
205         (-[WKSafeBrowsingWarning addContent]):
206         (-[WKSafeBrowsingWarning showDetailsClicked]):
207         (-[WKSafeBrowsingWarning layoutText]):
208         (-[WKSafeBrowsingWarning textView:clickedOnLink:atIndex:]):
209         (-[WKSafeBrowsingWarning layout]):
210         (-[WKSafeBrowsingWarning layoutSubviews]):
211         (-[WKSafeBrowsingWarning textView:shouldInteractWithURL:inRange:interaction:]):
212         (-[WKSafeBrowsingWarning didMoveToWindow]):
213         (-[WKSafeBrowsingWarning clickedOnLink:]):
214         (-[WKSafeBrowsingTextView initWithAttributedString:forWarning:]):
215         (-[WKSafeBrowsingTextView intrinsicContentSize]):
216         (colorNamed): Deleted.
217         (+[WKSafeBrowsingTextView viewWithAttributedString:linkTarget:]): Deleted.
218         (+[WKSafeBrowsingTextView viewWithString:]): Deleted.
219         (-[WKSafeBrowsingTextView clickedOnLink:atIndex:]): Deleted.
220         * UIProcess/ios/PageClientImplIOS.mm:
221         (WebKit::PageClientImpl::isViewWindowActive):
222         (WebKit::PageClientImpl::isViewFocused):
223         (WebKit::PageClientImpl::isViewVisible):
224         (WebKit::PageClientImpl::isViewInWindow):
225         (WebKit::PageClientImpl::decidePolicyForGeolocationPermissionRequest):
226         (WebKit::PageClientImpl::enterAcceleratedCompositingMode):
227         (WebKit::PageClientImpl::showSafeBrowsingWarning):
228         (WebKit::PageClientImpl::clearSafeBrowsingWarning):
229         (WebKit::PageClientImpl::mimeTypesWithCustomContentProviders):
230         (WebKit::PageClientImpl::navigationGestureDidBegin):
231         (WebKit::PageClientImpl::navigationGestureWillEnd):
232         (WebKit::PageClientImpl::navigationGestureDidEnd):
233         (WebKit::PageClientImpl::willRecordNavigationSnapshot):
234         (WebKit::PageClientImpl::didRemoveNavigationGestureSnapshot):
235         (WebKit::PageClientImpl::requestPasswordForQuickLookDocument):
236         * UIProcess/mac/PageClientImplMac.mm:
237         (WebKit::PageClientImpl::showShareSheet):
238         (WebKit::PageClientImpl::navigationGestureDidBegin):
239         (WebKit::PageClientImpl::navigationGestureWillEnd):
240         (WebKit::PageClientImpl::navigationGestureDidEnd):
241         (WebKit::PageClientImpl::willRecordNavigationSnapshot):
242         (WebKit::PageClientImpl::didRemoveNavigationGestureSnapshot):
243
244 2018-11-12  Tim Horton  <timothy_horton@apple.com>
245
246         Make it possible to edit images inline
247         https://bugs.webkit.org/show_bug.cgi?id=191352
248         <rdar://problem/30107985>
249
250         Reviewed by Dean Jackson.
251
252         * Platform/spi/ios/PencilKitSPI.h: Added.
253         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
254         (WebKit::RemoteLayerBackingStore::drawInContext):
255         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
256         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
257         (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::LayerCreationProperties):
258         (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::encode const):
259         (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::decode):
260         * WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.cpp:
261         (WebKit::GraphicsLayerCARemote::createPlatformCALayerForEmbeddedView):
262         * WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.h:
263         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
264         (WebKit::PlatformCALayerRemote::createForEmbeddedView):
265         (WebKit::PlatformCALayerRemote::PlatformCALayerRemote):
266         (WebKit::PlatformCALayerRemote::embeddedViewID const):
267         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:
268         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
269         (WebKit::RemoteLayerTreeContext::layerWasCreated):
270         Propagate EmbeddedViewID through the PlatformCALayer constructor and
271         through the layer creation parameters to the UI process.
272
273         * Shared/WebPreferences.yaml:
274         * UIProcess/API/Cocoa/WKWebView.mm:
275         (-[WKWebView _initializeWithConfiguration:]):
276         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
277         (-[WKWebViewConfiguration init]):
278         (-[WKWebViewConfiguration copyWithZone:]):
279         (-[WKWebViewConfiguration _setEditableImagesEnabled:]):
280         (-[WKWebViewConfiguration _editableImagesEnabled]):
281         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
282         Add a preference to enable editable images.
283
284         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h:
285         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
286         (WebKit::RemoteLayerTreeHost::layerWillBeRemoved):
287         (WebKit::RemoteLayerTreeHost::clearLayers):
288         (WebKit::RemoteLayerTreeHost::createLayer):
289         Keep track of "embedded views" in two maps: embeddedViewID->UIView,
290         and layerID->embeddedViewID. Clean them up when layers go away.
291         If a embedded view is reparented, currently it must be added to a new
292         layer in the same commit as it is removed from the previous layer
293         in order to persist the view's state (otherwise the view will be
294         destroyed and recreated). This will be less of a problem after future
295         patches introduce serialization of image data and whatnot.
296
297         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
298         (WebKit::RemoteLayerTreeHost::createLayer):
299         (WebKit::RemoteLayerTreeHost::createEmbeddedView):
300         Move the various remote layer tree UIView subclasses out into a separate file.
301
302         Add createEmbeddedView, which is used for LayerTypeEditableImageLayer,
303         and creates a WKDrawingView and sticks it in the maps.
304
305         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h: Added.
306         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm: Added.
307         (-[UIView _web_recursiveFindDescendantInteractibleViewAtPoint:withEvent:]):
308         (-[UIView _web_findDescendantViewAtPoint:withEvent:]):
309         (-[WKCompositingView hitTest:withEvent:]):
310         (-[WKCompositingView description]):
311         (+[WKTransformView layerClass]):
312         (+[WKSimpleBackdropView layerClass]):
313         (+[WKShapeView layerClass]):
314         (-[WKRemoteView initWithFrame:contextID:]):
315         (+[WKRemoteView layerClass]):
316         (-[WKBackdropView hitTest:withEvent:]):
317         (-[WKBackdropView description]):
318         (-[WKChildScrollView initWithFrame:]):
319         Move various remote layer tree UIView subclasses here, to their own file.
320         Make our UIView hit testing override test for views that conform to the
321         protocol "WKNativelyInteractible", which switches to normal UIView hit
322         testing. WKDrawingView will be the one such view.
323
324         Add WKChildScrollView and pull the one thing we customize out into it,
325         to make RemoteLayerTreeHost::createLayer less logic-ful.
326
327         * UIProcess/ios/WKDrawingView.h: Added.
328         * UIProcess/ios/WKDrawingView.mm: Added.
329         (-[WKDrawingView init]):
330         (-[WKDrawingView layoutSubviews]):
331         Add a very simple WKDrawingView, which uses PKCanvasView to edit the image.
332
333         * WebKit.xcodeproj/project.pbxproj:
334         * SourcesCocoa.txt:
335         Add the new files.
336
337 2018-11-12  Don Olmstead  <don.olmstead@sony.com>
338
339         Shipped PNGs include bad profiles: iCCP: known incorrect sRGB profile
340         https://bugs.webkit.org/show_bug.cgi?id=189230
341         <rdar://problem/44050379>
342
343         Reviewed by Joseph Pecoraro.
344
345         Runs all png images through zopflipng. This results in a smaller file
346         size and takes care of this issue as a byproduct.
347
348         * Resources/ios/iOS.xcassets/StartPictureInPictureButton.imageset/StartPictureInPictureButton@1x.png:
349         * Resources/ios/iOS.xcassets/StartPictureInPictureButton.imageset/StartPictureInPictureButton@2x.png:
350         * Resources/ios/iOS.xcassets/StartPictureInPictureButton.imageset/StartPictureInPictureButton@3x.png:
351         * Resources/ios/iOS.xcassets/StopPictureInPictureButton.imageset/StopPictureInPictureButton@1x.png:
352         * Resources/ios/iOS.xcassets/StopPictureInPictureButton.imageset/StopPictureInPictureButton@2x.png:
353         * Resources/ios/iOS.xcassets/StopPictureInPictureButton.imageset/StopPictureInPictureButton@3x.png:
354
355 2018-11-12  Eric Carlson  <eric.carlson@apple.com>
356
357         [MediaStream] Screen capture should be an experimental feature on OSX only
358         https://bugs.webkit.org/show_bug.cgi?id=191552
359         <rdar://problem/45994142>
360
361         Reviewed by Youenn Fablet.
362
363         * Shared/WebPreferences.yaml: Make ScreenCaptureEnabled.condition ENABLE(MEDIA_STREAM) && PLATFORM(MAC).
364
365 2018-11-12  Takashi Komori  <Takashi.Komori@sony.com>
366
367         Resurrect WebKitTestRunner for Windows port
368         https://bugs.webkit.org/show_bug.cgi?id=189257
369
370         Reviewed by Fujii Hironori.
371
372         * PlatformWin.cmake:
373
374 2018-11-12  Antoine Quint  <graouts@apple.com>
375
376         [Web Animations] Turn Web Animations experimental
377         https://bugs.webkit.org/show_bug.cgi?id=191543
378
379         Reviewed by Dean Jackson.
380
381         * Shared/WebPreferences.yaml:
382
383 2018-11-11  Wenson Hsieh  <wenson_hsieh@apple.com>
384
385         Implement a new edit command to change the enclosing list type
386         https://bugs.webkit.org/show_bug.cgi?id=191487
387         <rdar://problem/45955922>
388
389         Reviewed by Ryosuke Niwa.
390
391         * UIProcess/WebEditCommandProxy.cpp:
392         (WebKit::WebEditCommandProxy::nameForEditAction):
393
394         Add undo/redo edit action strings for ConvertToOrderedList and ConvertToUnorderedList.
395
396         * WebProcess/WebPage/WebPage.cpp:
397         (WebKit::WebPage::increaseListLevel):
398         (WebKit::WebPage::decreaseListLevel):
399         (WebKit::WebPage::changeListType):
400
401         Remove preflight checks for these list editing commands. These are not necessary because these commands fall
402         back to being noops if these checks return false. This avoids an extraneous ancestor walk to determine the
403         enclosing list element when changing list type.
404
405 2018-11-11  Daniel Bates  <dabates@apple.com>
406
407         [iOS] Draw caps lock indicator in password fields
408         https://bugs.webkit.org/show_bug.cgi?id=190565
409         <rdar://problem/45262343>
410
411         Reviewed by Dean Jackson.
412
413         Notify the WebContent process with the current modifer state on window activation changes. Notify
414         the WebContent process when hardware keyboard availability changes (e.g. a keyboard is attached).
415
416         * UIProcess/API/Cocoa/WKWebView.mm:
417         (-[WKWebView _initializeWithConfiguration:]): Register for hardware keyboard availability changed notifications.
418         (-[WKWebView dealloc]): Unregister from hardware availability changed notifications.
419         (hardwareKeyboardAvailabilityChangedCallback): Added.
420         * UIProcess/WebPageProxy.cpp:
421         (WebKit::WebPageProxy::updateCurrentModifierState): Compile this code when building for iOS.
422         * UIProcess/WebPageProxy.h:
423         * UIProcess/ios/WKContentViewInteraction.mm:
424         (-[WKContentView _handleKeyUIEvent:]): Update the current modifier state if this event is a hardware
425         keyboard flags changed event.
426         * UIProcess/ios/WebPageProxyIOS.mm:
427         (WebKit::WebPageProxy::hardwareKeyboardAvailabilityChanged): Added.
428
429         * WebProcess/WebPage/WebPage.h:
430         * WebProcess/WebPage/WebPage.messages.in:
431         * WebProcess/WebPage/ios/WebPageIOS.mm:
432         (WebKit::WebPage::hardwareKeyboardAvailabilityChanged):
433         Added new message HardwareKeyboardAvailabilityChanged. Notify the focused HTML input element (if we have
434         one) that the caps lock state may have changed when we receive message HardwareKeyboardAvailabilityChanged
435         so that we toggle visibility of the caps lock indicator.
436
437 2018-11-11  Dan Bernstein  <mitz@apple.com>
438
439         ProcessPoolConfiguration::copy() doesn’t copy m_customWebContentServiceBundleIdentifier
440         https://bugs.webkit.org/show_bug.cgi?id=191514
441
442         Reviewed by Geoffrey Garen.
443
444         Test: WebKitCocoa/WKProcessPoolConfiguration.mm
445
446         * UIProcess/API/APIProcessPoolConfiguration.cpp:
447         (API::ProcessPoolConfiguration::copy): Copy m_customWebContentServiceBundleIdentifier.
448
449 2018-11-11  Benjamin Poulain  <benjamin@webkit.org>
450
451         Fix a fixme: rename wtfObjcMsgSend to wtfObjCMsgSend
452         https://bugs.webkit.org/show_bug.cgi?id=191492
453
454         Reviewed by Alex Christensen.
455
456         * Platform/mac/StringUtilities.mm:
457         * UIProcess/ApplicationStateTracker.mm:
458         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
459         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
460
461 2018-11-10  Benjamin Poulain  <benjamin@webkit.org>
462
463         Fix a fixme: rename wtfObjcMsgSend to wtfObjCMsgSend
464         https://bugs.webkit.org/show_bug.cgi?id=191492
465
466         Reviewed by Alex Christensen.
467
468         * Platform/mac/StringUtilities.mm:
469         * UIProcess/ApplicationStateTracker.mm:
470         (WebKit::ApplicationStateTracker::applicationDidEnterBackground):
471         (WebKit::ApplicationStateTracker::applicationDidFinishSnapshottingAfterEnteringBackground):
472         (WebKit::ApplicationStateTracker::applicationWillEnterForeground):
473         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
474         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
475
476 2018-11-10  Ryan Haddad  <ryanhaddad@apple.com>
477
478         Unreviewed, rolling out r238065.
479
480         Breaks internal builds.
481
482         Reverted changeset:
483
484         "Make it possible to edit images inline"
485         https://bugs.webkit.org/show_bug.cgi?id=191352
486         https://trac.webkit.org/changeset/238065
487
488 2018-11-10  Tim Horton  <timothy_horton@apple.com>
489
490         Make it possible to edit images inline
491         https://bugs.webkit.org/show_bug.cgi?id=191352
492         <rdar://problem/30107985>
493
494         Reviewed by Dean Jackson.
495
496         * Platform/spi/ios/PencilKitSPI.h: Added.
497         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
498         (WebKit::RemoteLayerBackingStore::drawInContext):
499         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
500         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
501         (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::LayerCreationProperties):
502         (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::encode const):
503         (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::decode):
504         * WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.cpp:
505         (WebKit::GraphicsLayerCARemote::createPlatformCALayerForEmbeddedView):
506         * WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.h:
507         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
508         (WebKit::PlatformCALayerRemote::createForEmbeddedView):
509         (WebKit::PlatformCALayerRemote::PlatformCALayerRemote):
510         (WebKit::PlatformCALayerRemote::embeddedViewID const):
511         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:
512         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
513         (WebKit::RemoteLayerTreeContext::layerWasCreated):
514         Propagate EmbeddedViewID through the PlatformCALayer constructor and
515         through the layer creation parameters to the UI process.
516
517         * Shared/WebPreferences.yaml:
518         * UIProcess/API/Cocoa/WKWebView.mm:
519         (-[WKWebView _initializeWithConfiguration:]):
520         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
521         (-[WKWebViewConfiguration init]):
522         (-[WKWebViewConfiguration copyWithZone:]):
523         (-[WKWebViewConfiguration _setEditableImagesEnabled:]):
524         (-[WKWebViewConfiguration _editableImagesEnabled]):
525         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
526         Add a preference to enable editable images.
527
528         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h:
529         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
530         (WebKit::RemoteLayerTreeHost::layerWillBeRemoved):
531         (WebKit::RemoteLayerTreeHost::clearLayers):
532         (WebKit::RemoteLayerTreeHost::createLayer):
533         Keep track of "embedded views" in two maps: embeddedViewID->UIView,
534         and layerID->embeddedViewID. Clean them up when layers go away.
535         If a embedded view is reparented, currently it must be added to a new
536         layer in the same commit as it is removed from the previous layer
537         in order to persist the view's state (otherwise the view will be
538         destroyed and recreated). This will be less of a problem after future
539         patches introduce serialization of image data and whatnot.
540
541         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
542         (WebKit::RemoteLayerTreeHost::createLayer):
543         (WebKit::RemoteLayerTreeHost::createEmbeddedView):
544         Move the various remote layer tree UIView subclasses out into a separate file.
545
546         Add createEmbeddedView, which is used for LayerTypeEditableImageLayer,
547         and creates a WKDrawingView and sticks it in the maps.
548
549         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h: Added.
550         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm: Added.
551         (-[UIView _web_recursiveFindDescendantInteractibleViewAtPoint:withEvent:]):
552         (-[UIView _web_findDescendantViewAtPoint:withEvent:]):
553         (-[WKCompositingView hitTest:withEvent:]):
554         (-[WKCompositingView description]):
555         (+[WKTransformView layerClass]):
556         (+[WKSimpleBackdropView layerClass]):
557         (+[WKShapeView layerClass]):
558         (-[WKRemoteView initWithFrame:contextID:]):
559         (+[WKRemoteView layerClass]):
560         (-[WKBackdropView hitTest:withEvent:]):
561         (-[WKBackdropView description]):
562         (-[WKChildScrollView initWithFrame:]):
563         Move various remote layer tree UIView subclasses here, to their own file.
564         Make our UIView hit testing override test for views that conform to the
565         protocol "WKNativelyInteractible", which switches to normal UIView hit
566         testing. WKDrawingView will be the one such view.
567
568         Add WKChildScrollView and pull the one thing we customize out into it,
569         to make RemoteLayerTreeHost::createLayer less logic-ful.
570
571         * UIProcess/ios/WKDrawingView.h: Added.
572         * UIProcess/ios/WKDrawingView.mm: Added.
573         (-[WKDrawingView init]):
574         (-[WKDrawingView layoutSubviews]):
575         Add a very simple WKDrawingView, which uses PKCanvasView to edit the image.
576
577         * WebKit.xcodeproj/project.pbxproj:
578         * SourcesCocoa.txt:
579         Add the new files.
580
581 2018-11-09  Zalan Bujtas  <zalan@apple.com>
582
583         [iOS] Issue initial paint soon after the visuallyNonEmpty milestone is fired.
584         https://bugs.webkit.org/show_bug.cgi?id=191078
585         <rdar://problem/45736178>
586
587         Reviewed by Antti Koivisto.
588
589         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
590         (WebKit::WebChromeClient::layerFlushThrottlingIsActive const):
591         * WebProcess/WebCoreSupport/WebChromeClient.h:
592         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
593         (WebKit::AcceleratedDrawingArea::scheduleInitialDeferredPaint):
594         * WebProcess/WebPage/AcceleratedDrawingArea.h:
595         * WebProcess/WebPage/DrawingArea.h:
596         (WebKit::DrawingArea::layerFlushThrottlingIsActive const):
597         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
598         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
599         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
600         (WebKit::RemoteLayerTreeDrawingArea::setLayerTreeStateIsFrozen):
601         (WebKit::RemoteLayerTreeDrawingArea::initialDeferredPaint):
602         (WebKit::RemoteLayerTreeDrawingArea::scheduleInitialDeferredPaint):
603         (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush):
604         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
605         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
606         (WebKit::TiledCoreAnimationDrawingArea::scheduleInitialDeferredPaint):
607
608 2018-11-09  John Wilander  <wilander@apple.com>
609
610         Add ability to configure document.cookie lifetime cap through user defaults
611         https://bugs.webkit.org/show_bug.cgi?id=191480
612         <rdar://problem/45240871>
613
614         Reviewed by Chris Dumez.
615
616         This change makes the capped lifetime in seconds configurable through
617         user defaults.
618
619         * NetworkProcess/NetworkProcess.cpp:
620         (WebKit::NetworkProcess::setAgeCapForClientSideCookies):
621         (WebKit::NetworkProcess::setShouldCapLifetimeForClientSideCookies): Deleted.
622             Renamed setAgeCapForClientSideCookies().
623         * NetworkProcess/NetworkProcess.h:
624         * NetworkProcess/NetworkProcess.messages.in:
625         * UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm:
626         (WebKit::ResourceLoadStatisticsMemoryStore::registerUserDefaultsIfNeeded):
627         * UIProcess/Network/NetworkProcessProxy.cpp:
628         (WebKit::NetworkProcessProxy::setAgeCapForClientSideCookies):
629         (WebKit::NetworkProcessProxy::didSetAgeCapForClientSideCookies):
630         (WebKit::NetworkProcessProxy::setShouldCapLifetimeForClientSideCookies): Deleted.
631             Renamed setAgeCapForClientSideCookies().
632         (WebKit::NetworkProcessProxy::didSetShouldCapLifetimeForClientSideCookies): Deleted.
633             Renamed didSetAgeCapForClientSideCookies().
634         * UIProcess/Network/NetworkProcessProxy.h:
635         * UIProcess/Network/NetworkProcessProxy.messages.in:
636         * UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
637         (WebKit::ResourceLoadStatisticsMemoryStore::setAgeCapForClientSideCookies):
638         (WebKit::ResourceLoadStatisticsMemoryStore::updateClientSideCookiesAgeCap):
639         (WebKit::ResourceLoadStatisticsMemoryStore::didCreateNetworkProcess):
640             New function that handles all the things that need to be done when a network
641             process has been created.
642         * UIProcess/ResourceLoadStatisticsMemoryStore.h:
643         * UIProcess/WebResourceLoadStatisticsStore.cpp:
644         (WebKit::WebResourceLoadStatisticsStore::didCreateNetworkProcess):
645             Now just calls the corresponding function on its memory store where all the
646             configuration parameters are available.
647         * UIProcess/WebResourceLoadStatisticsStore.h:
648         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
649         (WebKit::WebsiteDataStore::setAgeCapForClientSideCookies):
650         (WebKit::WebsiteDataStore::setShouldCapLifetimeForClientSideCookies): Deleted.
651             Renamed setAgeCapForClientSideCookies().
652         * UIProcess/WebsiteData/WebsiteDataStore.h:
653
654 2018-11-09  Ryan Haddad  <ryanhaddad@apple.com>
655
656         Unreviewed, rolling out r238047.
657
658         Introduced layout test failures on iOS simulator.
659
660         Reverted changeset:
661
662         "[iOS] Draw caps lock indicator in password fields"
663         https://bugs.webkit.org/show_bug.cgi?id=190565
664         https://trac.webkit.org/changeset/238047
665
666 2018-11-09  Chris Dumez  <cdumez@apple.com>
667
668         Suspended page persists even after back/forward list item is gone
669         https://bugs.webkit.org/show_bug.cgi?id=191488
670         <rdar://problem/45953006>
671
672         Reviewed by Geoffrey Garen.
673
674         Currently, the WebProcessPool owns the SuspendedPageProxy objects and makes sure we cap how
675         many we can have. The WebBackForwardListItem merely has a WeakPtr to its associated
676         SuspendedPageProxy. However, there is no point in having the WebProcessPool keeping a
677         SuspendedPageProxy object alive if there is no longer any WebBackForwardListItem pointing
678         to it.
679
680         To address the issue, WebBackForwardListItem nows tells the WebProcessPool to destroy
681         its SuspendedPageProxy when necessary. WebBackForwardList also takes care of nulling
682         out the WebBackForwardListItem's SuspendedPageProxy after the item has been removed
683         from the list (in case somebody keeps the item alive).
684
685         * Shared/WebBackForwardListItem.cpp:
686         (WebKit::WebBackForwardListItem::~WebBackForwardListItem):
687         (WebKit::WebBackForwardListItem::setSuspendedPage):
688         (WebKit::WebBackForwardListItem::suspendedPageIsNoLongerNeeded):
689         * Shared/WebBackForwardListItem.h:
690         * UIProcess/SuspendedPageProxy.cpp:
691         (WebKit::SuspendedPageProxy::SuspendedPageProxy):
692         * UIProcess/WebBackForwardList.cpp:
693         (WebKit::WebBackForwardList::didRemoveItem):
694         * UIProcess/WebProcessPool.cpp:
695         (WebKit::WebProcessPool::removeSuspendedPageProxy):
696         * UIProcess/WebProcessPool.h:
697
698 2018-11-09  Wenson Hsieh  <wenson_hsieh@apple.com>
699
700         [Cocoa] Implement SPI on WKWebView to increase and decrease list levels
701         https://bugs.webkit.org/show_bug.cgi?id=191471
702         <rdar://problem/45952472>
703
704         Reviewed by Tim Horton.
705
706         Implement these method stubs by calling into Editor.
707
708         Test: WKWebViewEditActions.ModifyListLevel
709
710         * WebProcess/WebPage/WebPage.cpp:
711         (WebKit::WebPage::increaseListLevel):
712         (WebKit::WebPage::decreaseListLevel):
713         (WebKit::WebPage::changeListType):
714
715 2018-11-09  Keith Rollin  <krollin@apple.com>
716
717         Unreviewed build fix after https://bugs.webkit.org/show_bug.cgi?id=191324
718
719         Remove the use of .xcfilelists until their side-effects are better
720         understood.
721
722         * WebKit.xcodeproj/project.pbxproj:
723
724 2018-11-09  Basuke Suzuki  <basuke.suzuki@sony.com>
725
726         [Curl][WebKit] Implement Proxy configuration API.
727         https://bugs.webkit.org/show_bug.cgi?id=189053
728
729         Reviewed by Youenn Fablet.
730
731         Added proxy configuration API to WebsiteDataStore. Three API were added in WKWebsiteDataStoreRefCurl.h:
732         - WKWebsiteDataStoreEnableDefaultNetworkProxySettings(WKWebsiteDataStoreRef)
733         - WKWebsiteDataStoreEnableCustomNetworkProxySettings(WKWebsiteDataStoreRef, WKURLRef, WKStringRef ignoreHosts)
734         - WKWebsiteDataStoreDisableNetworkProxySettings(WKWebsiteDataStoreRef)
735
736         * NetworkProcess/NetworkProcess.h:
737         * NetworkProcess/NetworkProcess.messages.in:
738         * NetworkProcess/NetworkSessionCreationParameters.h:
739         (WebKit::NetworkSessionCreationParameters::encode const):
740         (WebKit::NetworkSessionCreationParameters::decode):
741         * NetworkProcess/curl/NetworkProcessCurl.cpp:
742         (WebKit::NetworkProcess::setNetworkProxySettings):
743         * NetworkProcess/curl/NetworkSessionCurl.cpp:
744         (WebKit::NetworkSessionCurl::NetworkSessionCurl):
745         * NetworkProcess/curl/RemoteNetworkingContextCurl.cpp:
746         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
747         * PlatformWin.cmake:
748         * Shared/WebCoreArgumentCoders.h:
749         * Shared/curl/WebCoreArgumentCodersCurl.cpp:
750         (IPC::ArgumentCoder<CurlProxySettings>::encode):
751         (IPC::ArgumentCoder<CurlProxySettings>::decode):
752         * UIProcess/API/C/curl/WKWebsiteDataStoreRefCurl.cpp:
753           Copied from Source/WebKit/NetworkProcess/curl/NetworkSessionCurl.cpp.
754         (WKWebsiteDataStoreEnableDefaultNetworkProxySettings):
755         (WKWebsiteDataStoreEnableCustomNetworkProxySettings):
756         (WKWebsiteDataStoreDisableNetworkProxySettings):
757         * UIProcess/API/C/curl/WKWebsiteDataStoreRefCurl.h:
758           Copied from Source/WebKit/NetworkProcess/curl/NetworkSessionCurl.cpp.
759         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
760         (WebKit::WebsiteDataStore::parameters):
761         * UIProcess/WebsiteData/WebsiteDataStore.h:
762         (WebKit::WebsiteDataStore::networkProxySettings const):
763         * UIProcess/WebsiteData/curl/WebsiteDataStoreCurl.cpp:
764           Copied from Source/WebKit/NetworkProcess/curl/NetworkSessionCurl.cpp.
765         (WebKit::WebsiteDataStore::platformSetParameters):
766         (WebKit::WebsiteDataStore::setNetworkProxySettings):
767
768 2018-11-09  Wenson Hsieh  <wenson_hsieh@apple.com>
769
770         [Cocoa] Introduce WKWebView SPI to insert nested ordered and unordered lists
771         https://bugs.webkit.org/show_bug.cgi?id=191410
772         <rdar://problem/45898610>
773
774         Reviewed by Dean Jackson.
775
776         Prefixes a few iOS-only SPI methods declared on WKWebView in r236867 with underscores, and also exposes some
777         more cross-platform Cocoa editing SPI. Once the unprefixed SPI methods are no longer used by internal clients,
778         these will need to be removed (see followup bug: webkit.org/b/191450). See below for more details.
779
780         Covered by new and existing API tests in WKWebViewEditActions.
781
782         * UIProcess/API/Cocoa/WKWebView.mm:
783
784         Hoist the definition (and undefinition) of `FORWARD_ACTION_TO_WKCONTENTVIEW` to encompass both the WKWebView
785         implementation and the WKWebView (WKPrivate) implementation. This allows us to use this macro when implementing
786         SPI methods in the WKPrivate category, as well as methods that are part of the main WKWebView implementation.
787
788         (-[WKWebView canPerformAction:withSender:]):
789         (-[WKWebView targetForAction:withSender:]):
790
791         Add forwarding for the new editing commands in -canPerformAction: and -targetForAction:.
792
793         (-[WKWebView _toggleStrikeThrough:]):
794         (-[WKWebView _increaseListLevel:]):
795         (-[WKWebView _decreaseListLevel:]):
796         (-[WKWebView _changeListType:]):
797         (-[WKWebView _setFont:sender:]):
798         (-[WKWebView _setFontSize:sender:]):
799         (-[WKWebView _setTextColor:sender:]):
800
801         Add definitions for the new editing methods on WKWebView, using macros (`WEBCORE_PRIVATE_COMMAND` on macOS and
802         `FORWARD_ACTION_TO_WKCONTENTVIEW` on iOS) to help reduce the code duplication.
803
804         (-[WKWebView _pasteAsQuotation:]): Deleted.
805
806         Remove this method definition, which is now replaced by macros on iOS and macOS.
807
808         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
809
810         Introduce the new SPI to WKWebView (WKPrivate), and add FIXMEs to remove old, unprefixed variants of the SPI.
811
812         * UIProcess/WebPageProxy.cpp:
813         (WebKit::WebPageProxy::increaseListLevel):
814         (WebKit::WebPageProxy::decreaseListLevel):
815         (WebKit::WebPageProxy::changeListType):
816
817         Add plumbing for these list editing commands.
818
819         * UIProcess/WebPageProxy.h:
820         * UIProcess/ios/WKContentViewInteraction.h:
821         * UIProcess/ios/WKContentViewInteraction.mm:
822         (-[WKContentView _increaseListLevelForWebView:]):
823         (-[WKContentView _decreaseListLevelForWebView:]):
824         (-[WKContentView _changeListTypeForWebView:]):
825         (-[WKContentView _toggleStrikeThroughForWebView:]):
826         (-[WKContentView _setFontForWebView:sender:]):
827         (-[WKContentView _setFontSizeForWebView:sender:]):
828         (-[WKContentView _setTextColorForWebView:sender:]):
829         (-[WKContentView toggleStrikeThroughForWebView:]):
830         (-[WKContentView setFontForWebView:sender:]):
831         (-[WKContentView setFontSizeForWebView:sender:]):
832         (-[WKContentView setTextColorForWebView:sender:]):
833         (-[WKContentView canPerformActionForWebView:withSender:]):
834
835         Check for the new action selectors here, and additionally add validation for `_pasteAsQuotation:`. Let the
836         unprefixed versions of these methods simply call the prefixed versions (these method implementations will be
837         removed in a followup once doing so would not affect any clients of WebKit).
838
839         * WebKit.xcodeproj/project.pbxproj:
840         * WebProcess/WebPage/WebPage.cpp:
841         (WebKit::WebPage::increaseListLevel):
842         (WebKit::WebPage::decreaseListLevel):
843         (WebKit::WebPage::changeListType):
844         * WebProcess/WebPage/WebPage.h:
845         * WebProcess/WebPage/WebPage.messages.in:
846
847         Add stubs for several list editing commands that are yet to be hooked up to WebCore. These will be implemented
848         in a future patch.
849
850 2018-11-09  Antti Koivisto  <antti@apple.com>
851
852         Use OptionSet for layout milestones
853         https://bugs.webkit.org/show_bug.cgi?id=191470
854
855         Reviewed by Dean Jackson.
856
857         * Shared/API/Cocoa/_WKRenderingProgressEventsInternal.h:
858         (renderingProgressEvents):
859         * Shared/API/c/WKSharedAPICast.h:
860         (WebKit::toWKLayoutMilestones):
861         (WebKit::toLayoutMilestones):
862         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
863         (WebKit::RemoteLayerTreeTransaction::newlyReachedLayoutMilestones const):
864         (WebKit::RemoteLayerTreeTransaction::setNewlyReachedLayoutMilestones):
865         * Shared/WebPageCreationParameters.cpp:
866         (WebKit::WebPageCreationParameters::encode const):
867         (WebKit::WebPageCreationParameters::decode):
868         * Shared/WebPageCreationParameters.h:
869         * UIProcess/API/APILoaderClient.h:
870         (API::LoaderClient::didReachLayoutMilestone):
871         * UIProcess/API/APINavigationClient.h:
872         (API::NavigationClient::renderingProgressDidChange):
873         * UIProcess/API/C/WKPage.cpp:
874         (WKPageSetPageLoaderClient):
875         (WKPageSetPageNavigationClient):
876         * UIProcess/API/C/WKPageRenderingProgressEventsInternal.h:
877         (pageRenderingProgressEvents):
878         * UIProcess/API/Cocoa/WKWebView.mm:
879         (layoutMilestones):
880         * UIProcess/Cocoa/NavigationState.h:
881         * UIProcess/Cocoa/NavigationState.mm:
882         (WebKit::NavigationState::NavigationClient::renderingProgressDidChange):
883         * UIProcess/WebPageProxy.cpp:
884         (WebKit::WebPageProxy::listenForLayoutMilestones):
885         (WebKit::WebPageProxy::didLayoutForCustomContentProvider):
886         (WebKit::WebPageProxy::didReachLayoutMilestone):
887         * UIProcess/WebPageProxy.h:
888         * UIProcess/WebPageProxy.messages.in:
889         * UIProcess/ios/WebPageProxyIOS.mm:
890         (WebKit::WebPageProxy::didCommitLayerTree):
891         * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
892         (API::InjectedBundle::PageLoaderClient::didReachLayoutMilestone):
893         (API::InjectedBundle::PageLoaderClient::layoutMilestones const):
894         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
895         (WebKit::InjectedBundlePageLoaderClient::didReachLayoutMilestone):
896         (WebKit::InjectedBundlePageLoaderClient::layoutMilestones const):
897         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
898         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
899         (WebKit::WebFrameLoaderClient::dispatchDidReachLayoutMilestone):
900         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
901         * WebProcess/WebPage/DrawingArea.h:
902         (WebKit::DrawingArea::dispatchDidReachLayoutMilestone):
903         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
904         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
905         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
906         (WebKit::RemoteLayerTreeDrawingArea::dispatchDidReachLayoutMilestone):
907         * WebProcess/WebPage/WebPage.cpp:
908         (WebKit::m_shouldAttachDrawingAreaOnPageTransition):
909         (WebKit::WebPage::listenForLayoutMilestones):
910         (WebKit::WebPage::dispatchDidReachLayoutMilestone):
911         * WebProcess/WebPage/WebPage.h:
912         * WebProcess/WebPage/WebPage.messages.in:
913         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
914         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
915         (WebKit::TiledCoreAnimationDrawingArea::sendPendingNewlyReachedLayoutMilestones):
916         (WebKit::TiledCoreAnimationDrawingArea::dispatchDidReachLayoutMilestone):
917
918 2018-11-09  Daniel Bates  <dabates@apple.com>
919
920         [iOS] Draw caps lock indicator in password fields
921         https://bugs.webkit.org/show_bug.cgi?id=190565
922         <rdar://problem/45262343>
923
924         Reviewed by Dean Jackson.
925
926         Notify the WebContent process with the current modifer state on window activation changes. Notify
927         the WebContent process when hardware keyboard availability changes (e.g. a keyboard is attached).
928
929         * UIProcess/API/Cocoa/WKWebView.mm:
930         (-[WKWebView _initializeWithConfiguration:]): Register for hardware keyboard availability changed notifications.
931         (-[WKWebView dealloc]): Unregister from hardware availability changed notifications.
932         (hardwareKeyboardAvailabilityChangedCallback): Added.
933         * UIProcess/WebPageProxy.cpp:
934         (WebKit::WebPageProxy::updateCurrentModifierState): Compile this code when building for iOS.
935         * UIProcess/WebPageProxy.h:
936         * UIProcess/ios/WKContentViewInteraction.mm:
937         (-[WKContentView _handleKeyUIEvent:]): Update the current modifier state if this event is a hardware
938         keyboard flags changed event.
939         * UIProcess/ios/WebPageProxyIOS.mm:
940         (WebKit::WebPageProxy::hardwareKeyboardAvailabilityChanged): Added.
941
942         * WebProcess/WebPage/WebPage.h:
943         * WebProcess/WebPage/WebPage.messages.in:
944         * WebProcess/WebPage/ios/WebPageIOS.mm:
945         (WebKit::WebPage::hardwareKeyboardAvailabilityChanged):
946         Added new message HardwareKeyboardAvailabilityChanged. Notify the focused HTML input element (if we have
947         one) that the caps lock state may have changed when we receive message HardwareKeyboardAvailabilityChanged
948         so that we toggle visibility of the caps lock indicator.
949
950 2018-11-09  Tim Horton  <timothy_horton@apple.com>
951
952         Make use of _UIRemoteView instead of CALayerHost if possible for WKRemoteView
953         https://bugs.webkit.org/show_bug.cgi?id=191449
954         <rdar://problem/45884977>
955
956         Reviewed by Eric Carlson.
957
958         UIRemoteView has some nice process assertion management that it would
959         be nice to not duplicate. So, we can just use it instead of CALayerHost!
960
961         * Platform/spi/ios/UIKitSPI.h:
962         * UIProcess/DrawingAreaProxy.h:
963         (WebKit::DrawingAreaProxy::page const):
964         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
965         (-[WKUIRemoteView hitTest:withEvent:]):
966         (-[WKUIRemoteView description]):
967         (createRemoteView):
968         (WebKit::RemoteLayerTreeHost::createLayer):
969
970 2018-11-09  Eric Carlson  <eric.carlson@apple.com>
971
972         [MediaStream] Make screen capture an experimental feature
973         https://bugs.webkit.org/show_bug.cgi?id=191472
974         <rdar://problem/45946499>
975
976         Reviewed by Jer Noble.
977
978         * Shared/WebPreferences.yaml: Make ScreenCaptureEnabled an experimental feature.
979
980 2018-11-09  Daniel Bates  <dabates@apple.com>
981
982         [iOS] Pressing forward delete key in text field does nothing and we should not invoke an editor
983         action when forward delete is pressed outside a text field
984         https://bugs.webkit.org/show_bug.cgi?id=190566
985         <rdar://problem/45262367>
986
987         Reviewed by Wenson Hsieh.
988
989         Override -_deleteForwardAndNotify to perform a forward deletion and remove the dead code that
990         expected UIKit to send us a character string with 0xF728 for the forward delete key. UIKit
991         ceased doing this many years ago. We may revist this decision once <rdar://problem/45772078>
992         is fixed.
993
994         * UIProcess/ios/WKContentViewInteraction.mm:
995         (-[WKContentView _interpretKeyEvent:isCharEvent:]):
996         (-[WKContentView _deleteForwardAndNotify:]):
997
998 2018-11-08  Wenson Hsieh  <wenson_hsieh@apple.com>
999
1000         Unreviewed, try to fix the 32-bit macOS build
1001
1002         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1003         (WebKit::PDFPlugin::showDefinitionForAttributedString):
1004
1005 2018-11-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
1006
1007         Add an SPI to allow WebView clients to add additional supported image formats
1008         https://bugs.webkit.org/show_bug.cgi?id=190454
1009
1010         Reviewed by Simon Fraser.
1011
1012         * Platform/mac/StringUtilities.h:
1013         * Platform/mac/StringUtilities.mm:
1014         (WebKit::webCoreStringVectorFromNSStringArray):
1015         A helper function which converts an NSArray of NSStrings to a Vector of
1016         WTFString.
1017
1018         * Shared/WebPageCreationParameters.cpp:
1019         (WebKit::WebPageCreationParameters::encode const):
1020         (WebKit::WebPageCreationParameters::decode):
1021         * Shared/WebPageCreationParameters.h:
1022         Handle encoding and decoding the AdditionalSupportedImageTypes which will
1023         allow transferring it from the UI process to the web process.
1024
1025         * UIProcess/API/APIPageConfiguration.h:
1026         (API::PageConfiguration::additionalSupportedImageTypes const):
1027         (API::PageConfiguration::setAdditionalSupportedImageTypes):
1028         Store the AdditionalSupportedImageTypes in the APIPageConfiguration
1029         which is used when creating the WebPageProxy in the UIPorcess.
1030
1031         * UIProcess/API/Cocoa/WKWebView.mm:
1032         (-[WKWebView _initializeWithConfiguration:]):
1033         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1034         (-[WKWebViewConfiguration copyWithZone:]):
1035         (-[WKWebViewConfiguration _additionalSupportedImageTypes]):
1036         (-[WKWebViewConfiguration _setAdditionalSupportedImageTypes:]):
1037         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1038         Setter/Getter for the AdditionalSupportedImageTypes.
1039
1040         * UIProcess/WebPageProxy.cpp:
1041         (WebKit::WebPageProxy::creationParameters):
1042         Copy the AdditionalSupportedImageTypes from APIPageConfiguration to 
1043         WebPageCreationParameters.
1044
1045         * UIProcess/WebPageProxy.h:
1046         Delete unimplemented function.
1047
1048         * WebProcess/WebPage/WebPage.cpp:
1049         (WebKit::m_shouldAttachDrawingAreaOnPageTransition):
1050         Copy the AdditionalSupportedImageTypes from WebPageCreationParameters to
1051         WebCore.
1052
1053 2018-11-08  Megan Gardner  <megan_gardner@apple.com>
1054
1055         Adopt Reveal Framework to replace Lookup
1056         https://bugs.webkit.org/show_bug.cgi?id=191097
1057         <rdar://problem/45924508>
1058
1059         Reviewed by Tim Horton.
1060
1061         Pass in what it needed to clear the textIndicators. This is better than
1062         the current notification structure.
1063
1064         * UIProcess/Cocoa/WebViewImpl.mm:
1065         (-[WKWindowVisibilityObserver dealloc]):
1066         (-[WKWindowVisibilityObserver startObservingLookupDismissalIfNeeded]):
1067         * UIProcess/mac/PageClientImplMac.mm:
1068         (WebKit::PageClientImpl::didPerformDictionaryLookup):
1069         * UIProcess/mac/WKImmediateActionController.mm:
1070         (-[WKImmediateActionController _animationControllerForText]):
1071         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1072         (WebKit::PDFPlugin::showDefinitionForAttributedString):
1073
1074         Generate and pass in the text indicator information, as this is needed now.
1075
1076         * WebProcess/WebPage/mac/WebPageMac.mm:
1077         (WebKit::WebPage::dictionaryPopupInfoForSelectionInPDFPlugin):
1078
1079 2018-11-08  Keith Rollin  <krollin@apple.com>
1080
1081         Create .xcfilelist files
1082         https://bugs.webkit.org/show_bug.cgi?id=191324
1083         <rdar://problem/45852819>
1084
1085         Reviewed by Alex Christensen.
1086
1087         As part of preparing for enabling XCBuild, create and use .xcfilelist
1088         files. These files are using during Run Script build phases in an
1089         Xcode project. If a Run Script build phase produces new files that are
1090         used later as inputs to subsequent build phases, XCBuild needs to know
1091         about these files. These files can be either specified in an "output
1092         files" section of the Run Script phase editor, or in .xcfilelist files
1093         that are associated with the Run Script build phase.
1094
1095         This patch takes the second approach. It consists of three sets of changes:
1096
1097         - Modify the DerivedSources.make files to have a
1098           'print_all_generated_files" target that produces a list of the files
1099           they create.
1100
1101         - Create a shell script that produces .xcfilelist files from the
1102           output of the previous step, as well as for the files created in the
1103           Generate Unified Sources build steps.
1104
1105         - Add the new .xcfilelist files to the associated projects.
1106
1107         Note that, with these changes, the Xcode workspace and projects can no
1108         longer be fully loaded into Xcode 9. Xcode will attempt to load the
1109         projects that have .xcfilelist files associated with them, but will
1110         fail and display a placeholder for those projects instead. It's
1111         expected that all developers are using Xcode 10 by now and that not
1112         being able to load into Xcode 9 is not a practical issue. Keep in mind
1113         that this is strictly an IDE issue, and that the projects can still be
1114         built with `xcodebuild`.
1115
1116         Also note that the shell script that creates the .xcfilelist files can
1117         also be used to verify that the set of files that's currently checked
1118         in is up-to-date. This checking can be used as part of a check-in hook
1119         or part of check-webkit-style to sooner catch cases where the
1120         .xcfilelist files need to be regenerated.
1121
1122         * DerivedSources.make:
1123         * DerivedSources.xcfilelist: Added.
1124         * UnifiedSources.xcfilelist: Added.
1125         * WebKit.xcodeproj/project.pbxproj:
1126
1127 2018-11-08  Timothy Hatcher  <timothy@apple.com>
1128
1129         Add experimental support for a `supported-color-schemes` CSS property.
1130         https://bugs.webkit.org/show_bug.cgi?id=191319
1131         rdar://problem/45852261
1132
1133         Reviewed by Dean Jackson.
1134
1135         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
1136         (WebKit::InjectedBundleRangeHandle::renderedImage):
1137         * WebProcess/WebPage/WebPage.cpp:
1138         (WebKit::WebPage::drawRect):
1139
1140 2018-11-08  Eric Carlson  <eric.carlson@apple.com>
1141
1142         [MediaStream] Use DeviceIdHashSaltStorage to generate device ID hash salt
1143         https://bugs.webkit.org/show_bug.cgi?id=190825
1144         <rdar://problem/45486085>
1145
1146         Reviewed by Youenn Fablet.
1147
1148         * UIProcess/API/C/WKUserMediaPermissionCheck.cpp:
1149         (WKUserMediaPermissionCheckSetUserMediaAccessInfo):
1150         * UIProcess/API/glib/WebKitDeviceInfoPermissionRequest.cpp:
1151         (webkitDeviceInfoPermissionRequestAllow):
1152         (webkitDeviceInfoPermissionRequestDeny):
1153         * UIProcess/Cocoa/UIDelegate.mm:
1154         (WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin):
1155         * UIProcess/DeviceIdHashSaltStorage.cpp:
1156         (WebKit::DeviceIdHashSaltStorage::regenerateDeviceIdHashSaltForOrigin):
1157         (WebKit::DeviceIdHashSaltStorage::deleteDeviceIdHashSaltForOrigin):
1158         * UIProcess/DeviceIdHashSaltStorage.h:
1159         * UIProcess/UserMediaPermissionCheckProxy.cpp:
1160         (WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo):
1161         * UIProcess/UserMediaPermissionCheckProxy.h:
1162         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1163         (WebKit::UserMediaPermissionRequestManagerProxy::createPermissionRequest):
1164         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
1165         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
1166         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo):
1167         (WebKit::UserMediaPermissionRequestManagerProxy::updateDeviceIDHashSalt):
1168         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
1169         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
1170         * UIProcess/UserMediaPermissionRequestProxy.cpp:
1171         (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy):
1172         * UIProcess/UserMediaPermissionRequestProxy.h:
1173         (WebKit::UserMediaPermissionRequestProxy::create):
1174         (WebKit::UserMediaPermissionRequestProxy::deviceIdentifierHashSalt const): Deleted.
1175
1176 2018-11-08  Carlos Garcia Campos  <cgarcia@igalia.com>
1177
1178         [GTK] Crash when running with sandbox enabled
1179         https://bugs.webkit.org/show_bug.cgi?id=191353
1180
1181         Reviewed by Michael Catanzaro.
1182
1183         g_key_file_set_string_list() expects a null-terminated array as parameter.
1184
1185         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
1186         (WebKit::createFlatpakInfo): Append nullptr to sharedPermissions array.
1187
1188 2018-11-07  Chris Dumez  <cdumez@apple.com>
1189
1190         Unreviewed, fix iOS build with recent SDKs.
1191
1192         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
1193         (-[WKFullScreenWindowController _EVOrganizationName]):
1194
1195 2018-11-07  John Wilander  <wilander@apple.com>
1196
1197         Resource Load Statistics: Enable cap on partitioned cache max age
1198         https://bugs.webkit.org/show_bug.cgi?id=191395
1199         <rdar://problem/45885977>
1200
1201         Reviewed by Chris Dumez.
1202
1203         This change does not bump the network cache revision number.
1204         It's not needed since it was done just a week ago.
1205
1206         * UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
1207         (WebKit::ResourceLoadStatisticsMemoryStore::setCacheMaxAgeCap):
1208         (WebKit::ResourceLoadStatisticsMemoryStore::updateCacheMaxAgeCap):
1209         * UIProcess/ResourceLoadStatisticsMemoryStore.h:
1210         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1211         (WebKit::WebResourceLoadStatisticsStore::didCreateNetworkProcess):
1212
1213 2018-11-07  Daniel Bates  <dabates@apple.com>
1214
1215         [iOS] Support deleting to the start of the line and to the end of the line
1216         https://bugs.webkit.org/show_bug.cgi?id=191389
1217         <rdar://problem/45883972>
1218
1219         Reviewed by Wenson Hsieh.
1220
1221         Add support for the key commands Command + Delete and Control + K to delete to the start
1222         of the line and to delete to the end of the line, respectively.
1223
1224         * UIProcess/ios/WKContentViewInteraction.mm:
1225         (-[WKContentView _deleteToStartOfLine]): Added.
1226         (-[WKContentView _deleteToEndOfLine]): Added.
1227
1228 2018-11-07  Daniel Bates  <dabates@apple.com>
1229
1230         [iOS] Option + Delete should delete previous word
1231         https://bugs.webkit.org/show_bug.cgi?id=191381
1232         <rdar://problem/23681351>
1233
1234         Reviewed by Wenson Hsieh.
1235
1236         Implement support for pressing Option + Delete to delete the previous word. This makes text editing
1237         in WebKit more closely match the platform conventions.
1238
1239         * UIProcess/ios/WKContentViewInteraction.mm:
1240         (-[WKContentView _deleteByWord]):
1241
1242 2018-11-07  Daniel Bates  <dabates@apple.com>
1243
1244         Override +[UIKeyboard isInHardwareKeyboardMode] in WebKitTestRunner and DumpRenderTree
1245         https://bugs.webkit.org/show_bug.cgi?id=190141
1246
1247         Reviewed by Darin Adler.
1248
1249         Directly use +[UIKeyboard isInHardwareKeyboardMode]. We will override this class method
1250         in DumpRenderTree and WebKitTestRunner to always return NO so as to make test runs
1251         deterministic regardless of whether a hardware keyboard is attached.
1252
1253         * Shared/NativeWebKeyboardEvent.h:
1254         * Shared/ios/NativeWebKeyboardEventIOS.mm:
1255         (WebKit::isInHardwareKeyboardMode): Deleted.
1256         * UIProcess/ios/WKContentViewInteraction.mm:
1257         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
1258         * WebProcess/WebPage/ios/WebPageIOS.mm:
1259         (WebKit::WebPage::platformEditorState const):
1260
1261 2018-11-07  Zamiul Haque  <zhaque@apple.com>
1262
1263         Force a gregorian calendar to show for credit card expiration date inputs
1264         (autocomplete='cc-exp'*) regardless of default system settings.
1265         https://bugs.webkit.org/show_bug.cgi?id=191096
1266         rdar://problem/42640256
1267
1268         Reviewed by Tim Horton.
1269
1270         Added some plumbing code to expose the calendar identifier of the calendar used by a
1271         presented date picker. Added shouldPresentGregorianCalendar:, to be used for
1272         determining what property values a date input control must present a Gregorian
1273         calendar for.
1274
1275         * UIProcess/ios/WKContentViewInteraction.mm:
1276         (-[WKContentView formInputPeripheral]):
1277         * UIProcess/ios/forms/WKFormInputControl.mm:
1278
1279 2018-11-07  Carlos Garcia Campos  <cgarcia@igalia.com>
1280
1281         Unreviewed. Fix GTK/WPE build when memfd is not available after r237922.
1282
1283         * Platform/unix/SharedMemoryUnix.cpp:
1284         (WebKit::createSharedMemory):
1285
1286 2018-11-07  Carlos Garcia Campos  <cgarcia@igalia.com>
1287
1288         [Linux] Use memfd_create when available in SharedMemory implementation
1289         https://bugs.webkit.org/show_bug.cgi?id=189741
1290
1291         Reviewed by Michael Catanzaro.
1292
1293         If memfd is available, use it instead of shm_open.
1294
1295         * Platform/unix/SharedMemoryUnix.cpp:
1296         (WebKit::createSharedMemory): Helper to create the shared memory, trying first with memfd and falling back to
1297         shm if it's not available.
1298         (WebKit::SharedMemory::create): Use createSharedMemory() helper.
1299
1300 2018-11-06  Justin Fan  <justin_fan@apple.com>
1301
1302         [WebGPU] Experimental prototype for WebGPURenderPipeline and WebGPUSwapChain
1303         https://bugs.webkit.org/show_bug.cgi?id=191291
1304
1305         Reviewed by Myles Maxfield.
1306
1307         Properly disable WEBGPU on all non-Metal platforms for now.
1308
1309         * Configurations/FeatureDefines.xcconfig:
1310
1311 2018-11-06  Youenn Fablet  <youenn@apple.com>
1312
1313         Make mDNS ICE Candidate an experimental flag again
1314         https://bugs.webkit.org/show_bug.cgi?id=191262
1315
1316         Reviewed by Dean Jackson.
1317
1318         * Shared/WebPreferences.yaml:
1319         * UIProcess/API/C/WKPreferences.cpp:
1320         (WKPreferencesSetWebRTCMDNSICECandidatesEnabled):
1321         (WKPreferencesGetWebRTCMDNSICECandidatesEnabled):
1322         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1323         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1324
1325 2018-11-06  Suresh Koppisetty  <skoppisetty@apple.com>
1326
1327         Don’t use the main queue to create an XPC connection.
1328         https://bugs.webkit.org/show_bug.cgi?id=191160
1329         <rdar://problem/45736262>
1330
1331         Reviewed by Geoffrey Garen.
1332
1333         Don't use the main queue to create an XPC connection. xpc_connection_set_bootstrap does
1334         dispatch_mach_send_barrier_f on this queue which delays the sending of the subsequent
1335         bootstrap message (sent to launchd for launching a new target process) when the main queue is busy.
1336
1337         Now that the XPC connection runs on the default concurrent queue, errorHandler could be invoked
1338         by any thread. The job of errorHandler is to dispatch errorHandlerImpl to the main thread,
1339         where errorHandlerImpl is responsible for the actual handling of errors if any.
1340
1341         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1342         (WebKit::ProcessLauncher::launchProcess):
1343
1344 2018-11-06  Brian Burg  <bburg@apple.com>
1345
1346         Add missing iOS availability macro to _WKAutomationSessionConfiguration
1347         https://bugs.webkit.org/show_bug.cgi?id=191320
1348
1349         Reviewed by Tim Horton.
1350
1351         * UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.h:
1352
1353 2018-11-06  John Wilander  <wilander@apple.com>
1354
1355         Resource Load Statistics: Remove cap on partitioned cache max age if it matches a network reload (redirect-only)
1356         https://bugs.webkit.org/show_bug.cgi?id=189760
1357         <rdar://problem/44612242>
1358
1359         Reviewed by Youenn Fablet and Antti Koivisto.
1360
1361         When a redirect cache entry for a prevalent resource reaches its max
1362         age cap, it is loaded again from the network and the network response
1363         is compared with what's in the cache. If it's a match, the cache entry
1364         is fully accepted. If not, a new capped cache entry is created.
1365
1366         This feature is still off by default.
1367
1368         * NetworkProcess/NetworkResourceLoader.cpp:
1369         (WebKit::NetworkResourceLoader::canUseCachedRedirect const):
1370             Now checks the new member m_cacheEntryForMaxAgeCapValidation.
1371         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
1372             New case handled for entry->hasReachedPrevalentResourceAgeCap().
1373         (WebKit::NetworkResourceLoader::validateCacheEntryForMaxAgeCapValidation):
1374             This is where the new logic compares the incoming redirect with the
1375             cached one. If they match, an uncapped entry is allowed to be stored.
1376             If they don't match, a new capped entry will be stored.
1377         (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
1378             Now calls the new
1379             NetworkResourceLoader::validateCacheEntryForMaxAgeCapValidation()
1380             function.
1381         * NetworkProcess/NetworkResourceLoader.h:
1382             Added the m_cacheEntryForMaxAgeCapValidation member.
1383         * NetworkProcess/cache/NetworkCache.cpp:
1384         (WebKit::NetworkCache::makeUseDecision):
1385             Restored to previous behavior which means
1386             UseDecision::NoDueToPrevalentResourceAgeCap was removed.
1387         (WebKit::NetworkCache::Cache::retrieve):
1388             Restored to previous behavior.
1389         (WebKit::NetworkCache::Cache::storeRedirect):
1390             Now takes the optional maxAgeCap and caps the entry's max age if it's set.
1391         (WebKit::NetworkCache::hasReachedPrevalentResourceAgeCap): Deleted.
1392         * NetworkProcess/cache/NetworkCache.h:
1393         * NetworkProcess/cache/NetworkCacheEntry.cpp:
1394         (WebKit::NetworkCache::Entry::encodeAsStorageRecord const):
1395             Now encodes m_maxAgeCap.
1396         (WebKit::NetworkCache::Entry::decodeStorageRecord):
1397             Now decodes m_maxAgeCap.
1398         (WebKit::NetworkCache::Entry::hasReachedPrevalentResourceAgeCap const):
1399             Added.
1400         (WebKit::NetworkCache::Entry::capMaxAge):
1401             Added.
1402         * NetworkProcess/cache/NetworkCacheEntry.h:
1403             Added the optional m_maxAgeCap.
1404         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
1405         (WebKit::NetworkCache::SpeculativeLoad::willSendRedirectedRequest):
1406             Now gets the optional max age cap from the NetworkStorageSession and sends it
1407             to Cache::storeRedirect().
1408         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
1409         (WebKit::NetworkCache::cachedEntryReuseFailureToDiagnosticKey):
1410             Removed handling of UseDecision::NoDueToPrevalentResourceAgeCap.
1411
1412 2018-11-06  Per Arne Vollan  <pvollan@apple.com>
1413
1414         REGRESSION (r230523): Caps lock indicator not shown in password field
1415         https://bugs.webkit.org/show_bug.cgi?id=190056
1416
1417         Reviewed by Ryosuke Niwa.
1418
1419         Update cached modifier state in the WebProcess when WebKit::WebPage::keyEvent is called, and
1420         when the window becomes active.
1421
1422         * UIProcess/WebPageProxy.cpp:
1423         (WebKit::WebPageProxy::dispatchActivityStateChange):
1424         (WebKit::WebPageProxy::updateCurrentModifierState):
1425         * UIProcess/WebPageProxy.h:
1426         * WebProcess/WebPage/WebPage.cpp:
1427         (WebKit::WebPage::keyEvent):
1428         (WebKit::WebPage::updateCurrentModifierState):
1429         * WebProcess/WebPage/WebPage.h:
1430         * WebProcess/WebPage/WebPage.messages.in:
1431
1432 2018-11-06  Alex Christensen  <achristensen@webkit.org>
1433
1434         Add ObjC SPI equivalent of WKContextHandlesSafeBrowsing
1435         https://bugs.webkit.org/show_bug.cgi?id=191329
1436
1437         Reviewed by Tim Horton.
1438
1439         Like WKContextHandlesSafeBrowsing, this is so I can make one change in WebKit and enable safe browsing
1440         in WKWebView and disable it in Safari at the same time without broken revisions between landing two changes
1441         in two repositories.
1442
1443         * UIProcess/API/Cocoa/WKWebView.mm:
1444         (+[WKWebView handlesSafeBrowsing]):
1445         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1446
1447 2018-11-06  Eric Carlson  <eric.carlson@apple.com>
1448
1449         [MediaStream] User should not be prompted again after denying getDisplayMedia request
1450         https://bugs.webkit.org/show_bug.cgi?id=191227
1451         <rdar://problem/45784512>
1452
1453         Reviewed by Youenn Fablet.
1454
1455         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1456         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied):
1457         (WebKit::UserMediaPermissionRequestManagerProxy::wasRequestDenied):
1458         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
1459         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
1460
1461 2018-11-06  Fujii Hironori  <Hironori.Fujii@sony.com>
1462
1463         [MediaStream] User should not be prompted again after denying getDisplayMedia request
1464         https://bugs.webkit.org/show_bug.cgi?id=191227
1465         <rdar://problem/45784512>
1466
1467         Unreviewed build fix of ports not ENABLE(MEDIA_STREAM).
1468
1469         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: Define getRequestAction only if ENABLE(MEDIA_STREAM).
1470         * UIProcess/UserMediaPermissionRequestManagerProxy.h: Ditto.
1471
1472 2018-11-03  Alex Christensen  <achristensen@webkit.org>
1473
1474         [Mac] Implement safe browsing in WebKit
1475         https://bugs.webkit.org/show_bug.cgi?id=188871
1476
1477         Reviewed by Tim Horton.
1478
1479         * Platform/spi/Cocoa/SafeBrowsingSPI.h:
1480         * Resources/SafeBrowsing.xcassets: Added.
1481         * Resources/SafeBrowsing.xcassets/Contents.json: Added.
1482         * Resources/SafeBrowsing.xcassets/WKSafeBrowsingWarningBackground.colorset: Added.
1483         * Resources/SafeBrowsing.xcassets/WKSafeBrowsingWarningBackground.colorset/Contents.json: Added.
1484         * Resources/SafeBrowsing.xcassets/WKSafeBrowsingWarningText.colorset: Added.
1485         * Resources/SafeBrowsing.xcassets/WKSafeBrowsingWarningText.colorset/Contents.json: Added.
1486         * Resources/SafeBrowsing.xcassets/WKSafeBrowsingWarningTitle.colorset: Added.
1487         * Resources/SafeBrowsing.xcassets/WKSafeBrowsingWarningTitle.colorset/Contents.json: Added.
1488         * Shared/WebPreferences.yaml:
1489         * Shared/WebPreferencesDefaultValues.h:
1490         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
1491         (WKContextHandlesSafeBrowsing):
1492         * UIProcess/Cocoa/SafeBrowsingResultCocoa.mm:
1493         (WebKit::malwareDetailsBase):
1494         (WebKit::learnMore):
1495         (WebKit::reportAnErrorBase):
1496         (WebKit::localizedProvider):
1497         (WebKit::SafeBrowsingResult::SafeBrowsingResult):
1498         * UIProcess/Cocoa/WKSafeBrowsingWarning.h: Added.
1499         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm: Added.
1500         (confirmMalwareSentinel):
1501         (visitUnsafeWebsiteSentinel):
1502         (colorNamed):
1503         (replace):
1504         (addLinkAndReplace):
1505         (-[WKSafeBrowsingExclamationPoint drawRect:]):
1506         (-[WKSafeBrowsingExclamationPoint intrinsicContentSize]):
1507         (reportAnErrorURL):
1508         (malwareDetailsURL):
1509         (titleText):
1510         (warningText):
1511         (detailsText):
1512         (-[WKSafeBrowsingWarning initWithFrame:safeBrowsingResult:completionHandler:]):
1513         (-[WKSafeBrowsingWarning dealloc]):
1514         (-[WKSafeBrowsingWarning goBackClicked]):
1515         (-[WKSafeBrowsingWarning clickedOnLink:]):
1516         (-[WKSafeBrowsingWarning showDetailsClicked]):
1517         (+[WKSafeBrowsingTextView viewWithAttributedString:linkTarget:]):
1518         (+[WKSafeBrowsingTextView viewWithString:]):
1519         (-[WKSafeBrowsingTextView intrinsicContentSize]):
1520         (-[WKSafeBrowsingTextView clickedOnLink:atIndex:]):
1521         * UIProcess/Cocoa/WebViewImpl.h:
1522         * UIProcess/Cocoa/WebViewImpl.mm:
1523         (WebKit::WebViewImpl::showSafeBrowsingWarning):
1524         (WebKit::WebViewImpl::clearSafeBrowsingWarning):
1525         (WebKit::WebViewImpl::setFrameSize):
1526         * UIProcess/PageClient.h:
1527         (WebKit::PageClient::showSafeBrowsingWarning):
1528         (WebKit::PageClient::clearSafeBrowsingWarning):
1529         * UIProcess/SafeBrowsingResult.h:
1530         (WebKit::SafeBrowsingResult::url const):
1531         (WebKit::SafeBrowsingResult::provider const):
1532         (WebKit::SafeBrowsingResult::localizedProviderName const):
1533         (WebKit::SafeBrowsingResult::malwareDetailsURLBase const):
1534         (WebKit::SafeBrowsingResult::reportAnErrorURLBase const):
1535         (WebKit::SafeBrowsingResult::learnMoreURL const):
1536         (WebKit::SafeBrowsingResult::needsSafeBrowsingWarning const):
1537         (WebKit::SafeBrowsingResult::isKnownToBeUnsafe const): Deleted.
1538         * UIProcess/WebPageProxy.cpp:
1539         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1540         * UIProcess/ios/PageClientImplIOS.h:
1541         * UIProcess/ios/PageClientImplIOS.mm:
1542         (WebKit::PageClientImpl::showSafeBrowsingWarning):
1543         (WebKit::PageClientImpl::clearSafeBrowsingWarning):
1544         * UIProcess/mac/PageClientImplMac.h:
1545         * UIProcess/mac/PageClientImplMac.mm:
1546         (WebKit::PageClientImpl::setImpl):
1547         (WebKit::PageClientImpl::showSafeBrowsingWarning):
1548         (WebKit::PageClientImpl::clearSafeBrowsingWarning):
1549         * WebKit.xcodeproj/project.pbxproj:
1550
1551 2018-11-05  Zan Dobersek  <zdobersek@igalia.com>
1552
1553         [WPE] Remove BackingStore, BackingStoreCairo implementation files from build
1554         https://bugs.webkit.org/show_bug.cgi?id=191269
1555
1556         Reviewed by Michael Catanzaro.
1557
1558         * SourcesWPE.txt: Drop the BackingStore.cpp and BackingStoreCairo.cpp
1559         files from the WPE build. These are not used at all in WPE configuration
1560         as they are only used by the GTK+ port for non-AC functionality.
1561
1562 2018-11-05  Chris Dumez  <cdumez@apple.com>
1563
1564         Use same limit for page cache and suspended pages
1565         https://bugs.webkit.org/show_bug.cgi?id=191266
1566
1567         Reviewed by Geoffrey Garen.
1568
1569         Use same limit for page cache and suspended pages as they serve the same purpose.
1570
1571         * UIProcess/API/Cocoa/WKProcessPool.mm:
1572         (-[WKProcessPool _maximumSuspendedPageCount]):
1573         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1574         * UIProcess/WebProcessPool.cpp:
1575         (WebKit::WebProcessPool::updateMaxSuspendedPageCount):
1576         (WebKit::WebProcessPool::setCacheModel):
1577         (WebKit::WebProcessPool::addSuspendedPageProxy):
1578         * UIProcess/WebProcessPool.h:
1579
1580 2018-11-05  Wenson Hsieh  <wenson_hsieh@apple.com>
1581
1582         [iOS] Allow WKWebView clients to customize bar button item groups in the accessory view when editing
1583         https://bugs.webkit.org/show_bug.cgi?id=191240
1584         <rdar://problem/44872806>
1585
1586         Reviewed by Tim Horton.
1587
1588         Allow WKWebView clients to override WKContentView's default input assistant item by plumbing the call to
1589         `-inputAssistantItem` through `-[WKWebView inputAssistantItem]`, such that if a client asks WKWebView for its
1590         input assistant item and changes its leading or trailing bar button groups, the changes will be reflected by
1591         WKContentView; additionally, this allows clients to achieve the same effect by overriding `-inputAssistantItem`
1592         on WKWebView.
1593
1594         Test:   KeyboardInputTests.ModifyInputAssistantItemBarButtonGroups
1595                 KeyboardInputTests.OverrideInputAssistantItemBarButtonGroups
1596
1597         * UIProcess/API/Cocoa/WKWebView.mm:
1598         (-[WKWebView inputAssistantItem]):
1599         * UIProcess/ios/WKContentViewInteraction.h:
1600         * UIProcess/ios/WKContentViewInteraction.mm:
1601         (-[WKContentView inputAssistantItem]):
1602
1603         Route the call to `[super inputAssistantItem]` through `-[WKWebView inputAssistantItem]`, so that the input
1604         assistant item may be overridden via WKWebView.
1605
1606         (-[WKContentView inputAssistantItemForWebView]):
1607
1608 2018-11-05  Ryan Haddad  <ryanhaddad@apple.com>
1609
1610         Unreviewed, rolling out r237785.
1611
1612         Introduced layout test and API test failures on macOS and iOS.
1613
1614         Reverted changeset:
1615
1616         "[iOS] Issue initial paint soon after the visuallyNonEmpty
1617         milestone is fired."
1618         https://bugs.webkit.org/show_bug.cgi?id=191078
1619         https://trac.webkit.org/changeset/237785
1620
1621 2018-11-05  Commit Queue  <commit-queue@webkit.org>
1622
1623         Unreviewed, rolling out r237784 and r237788.
1624         https://bugs.webkit.org/show_bug.cgi?id=191270
1625
1626         Caused mediastream layout test failures (Requested by
1627         ryanhaddad on #webkit).
1628
1629         Reverted changesets:
1630
1631         "[MediaStream] User should not be prompted again after denying
1632         getDisplayMedia request"
1633         https://bugs.webkit.org/show_bug.cgi?id=191227
1634         https://trac.webkit.org/changeset/237784
1635
1636         "[MediaStream] User should not be prompted again after denying
1637         getDisplayMedia request"
1638         https://bugs.webkit.org/show_bug.cgi?id=191227
1639         https://trac.webkit.org/changeset/237788
1640
1641 2018-11-04  Fujii Hironori  <Hironori.Fujii@sony.com>
1642
1643         [MediaStream] User should not be prompted again after denying getDisplayMedia request
1644         https://bugs.webkit.org/show_bug.cgi?id=191227
1645         <rdar://problem/45784512>
1646
1647         Unreviewed build fix of ports not ENABLE(MEDIA_STREAM).
1648
1649         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: Define getRequestAction only if ENABLE(MEDIA_STREAM).
1650         * UIProcess/UserMediaPermissionRequestManagerProxy.h: Ditto.
1651
1652 2018-11-04  Zalan Bujtas  <zalan@apple.com>
1653
1654         [iOS] Issue initial paint soon after the visuallyNonEmpty milestone is fired.
1655         https://bugs.webkit.org/show_bug.cgi?id=191078
1656         <rdar://problem/45736178>
1657
1658         Reviewed by Antti Koivisto.
1659
1660         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1661         (WebKit::WebChromeClient::layerFlushThrottlingIsActive const):
1662         * WebProcess/WebCoreSupport/WebChromeClient.h:
1663         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
1664         (WebKit::AcceleratedDrawingArea::scheduleInitialDeferredPaint):
1665         * WebProcess/WebPage/AcceleratedDrawingArea.h:
1666         * WebProcess/WebPage/DrawingArea.h:
1667         (WebKit::DrawingArea::layerFlushThrottlingIsActive const):
1668         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
1669         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
1670         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
1671         (WebKit::RemoteLayerTreeDrawingArea::setLayerTreeStateIsFrozen):
1672         (WebKit::RemoteLayerTreeDrawingArea::initialDeferredPaint):
1673         (WebKit::RemoteLayerTreeDrawingArea::scheduleInitialDeferredPaint):
1674         (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush):
1675         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
1676         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1677         (WebKit::TiledCoreAnimationDrawingArea::scheduleInitialDeferredPaint):
1678
1679 2018-11-04  Eric Carlson  <eric.carlson@apple.com>
1680
1681         [MediaStream] User should not be prompted again after denying getDisplayMedia request
1682         https://bugs.webkit.org/show_bug.cgi?id=191227
1683         <rdar://problem/45784512>
1684
1685         Reviewed by Youenn Fablet.
1686
1687         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1688         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied):
1689         (WebKit::UserMediaPermissionRequestManagerProxy::wasRequestDenied):
1690         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
1691         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
1692
1693 2018-11-03  Alex Christensen  <achristensen@webkit.org>
1694
1695         Mac production builds should sign the network process xpc service with entitlements
1696         https://bugs.webkit.org/show_bug.cgi?id=191209
1697         <rdar://problem/45377609>
1698
1699         Reviewed by Geoff Garen.
1700
1701         * Configurations/Network-OSX.entitlements: Copied from Configurations/Network-OSX-sandbox.entitlements.
1702         * Configurations/NetworkService.xcconfig:
1703         Set CODE_SIGN_ENTITLEMENTS_COCOA_TOUCH_NO like we do for the web process,
1704         except with the corresponoding network process entitlements file.
1705         * UIProcess/API/Cocoa/WKProcessPool.mm:
1706         (-[WKProcessPool _networkProcessHasEntitlementForTesting:]):
1707         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1708         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1709         (WebKit::WebProcessPool::networkProcessHasEntitlementForTesting):
1710         * UIProcess/WebProcessPool.h:
1711         * WebKit.xcodeproj/project.pbxproj:
1712         Add infrastructure to test that the network process actually has an entitlement.
1713
1714 2018-11-03  Philippe Normand  <pnormand@igalia.com>
1715
1716         [WPE] Add the WebKitVersion.h header
1717         https://bugs.webkit.org/show_bug.cgi?id=191015
1718         <rdar://problem/45647211>
1719
1720         Reviewed by Michael Catanzaro.
1721
1722         * PlatformWPE.cmake: Install the generated header as well.
1723
1724 2018-11-02  Alex Christensen  <achristensen@webkit.org>
1725
1726         Unreviewed, rolling out r237761.
1727
1728         Makes most API tests timeout and WK2 tests crash
1729
1730         Reverted changeset:
1731
1732         "Mac production builds should sign the network process xpc
1733         service with entitlements"
1734         https://bugs.webkit.org/show_bug.cgi?id=191209
1735         https://trac.webkit.org/changeset/237761
1736
1737 2018-11-02  Ryan Haddad  <ryanhaddad@apple.com>
1738
1739         Unreviewed, attempt to fix the build with recent SDKs.
1740
1741         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
1742         (WebKit::XPCServiceExit):
1743
1744 2018-11-02  Alex Christensen  <achristensen@webkit.org>
1745
1746         Mac production builds should sign the network process xpc service with entitlements
1747         https://bugs.webkit.org/show_bug.cgi?id=191209
1748         <rdar://problem/45377609>
1749
1750         Reviewed by Geoff Garen.
1751
1752         * Configurations/NetworkService.xcconfig:
1753         Set CODE_SIGN_ENTITLEMENTS_COCOA_TOUCH_NO like we do for the web process,
1754         except with the corresponoding network process entitlements file.
1755         * UIProcess/API/Cocoa/WKProcessPool.mm:
1756         (-[WKProcessPool _networkProcessHasEntitlementForTesting:]):
1757         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1758         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1759         (WebKit::WebProcessPool::networkProcessHasEntitlementForTesting):
1760         * UIProcess/WebProcessPool.h:
1761         Add infrastructure to test that the network process actually has an entitlement.
1762
1763 2018-11-02  Daniel Bates  <dabates@apple.com>
1764
1765         [iOS] WebKit should dispatch DOM events when a modifier key is pressed
1766         https://bugs.webkit.org/show_bug.cgi?id=190487
1767
1768         Reviewed by Tim Horton.
1769
1770         Add support for modifier flags change events dispatched by UIKit.
1771
1772         * Shared/ios/WebIOSEventFactory.mm:
1773         (modifiersForEvent): Update for renamed enumerations.
1774         (WebIOSEventFactory::createWebKeyboardEvent): Modifier keys do not have an associated
1775         character and do not participate in key repeat.
1776         * UIProcess/Automation/ios/WebAutomationSessionIOS.mm:
1777         (WebKit::WebAutomationSession::platformSimulateKeyboardInteraction): Update for renamed enumerations.
1778         * UIProcess/ios/WKContentViewInteraction.mm:
1779         (-[WKContentView _interpretKeyEvent:isCharEvent:]): Return NO if the event represents a
1780         modifier flags change to allow the default handling.
1781         * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
1782         (-[WKKeyboardScrollingAnimator keyboardScrollForEvent:]): Update for renamed enumerations.
1783
1784 2018-11-02  Chris Dumez  <cdumez@apple.com>
1785
1786         [PSON] Reuse SuspendedPages' process when possible, for performance
1787         https://bugs.webkit.org/show_bug.cgi?id=191166
1788
1789         Reviewed by Geoffrey Garen.
1790
1791         When process-swapping check if there is an existing SuspendedPage for the domain we're going to.
1792         If there is, use this SuspendedPage's process for the navigation instead of a fresh new process.
1793         This change should be beneficial for performance as it:
1794         - Avoids spinning up a new process (CPU & memory cost)
1795         - Likely better leverages caches since this process already loaded this domain in the past
1796
1797         Due to current limitations, using a SuspendedPage's proxy may consume the SuspendedPage, which
1798         means that it can no longer be used for PageCache on history navigations. We need to do this when
1799         the SuspendedPageProxy in question was created for the current WebPageProxy because:
1800         - This SuspendedPageProxy's process already has a suspended WebPage with this WebPageProxy's pageID
1801         and
1802         - We do not currently support having more than one WebPage with a given pageID within a single
1803           WebProcess.
1804
1805         * UIProcess/SuspendedPageProxy.cpp:
1806         (WebKit::SuspendedPageProxy::SuspendedPageProxy):
1807         * UIProcess/SuspendedPageProxy.h:
1808         * UIProcess/WebProcessPool.cpp:
1809         (WebKit::WebProcessPool::processForNavigationInternal):
1810
1811 2018-11-01  Fujii Hironori  <Hironori.Fujii@sony.com>
1812
1813         Rename <wtf/unicode/UTF8.h> to <wtf/unicode/UTF8Conversion.h> in order to avoid conflicting with ICU's unicode/utf8.h
1814         https://bugs.webkit.org/show_bug.cgi?id=189693
1815
1816         Reviewed by Yusuke Suzuki.
1817
1818         * Shared/API/APIString.h: Replaced <wtf/unicode/UTF8.h> with <wtf/unicode/UTF8Conversion.h>.
1819
1820 2018-11-01  Daniel Bates  <dabates@apple.com>
1821
1822         Cleanup: Extraneous platform guarding of -_setUpSQLiteDatabaseTrackerClient
1823         https://bugs.webkit.org/show_bug.cgi?id=191124
1824
1825         Reviewed by Tim Horton.
1826
1827         Remove the platform guard around the call to -_setUpSQLiteDatabaseTrackerClient as the
1828         implementation of that message is already guarded.
1829
1830         * UIProcess/API/Cocoa/WKWebView.mm:
1831         (-[WKWebView _initializeWithConfiguration:]):
1832
1833 2018-11-01  Ryan Haddad  <ryanhaddad@apple.com>
1834
1835         Unreviewed, attempt to fix the build with recent SDKs.
1836
1837         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
1838         (WebKit::XPCServiceInitializer):
1839
1840 2018-11-01  Sihui Liu  <sihui_liu@apple.com>
1841
1842         Add a storage limit for IndexedDB
1843         https://bugs.webkit.org/show_bug.cgi?id=190598
1844         <rdar://problem/44654715>
1845
1846         Reviewed by Chris Dumez.
1847
1848         Add SPI for testing.
1849
1850         * NetworkProcess/NetworkProcess.cpp:
1851         (WebKit::NetworkProcess::NetworkProcess):
1852         (WebKit::NetworkProcess::idbServer):
1853         (WebKit::NetworkProcess::setIDBPerOriginQuota):
1854         * NetworkProcess/NetworkProcess.h:
1855         * NetworkProcess/NetworkProcess.messages.in:
1856         * UIProcess/API/C/WKContext.cpp:
1857         (WKContextSetIDBPerOriginQuota):
1858         * UIProcess/API/C/WKContextPrivate.h:
1859         * UIProcess/WebProcessPool.cpp:
1860         (WebKit::WebProcessPool::setIDBPerOriginQuota):
1861         * UIProcess/WebProcessPool.h:
1862
1863 2018-11-01  Chris Dumez  <cdumez@apple.com>
1864
1865         [PSON] WebPageProxy::receivedNavigationPolicyDecision() should not schedule the new load asynchronously when process-swapping
1866         https://bugs.webkit.org/show_bug.cgi?id=191076
1867
1868         Reviewed by Geoffrey Garen.
1869
1870         WebPageProxy::receivedNavigationPolicyDecision() should not schedule the new load asynchronously when process-swapping.
1871         The client can request a new load synchronously after answering the policy decision, in which case we'd end up loading
1872         the wrong URL.
1873
1874         * UIProcess/WebPageProxy.cpp:
1875         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
1876         * UIProcess/WebProcessPool.cpp:
1877         (WebKit::WebProcessPool::processForNavigation):
1878         (WebKit::WebProcessPool::processForNavigationInternal):
1879         * UIProcess/WebProcessPool.h:
1880
1881 2018-11-01  Chris Dumez  <cdumez@apple.com>
1882
1883         [PSON] Unable to submit a file in FormData cross-site
1884         https://bugs.webkit.org/show_bug.cgi?id=191138
1885
1886         Reviewed by Alex Christensen.
1887
1888         When PSON is enabled, we are unable to submit a file in FormData cross-site. Although we encode the
1889         request body over IPC since r237639, we're missing the right sandbox extensions for its to work for
1890         files.
1891
1892         Update FormDataReference encoder to pass along the necessary sandbox extensions for files in the
1893         FormData, and have its decoder consume those extensions so that the recipient has access to those
1894         files. Also update LoadParameters's IPC encoder / decoder to encoder an IPC::FormDataReference
1895         (which encodes both FormData and sandbox extensions) instead of a FormData.
1896
1897         * Platform/IPC/FormDataReference.h:
1898         (IPC::FormDataReference::encode const):
1899         (IPC::FormDataReference::decode):
1900         * Shared/LoadParameters.cpp:
1901         (WebKit::LoadParameters::encode const):
1902         (WebKit::LoadParameters::decode):
1903
1904 2018-11-01  Claudio Saavedra  <csaavedra@igalia.com>
1905
1906         ERROR: ResourceLoadStatisticsPersistentStorage: Unable to delete statistics file
1907         https://bugs.webkit.org/show_bug.cgi?id=191152
1908
1909         Reviewed by Chris Dumez.
1910
1911         The statistics file is not created unconditionally, so
1912         make sure it exists before logging an error.
1913
1914         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
1915         (WebKit::ResourceLoadStatisticsPersistentStorage::clear):
1916         Check that the file exists before logging an error.
1917
1918 2018-11-01  Claudio Saavedra  <csaavedra@igalia.com>
1919
1920         [GLIB] Silent a build warning when not using Wayland
1921
1922         Unreviewed.
1923
1924         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
1925
1926 2018-11-01  Frederic Wang  <fwang@igalia.com>
1927
1928         [WebAuthN] Make AuthenticatorManager
1929         https://bugs.webkit.org/show_bug.cgi?id=189279
1930
1931         Unreviewed build fix.
1932
1933         * UIProcess/WebAuthentication/Cocoa/LocalConnection.h: Add missing headers.
1934
1935 2018-10-31  Wenson Hsieh  <wenson_hsieh@apple.com>
1936
1937         API test WKAttachmentTests.CopyAndPasteBetweenWebViews fails on macOS 10.13
1938         https://bugs.webkit.org/show_bug.cgi?id=191114
1939         <rdar://problem/45700410>
1940
1941         Reviewed by Dean Jackson.
1942
1943         Followup to r237648: also make sure that we insecurely unarchive NSFileWrapper on platforms that don't support
1944         secure archiving of file wrappers.
1945
1946         * UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
1947         (API::Attachment::updateFromSerializedRepresentation):
1948
1949 2018-10-31  Dean Jackson  <dino@apple.com>
1950
1951         Forward original fragment identifier into System Preview
1952         https://bugs.webkit.org/show_bug.cgi?id=191141
1953         <rdar://problem/45717542>
1954
1955         Reviewed by Wenson Hsieh.
1956
1957         If the URL used by the page includes a fragment identifier, use
1958         it when telling QuickLook to open a local file.
1959
1960         * UIProcess/Cocoa/DownloadClient.mm:
1961         (WebKit::DownloadClient::didFinish): Append original fragment identifier
1962         to the destination URL.
1963
1964 2018-10-31  Zalan Bujtas  <zalan@apple.com>
1965
1966         [iOS] Do not paint tap highlight unless it is above a certain threshold
1967         https://bugs.webkit.org/show_bug.cgi?id=191134
1968         <rdar://problem/43615142>
1969
1970         Flashing a large portion of the screen on every tap looks unpleasant.
1971         This patch impoves the existing heuristic by adding area check and a % threshold.  
1972
1973         Reviewed by Tim Horton.
1974
1975         * UIProcess/ios/WKContentViewInteraction.mm:
1976         (-[WKContentView _showTapHighlight]):
1977         (highlightedQuadsAreSmallerThanRect): Deleted.
1978
1979 2018-10-31  Wenson Hsieh  <wenson_hsieh@apple.com>
1980
1981         API test WKAttachmentTests.CopyAndPasteBetweenWebViews fails on macOS 10.13
1982         https://bugs.webkit.org/show_bug.cgi?id=191114
1983         <rdar://problem/45700410>
1984
1985         Reviewed by Dean Jackson.
1986
1987         On macOS 10.12, we don't attempt secure archival at all because SECURE_ARCHIVER_API is turned off, and on macOS
1988         10.14, NSFileWrapper supports secure coding. However, on macOS 10.13, SECURE_ARCHIVER_API is on despite
1989         NSFileWrapper not being securely codable, so we're unable to serialize attachment data.
1990
1991         To fix this, we only use the secure archiver on ≥ macOS 10.14 and ≥ iOS 12.
1992
1993         * UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
1994         (API::Attachment::createSerializedRepresentation const):
1995
1996 2018-10-31  Zach Li  <zacharyli323@gmail.com>
1997
1998         Add credit card autofill button
1999         https://bugs.webkit.org/show_bug.cgi?id=191051
2000         <rdar://problem/45657011>
2001
2002         Reviewed by Wenson Hsieh.
2003
2004         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
2005         (toAutoFillButtonType):
2006         (toWKAutoFillButtonType):
2007         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandlePrivate.h:
2008         Introduce a new button type for credit card autofill.
2009         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
2010         (toAutoFillButtonType):
2011         (toWKAutoFillButtonType):
2012         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h:
2013
2014 2018-10-31  Chris Dumez  <cdumez@apple.com>
2015
2016         [PSON] When process-swapping for a POST request the HTTP body gets dropped
2017         https://bugs.webkit.org/show_bug.cgi?id=191046
2018         <rdar://problem/45229732>
2019
2020         Reviewed by Alex Christensen.
2021
2022         For performance reasons, the ResourceRequest IPC encoder does not encode the request's HTTP body (aka form data).
2023         When we decide to process-swap for a POST request in WebPageProxy::decidePolicyForNavigationAction(), the request
2024         we pass the new WebProcess thus no longer has a HTTP body and the load will likely fail in the new process.
2025
2026         To address the issue, we now pass the request body along with the request when sending the DecidePolicyForNavigationActionAsync
2027         / DecidePolicyForNavigationActionSync IPC from the WebProcess to the UIProcess. No action is needed for the
2028         LoadRequest IPC to the new WebProcess since the LoadParameters' IPC encoder takes care of encoding the request's
2029         body already.
2030
2031         * UIProcess/WebPageProxy.cpp:
2032         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
2033         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
2034         * UIProcess/WebPageProxy.h:
2035         * UIProcess/WebPageProxy.messages.in:
2036         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2037         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2038
2039 2018-10-31  Antti Koivisto  <antti@apple.com>
2040
2041         Stop using LayerFlushScheduler in WK2
2042         https://bugs.webkit.org/show_bug.cgi?id=191065
2043
2044         Reviewed by Tim Horton.
2045
2046         Code gets more understandable when TiledCoreAnimationDrawingArea simply uses RunLoopObserver
2047         directly for flush scheduling. LayerFlushScheduler can be later moved to WK1.
2048
2049         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
2050         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2051         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
2052         (WebKit::TiledCoreAnimationDrawingArea::~TiledCoreAnimationDrawingArea):
2053         (WebKit::TiledCoreAnimationDrawingArea::setLayerTreeStateIsFrozen):
2054         (WebKit::TiledCoreAnimationDrawingArea::scheduleCompositingLayerFlush):
2055         (WebKit::TiledCoreAnimationDrawingArea::dispatchAfterEnsuringUpdatedScrollPosition):
2056         (WebKit::TiledCoreAnimationDrawingArea::layerFlushRunLoopCallback):
2057         (WebKit::TiledCoreAnimationDrawingArea::invalidateLayerFlushRunLoopObserver):
2058         (WebKit::TiledCoreAnimationDrawingArea::scheduleLayerFlushRunLoopObserver):
2059
2060 2018-10-31  Claudio Saavedra  <csaavedra@igalia.com>
2061
2062         [WPE][GTK] Certificates loaded from the cache don't include the certificate chain
2063         https://bugs.webkit.org/show_bug.cgi?id=190956
2064
2065         Reviewed by Youenn Fablet.
2066
2067         Similarly to what was done for the IPC coders, serialize
2068         the entire certificate chain in the cache coder. Bump
2069         the cache version due to the caching format changes.
2070
2071         * NetworkProcess/cache/NetworkCacheCoders.h: Add GRefPtr<GByteArray> coders.
2072         * NetworkProcess/cache/NetworkCacheCodersSoup.cpp:
2073         (WTF::Persistence::certificatesDataListFromCertificateInfo):
2074         (WTF::Persistence::certificateFromCertificatesDataList): Helpers.
2075         (WTF::Persistence::Coder<WebCore::CertificateInfo>::encode):
2076         (WTF::Persistence::Coder<WebCore::CertificateInfo>::decode):
2077         (WTF::Persistence::Coder<GRefPtr<GByteArray>>::encode):
2078         (WTF::Persistence::Coder<GRefPtr<GByteArray>>::decode):
2079         * NetworkProcess/cache/NetworkCacheStorage.h: Bump the cache version.
2080
2081 2018-10-30  Wenson Hsieh  <wenson_hsieh@apple.com>
2082
2083         [Cocoa] Attachment dropped from one web view to another is missing its file wrapper
2084         https://bugs.webkit.org/show_bug.cgi?id=190530
2085         <rdar://problem/45232149>
2086
2087         Reviewed by Tim Horton.
2088
2089         See WebCore ChangeLog for more details.
2090
2091         * Shared/WebCoreArgumentCoders.cpp:
2092         (IPC::ArgumentCoder<SerializedAttachmentData>::encode):
2093         (IPC::ArgumentCoder<SerializedAttachmentData>::decode):
2094         * Shared/WebCoreArgumentCoders.h:
2095
2096         Add IPC encoding/decoding support for SerializedAttachmentData.
2097
2098         * UIProcess/API/APIAttachment.cpp:
2099         (API::Attachment::createSerializedRepresentation const):
2100         (API::Attachment::updateFromSerializedRepresentation):
2101         * UIProcess/API/APIAttachment.h:
2102         * UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
2103         (API::Attachment::createSerializedRepresentation const):
2104
2105         Add a method to serialize and return attachment info as a blob of data.
2106
2107         (API::Attachment::updateFromSerializedRepresentation):
2108
2109         Add a method to update the attachment, given a serialized blob of data. On Cocoa platforms, this fails
2110         gracefully if the serialized data cannot be decoded.
2111
2112         * UIProcess/Cocoa/PageClientImplCocoa.h:
2113         * UIProcess/Cocoa/PageClientImplCocoa.mm:
2114         (WebKit::PageClientImplCocoa::allocFileWrapperInstance const):
2115         (WebKit::PageClientImplCocoa::serializableFileWrapperClasses const):
2116         (WebKit::PageClientImplCocoa::allocFileWrapperInstance): Deleted.
2117
2118         Add an additional hook to return the list of NSFileWrapper subclasses suitable for deserialization. This
2119         array contains (at minimum) NSFileWrapper, but may additionally include a custom NSFileWrapper subclass, if
2120         configured.
2121
2122         * UIProcess/PageClient.h:
2123         (WebKit::PageClient::allocFileWrapperInstance const):
2124         (WebKit::PageClient::serializableFileWrapperClasses const):
2125         (WebKit::PageClient::allocFileWrapperInstance): Deleted.
2126         * UIProcess/WebPageProxy.cpp:
2127         (WebKit::WebPageProxy::registerAttachmentsFromSerializedData):
2128
2129         Registers the given serialized attachment data, creating new _WKAttachment instances if necessary. Currently,
2130         this does not update the file wrappers of existing _WKAttachments; we should revisit this in the future to see
2131         if we can additionally update file wrappers for existing attachments, without breaking the case where the user
2132         copies and pastes or drags and drops attachments within a single web view and the client expects _WKAttachment
2133         instances to be reused.
2134
2135         (WebKit::WebPageProxy::serializedAttachmentDataForIdentifiers):
2136         * UIProcess/WebPageProxy.h:
2137         * UIProcess/WebPageProxy.messages.in:
2138         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2139         (WebKit::WebEditorClient::registerAttachments):
2140         (WebKit::WebEditorClient::serializedAttachmentDataForIdentifiers):
2141
2142         Implement a new IPC hook to fetch an array of serialized attachment data blobs, given a list of attachment
2143         identifiers.
2144
2145         * WebProcess/WebCoreSupport/WebEditorClient.h:
2146
2147 2018-10-30  Chris Dumez  <cdumez@apple.com>
2148
2149         [PSON] View gesture snapshot gets taken down early when process-swapping
2150         https://bugs.webkit.org/show_bug.cgi?id=191083
2151         <rdar://problem/45058738>
2152
2153         Reviewed by Alex Christensen.
2154
2155         When process-swapping, we would call WebViewImpl::processDidExit(), which would destroy
2156         the ViewGestureController and thus take down the swipe navigation snapshot before it
2157         should. We now call WebViewImpl::processDidSwap() instead, which does the same thing,
2158         except for destroying the ViewGestureController. As a result, the view snapshot stays
2159         visible as long as it is needed, even in case of process swap.
2160
2161         * UIProcess/Cocoa/WebViewImpl.h:
2162         * UIProcess/Cocoa/WebViewImpl.mm:
2163         (WebKit::WebViewImpl::handleProcessSwapOrExit):
2164         (WebKit::WebViewImpl::processWillSwap):
2165         (WebKit::WebViewImpl::processDidExit):
2166         * UIProcess/mac/PageClientImplMac.mm:
2167         (WebKit::PageClientImpl::processWillSwap):
2168
2169 2018-10-30  Chris Dumez  <cdumez@apple.com>
2170
2171         [PSON] WebView renders with incorrect dimensions after back or forward
2172         https://bugs.webkit.org/show_bug.cgi?id=191071
2173         <rdar://problem/45058950>
2174
2175         Reviewed by Alex Christensen.
2176
2177         Make sure WebPage::reinitializeWebPage() updates the page's dimensions if needed using the
2178         WebPageCreationParameters it is provided.
2179
2180         * WebProcess/WebPage/WebPage.cpp:
2181         (WebKit::WebPage::reinitializeWebPage):
2182
2183 2018-10-30  Dewei Zhu  <dewei_zhu@apple.com>
2184
2185         Move 'ProcessSwapOnCrossSiteNavigationEnabled' to 'experimental' category.
2186         https://bugs.webkit.org/show_bug.cgi?id=191049
2187
2188         Reviewed by Dean Jackson.
2189
2190         Move the feature flag to experimental feature section.
2191
2192         * Shared/WebPreferences.yaml:
2193
2194 2018-10-30  Alexey Proskuryakov  <ap@apple.com>
2195
2196         Enable InstallAPI for iOS unconditionally
2197         https://bugs.webkit.org/show_bug.cgi?id=191043
2198         rdar://problem/32728423
2199
2200         Reviewed by Dan Bernstein.
2201
2202         * Configurations/Base.xcconfig: Enabled it. Added NSURLDownloadSPI.h as an
2203         excluded header - WebKit doesn't export NSURLDownload, so the definition
2204         shouldn't be processed by InstallAPI.
2205
2206 2018-10-30  Alexey Proskuryakov  <ap@apple.com>
2207
2208         Clean up some obsolete MAX_ALLOWED macros
2209         https://bugs.webkit.org/show_bug.cgi?id=190916
2210
2211         Reviewed by Tim Horton.
2212
2213         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2214         (WebKit::NetworkDataTaskCocoa::applySniffingPoliciesAndBindRequestToInferfaceIfNeeded):
2215         * Platform/spi/Cocoa/DeviceIdentitySPI.h:
2216         * Platform/spi/ios/UIKitSPI.h:
2217         * Shared/WebPreferencesDefaultValues.cpp:
2218         (defaultCustomPasteboardDataEnabled):
2219         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2220         (WebKit::toPKPaymentRequest):
2221         * UIProcess/ios/WKContentViewInteraction.mm:
2222         (-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:]): Deleted.
2223
2224 2018-10-30  Commit Queue  <commit-queue@webkit.org>
2225
2226         Unreviewed, rolling out r237600 and r237604.
2227         https://bugs.webkit.org/show_bug.cgi?id=191086
2228
2229         Breaks internal iOS builds (Requested by ryanhadd_ on
2230         #webkit).
2231
2232         Reverted changesets:
2233
2234         "Enable InstallAPI for iOS unconditionally"
2235         https://bugs.webkit.org/show_bug.cgi?id=191043
2236         https://trac.webkit.org/changeset/237600
2237
2238         "Build fix attempt after enabling InstallAPI for iOS."
2239         https://bugs.webkit.org/show_bug.cgi?id=191043
2240         https://trac.webkit.org/changeset/237604
2241
2242 2018-10-30  Alexey Proskuryakov  <ap@apple.com>
2243
2244         Build fix attempt after enabling InstallAPI for iOS.
2245         https://bugs.webkit.org/show_bug.cgi?id=191043
2246         rdar://problem/32728423
2247
2248         * Configurations/WebKit.xcconfig: Skip NSURLDownloadSPI.h here too.
2249
2250 2018-10-30  Alexey Proskuryakov  <ap@apple.com>
2251
2252         Enable InstallAPI for iOS unconditionally
2253         https://bugs.webkit.org/show_bug.cgi?id=191043
2254         rdar://problem/32728423
2255
2256         Reviewed by Dan Bernstein.
2257
2258         * Configurations/Base.xcconfig: Enabled it.
2259
2260 2018-10-30  Zan Dobersek  <zdobersek@igalia.com>
2261
2262         [CoordGraphics] CoordinatedLayerTreeHost::flushLayersAndForceRepaint() should schedule the flush
2263         https://bugs.webkit.org/show_bug.cgi?id=191066
2264
2265         Reviewed by Michael Catanzaro.
2266
2267         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
2268         (WebKit::CoordinatedLayerTreeHost::flushLayersAndForceRepaint):
2269         Only schedule the layer flush in this call, don't perform it on the
2270         spot. This avoids re-entry of the layer flushing process in cases when
2271         the associated display refresh monitor is requested a callback during
2272         the layout phase that's executed under the initial layer flush.
2273
2274 2018-10-29  Dewei Zhu  <dewei_zhu@apple.com>
2275
2276         Move 'ProcessSwapOnCrossSiteNavigationEnabled' to 'experimental' category.
2277         https://bugs.webkit.org/show_bug.cgi?id=191049
2278
2279         Reviewed by Chris Dumez.
2280
2281         Move 'ProcessSwapOnCrossSiteNavigationEnabled' from 'internal' to 'experimental' category.
2282
2283         * Shared/WebPreferences.yaml:
2284
2285 2018-10-29  Youenn Fablet  <youenn@apple.com>
2286
2287         Handle MDNS resolution of candidates through libwebrtc directly
2288         https://bugs.webkit.org/show_bug.cgi?id=190681
2289
2290         Reviewed by Eric Carlson.
2291
2292         Add support for AsyncResolver to resolve MDNS.
2293         This basically reuse the code path used to resolve STUN server addresses.
2294         Removed MDNS specific resolution.
2295         Use existing CFHost resolution mechanism to do the actual resolution.
2296
2297         Make sure that a resolver is kept alive while iterating through its clients when signaling done.
2298         Some of its clients may indeed call Destroy() on the resolver during that iteration.
2299
2300         * NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
2301         (WebKit::NetworkMDNSRegister::registerMDNSName):
2302         * NetworkProcess/webrtc/NetworkMDNSRegister.messages.in:
2303         * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
2304         (WebKit::LibWebRTCResolver::Destroy):
2305         (WebKit::LibWebRTCResolver::doDestroy):
2306         (WebKit::LibWebRTCResolver::setResolvedAddress):
2307         (WebKit::LibWebRTCResolver::setError):
2308         (WebKit::LibWebRTCProvider::createPeerConnection):
2309         * WebProcess/Network/webrtc/LibWebRTCProvider.h:
2310         * WebProcess/Network/webrtc/LibWebRTCSocketFactory.h:
2311         * WebProcess/Network/webrtc/WebMDNSRegister.cpp:
2312         * WebProcess/Network/webrtc/WebMDNSRegister.h:
2313         * WebProcess/Network/webrtc/WebMDNSRegister.messages.in:
2314
2315 2018-10-29  Tim Horton  <timothy_horton@apple.com>
2316
2317         Modernize WebKit nibs and lprojs for localization's sake
2318         https://bugs.webkit.org/show_bug.cgi?id=190911
2319         <rdar://problem/45349466>
2320
2321         Reviewed by Dan Bernstein.
2322
2323         * Resources/WebContentProcess.xib:
2324         * WebKit.xcodeproj/project.pbxproj:
2325         * en.lproj/InfoPlist.strings: Renamed from Source/WebKit/English.lproj/InfoPlist.strings.
2326         English->en
2327
2328 2018-10-29  Tim Horton  <timothy_horton@apple.com>
2329
2330         Make FindOptionsShowOverlay work on iOS
2331         https://bugs.webkit.org/show_bug.cgi?id=190551
2332
2333         Reviewed by Andy Estes.
2334
2335         * WebProcess/WebPage/FindController.cpp:
2336         (WebKit::FindController::updateFindUIAfterPageScroll):
2337         Update the find indicator after installing the page overlay for the find holes.
2338         This ensures that if the find indicator mechanism also uses page overlays,
2339         as it does on iOS, that they are installed in the correct order (because
2340         order of installation directly affects z-order).
2341
2342         (WebKit::FindController::findIndicatorRadius const):
2343         (WebKit::FindController::shouldHideFindIndicatorOnScroll const):
2344         Add two getters for design differences between find-in-page on iOS vs. other platforms.
2345
2346         (WebKit::FindController::rectsForTextMatchesInRect):
2347         Return FloatRects instead of IntRects for ease of use in the caller.
2348         Don't clip rects for matches that intersect the current tile. We still
2349         drop ones that don't intersect at all, but if they do intersect, we
2350         provide the full rect (which may overlap a different tile), so that
2351         e.g. border drawing will work correctly.
2352
2353         (WebKit::FindController::drawRect):
2354         Adopt shrink-wrapping for find holes. This has minimal impact on macOS,
2355         where the holes don't have rounded corners, but on iOS this makes
2356         overlapping or adjacent holes look great. We already do this for the indicator,
2357         so it only makes sense to do the same for the holes.
2358
2359         In order to support shrink-wrapping here, switch to using a Clear operator
2360         with a path-fill instead of clearRect to clear out the holes.
2361
2362         Avoid hiding the find indicator on scroll if the platform says not to.
2363
2364         * WebProcess/WebPage/FindController.h:
2365         * WebProcess/WebPage/ios/FindControllerIOS.mm:
2366         (WebKit::FindController::findIndicatorRadius const):
2367         (WebKit::FindController::shouldHideFindIndicatorOnScroll const):
2368         Slightly adjust the find indicator's parameters to be compatible with having holes.
2369         Reduce the horizontal margin by half a point so that it fits precisely in the hole.
2370         Drop the "TightlyFitContent" text indicator parameter, because we want 
2371         rects that match the holes, and they do not tightly fit the content's height.
2372         This matches macOS's behavior.
2373
2374 2018-10-29  Jer Noble  <jer.noble@apple.com>
2375
2376         CRASH in CoreGraphics: ERROR_CGDataProvider_BufferIsNotBigEnough
2377         https://bugs.webkit.org/show_bug.cgi?id=190954
2378
2379         Reviewed by Simon Fraser.
2380
2381         * Shared/cg/ShareableBitmapCG.cpp:
2382         (WebKit::ShareableBitmap::makeCGImage):
2383
2384 2018-10-29  Youenn Fablet  <youenn@apple.com>
2385
2386         Guard H264 simulcast with a runtime flag
2387         https://bugs.webkit.org/show_bug.cgi?id=191025
2388
2389         Reviewed by Eric Carlson.
2390
2391         * Shared/WebPreferences.yaml:
2392
2393 2018-10-29  Chris Dumez  <cdumez@apple.com>
2394
2395         [PSON] When Safari restores session state after launching, going back and forward does not swap processes
2396         https://bugs.webkit.org/show_bug.cgi?id=190975
2397         <rdar://problem/45059256>
2398
2399         Reviewed by Antti Koivisto.
2400
2401         When deciding to process-swap or not on a history navigation, we normally check the BackForwardListItems'
2402         process identifiers do check if they come from different WebProcesses or not. However, the check was invalid
2403         in the case where the BackForwardListItems were restored by the client. After a session restore, the
2404         items' process identifier is the UIProcess one. Therefore, we need to disable the BackForwardListItems'
2405         process identifiers check if if the process identifier is the one of the UIProcess.
2406
2407         * UIProcess/WebProcessPool.cpp:
2408         (WebKit::WebProcessPool::processForNavigationInternal):
2409
2410 2018-10-29  Youenn Fablet  <youenn@apple.com>
2411
2412         [WebRTC] Enable VP8 by default
2413         https://bugs.webkit.org/show_bug.cgi?id=190672
2414
2415         Reviewed by Eric Carlson.
2416
2417         * Shared/WebPreferences.yaml:
2418
2419 2018-10-28  Zan Dobersek  <zdobersek@igalia.com>
2420
2421         [WPE] Add the WebKitVersion.h header
2422         https://bugs.webkit.org/show_bug.cgi?id=191015
2423
2424         Reviewed by Michael Catanzaro.
2425
2426         Add the WebKitVersion.h API header for the WPE port. As with other
2427         headers providing the GLib API, we have to provide a WPE-specific
2428         version, but the implementation file can be shared with the GTK port,
2429         and is moved under the UIProcess/API/glib/ directory accordingly.
2430
2431         * PlatformWPE.cmake:
2432         * SourcesWPE.txt:
2433         * UIProcess/API/glib/WebKitVersion.cpp: Renamed from Source/WebKit/UIProcess/API/gtk/WebKitVersion.cpp.
2434         * UIProcess/API/wpe/WebKitVersion.h.in: Added.
2435         * UIProcess/API/wpe/webkit.h:
2436
2437 2018-10-26  Megan Gardner  <megan_gardner@apple.com>
2438
2439         Remove Unused WebSelectionAssistant
2440         https://bugs.webkit.org/show_bug.cgi?id=190939
2441
2442         Reviewed by Tim Horton.
2443
2444         We made webSelectionAssistant alwasys nil last year when we moved to using
2445         the textSelectionAssistant for all text selection on the web. This patch merely 
2446         goes through and cleans out all the references to this object that is always nil.
2447         No functionality should change.
2448
2449         * UIProcess/ios/WKContentView.mm:
2450         (-[WKContentView _didExitStableState]):
2451         * UIProcess/ios/WKContentViewInteraction.h:
2452         * UIProcess/ios/WKContentViewInteraction.mm:
2453         (-[WKContentView cleanupInteraction]):
2454         (-[WKContentView resignFirstResponderForWebView]):
2455         (-[WKContentView _scrollingNodeScrollingWillBegin]):
2456         (-[WKContentView _scrollingNodeScrollingDidEnd]):
2457         (-[WKContentView gestureRecognizer:canBePreventedByGestureRecognizer:]):
2458         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
2459         (-[WKContentView _uiTextSelectionRects]):
2460         (-[WKContentView _singleTapCommited:]):
2461         (-[WKContentView _willStartScrollingOrZooming]):
2462         (-[WKContentView _didEndScrollingOrZooming]):
2463         (-[WKContentView _lookupForWebView:]):
2464         (-[WKContentView _shareForWebView:]):
2465         (-[WKContentView _addShortcutForWebView:]):
2466         (-[WKContentView _showDictionary:]):
2467         (selectionChangedWithGesture):
2468         (selectionChangedWithTouch):
2469         (-[WKContentView selectionInteractionAssistant]):
2470         (-[WKContentView _stopAssistingNode]):
2471         (-[WKContentView _updateChangedSelection:]):
2472         (-[WKContentView actionSheetAssistant:shareElementWithURL:rect:]):
2473         (-[WKContentView _restoreCalloutBarIfNeeded]):
2474         (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
2475         (-[WKContentView webSelectionAssistant]): Deleted.
2476
2477 2018-10-26  Commit Queue  <commit-queue@webkit.org>
2478
2479         Unreviewed, rolling out r237458.
2480         https://bugs.webkit.org/show_bug.cgi?id=190973
2481
2482         broke internal iOS builds (Requested by zalan on #webkit).
2483
2484         Reverted changeset:
2485
2486         "Adopt -setOverrideRouteSharingPolicy:routingContextUID: SPI"
2487         https://bugs.webkit.org/show_bug.cgi?id=190951
2488         https://trac.webkit.org/changeset/237458
2489
2490 2018-10-26  Chris Dumez  <cdumez@apple.com>
2491
2492         [PSON] Only delay attaching drawingArea in case of process swap and drop DidCompletePageTransition IPC handshake
2493         https://bugs.webkit.org/show_bug.cgi?id=190971
2494
2495         Reviewed by Geoffrey Garen.
2496
2497         Only delay attaching drawingArea in case of process swap and drop DidCompletePageTransition IPC handshake.
2498
2499         Since r236257, the WebProcess would always delay attaching the drawing area when a new WebPage is created. The
2500         WebProcess would send a DidCompletePageTransition IPC to the UIProcess when the page transition is complete and
2501         the UIProcess would then send an IPC back to attach the drawing area.
2502
2503         In the new design, WebPageCreationParameters contains a flag indicating if the WebPage should delay attaching
2504         the drawing area or not. We only delay attaching in case of process swap and we've successfuly suspended the
2505         previous page. Then when WebPage::didCompletePageTransition(), we stop sending the DidCompletePageTransition
2506         IPC to the UIProcess and instead have the WebProcess attach the drawing area right away if we've delayed
2507         attaching until then.
2508
2509         * Shared/WebPageCreationParameters.cpp:
2510         (WebKit::WebPageCreationParameters::encode const):
2511         (WebKit::WebPageCreationParameters::decode):
2512         * Shared/WebPageCreationParameters.h:
2513         * UIProcess/DrawingAreaProxy.h:
2514         * UIProcess/WebPageProxy.cpp:
2515         (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
2516         (WebKit::WebPageProxy::swapToWebProcess):
2517         (WebKit::WebPageProxy::finishAttachingToWebProcess):
2518         (WebKit::WebPageProxy::initializeWebPage):
2519         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
2520         * UIProcess/WebPageProxy.h:
2521         * UIProcess/WebPageProxy.messages.in:
2522         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
2523         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
2524         * WebProcess/WebPage/DrawingArea.messages.in:
2525         * WebProcess/WebPage/WebPage.cpp:
2526         (WebKit::m_shouldAttachDrawingAreaOnPageTransition):
2527         (WebKit::WebPage::reinitializeWebPage):
2528         (WebKit::WebPage::didCompletePageTransition):
2529         * WebProcess/WebPage/WebPage.h:
2530         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2531         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
2532
2533 2018-10-26  Chris Dumez  <cdumez@apple.com>
2534
2535         [PSON] Avoid tearing down the drawing area when suspending a WebPage due to process-swap
2536         https://bugs.webkit.org/show_bug.cgi?id=190879
2537
2538         Reviewed by Antti Koivisto.
2539
2540         Avoid tearing down the drawing area when suspending a WebPage due to process-swap. We really only need to reset
2541         the drawing area upon resuming the WebPage. There is no strict need to destroy the drawing area on suspension
2542         and this has caused various crashes because code usually assumes we always have a drawing area.
2543
2544         This patch also drops various drawing area null checks that were added to address PSON crashes.
2545
2546         * UIProcess/SuspendedPageProxy.cpp:
2547         (WebKit::SuspendedPageProxy::tearDownDrawingAreaInWebProcess): Deleted.
2548         * UIProcess/SuspendedPageProxy.h:
2549         * UIProcess/WebPageProxy.cpp:
2550         (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
2551         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
2552         (WebKit::WebPageProxy::didCompletePageTransition):
2553         (WebKit::WebPageProxy::enterAcceleratedCompositingMode):
2554         * UIProcess/WebPageProxy.h:
2555         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2556         (WebKit::WebChromeClient::invalidateContentsAndRootView):
2557         (WebKit::WebChromeClient::invalidateContentsForSlowScroll):
2558         (WebKit::WebChromeClient::contentsSizeChanged const):
2559         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2560         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
2561         * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm:
2562         (WebKit::RemoteScrollingCoordinator::scheduleTreeStateCommit):
2563         * WebProcess/WebPage/WebPage.cpp:
2564         (WebKit::WebPage::reinitializeWebPage):
2565         (WebKit::WebPage::exitAcceleratedCompositingMode):
2566         (WebKit::WebPage::setIsSuspended):
2567         (WebKit::WebPage::tearDownDrawingAreaForSuspend): Deleted.
2568         * WebProcess/WebPage/WebPage.h:
2569         * WebProcess/WebPage/WebPage.messages.in:
2570
2571 2018-10-26  Antti Koivisto  <antti@apple.com>
2572
2573         Use random() instead of begin() to limit cache sizes
2574         https://bugs.webkit.org/show_bug.cgi?id=190957
2575
2576         Reviewed by Chris Dumez.
2577
2578         * UIProcess/WebProcessPool.cpp:
2579         (WebKit::WebProcessPool::didCollectPrewarmInformation):
2580
2581 2018-10-26  Chris Dumez  <cdumez@apple.com>
2582
2583         Modernize / Simplify IPC::Connection::sendOutgoingMessage()
2584         https://bugs.webkit.org/show_bug.cgi?id=190931
2585
2586         Reviewed by Alex Christensen.
2587
2588         * Platform/IPC/mac/ConnectionMac.mm:
2589         (IPC::Connection::sendOutgoingMessage):
2590
2591 2018-10-26  Jer Noble  <jer.noble@apple.com>
2592
2593         Adopt -setOverrideRouteSharingPolicy:routingContextUID: SPI
2594         https://bugs.webkit.org/show_bug.cgi?id=190951
2595         <rdar://problem/45213065>
2596
2597         Reviewed by Alex Christensen.
2598
2599         Add an asyncronous reply request to VideoFullscreenManager.
2600
2601         Drive-by fix: messages.py generates "WTFMove(*arg1, *arg2)" instead of "WTFMove(*arg1), WTFMove(*arg2)"
2602         in its reply handler generation.
2603
2604         * Platform/IPC/MessageSender.h:
2605         (IPC::MessageSender::sendWithAsyncReply):
2606         * Scripts/webkit/messages.py:
2607         * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
2608         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
2609         (WebKit::VideoFullscreenModelContext::requestRouteSharingPolicyAndContextUID):
2610         * WebProcess/cocoa/VideoFullscreenManager.h:
2611         * WebProcess/cocoa/VideoFullscreenManager.messages.in:
2612         * WebProcess/cocoa/VideoFullscreenManager.mm:
2613         (WebKit::VideoFullscreenManager::requestRouteSharingPolicyAndContextUID):
2614
2615 2018-10-25  Michael Catanzaro  <mcatanzaro@igalia.com>
2616
2617         Unreviewed, another try at fixing the GTK build with sandbox enabled
2618
2619         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
2620         (WebKit::memfd_create): Deleted.
2621
2622 2018-10-25  Antoine Quint  <graouts@apple.com>
2623
2624         [Web Animations] Turn Web Animations CSS Integration off by default
2625         https://bugs.webkit.org/show_bug.cgi?id=190901
2626
2627         Reviewed by Dean Jackson.
2628
2629         * Shared/WebPreferences.yaml:
2630
2631 2018-10-25  Michael Catanzaro  <mcatanzaro@igalia.com>
2632
2633         Unreviewed, try to fix GTK build with sandbox enabled
2634
2635         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
2636
2637 2018-10-25  Claudio Saavedra  <csaavedra@igalia.com>
2638
2639         [WPE][GTK] Follow-up fixes to the certificate coders
2640         https://bugs.webkit.org/show_bug.cgi?id=190900
2641
2642         Reviewed by Michael Catanzaro.
2643
2644         Cleanup the GRefPtr mess I created earlier. Also we now bail out
2645         if any certificate in the chain has no data instead of returning a
2646         cropped chain.
2647
2648         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
2649         (IPC::ArgumentCoder<CertificateInfo>::encode):
2650         (IPC::ArgumentCoder<CertificateInfo>::decode):
2651
2652 2018-10-25  Zan Dobersek  <zdobersek@igalia.com>
2653
2654         [GTK][AC] Resizing the window doesn't always update the visible rect
2655         https://bugs.webkit.org/show_bug.cgi?id=189743
2656
2657         Reviewed by Michael Catanzaro.
2658
2659         Disassociate resizing that can be done on an AcceleratedSurface object
2660         between "host resizes" and "client resizes".
2661
2662         The former is done from ThreadedCoordinatedLayerTreeHost directly, and
2663         is currently used only for GTK on X11, where a new pixmap object is
2664         created on each resize, which affects the context ID that is based on
2665         that pixmap object's address.
2666
2667         The latter is done from the composition thread. It's used for GTK on
2668         Wayland and WPE. In both cases, the underlying window object does not
2669         change on each resize, but it's necessary to perform the actual resize
2670         on the composition thread.
2671
2672         So far it hasn't been performed there, which ended up pushing sizes of
2673         the WebKit view and the underlying window object out of sync during
2674         resizing, leaving parts of window unrendered.
2675
2676         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
2677         (WebKit::ThreadedCompositor::renderLayerTree):
2678         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
2679         * WebProcess/WebPage/AcceleratedSurface.cpp:
2680         (WebKit::AcceleratedSurface::hostResize):
2681         (WebKit::AcceleratedSurface::resize): Deleted.
2682         * WebProcess/WebPage/AcceleratedSurface.h:
2683         (WebKit::AcceleratedSurface::clientResize):
2684         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
2685         (WebKit::ThreadedCoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged):
2686         (WebKit::ThreadedCoordinatedLayerTreeHost::sizeDidChange):
2687         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
2688         * WebProcess/WebPage/gtk/AcceleratedSurfaceWayland.cpp:
2689         (WebKit::AcceleratedSurfaceWayland::clientResize):
2690         (WebKit::AcceleratedSurfaceWayland::resize): Deleted.
2691         * WebProcess/WebPage/gtk/AcceleratedSurfaceWayland.h:
2692         * WebProcess/WebPage/gtk/AcceleratedSurfaceX11.cpp:
2693         (WebKit::AcceleratedSurfaceX11::hostResize):
2694         (WebKit::AcceleratedSurfaceX11::resize): Deleted.
2695         * WebProcess/WebPage/gtk/AcceleratedSurfaceX11.h:
2696         * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp:
2697         (WebKit::AcceleratedSurfaceWPE::clientResize):
2698         (WebKit::AcceleratedSurfaceWPE::resize): Deleted.
2699         * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.h:
2700
2701 2018-10-24  Alexey Proskuryakov  <ap@apple.com>
2702
2703         Clean up some obsolete macOS version guards
2704         https://bugs.webkit.org/show_bug.cgi?id=190887
2705
2706         Reviewed by Dan Bernstein.
2707
2708         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
2709         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2710         (WebKit::WebProcessPool::platformInitializeWebProcess):
2711
2712 2018-10-24  Megan Gardner  <megan_gardner@apple.com>
2713
2714         Turn on Conic Gradients
2715         https://bugs.webkit.org/show_bug.cgi?id=190810
2716
2717         Reviewed by Tim Horton.
2718
2719         Remove conic gradients from experimental features and turn it on always.
2720
2721         * Configurations/FeatureDefines.xcconfig:
2722         * Shared/WebPreferences.yaml:
2723
2724 2018-10-24  Said Abou-Hallawa  <sabouhallawa@apple.com>
2725
2726         Cleanup: MIMETypeRegistry functions
2727         https://bugs.webkit.org/show_bug.cgi?id=190838
2728
2729         Reviewed by Simon Fraser.
2730
2731         * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
2732         (-[WKWebViewContentProviderRegistry initWithConfiguration:]):
2733
2734 2018-10-24  Chris Dumez  <cdumez@apple.com>
2735
2736         REGRESSION (r237257): [iOS] Crashes in com.apple.WebKit: WebKit::RemoteScrollingCoordinator::scheduleTreeStateCommit
2737         https://bugs.webkit.org/show_bug.cgi?id=190804
2738
2739         Reviewed by Alex Christensen.
2740
2741         Fix null-dereference of the drawing area in RemoteScrollingCoordinator::scheduleTreeStateCommit.
2742         With process-swap-on-navigation enabled, suspended pages' drawing area gets torn down.
2743
2744         * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm:
2745         (WebKit::RemoteScrollingCoordinator::scheduleTreeStateCommit):
2746
2747 2018-10-24  Claudio Saavedra  <csaavedra@igalia.com>
2748
2749         [WPE][GTK] Cleanups to the certificate decoder
2750         https://bugs.webkit.org/show_bug.cgi?id=190867
2751
2752         Reviewed by Žan Doberšek.
2753
2754         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
2755         (IPC::ArgumentCoder<CertificateInfo>::decode):
2756
2757 2018-10-24  Claudio Saavedra  <csaavedra@igalia.com>
2758
2759         [WPE][GTK] Cleanups to the certificate encoder
2760         https://bugs.webkit.org/show_bug.cgi?id=190865
2761
2762         Reviewed by Žan Doberšek.
2763
2764         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
2765         (IPC::ArgumentCoder<CertificateInfo>::encode):
2766
2767 2018-10-23  Ryan Haddad  <ryanhaddad@apple.com>
2768
2769         Unreviewed, rolling out r237261.
2770
2771         The layout test for this change crashes under GuardMalloc.
2772
2773         Reverted changeset:
2774
2775         "Handle MDNS resolution of candidates through libwebrtc
2776         directly"
2777         https://bugs.webkit.org/show_bug.cgi?id=190681
2778         https://trac.webkit.org/changeset/237261
2779
2780 2018-10-23  David Kilzer  <ddkilzer@apple.com>
2781
2782         Fix false positive leaks when using custom -init methods that don't start with -init
2783         <https://webkit.org/b/190818>
2784         <rdar://problem/45476042>
2785
2786         Reviewed by Dan Bernstein.
2787
2788         * UIProcess/Cocoa/WKWebViewContentProvider.h:
2789         (-[WKWebViewContentProvider web_initWithFrame:webView:mimeType:]):
2790         Add attribute to make this behave like an -init method.
2791
2792 2018-10-23  Chris Dumez  <cdumez@apple.com>
2793
2794         [PSON] Add support for cross-site client-side redirects
2795         https://bugs.webkit.org/show_bug.cgi?id=190806
2796         <rdar://problem/45047344>
2797
2798         Reviewed by Geoffrey Garen.
2799
2800         * Shared/LoadParameters.cpp:
2801         (WebKit::LoadParameters::encode const):
2802         (WebKit::LoadParameters::decode):
2803         * Shared/LoadParameters.h:
2804         * Shared/NavigationActionData.cpp:
2805         (WebKit::NavigationActionData::encode const):
2806         (WebKit::NavigationActionData::decode):
2807         * Shared/NavigationActionData.h:
2808         * Shared/WebBackForwardListItem.cpp:
2809         (WebKit::WebBackForwardListItem::setSuspendedPage):
2810         * UIProcess/API/APINavigation.h:
2811         (API::Navigation::setLockHistory):
2812         (API::Navigation::lockHistory const):
2813         (API::Navigation::setLockBackForwardList):
2814         (API::Navigation::lockBackForwardList const):
2815         (API::Navigation::setClientRedirectSourceForHistory):
2816         (API::Navigation::clientRedirectSourceForHistory const):
2817         * UIProcess/API/APINavigationClient.h:
2818         (API::NavigationClient::willPerformClientRedirect):
2819         (API::NavigationClient::didPerformClientRedirect):
2820         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
2821         * UIProcess/Cocoa/NavigationState.h:
2822         * UIProcess/Cocoa/NavigationState.mm:
2823         (WebKit::NavigationState::setNavigationDelegate):
2824         (WebKit::NavigationState::NavigationClient::didPerformClientRedirect):
2825         * UIProcess/FrameLoadState.h:
2826         (WebKit::FrameLoadState::setURL):
2827         * UIProcess/WebPageProxy.cpp:
2828         (WebKit::WebPageProxy::loadRequestWithNavigation):
2829         (WebKit::WebPageProxy::continueNavigationInNewProcess):
2830         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2831         (WebKit::WebPageProxy::didPerformClientRedirect):
2832         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2833         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2834         * WebProcess/WebPage/WebPage.cpp:
2835         (WebKit::WebPage::loadRequest):
2836         (WebKit::WebPage::setCurrentHistoryItemForReattach):
2837         * WebProcess/WebPage/WebPage.h:
2838         * WebProcess/WebPage/WebPage.messages.in:
2839
2840 2018-10-23  Claudio Saavedra  <csaavedra@igalia.com>
2841
2842         [WPE][GTK] Pass full certificate chain in CertificateInfo coder
2843         https://bugs.webkit.org/show_bug.cgi?id=190789
2844
2845         Reviewed by Michael Catanzaro.
2846
2847         When the network process serializes certificate data to other
2848         processes through the argument coders, the certificate chain, if
2849         present, is lost. In practice this means that applications using
2850         the public API to process certificate info have no details on the
2851         certificate chain, other than the very basics included in the
2852         certificate. Serialize the entire chain if available in the
2853         certificate.
2854
2855         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
2856         (IPC::ArgumentCoder<CertificateInfo>::encode): Encode the
2857         certificate chain if present.
2858         (IPC::ArgumentCoder<CertificateInfo>::decode): Decode the
2859         entire certificate chain and rebuild it.
2860
2861 2018-10-22  Keith Rollin  <krollin@apple.com>
2862
2863         Use Location = "Relative to Build Products" rather than "Relative to Group"
2864         https://bugs.webkit.org/show_bug.cgi?id=190781
2865
2866         Reviewed by Alexey Proskuryakov.
2867
2868         Almost all Derived Files are included in Xcode projects with the
2869         Location attribute set to "Relative to Group". While this currently
2870         works, the Derived Files can no longer be found when enabling XCBuild
2871         (which has stricter requirements). Fix this by setting the Location
2872         attribute to "Relative to Build Products".
2873
2874         * WebKit.xcodeproj/project.pbxproj:
2875
2876 2018-10-22  Tim Horton  <timothy_horton@apple.com>
2877
2878         Don't waste time under -setupInteraction under -initWithFrame for unparented WKWebViews
2879         https://bugs.webkit.org/show_bug.cgi?id=190801
2880         <rdar://problem/43674361>
2881
2882         Reviewed by Megan Gardner.
2883
2884         * UIProcess/ios/WKContentView.mm:
2885         (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
2886         (-[WKContentView didMoveToWindow]):
2887         Defer the first call to WKContentViewInteraction's -setupInteraction
2888         until the view is parented. This avoids a few milliseconds of unnecessary
2889         work for views that are never parented.
2890
2891         * UIProcess/ios/WKContentViewInteraction.h:
2892         * UIProcess/ios/WKContentViewInteraction.mm:
2893         (-[WKContentView setupInteraction]):
2894         (-[WKContentView cleanupInteraction]):
2895         Keep track of the current state of WKContentViewInteraction's gestures.
2896         Use this to make it OK to call -setupInteraction multiple times.
2897
2898 2018-10-22  Chris Dumez  <cdumez@apple.com>
2899
2900         Deque's contains() and findIf() should be const
2901         https://bugs.webkit.org/show_bug.cgi?id=190796
2902
2903         Reviewed by Antti Koivisto.
2904
2905         Mark method as const now that Deque's implementation allows it to be.
2906
2907         * UIProcess/WebProcessPool.cpp:
2908         (WebKit::WebProcessPool::hasSuspendedPageProxyFor const):
2909         (WebKit::WebProcessPool::hasSuspendedPageProxyFor): Deleted.
2910         * UIProcess/WebProcessPool.h:
2911
2912 2018-10-19  Brent Fulgham  <bfulgham@apple.com>
2913
2914         Allow WebContent process to check some file system features
2915         https://bugs.webkit.org/show_bug.cgi?id=190768
2916         <rdar://problem/45377609>
2917
2918         Reviewed by Alexey Proskuryakov.
2919
2920         This patch unblocks some IOKit properties that are needed by lower level frameworks to make decisions
2921         about how to efficiently use the file system.
2922
2923         * WebProcess/com.apple.WebProcess.sb.in:
2924
2925 2018-10-19  Stephan Szabo  <stephan.szabo@sony.com>
2926
2927         [WinCairo] Search terms are not saved for <input type="search">
2928         https://bugs.webkit.org/show_bug.cgi?id=188174
2929
2930         Reviewed by Fujii Hironori.
2931
2932         Add support for saving the search terms for <input
2933         type="search"> to a SQLite database, replacing the
2934         CF-based implementation for Windows and adding support
2935         for non-legacy WebKit.
2936
2937         * UIProcess/win/WebPageProxyWin.cpp:
2938         (WebKit::WebPageProxy::saveRecentSearches): Use SQLite database
2939         implementation in WebCore::SearchPopupMenuDB to save search
2940         terms
2941         (WebKit::WebPageProxy::loadRecentSearches): Use SQLite database
2942         implementation in WebCore::SearchPopupMenuDB to load search
2943         terms
2944
2945 2018-10-19  Alex Christensen  <achristensen@webkit.org>
2946
2947         WebDataListSuggestionsDropdown should use a WeakPtr
2948         https://bugs.webkit.org/show_bug.cgi?id=190763
2949         <rdar://problem/45417449>
2950
2951         Reviewed by Tim Horton.
2952
2953         Nothing suspicious here. It's just good practice to not keep raw pointers that aren't reset when the object they point to are destroyed.
2954
2955         * UIProcess/WebDataListSuggestionsDropdown.cpp:
2956         (WebKit::WebDataListSuggestionsDropdown::WebDataListSuggestionsDropdown):
2957         (WebKit::WebDataListSuggestionsDropdown::close):
2958         * UIProcess/WebDataListSuggestionsDropdown.h:
2959         (WebKit::WebDataListSuggestionsDropdown::Client::~Client): Deleted.
2960         * UIProcess/WebPageProxy.h:
2961         * UIProcess/ios/WebDataListSuggestionsDropdownIOS.h:
2962         * UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm:
2963         (WebKit::WebDataListSuggestionsDropdownIOS::create):
2964         (WebKit::WebDataListSuggestionsDropdownIOS::WebDataListSuggestionsDropdownIOS):
2965         (WebKit::WebDataListSuggestionsDropdownIOS::close):
2966         (WebKit::WebDataListSuggestionsDropdownIOS::didSelectOption):
2967         * UIProcess/mac/WebDataListSuggestionsDropdownMac.h:
2968         * UIProcess/mac/WebDataListSuggestionsDropdownMac.mm:
2969         (WebKit::WebDataListSuggestionsDropdownMac::create):
2970         (WebKit::WebDataListSuggestionsDropdownMac::WebDataListSuggestionsDropdownMac):
2971         (WebKit::WebDataListSuggestionsDropdownMac::didSelectOption):
2972         (WebKit::WebDataListSuggestionsDropdownMac::selectOption):
2973
2974 2018-10-19  Wenson Hsieh  <wenson_hsieh@apple.com>
2975
2976         [iOS] [Datalist] Can't pick datalist suggestions in a stock WKWebView
2977         https://bugs.webkit.org/show_bug.cgi?id=190621
2978         <rdar://problem/45310649>
2979
2980         Reviewed by Tim Horton.
2981
2982         Fixes the bug by refactoring datalist suggestion information on iOS; currently, we override text suggestions on
2983         _WKFormInputSession. This only works for a few internal clients (including Safari) that set a _WKInputDelegate
2984         and also implement either -_webView:willStartInputSession: or -_webView:didStartInputSession:, which is
2985         necessary in order to ensure that WebKit creates and maintains a form input session.
2986
2987         The two pieces of information that datalist code needs to vend to WKContentView are a list of UITextSuggestions
2988         and a custom input view, which are both currently properties of _WKFormInputSession. This patch lifts these out
2989         of the input session and makes them properties of WKContentView, which are used in
2990         WebDataListSuggestionsDropdownIOS.
2991
2992         Test: fast/forms/datalist/datalist-textinput-suggestions-order.html
2993
2994         * UIProcess/ios/WKContentViewInteraction.h:
2995         * UIProcess/ios/WKContentViewInteraction.mm:
2996
2997         Add new properties to WKContentView: an input view for datalist suggestions, and a list of text suggestions.
2998
2999         (-[WKFormInputSession setSuggestions:]):
3000         (-[WKContentView setupInteraction]):
3001         (-[WKContentView cleanupInteraction]):
3002         (-[WKContentView _endEditing]):
3003
3004         Pull out common logic when resigning first responder or tabbing to the next or previous text field into a new
3005         helper. This helper notifies `_inputPeripheral`, `_formInputSession`, and `_dataListTextSuggestionsInputView`
3006         when editing has ended; the input peripheral and suggestions input view use this chance to send the value of the
3007         form control to the web process.
3008
3009         (-[WKContentView resignFirstResponderForWebView]):
3010         (-[WKContentView inputView]):
3011
3012         If a custom input view is not set but we have an input view for a datalist's text suggestions, use the datalist
3013         input view.
3014
3015         (-[WKContentView accessoryTab:]):
3016         (-[WKContentView _stopAssistingNode]):
3017
3018         Clear datalist state on WKContentView.
3019
3020         (-[WKContentView dataListTextSuggestionsInputView]):
3021         (-[WKContentView dataListTextSuggestions]):
3022         (-[WKContentView setDataListTextSuggestionsInputView:]):
3023         (-[WKContentView setDataListTextSuggestions:]):
3024         (-[WKContentView updateTextSuggestionsForInputDelegate]):
3025
3026         Pull out logic for setting suggestions on UIKit's `inputDelegate` (i.e. UIKeyboardImpl). We now first consult
3027         internally-vended text suggestions from _WKFormInputSession; if an internal client has not overridden our text
3028         suggestions, then we simply use suggestions from the current datalist (if present).
3029
3030         * UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm:
3031         (-[WKDataListSuggestionsPicker updateWithInformation:]):
3032         (-[WKDataListSuggestionsPicker showSuggestionsDropdown:activationType:]):
3033         (-[WKDataListSuggestionsPicker invalidate]):
3034         (-[WKDataListSuggestionsPopover updateWithInformation:]):
3035         (-[WKDataListSuggestionsPopover showSuggestionsDropdown:activationType:]):
3036         (-[WKDataListSuggestionsPopover didSelectOptionAtIndex:]):
3037
3038         Change all the places that currently manipulate WKContentView's form input session to directly set text
3039         suggestions and the text suggestion input view on the content view instead.
3040
3041 2018-10-19  John Wilander  <wilander@apple.com>
3042
3043         Only cap lifetime of persistent cookies created client-side through document.cookie when resource load statistics is enabled
3044         https://bugs.webkit.org/show_bug.cgi?id=190687
3045         <rdar://problem/45349024>
3046
3047         Reviewed by Alex Christensen.
3048
3049         This patch adds the following:
3050         - The WebProcessPool now tells the WebsiteDataStore when a network process has
3051             been created.
3052         - The WebsiteDataStore in turn tells the WebResourceLoadStatisticsStore when
3053             a network process has been created.
3054         - The WebResourceLoadStatisticsStore makes sure to update the network processes
3055             with its cookie policy when it's notified that a network process has been
3056             created.
3057
3058         In addition, this patch changes the following:
3059         - The ResourceLoadStatisticsMemoryStore no longer keeps track of which domains
3060             it has told the network process to block cookies for. The reason is that
3061             we cannot assume that there is only one network process so we should
3062             always send complete blocking data.
3063         - The ResourceLoadStatisticsMemoryStore's functions for communicating cookie
3064             blocking state to the network process no longer take and forward the
3065             "clear first" parameter. This is because complete data is sent every time
3066             and thus the network process' set is always cleared on an update.
3067         - Removes WebsiteDataStore::networkProcessDidCrash() and
3068             WebResourceLoadStatisticsStore::scheduleCookieBlockingStateReset() since
3069             the call site---WebProcessPool::ensureNetworkProcess()---now calls
3070             WebsiteDataStore::didCreateNetworkProcess() after a network process
3071             crash and the state sync for cookie blocking is triggered.
3072
3073         * NetworkProcess/NetworkProcess.cpp:
3074         (WebKit::NetworkProcess::updatePrevalentDomainsToBlockCookiesFor):
3075         (WebKit::NetworkProcess::setShouldCapLifetimeForClientSideCookies):
3076         * NetworkProcess/NetworkProcess.h:
3077         * NetworkProcess/NetworkProcess.messages.in:
3078         * UIProcess/Network/NetworkProcessProxy.cpp:
3079         (WebKit::NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor):
3080         (WebKit::NetworkProcessProxy::setShouldCapLifetimeForClientSideCookies):
3081         (WebKit::NetworkProcessProxy::didSetShouldCapLifetimeForClientSideCookies):
3082         * UIProcess/Network/NetworkProcessProxy.h:
3083         * UIProcess/Network/NetworkProcessProxy.messages.in:
3084         * UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
3085         (WebKit::ResourceLoadStatisticsMemoryStore::clear):
3086         (WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlocking):
3087         (WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlockingForDomains):
3088         (WebKit::ResourceLoadStatisticsMemoryStore::clearBlockingStateForDomains):
3089         (WebKit::ResourceLoadStatisticsMemoryStore::resetCookieBlockingState): Deleted.
3090         * UIProcess/ResourceLoadStatisticsMemoryStore.h:
3091         * UIProcess/WebProcessPool.cpp:
3092         (WebKit::WebProcessPool::ensureNetworkProcess):
3093         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3094         (WebKit::WebResourceLoadStatisticsStore::didCreateNetworkProcess):
3095         (WebKit::WebResourceLoadStatisticsStore::scheduleCookieBlockingUpdateForDomains):
3096         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
3097         (WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToBlockCookiesForHandler):
3098         (WebKit::WebResourceLoadStatisticsStore::scheduleCookieBlockingStateReset): Deleted.
3099         * UIProcess/WebResourceLoadStatisticsStore.h:
3100         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3101         (WebKit::WebsiteDataStore::updatePrevalentDomainsToBlockCookiesFor):
3102         (WebKit::WebsiteDataStore::setShouldCapLifetimeForClientSideCookies):
3103         (WebKit::WebsiteDataStore::didCreateNetworkProcess):
3104         (WebKit::WebsiteDataStore::networkProcessDidCrash): Deleted.
3105         * UIProcess/WebsiteData/WebsiteDataStore.h:
3106
3107 2018-10-19  Alex Christensen  <achristensen@webkit.org>
3108
3109         Rebase python tests.
3110
3111         * Scripts/webkit/messages_unittest.py:
3112
3113 2018-10-19  Alex Christensen  <achristensen@webkit.org>
3114
3115         Rebase python tests.
3116
3117         * Scripts/Makefile:
3118         * Scripts/webkit/MessageReceiver-expected.cpp:
3119         * Scripts/webkit/Messages-expected.h:
3120
3121 2018-10-19  Alex Christensen  <achristensen@webkit.org>
3122
3123         Mark LegacySync IPC messages
3124         https://bugs.webkit.org/show_bug.cgi?id=190759
3125
3126         Reviewed by Tim Horton.
3127
3128         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
3129         * NetworkProcess/NetworkProcess.messages.in:
3130         * NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in:
3131         * Platform/IPC/HandleMessage.h:
3132         (IPC::handleMessageLegacySync):
3133         * PluginProcess/PluginControllerProxy.messages.in:
3134         * Scripts/webkit/messages.py:
3135         * Shared/Plugins/NPObjectMessageReceiver.messages.in:
3136         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in:
3137         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
3138         * UIProcess/Plugins/PluginProcessProxy.messages.in:
3139         * UIProcess/WebFullScreenManagerProxy.messages.in:
3140         * UIProcess/WebPageProxy.messages.in:
3141         * UIProcess/WebPasteboardProxy.messages.in:
3142         * UIProcess/WebProcessPool.messages.in:
3143         * UIProcess/WebProcessProxy.messages.in:
3144         * UIProcess/WebStorage/StorageManager.messages.in:
3145         * UIProcess/mac/SecItemShimProxy.messages.in:
3146         * WebProcess/Plugins/PluginProcessConnection.messages.in:
3147         * WebProcess/Plugins/PluginProxy.messages.in:
3148         * WebProcess/WebPage/WebPage.messages.in:
3149         * WebProcess/WebProcess.messages.in:
3150
3151 2018-10-19  Alex Christensen  <achristensen@webkit.org>
3152
3153         Update and add python tests after r237294
3154         https://bugs.webkit.org/show_bug.cgi?id=190746
3155
3156         * Scripts/Makefile: Added to help updating expectations.
3157         * Scripts/webkit/LegacyMessageReceiver-expected.cpp:
3158         * Scripts/webkit/MessageReceiverSuperclass-expected.cpp:
3159         (Messages::WebPage::TestAsyncMessage::callReply):
3160         (Messages::WebPage::TestAsyncMessage::cancelReply):
3161         (Messages::WebPage::TestAsyncMessage::send):
3162         (WebKit::WebPage::didReceiveMessage):
3163         * Scripts/webkit/MessagesSuperclass-expected.h:
3164         (Messages::WebPage::TestAsyncMessage::receiverName):
3165         (Messages::WebPage::TestAsyncMessage::name):
3166         (Messages::WebPage::TestAsyncMessage::asyncMessageReplyName):
3167         (Messages::WebPage::TestAsyncMessage::TestAsyncMessage):
3168         (Messages::WebPage::TestAsyncMessage::arguments const):
3169         * Scripts/webkit/test-superclass-messages.in:
3170         Adding the extra newline made python tests fail.
3171         I also added more tests for the new functionality introduced in r237924.
3172
3173 2018-10-19  Alex Christensen  <achristensen@webkit.org>
3174
3175         Introduce CompletionHandler-based Async IPC messages with replies
3176         https://bugs.webkit.org/show_bug.cgi?id=190746
3177
3178         Reviewed by Tim Horton.
3179
3180         Before this patch, to make an asynchronous IPC message with a reply you had to find two objects that
3181         can talk to each other, make two new message types, send a generated identifier, keep track of that
3182         identifier, make a HashMap somewhere to store the object waiting for the response, and hook it all up.
3183         What a mess.  No wonder people take shortcuts and make strange design decisions.
3184
3185         Now, you can just use a CompletionHandler and mark the reply as Async in *.messages.in.
3186         I've adopted this with a message whose behavior is covered by the storage/indexeddb/modern/blob-cursor.html
3187         layout test and many others.  I intent to refine and further adopt this incrementally.
3188
3189         * NetworkProcess/NetworkProcess.cpp:
3190         (WebKit::NetworkProcess::getSandboxExtensionsForBlobFiles):
3191         (WebKit::NetworkProcess::didGetSandboxExtensionsForBlobFiles): Deleted.
3192         * NetworkProcess/NetworkProcess.h:
3193         * NetworkProcess/NetworkProcess.messages.in:
3194         This is representative of how code will be simplified with greater adoption. 
3195         * NetworkProcess/NetworkResourceLoadParameters.cpp:
3196         (WebKit::NetworkResourceLoadParameters::decode):
3197         Modernize HandleArray decoding.
3198         * Platform/IPC/Connection.cpp:
3199         (IPC::Connection::dispatchMessage):
3200         (IPC::nextAsyncReplyHandlerID):
3201         (IPC::asyncReplyHandlerMap):
3202         Handle async replies when looking at incoming messages from the sending process.
3203         * Platform/IPC/Connection.h:
3204         (IPC::Connection::sendWithAsyncReply):
3205         Send a message with an async reply and prepare the reply receiver.
3206         * Platform/IPC/Encoder.h:
3207         Make the uint64_t encoder public so we can use it when encoding the listenerID.
3208         * Platform/IPC/HandleMessage.h:
3209         (IPC::handleMessageAsync):
3210         Handle an asynchronous message with a reply from the receiving process.
3211         This is similar to how DelayedReply messages are handled, but the listenerID is automatically captured and sent back.
3212         * Scripts/webkit/messages.py:
3213         Generate code for async message replies.
3214         * Shared/Databases/IndexedDB/WebIDBResult.cpp:
3215         (WebKit::WebIDBResult::decode):
3216         * Shared/SandboxExtension.h:
3217         (WebKit::SandboxExtension::HandleArray::at):
3218         (WebKit::SandboxExtension::HandleArray::decode):
3219         * Shared/WebProcessCreationParameters.cpp:
3220         (WebKit::WebProcessCreationParameters::decode):
3221         * Shared/mac/SandboxExtensionMac.mm:
3222         (WebKit::SandboxExtension::HandleArray::decode):
3223         Modernize the decoding of HandleArray to work with generated decoding.
3224         * UIProcess/Network/NetworkProcessProxy.cpp:
3225         (WebKit::NetworkProcessProxy::getSandboxExtensionsForBlobFiles):
3226         * UIProcess/Network/NetworkProcessProxy.h:
3227         * UIProcess/Network/NetworkProcessProxy.messages.in:
3228         This is also representative of how code will be simplified with greater adoption.
3229         * WebProcess/MediaStream/MediaDeviceSandboxExtensions.cpp:
3230         (WebKit::MediaDeviceSandboxExtensions::decode):
3231         Modernize HandleArray decoding.
3232
3233 2018-10-19  Chris Dumez  <cdumez@apple.com>
3234
3235         [PSON] WebPageProxy::didCompletePageTransition() may interact with a SuspendedPageProxy from a previous navigation
3236         https://bugs.webkit.org/show_bug.cgi?id=190717
3237
3238         Reviewed by Antti Koivisto.
3239
3240         WebPageProxy::didCompletePageTransition() may interact with a SuspendedPageProxy from a previous navigation. We need
3241         to reset m_lastSuspendedPage whenever the page starts a new navigation as m_lastSuspendedPage is only updated when
3242         we process-swap otherwise.
3243
3244         Also rename the data member to m_pageSuspendedDueToCurrentNavigation for clarity.
3245
3246         In a follow-up, I will see if I can get rid of this data member entirely or maybe move it to the Navigation
3247         object.
3248
3249         * UIProcess/WebPageProxy.cpp:
3250         (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
3251         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
3252         (WebKit::WebPageProxy::didCompletePageTransition):
3253         (WebKit::WebPageProxy::enterAcceleratedCompositingMode):
3254
3255 2018-10-18  Eric Carlson  <eric.carlson@apple.com>
3256
3257         [MediaStream] Allow ports to optionally do screen capture in the UI process
3258         https://bugs.webkit.org/show_bug.cgi?id=190728
3259         <rdar://problem/45376824>
3260
3261         Reviewed by Jer Noble and Tim Horton.
3262
3263         * Shared/WebProcessCreationParameters.cpp:
3264         (WebKit::WebProcessCreationParameters::encode const): Encode shouldCaptureDisplayInUIProcess.
3265         (WebKit::WebProcessCreationParameters::decode): Decode shouldCaptureDisplayInUIProcess.
3266         * Shared/WebProcessCreationParameters.h:
3267
3268         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3269         (API::ProcessPoolConfiguration::copy): Copy shouldCaptureDisplayInUIProcess.
3270         * UIProcess/API/APIProcessPoolConfiguration.h:
3271
3272         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
3273         (WebKit::UserMediaCaptureManagerProxy::SourceProxy::remoteVideoSampleAvailable):
3274         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints): Remove
3275         RealtimeMediaSource::Type parameter, CaptureDevice has the same information. Deal with display
3276         capture "devices".
3277         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
3278         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
3279
3280         * UIProcess/WebProcessPool.cpp:
3281         (WebKit::WebProcessPool::initializeNewWebProcess): Copy shouldCaptureDisplayInUIProcess.
3282
3283         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
3284         (WebKit::UserMediaCaptureManager::Source::Source): Only allocate a ring buffer for Audio sources.
3285         (WebKit::UserMediaCaptureManager::Source::~Source): Same for deallocate.
3286         (WebKit::UserMediaCaptureManager::Source::storage): m_ringBuffer is a pointer.
3287         (WebKit::UserMediaCaptureManager::Source::setStorage): Ditto.
3288         (WebKit::UserMediaCaptureManager::Source::setRingBufferFrameBounds): Ditto.
3289         (WebKit::UserMediaCaptureManager::Source::audioSamplesAvailable): Ditto.
3290         (WebKit::UserMediaCaptureManager::Source::remoteVideoSampleAvailable): Create a 
3291         PixelBuffer-backed media sample and call videoSampleAvailable.
3292         (WebKit::UserMediaCaptureManager::~UserMediaCaptureManager): Clear the audio and display capture
3293         factory overrides.
3294         (WebKit::UserMediaCaptureManager::initialize): Set the audio and display capture factory overrides.
3295         (WebKit::UserMediaCaptureManager::createCaptureSource):
3296         (WebKit::UserMediaCaptureManager::remoteVideoSampleAvailable):
3297         * WebProcess/cocoa/UserMediaCaptureManager.h:
3298         * WebProcess/cocoa/UserMediaCaptureManager.messages.in:
3299
3300 2018-10-18  Truitt Savell  <tsavell@apple.com>
3301
3302         Unreviewed, rolling out r237272.
3303
3304         Broke on device iOS builds and Windows builds
3305
3306         Reverted changeset:
3307
3308         "[MediaStream] Allow ports to optionally do screen capture in
3309         the UI process"
3310         https://bugs.webkit.org/show_bug.cgi?id=190728
3311         https://trac.webkit.org/changeset/237272
3312
3313 2018-10-18  Jer Noble  <jer.noble@apple.com>
3314
3315         Enable WKPreferences._lowPowerVideoAudioBufferSizeEnabled by default
3316         https://bugs.webkit.org/show_bug.cgi?id=190315
3317
3318         Reviewed by Eric Carlson.
3319
3320         This preference is disabled for WebKitLegacy because it can interact poorly with clients' own use of audio.
3321         It can be enabled for WebKit since it will only affect the WebProcess and not the client process.
3322
3323         * Shared/WebPreferences.yaml:
3324
3325 2018-10-18  Eric Carlson  <eric.carlson@apple.com>
3326
3327         [MediaStream] Allow ports to optionally do screen capture in the UI process
3328         https://bugs.webkit.org/show_bug.cgi?id=190728
3329         <rdar://problem/45376824>
3330
3331         Reviewed by Jer Noble and Tim Horton.
3332
3333         * Shared/WebProcessCreationParameters.cpp:
3334         (WebKit::WebProcessCreationParameters::encode const): Encode shouldCaptureDisplayInUIProcess.
3335         (WebKit::WebProcessCreationParameters::decode): Decode shouldCaptureDisplayInUIProcess.
3336         * Shared/WebProcessCreationParameters.h:
3337
3338         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3339         (API::ProcessPoolConfiguration::copy): Copy shouldCaptureDisplayInUIProcess.
3340         * UIProcess/API/APIProcessPoolConfiguration.h:
3341
3342         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
3343         (WebKit::UserMediaCaptureManagerProxy::SourceProxy::remoteVideoSampleAvailable):
3344         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints): Remove
3345         RealtimeMediaSource::Type parameter, CaptureDevice has the same information. Deal with display
3346         capture "devices".
3347         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
3348         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
3349
3350         * UIProcess/WebProcessPool.cpp:
3351         (WebKit::WebProcessPool::initializeNewWebProcess): Copy shouldCaptureDisplayInUIProcess.
3352
3353         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
3354         (WebKit::UserMediaCaptureManager::Source::Source): Only allocate a ring buffer for Audio sources.
3355         (WebKit::UserMediaCaptureManager::Source::~Source): Same for deallocate.
3356         (WebKit::UserMediaCaptureManager::Source::storage): m_ringBuffer is a pointer.
3357         (WebKit::UserMediaCaptureManager::Source::setStorage): Ditto.
3358         (WebKit::UserMediaCaptureManager::Source::setRingBufferFrameBounds): Ditto.
3359         (WebKit::UserMediaCaptureManager::Source::audioSamplesAvailable): Ditto.
3360         (WebKit::UserMediaCaptureManager::Source::remoteVideoSampleAvailable): Create a 
3361         PixelBuffer-backed media sample and call videoSampleAvailable.
3362         (WebKit::UserMediaCaptureManager::~UserMediaCaptureManager): Clear the audio and display capture
3363         factory overrides.
3364         (WebKit::UserMediaCaptureManager::initialize): Set the audio and display capture factory overrides.
3365         (WebKit::UserMediaCaptureManager::createCaptureSource):
3366         (WebKit::UserMediaCaptureManager::remoteVideoSampleAvailable):
3367         * WebProcess/cocoa/UserMediaCaptureManager.h:
3368         * WebProcess/cocoa/UserMediaCaptureManager.messages.in:
3369
3370 2018-10-18  Chris Dumez  <cdumez@apple.com>
3371
3372         [PSON] SuspendedPages do not report meaningful domains in Activity Monitor
3373         https://bugs.webkit.org/show_bug.cgi?id=190721
3374         <rdar://problem/45059699>
3375
3376         Reviewed by Alex Christensen.
3377
3378         SuspendedPages do not report meaningful domains in Activity Monitor, which makes
3379         debugging harder.
3380
3381         * WebProcess/cocoa/WebProcessCocoa.mm:
3382         (WebKit::origin):
3383         (WebKit::WebProcess::updateActivePages):
3384
3385 2018-10-18  Alexey Proskuryakov  <ap@apple.com>
3386
3387         Switch from PLATFORM(IOS) to PLATFORM(IOS_FAMILY)
3388         https://bugs.webkit.org/show_bug.cgi?id=190729
3389
3390         Reviewed by Tim Horton.
3391
3392         * DerivedSources.make:
3393         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
3394         (WebKit::Download::resume):
3395         * NetworkProcess/NetworkActivityTracker.h:
3396         * NetworkProcess/NetworkProcess.h:
3397         * NetworkProcess/NetworkProcessCreationParameters.cpp:
3398         (WebKit::NetworkProcessCreationParameters::encode const):
3399         (WebKit::NetworkProcessCreationParameters::decode):
3400         * NetworkProcess/NetworkProcessCreationParameters.h:
3401         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
3402         (WebKit::NetworkCache::isSafeToUseMemoryMapForPath):
3403         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3404         (WebKit::updateTaskWithFirstPartyForSameSiteCookies):
3405         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3406         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
3407         (WebKit::NetworkProcess::sourceApplicationAuditData const):
3408         (WebKit::NetworkProcess::platformSyncAllCookies):
3409         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
3410         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3411         (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
3412         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
3413         * NetworkProcess/ios/NetworkProcessIOS.mm:
3414         * Platform/IPC/mac/ConnectionMac.mm:
3415         (IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog):
3416         (IPC::Connection::receiveSourceEventHandler):
3417         (IPC::AccessibilityProcessSuspendedNotification):
3418         * Platform/ios/AccessibilityIOS.mm:
3419         * Platform/mac/LayerHostingContext.mm:
3420         (WebKit::LayerHostingContext::createForExternalHostingProcess):
3421         * Platform/spi/Cocoa/DeviceIdentitySPI.h:
3422         * Platform/spi/ios/CelestialSPI.h:
3423         * Platform/spi/ios/FrontBoardServicesSPI.h:
3424         * PluginProcess/mac/PluginProcessShim.mm:
3425         * Shared/API/Cocoa/WKDataDetectorTypesInternal.h:
3426         * Shared/API/Cocoa/WebKit.m:
3427         * Shared/AssistedNodeInformation.cpp:
3428         * Shared/AssistedNodeInformation.h:
3429         * Shared/CacheModel.cpp:
3430         (WebKit::calculateURLCacheSizes):
3431         * Shared/ChildProcess.cpp:
3432         * Shared/Cocoa/APIObject.mm:
3433         (API::Object::newObject):
3434         * Shared/Cocoa/WebKit2InitializeCocoa.mm:
3435         (WebKit::runInitializationCode):
3436         * Shared/DrawingAreaInfo.h:
3437         * Shared/EditorState.cpp:
3438         (WebKit::EditorState::encode const):
3439         (WebKit::EditorState::decode):
3440         (WebKit::EditorState::PostLayoutData::encode const):
3441         (WebKit::EditorState::PostLayoutData::decode):
3442         (WebKit::operator<<):
3443         * Shared/EditorState.h:
3444         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
3445         (WebKit::XPCServiceInitializerDelegate::checkEntitlements):
3446         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
3447         (WebKit::XPCServiceMain):
3448         * Shared/NativeWebKeyboardEvent.h:
3449         * Shared/NativeWebMouseEvent.h:
3450         * Shared/NativeWebTouchEvent.h:
3451         * Shared/PrintInfo.cpp:
3452         (WebKit::PrintInfo::encode const):
3453         (WebKit::PrintInfo::decode):
3454         * Shared/PrintInfo.h:
3455         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.h:
3456         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
3457         (WebKit::RemoteLayerTreePropertyApplier::applyProperties):
3458         * Shared/SessionState.cpp:
3459         (WebKit::FrameState::encode const):
3460         (WebKit::FrameState::decode):
3461         * Shared/SessionState.h:
3462         * Shared/WebCoreArgumentCoders.cpp:
3463         * Shared/WebCoreArgumentCoders.h:
3464         * Shared/WebEvent.h:
3465         * Shared/WebEventConversion.cpp:
3466         (WebKit::WebKit2PlatformTouchEvent::WebKit2PlatformTouchEvent):
3467         * Shared/WebKeyboardEvent.cpp:
3468         * Shared/WebPageCreationParameters.cpp:
3469         (WebKit::WebPageCreationParameters::encode const):
3470         (WebKit::WebPageCreationParameters::decode):
3471         * Shared/WebPageCreationParameters.h:
3472         * Shared/WebPlatformTouchPoint.cpp:
3473         * Shared/WebPreferences.yaml:
3474         * Shared/WebPreferencesDefaultValues.cpp:
3475         (defaultPassiveTouchListenersAsDefaultOnDocument):
3476         (defaultCustomPasteboardDataEnabled):
3477         * Shared/WebPreferencesDefaultValues.h:
3478         * Shared/WebProcessCreationParameters.cpp:
3479         (WebKit::WebProcessCreationParameters::encode const):
3480         (WebKit::WebProcessCreationParameters::decode):
3481         * Shared/WebProcessCreationParameters.h:
3482         * Shared/WebTouchEvent.cpp:
3483         * Shared/cf/ArgumentCodersCF.cpp:
3484         (IPC::encode):
3485         (IPC::decode):
3486         * Shared/cf/ArgumentCodersCF.h:
3487         * Shared/ios/ChildProcessIOS.mm:
3488         * Shared/ios/InteractionInformationAtPosition.h:
3489         * Shared/ios/InteractionInformationAtPosition.mm:
3490         * Shared/ios/InteractionInformationRequest.cpp:
3491         * Shared/ios/InteractionInformationRequest.h:
3492         * Shared/ios/NativeWebKeyboardEventIOS.mm:
3493         * Shared/ios/NativeWebMouseEventIOS.mm:
3494         * Shared/ios/NativeWebTouchEventIOS.mm:
3495         * Shared/ios/WebIOSEventFactory.h:
3496         * Shared/ios/WebIOSEventFactory.mm:
3497         * Shared/ios/WebIconUtilities.h:
3498         * Shared/ios/WebIconUtilities.mm:
3499         * Shared/mac/ArgumentCodersMac.h:
3500         * Shared/mac/ArgumentCodersMac.mm:
3501         * Shared/mac/SandboxExtensionMac.mm:
3502         * Shared/mac/SecItemShim.cpp:
3503         (WebKit::initializeSecItemShim):
3504         * UIProcess/API/APIPageConfiguration.cpp:
3505         (API::PageConfiguration::copy const):
3506         * UIProcess/API/APIPageConfiguration.h:
3507         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3508         (API::ProcessPoolConfiguration::copy):
3509         * UIProcess/API/APIProcessPoolConfiguration.h:
3510         * UIProcess/API/APIUIClient.h:
3511         * UIProcess/API/C/WKInspector.cpp:
3512         * UIProcess/API/C/WKPage.cpp:
3513         (WKPageSetIgnoresViewportScaleLimits):
3514         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
3515         (WKContextIsPlugInUpdateAvailable):
3516         * UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
3517         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
3518         (API::WebsiteDataStore::defaultApplicationCacheDirectory):
3519         (API::WebsiteDataStore::legacyDefaultApplicationCacheDirectory):
3520         (API::WebsiteDataStore::legacyDefaultJavaScriptConfigurationDirectory):
3521         * UIProcess/API/Cocoa/WKNavigationAction.mm:
3522         (-[WKNavigationAction description]):
3523         * UIProcess/API/Cocoa/WKPreviewActionItemIdentifiers.mm:
3524         * UIProcess/API/Cocoa/WKPreviewElementInfo.mm:
3525         * UIProcess/API/Cocoa/WKProcessGroup.mm:
3526         (IGNORE_WARNINGS_BEGIN):
3527         * UIProcess/API/Cocoa/WKProcessPool.mm:
3528         (-[WKProcessPool _pluginProcessCount]):
3529         * UIProcess/API/Cocoa/WKWebView.mm:
3530         (shouldRequireUserGestureToLoadVideo):
3531         (validate):
3532         (-[WKWebView _initializeWithConfiguration:]):
3533         (-[WKWebView _setUpSQLiteDatabaseTrackerClient]):
3534         (-[WKWebView dealloc]):
3535         (-[WKWebView allowsLinkPreview]):
3536         (-[WKWebView setAllowsLinkPreview:]):
3537         (-[WKWebView _countStringMatches:options:maxCount:]):
3538         (-[WKWebView _findString:options:maxCount:]):
3539         (-[WKWebView _hideFindUI]):
3540         (-[WKWebView _scrollPerformanceData]):
3541         (-[WKWebView _allowsMediaDocumentInlinePlayback]):
3542         (-[WKWebView _setAllowsMediaDocumentInlinePlayback:]):
3543         (-[WKWebView _contentsOfUserInterfaceItem:]):
3544         (-[WKWebView _internalDoAfterNextPresentationUpdate:withoutWaitingForPainting:withoutWaitingForAnimatedResize:]):
3545         (-[WKWebView _doAfterNextVisibleContentRectUpdate:]):
3546         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3547         (-[WKWebViewConfiguration init]):
3548         (-[WKWebViewConfiguration encodeWithCoder:]):
3549         (-[WKWebViewConfiguration initWithCoder:]):
3550         (-[WKWebViewConfiguration copyWithZone:]):
3551         (defaultApplicationNameForUserAgent):
3552         * UIProcess/API/Cocoa/WKWebViewConfigurationInternal.h:
3553         * UIProcess/API/Cocoa/WKWebViewInternal.h:
3554         * UIProcess/API/Cocoa/_WKActivatedElementInfo.mm:
3555         (-[_WKActivatedElementInfo _initWithType:URL:location:title:ID:rect:image:userInfo:]):
3556         * UIProcess/API/Cocoa/_WKActivatedElementInfoInternal.h:
3557         * UIProcess/API/Cocoa/_WKAttachment.mm:
3558         * UIProcess/API/Cocoa/_WKContextMenuElementInfo.mm:
3559         * UIProcess/API/Cocoa/_WKElementAction.mm:
3560         * UIProcess/API/Cocoa/_WKElementActionInternal.h:
3561         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
3562         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h:
3563         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
3564         (-[WKPaymentAuthorizationViewControllerDelegate invalidate]):
3565         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didAuthorizePayment:handler:]):
3566         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:handler:]):
3567         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:handler:]):
3568         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:handler:]):
3569         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
3570         (WebKit::toPKPaymentRequest):
3571         (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentSession):
3572         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection):
3573         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection):
3574         (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection):
3575         * UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
3576         * UIProcess/ApplicationStateTracker.h:
3577         * UIProcess/ApplicationStateTracker.mm:
3578         * UIProcess/Automation/cocoa/WebAutomationSessionCocoa.mm:
3579         * UIProcess/Automation/ios/WebAutomationSessionIOS.mm:
3580         * UIProcess/BackgroundProcessResponsivenessTimer.cpp:
3581         (WebKit::BackgroundProcessResponsivenessTimer::shouldBeActive const):
3582         * UIProcess/ChildProcessProxy.cpp:
3583         (WebKit::ChildProcessProxy::shutDownProcess):
3584         * UIProcess/Cocoa/DownloadClient.h:
3585         * UIProcess/Cocoa/DownloadClient.mm:
3586         (WebKit::DownloadClient::takeActivityToken):
3587         (WebKit::DownloadClient::releaseActivityTokenIfNecessary):
3588         * UIProcess/Cocoa/LayerRepresentation.h:
3589         * UIProcess/Cocoa/NavigationState.h:
3590         * UIProcess/Cocoa/NavigationState.mm:
3591         (WebKit::NavigationState::NavigationState):
3592         (WebKit::NavigationState::didChangeIsLoading):
3593         * UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
3594         * UIProcess/Cocoa/PlaybackSessionManagerProxy.messages.in:
3595         * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
3596         * UIProcess/Cocoa/UIDelegate.h:
3597         * UIProcess/Cocoa/UIDelegate.mm:
3598         (WebKit::UIDelegate::setDelegate):
3599         (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
3600         * UIProcess/Cocoa/VersionChecks.h:
3601         * UIProcess/Cocoa/VersionChecks.mm:
3602         (WebKit::linkedOnOrAfter):
3603         * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
3604         * UIProcess/Cocoa/VideoFullscreenManagerProxy.messages.in:
3605         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
3606         (WebKit::VideoFullscreenManagerProxy::setupFullscreenWithID):
3607         (WebKit::VideoFullscreenManagerProxy::exitFullscreen):
3608         (WebKit::VideoFullscreenManagerProxy::preparedToReturnToInline):
3609         (WebKit::VideoFullscreenManagerProxy::setVideoLayerFrame):
3610         * UIProcess/Cocoa/ViewGestureController.h:
3611         * UIProcess/Cocoa/WKShareSheet.mm:
3612         (-[WKShareSheet presentWithParameters:completionHandler:]):
3613         * UIProcess/Cocoa/WKWebViewContentProvider.h:
3614         * UIProcess/Cocoa/WKWebViewContentProviderRegistry.h:
3615         * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
3616         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
3617         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
3618         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3619         (WebKit::WebProcessPool::platformResolvePathsForSandboxExtensions):
3620         (WebKit::WebProcessPool::platformInitializeWebProcess):
3621         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
3622         (WebKit::WebProcessPool::registerNotificationObservers):
3623         (WebKit::WebProcessPool::unregisterNotificationObservers):
3624         * UIProcess/Gamepad/cocoa/UIGamepadProviderCocoa.mm:
3625         (WebKit::UIGamepadProvider::platformSetDefaultGamepadProvider):
3626         * UIProcess/Gamepad/ios/UIGamepadProviderIOS.mm:
3627         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
3628         (WebKit::shouldLeakBoost):
3629         (WebKit::systemDirectoryPath):
3630         (WebKit::ProcessLauncher::launchProcess):
3631         * UIProcess/Network/NetworkProcessProxy.cpp:
3632         (WebKit::NetworkProcessProxy::didFinishLaunching):
3633         * UIProcess/PageClient.h:
3634         * UIProcess/ProcessAssertion.cpp:
3635         * UIProcess/ProcessAssertion.h:
3636         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
3637         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
3638         (WebKit::RemoteLayerTreeDrawingAreaProxy::~RemoteLayerTreeDrawingAreaProxy):
3639         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
3640         (WebKit::RemoteLayerTreeDrawingAreaProxy::indicatorLocation const):
3641         (WebKit::RemoteLayerTreeDrawingAreaProxy::updateDebugIndicator):
3642         (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
3643         (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateActivityState):
3644         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
3645         (WebKit::RemoteLayerTreeHost::clearLayers):
3646         (WebKit::RemoteLayerTreeHost::detachRootLayer):
3647         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
3648         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
3649         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
3650         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
3651         (WebKit::RemoteScrollingTree::createScrollingTreeNode):
3652         * UIProcess/RemoteLayerTree/RemoteScrollingTree.h:
3653         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
3654         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
3655         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
3656         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
3657         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
3658         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
3659         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
3660         * UIProcess/WKImagePreviewViewController.h:
3661         * UIProcess/WKImagePreviewViewController.mm:
3662         * UIProcess/WKInspectorHighlightView.h:
3663         * UIProcess/WKInspectorHighlightView.mm:
3664         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
3665         (WebKit::LocalAuthenticatorInternal::buildAuthData):
3666         (WebKit::LocalAuthenticator::makeCredential):
3667         (WebKit::LocalAuthenticator::continueMakeCredentialAfterUserConsented):
3668         (WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested):
3669         (WebKit::LocalAuthenticator::getAssertion):
3670         (WebKit::LocalAuthenticator::continueGetAssertionAfterUserConsented):
3671         * UIProcess/WebAuthentication/Cocoa/LocalConnection.mm:
3672         (WebKit::LocalConnection::getUserConsent const):
3673         (WebKit::LocalConnection::getAttestation const):
3674         * UIProcess/WebAuthentication/Cocoa/LocalService.mm:
3675         (WebKit::LocalService::isAvailable):
3676         * UIProcess/WebFullScreenManagerProxy.cpp:
3677         (WebKit::WebFullScreenManagerProxy::supportsFullScreen):
3678         * UIProcess/WebGeolocationManagerProxy.cpp:
3679         * UIProcess/WebGeolocationManagerProxy.h:
3680         * UIProcess/WebInspectorProxy.cpp:
3681         * UIProcess/WebOpenPanelResultListenerProxy.cpp:
3682         * UIProcess/WebOpenPanelResultListenerProxy.h:
3683         * UIProcess/WebPageProxy.cpp:
3684         (WebKit::m_resetRecentCrashCountTimer):
3685         (WebKit::WebPageProxy::finishAttachingToWebProcess):
3686         (WebKit::WebPageProxy::initializeWebPage):
3687         (WebKit::WebPageProxy::close):
3688         (WebKit::WebPageProxy::viewDidLeaveWindow):
3689         (WebKit::WebPageProxy::updateThrottleState):
3690         (WebKit::WebPageProxy::waitForDidUpdateActivityState):
3691         (WebKit::WebPageProxy::didCommitLoadForFrame):
3692         (WebKit::WebPageProxy::exitFullscreenImmediately):
3693         (WebKit::WebPageProxy::runJavaScriptAlert):
3694         (WebKit::WebPageProxy::runJavaScriptConfirm):
3695         (WebKit::WebPageProxy::runJavaScriptPrompt):
3696         (WebKit::WebPageProxy::pageDidScroll):
3697         (WebKit::WebPageProxy::processDidTerminate):
3698         (WebKit::WebPageProxy::resetState):
3699         (WebKit::WebPageProxy::resetStateAfterProcessExited):
3700         (WebKit::WebPageProxy::creationParameters):
3701         (WebKit::WebPageProxy::requestGeolocationPermissionForFrame):
3702         (WebKit::WebPageProxy::hasActiveVideoForControlsManager const):
3703         (WebKit::WebPageProxy::requestControlledElementID const):
3704         (WebKit::WebPageProxy::isPlayingVideoInEnhancedFullscreen const):
3705         * UIProcess/WebPageProxy.h:
3706         * UIProcess/WebPageProxy.messages.in:
3707         * UIProcess/WebPasteboardProxy.h:
3708         * UIProcess/WebPasteboardProxy.messages.in:
3709         * UIProcess/WebProcessPool.cpp:
3710         (WebKit::WebProcessPool::ensureNetworkProcess):
3711         (WebKit::WebProcessPool::initializeNewWebProcess):
3712         (WebKit::WebProcessPool::updateProcessAssertions):
3713         (WebKit::WebProcessPool::reinstateNetworkProcessAssertionState):
3714         * UIProcess/WebProcessPool.h:
3715         * UIProcess/WebProcessProxy.cpp:
3716         (WebKit::isMainThreadOrCheckDisabled):
3717         (WebKit::WebProcessProxy::didFinishLaunching):
3718         (WebKit::WebProcessProxy::didSetAssertionState):
3719         * UIProcess/WebProcessProxy.h:
3720         * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
3721         (WebKit::LocalStorageDatabaseTracker::databasePath const):
3722         * UIProcess/WebStorage/LocalStorageDatabaseTracker.h:
3723         * UIProcess/WebStorage/ios/LocalStorageDatabaseTrackerIOS.mm:
3724         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
3725         * UIProcess/_WKWebViewPrintFormatter.mm:
3726         * UIProcess/_WKWebViewPrintFormatterInternal.h:
3727         * UIProcess/ios/DragDropInteractionState.h:
3728         * UIProcess/ios/DragDropInteractionState.mm:
3729         * UIProcess/ios/InputViewUpdateDeferrer.h:
3730         * UIProcess/ios/InputViewUpdateDeferrer.mm:
3731         * UIProcess/ios/LayerRepresentation.mm:
3732         * UIProcess/ios/PageClientImplIOS.h:
3733         * UIProcess/ios/PageClientImplIOS.mm:
3734         * UIProcess/ios/ProcessAssertionIOS.mm:
3735         * UIProcess/ios/ResourceLoadStatisticsPersistentStorageIOS.mm:
3736         * UIProcess/ios/SmartMagnificationController.h:
3737         * UIProcess/ios/SmartMagnificationController.messages.in:
3738         * UIProcess/ios/SmartMagnificationController.mm:
3739         * UIProcess/ios/TextCheckerIOS.mm:
3740         * UIProcess/ios/ViewGestureControllerIOS.mm:
3741         * UIProcess/ios/WKActionSheet.h:
3742         * UIProcess/ios/WKActionSheet.mm:
3743         * UIProcess/ios/WKActionSheetAssistant.h:
3744         * UIProcess/ios/WKActionSheetAssistant.mm:
3745         * UIProcess/ios/WKApplicationStateTrackingView.h:
3746         * UIProcess/ios/WKApplicationStateTrackingView.mm:
3747         * UIProcess/ios/WKContentView.mm:
3748         * UIProcess/ios/WKContentViewInteraction.h:
3749         * UIProcess/ios/WKContentViewInteraction.mm:
3750         * UIProcess/ios/WKGeolocationProviderIOS.h:
3751         * UIProcess/ios/WKGeolocationProviderIOS.mm:
3752         * UIProcess/ios/WKGeolocationProviderIOSObjCSecurityOrigin.mm:
3753         * UIProcess/ios/WKInspectorNodeSearchGestureRecognizer.h:
3754         * UIProcess/ios/WKInspectorNodeSearchGestureRecognizer.mm:
3755         * UIProcess/ios/WKKeyboardScrollingAnimator.h:
3756         * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
3757         * UIProcess/ios/WKPDFPageNumberIndicator.h:
3758         * UIProcess/ios/WKPDFPageNumberIndicator.mm:
3759         * UIProcess/ios/WKPasswordView.h:
3760         * UIProcess/ios/WKPasswordView.mm:
3761         * UIProcess/ios/WKScrollView.h:
3762         * UIProcess/ios/WKScrollView.mm:
3763         * UIProcess/ios/WKSyntheticClickTapGestureRecognizer.h:
3764         * UIProcess/ios/WKSyntheticClickTapGestureRecognizer.m:
3765         * UIProcess/ios/WKWebEvent.h:
3766         * UIProcess/ios/WKWebEvent.mm:
3767         * UIProcess/ios/WebDataListSuggestionsDropdownIOS.h:
3768         * UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm:
3769         * UIProcess/ios/WebPageProxyIOS.mm:
3770         * UIProcess/ios/WebProcessProxyIOS.mm:
3771         * UIProcess/ios/forms/WKAirPlayRoutePicker.h:
3772         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
3773         * UIProcess/ios/forms/WKFileUploadPanel.h:
3774         * UIProcess/ios/forms/WKFileUploadPanel.mm:
3775         * UIProcess/ios/forms/WKFormColorControl.h:
3776         * UIProcess/ios/forms/WKFormColorControl.mm:
3777         * UIProcess/ios/forms/WKFormColorPicker.h:
3778         * UIProcess/ios/forms/WKFormColorPicker.mm:
3779         * UIProcess/ios/forms/WKFormInputControl.h:
3780         * UIProcess/ios/forms/WKFormInputControl.mm:
3781         * UIProcess/ios/forms/WKFormPopover.h:
3782         * UIProcess/ios/forms/WKFormPopover.mm:
3783         * UIProcess/ios/forms/WKFormSelectControl.h:
3784         * UIProcess/ios/forms/WKFormSelectControl.mm:
3785         * UIProcess/ios/forms/WKFormSelectPicker.h:
3786         * UIProcess/ios/forms/WKFormSelectPicker.mm:
3787         * UIProcess/ios/forms/WKFormSelectPopover.h:
3788         * UIProcess/ios/forms/WKFormSelectPopover.mm:
3789         * UIProcess/ios/fullscreen/FullscreenTouchSecheuristic.cpp:
3790         * UIProcess/ios/fullscreen/FullscreenTouchSecheuristic.h:
3791         * UIProcess/ios/fullscreen/WKFullScreenViewController.h:
3792         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
3793         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.h:
3794         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
3795         * UIProcess/ios/fullscreen/WKFullscreenStackView.h:
3796         * UIProcess/ios/fullscreen/WKFullscreenStackView.mm:
3797         * UIProcess/mac/LegacySessionStateCoding.cpp:
3798         (WebKit::encodeFrameStateNode):
3799         (WebKit::decodeBackForwardTreeNode):
3800         * UIProcess/mac/PageClientImplMac.h:
3801         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
3802         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
3803         * UIProcess/mac/ViewSnapshotStore.mm:
3804         * UIProcess/mac/WKFullScreenWindowController.mm:
3805         * WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm:
3806         (WebContentServiceInitializer):
3807         * WebProcess/FullScreen/WebFullScreenManager.cpp:
3808         (WebKit::WebFullScreenManager::videoControlsManagerDidChange):
3809         (WebKit::WebFullScreenManager::willEnterFullScreen):
3810         (WebKit::WebFullScreenManager::didEnterFullScreen):
3811         (WebKit::WebFullScreenManager::willExitFullScreen):
3812         * WebProcess/Geolocation/WebGeolocationManager.cpp:
3813         * WebProcess/Geolocation/WebGeolocationManager.h:
3814         * WebProcess/Geolocation/WebGeolocationManager.messages.in:
3815         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
3816         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
3817         * WebProcess/InjectedBundle/API/c/mac/WKBundlePageBannerMac.mm:
3818         * WebProcess/InjectedBundle/API/mac/WKDOMInternals.mm:
3819         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
3820         (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]):
3821         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
3822         (WebKit::toFrameState):
3823         (WebKit::applyFrameState):
3824         * WebProcess/WebCoreSupport/WebAlternativeTextClient.h:
3825         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3826         (WebKit::WebChromeClient::windowRect):
3827         (WebKit::WebChromeClient::enterVideoFullscreenForVideoElement):
3828         * WebProcess/WebCoreSupport/WebChromeClient.h:
3829         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
3830         * WebProcess/WebCoreSupport/WebEditorClient.h:
3831         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3832         (WebKit::WebFrameLoaderClient::dispatchDidLayout):
3833         (WebKit::WebFrameLoaderClient::saveViewStateToItem):
3834         (WebKit::WebFrameLoaderClient::restoreViewState):
3835         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
3836         (WebKit::WebFrameLoaderClient::objectContentType):
3837         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
3838         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
3839         (WebKit::WebInspectorClient::highlight):
3840         (WebKit::WebInspectorClient::hideHighlight):
3841         * WebProcess/WebCoreSupport/WebInspectorClient.h:
3842         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3843         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
3844         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
3845         * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
3846         * WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm:
3847         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
3848         * WebProcess/WebPage/DrawingArea.cpp:
3849         (WebKit::DrawingArea::create):
3850         * WebProcess/WebPage/DrawingArea.h:
3851         * WebProcess/WebPage/FindController.cpp:
3852         (WebKit::FindController::findString):
3853         * WebProcess/WebPage/FindController.h:
3854         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm:
3855         (WebKit::PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom):
3856         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
3857         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
3858         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
3859         (WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
3860         * WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
3861         (WebKit::ViewGestureGeometryCollector::dispatchDidCollectGeometryForSmartMagnificationGesture):
3862         (WebKit::ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture):
3863         (WebKit::ViewGestureGeometryCollector::mainFrameDidLayout):
3864         * WebProcess/WebPage/ViewGestureGeometryCollector.h:
3865         * WebProcess/WebPage/ViewGestureGeometryCollector.messages.in:
3866         * WebProcess/WebPage/ViewUpdateDispatcher.cpp:
3867         * WebProcess/WebPage/WKAccessibilityWebPageObjectIOS.h:
3868         * WebProcess/WebPage/WKAccessibilityWebPageObjectIOS.mm:
3869         * WebProcess/WebPage/WebFrame.h:
3870         * WebProcess/WebPage/WebOpenPanelResultListener.cpp:
3871         * WebProcess/WebPage/WebOpenPanelResultListener.h:
3872         * WebProcess/WebPage/WebPage.cpp:
3873         (WebKit::m_cpuLimit):
3874         (WebKit::WebPage::~WebPage):
3875         (WebKit::WebPage::scalePage):
3876         (WebKit::WebPage::setUseFixedLayout):
3877         (WebKit::WebPage::disabledAdaptationsDidChange):
3878         (WebKit::WebPage::viewportPropertiesDidChange):
3879         (WebKit::WebPage::pageDidScroll):
3880         (WebKit::WebPage::mouseEvent):
3881         (WebKit::WebPage::updatePreferences):
3882         (WebKit::WebPage::willCommitLayerTree):
3883         (WebKit::WebPage::didFlushLayerTreeAtTime):
3884         (WebKit::WebPage::mainFrameDidLayout):
3885         (WebKit::WebPage::resetAssistedNodeForFrame):
3886         (WebKit::WebPage::elementDidFocus):
3887         (WebKit::WebPage::elementDidBlur):
3888         (WebKit::WebPage::willReplaceMultipartContent):
3889         (WebKit::WebPage::didReplaceMultipartContent):
3890         (WebKit::WebPage::didCommitLoad):
3891         * WebProcess/WebPage/WebPage.h:
3892         * WebProcess/WebPage/WebPage.messages.in:
3893         * WebProcess/WebPage/ios/FindControllerIOS.mm:
3894         * WebProcess/WebPage/ios/WebPageIOS.mm:
3895         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
3896         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3897         (WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
3898         * WebProcess/WebPage/mac/WebPageMac.mm:
3899         * WebProcess/WebProcess.cpp:
3900         (WebKit::WebProcess::WebProcess):
3901         (WebKit::WebProcess::initializeConnection):
3902         (WebKit::WebProcess::initializeWebProcess):
3903         (WebKit::WebProcess::actualPrepareToSuspend):
3904         (WebKit::WebProcess::cancelPrepareToSuspend):
3905         (WebKit::WebProcess::processDidResume):
3906         * WebProcess/WebProcess.h:
3907         * WebProcess/cocoa/PlaybackSessionManager.h:
3908         * WebProcess/cocoa/PlaybackSessionManager.messages.in:
3909         * WebProcess/cocoa/PlaybackSessionManager.mm:
3910         * WebProcess/cocoa/VideoFullscreenManager.h:
3911         * WebProcess/cocoa/VideoFullscreenManager.messages.in:
3912         * WebProcess/cocoa/VideoFullscreenManager.mm:
3913         (WebKit::VideoFullscreenManager::supportsVideoFullscreen const):
3914         (WebKit::VideoFullscreenManager::supportsVideoFullscreenStandby const):
3915         (WebKit::VideoFullscreenManager::didSetupFullscreen):
3916         (WebKit::VideoFullscreenManager::didExitFullscreen):
3917         * WebProcess/cocoa/WebProcessCocoa.mm:
3918         (WebKit::WebProcess::platformInitializeWebProcess):
3919         (WebKit::WebProcess::initializeProcessName):
3920         (WebKit::registerWithAccessibility):
3921         (WebKit::WebProcess::sourceApplicationAuditData const):
3922         (WebKit::WebProcess::initializeSandbox):
3923         * WebProcess/mac/SecItemShimLibrary.mm:
3924         * config.h:
3925
3926 2018-10-18  Alex Christensen  <achristensen@webkit.org>
3927
3928         Clean up FrameLoader two-state enums
3929         https://bugs.webkit.org/show_bug.cgi?id=190731
3930
3931         Reviewed by Chris Dumez.
3932
3933         * NetworkProcess/NetworkProcess.h:
3934         * NetworkProcess/NetworkProcess.messages.in:
3935         * Shared/WebCoreArgumentCoders.h:
3936         * UIProcess/WebPageProxy.cpp:
3937         (WebKit::WebPageProxy::willPerformClientRedirectForFrame):
3938         * UIProcess/WebPageProxy.h:
3939         * UIProcess/WebPageProxy.messages.in:
3940         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3941         (WebKit::WebFrameLoaderClient::dispatchWillPerformClientRedirect):
3942         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
3943
3944 2018-10-18  Youenn Fablet  <youenn@apple.com>
3945
3946         Handle MDNS resolution of candidates through libwebrtc directly
3947         https://bugs.webkit.org/show_bug.cgi?id=190681
3948
3949         Reviewed by Eric Carlson.
3950
3951         Add support for AsyncResolver to resolve MDNS.
3952         This basically reuse the code path used to resolve STUN server addresses.
3953         Removed MDNS specific resolution.
3954         Use existing CFHost resolution mechanism to do the actual resolution.
3955
3956         * NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
3957         (WebKit::NetworkMDNSRegister::registerMDNSName):
3958         * NetworkProcess/webrtc/NetworkMDNSRegister.messages.in:
3959         * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
3960         (WebKit::LibWebRTCProvider::createPeerConnection):
3961         * WebProcess/Network/webrtc/LibWebRTCProvider.h:
3962         * WebProcess/Network/webrtc/LibWebRTCSocketFactory.h:
3963         * WebProcess/Network/webrtc/WebMDNSRegister.cpp:
3964         * WebProcess/Network/webrtc/WebMDNSRegister.h:
3965         * WebProcess/Network/webrtc/WebMDNSRegister.messages.in:
3966
3967 2018-10-18  Chris Dumez  <cdumez@apple.com>
3968
3969         [PSON] Cap number of SuspendedPageProxy objects and allow a WebPageProxy to have more than one
3970         https://bugs.webkit.org/show_bug.cgi?id=190688
3971         <rdar://problem/45354095>
3972
3973         Reviewed by Antti Koivisto.
3974
3975         Cap number of SuspendedPageProxy objects to 3 to avoid accumulating too many "suspended" processes.
3976
3977         Also allow a WebPageProxy to have more than one SuspendedPageProxy so that PageCache now works for
3978         more than 1 history navigation (up to 3 with the suspended page limit in this patch).
3979
3980         The following cleanup / refactoring was made to support this:
3981         - The SuspendedPageProxy objects are now owned by the WebProcessPool instead of the WebPageProxy.
3982           The WebProcessPool is in charge of limiting the number of SuspendedPageProxy objects by dropping
3983           the oldest one whenever a WebPageProxy tries to add a new one and we've already reached the limit.
3984         - WebProcessProxy no longer needs to know anything about suspended pages, which simplifies the
3985           code quite a bit. Instead, the SuspendedPageProxy objects now register themselves as
3986           IPC::MessageReceivers with their WebProcessProxy. The SuspendedPageProxy also take care of
3987           calling maybeShutdown() on their WebProcessProxy when they get destroyed.
3988
3989         * UIProcess/SuspendedPageProxy.cpp:
3990         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
3991         (WebKit::SuspendedPageProxy::tearDownDrawingAreaInWebProcess):
3992         (WebKit::SuspendedPageProxy::unsuspend):
3993         (WebKit::SuspendedPageProxy::didFinishLoad):
3994         (WebKit::SuspendedPageProxy::didReceiveSyncMessage):
3995         * UIProcess/SuspendedPageProxy.h:
3996         * UIProcess/WebPageProxy.cpp:
3997         (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
3998         (WebKit::WebPageProxy::swapToWebProcess):
3999         (WebKit::WebPageProxy::close):
4000         (WebKit::WebPageProxy::continueNavigationInNewProcess):
4001         (WebKit::WebPageProxy::didCompletePageTransition):
4002         (WebKit::WebPageProxy::enterAcceleratedCompositingMode):
4003         * UIProcess/WebPageProxy.h:
4004         * UIProcess/WebProcessPool.cpp:
4005         (WebKit::WebProcessPool::disconnectProcess):
4006         (WebKit::WebProcessPool::processForNavigationInternal):
4007         (WebKit::WebProcessPool::addSuspendedPageProxy):
4008         (WebKit::WebProcessPool::removeAllSuspendedPageProxiesForPage):
4009         (WebKit::WebProcessPool::takeSuspendedPageProxy):
4010         (WebKit::WebProcessPool::hasSuspendedPageProxyFor):
4011         * UIProcess/WebProcessPool.h:
4012         * UIProcess/WebProcessProxy.cpp: