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