c813612d50edff8f23239c0474b923a720666348
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-12-20  Keith Rollin  <krollin@apple.com>
2
3         Improve release-level page-load logging
4         https://bugs.webkit.org/show_bug.cgi?id=192872
5         <rdar://problem/46850309>
6
7         Reviewed by Chris Dumez.
8
9         There are a number of reported bugs that are difficult or impossible
10         to track down with our current level of logging. Additionally, some
11         software groups lower in the page-loading stack have requested logging
12         sufficient for tracking a user-visible error message down to the
13         requested resource that caused the message. Add more-comprehensive
14         logging to address these issues/requests.
15
16         * UIProcess/WebPageProxy.cpp:
17         (WebKit::m_editableImageController):
18         (WebKit::WebPageProxy::~WebPageProxy):
19         (WebKit::WebPageProxy::reattachToWebProcess):
20         (WebKit::WebPageProxy::swapToWebProcess):
21         (WebKit::WebPageProxy::reattachToWebProcessForReload):
22         (WebKit::WebPageProxy::reattachToWebProcessWithItem):
23         (WebKit::WebPageProxy::close):
24         (WebKit::WebPageProxy::tryClose):
25         (WebKit::WebPageProxy::loadRequest):
26         (WebKit::WebPageProxy::loadRequestWithNavigation):
27         (WebKit::WebPageProxy::loadFile):
28         (WebKit::WebPageProxy::loadData):
29         (WebKit::WebPageProxy::loadDataWithNavigation):
30         (WebKit::WebPageProxy::loadAlternateHTML):
31         (WebKit::WebPageProxy::loadWebArchiveData):
32         (WebKit::WebPageProxy::navigateToPDFLinkWithSimulatedClick):
33         (WebKit::WebPageProxy::stopLoading):
34         (WebKit::WebPageProxy::reload):
35         (WebKit::WebPageProxy::goToBackForwardItem):
36         (WebKit::WebPageProxy::tryRestoreScrollPosition):
37         (WebKit::WebPageProxy::updateThrottleState):
38         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
39         (WebKit::WebPageProxy::continueNavigationInNewProcess):
40         (WebKit::WebPageProxy::restoreFromSessionState):
41         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
42         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
43         (WebKit::WebPageProxy::willPerformClientRedirectForFrame):
44         (WebKit::WebPageProxy::didCancelClientRedirectForFrame):
45         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
46         (WebKit::WebPageProxy::didCommitLoadForFrame):
47         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
48         (WebKit::WebPageProxy::didFinishLoadForFrame):
49         (WebKit::WebPageProxy::didFailLoadForFrame):
50         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
51         (WebKit::WebPageProxy::didNavigateWithNavigationData):
52         (WebKit::WebPageProxy::didPerformClientRedirect):
53         (WebKit::WebPageProxy::didPerformServerRedirect):
54         (WebKit::WebPageProxy::processDidBecomeUnresponsive):
55         (WebKit::WebPageProxy::processDidBecomeResponsive):
56         (WebKit::WebPageProxy::processDidTerminate):
57         (WebKit::WebPageProxy::dispatchProcessDidTerminate):
58         (WebKit::WebPageProxy::tryReloadAfterProcessTermination):
59         (WebKit::WebPageProxy::didExceedInactiveMemoryLimitWhileActive):
60         (WebKit::WebPageProxy::didExceedBackgroundCPULimitWhileInForeground):
61         * WebProcess/Network/WebLoaderStrategy.cpp:
62         (WebKit::WebLoaderStrategy::scheduleLoad):
63         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
64         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
65         * WebProcess/Network/WebResourceLoader.cpp:
66         (WebKit::WebResourceLoader::willSendRequest):
67         (WebKit::WebResourceLoader::didReceiveResponse):
68         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
69         (WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad):
70         (WebKit::WebFrameLoaderClient::dispatchDidFailLoad):
71
72 2018-12-20  Wenson Hsieh  <wenson_hsieh@apple.com>
73
74         [iOS] Replace "node assistance" terminology in WebKit with "focused element"
75         https://bugs.webkit.org/show_bug.cgi?id=192936
76
77         Reviewed by Tim Horton.
78
79         Renames a few methods and data structures in WebKit, to refer to "focused elements" rather than "assisted nodes";
80         see below for more details. No new tests, because there should be no change in behavior.
81
82         * Shared/FocusedElementInformation.cpp: Renamed from Source/WebKit/Shared/AssistedNodeInformation.cpp.
83         (WebKit::OptionItem::encode const):
84         (WebKit::OptionItem::decode):
85         (WebKit::FocusedElementInformation::encode const):
86         (WebKit::FocusedElementInformation::decode):
87         * Shared/FocusedElementInformation.h: Renamed from Source/WebKit/Shared/AssistedNodeInformation.h.
88
89         Rename AssistedNodeInformation to FocusedElementInformation. Additionally, introduce a named type for the
90         focusedElementIdentifier (which is currently just a `uint64_t`).
91
92         (WebKit::OptionItem::OptionItem):
93         * Shared/ios/InteractionInformationAtPosition.h:
94         * Shared/ios/InteractionInformationAtPosition.mm:
95         (WebKit::InteractionInformationAtPosition::encode const):
96         (WebKit::InteractionInformationAtPosition::decode):
97         * SourcesCocoa.txt:
98         * UIProcess/API/Cocoa/WKWebView.mm:
99         (-[WKWebView _shouldUpdateKeyboardWithInfo:]):
100         * UIProcess/PageClient.h:
101         * UIProcess/WebPageProxy.cpp:
102         (WebKit::WebPageProxy::resetStateAfterProcessExited):
103         * UIProcess/WebPageProxy.h:
104
105         Rename NodeAssistanceArguments to ElementDidFocusArguments (and also add a FIXME for removing this mechanism
106         eventually).
107
108         (WebKit::WebPageProxy::focusNextFocusedElement):
109         (WebKit::WebPageProxy::focusNextAssistedNode): Deleted.
110         * UIProcess/WebPageProxy.messages.in:
111
112         Rename StartAssistingNode to ElementDidFocus, and StopAssistingNode to ElementDidBlur.
113
114         * UIProcess/ios/PageClientImplIOS.h:
115         * UIProcess/ios/PageClientImplIOS.mm:
116         (WebKit::PageClientImpl::elementDidFocus):
117         (WebKit::PageClientImpl::isFocusingElement):
118         (WebKit::PageClientImpl::elementDidBlur):
119         (WebKit::PageClientImpl::startAssistingNode): Deleted.
120         (WebKit::PageClientImpl::isAssistingNode): Deleted.
121         (WebKit::PageClientImpl::stopAssistingNode): Deleted.
122         * UIProcess/ios/WKContentView.h:
123         * UIProcess/ios/WKContentView.mm:
124         (-[WKContentView isFocusingElement]):
125         (-[WKContentView _didCommitLoadForMainFrame]):
126         (-[WKContentView isAssistingNode]): Deleted.
127         * UIProcess/ios/WKContentViewInteraction.h:
128         * UIProcess/ios/WKContentViewInteraction.mm:
129         (-[WKFocusedElementInfo initWithFocusedElementInformation:isUserInitiated:userObject:]):
130         (hasFocusedElement):
131         (-[WKContentView cleanupInteraction]):
132         (-[WKContentView shouldHideSelectionWhenScrolling]):
133         (-[WKContentView resignFirstResponderForWebView]):
134         (-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:]):
135         (-[WKContentView _requiresKeyboardWhenFirstResponder]):
136         (-[WKContentView _zoomToRevealFocusedElement]):
137         (-[WKContentView inputView]):
138         (-[WKContentView _selectionClipRect]):
139         (-[WKContentView gestureRecognizerShouldBegin:]):
140         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
141         (-[WKContentView clearSelection]):
142         (-[WKContentView requiresAccessoryView]):
143         (-[WKContentView canPerformActionForWebView:withSender:]):
144         (-[WKContentView _isInteractingWithFocusedElement]):
145         (-[WKContentView changeSelectionWithGestureAt:withGesture:withState:withFlags:]):
146         (-[WKContentView selectPositionAtPoint:completionHandler:]):
147         (-[WKContentView selectPositionAtBoundary:inDirection:fromPoint:completionHandler:]):
148         (-[WKContentView selectTextWithGranularity:atPoint:completionHandler:]):
149         (-[WKContentView updateSelectionWithExtentPoint:completionHandler:]):
150         (-[WKContentView updateSelectionWithExtentPoint:withBoundary:completionHandler:]):
151         (-[WKContentView accessoryTab:]):
152         (-[WKContentView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]):
153         (-[WKContentView accessoryClear]):
154         (-[WKContentView _updateAccessory]):
155         (-[WKContentView insertTextSuggestion:]):
156         (-[WKContentView setSelectedTextRange:]):
157         (-[WKContentView textInputTraits]):
158         (-[WKContentView isScrollableForKeyboardScrollViewAnimator:]):
159         (-[WKContentView focusedElementInformation]):
160         (-[WKContentView focusedSelectElementOptions]):
161         (rectToRevealWhenZoomingToFocusedElement):
162         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
163         (-[WKContentView _elementDidBlur]):
164         (-[WKContentView _didReceiveEditorStateUpdateAfterFocus]):
165         (-[WKContentView updateCurrentFocusedElementInformation:]):
166         (-[WKContentView presentViewControllerForCurrentFocusedElement]):
167         (-[WKContentView focusedFormControlViewDidSubmit:]):
168         (-[WKContentView focusedFormControlViewDidCancel:]):
169         (-[WKContentView focusedFormControlViewDidBeginEditing:]):
170         (-[WKContentView rectForFocusedFormControlView:]):
171         (-[WKContentView nextRectForFocusedFormControlView:]):
172         (-[WKContentView previousRectForFocusedFormControlView:]):
173         (-[WKContentView actionNameForFocusedFormControlView:]):
174         (-[WKContentView focusedFormControlViewDidRequestNextNode:]):
175         (-[WKContentView focusedFormControlViewDidRequestPreviousNode:]):
176         (-[WKContentView hasNextNodeForFocusedFormControlView:]):
177         (-[WKContentView hasPreviousNodeForFocusedFormControlView:]):
178         (-[WKContentView selectMenu:didSelectItemAtIndex:]):
179         (-[WKContentView numberOfItemsInSelectMenu:]):
180         (-[WKContentView selectMenu:displayTextForItemAtIndex:]):
181         (-[WKContentView selectMenu:didCheckItemAtIndex:checked:]):
182         (-[WKContentView selectMenuUsesMultipleSelection:]):
183         (-[WKContentView selectMenu:hasSelectedOptionAtIndex:]):
184         (-[WKContentView _updateChangedSelection:]):
185         (-[WKContentView _autofillContext]):
186         (-[WKContentView dismissQuickboardViewControllerAndRevealFocusedFormOverlayIfNecessary:]):
187         (-[WKContentView allowsLanguageSelectionMenuForListViewController:]):
188         (-[WKContentView inputLabelTextForViewController:]):
189         (-[WKContentView initialValueForViewController:]):
190         (-[WKContentView shouldDisplayInputContextViewForListViewController:]):
191         (-[WKContentView numericInputModeForListViewController:]):
192         (-[WKContentView textContentTypeForListViewController:]):
193         (-[WKContentView allowsDictationInputForListViewController:]):
194         (-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:userObject:]): Deleted.
195         (hasAssistedNode): Deleted.
196
197         Replaced with hasFocusedElement.
198
199         (-[WKContentView _isInteractingWithAssistedNode]): Deleted.
200         (-[WKContentView assistedNodeInformation]): Deleted.
201         (-[WKContentView assistedNodeSelectOptions]): Deleted.
202         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]): Deleted.
203         (-[WKContentView _stopAssistingNode]): Deleted.
204         (-[WKContentView updateCurrentAssistedNodeInformation:]): Deleted.
205         (-[WKContentView presentViewControllerForCurrentAssistedNode]): Deleted.
206         * UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm:
207         (-[WKDataListSuggestionsControl textAlignment]):
208         * UIProcess/ios/WebPageProxyIOS.mm:
209         (WebKit::WebPageProxy::focusedElementInformationCallback):
210         (WebKit::WebPageProxy::requestFocusedElementInformation):
211         (WebKit::WebPageProxy::computeCustomFixedPositionRect const):
212         (WebKit::WebPageProxy::didCommitLayerTree):
213         (WebKit::WebPageProxy::selectWithGesture):
214         (WebKit::WebPageProxy::selectTextWithGranularityAtPoint):
215         (WebKit::WebPageProxy::selectPositionAtBoundaryWithDirection):
216         (WebKit::WebPageProxy::selectPositionAtPoint):
217         (WebKit::WebPageProxy::updateSelectionWithExtentPoint):
218         (WebKit::WebPageProxy::updateSelectionWithExtentPointAndBoundary):
219         (WebKit::WebPageProxy::blurFocusedElement):
220         (WebKit::WebPageProxy::elementDidFocus):
221         (WebKit::WebPageProxy::elementDidBlur):
222         (WebKit::WebPageProxy::focusNextFocusedElement):
223         (WebKit::WebPageProxy::setFocusedElementValue):
224         (WebKit::WebPageProxy::setFocusedElementValueAsNumber):
225         (WebKit::WebPageProxy::setFocusedElementSelectedIndex):
226         (WebKit::WebPageProxy::assistedNodeInformationCallback): Deleted.
227         (WebKit::WebPageProxy::requestAssistedNodeInformation): Deleted.
228         (WebKit::WebPageProxy::blurAssistedNode): Deleted.
229         (WebKit::WebPageProxy::startAssistingNode): Deleted.
230         (WebKit::WebPageProxy::stopAssistingNode): Deleted.
231         (WebKit::WebPageProxy::focusNextAssistedNode): Deleted.
232         (WebKit::WebPageProxy::setAssistedNodeValue): Deleted.
233         (WebKit::WebPageProxy::setAssistedNodeValueAsNumber): Deleted.
234         (WebKit::WebPageProxy::setAssistedNodeSelectedIndex): Deleted.
235         * UIProcess/ios/forms/WKFormColorPicker.mm:
236         (-[WKColorPicker initWithView:]):
237         (-[WKColorPicker setControlValueFromUIColor:]):
238         * UIProcess/ios/forms/WKFormInputControl.mm:
239         (-[WKDateTimePicker initWithView:datePickerMode:]):
240         (-[WKDateTimePicker shouldPresentGregorianCalendar:]):
241         (-[WKDateTimePicker _dateChangedSetAsNumber]):
242         (-[WKDateTimePicker _dateChangedSetAsString]):
243         (-[WKDateTimePicker controlBeginEditing]):
244         (-[WKFormInputControl initWithView:]):
245         (-[WKDateTimePopover clear:]):
246         (-[WKDateTimePopover initWithView:datePickerMode:]):
247         * UIProcess/ios/forms/WKFormPopover.mm:
248         (-[WKRotatingPopover presentPopoverAnimated:]):
249         * UIProcess/ios/forms/WKFormSelectControl.h:
250         * UIProcess/ios/forms/WKFormSelectControl.mm:
251         (-[WKFormSelectControl initWithView:]):
252         * UIProcess/ios/forms/WKFormSelectPicker.mm:
253         (-[WKMultipleSelectPicker initWithView:]):
254         (-[WKMultipleSelectPicker pickerView:viewForRow:forComponent:reusingView:]):
255         (-[WKMultipleSelectPicker pickerView:numberOfRowsInComponent:]):
256         (-[WKMultipleSelectPicker findItemIndexAt:]):
257         (-[WKMultipleSelectPicker pickerView:row:column:checked:]):
258         (-[WKSelectSinglePicker initWithView:]):
259         (-[WKSelectSinglePicker controlEndEditing]):
260         (-[WKSelectSinglePicker pickerView:numberOfRowsInComponent:]):
261         (-[WKSelectSinglePicker pickerView:attributedTitleForRow:forComponent:]):
262         (-[WKSelectSinglePicker pickerView:didSelectRow:inComponent:]):
263         * UIProcess/ios/forms/WKFormSelectPopover.mm:
264         (-[WKSelectTableViewController initWithView:hasGroups:]):
265         (-[WKSelectTableViewController tableView:numberOfRowsInSection:]):
266         (-[WKSelectTableViewController tableView:titleForHeaderInSection:]):
267         (-[WKSelectTableViewController findItemIndexAt:]):
268         (-[WKSelectTableViewController findItemAt:]):
269         (-[WKSelectTableViewController tableView:cellForRowAtIndexPath:]):
270         (-[WKSelectTableViewController tableView:didSelectRowAtIndexPath:]):
271         (-[WKSelectPopover initWithView:hasGroups:]):
272         * WebKit.xcodeproj/project.pbxproj:
273         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
274         (WebKit::WebChromeClient::elementDidFocus):
275         (WebKit::WebChromeClient::elementDidRefocus):
276         (WebKit::WebChromeClient::elementDidBlur):
277         * WebProcess/WebPage/WebPage.cpp:
278         (WebKit::WebPage::didStartPageTransition):
279         (WebKit::WebPage::setTextAsync):
280         (WebKit::WebPage::resetFocusedElementForFrame):
281         (WebKit::WebPage::elementDidRefocus):
282         (WebKit::WebPage::elementDidFocus):
283         (WebKit::WebPage::elementDidBlur):
284         (WebKit::WebPage::didCommitLoad):
285         (WebKit::WebPage::resetAssistedNodeForFrame): Deleted.
286         * WebProcess/WebPage/WebPage.h:
287
288         Refactor elementDid{Refocus|Focus|Blur} to take `Element&` rather than `Node*`.
289
290         * WebProcess/WebPage/WebPage.messages.in:
291         * WebProcess/WebPage/ios/WebPageIOS.mm:
292
293         Replace m_assistedNode (a `RefPtr<Node>`) with m_focusedElement (a `RefPtr<Element>`).
294
295         (WebKit::WebPage::platformEditorState const):
296         (WebKit::WebPage::completeSyntheticClick):
297         (WebKit::WebPage::requestFocusedElementInformation):
298         (WebKit::WebPage::blurFocusedElement):
299         (WebKit::WebPage::setFocusedElementValue):
300         (WebKit::WebPage::setFocusedElementValueAsNumber):
301         (WebKit::WebPage::setFocusedElementSelectedIndex):
302         (WebKit::innerFrameQuad):
303         (WebKit::constrainPoint):
304         (WebKit::WebPage::selectWithGesture):
305         (WebKit::WebPage::startAutoscrollAtPosition):
306         (WebKit::WebPage::visiblePositionInFocusedNodeForPoint):
307         (WebKit::WebPage::selectPositionAtPoint):
308         (WebKit::WebPage::selectPositionAtBoundaryWithDirection):
309         (WebKit::WebPage::rangeForGranularityAtPoint):
310         (WebKit::WebPage::selectTextWithGranularityAtPoint):
311         (WebKit::WebPage::updateSelectionWithExtentPointAndBoundary):
312         (WebKit::WebPage::updateSelectionWithExtentPoint):
313         (WebKit::WebPage::getPositionInformation):
314         (WebKit::WebPage::focusNextFocusedElement):
315         (WebKit::WebPage::getFocusedElementInformation):
316         (WebKit::WebPage::autofillLoginCredentials):
317         (WebKit::WebPage::requestAssistedNodeInformation): Deleted.
318         (WebKit::WebPage::blurAssistedNode): Deleted.
319         (WebKit::WebPage::setAssistedNodeValue): Deleted.
320         (WebKit::WebPage::setAssistedNodeValueAsNumber): Deleted.
321         (WebKit::WebPage::setAssistedNodeSelectedIndex): Deleted.
322         (WebKit::WebPage::focusNextAssistedNode): Deleted.
323         (WebKit::WebPage::getAssistedNodeInformation): Deleted.
324
325 2018-12-20  Brent Fulgham  <bfulgham@apple.com>
326
327         WKWebView default UA doesn't freeze the build number
328         https://bugs.webkit.org/show_bug.cgi?id=192809
329         <rdar://problem/44687185>
330
331         Reviewed by Andy Estes.
332
333         Always reports the frozen build number.
334
335         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
336         (defaultApplicationNameForUserAgent): Do not expose the actual build number through this API.
337
338 2018-12-20  Jer Noble  <jer.noble@apple.com>
339
340         Enable MediaCapabilities by default.
341         https://bugs.webkit.org/show_bug.cgi?id=192340
342         <rdar://problem/46435149>
343
344         Reviewed by Dean Jackson.
345
346         * Shared/WebPreferences.yaml:
347
348 2018-12-20  Carlos Garcia Campos  <cgarcia@igalia.com>
349
350         [GTK] WebDriver: tests in imported/w3c/webdriver/tests/element_clear/user_prompts.py are failing
351         https://bugs.webkit.org/show_bug.cgi?id=192927
352
353         Reviewed by Michael Catanzaro.
354
355         Give the focus back to the web view when a dialog is dismissed.
356
357         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
358         (webkitWebViewBaseContainerRemove):
359
360 2018-12-20  Tim Horton  <timothy_horton@apple.com>
361
362         Unparented WKWebView can't retrieve main resource data for a main frame plugin
363         https://bugs.webkit.org/show_bug.cgi?id=192923
364         <rdar://problem/46859068>
365
366         Reviewed by Wenson Hsieh.
367
368         * WebProcess/Plugins/PluginView.cpp:
369         (WebKit::PluginView::liveResourceData const):
370         If the WKWebView is unparented, we may not immediately initialize the plugin.
371         In that case, PluginView holds on to the backing data until the plugin
372         is initialized. If a WKWebView API client asks for the backing data
373         for the plugin during this time, we should return it, instead of bailing.
374
375 2018-12-20  Wenson Hsieh  <wenson_hsieh@apple.com>
376
377         [iOS] Focusing an editable element should scroll to reveal the selection
378         https://bugs.webkit.org/show_bug.cgi?id=192802
379         <rdar://problem/46781759>
380
381         Reviewed by Tim Horton.
382
383         Currently, when tapping on an editable element, logic in -[WKWebView _zoomToFocusRect:…:] attempts to adjust the
384         visible viewport such that the rect containing the selection is visible. However, AssistedNodeInformation's
385         selectionRect is used here, which (as the FIXME in WebPage::getAssistedNodeInformation notes) is either the last
386         touch location, or the top left of the element if the touch location is outside of the element's bounding rect.
387         This leads to confusing and undesirable behavior when tapping near the bottom of a large contenteditable element
388         to focus it, since the actual selection will end up near the top of the element, yet we'll try to scroll to
389         reveal the bottom of the element, which causes the visible selection to scroll offscreen. Notably, this affects
390         scenarios involving editable web views embedded in apps, such as Mail compose.
391
392         Right now, we use the last touch location as an approximation for the selection rect because the selection may
393         have not yet been updated at the moment when focus moves into an editable element. To fix this, we defer the
394         process of zooming to the focused element rect until after the selection changes and the UI process is updated
395         with information about the new selection rects.
396
397         Test: editing/selection/ios/selection-is-visible-after-focusing-editable-area.html
398
399         * Shared/AssistedNodeInformation.cpp:
400         (WebKit::AssistedNodeInformation::encode const):
401         (WebKit::AssistedNodeInformation::decode):
402         * Shared/AssistedNodeInformation.h:
403
404         Rename selectionRect to elementInteractionLocation, to more accurately reflect its value and purpose. This isn't
405         strictly always the last touch location, since we may default to the focused element location instead if the
406         last touch location is outside of the element rect.
407
408         * UIProcess/API/Cocoa/WKWebView.mm:
409         (-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
410
411         Tweak a constant that determines the minimum amount of margin to leave between the selection rect and the edge
412         of the window when scrolling to reveal the focused element. Previously, this was larger than necessary to
413         accomodate for the fact that the "selection rect" used when zooming to the focused element did not take the
414         actual selection into account at all, and was simply a 1 by 1 rect; this meant that the margin needed to be
415         large enough to exceed the usual height of a text caret in editable content. Since we now use the real selection
416         rect, we can be much less generous with this margin.
417
418         * UIProcess/ios/WKContentViewInteraction.h:
419         * UIProcess/ios/WKContentViewInteraction.mm:
420         (-[WKContentView cleanupInteraction]):
421         (-[WKContentView observeValueForKeyPath:ofObject:change:context:]):
422
423         Don't additionally update the selection in the middle of triggering zooming to the focused element; on
424         particular versions of iOS, this now attempts to scroll the selection rect on-screen, which then conflicts with
425         zooming to reveal the focused element.
426
427         (-[WKContentView _zoomToRevealFocusedElement]):
428
429         Renamed from _displayFormNodeInputView to _zoomToRevealFocusedElement, to make the purpose of this function more
430         clear. Additionally, pull logic to update the accessory view out of this method, so that it's strictly concerned
431         with zooming to the focused element.
432
433         (-[WKContentView inputView]):
434
435         Add a FIXME describing the implications of zooming to the focused element in the implementation of -inputView.
436         See also: <https://bugs.webkit.org/show_bug.cgi?id=192878>.
437
438         (-[WKContentView accessoryTab:]):
439
440         Fix a subtle issue when keeping track of _didAccessoryTabInitiateFocus. Currently, this is set to YES in
441         -accessoryTab: and unset in _displayFormNodeInputView, but since _displayFormNodeInputView may be invoked
442         multiple times for the same focused element (see: -inputView), we might end up zooming to the focused element
443         with _didAccessoryTabInitiateFocus set to NO, even though we initiated focus with the previous/next buttons.
444
445         Instead, temporarily set a different ivar, _isChangingFocusUsingAccessoryTab, to YES in -accessoryTab:, and
446         unset it in the completion handler after the focused element has changed. Then, when we _startAssistingNode:,
447         set _didAccessoryTabInitiateFocus to _isChangingFocusUsingAccessoryTab. This ensures that the correctness of
448         _didAccessoryTabInitiateFocus isn't tied to the number of times -[WKContentView inputView] is invoked when
449         focusing an element.
450
451         (shouldZoomToRevealSelectionRect):
452         (rectToRevealWhenZoomingToFocusedElement):
453
454         Add a helper method to determine the selection rect to use when zooming to reveal the focused element. ASSERTs
455         that we have post-layout data in the EditorState.
456
457         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
458
459         When "assisting" a focused element, immediately zoom to it if we don't need selection information to compute the
460         rect to zoom to; otherwise, defer zooming until we receive the first editor state update in the UI process that
461         contains information about our selection rects.
462
463         (-[WKContentView _stopAssistingNode]):
464         (-[WKContentView _didReceiveEditorStateUpdateAfterFocus]):
465
466         If necessary, reveal the focused element by zooming.
467
468         (-[WKContentView _updateInitialWritingDirectionIfNecessary]):
469
470         Pull this initial writing direction update logic out into a separate helper method.
471
472         (-[WKContentView _displayFormNodeInputView]): Deleted.
473
474         Replaced by _zoomToRevealFocusedElement.
475
476         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
477         (WebKit::WebChromeClient::elementDidRefocus):
478
479         This currently calls WebChromeClient::elementDidFocus; instead, call the new WebPage::elementDidRefocus;
480         additionally, make this available on all PLATFORM(COCOA), rather than just IOS_FAMILY.
481
482         * WebProcess/WebCoreSupport/WebChromeClient.h:
483         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
484         (WebKit::WebChromeClient::elementDidRefocus): Deleted.
485
486         Replaced by the PLATFORM(COCOA) version.
487
488         * WebProcess/WebPage/WebPage.cpp:
489         (WebKit::WebPage::elementDidRefocus):
490
491         When refocusing an element, ensure that post-layout editor state data is sent to the UI process by including a
492         full EditorState in the next layer tree transaction.
493
494         * WebProcess/WebPage/WebPage.h:
495         * WebProcess/WebPage/ios/WebPageIOS.mm:
496         (WebKit::WebPage::completeSyntheticClick):
497
498         Call elementDidRefocus instead of elementDidFocus, in the case where the existing focused element is clicked.
499
500         (WebKit::WebPage::getAssistedNodeInformation):
501
502         Adjust for the change from selectionRect to elementInteractionLocation.
503
504 2018-12-20  Patrick Griffis  <pgriffis@igalia.com>
505
506         [GTK][WPE] Grant the sandbox read access to XDG_DATA_HOME/prgname
507         https://bugs.webkit.org/show_bug.cgi?id=192929
508
509         Reviewed by Michael Catanzaro.
510
511         * UIProcess/API/glib/WebKitWebContext.cpp:
512         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
513         (WebKit::bubblewrapSpawn):
514
515 2018-12-20  Chris Dumez  <cdumez@apple.com>
516
517         [PSON] SuspendedPageProxy fails to release its process assertion if the WebPage fails to enter PageCache
518         https://bugs.webkit.org/show_bug.cgi?id=192873
519
520         Reviewed by Antti Koivisto.
521
522         SuspendedPageProxy fails to release its process assertion if the WebPage fails to enter PageCache, preventing
523         the process from suspending on iOS.
524
525         * UIProcess/SuspendedPageProxy.cpp:
526         (WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
527         (WebKit::SuspendedPageProxy::didReceiveMessage):
528         (WebKit::SuspendedPageProxy::didSuspend): Deleted.
529         (WebKit::SuspendedPageProxy::didFailToSuspend): Deleted.
530         * UIProcess/SuspendedPageProxy.h:
531
532 2018-12-19  Chris Dumez  <cdumez@apple.com>
533
534         wtf/Optional.h: move-constructor and move-assignment operator should disengage the value being moved from
535         https://bugs.webkit.org/show_bug.cgi?id=192728
536         <rdar://problem/46746779>
537
538         Reviewed by Geoff Garen.
539
540         * NetworkProcess/*:
541         * Platform/*:
542         * Scripts/*:
543         * Shared/*:
544         * UIProcess/*:
545         * WebProcess/*:
546
547 2018-12-19  Michael Catanzaro  <mcatanzaro@igalia.com>
548
549         Unreviewed, silence -Wpragmas warning
550
551         * WebProcess/WebCoreSupport/WebAlternativeTextClient.h:
552
553 2018-12-19  Vivek Seth  <v_seth@apple.com>
554
555         HTTPS Upgrade: Use full sqlite upgrade list
556         https://bugs.webkit.org/show_bug.cgi?id=192736
557         <rdar://problem/45851427>
558
559         Reviewed by Chris Dumez.
560
561         * NetworkProcess/NetworkHTTPSUpgradeChecker.cpp: Added.
562         (WebKit::NetworkHTTPSUpgradeCheckerDatabasePath):
563         (WebKit::NetworkHTTPSUpgradeChecker::NetworkHTTPSUpgradeChecker):
564         (WebKit::NetworkHTTPSUpgradeChecker::~NetworkHTTPSUpgradeChecker):
565         (WebKit::NetworkHTTPSUpgradeChecker::query):
566         (WebKit::NetworkHTTPSUpgradeChecker::isAlwaysOnLoggingAllowed const):
567         * NetworkProcess/NetworkHTTPSUpgradeChecker.h: Added.
568         (WebKit::NetworkHTTPSUpgradeChecker::didSetupCompleteSuccessfully const):
569         * NetworkProcess/NetworkLoadChecker.cpp:
570         (WebKit::NetworkLoadChecker::applyHTTPSUpgradeIfNeeded const):
571         (WebKit::NetworkLoadChecker::checkRequest):
572         * NetworkProcess/NetworkLoadChecker.h:
573         * NetworkProcess/NetworkProcess.h:
574         (WebKit::NetworkProcess::networkHTTPSUpgradeChecker):
575         * Sources.txt:
576         * WebKit.xcodeproj/project.pbxproj:
577
578 2018-12-19  Tim Horton  <timothy_horton@apple.com>
579
580         Use delegate instead of drawingDelegate in WKDrawingView
581         https://bugs.webkit.org/show_bug.cgi?id=192899
582         <rdar://problem/46733339>
583
584         Reviewed by Wenson Hsieh.
585
586         * UIProcess/ios/WKDrawingView.mm:
587         (-[WKDrawingView initWithEmbeddedViewID:webPageProxy:]):
588         Do the dance.
589
590 2018-12-19  Alex Christensen  <achristensen@webkit.org>
591
592         Navigations away from the SafeBrowsing interstitial show a flash of old content
593         https://bugs.webkit.org/show_bug.cgi?id=192676
594
595         Reviewed by Chris Dumez.
596
597         When a user clicks through a safe browsing warning, do not remove the warning until content is drawn for the destination.
598         Otherwise, the user will confusingly see the page before the warning while the navigation happens.
599         We can only do this for warnings caused by main frame navigations, though.  Other warnings (such as those caused by iframes)
600         need to be cleared immediately, and we still need to clear the warning immediately if the user has said to go back.
601
602         This change is reflected in an updated API test.
603
604         * UIProcess/API/Cocoa/WKWebView.mm:
605         (-[WKWebView _showSafeBrowsingWarning:completionHandler:]):
606         * UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm:
607         (WebKit::SafeBrowsingWarning::SafeBrowsingWarning):
608         * UIProcess/Cocoa/WKSafeBrowsingWarning.h:
609         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
610         (-[WKSafeBrowsingWarning forMainFrameNavigation]):
611         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
612         (WebKit::WebPageProxy::beginSafeBrowsingCheck):
613         * UIProcess/Cocoa/WebViewImpl.h:
614         * UIProcess/Cocoa/WebViewImpl.mm:
615         (WebKit::WebViewImpl::showSafeBrowsingWarning):
616         (WebKit::WebViewImpl::clearSafeBrowsingWarningIfForMainFrameNavigation):
617         * UIProcess/PageClient.h:
618         (WebKit::PageClient::clearSafeBrowsingWarningIfForMainFrameNavigation):
619         * UIProcess/SafeBrowsingWarning.h:
620         (WebKit::SafeBrowsingWarning::create):
621         (WebKit::SafeBrowsingWarning::forMainFrameNavigation const):
622         * UIProcess/WebPageProxy.cpp:
623         (WebKit::WebPageProxy::didReachLayoutMilestone):
624         (WebKit::WebPageProxy::beginSafeBrowsingCheck):
625         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
626         * UIProcess/WebPageProxy.h:
627         * UIProcess/ios/PageClientImplIOS.h:
628         * UIProcess/mac/PageClientImplMac.h:
629         * UIProcess/mac/PageClientImplMac.mm:
630         (WebKit::PageClientImpl::clearSafeBrowsingWarningIfForMainFrameNavigation):
631
632 2018-12-19  Tim Horton  <timothy_horton@apple.com>
633
634         UI process crash when focusing an editable image
635         https://bugs.webkit.org/show_bug.cgi?id=192839
636         <rdar://problem/46786670>
637
638         Reviewed by Wenson Hsieh.
639
640         * SourcesCocoa.txt:
641         * UIProcess/ios/WKContentViewInteraction.h:
642         * UIProcess/ios/WKContentViewInteraction.mm:
643         (-[WKContentView _requiresKeyboardWhenFirstResponder]):
644         (-[WKContentView inputView]):
645         (-[WKContentView requiresAccessoryView]):
646         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
647         (-[WKContentView _stopAssistingNode]):
648         (-[WKContentView _installInkPickerForDrawingViewWithID:]):
649         (-[WKContentView _uninstallInkPicker]):
650         * UIProcess/ios/WKInkPickerView.h: Renamed from Source/WebKit/UIProcess/ios/WKInkPickerControl.h.
651         * UIProcess/ios/WKInkPickerView.mm: Renamed from Source/WebKit/UIProcess/ios/WKInkPickerControl.mm.
652         (-[WKInkPickerView initWithDrawingView:]):
653         (-[WKInkPickerView didPickInk]):
654         (-[WKInkPickerView inlineInkPickerDidToggleRuler:]):
655         (-[WKInkPickerView inlineInkPicker:didSelectTool:]):
656         (-[WKInkPickerView inlineInkPicker:didSelectColor:]):
657         (-[WKInkPickerView inkPickerSize]):
658         (-[WKInkPickerView layoutSubviews]):
659         (-[WKInkPickerView sizeThatFits:]):
660         (-[WKInkPickerView viewControllerForPopoverPresentationFromInlineInkPicker:]):
661         * WebKit.xcodeproj/project.pbxproj:
662         Make WKInkPickerView a WKWebView subview instead of an inputView.
663         Also, don't force the keyboard to be visible when an editable image is focused.
664
665 2018-12-19  Eric Carlson  <eric.carlson@apple.com>
666
667         [MediaStream] Force system camera/microphone TCC prompt if necessary
668         https://bugs.webkit.org/show_bug.cgi?id=192820
669         <rdar://problem/42680098>
670
671         Reviewed by Jer Noble.
672
673         * UIProcess/Cocoa/UIDelegate.mm:
674         (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest): Enable TCC check 
675         and prompt on Mojave.
676
677 2018-12-19  Megan Gardner  <megan_gardner@apple.com>
678
679         Allow clients to set the navigator platform
680         https://bugs.webkit.org/show_bug.cgi?id=192735
681
682         Reviewed by Tim Horton.
683
684         Add private API to allow clients to override the default navigator
685         platform. Some websites check for the platform, which 
686         interfears with our request desktop site feature. This should
687         help more sites function as expected.
688
689         * Shared/WebsitePoliciesData.cpp:
690         (WebKit::WebsitePoliciesData::encode const):
691         (WebKit::WebsitePoliciesData::decode):
692         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
693         * Shared/WebsitePoliciesData.h:
694         * UIProcess/API/APIWebsitePolicies.cpp:
695         (API::WebsitePolicies::data):
696         * UIProcess/API/APIWebsitePolicies.h:
697         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
698         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
699         (-[_WKWebsitePolicies setCustomNavigatorPlatform:]):
700         (-[_WKWebsitePolicies customNavigatorPlatform]):
701         * UIProcess/Cocoa/NavigationState.mm:
702         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
703
704 2018-12-19  Truitt Savell  <tsavell@apple.com>
705
706         Unreviewed, rolling out r239358.
707
708         Revision caused imported/w3c/web-platform-tests/IndexedDB/ to
709         crash on Debug bots
710
711         Reverted changeset:
712
713         "Clean up IndexedDB files between tests"
714         https://bugs.webkit.org/show_bug.cgi?id=192796
715         https://trac.webkit.org/changeset/239358
716
717 2018-12-18  Alex Christensen  <achristensen@webkit.org>
718
719         REGRESSION(r239134) iOS safe browsing warning unable to show details
720         https://bugs.webkit.org/show_bug.cgi?id=192837
721
722         Reviewed by Tim Horton.
723
724         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
725         (-[WKSafeBrowsingWarning addContent]):
726         I had a fragile design that relied on the internal view heirarchy structure of UIScrollView,
727         which I changed in r239134 by introducing a layout which changed where its scrollbars were in the view heirarchy.
728         I now have a more robust design that saves a WeakObjCPtr to the view I need to traverse to.
729         Testing is problematic because this had to do with scrollbars and UIScrollView internals which seem to behave
730         differently in TestWebKitAPI, but I verified manually that this fixes the issue.
731
732 2018-12-18  Fujii Hironori  <Hironori.Fujii@sony.com>
733
734         [Win][Clang] Fix compilation warnings under Source/WebKit directory
735         https://bugs.webkit.org/show_bug.cgi?id=192695
736
737         Reviewed by Alex Christensen.
738
739         * NetworkProcess/cache/NetworkCacheData.cpp:
740         (makeSalt): Enclosed by #if !OS(WINDOWS).
741         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
742         (WebKit::NetworkCache::directoryEntryType): Ditto.
743         * Platform/win/ModuleWin.cpp:
744         (WebKit::Module::platformFunctionPointer const): Cast a function pointer with reinterpret_cast<void*>().
745         * UIProcess/DrawingAreaProxyImpl.cpp:
746         (WebKit::DrawingAreaProxyImpl::DrawingMonitor::DrawingMonitor):
747         Moved the initializer of m_webPage in order to be encluded by #if PLATFORM(GTK).
748         * UIProcess/DrawingAreaProxyImpl.h: Ditto.
749         * UIProcess/Launcher/win/ProcessLauncherWin.cpp:
750         (WebKit::processName): Removed the duplicated 'const' type qualifier.
751         * UIProcess/win/WebInspectorProxyWin.cpp:
752         (WebKit::WebInspectorProxy::platformAttach): Removed an unused variable.
753         (WebKit::WebInspectorProxy::platformDetach): Ditto.
754         * UIProcess/win/WebPopupMenuProxyWin.cpp: Ditto.
755         * UIProcess/win/WebView.cpp:
756         (WebKit::WebView::paint): Ditto.
757         (WebKit::WebPopupMenu::setUpPlatformData): Ditto.
758         * UIProcess/win/WebPopupMenuProxyWin.h: Marked override methods with 'override'.
759         * WebProcess/WebCoreSupport/curl/WebFrameNetworkingContext.h: Ditto.
760         * WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp: Removed an unused variable.
761
762 2018-12-18  Wenson Hsieh  <wenson_hsieh@apple.com>
763
764         [macOS] fast/forms/datalist/datalist-textinput-suggestions-order.html sometimes crashes after r239337
765         https://bugs.webkit.org/show_bug.cgi?id=192836
766         <rdar://problem/45321184>
767
768         Reviewed by Tim Horton.
769
770         r239337 exposed a subtle issue in the implementation of `-[WKDataListSuggestionsView updateWithInformation:]`,
771         wherein we might end up recomputing information for table view cells at rows that no longer exist. This currently
772         happens because we first set the datalist's `_suggestions`, then change the table view's frame, and then finally
773         reload the table view; however, in the case where the number of suggestions decreased and the frame changed
774         (which prompts AppKit to ask us again for table cell views), we'll attempt to access an out-of-bounds index in
775         the `_suggestions` vector.
776
777         To address this, we change our suggestions and immediately reload the table view before updating `NSTableView`'s
778         frame, so that we only provide table view cells for rows that actually correspond to items in `_suggestions`.
779
780         * UIProcess/mac/WebDataListSuggestionsDropdownMac.mm:
781         (-[WKDataListSuggestionsView updateWithInformation:]):
782
783 2018-12-18  Jiewen Tan  <jiewen_tan@apple.com>
784
785         [Mac] Layout Test http/wpt/webauthn/public-key-credential-create-success-hid.https.html and http/wpt/webauthn/public-key-credential-get-success-hid.https.html are flaky
786         https://bugs.webkit.org/show_bug.cgi?id=192061
787
788         Reviewed by Dewei Zhu.
789
790         Part 4.
791
792         Add some additional temporary logging info to determine if the time out value passed to the timer is right.
793         Once the bug is determined and fixed, we should remove all logging added in this patch.
794
795         * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
796         (WebKit::AuthenticatorManager::initTimeOutTimer):
797
798 2018-12-18  Sihui Liu  <sihui_liu@apple.com>
799
800         Clean up IndexedDB files between tests
801         https://bugs.webkit.org/show_bug.cgi?id=192796
802
803         Reviewed by Geoffrey Garen.
804
805         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
806         (WKWebsiteDataStoreRemoveAllIndexedDatabasesSync):
807         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
808
809 2018-12-18  Vivek Seth  <v_seth@apple.com>
810
811         HTTPS Upgrade: Scripts / preprocessing necessary to create new database in future
812         https://bugs.webkit.org/show_bug.cgi?id=192612
813         <rdar://problem/46651207>
814
815         Reviewed by Andy Estes.
816
817         * Configurations/WebKit.xcconfig:
818         * DerivedSources.make:
819         * Scripts/generate-https-upgrade-database.sh: Added.
820         * WebKit.xcodeproj/project.pbxproj:
821
822 2018-12-18  Wenson Hsieh  <wenson_hsieh@apple.com>
823
824         Unreviewed, fix the 32-bit watchOS build after r239314
825
826         * UIProcess/API/Cocoa/WKWebView.mm:
827         (-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
828
829 2018-12-18  Alex Christensen  <achristensen@webkit.org>
830
831         WKWebView has old URL while displaying SafeBrowsing interstitial, for link-click navigations
832         https://bugs.webkit.org/show_bug.cgi?id=192675
833
834         Reviewed by Geoffrey Garen.
835
836         When a safe browsing warning is being shown, WKWebView.URL should be the unsafe website, not the safe website before it.
837
838         * UIProcess/API/Cocoa/WKWebView.mm:
839         (-[WKWebView _showSafeBrowsingWarningWithTitle:warning:details:completionHandler:]):
840         (-[WKWebView _showSafeBrowsingWarningWithURL:title:warning:details:completionHandler:]):
841         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
842         * UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm:
843         (WebKit::SafeBrowsingWarning::SafeBrowsingWarning):
844         * UIProcess/SafeBrowsingWarning.h:
845         (WebKit::SafeBrowsingWarning::create):
846         (WebKit::SafeBrowsingWarning::url const):
847         * UIProcess/WebPageProxy.cpp:
848         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
849
850 2018-12-18  Chris Dumez  <cdumez@apple.com>
851
852         Regression(r239182) SuspendedPage's process reuse for link navigation optimization sometimes broken
853         https://bugs.webkit.org/show_bug.cgi?id=192772
854
855         Reviewed by Antti Koivisto.
856
857         With r239182, if the page in the previous process would fail to enter PageCache, we would destroy
858         the corresponding SuspendedPageProxy, which would potentially terminate the process. This would
859         regress performance when trying to navigate back in history to that page. This would also regress
860         performance when link-navigating to the same domain as we would have previously reused the suspended
861         page's process for such navigation.
862
863         Address the issue by keeping the SuspendedPageProxy alive even if the WebPage fails to suspend.
864         When trying to reuse a SuspendedPageProxy, if the page failed to suspend, reuse its process but
865         not the suspended page itself.
866
867         * UIProcess/SuspendedPageProxy.cpp:
868         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
869         (WebKit::SuspendedPageProxy::waitUntilReadyToUnsuspend):
870         (WebKit::SuspendedPageProxy::unsuspend):
871         (WebKit::SuspendedPageProxy::didSuspend):
872         (WebKit::SuspendedPageProxy::didFailToSuspend):
873         (WebKit::SuspendedPageProxy::loggingString const):
874         * UIProcess/SuspendedPageProxy.h:
875         * UIProcess/WebPageProxy.cpp:
876         (WebKit::WebPageProxy::swapToWebProcess):
877         * UIProcess/WebProcessPool.cpp:
878         (WebKit::WebProcessPool::processForNavigationInternal):
879
880 2018-12-17  Jiewen Tan  <jiewen_tan@apple.com>
881
882         [Mac] Layout Test http/wpt/webauthn/public-key-credential-create-success-hid.https.html and http/wpt/webauthn/public-key-credential-get-success-hid.https.html are flaky
883         https://bugs.webkit.org/show_bug.cgi?id=192061
884
885         Reviewed by Dewei Zhu.
886
887         Part 3.
888
889         Add some additional temporary logging info to determine if the timer is working as expected.
890         Once the bug is determined and fixed, we should remove all logging added in this patch.
891
892         * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
893         (WebKit::AuthenticatorManager::respondReceived):
894         (WebKit::AuthenticatorManager::initTimeOutTimer):
895         (WebKit::AuthenticatorManager::timeOutTimerFired):
896         * UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.cpp:
897         (WebKit::MockAuthenticatorManager::respondReceivedInternal):
898
899 2018-12-17  Saam barati  <sbarati@apple.com>
900
901         Enable HTTP and HTTPS proxies on iOS and make it a property of the NSURLSession
902         https://bugs.webkit.org/show_bug.cgi?id=192374
903         <rdar://problem/46506286>
904
905         Reviewed by Alex Christensen.
906
907         This patch makes it so that we can use HTTP/HTTPS proxies on iOS as well.
908         To enable on iOS, you can do something like:
909         $ defaults write -g WebKit2HTTPProxy -string "http://localhost:8080"
910         $ defaults write -g WebKit2HTTPSProxy -string "http://localhost:8080"
911         
912         This patch also changes the Proxy to be enabled on a per NSURLSession
913         basis instead of a per process basis.
914
915         * NetworkProcess/NetworkProcess.cpp:
916         (WebKit::NetworkProcess::initializeNetworkProcess):
917         * NetworkProcess/NetworkSessionCreationParameters.cpp:
918         (WebKit::NetworkSessionCreationParameters::privateSessionParameters):
919         (WebKit::NetworkSessionCreationParameters::encode const):
920         (WebKit::NetworkSessionCreationParameters::decode):
921         * NetworkProcess/NetworkSessionCreationParameters.h:
922         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
923         (WebKit::proxyDictionary):
924         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
925         * NetworkProcess/mac/NetworkProcessMac.mm:
926         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
927         (WebKit::overrideSystemProxies): Deleted.
928         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
929         (-[WKWebsiteDataStore _initWithConfiguration:]):
930         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
931         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
932         (-[_WKWebsiteDataStoreConfiguration httpProxy]):
933         (-[_WKWebsiteDataStoreConfiguration setHTTPProxy:]):
934         (-[_WKWebsiteDataStoreConfiguration httpsProxy]):
935         (-[_WKWebsiteDataStoreConfiguration setHTTPSProxy:]):
936         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
937         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
938         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
939         (WebKit::WebsiteDataStore::parameters):
940         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
941         (WebKit::WebsiteDataStoreConfiguration::copy):
942         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
943         (WebKit::WebsiteDataStoreConfiguration::httpProxy const):
944         (WebKit::WebsiteDataStoreConfiguration::setHTTPProxy):
945         (WebKit::WebsiteDataStoreConfiguration::httpsProxy const):
946         (WebKit::WebsiteDataStoreConfiguration::setHTTPSProxy):
947
948 2018-12-17  Wenson Hsieh  <wenson_hsieh@apple.com>
949
950         Tap highlights should not be shown on iOSMac
951         https://bugs.webkit.org/show_bug.cgi?id=192797
952         <rdar://problem/46793995>
953
954         Reviewed by Tim Horton.
955
956         WKWebViews in iOSMac should avoid painting tap highlights, since tap highlights are not present in the rest of
957         the macOS platform. Simply disable this functionality by bailing in `-[WKContentView _showTapHighlight]`.
958
959         * UIProcess/ios/WKContentViewInteraction.mm:
960         (-[WKContentView _showTapHighlight]):
961
962 2018-12-17  Wenson Hsieh  <wenson_hsieh@apple.com>
963
964         Unreviewed, fix the iOSMac engineering build again
965
966         After r239311, `WebProcessProxy::fullKeyboardAccessEnabled` in `WebProcessProxyIOS.mm` attempts to use
967         `WKFullKeyboardAccessWatcher`, which is guarded by `ENABLE(FULL_KEYBOARD_ACCESS)`. However, on iOSMac,
968         `ENABLE(FULL_KEYBOARD_ACCESS)` is 0. Fix the build by putting access to `WKFullKeyboardAccessWatcher` behind
969         `ENABLE(FULL_KEYBOARD_ACCESS)`.
970
971         * UIProcess/ios/WebProcessProxyIOS.mm:
972         (WebKit::WebProcessProxy::fullKeyboardAccessEnabled):
973
974 2018-12-17  Wenson Hsieh  <wenson_hsieh@apple.com>
975
976         Unreviewed, fix the iOSMac engineering build
977
978         `generateRequestID()` is only invoked from code under `ENABLE(MEDIA_STREAM)`; move it under this guard to avoid
979         an unused function warning.
980
981         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
982
983 2018-12-17  David Kilzer  <ddkilzer@apple.com>
984
985         clang-tidy: Fix unnecessary object copy in CPUMonitor::setCPULimit()
986         <https://webkit.org/b/192707>
987         <rdar://problem/46734926>
988
989         Reviewed by Daniel Bates.
990
991         * WebProcess/cocoa/WebProcessCocoa.mm:
992         (WebKit::WebProcess::updateCPUMonitorState):
993         - Pass m_cpuLimit directly since getting its value causes an
994           identical std::optional<double> to be created unnecessarily.
995
996 2018-12-17  Wenson Hsieh  <wenson_hsieh@apple.com>
997
998         [iOS] Focusing a large editable element always scrolls to the top of the element
999         https://bugs.webkit.org/show_bug.cgi?id=192745
1000         <rdar://problem/46758445>
1001
1002         Reviewed by Tim Horton.
1003
1004         Currently, when focusing form controls or editable elements, we try to scroll such that the focused element rect
1005         is centered within the visible area. In the case of very large focusable elements whose dimensions exceed the
1006         width or height of the visible area, we instead scroll such that the top left point of the element is at the top
1007         left corner of the visible area.
1008
1009         However, this results in unnecessary scrolling if the top of the element is already near the top of the visible
1010         area. For WebKit2-based rich text editors that have an editable body element with a top content inset that
1011         contains additional content, this means we will always scroll the additional content away when focusing the
1012         editable body.
1013
1014         To avoid this behavior, adjust focused element zooming logic for editable elements that are too large to be
1015         centered in the visible area, such that we only scroll the top left position of the focused element to the top
1016         half or top right of the visible area, respectively. This reduces the amount of scrolling when focusing large
1017         editable elements, while still making it clear which element is being focused.
1018
1019         * Platform/spi/ios/UIKitSPI.h:
1020         * UIProcess/API/Cocoa/WKWebView.mm:
1021         (-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
1022
1023         Make some small adjustments to improve the readability of this method by using `clampTo` instead of clamping
1024         values by comparing and setting values.
1025
1026         Also, fix an existing bug wherein focusable elements that are meant to be centered within the visible area are
1027         currently offset by half the difference between the bottom inset amount and the top inset amount, in the case
1028         where the `_obscuredInsets` SPI is used to specify content insets for the web view (i.e., MobileSafari).
1029
1030         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1031
1032         Make a couple of arguments `const FloatRect&` instead of just `FloatRect`.
1033
1034 2018-12-17  Ryosuke Niwa  <rniwa@webkit.org>
1035
1036         offsetLeft and offsetParent should adjust across shadow boundaries
1037         https://bugs.webkit.org/show_bug.cgi?id=157437
1038         <rdar://problem/26154021>
1039
1040         Reviewed by Simon Fraser.
1041
1042         Use *forBindings variants of offsetLeft, offsetTop, and offsetParent.
1043
1044         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementGtk.cpp:
1045         (webkit_dom_element_get_offset_left):
1046         (webkit_dom_element_get_offset_top):
1047         (webkit_dom_element_get_offset_parent):
1048
1049 2018-12-17  Chris Fleizach  <cfleizach@apple.com>
1050
1051         Some builds are broken after r239262
1052         https://bugs.webkit.org/show_bug.cgi?id=192777
1053
1054         Reviewed by Simon Fraser.
1055
1056         * Platform/spi/ios/AccessibilitySupportSPI.h:
1057         * UIProcess/Cocoa/WKFullKeyboardAccessWatcher.h:
1058         * UIProcess/Cocoa/WKFullKeyboardAccessWatcher.mm:
1059         (platformIsFullKeyboardAccessEnabled):
1060         (-[WKFullKeyboardAccessWatcher init]):
1061         Fix the build by being more clear about when it's OK to use AccessibilitySupport.
1062
1063 2018-12-17  Chris Dumez  <cdumez@apple.com>
1064
1065         Allow passing nil as session state to [WKWebView _restoreSessionState:]
1066         https://bugs.webkit.org/show_bug.cgi?id=192789
1067         <rdar://problem/46755277>
1068
1069         Reviewed by Alex Christensen.
1070
1071         Allow passing nil as session state to [WKWebView _restoreSessionState:] instead of crashing.
1072
1073         * UIProcess/API/Cocoa/WKWebView.mm:
1074         (-[WKWebView _restoreSessionState:andNavigate:]):
1075
1076 2018-12-17  Alex Christensen  <achristensen@webkit.org>
1077
1078         Fix occasional null-dereference crash in WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame
1079         https://bugs.webkit.org/show_bug.cgi?id=192744
1080         <rdar://problem/45842668>
1081
1082         Reviewed by Chris Dumez.
1083
1084         * UIProcess/WebPageProxy.cpp:
1085         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
1086         Things happen.  Navigations can be null.  If they are, we shouldn't dereference pointers to them.
1087
1088 2018-12-17  Chris Dumez  <cdumez@apple.com>
1089
1090         Unreviewed, revert recent CrashReporterClient build fixes as they are no longer needed.
1091
1092         * Platform/cocoa/WKCrashReporter.mm:
1093
1094 2018-12-17  Suresh Koppisetty  <skoppisettyt@apple.com>
1095
1096         Rollout r235411
1097         https://bugs.webkit.org/show_bug.cgi?id=192778
1098         <rdar://46789485>
1099
1100         Disabling access to CoreServices is causing a performance
1101         regression in process launch time.  See <rdar://46141878>
1102
1103         Reviewed by Alex Christensen.
1104
1105         * WebProcess/com.apple.WebProcess.sb.in:
1106
1107 2018-12-17  Zan Dobersek  <zdobersek@igalia.com>
1108
1109         Unreviewed WPE build fix after r239277.
1110
1111         * UIProcess/API/C/WKContext.cpp:
1112         (WKContextClearCurrentModifierStateForTesting):
1113         Use the WebKit:: namespace specifier as it is used across this file.
1114
1115 2018-12-17  Commit Queue  <commit-queue@webkit.org>
1116
1117         Unreviewed, rolling out r239265 and r239274.
1118         https://bugs.webkit.org/show_bug.cgi?id=192765
1119
1120         unorm_normalize is deprecated, and broke an internal build
1121         (Requested by Truitt on #webkit).
1122
1123         Reverted changesets:
1124
1125         "[GTK][WPE] Need a function to convert internal URI to display
1126         ("pretty") URI"
1127         https://bugs.webkit.org/show_bug.cgi?id=174816
1128         https://trac.webkit.org/changeset/239265
1129
1130         "Fix the Apple Internal Mac build with a newer SDK"
1131         https://trac.webkit.org/changeset/239274
1132
1133 2018-12-17  Daniel Bates  <dabates@apple.com>
1134
1135         Implement UIScriptController::toggleCapsLock() for iOS
1136         https://bugs.webkit.org/show_bug.cgi?id=191815
1137
1138         Reviewed by Andy Estes.
1139
1140         Add test infrastructure to clear the current modifier state. We will use this to ensure that
1141         the caps lock state does not persist between tests.
1142
1143         * UIProcess/API/C/WKContext.cpp:
1144         (WKContextClearCurrentModifierStateForTesting): Added.
1145         * UIProcess/API/C/WKContextPrivate.h:
1146         * UIProcess/WebProcessPool.cpp:
1147         (WebKit::WebProcessPool::clearCurrentModifierStateForTesting): Added.
1148         * UIProcess/WebProcessPool.h:
1149         * WebProcess/WebProcess.cpp:
1150         (WebKit::WebProcess::clearCurrentModifierStateForTesting): Added.
1151         * WebProcess/WebProcess.h:
1152         * WebProcess/WebProcess.messages.in:
1153
1154 2018-12-17  David Kilzer  <ddkilzer@apple.com>
1155
1156         REGRESSION (r239262): Fix broken builds prior to Mojave
1157         <https://bugs.webkit.org/show_bug.cgi?id=192373>
1158         <rdar://problem/46462670>
1159
1160         * UIProcess/Cocoa/WKFullKeyboardAccessWatcher.mm:
1161         Wrap header in ENABLE(ACCESSIBILITY_EVENTS) to fix the build.
1162
1163 2018-12-17  Daniel Bates  <dabates@apple.com>
1164
1165         [iOS] Remove -[WebEvent initWithKeyEventType:...:characterSet:]
1166         https://bugs.webkit.org/show_bug.cgi?id=192633
1167
1168         Reviewed by Wenson Hsieh.
1169
1170         Update code to use the modern initializer.
1171
1172         * UIProcess/ios/WKWebEvent.mm:
1173         (-[WKWebEvent initWithEvent:]):
1174
1175 2018-12-17  Matt Lewis  <jlewis3@apple.com>
1176
1177         Unreviewed, rolling out r239254.
1178
1179         This broke the Windows 10 Debug build
1180
1181         Reverted changeset:
1182
1183         "Replace many uses of String::format with more type-safe
1184         alternatives"
1185         https://bugs.webkit.org/show_bug.cgi?id=192742
1186         https://trac.webkit.org/changeset/239254
1187
1188 2018-12-17  David Kilzer  <ddkilzer@apple.com>
1189
1190         clang-tidy: loop variable is copied but only used as const reference in WebCore, WebKit, Tools
1191         <https://webkit.org/b/192751>
1192         <rdar://problem/46771623>
1193
1194         Reviewed by Daniel Bates.
1195
1196         Change loop variables to const references to avoid unnecessary
1197         copies.
1198
1199         * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
1200         (WebKit::WebSWServerConnection::~WebSWServerConnection):
1201         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
1202         (WebKit::RemoteLayerTreeTransaction::encode const):
1203         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1204         (WebKit::toNSErrors):
1205         * UIProcess/Automation/WebAutomationSession.cpp:
1206         (WebKit::WebAutomationSession::setFilesToSelectForFileUpload):
1207         (WebKit::WebAutomationSession::performKeyboardInteractions):
1208         (WebKit::WebAutomationSession::performInteractionSequence):
1209         * UIProcess/Plugins/PluginProcessManager.cpp:
1210         (WebKit::PluginProcessManager::getPluginProcess):
1211         * UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
1212         (WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords):
1213         (WebKit::ResourceLoadStatisticsMemoryStore::shouldRemoveDataRecords const):
1214         * UIProcess/WebPageProxy.cpp:
1215         (WebKit::WebPageProxy::serializedAttachmentDataForIdentifiers):
1216         * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
1217         (WebKit::LocalStorageDatabaseTracker::deleteAllDatabases):
1218         (WebKit::LocalStorageDatabaseTracker::origins const):
1219         (WebKit::LocalStorageDatabaseTracker::originDetails):
1220         * WebProcess/WebPage/WebPage.cpp:
1221         (WebKit::m_shouldAttachDrawingAreaOnPageTransition):
1222         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1223         (WebKit::TiledCoreAnimationDrawingArea::didUpdateActivityStateTimerFired):
1224
1225 2018-12-17  Ms2ger  <Ms2ger@igalia.com>
1226
1227         [GTK][WPE] Need a function to convert internal URI to display ("pretty") URI
1228         https://bugs.webkit.org/show_bug.cgi?id=174816
1229
1230         Reviewed by Michael Catanzaro.
1231
1232         Add webkit_uri_for_display for GTK and WPE.
1233
1234         * PlatformGTK.cmake:
1235         * PlatformWPE.cmake:
1236         * SourcesGTK.txt:
1237         * SourcesWPE.txt:
1238         * UIProcess/API/glib/WebKitURIUtilities.cpp: Added.
1239         (webkit_uri_for_display):
1240         * UIProcess/API/gtk/WebKitURIUtilities.h: Added.
1241         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
1242         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
1243         * UIProcess/API/gtk/webkit2.h:
1244         * UIProcess/API/wpe/WebKitURIUtilities.h: Added.
1245         * UIProcess/API/wpe/docs/wpe-0.1-sections.txt:
1246         * UIProcess/API/wpe/docs/wpe-docs.sgml:
1247         * UIProcess/API/wpe/webkit.h:
1248
1249 2018-12-17  Carlos Garcia Campos  <cgarcia@igalia.com>
1250
1251         [WPE] Add API to notify about frame displayed view backend callback
1252         https://bugs.webkit.org/show_bug.cgi?id=192224
1253
1254         Reviewed by Michael Catanzaro.
1255
1256         Add API to add a callback to the view to be called when the view backend notifies that a frame has been
1257         displayed.
1258
1259         * UIProcess/API/glib/WebKitWebView.cpp:
1260         (FrameDisplayedCallback::FrameDisplayedCallback):
1261         (FrameDisplayedCallback::~FrameDisplayedCallback):
1262         (webkit_web_view_add_frame_displayed_callback):
1263         (webkit_web_view_remove_frame_displayed_callback):
1264         * UIProcess/API/wpe/WebKitWebView.h:
1265         * UIProcess/API/wpe/docs/wpe-0.1-sections.txt:
1266
1267 2018-12-16  Chris Fleizach  <cfleizach@apple.com>
1268
1269         AX: Support keyboard access preference for iOS in WebKit
1270         https://bugs.webkit.org/show_bug.cgi?id=192373
1271         <rdar://problem/46462670>
1272
1273         Reviewed by Tim Horton.
1274
1275         * Platform/spi/ios/AccessibilitySupportSPI.h:
1276         * PlatformMac.cmake:
1277         * SourcesCocoa.txt:
1278         * UIProcess/Cocoa/WKFullKeyboardAccessWatcher.h: Added.
1279         * UIProcess/Cocoa/WKFullKeyboardAccessWatcher.mm: Added.
1280         (platformIsFullKeyboardAccessEnabled):
1281         (-[WKFullKeyboardAccessWatcher notifyAllProcessPools]):
1282         (-[WKFullKeyboardAccessWatcher retrieveKeyboardUIModeFromPreferences:]):
1283         (-[WKFullKeyboardAccessWatcher init]):
1284         (+[WKFullKeyboardAccessWatcher fullKeyboardAccessEnabled]):
1285         * UIProcess/ios/WebProcessProxyIOS.mm:
1286         (WebKit::WebProcessProxy::fullKeyboardAccessEnabled):
1287         * UIProcess/mac/WKFullKeyboardAccessWatcher.h: Removed.
1288         * UIProcess/mac/WKFullKeyboardAccessWatcher.mm: Removed.
1289         * WebKit.xcodeproj/project.pbxproj:
1290
1291 2018-12-16  Adrian Perez de Castro  <aperez@igalia.com>
1292
1293         Unreviewed follow up after r239260
1294         https://bugs.webkit.org/show_bug.cgi?id=192714
1295         <rdar://problem/46762407>
1296
1297         * Platform/win/SharedMemoryWin.cpp:
1298         (WebKit::SharedMemory::allocate): Use PAGE_READWRITE directly instead
1299         of going through the protectAttribute() function, which is removed
1300         because it is now unused.
1301
1302 2018-12-16  Adrian Perez de Castro  <aperez@igalia.com>
1303
1304         Unify SharedMemory factory functions
1305         https://bugs.webkit.org/show_bug.cgi?id=192714
1306
1307         Reviewed by Darin Adler.
1308
1309         This unifies SharedMemory so in the following way, across platforms:
1310
1311         - SharedMemory::create() is removed, to avoid ambiguity.
1312         - SharedMemory::allocate() always allocates a new block of shared memory.
1313         - SharedMemory::wrapMap() always creates a SharedMemory object which refers to an
1314           existing region of memory resulting from memory-mapping a file.
1315
1316         * NetworkProcess/cache/NetworkCacheDataCocoa.mm:
1317         (WebKit::NetworkCache::Data::tryCreateSharedMemory const): Use SharedMemory::wrapMap().
1318         * Platform/SharedMemory.h: Remove the definition of SharedMemory::create(), and make
1319         SharedMemory::wrapMap() available on OS(DARWIN) as well.
1320         * Platform/cocoa/SharedMemoryCocoa.cpp:
1321         (WebKit::SharedMemory::wrapMap): Renamed from ::create().
1322         * Platform/unix/SharedMemoryUnix.cpp:
1323         (WebKit::SharedMemory::allocate): Renamed from ::create().
1324         * Platform/win/SharedMemoryWin.cpp:
1325         (WebKit::SharedMemory::allocate): Renamed from ::create()
1326         * UIProcess/API/APIContentRuleListStore.cpp:
1327         (API::createExtension): Use NetworkCache::Data::tryCreateSharedMemory() instead of
1328         SharedMemory::create().
1329
1330 2018-12-15  Chris Fleizach  <cfleizach@apple.com>
1331
1332         [meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
1333         https://bugs.webkit.org/show_bug.cgi?id=192449
1334         <rdar://problem/46595508>
1335
1336         Reviewed by Darin Adler.
1337
1338         Part 7: Files in UIProcess/API
1339
1340         * UIProcess/API/APIContentRuleListStore.cpp:
1341         * UIProcess/API/APIHitTestResult.cpp:
1342         * UIProcess/API/APINavigation.cpp:
1343         * UIProcess/API/APIOpenPanelParameters.cpp:
1344         * UIProcess/API/APIPageConfiguration.cpp:
1345         * UIProcess/API/C/WKApplicationCacheManager.cpp:
1346         (WKApplicationCacheManagerGetTypeID):
1347         (WKApplicationCacheManagerGetApplicationCacheOrigins):
1348         (WKApplicationCacheManagerDeleteEntriesForOrigin):
1349         (WKApplicationCacheManagerDeleteAllEntries):
1350         * UIProcess/API/C/WKAuthenticationDecisionListener.cpp:
1351         (WKAuthenticationDecisionListenerGetTypeID):
1352         (WKAuthenticationDecisionListenerUseCredential):
1353         (WKAuthenticationDecisionListenerCancel):
1354         (WKAuthenticationDecisionListenerRejectProtectionSpaceAndContinue):
1355         * UIProcess/API/C/WKBackForwardListItemRef.cpp:
1356         (WKBackForwardListItemGetTypeID):
1357         (WKBackForwardListItemCopyURL):
1358         (WKBackForwardListItemCopyTitle):
1359         (WKBackForwardListItemCopyOriginalURL):
1360         * UIProcess/API/C/WKContext.cpp:
1361         (WKContextGetTypeID):
1362         (WKContextCreate):
1363         (WKContextCreateWithInjectedBundlePath):
1364         (WKContextCreateWithConfiguration):
1365         (WKContextSetClient):
1366         (WKContextSetInjectedBundleClient):
1367         (WKContextSetHistoryClient):
1368         (WKContextSetDownloadClient):
1369         (WKContextSetConnectionClient):
1370         (WKContextDownloadURLRequest):
1371         (WKContextResumeDownload):
1372         (WKContextSetInitializationUserDataForInjectedBundle):
1373         (WKContextPostMessageToInjectedBundle):
1374         (WKContextGetGlobalStatistics):
1375         (WKContextAddVisitedLink):
1376         (WKContextClearVisitedLinks):
1377         (WKContextSetCacheModel):
1378         (WKContextGetCacheModel):
1379         (WKContextSetMaximumNumberOfProcesses):
1380         (WKContextGetMaximumNumberOfProcesses):
1381         (WKContextSetAlwaysUsesComplexTextCodePath):
1382         (WKContextSetShouldUseFontSmoothing):
1383         (WKContextSetAdditionalPluginsDirectory):
1384         (WKContextRefreshPlugIns):
1385         (WKContextRegisterURLSchemeAsEmptyDocument):
1386         (WKContextRegisterURLSchemeAsSecure):
1387         (WKContextRegisterURLSchemeAsBypassingContentSecurityPolicy):
1388         (WKContextRegisterURLSchemeAsCachePartitioned):
1389         (WKContextRegisterURLSchemeAsCanDisplayOnlyIfCanRequest):
1390         (WKContextSetDomainRelaxationForbiddenForURLScheme):
1391         (WKContextSetCanHandleHTTPSServerTrustEvaluation):
1392         (WKContextSetPrewarmsProcessesAutomatically):
1393         (WKContextSetCustomWebContentServiceBundleIdentifier):
1394         (WKContextSetDiskCacheSpeculativeValidationEnabled):
1395         (WKContextPreconnectToServer):
1396         (WKContextGetCookieManager):
1397         (WKContextGetWebsiteDataStore):
1398         (WKContextGetGeolocationManager):
1399         (WKContextGetMediaSessionFocusManager):
1400         (WKContextGetNotificationManager):
1401         (WKContextStartMemorySampler):
1402         (WKContextStopMemorySampler):
1403         (WKContextAllowSpecificHTTPSCertificateForHost):
1404         (WKContextDisableProcessTermination):
1405         (WKContextEnableProcessTermination):
1406         (WKContextSetHTTPPipeliningEnabled):
1407         (WKContextWarmInitialProcess):
1408         (WKContextGetStatistics):
1409         (WKContextGetStatisticsWithOptions):
1410         (WKContextJavaScriptConfigurationFileEnabled):
1411         (WKContextSetJavaScriptConfigurationFileEnabled):
1412         (WKContextGarbageCollectJavaScriptObjects):
1413         (WKContextSetJavaScriptGarbageCollectorTimerEnabled):
1414         (WKContextUseTestingNetworkSession):
1415         (WKContextSetAllowsAnySSLCertificateForWebSocketTesting):
1416         (WKContextSetAllowsAnySSLCertificateForServiceWorkerTesting):
1417         (WKContextClearCachedCredentials):
1418         (WKContextCopyPlugInAutoStartOriginHashes):
1419         (WKContextSetPlugInAutoStartOriginHashes):
1420         (WKContextSetPlugInAutoStartOriginsFilteringOutEntriesAddedAfterTime):
1421         (WKContextSetPlugInAutoStartOrigins):
1422         (WKContextSetInvalidMessageFunction):
1423         (WKContextSetMemoryCacheDisabled):
1424         (WKContextSetFontWhitelist):
1425         (WKContextTerminateNetworkProcess):
1426         (WKContextTerminateServiceWorkerProcess):
1427         (WKContextGetNetworkProcessIdentifier):
1428         (WKContextAddSupportedPlugin):
1429         (WKContextClearSupportedPlugins):
1430         (WKContextSetIDBPerOriginQuota):
1431         * UIProcess/API/C/WKPage.cpp:
1432         (WKPageLoadURLWithShouldOpenExternalURLsPolicy):
1433         (WKPageLoadURLWithUserData):
1434         (WKPageLoadURLRequestWithUserData):
1435         (WKPageSetPaginationMode):
1436         (WKPageGetPaginationMode):
1437         (WKPageSetPageLoaderClient):
1438         (WKPageSetPagePolicyClient):
1439         * UIProcess/API/C/cg/WKIconDatabaseCG.cpp:
1440
1441 2018-12-15  Darin Adler  <darin@apple.com>
1442
1443         Use warning-ignoring macros more consistently and simply
1444         https://bugs.webkit.org/show_bug.cgi?id=192743
1445
1446         Reviewed by Mark Lam.
1447
1448         * UIProcess/ios/WKDrawingView.mm:
1449         (-[WKDrawingView initWithEmbeddedViewID:webPageProxy:]):
1450         Use ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END.
1451         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
1452         (-[WKFullScreenWindowController _EVOrganizationName]): Ditto.
1453
1454         * WebProcess/WebCoreSupport/WebAlternativeTextClient.h: Use
1455         IGNORE_WARNINGS_BEGIN/END instead of IGNORE_CLANG_WARNINGS_BEGIN/END
1456         because there is no need to accomodate non-clang compilers here.
1457         Also use #pragma once, add a missing "explicit", and fix conditionals.
1458
1459 2018-12-15  Darin Adler  <darin@apple.com>
1460
1461         Replace many uses of String::format with more type-safe alternatives
1462         https://bugs.webkit.org/show_bug.cgi?id=192742
1463
1464         Reviewed by Mark Lam.
1465
1466         * Shared/WebMemorySampler.cpp:
1467         (WebKit::WebMemorySampler::writeHeaders): Use makeString.
1468
1469         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
1470         (WebKit::LocalAuthenticator::makeCredential): Use string concatentation.
1471
1472         * UIProcess/WebInspectorUtilities.cpp:
1473         (WebKit::inspectorPageGroupIdentifierForPage): Use makeString.
1474         * UIProcess/WebProcessPool.cpp:
1475         (WebKit::WebProcessPool::processDidFinishLaunching): Ditto.
1476         (WebKit::WebProcessPool::startMemorySampler): Ditto.
1477
1478 2018-12-14  Ryan Haddad  <ryanhaddad@apple.com>
1479
1480         Unreviewed, fix the build with recent SDKs.
1481
1482         * UIProcess/ios/WKDrawingView.mm:
1483         (-[WKDrawingView initWithEmbeddedViewID:webPageProxy:]):
1484
1485 2018-12-14  Jiewen Tan  <jiewen_tan@apple.com>
1486
1487         [Mac] Layout Test http/wpt/webauthn/public-key-credential-create-success-hid.https.html and http/wpt/webauthn/public-key-credential-get-success-hid.https.html are flaky
1488         https://bugs.webkit.org/show_bug.cgi?id=192061
1489
1490         Reviewed by Dewei Zhu.
1491
1492         Part 2.
1493
1494         Add some additional temporary logging info. Since the failure cannot be reproduced easily by human, we have to
1495         rely on the test infrastructure to reporoduce it. Once the bug is determined and fixed, we should remove all
1496         logging added in this patch.
1497
1498         * UIProcess/WebAuthentication/Cocoa/HidService.mm:
1499         (WebKit::HidService::deviceAdded):
1500         * UIProcess/WebAuthentication/fido/CtapHidAuthenticator.cpp:
1501         (WebKit::CtapHidAuthenticator::makeCredential):
1502         (WebKit::CtapHidAuthenticator::getAssertion):
1503         * UIProcess/WebAuthentication/fido/CtapHidDriver.cpp:
1504         (WebKit::CtapHidDriver::Worker::write):
1505         (WebKit::CtapHidDriver::Worker::read):
1506         (WebKit::CtapHidDriver::Worker::returnMessage):
1507         (WebKit::CtapHidDriver::transact):
1508         (WebKit::CtapHidDriver::continueAfterChannelAllocated):
1509         (WebKit::CtapHidDriver::continueAfterResponseReceived):
1510
1511 2018-12-14  Adrian Perez de Castro  <aperez@igalia.com>
1512
1513         [GTK] Unreviewed build fix.
1514
1515         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: Add missing WebPolicyAction.h include.
1516
1517 2018-12-14  Chris Dumez  <cdumez@apple.com>
1518
1519         Unreviewed, fix assertion failure in API test after r239210.
1520
1521         * WebProcess/WebPage/WebPage.cpp:
1522         (WebKit::WebPage::createDocumentLoader):
1523
1524 2018-12-14  Adrian Perez de Castro  <aperez@igalia.com>
1525
1526         [SOUP] Unreviewed build fix after r239219
1527
1528         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1529         (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse): Remove
1530         handling of PolicyAction::Suspend, which is no longer available.
1531
1532 2018-12-14  Joseph Pecoraro  <pecoraro@apple.com>
1533
1534         Unreviewed, apply post-landing review comments after r239221.
1535
1536         * UIProcess/WebPageDebuggable.cpp:
1537         (WebKit::WebPageDebuggable::url const):
1538         Switch to WTF::blankURL() instead of using "about:blank" directly.
1539
1540 2018-12-14  Chris Dumez  <cdumez@apple.com>
1541
1542         [PSON] Process-swapping on a loadHTMLString causes duplicate decidePolicyForNavigationAction delegate calls
1543         https://bugs.webkit.org/show_bug.cgi?id=192704
1544
1545         Reviewed by Geoffrey Garen.
1546
1547         Process-swapping on a loadHTMLString causes duplicate decidePolicyForNavigationAction delegate calls. This
1548         is because we were failing to pass the ShouldTreatAsContinuingLoad flag to the WebContent process when
1549         doing a LoadData.
1550
1551         * UIProcess/WebPageProxy.cpp:
1552         (WebKit::WebPageProxy::loadData):
1553         (WebKit::WebPageProxy::loadDataWithNavigation):
1554         (WebKit::WebPageProxy::continueNavigationInNewProcess):
1555         * UIProcess/WebPageProxy.h:
1556         * WebProcess/WebPage/WebPage.cpp:
1557         (WebKit::WebPage::loadDataImpl):
1558         (WebKit::WebPage::loadData):
1559         (WebKit::WebPage::loadAlternateHTML):
1560         * WebProcess/WebPage/WebPage.h:
1561
1562 2018-12-14  Joseph Pecoraro  <pecoraro@apple.com>
1563
1564         Web Inspector: Prefer "about:blank" instead of an empty string for WebPageDebuggable url
1565         https://bugs.webkit.org/show_bug.cgi?id=192691
1566         <rdar://problem/46719798>
1567
1568         Reviewed by Darin Adler.
1569
1570         * UIProcess/WebPageDebuggable.cpp:
1571         (WebKit::WebPageDebuggable::url const):
1572         Instead of an empty string, return "about:blank" in bail cases.
1573         When inspecting the page that matches the contents.
1574
1575 2018-12-14  Chris Dumez  <cdumez@apple.com>
1576
1577         [PSON] Stop exposing PolicyAction::Suspend to WebCore
1578         https://bugs.webkit.org/show_bug.cgi?id=192701
1579
1580         Reviewed by Brady Eidson.
1581
1582         Introduce a new WebPolicyAction enum that is used at WebKit2 layer and augments
1583         WebCore::PolicyAction with a "Suspend" value.
1584
1585         * NetworkProcess/NetworkDataTaskBlob.cpp:
1586         (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse):
1587         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1588         (toNSURLSessionResponseDisposition):
1589         * Shared/WebPolicyAction.h: Added.
1590         * UIProcess/WebFramePolicyListenerProxy.cpp:
1591         (WebKit::WebFramePolicyListenerProxy::didReceiveSafeBrowsingResults):
1592         (WebKit::WebFramePolicyListenerProxy::use):
1593         (WebKit::WebFramePolicyListenerProxy::download):
1594         (WebKit::WebFramePolicyListenerProxy::ignore):
1595         * UIProcess/WebFramePolicyListenerProxy.h:
1596         * UIProcess/WebFrameProxy.cpp:
1597         (WebKit::WebFrameProxy::setUpPolicyListenerProxy):
1598         * UIProcess/WebFrameProxy.h:
1599         * UIProcess/WebPageProxy.cpp:
1600         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
1601         (WebKit::WebPageProxy::receivedPolicyDecision):
1602         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1603         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
1604         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
1605         (WebKit::WebPageProxy::decidePolicyForResponse):
1606         * UIProcess/WebPageProxy.h:
1607         * UIProcess/WebPageProxy.messages.in:
1608         * WebKit.xcodeproj/project.pbxproj:
1609         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1610         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
1611         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1612         * WebProcess/WebPage/WebFrame.cpp:
1613         (WebKit::toPolicyAction):
1614         (WebKit::WebFrame::didReceivePolicyDecision):
1615         * WebProcess/WebPage/WebFrame.h:
1616         * WebProcess/WebPage/WebPage.cpp:
1617         (WebKit::WebPage::didReceivePolicyDecision):
1618         * WebProcess/WebPage/WebPage.h:
1619         * WebProcess/WebPage/WebPage.messages.in:
1620
1621 2018-12-14  David Quesada  <david_quesada@apple.com>
1622
1623         Remove a global 'using namespace WebKit' in WebViewImpl.mm
1624         https://bugs.webkit.org/show_bug.cgi?id=192690
1625
1626         Reviewed by Tim Horton.
1627
1628         * UIProcess/Cocoa/WebViewImpl.mm:
1629         (-[WKTextListTouchBarViewController initWithWebViewImpl:]):
1630         (-[WKTextListTouchBarViewController _selectList:]):
1631         (-[WKTextListTouchBarViewController setCurrentListType:]):
1632         (-[WKTextTouchBarItemController initWithWebViewImpl:]):
1633
1634 2018-12-14  Chris Dumez  <cdumez@apple.com>
1635
1636         [PSON] WebsitePolicies are lost on process-swap
1637         https://bugs.webkit.org/show_bug.cgi?id=192694
1638         <rdar://problem/46715748>
1639
1640         Reviewed by Brady Eidson.
1641
1642         In case of process-swap on navigation, instead of sending the websitePolicies to the old
1643         process, send them to the new process as we trigger the navigation. We tell the new process
1644         that it is continuing a load and it will therefore not re-trigger a decidePolicyForNavigationAction.
1645
1646         * Shared/LoadParameters.cpp:
1647         (WebKit::LoadParameters::encode const):
1648         (WebKit::LoadParameters::decode):
1649         * Shared/LoadParameters.h:
1650         * UIProcess/WebPageProxy.cpp:
1651         (WebKit::WebPageProxy::reattachToWebProcessForReload):
1652         (WebKit::WebPageProxy::reattachToWebProcessWithItem):
1653         (WebKit::WebPageProxy::loadRequestWithNavigation):
1654         (WebKit::WebPageProxy::loadDataWithNavigation):
1655         (WebKit::WebPageProxy::goToBackForwardItem):
1656         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
1657         (WebKit::WebPageProxy::continueNavigationInNewProcess):
1658         * UIProcess/WebPageProxy.h:
1659         * WebProcess/WebPage/WebPage.cpp:
1660         (WebKit::WebPage::loadRequest):
1661         (WebKit::WebPage::loadDataImpl):
1662         (WebKit::WebPage::loadData):
1663         (WebKit::WebPage::loadAlternateHTML):
1664         (WebKit::WebPage::goToBackForwardItem):
1665         (WebKit::WebPage::createDocumentLoader):
1666         * WebProcess/WebPage/WebPage.h:
1667         * WebProcess/WebPage/WebPage.messages.in:
1668
1669 2018-12-14  Patrick Griffis  <pgriffis@igalia.com>
1670
1671         [GTK][WPE] Fix forwarding webkit socket to flatpak sandbox
1672         https://bugs.webkit.org/show_bug.cgi?id=192622
1673
1674         Reviewed by Michael Catanzaro.
1675
1676         This fixes running with the sandbox enabled in Flatpak.
1677
1678         * UIProcess/Launcher/glib/FlatpakLauncher.cpp:
1679         (WebKit::flatpakSpawn):
1680         * UIProcess/Launcher/glib/FlatpakLauncher.h:
1681         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
1682         (WebKit::ProcessLauncher::launchProcess):
1683
1684 2018-12-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1685
1686         [WPE] Use new view state API from libwpe
1687         https://bugs.webkit.org/show_bug.cgi?id=191906
1688
1689         Reviewed by Žan Doberšek.
1690
1691         Remove WKViewSetViewState from the C API.
1692
1693         * UIProcess/API/C/wpe/WKAPICastWPE.h:
1694         * UIProcess/API/C/wpe/WKView.cpp:
1695         * UIProcess/API/C/wpe/WKView.h:
1696         * UIProcess/API/wpe/WPEView.cpp:
1697         (WKWPE::View::View): Add implementation for activity_state_changed vfunc of the view backend client.):
1698         (WKWPE::View::setViewState): Remove the default flags.
1699         * UIProcess/API/wpe/WPEView.h:
1700         (WKWPE::View::setViewState const): Make it private.
1701
1702 2018-12-13  Joseph Pecoraro  <pecoraro@apple.com>
1703
1704         [iOS] Web Inspector: Occasional UIProcess crashes under WebPageProxy::showInspectorIndication
1705         https://bugs.webkit.org/show_bug.cgi?id=192689
1706         <rdar://problem/46323610>
1707
1708         Reviewed by Simon Fraser.
1709
1710         * UIProcess/WebPageProxy.cpp:
1711         (WebKit::WebPageProxy::close):
1712         * UIProcess/WebPageProxy.h:
1713         Don't wait until ~WebPageProxy to destroy the WebPageProxyDebuggable
1714         which broadcasts it as a remote inspector target. Terminate this
1715         as soon as the WebPageProxy closes and becomes invalid.
1716
1717 2018-12-13  Chris Dumez  <cdumez@apple.com>
1718
1719         Unreviewed build fix for tvOS.
1720
1721         * Platform/cocoa/WKCrashReporter.mm:
1722
1723 2018-12-13  Chris Dumez  <cdumez@apple.com>
1724
1725         Unreviewed build fix for tvOS.
1726
1727         * Platform/cocoa/WKCrashReporter.mm:
1728
1729 2018-12-13  Chris Dumez  <cdumez@apple.com>
1730
1731         [PSON] We should not need to navigate to 'about:blank' to suspend pages
1732         https://bugs.webkit.org/show_bug.cgi?id=192668
1733         <rdar://problem/46701466>
1734
1735         Reviewed by Alex Christensen.
1736
1737         To support PageCache when process-swap on cross-site navigation is enabled,
1738         we've been navigating the previous process to 'about:blank' when swapping.
1739         This would trigger PageCaching of the page in the old process. While
1740         convenient, this design has led to a lot of bugs because we did not really
1741         want a navigation to happen in the old process.
1742
1743         To address the issue, when a WebPage is asked to suspend (for process-swap),
1744         we now attempt to add it to PageCache and save it on the current HistoryItem,
1745         *without* triggering any navigation. Any pending navigation gets cancelled
1746         and we just suspend in place.
1747
1748         Later on, when we want to go back to this HistoryItem, we simply leverage the
1749         existing WebPage::goToBackForwardItem() code path. The only subtlety is that
1750         we're actually asking the WebPage to load a HistoryItem that is the current
1751         one in the History. I had to tweak a some logic / assertions to support this
1752         as this is not something we usually do. However, it actually works with very
1753         little changes and successfully restores the PageCache entry on the current
1754         HistoryItem.
1755
1756         There is no expected overall behavior change and ProcessSwap API tests (which
1757         cover PageCache) still pass. This is merely a simpler design because it avoids
1758         navigating to about:blank.
1759
1760         * UIProcess/SuspendedPageProxy.cpp:
1761         (WebKit::SuspendedPageProxy::didSuspend):
1762         (WebKit::SuspendedPageProxy::didReceiveMessage):
1763         * UIProcess/SuspendedPageProxy.h:
1764         * UIProcess/WebPageProxy.cpp:
1765         (WebKit::WebPageProxy::didSuspendAfterProcessSwap):
1766         * UIProcess/WebPageProxy.h:
1767         * UIProcess/WebPageProxy.messages.in:
1768         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1769         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
1770         * WebProcess/WebPage/WebDocumentLoader.cpp:
1771         (WebKit::WebDocumentLoader::setNavigationID):
1772         * WebProcess/WebPage/WebFrame.cpp:
1773         (WebKit::WebFrame::didReceivePolicyDecision):
1774         * WebProcess/WebPage/WebPage.cpp:
1775         (WebKit::WebPage::suspendForProcessSwap):
1776         * WebProcess/WebPage/WebPage.h:
1777         * WebProcess/cocoa/WebProcessCocoa.mm:
1778         (WebKit::origin):
1779
1780 2018-12-13  Per Arne Vollan  <pvollan@apple.com>
1781
1782         [macOS] Remove with-report from 3 services that are currently needed on macOS
1783         https://bugs.webkit.org/show_bug.cgi?id=192593
1784         <rdar://problem/46604752>
1785
1786         Reviewed by Brent Fulgham.
1787
1788         * WebProcess/com.apple.WebProcess.sb.in:
1789
1790 2018-12-13  Youenn Fablet  <youenn@apple.com>
1791
1792         On page close, WebPage::m_userMediaPermissionRequestManager is nullified too early
1793         https://bugs.webkit.org/show_bug.cgi?id=192657
1794
1795         Reviewed by Eric Carlson.
1796
1797         Instead of nullifying the manager, make it a UniqueRef and clear it on closing the page.
1798         This ensures we revoke the sandbox extensions as early as possible and keep the manager lifetime simple.
1799
1800         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
1801         (WebKit::UserMediaPermissionRequestManager::~UserMediaPermissionRequestManager):
1802         (WebKit::UserMediaPermissionRequestManager::clear):
1803         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
1804         * WebProcess/WebPage/WebPage.cpp:
1805         (WebKit::WebPage::close):
1806         * WebProcess/WebPage/WebPage.h:
1807         (WebKit::WebPage::userMediaPermissionRequestManager):
1808
1809 2018-12-13  Chris Fleizach  <cfleizach@apple.com>
1810
1811         [meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
1812         https://bugs.webkit.org/show_bug.cgi?id=192449
1813         <rdar://problem/46595508>
1814
1815         Reviewed by Darin Adler.
1816
1817         Part 6: Files in plugin process and UI process.
1818
1819         * PluginProcess/PluginControllerProxy.cpp:
1820         * PluginProcess/PluginProcess.cpp:
1821         * PluginProcess/WebProcessConnection.cpp:
1822         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
1823         * UIProcess/WebStorage/LocalStorageDatabase.cpp:
1824         * UIProcess/mac/WebPageProxyMac.mm:
1825
1826 2018-12-13  Eric Carlson  <eric.carlson@apple.com>
1827
1828         [MediaStream] Calculate width or height when constraints contain only the other
1829         https://bugs.webkit.org/show_bug.cgi?id=192632
1830         <rdar://problem/46665734>
1831
1832         Reviewed by Youenn Fablet.
1833
1834         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
1835         (WebKit::UserMediaCaptureManagerProxy::SourceProxy::remoteVideoSampleAvailable): Deleted,
1836         replaced with videoSampleAvailable.
1837
1838         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
1839         (WebKit::UserMediaCaptureManager::Source::remoteVideoSampleAvailable): Use original frame
1840         size if necessary when calculating new frame size.
1841
1842 2018-12-12  Chris Fleizach  <cfleizach@apple.com>
1843
1844         [meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
1845         https://bugs.webkit.org/show_bug.cgi?id=192449
1846         <rdar://problem/46595508>
1847
1848         Reviewed by Darin Adler.
1849
1850         Part 5: Files in WebProcess folder.
1851
1852         * WebProcess/Cache/WebCacheStorageConnection.cpp:
1853         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
1854         (mediaTimeToCurrentTime):
1855         (-[WKAnimationDelegate initWithLayerID:layerTreeHost:]):
1856         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
1857         (-[WKAccessibilityWebPageObject accessibilityHitTest:]):
1858
1859 2018-12-12  Ross Kirsling  <ross.kirsling@sony.com>
1860
1861         [MSVC] Unreviewed build fix for r239080.
1862
1863         * UIProcess/WebPageProxy.cpp:
1864         (WebKit::WebPageProxy::didFailToSuspendAfterProcessSwap):
1865
1866 2018-12-12  Chris Fleizach  <cfleizach@apple.com>
1867
1868         [meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
1869         https://bugs.webkit.org/show_bug.cgi?id=192449
1870         <rdar://problem/46595508>
1871
1872         Reviewed by Darin Adler.
1873
1874         Part 4: Handling NetworkProcess folder.
1875
1876         * NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
1877         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
1878         * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
1879         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
1880         * NetworkProcess/ios/NetworkProcessIOS.mm:
1881         * NetworkProcess/mac/NetworkProcessMac.mm:
1882         * NetworkProcess/mac/RemoteNetworkingContext.mm:
1883
1884 2018-12-12  Chris Fleizach  <cfleizach@apple.com>
1885
1886         [meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
1887         https://bugs.webkit.org/show_bug.cgi?id=192449
1888         <rdar://problem/46595508>
1889
1890         Reviewed by Tim Horton.
1891
1892         Fix iosmac build.
1893
1894         * UIProcess/ios/WKContentViewInteraction.mm:
1895         (-[WKContentView _hoverGestureRecognizerChanged:]):
1896
1897 2018-12-12  Alex Christensen  <achristensen@webkit.org>
1898
1899         Implement safe browsing in WebKit on WatchOS
1900         https://bugs.webkit.org/show_bug.cgi?id=192641
1901         <rdar://problem/46376188>
1902
1903         Reviewed by Geoff Garen.
1904
1905         WatchOS has a few special requirements:
1906         1. The margin size needs to be smaller and the title font smaller to fit on the screen.
1907         2. The exclamation point cannot be beside the title or it won't fit on the screen.  I put it above the title.
1908         3. The application must be told when the safe browsing warning has been shown.  I added a new delegate callback.
1909         4. The UIScrollView's contentSize must be set even before the details are shown to be able to scroll down to the buttons.
1910            This was already an issue on small WKWebViews on iOS, so this fixes both operating systems.
1911
1912         * Configurations/WebKit.xcconfig:
1913         * UIProcess/API/APIUIClient.h:
1914         (API::UIClient::didShowSafeBrowsingWarning):
1915         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1916         * UIProcess/Cocoa/UIDelegate.h:
1917         * UIProcess/Cocoa/UIDelegate.mm:
1918         (WebKit::UIDelegate::setDelegate):
1919         (WebKit::UIDelegate::UIClient::didShowSafeBrowsingWarning):
1920         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
1921         (fontOfSize):
1922         (buttonSize):
1923         (-[WKSafeBrowsingWarning addContent]):
1924         (-[WKSafeBrowsingWarning showDetailsClicked]):
1925         (-[WKSafeBrowsingWarning updateContentSize]):
1926         (buttonWidth): Deleted.
1927         * UIProcess/WebPageProxy.cpp:
1928         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1929
1930 2018-12-12  Commit Queue  <commit-queue@webkit.org>
1931
1932         Unreviewed, rolling out r239129 and r239131.
1933         https://bugs.webkit.org/show_bug.cgi?id=192646
1934
1935         Casued macOS and iOS Debug testing to fail early (Requested by
1936         Truitt on #webkit).
1937
1938         Reverted changesets:
1939
1940         "Unreviewed build fix for WinCairo Debug after r239080(?)."
1941         https://trac.webkit.org/changeset/239129
1942
1943         "Unreviewed fix for Cocoa Debug test instability following
1944         r239129."
1945         https://trac.webkit.org/changeset/239131
1946
1947 2018-12-12  Vivek Seth  <v_seth@apple.com>
1948
1949         HTTPS Upgrade: Figure out if/how to tell clients that the HTTPS upgrade happened
1950         https://bugs.webkit.org/show_bug.cgi?id=192375
1951         <rdar://problem/45851159>
1952
1953         Reviewed by Chris Dumez.
1954
1955         Use simulated redirect to tell clients that HTTPS Upgrade happened.
1956
1957         * NetworkProcess/NetworkLoadChecker.cpp:
1958         (WebKit::NetworkLoadChecker::NetworkLoadChecker):
1959         (WebKit::NetworkLoadChecker::checkRedirection):
1960         (WebKit::NetworkLoadChecker::accessControlErrorForValidationHandler):
1961         (WebKit::NetworkLoadChecker::applyHTTPSUpgradeIfNeeded const):
1962         (WebKit::NetworkLoadChecker::checkRequest):
1963         (WebKit::NetworkLoadChecker::continueCheckingRequestOrDoSyntheticRedirect):
1964         (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
1965         (WebKit::NetworkLoadChecker::applyHTTPSUpgradeIfNeeded): Deleted.
1966         * NetworkProcess/NetworkLoadChecker.h:
1967         * NetworkProcess/NetworkResourceLoader.cpp:
1968         (WebKit::NetworkResourceLoader::start):
1969         * NetworkProcess/PingLoad.cpp:
1970
1971 2018-12-12  Ross Kirsling  <ross.kirsling@sony.com>
1972
1973         Unreviewed fix for Cocoa Debug test instability following r239129.
1974
1975         * UIProcess/WebPageProxy.cpp:
1976         (WebKit::WebPageProxy::didFailToSuspendAfterProcessSwap): Deleted.
1977         * UIProcess/WebPageProxy.h:
1978         (WebKit::WebPageProxy::didFailToSuspendAfterProcessSwap):
1979         Move the whole assertion to the declaration site.
1980
1981 2018-12-12  Chris Dumez  <cdumez@apple.com>
1982
1983         Add a preference to enable / disable devicemotion and deviceorientation events
1984         https://bugs.webkit.org/show_bug.cgi?id=192631
1985         <rdar://problem/46646244>
1986
1987         Reviewed by Geoffrey Garen.
1988
1989         Add setting to toggle support for the deviceorientation / devicemotion events:
1990         - https://w3c.github.io/deviceorientation/
1991
1992         * Shared/WebPreferences.yaml:
1993         * UIProcess/API/Cocoa/WKPreferences.mm:
1994         (-[WKPreferences _setDeviceOrientationEventEnabled:]):
1995         (-[WKPreferences _deviceOrientationEventEnabled]):
1996         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1997
1998 2018-12-12  Ross Kirsling  <ross.kirsling@sony.com>
1999
2000         Unreviewed build fix for WinCairo Debug after r239080(?).
2001
2002         MSVC gives a redefinition error if noreturn is specified on the definition instead of the declaration.
2003
2004         * UIProcess/WebPageProxy.cpp:
2005         (WebKit::WebPageProxy::didFailToSuspendAfterProcessSwap):
2006         * UIProcess/WebPageProxy.h:
2007         Move NO_RETURN_DUE_TO_ASSERT to the declaration site.
2008
2009 2018-12-12  Chris Fleizach  <cfleizach@apple.com>
2010
2011         [meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
2012         https://bugs.webkit.org/show_bug.cgi?id=192449
2013         <rdar://problem/46595508>
2014
2015         Reviewed by Darin Adler.
2016
2017         Part 2: UIProcess/Cocoa and UIProcess/ios folders.
2018
2019         * UIProcess/Cocoa/WebViewImpl.h:
2020         * UIProcess/Cocoa/WebViewImpl.mm:
2021         * UIProcess/ios/WKContentView.mm:
2022         (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
2023         (-[WKContentView initWithFrame:processPool:configuration:webView:]):
2024         (-[WKContentView dealloc]):
2025         (-[WKContentView page]):
2026         (-[WKContentView updateFixedClippingView:]):
2027         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
2028         (-[WKContentView _updateForScreen:]):
2029         (-[WKContentView _accessibilityRegisterUIProcessTokens]):
2030         (-[WKContentView _createDrawingAreaProxy]):
2031         (-[WKContentView _didCommitLayerTree:]):
2032         (-[WKContentView _wk_pageCountForPrintFormatter:]):
2033         * UIProcess/ios/WKContentViewInteraction.mm:
2034         (-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:userObject:]):
2035         (hasAssistedNode):
2036         (-[WKContentView setupInteraction]):
2037         (-[WKContentView positionInformation]):
2038         (-[WKContentView _webTouchEventsRecognized:]):
2039         (inflateQuad):
2040         (-[WKContentView _updateTapHighlight]):
2041         (-[WKContentView _showTapHighlight]):
2042         (-[WKContentView _requiresKeyboardWhenFirstResponder]):
2043         (-[WKContentView _displayFormNodeInputView]):
2044         (-[WKContentView inputView]):
2045         (-[WKContentView _actionForLongPressFromPositionInformation:]):
2046         (-[WKContentView currentPositionInformation]):
2047         (-[WKContentView doAfterPositionInformationUpdate:forRequest:]):
2048         (-[WKContentView _currentPositionInformationIsValidForRequest:]):
2049         (-[WKContentView _hasValidOutstandingPositionInformationRequest:]):
2050         (-[WKContentView _currentPositionInformationIsApproximatelyValidForRequest:]):
2051         (-[WKContentView gestureRecognizerShouldBegin:]):
2052         (-[WKContentView hasSelectablePositionAtPoint:]):
2053         (-[WKContentView pointIsNearMarkedText:]):
2054         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
2055         (-[WKContentView webSelectionRectsForSelectionRects:]):
2056         (-[WKContentView _twoFingerSingleTapGestureRecognized:]):
2057         (-[WKContentView _stylusSingleTapRecognized:]):
2058         (-[WKContentView _singleTapCommited:]):
2059         (-[WKContentView _attemptClickAtLocation:]):
2060         (-[WKContentView _positionInformationDidChange:]):
2061         (-[WKContentView requiresAccessoryView]):
2062         (-[WKContentView supportedPasteboardTypesForCurrentSelection]):
2063         (-[WKContentView _lookupForWebView:]):
2064         (-[WKContentView _shareForWebView:]):
2065         (-[WKContentView textStylingAtPosition:inDirection:]):
2066         (-[WKContentView canPerformActionForWebView:withSender:]):
2067         (-[WKContentView selectForWebView:]):
2068         (-[WKContentView _accessibilityRetrieveRectsEnclosingSelectionOffset:withGranularity:]):
2069         (-[WKContentView _accessibilityRetrieveRectsAtSelectionOffset:withText:completionHandler:]):
2070         (toGestureType):
2071         (toUIWKGestureType):
2072         (toSelectionTouch):
2073         (toUIWKSelectionTouch):
2074         (toGestureRecognizerState):
2075         (toUIGestureRecognizerState):
2076         (toUIWKSelectionFlags):
2077         (toWKTextGranularity):
2078         (toWKSelectionDirection):
2079         (selectionChangedWithGesture):
2080         (selectionChangedWithTouch):
2081         (-[WKContentView changeSelectionWithGestureAt:withGesture:withState:withFlags:]):
2082         (-[WKContentView autocorrectionData]):
2083         (-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]):
2084         (-[WKContentView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]):
2085         (-[WKContentView _updateAccessory]):
2086         (-[WKContentView selectedTextRange]):
2087         (-[WKContentView setMarkedText:selectedRange:]):
2088         (coreWritingDirection):
2089         (-[WKContentView closestPositionToPoint:]):
2090         (-[WKContentView insertText:]):
2091         (-[WKContentView textInputTraits]):
2092         (-[WKContentView handleKeyWebEvent:]):
2093         (-[WKContentView handleKeyWebEvent:withCompletionHandler:]):
2094         (-[WKContentView isScrollableForKeyboardScrollViewAnimator:]):
2095         (-[WKContentView keyboardScrollViewAnimator:distanceForIncrement:]):
2096         (-[WKContentView assistedNodeInformation]):
2097         (-[WKContentView assistedNodeSelectOptions]):
2098         (isAssistableInputType):
2099         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
2100         (-[WKContentView _stopAssistingNode]):
2101         (-[WKContentView updateCurrentAssistedNodeInformation:]):
2102         (-[WKContentView presentViewControllerForCurrentAssistedNode]):
2103         (-[WKContentView actionNameForFocusedFormControlView:]):
2104         (-[WKContentView selectWordForReplacement]):
2105         (-[WKContentView _updateChangedSelection:]):
2106         (-[WKContentView _beginSuppressingSelectionAssistantForReason:]):
2107         (-[WKContentView _stopSuppressingSelectionAssistantForReason:]):
2108         (-[WKContentView _showPlaybackTargetPicker:fromRect:routeSharingPolicy:routingContextUID:]):
2109         (-[WKContentView _showRunOpenPanel:resultListener:]):
2110         (-[WKContentView _showShareSheet:completionHandler:]):
2111         (-[WKContentView positionInformationForActionSheetAssistant:]):
2112         (-[WKContentView updatePositionInformationForActionSheetAssistant:]):
2113         (-[WKContentView _startDrag:item:]):
2114         (-[WKContentView _didHandleAdditionalDragItemsRequest:]):
2115         (-[WKContentView _didHandleStartDataInteractionRequest:]):
2116         (dropOperationForWebCoreDragOperation):
2117         (-[WKContentView dragDataForDropSession:dragDestinationAction:]):
2118         (-[WKContentView _didConcludeEditDataInteraction:]):
2119         (-[WKContentView _didPerformDragOperation:]):
2120         (-[WKContentView _prepareToDragPromisedAttachment:]):
2121         (-[WKContentView _itemsForBeginningOrAddingToSessionWithRegistrationList:stagedDragSource:]):
2122         (-[WKContentView _autofillContext]):
2123         (-[WKContentView _dragInteraction:itemsForAddingToSession:withTouchAtPoint:completion:]):
2124         (-[WKContentView _dragInteraction:prepareForSession:completion:]):
2125         (-[WKContentView dragInteraction:itemsForBeginningSession:]):
2126         (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
2127         (-[WKContentView dragInteraction:session:didEndWithOperation:]):
2128         (-[WKContentView dragInteraction:item:willAnimateCancelWithAnimator:]):
2129         (-[WKContentView dropInteraction:performDrop:]):
2130         (-[WKContentView dropInteraction:sessionDidEnd:]):
2131         (-[WKContentView allowsLanguageSelectionMenuForListViewController:]):
2132         (-[WKContentView shouldDisplayInputContextViewForListViewController:]):
2133         (-[WKContentView numericInputModeForListViewController:]):
2134         (-[WKContentView textContentTypeForListViewController:]):
2135         (-[WKContentView allowsDictationInputForListViewController:]):
2136         (-[WKContentView _simulateLongPressActionAtLocation:]):
2137         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
2138         (-[WKContentView _presentationRectsForPreviewItemController:]):
2139         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
2140         (WKFullScreenViewControllerPlaybackSessionModelClient::setInterface):
2141         (WKFullScreenViewControllerVideoFullscreenModelClient::setInterface):
2142         (WKFullScreenViewControllerVideoFullscreenModelClient::interface const):
2143         (-[WKFullScreenViewController videoControlsManagerDidChange]):
2144         (-[WKFullScreenViewController _manager]):
2145         (-[WKFullScreenViewController _togglePiPAction:]):
2146         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
2147         (-[WKFullscreenAnimationController configureInitialAndFinalStatesForTransition:]):
2148         (-[WKFullScreenWindowController isFullScreen]):
2149         (-[WKFullScreenWindowController enterFullScreen]):
2150         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
2151         (-[WKFullScreenWindowController exitFullScreen]):
2152         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
2153         (-[WKFullScreenWindowController _completedExitFullScreen]):
2154         (-[WKFullScreenWindowController webViewDidRemoveFromSuperviewWhileInFullscreen]):
2155         (-[WKFullScreenWindowController _exitFullscreenImmediately]):
2156         (-[WKFullScreenWindowController _manager]):
2157
2158 2018-12-12  Chris Fleizach  <cfleizach@apple.com>
2159
2160         [meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
2161         https://bugs.webkit.org/show_bug.cgi?id=192449
2162         <rdar://problem/46595508>
2163
2164         Reviewed by Darin Adler.
2165
2166         Part 1: Files in Shared folder.
2167
2168         * Shared/API/c/WKRenderLayer.cpp:
2169         (WKRenderLayerGetFrameContentsLayer):
2170         * Shared/API/c/cf/WKErrorCF.cpp:
2171         (WKErrorCreateWithCFError):
2172         (WKErrorCopyCFError):
2173         * Shared/API/c/cg/WKImageCG.cpp:
2174         (WKImageCreateCGImage):
2175         (WKImageCreateFromCGImage):
2176         * Shared/API/c/mac/WKWebArchive.cpp:
2177         (WKWebArchiveGetTypeID):
2178         (WKWebArchiveCreate):
2179         (WKWebArchiveCreateWithData):
2180         (WKWebArchiveCreateFromRange):
2181         (WKWebArchiveCopyMainResource):
2182         (WKWebArchiveCopySubresources):
2183         (WKWebArchiveCopySubframeArchives):
2184         (WKWebArchiveCopyData):
2185         * Shared/API/c/mac/WKWebArchiveResource.cpp:
2186         (WKWebArchiveResourceGetTypeID):
2187         (WKWebArchiveResourceCreate):
2188         (WKWebArchiveResourceCopyData):
2189         (WKWebArchiveResourceCopyURL):
2190         (WKWebArchiveResourceCopyMIMEType):
2191         (WKWebArchiveResourceCopyTextEncoding):
2192         * Shared/ChildProcess.cpp:
2193         * Shared/ContextMenuContextData.cpp:
2194         * Shared/EditorState.cpp:
2195         * Shared/Plugins/NPIdentifierData.cpp:
2196         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
2197         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
2198         * Shared/SessionState.cpp:
2199         * Shared/SessionTracker.cpp:
2200         * Shared/ShareableBitmap.cpp:
2201         * Shared/ShareableResource.cpp:
2202         * Shared/VisibleContentRectUpdateInfo.cpp:
2203         * Shared/WebBackForwardListItem.cpp:
2204         * Shared/WebContextMenuItemData.cpp:
2205         * Shared/WebCoreArgumentCoders.cpp:
2206         * Shared/WebHitTestResultData.cpp:
2207         * Shared/WebImage.cpp:
2208         * Shared/WebMediaSessionMetadata.cpp:
2209         * Shared/WebMemorySampler.cpp:
2210         * Shared/WebMouseEvent.cpp:
2211         * Shared/WebRenderObject.cpp:
2212         * Shared/WebSQLiteDatabaseTracker.cpp:
2213         * Shared/WebWheelEvent.cpp:
2214         * Shared/cf/ArgumentCodersCF.cpp:
2215         * Shared/ios/WebPlatformTouchPointIOS.cpp:
2216
2217 2018-12-12  Chris Fleizach  <cfleizach@apple.com>
2218
2219         [meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
2220         https://bugs.webkit.org/show_bug.cgi?id=192449
2221         <rdar://problem/46595508>
2222
2223         Reviewed by Darin Adler.
2224
2225         Part 1: Files in NetworkProcess.
2226
2227         * NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
2228         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
2229         * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
2230         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
2231         * NetworkProcess/ios/NetworkProcessIOS.mm:
2232         * NetworkProcess/mac/NetworkProcessMac.mm:
2233         * NetworkProcess/mac/RemoteNetworkingContext.mm:
2234
2235 2018-12-12  Chris Dumez  <cdumez@apple.com>
2236
2237         Unreviewed build with with recent macOS SDKs.
2238
2239         * Platform/cocoa/WKCrashReporter.mm:
2240
2241 2018-12-12  Chris Dumez  <cdumez@apple.com>
2242
2243         Unreviewed attempt to fix GTK build after r239104.
2244
2245         * UIProcess/WebPageProxy.cpp:
2246         (WebKit::WebPageProxy::performDragControllerAction):
2247
2248 2018-12-12  Chris Dumez  <cdumez@apple.com>
2249
2250         Unreviewed attempt to fix build with older SDKs after r239110.
2251
2252         * Platform/cocoa/WKCrashReporter.mm:
2253
2254 2018-12-12  Chris Dumez  <cdumez@apple.com>
2255
2256         Unreviewed, fix build with recent SDKs.
2257
2258         * Platform/cocoa/WKCrashReporter.mm:
2259
2260 2018-12-09  Darin Adler  <darin@apple.com>
2261
2262         [iOS] Zero memory containing the password for PDF documents when a WKPDFView is deallocated
2263         https://bugs.webkit.org/show_bug.cgi?id=192536
2264         rdar://problem/41174451
2265
2266         Reviewed by Tim Horton.
2267
2268         * UIProcess/ios/WKPDFView.mm: Took out PLATFORM(IOSMAC) since
2269         this class is not compiled on that platform at this time. Can always
2270         add it back later.
2271         (-[WKPDFView dealloc]): Zero out characters of _passwordForPrinting.
2272         (-[WKPDFView pdfHostViewController:documentDidUnlockWithPassword:]):
2273         Initialize _passwordForPrinting; use a CString instead of retaining
2274         an NSString since we can zero that out easily.
2275         (-[WKPDFView _ensureDocumentForPrinting]): Use _passwordForPrinting.
2276
2277 2018-12-12  Commit Queue  <commit-queue@webkit.org>
2278
2279         Unreviewed, rolling out r239103.
2280         https://bugs.webkit.org/show_bug.cgi?id=192627
2281
2282         It broke the built because it depends on another patch that
2283         didn't land yet (Requested by KaL on #webkit).
2284
2285         Reverted changeset:
2286
2287         "[WPE] Add API to notify about frame displayed view backend
2288         callback"
2289         https://bugs.webkit.org/show_bug.cgi?id=192224
2290         https://trac.webkit.org/changeset/239103
2291
2292 2018-12-12  Chris Dumez  <cdumez@apple.com>
2293
2294         Restore MESSAGE_CHECK_URL() security check on sourceURL in didPerformClientRedirect()
2295         https://bugs.webkit.org/show_bug.cgi?id=191982
2296         <rdar://problem/46258054>
2297
2298         Reviewed by Alex Christensen.
2299
2300         Have the WebPageProxy remember the local paths it previously visited so that the
2301         MESSAGE_CHECK_URL() checks still work when process-swap on navigation is enabled.
2302
2303         Add back MESSAGE_CHECK_URL() on sourceURL in didPerformClientRedirect().
2304
2305         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
2306         (WebKit::WebPageProxy::createSandboxExtensionsIfNeeded):
2307         * UIProcess/RemoteWebInspectorProxy.cpp:
2308         (WebKit::RemoteWebInspectorProxy::createFrontendPageAndWindow):
2309         * UIProcess/WebInspectorProxy.cpp:
2310         (WebKit::WebInspectorProxy::createFrontendPage):
2311         * UIProcess/WebPageProxy.cpp:
2312         (WebKit::WebPageProxy::loadRequestWithNavigation):
2313         (WebKit::WebPageProxy::loadFile):
2314         (WebKit::WebPageProxy::loadDataWithNavigation):
2315         (WebKit::WebPageProxy::loadAlternateHTML):
2316         (WebKit::WebPageProxy::reload):
2317         (WebKit::WebPageProxy::didPerformClientRedirect):
2318         (WebKit::WebPageProxy::backForwardGoToItem):
2319         (WebKit::WebPageProxy::checkURLReceivedFromCurrentOrPreviousWebProcess):
2320         (WebKit::WebPageProxy::addPreviouslyVisitedPath):
2321         (WebKit::WebPageProxy::willAcquireUniversalFileReadSandboxExtension):
2322         * UIProcess/WebPageProxy.h:
2323         * UIProcess/WebProcessProxy.cpp:
2324         (WebKit::WebProcessProxy::assumeReadAccessToBaseURL):
2325         * UIProcess/WebProcessProxy.h:
2326         * UIProcess/mac/WebPageProxyMac.mm:
2327
2328 2018-11-30  Carlos Garcia Campos  <cgarcia@igalia.com>
2329
2330         [WPE] Add API to notify about frame displayed view backend callback
2331         https://bugs.webkit.org/show_bug.cgi?id=192224
2332
2333         Reviewed by Michael Catanzaro.
2334
2335         Add API to add a callback to the view to be called when the view backend notifies that a frame has been
2336         displayed.
2337
2338         * UIProcess/API/glib/WebKitWebView.cpp:
2339         (FrameDisplayedCallback::FrameDisplayedCallback):
2340         (FrameDisplayedCallback::~FrameDisplayedCallback):
2341         (webkit_web_view_add_frame_displayed_callback):
2342         (webkit_web_view_remove_frame_displayed_callback):
2343         * UIProcess/API/wpe/WebKitWebView.h:
2344
2345 2018-12-11  Justin Michaud  <justin_michaud@apple.com>
2346
2347         Implement feature flag for CSS Typed OM
2348         https://bugs.webkit.org/show_bug.cgi?id=192610
2349
2350         Reviewed by Ryosuke Niwa.
2351
2352         * Configurations/FeatureDefines.xcconfig:
2353         * Shared/WebPreferences.yaml:
2354         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2355         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2356
2357 2018-12-11  Fujii Hironori  <Hironori.Fujii@sony.com>
2358
2359         [Win][Clang] Fix warning -Wmissing-field-initializers
2360         https://bugs.webkit.org/show_bug.cgi?id=192584
2361
2362         Reviewed by Yusuke Suzuki.
2363
2364         Initialize a struct with '{ }' instead of '= {0}'.
2365
2366         * UIProcess/Launcher/win/ProcessLauncherWin.cpp:
2367         (WebKit::ProcessLauncher::launchProcess):
2368         * UIProcess/win/WebPopupMenuProxyWin.cpp:
2369         (WebKit::WebPopupMenuProxyWin::showPopupMenu):
2370         * UIProcess/win/WebView.cpp:
2371         (WebKit::WebView::initializeToolTipWindow):
2372         (WebKit::WebView::setToolTip):
2373
2374 2018-12-11  Chris Dumez  <cdumez@apple.com>
2375
2376         PSON logic gets confused by concurrent decidePolicyForNavigationAction requests
2377         https://bugs.webkit.org/show_bug.cgi?id=192482
2378         <rdar://problem/46470145>
2379
2380         Reviewed by Antti Koivisto.
2381
2382         It is possible to get 2 parallel decidePolicyForNavigationAction() requests from the
2383         WebProcess when a new load is started before responding to the existing policy
2384         decision. This would lead to several issues with regards to PSON:
2385         - We would decide to swap for the first policy decision and tell the WebProcess to
2386           suspend. However, because the WebProcess issued a new decidePolicyForNavigationAction
2387           since for the same frame, the previous one is invalidated and the WebProcess would
2388           ignore our request to suspend.
2389         - We would hit assertions later on because the navigation has been destroyed and yet
2390           we're getting a didStartProvisionalLoad for it.
2391         - swapToWebProcess() was asynchronous so that it would wait for the destination
2392           SuspendedPage to finish suspending before asking it to unsuspend. This led to various
2393           problems because anything can happen in the UIProcess while we're waiting for the
2394           suspension (e.g. another load). Also, we may create the SuspendedPageProxy for
2395           the current page too late and start getting IPC from the previous process about
2396           the suspension load to about:blank.
2397
2398         To address these issues, the following design is now implemented:
2399         - swapToWebProcess() is no longer asynchronous
2400         - instead, WebProcessPool::processForNavigation() is now asynchronous. This is better
2401           because at this point we have not yet told the WebProcess about the policy decision.
2402           We already properly deal with the policy decision being made asynchronously. This
2403           also allows us to choose another process if the SuspendedPage we'd like to use
2404           failed to suspend.
2405         - If the WebProcess receives a PolicyAction::Suspend but ignores it, have it send an
2406           IPC to the UIProcess so that the SuspendedPageProxy knows about it. We then destroy
2407           the SuspendedPageProxy and make sure it is not used.
2408         - After the asynchronous process selection, if the navigation has been destroy, abort
2409           the process-swap to avoid hitting assertions later on due to doing a load for a
2410           destroyed navigation.
2411
2412         * UIProcess/SuspendedPageProxy.cpp:
2413         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
2414         Make sure m_whenReadyToConsume completion handler gets called if necessary if the
2415         SuspendedPageProxy gets destroyed. We pass null so that the SuspendedPage is not
2416         used.
2417
2418         (WebKit::SuspendedPageProxy::whenReadyToConsume):
2419         Add whenReadyToConsume() utility method to get a completion handler called when
2420         the SuspendedPageProxy is ready to be used. This basically means we have to wait
2421         for the page to finish its about:blank suspension load. If the suspension fails
2422         then we call the completion handler with null to indicate that the suspended
2423         page is not usable.
2424
2425         (WebKit::SuspendedPageProxy::unsuspendAndConsume):
2426         Rename unsuspend() to unsuspendAndConsume() and make it synchronous. This only gets
2427         called after whenReadyToConsume()'s completion handler has been called and if we
2428         do decide to use the SuspendedPageProxy. It tells the WebProcess to unsuspend and
2429         removes the SuspendedPageProxy from the WebProcessPool.
2430
2431         (WebKit::SuspendedPageProxy::didFinishLoad):
2432         rename m_finishedSuspendingHandler to m_whenReadyToConsume.
2433
2434         (WebKit::SuspendedPageProxy::didFailToSuspend):
2435         Add new didFailToSuspend() that gets called when the WebProcess sends us an IPC telling
2436         us it ignored our request to suspend. We then call m_whenReadyToConsume completion
2437         handler with null and destroy the SuspendedPageProxy.
2438
2439         (WebKit::SuspendedPageProxy::didReceiveMessage):
2440         * UIProcess/SuspendedPageProxy.h:
2441
2442         * UIProcess/WebNavigationState.h:
2443         (WebKit::WebNavigationState::hasNavigation const):
2444         Add utility function to query if a navigation is still valid.
2445
2446         * UIProcess/WebPageProxy.cpp:
2447         (WebKit::WebPageProxy::swapToWebProcess):
2448         Update method so that it is no longer asynchronous. Some of its code was also moved to
2449         continueNavigationInNewProcess() for clarity.
2450
2451         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
2452         Deal with WebProcessPool::processForNavigation() now being asynchronous.
2453
2454         (WebKit::WebPageProxy::continueNavigationInNewProcess):
2455         Update code now that swapToWebProcess() is no longer asynchronous. Some of the swapToWebProcess()
2456         code was also moved here for clarity.
2457
2458         (WebKit::WebPageProxy::didFailToSuspendAfterProcessSwap):
2459
2460         * UIProcess/WebPageProxy.h:
2461         * UIProcess/WebPageProxy.messages.in:
2462         Add new DidFailToSuspendAfterProcessSwap IPC message.
2463
2464         * UIProcess/WebProcessPool.cpp:
2465         (WebKit::WebProcessPool::processForNavigation):
2466         (WebKit::WebProcessPool::processForNavigationInternal):
2467         * UIProcess/WebProcessPool.h:
2468         Make asynchronous. If we decide to use a SuspendedPageProxy's process, then call
2469         whenReadyToConsume() on it to wait for it to suspend. If the SuspendedPageProxy
2470         fails to suspend use a new process instead.
2471
2472         * WebProcess/WebPage/WebFrame.cpp:
2473         (WebKit::WebFrame::didReceivePolicyDecision):
2474         If we ignore the policy decision and the decision was "Suspend", send the DidFailToSuspendAfterProcessSwap
2475         IPC to the UIProcess so that the SuspendedPageProxy knows about it.
2476
2477 2018-12-11  Andy Estes  <aestes@apple.com>
2478
2479         Introduce makeBlockPtr for lambdas
2480         https://bugs.webkit.org/show_bug.cgi?id=192594
2481
2482         Reviewed by Alex Christensen.
2483
2484         Adopted makeBlockPtr.
2485
2486         * NetworkProcess/Downloads/cocoa/WKDownloadProgress.mm:
2487         (-[WKDownloadProgress initWithDownloadTask:download:URL:sandboxExtension:]):
2488         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
2489         (WebKit::NetworkCache::IOChannel::read):
2490         (WebKit::NetworkCache::IOChannel::write):
2491         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2492         (WebKit::NetworkProcess::clearDiskCache):
2493         (WebKit::saveCookies):
2494         * NetworkProcess/watchos/NetworkProximityAssertion.mm:
2495         (WebKit::BluetoothProximityAssertion::suspend):
2496         * UIProcess/API/Cocoa/WKWebView.mm:
2497         (-[WKWebView _setInputDelegate:]):
2498         * UIProcess/API/mac/WKView.mm:
2499         (-[WKView maybeInstallIconLoadingClient]):
2500         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2501         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
2502         (WebKit::WebPaymentCoordinatorProxy::platformOpenPaymentSetup):
2503         * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
2504         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
2505         * UIProcess/Cocoa/AutomationSessionClient.mm:
2506         (WebKit::AutomationSessionClient::requestNewPageWithOptions):
2507         (WebKit::AutomationSessionClient::requestSwitchToPage):
2508         (WebKit::AutomationSessionClient::requestHideWindowOfPage):
2509         (WebKit::AutomationSessionClient::requestRestoreWindowOfPage):
2510         (WebKit::AutomationSessionClient::requestMaximizeWindowOfPage):
2511         * UIProcess/Cocoa/DownloadClient.mm:
2512         (WebKit::DownloadClient::didReceiveAuthenticationChallenge):
2513         (WebKit::DownloadClient::decideDestinationWithSuggestedFilename):
2514         * UIProcess/Cocoa/IconLoadingDelegate.mm:
2515         (WebKit::IconLoadingDelegate::IconLoadingClient::getLoadDecisionForIcon):
2516         * UIProcess/Cocoa/NavigationState.mm:
2517         (WebKit::NavigationState::NavigationClient::decidePolicyForPluginLoad):
2518         (WebKit::NavigationState::NavigationClient::webGLLoadPolicy const):
2519         (WebKit::NavigationState::NavigationClient::resolveWebGLLoadPolicy const):
2520         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
2521         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):
2522         (WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge):
2523         * UIProcess/Cocoa/UIDelegate.mm:
2524         (WebKit::UIDelegate::ContextMenuClient::menuFromProposedMenu):
2525         (WebKit::UIDelegate::UIClient::createNewPage):
2526         (WebKit::UIDelegate::UIClient::runJavaScriptAlert):
2527         (WebKit::UIDelegate::UIClient::runJavaScriptConfirm):
2528         (WebKit::UIDelegate::UIClient::runJavaScriptPrompt):
2529         (WebKit::UIDelegate::UIClient::requestStorageAccessConfirm):
2530         (WebKit::UIDelegate::UIClient::decidePolicyForGeolocationPermissionRequest):
2531         (WebKit::UIDelegate::UIClient::runBeforeUnloadConfirmPanel):
2532         (WebKit::UIDelegate::UIClient::exceededDatabaseQuota):
2533         (WebKit::UIDelegate::UIClient::windowFrame):
2534         (WebKit::UIDelegate::UIClient::toolbarsAreVisible):
2535         (WebKit::UIDelegate::UIClient::decidePolicyForNotificationPermissionRequest):
2536         (WebKit::UIDelegate::UIClient::runOpenPanel):
2537         (WebKit::requestUserMediaAuthorizationForDevices):
2538         (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
2539         (WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin):
2540         (WebKit::UIDelegate::UIClient::reachedApplicationCacheOriginQuota):
2541         (WebKit::UIDelegate::UIClient::requestPointerLock):
2542         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
2543         (-[WKSafeBrowsingWarning clickedOnLink:]):
2544         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
2545         (WebKit::WebPageProxy::beginSafeBrowsingCheck):
2546         * UIProcess/WebAuthentication/Cocoa/HidConnection.mm:
2547         (WebKit::HidConnection::send):
2548         * UIProcess/WebAuthentication/Cocoa/LocalConnection.mm:
2549         (WebKit::LocalConnection::getUserConsent const):
2550         (WebKit::LocalConnection::getAttestation const):
2551         * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
2552         (WebKit::MockHidConnection::send):
2553         * UIProcess/ios/PageClientImplIOS.mm:
2554         (WebKit::PageClientImpl::requestPasswordForQuickLookDocument):
2555         * UIProcess/ios/WKGeolocationProviderIOS.mm:
2556         (-[WKGeolocationProviderIOS geolocationAuthorizationGranted]):
2557         * UIProcess/mac/ServicesController.mm:
2558         (WebKit::hasCompatibleServicesForItems):
2559         (WebKit::ServicesController::refreshExistingServices):
2560         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2561         (PageLoaderClient::didStartProvisionalLoadForFrame):
2562
2563 2018-12-11  Alex Christensen  <achristensen@webkit.org>
2564
2565         Fix an internal build failure after r239014
2566         https://bugs.webkit.org/show_bug.cgi?id=192205
2567
2568         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
2569         (fontOfSize):
2570         There's a system that doesn't have safe browsing or UIFontTextStyleLargeTitle.
2571
2572 2018-12-11  Brian Burg  <bburg@apple.com>
2573
2574         SimulatedInputDispatcher::transitionInputSourceToState() can reuse a moved-from completion handler
2575         https://bugs.webkit.org/show_bug.cgi?id=191155
2576         <rdar://problem/45745569>
2577
2578         Reviewed by Joseph Pecoraro.
2579
2580         * UIProcess/Automation/SimulatedInputDispatcher.cpp:
2581         (WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
2582         Add an ASSERT to guard against unexpected inputs where >1 VirtualKey changes per state.
2583         webkitdriver needs to be updated to not produce such states in this scenario, but this will
2584         avoid a runtime crash caused by trying to call a moved-out completion handler a second time.
2585
2586 2018-12-11  Commit Queue  <commit-queue@webkit.org>
2587
2588         Unreviewed, rolling out r239071.
2589         https://bugs.webkit.org/show_bug.cgi?id=192588
2590
2591         Broke WPE build due to undefined references to toAPI() and
2592         toImpl() inside the C API (Requested by magomez on #webkit).
2593
2594         Reverted changeset:
2595
2596         "[meta][WebKit] Remove using namespace WebCore and WebKit in
2597         the global scope for unified source builds"
2598         https://bugs.webkit.org/show_bug.cgi?id=192449
2599         https://trac.webkit.org/changeset/239071
2600
2601 2018-12-10  Chris Fleizach  <cfleizach@apple.com>
2602
2603         [meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
2604         https://bugs.webkit.org/show_bug.cgi?id=192449
2605
2606         Reviewed by Darin Adler.
2607
2608         * NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
2609         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
2610         * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
2611         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
2612         * NetworkProcess/ios/NetworkProcessIOS.mm:
2613         * NetworkProcess/mac/NetworkProcessMac.mm:
2614         * NetworkProcess/mac/RemoteNetworkingContext.mm:
2615         * Platform/spi/ios/AccessibilitySupportSPI.h:
2616         * PlatformMac.cmake:
2617         * PluginProcess/PluginControllerProxy.cpp:
2618         * PluginProcess/PluginProcess.cpp:
2619         * PluginProcess/WebProcessConnection.cpp:
2620         * Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb:
2621         * Shared/API/c/cf/WKErrorCF.cpp:
2622         (WKErrorCreateWithCFError):
2623         (WKErrorCopyCFError):
2624         * Shared/API/c/cg/WKImageCG.cpp:
2625         (WKImageCreateCGImage):
2626         (WKImageCreateFromCGImage):
2627         * Shared/ChildProcess.cpp:
2628         * Shared/ContextMenuContextData.cpp:
2629         * Shared/EditorState.cpp:
2630         * Shared/Plugins/NPIdentifierData.cpp:
2631         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
2632         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
2633         * Shared/SessionState.cpp:
2634         * Shared/SessionTracker.cpp:
2635         * Shared/ShareableBitmap.cpp:
2636         * Shared/ShareableResource.cpp:
2637         * Shared/VisibleContentRectUpdateInfo.cpp:
2638         * Shared/WebBackForwardListItem.cpp:
2639         * Shared/WebContextMenuItemData.cpp:
2640         * Shared/WebCoreArgumentCoders.cpp:
2641         * Shared/WebHitTestResultData.cpp:
2642         * Shared/WebImage.cpp:
2643         * Shared/WebMediaSessionMetadata.cpp:
2644         * Shared/WebMemorySampler.cpp:
2645         * Shared/WebMouseEvent.cpp:
2646         * Shared/WebRenderObject.cpp:
2647         * Shared/WebSQLiteDatabaseTracker.cpp:
2648         * Shared/WebWheelEvent.cpp:
2649         * Shared/cf/ArgumentCodersCF.cpp:
2650         * Shared/ios/WebPlatformTouchPointIOS.cpp:
2651         * SourcesCocoa.txt:
2652         * UIProcess/API/APIContentRuleListStore.cpp:
2653         * UIProcess/API/APIHitTestResult.cpp:
2654         * UIProcess/API/APINavigation.cpp:
2655         * UIProcess/API/APIOpenPanelParameters.cpp:
2656         * UIProcess/API/APIPageConfiguration.cpp:
2657         * UIProcess/API/C/WKPage.cpp:
2658         (WKPageLoadURLWithShouldOpenExternalURLsPolicy):
2659         (WKPageLoadURLWithUserData):
2660         (WKPageLoadURLRequestWithUserData):
2661         (WKPageSetPaginationMode):
2662         (WKPageGetPaginationMode):
2663         (WKPageSetPageLoaderClient):
2664         (WKPageSetPagePolicyClient):
2665         * UIProcess/API/C/cg/WKIconDatabaseCG.cpp:
2666         * UIProcess/Cocoa/WebViewImpl.h:
2667         * UIProcess/Cocoa/WebViewImpl.mm:
2668         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
2669         * UIProcess/WebStorage/LocalStorageDatabase.cpp:
2670         * UIProcess/ios/WKContentView.mm:
2671         (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
2672         (-[WKContentView initWithFrame:processPool:configuration:webView:]):
2673         (-[WKContentView dealloc]):
2674         (-[WKContentView page]):
2675         (-[WKContentView updateFixedClippingView:]):
2676         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
2677         (-[WKContentView _updateForScreen:]):
2678         (-[WKContentView _accessibilityRegisterUIProcessTokens]):
2679         (-[WKContentView _createDrawingAreaProxy]):
2680         (-[WKContentView _didCommitLayerTree:]):
2681         (-[WKContentView _wk_pageCountForPrintFormatter:]):
2682         * UIProcess/ios/WKContentViewInteraction.mm:
2683         (-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:userObject:]):
2684         (hasAssistedNode):
2685         (-[WKContentView setupInteraction]):
2686         (-[WKContentView positionInformation]):
2687         (-[WKContentView _webTouchEventsRecognized:]):
2688         (inflateQuad):
2689         (-[WKContentView _updateTapHighlight]):
2690         (-[WKContentView _showTapHighlight]):
2691         (-[WKContentView _requiresKeyboardWhenFirstResponder]):
2692         (-[WKContentView _displayFormNodeInputView]):
2693         (-[WKContentView inputView]):
2694         (-[WKContentView _actionForLongPressFromPositionInformation:]):
2695         (-[WKContentView currentPositionInformation]):
2696         (-[WKContentView doAfterPositionInformationUpdate:forRequest:]):
2697         (-[WKContentView _currentPositionInformationIsValidForRequest:]):
2698         (-[WKContentView _hasValidOutstandingPositionInformationRequest:]):
2699         (-[WKContentView _currentPositionInformationIsApproximatelyValidForRequest:]):
2700         (-[WKContentView gestureRecognizerShouldBegin:]):
2701         (-[WKContentView hasSelectablePositionAtPoint:]):
2702         (-[WKContentView pointIsNearMarkedText:]):
2703         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
2704         (-[WKContentView webSelectionRectsForSelectionRects:]):
2705         (-[WKContentView _twoFingerSingleTapGestureRecognized:]):
2706         (-[WKContentView _stylusSingleTapRecognized:]):
2707         (-[WKContentView _singleTapCommited:]):
2708         (-[WKContentView _attemptClickAtLocation:]):
2709         (-[WKContentView _positionInformationDidChange:]):
2710         (-[WKContentView requiresAccessoryView]):
2711         (-[WKContentView supportedPasteboardTypesForCurrentSelection]):
2712         (-[WKContentView _lookupForWebView:]):
2713         (-[WKContentView _shareForWebView:]):
2714         (-[WKContentView textStylingAtPosition:inDirection:]):
2715         (-[WKContentView canPerformActionForWebView:withSender:]):
2716         (-[WKContentView selectForWebView:]):
2717         (-[WKContentView _accessibilityRetrieveRectsEnclosingSelectionOffset:withGranularity:]):
2718         (-[WKContentView _accessibilityRetrieveRectsAtSelectionOffset:withText:completionHandler:]):
2719         (toGestureType):
2720         (toUIWKGestureType):
2721         (toSelectionTouch):
2722         (toUIWKSelectionTouch):
2723         (toGestureRecognizerState):
2724         (toUIGestureRecognizerState):
2725         (toUIWKSelectionFlags):
2726         (toWKTextGranularity):
2727         (toWKSelectionDirection):
2728         (selectionChangedWithGesture):
2729         (selectionChangedWithTouch):
2730         (-[WKContentView changeSelectionWithGestureAt:withGesture:withState:withFlags:]):
2731         (-[WKContentView autocorrectionData]):
2732         (-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]):
2733         (-[WKContentView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]):
2734         (-[WKContentView _updateAccessory]):
2735         (-[WKContentView selectedTextRange]):
2736         (-[WKContentView setMarkedText:selectedRange:]):
2737         (coreWritingDirection):
2738         (-[WKContentView closestPositionToPoint:]):
2739         (-[WKContentView insertText:]):
2740         (-[WKContentView textInputTraits]):
2741         (-[WKContentView handleKeyWebEvent:]):
2742         (-[WKContentView handleKeyWebEvent:withCompletionHandler:]):
2743         (-[WKContentView isScrollableForKeyboardScrollViewAnimator:]):
2744         (-[WKContentView keyboardScrollViewAnimator:distanceForIncrement:]):
2745         (-[WKContentView assistedNodeInformation]):
2746         (-[WKContentView assistedNodeSelectOptions]):
2747         (isAssistableInputType):
2748         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
2749         (-[WKContentView _stopAssistingNode]):
2750         (-[WKContentView updateCurrentAssistedNodeInformation:]):
2751         (-[WKContentView presentViewControllerForCurrentAssistedNode]):
2752         (-[WKContentView actionNameForFocusedFormControlView:]):
2753         (-[WKContentView selectWordForReplacement]):
2754         (-[WKContentView _updateChangedSelection:]):
2755         (-[WKContentView _beginSuppressingSelectionAssistantForReason:]):
2756         (-[WKContentView _stopSuppressingSelectionAssistantForReason:]):
2757         (-[WKContentView _showPlaybackTargetPicker:fromRect:routeSharingPolicy:routingContextUID:]):
2758         (-[WKContentView _showRunOpenPanel:resultListener:]):
2759         (-[WKContentView _showShareSheet:completionHandler:]):
2760         (-[WKContentView positionInformationForActionSheetAssistant:]):
2761         (-[WKContentView updatePositionInformationForActionSheetAssistant:]):
2762         (-[WKContentView _startDrag:item:]):
2763         (-[WKContentView _didHandleAdditionalDragItemsRequest:]):
2764         (-[WKContentView _didHandleStartDataInteractionRequest:]):
2765         (dropOperationForWebCoreDragOperation):
2766         (-[WKContentView dragDataForDropSession:dragDestinationAction:]):
2767         (-[WKContentView _didConcludeEditDataInteraction:]):
2768         (-[WKContentView _didPerformDragOperation:]):
2769         (-[WKContentView _prepareToDragPromisedAttachment:]):
2770         (-[WKContentView _itemsForBeginningOrAddingToSessionWithRegistrationList:stagedDragSource:]):
2771         (-[WKContentView _autofillContext]):
2772         (-[WKContentView _dragInteraction:itemsForAddingToSession:withTouchAtPoint:completion:]):
2773         (-[WKContentView _dragInteraction:prepareForSession:completion:]):
2774         (-[WKContentView dragInteraction:itemsForBeginningSession:]):
2775         (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
2776         (-[WKContentView dragInteraction:session:didEndWithOperation:]):
2777         (-[WKContentView dragInteraction:item:willAnimateCancelWithAnimator:]):
2778         (-[WKContentView dropInteraction:performDrop:]):
2779         (-[WKContentView dropInteraction:sessionDidEnd:]):
2780         (-[WKContentView allowsLanguageSelectionMenuForListViewController:]):
2781         (-[WKContentView shouldDisplayInputContextViewForListViewController:]):
2782         (-[WKContentView numericInputModeForListViewController:]):
2783         (-[WKContentView textContentTypeForListViewController:]):
2784         (-[WKContentView allowsDictationInputForListViewController:]):
2785         (-[WKContentView _simulateLongPressActionAtLocation:]):
2786         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
2787         (-[WKContentView _presentationRectsForPreviewItemController:]):
2788         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
2789         (WKFullScreenViewControllerPlaybackSessionModelClient::setInterface):
2790         (WKFullScreenViewControllerVideoFullscreenModelClient::setInterface):
2791         (WKFullScreenViewControllerVideoFullscreenModelClient::interface const):
2792         (-[WKFullScreenViewController videoControlsManagerDidChange]):
2793         (-[WKFullScreenViewController _manager]):
2794         (-[WKFullScreenViewController _togglePiPAction:]):
2795         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
2796         (-[WKFullscreenAnimationController configureInitialAndFinalStatesForTransition:]):
2797         (-[WKFullScreenWindowController isFullScreen]):
2798         (-[WKFullScreenWindowController enterFullScreen]):
2799         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
2800         (-[WKFullScreenWindowController exitFullScreen]):
2801         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
2802         (-[WKFullScreenWindowController _completedExitFullScreen]):
2803         (-[WKFullScreenWindowController webViewDidRemoveFromSuperviewWhileInFullscreen]):
2804         (-[WKFullScreenWindowController _exitFullscreenImmediately]):
2805         (-[WKFullScreenWindowController _manager]):
2806         * UIProcess/mac/WebPageProxyMac.mm:
2807         * WebKit.xcodeproj/project.pbxproj:
2808         * WebProcess/Cache/WebCacheStorageConnection.cpp:
2809         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
2810         (mediaTimeToCurrentTime):
2811         (-[WKAnimationDelegate initWithLayerID:layerTreeHost:]):
2812         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
2813         (-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]):
2814
2815 2018-12-10  Don Olmstead  <don.olmstead@sony.com>
2816
2817         Move ENABLE_RESOURCE_LOAD_STATISTICS to FeatureDefines.xcconfig
2818         https://bugs.webkit.org/show_bug.cgi?id=192573
2819
2820         Reviewed by Simon Fraser.
2821
2822         * Configurations/FeatureDefines.xcconfig:
2823
2824 2018-12-10  Youenn Fablet  <youenn@apple.com>
2825
2826         Remove derived classes of RealtimeMediaSourceCenter
2827         https://bugs.webkit.org/show_bug.cgi?id=192546
2828
2829         Reviewed by Eric Carlson.
2830
2831         pdate code according WebCore changes.
2832
2833         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
2834         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
2835         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
2836         (WebKit::UserMediaCaptureManager::~UserMediaCaptureManager):
2837         (WebKit::UserMediaCaptureManager::initialize):
2838
2839 2018-12-10  Tim Horton  <timothy_horton@apple.com>
2840
2841         Animated scrolling on Google Maps scrolls the page in addition to moving the map
2842         https://bugs.webkit.org/show_bug.cgi?id=192521
2843         <rdar://problem/46382007>
2844
2845         Reviewed by Sam Weinig.
2846
2847         * Platform/spi/ios/UIKitSPI.h:
2848         * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
2849         (-[WKKeyboardScrollViewAnimator rubberbandableDirections]):
2850         Only do keyboard-based rubber-banding in directions that we can actually
2851         scroll, not directions we can only finger-rubber-band in. This effectively
2852         means keyboard scrolling will ignore "alwaysBounce{Vertical, Horizontal}".
2853
2854 2018-12-10  Commit Queue  <commit-queue@webkit.org>
2855
2856         Unreviewed, rolling out r239023.
2857         https://bugs.webkit.org/show_bug.cgi?id=192571
2858
2859         Speculative rollout due to broken perf test (Requested by
2860         deanj on #webkit).
2861
2862         Reverted changeset:
2863
2864         "Enable HTTP and HTTPS proxies on iOS and make it a property
2865         of the NSURLSession"
2866         https://bugs.webkit.org/show_bug.cgi?id=192374
2867         https://trac.webkit.org/changeset/239023
2868
2869 2018-12-10  Wenson Hsieh  <wenson_hsieh@apple.com>
2870
2871         Unreviewed, fix the iOS build after r239039.
2872         https://bugs.webkit.org/show_bug.cgi?id=192568
2873
2874         * UIProcess/ios/WKContentViewInteraction.mm:
2875         (-[WKContentView dropInteraction:sessionDidUpdate:]):
2876
2877 2018-12-10  Alex Christensen  <achristensen@webkit.org>
2878
2879         Fix WatchOS build.
2880
2881         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2882         * UIProcess/ios/WKContentViewInteraction.mm:
2883         (-[WKContentView actionNameForFocusedFormControlView:]):
2884
2885 2018-12-10  Matt Lewis  <jlewis3@apple.com>
2886
2887         Unreviewed, rolling out r239029.
2888
2889         This patch caused internal build failures.
2890
2891         Reverted changeset:
2892
2893         "[meta][WebKit] Remove using namespace WebCore and WebKit in
2894         the global scope for unified source builds"
2895         https://bugs.webkit.org/show_bug.cgi?id=192449
2896         https://trac.webkit.org/changeset/239029
2897
2898 2018-12-10  Chris Dumez  <cdumez@apple.com>
2899
2900         Add SPI to allow the client to set the user-agent at main frame level, from the UIProcess
2901         https://bugs.webkit.org/show_bug.cgi?id=192509
2902         <rdar://problem/46500832>
2903
2904         Reviewed by Alex Christensen.
2905
2906         Add SPI to allow the client to set the user-agent at main frame level, from the UIProcess instead of doing
2907         it at resource-level from the injected bundle.
2908
2909         The custom user-agent string can now be set on _WKWebsitePolicies during the
2910         decidePolicyForNavigationAction for the main feame, and will impact this main resource load as well as its
2911         future subresource loads.
2912
2913         * Shared/WebsitePoliciesData.cpp:
2914         (WebKit::WebsitePoliciesData::encode const):
2915         (WebKit::WebsitePoliciesData::decode):
2916         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
2917         * Shared/WebsitePoliciesData.h:
2918         * UIProcess/API/APIWebsitePolicies.cpp:
2919         (API::WebsitePolicies::data):
2920         * UIProcess/API/APIWebsitePolicies.h:
2921         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
2922         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
2923         (-[_WKWebsitePolicies setCustomUserAgent:]):
2924         (-[_WKWebsitePolicies customUserAgent]):
2925         * UIProcess/Cocoa/NavigationState.mm:
2926         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
2927
2928 2018-12-10  Alex Christensen  <achristensen@webkit.org>
2929
2930         Safe browsing warning should layout buttons vertically in narrow WKWebViews
2931         https://bugs.webkit.org/show_bug.cgi?id=192535
2932         <rdar://problem/46308364>
2933
2934         Reviewed by Tim Horton.
2935
2936         They're usually next to each other, but in narrow WKWebViews they currently get clipped.
2937         In order to make it more likely that both buttons are completely visible, put one above
2938         the other if the WKWebView is too narrow to completely show both.  This also helps with
2939         languages where the translations of "Go Back" or "Show Details" are rendered wider than English.
2940
2941         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
2942         (buttonWidth):
2943         (-[WKSafeBrowsingWarning addContent]):
2944
2945 2018-12-10  Simon Fraser  <simon.fraser@apple.com>
2946
2947         Allow control over child order when adding nodes to the scrolling tree
2948         https://bugs.webkit.org/show_bug.cgi?id=176914
2949         <rdar://problem/46542237>
2950         
2951         Re-land r239010 after over-zealous rollout.
2952
2953         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
2954         (WebKit::RemoteScrollingCoordinatorTransaction::decode):
2955
2956 2018-12-10  Wenson Hsieh  <wenson_hsieh@apple.com>
2957
2958         [iOS] Caret is obscured by finger when dragging over an editable element
2959         https://bugs.webkit.org/show_bug.cgi?id=192499
2960         <rdar://problem/46570101>
2961
2962         Reviewed by Tim Horton.
2963
2964         Add support for setting the `precise` property of `UIDropProposal` to YES when dragging over an editable area.
2965         When enabled, this property shifts the drop location up by a small amount, allowing the user to see the drop
2966         caret (currently, this is not the case, and it's difficult to drop text at a precise location on iOS). Changes
2967         are covered by adding to existing API tests.
2968
2969         * Scripts/webkit/messages.py:
2970         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2971
2972         Add a new version of `-_webView:willUpdateDataInteractionOperationToOperation:forSession:` that receives and
2973         returns a UIDropProposal, so that Mail can more easily port over existing logic in its legacy-WebKit-based
2974         compose implementation. iOS Safari is currently the only client of this private delegate, so the old version can
2975         be easily removed once Safari adopts this new version.
2976
2977         * UIProcess/WebPageProxy.cpp:
2978         (WebKit::WebPageProxy::didPerformDragControllerAction):
2979
2980         Add plumbing to send the latest drag handling method from WebPage to WebPageProxy.
2981
2982         (WebKit::WebPageProxy::resetCurrentDragInformation):
2983         * UIProcess/WebPageProxy.h:
2984         (WebKit::WebPageProxy::currentDragHandlingMethod const):
2985         * UIProcess/WebPageProxy.messages.in:
2986         * UIProcess/ios/WKContentViewInteraction.mm:
2987         (-[WKContentView dropInteraction:sessionDidUpdate:]):
2988
2989         Call the new UI delegate hook when determining the drop proposal to return to UIKit. Additionally set the
2990         `precise` bit on the drop proposal in the case where the drop handling method is either "editing rich text" or
2991         "editing plain text".
2992
2993         * WebProcess/WebPage/WebPage.cpp:
2994         (WebKit::WebPage::performDragControllerAction):
2995         * WebProcess/WebPage/WebPage.h:
2996
2997 2018-12-10  Youenn Fablet  <youenn@apple.com>
2998
2999         Make mock capture happen in the process used for real capture
3000         https://bugs.webkit.org/show_bug.cgi?id=192544
3001
3002         Reviewed by Eric Carlson.
3003
3004         Make mock capture happen in the right process by only overriding
3005         factories by mock factories for source types that UserMediaCaptureManager will not override.
3006         That way, UserMediaCaptureManager will be used to go to UIProcess, where mock will be used as if it was the real capture.
3007
3008         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
3009         (WebKit::UserMediaCaptureManager::initialize):
3010
3011 2018-12-10  Alexey Proskuryakov  <ap@apple.com>
3012
3013         Move ENABLE_SEC_ITEM_SHIM out of WebKit's config.h
3014         https://bugs.webkit.org/show_bug.cgi?id=192428
3015
3016         Reviewed by Tim Horton.
3017
3018         * config.h:
3019
3020 2018-12-10  Alexey Proskuryakov  <ap@apple.com>
3021
3022         Move more macros out of WebKit's config.h
3023         https://bugs.webkit.org/show_bug.cgi?id=192430
3024
3025         Reviewed by Tim Horton.
3026
3027         * config.h:
3028
3029 2018-12-10  Chris Fleizach  <cfleizach@apple.com>
3030
3031         [meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
3032         https://bugs.webkit.org/show_bug.cgi?id=192449
3033
3034         Reviewed by Darin Adler.
3035
3036         * NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
3037         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
3038         * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
3039         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
3040         * NetworkProcess/ios/NetworkProcessIOS.mm:
3041         * NetworkProcess/mac/NetworkProcessMac.mm:
3042         * NetworkProcess/mac/RemoteNetworkingContext.mm:
3043         * Platform/spi/ios/AccessibilitySupportSPI.h:
3044         * PlatformMac.cmake:
3045         * PluginProcess/PluginControllerProxy.cpp:
3046         * PluginProcess/PluginProcess.cpp:
3047         * PluginProcess/WebProcessConnection.cpp:
3048         * Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb:
3049         * Shared/API/c/cf/WKErrorCF.cpp:
3050         (WKErrorCreateWithCFError):
3051         (WKErrorCopyCFError):
3052         * Shared/API/c/cg/WKImageCG.cpp:
3053         (WKImageCreateCGImage):
3054         (WKImageCreateFromCGImage):
3055         * Shared/ChildProcess.cpp:
3056         * Shared/ContextMenuContextData.cpp:
3057         * Shared/EditorState.cpp:
3058         * Shared/Plugins/NPIdentifierData.cpp:
3059         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
3060         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
3061         * Shared/SessionState.cpp:
3062         * Shared/SessionTracker.cpp:
3063         * Shared/ShareableBitmap.cpp:
3064         * Shared/ShareableResource.cpp:
3065         * Shared/VisibleContentRectUpdateInfo.cpp:
3066         * Shared/WebBackForwardListItem.cpp:
3067         * Shared/WebContextMenuItemData.cpp:
3068         * Shared/WebCoreArgumentCoders.cpp:
3069         * Shared/WebHitTestResultData.cpp:
3070         * Shared/WebImage.cpp:
3071         * Shared/WebMediaSessionMetadata.cpp:
3072         * Shared/WebMemorySampler.cpp:
3073         * Shared/WebMouseEvent.cpp:
3074         * Shared/WebRenderObject.cpp:
3075         * Shared/WebSQLiteDatabaseTracker.cpp:
3076         * Shared/WebWheelEvent.cpp:
3077         * Shared/cf/ArgumentCodersCF.cpp:
3078         * Shared/ios/WebPlatformTouchPointIOS.cpp:
3079         * SourcesCocoa.txt:
3080         * UIProcess/API/APIContentRuleListStore.cpp:
3081         * UIProcess/API/APIHitTestResult.cpp:
3082         * UIProcess/API/APINavigation.cpp:
3083         * UIProcess/API/APIOpenPanelParameters.cpp:
3084         * UIProcess/API/APIPageConfiguration.cpp:
3085         * UIProcess/API/C/WKPage.cpp:
3086         (WKPageLoadURLWithShouldOpenExternalURLsPolicy):
3087         (WKPageLoadURLWithUserData):
3088         (WKPageLoadURLRequestWithUserData):
3089         (WKPageSetPaginationMode):
3090         (WKPageGetPaginationMode):
3091         (WKPageSetPageLoaderClient):
3092         (WKPageSetPagePolicyClient):
3093         * UIProcess/API/C/cg/WKIconDatabaseCG.cpp:
3094         * UIProcess/Cocoa/WebViewImpl.h:
3095         * UIProcess/Cocoa/WebViewImpl.mm:
3096         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
3097         * UIProcess/WebStorage/LocalStorageDatabase.cpp:
3098         * UIProcess/ios/WKContentView.mm:
3099         (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
3100         (-[WKContentView initWithFrame:processPool:configuration:webView:]):
3101         (-[WKContentView dealloc]):
3102         (-[WKContentView page]):
3103         (-[WKContentView updateFixedClippingView:]):
3104         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
3105         (-[WKContentView _updateForScreen:]):
3106         (-[WKContentView _accessibilityRegisterUIProcessTokens]):
3107         (-[WKContentView _createDrawingAreaProxy]):
3108         (-[WKContentView _didCommitLayerTree:]):
3109         (-[WKContentView _wk_pageCountForPrintFormatter:]):
3110         * UIProcess/ios/WKContentViewInteraction.mm:
3111         (-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:userObject:]):
3112         (hasAssistedNode):
3113         (-[WKContentView setupInteraction]):
3114         (-[WKContentView positionInformation]):
3115         (-[WKContentView _webTouchEventsRecognized:]):
3116         (inflateQuad):
3117         (-[WKContentView _updateTapHighlight]):
3118         (-[WKContentView _showTapHighlight]):
3119         (-[WKContentView _requiresKeyboardWhenFirstResponder]):
3120         (-[WKContentView _displayFormNodeInputView]):
3121         (-[WKContentView inputView]):
3122         (-[WKContentView _actionForLongPressFromPositionInformation:]):
3123         (-[WKContentView currentPositionInformation]):
3124         (-[WKContentView doAfterPositionInformationUpdate:forRequest:]):
3125         (-[WKContentView _currentPositionInformationIsValidForRequest:]):
3126         (-[WKContentView _hasValidOutstandingPositionInformationRequest:]):
3127         (-[WKContentView _currentPositionInformationIsApproximatelyValidForRequest:]):
3128         (-[WKContentView gestureRecognizerShouldBegin:]):
3129         (-[WKContentView hasSelectablePositionAtPoint:]):
3130         (-[WKContentView pointIsNearMarkedText:]):
3131         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
3132         (-[WKContentView webSelectionRectsForSelectionRects:]):
3133         (-[WKContentView _twoFingerSingleTapGestureRecognized:]):
3134         (-[WKContentView _stylusSingleTapRecognized:]):
3135         (-[WKContentView _singleTapCommited:]):
3136         (-[WKContentView _attemptClickAtLocation:]):
3137         (-[WKContentView _positionInformationDidChange:]):
3138         (-[WKContentView requiresAccessoryView]):
3139         (-[WKContentView supportedPasteboardTypesForCurrentSelection]):
3140         (-[WKContentView _lookupForWebView:]):
3141         (-[WKContentView _shareForWebView:]):
3142         (-[WKContentView textStylingAtPosition:inDirection:]):
3143         (-[WKContentView canPerformActionForWebView:withSender:]):
3144         (-[WKContentView selectForWebView:]):
3145         (-[WKContentView _accessibilityRetrieveRectsEnclosingSelectionOffset:withGranularity:]):
3146         (-[WKContentView _accessibilityRetrieveRectsAtSelectionOffset:withText:completionHandler:]):
3147         (toGestureType):
3148         (toUIWKGestureType):
3149         (toSelectionTouch):
3150         (toUIWKSelectionTouch):
3151         (toGestureRecognizerState):
3152         (toUIGestureRecognizerState):
3153         (toUIWKSelectionFlags):
3154         (toWKTextGranularity):
3155         (toWKSelectionDirection):
3156         (selectionChangedWithGesture):
3157         (selectionChangedWithTouch):
3158         (-[WKContentView changeSelectionWithGestureAt:withGesture:withState:withFlags:]):
3159         (-[WKContentView autocorrectionData]):
3160         (-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]):
3161         (-[WKContentView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]):
3162         (-[WKContentView _updateAccessory]):
3163         (-[WKContentView selectedTextRange]):
3164         (-[WKContentView setMarkedText:selectedRange:]):
3165         (coreWritingDirection):
3166         (-[WKContentView closestPositionToPoint:]):
3167         (-[WKContentView insertText:]):
3168         (-[WKContentView textInputTraits]):
3169         (-[WKContentView handleKeyWebEvent:]):
3170         (-[WKContentView handleKeyWebEvent:withCompletionHandler:]):
3171         (-[WKContentView isScrollableForKeyboardScrollViewAnimator:]):
3172         (-[WKContentView keyboardScrollViewAnimator:distanceForIncrement:]):
3173         (-[WKContentView assistedNodeInformation]):
3174         (-[WKContentView assistedNodeSelectOptions]):
3175         (isAssistableInputType):
3176         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
3177         (-[WKContentView _stopAssistingNode]):
3178         (-[WKContentView updateCurrentAssistedNodeInformation:]):
3179         (-[WKContentView presentViewControllerForCurrentAssistedNode]):
3180         (-[WKContentView actionNameForFocusedFormControlView:]):
3181         (-[WKContentView selectWordForReplacement]):
3182         (-[WKContentView _updateChangedSelection:]):
3183         (-[WKContentView _beginSuppressingSelectionAssistantForReason:]):
3184         (-[WKContentView _stopSuppressingSelectionAssistantForReason:]):
3185         (-[WKContentView _showPlaybackTargetPicker:fromRect:routeSharingPolicy:routingContextUID:]):
3186         (-[WKContentView _showRunOpenPanel:resultListener:]):
3187         (-[WKContentView _showShareSheet:completionHandler:]):
3188         (-[WKContentView positionInformationForActionSheetAssistant:]):
3189         (-[WKContentView updatePositionInformationForActionSheetAssistant:]):
3190         (-[WKContentView _startDrag:item:]):
3191         (-[WKContentView _didHandleAdditionalDragItemsRequest:]):
3192         (-[WKContentView _didHandleStartDataInteractionRequest:]):
3193         (dropOperationForWebCoreDragOperation):
3194         (-[WKContentView dragDataForDropSession:dragDestinationAction:]):
3195         (-[WKContentView _didConcludeEditDataInteraction:]):
3196         (-[WKContentView _didPerformDragOperation:]):
3197         (-[WKContentView _prepareToDragPromisedAttachment:]):
3198         (-[WKContentView _itemsForBeginningOrAddingToSessionWithRegistrationList:stagedDragSource:]):
3199         (-[WKContentView _autofillContext]):
3200         (-[WKContentView _dragInteraction:itemsForAddingToSession:withTouchAtPoint:completion:]):
3201         (-[WKContentView _dragInteraction:prepareForSession:completion:]):
3202         (-[WKContentView dragInteraction:itemsForBeginningSession:]):
3203         (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
3204         (-[WKContentView dragInteraction:session:didEndWithOperation:]):
3205         (-[WKContentView dragInteraction:item:willAnimateCancelWithAnimator:]):
3206         (-[WKContentView dropInteraction:performDrop:]):
3207         (-[WKContentView dropInteraction:sessionDidEnd:]):
3208         (-[WKContentView allowsLanguageSelectionMenuForListViewController:]):
3209         (-[WKContentView shouldDisplayInputContextViewForListViewController:]):
3210         (-[WKContentView numericInputModeForListViewController:]):
3211         (-[WKContentView textContentTypeForListViewController:]):
3212         (-[WKContentView allowsDictationInputForListViewController:]):
3213         (-[WKContentView _simulateLongPressActionAtLocation:]):
3214         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
3215         (-[WKContentView _presentationRectsForPreviewItemController:]):
3216         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
3217         (WKFullScreenViewControllerPlaybackSessionModelClient::setInterface):
3218         (WKFullScreenViewControllerVideoFullscreenModelClient::setInterface):
3219         (WKFullScreenViewControllerVideoFullscreenModelClient::interface const):
3220         (-[WKFullScreenViewController videoControlsManagerDidChange]):
3221         (-[WKFullScreenViewController _manager]):
3222         (-[WKFullScreenViewController _togglePiPAction:]):
3223         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
3224         (-[WKFullscreenAnimationController configureInitialAndFinalStatesForTransition:]):
3225         (-[WKFullScreenWindowController isFullScreen]):
3226         (-[WKFullScreenWindowController enterFullScreen]):
3227         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
3228         (-[WKFullScreenWindowController exitFullScreen]):
3229         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
3230         (-[WKFullScreenWindowController _completedExitFullScreen]):
3231         (-[WKFullScreenWindowController webViewDidRemoveFromSuperviewWhileInFullscreen]):
3232         (-[WKFullScreenWindowController _exitFullscreenImmediately]):
3233         (-[WKFullScreenWindowController _manager]):
3234         * UIProcess/mac/WebPageProxyMac.mm:
3235         * WebKit.xcodeproj/project.pbxproj:
3236         * WebProcess/Cache/WebCacheStorageConnection.cpp:
3237         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
3238         (mediaTimeToCurrentTime):
3239         (-[WKAnimationDelegate initWithLayerID:layerTreeHost:]):
3240         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
3241         (-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]):
3242
3243 2018-12-10  Tim Horton  <timothy_horton@apple.com>
3244
3245         WKWebView should support custom tintColor
3246         https://bugs.webkit.org/show_bug.cgi?id=192518
3247         <rdar://problem/37243261>
3248
3249         Reviewed by Wenson Hsieh.
3250
3251         * Platform/spi/ios/UIKitSPI.h:
3252         * UIProcess/ios/WKContentViewInteraction.mm:
3253         (-[WKContentView insertionPointColor]):
3254         (-[WKContentView selectionBarColor]):
3255         (-[WKContentView selectionHighlightColor]):
3256         Grab insertion point and selection colors from UITextInputTraits.
3257
3258         (-[WKContentView _updateInteractionTintColor]):
3259         Determine our effective tint color:
3260             - transparent if interaction is disabled
3261             - a CSS-derived color if caret-color style is applied
3262             - the _inheritedInteractionTintColor, which climbs up to the tintColor API
3263         Apply it to our UITextInputTraits.
3264
3265         (-[WKContentView tintColorDidChange]):
3266         (-[WKContentView textInputTraits]):
3267         Call _updateInteractionTintColor whenever we create a new UITextInputTraits
3268         or when the tint color changes.
3269
3270 2018-12-09  Youenn Fablet  <youenn@apple.com>
3271
3272         Move capture manager from RealtimeMediaSourceCenter to capture factory
3273         https://bugs.webkit.org/show_bug.cgi?id=192542
3274
3275         Reviewed by Eric Carlson.
3276
3277         Make sure to unregister for video capture as done for other capture types.
3278         Implement manager which should be doing nothing as the manager is used for enumeration of devices
3279         which should only happen in UIProcess.
3280
3281         Given that mock capture is interfering with UserMediaCaptureManager,
3282         switching on/off mock capture will require creating a new process.
3283         This shortcoming should be fixed once mock capture will be fully happening in
3284         the same process as regular capture.
3285
3286         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
3287         (WebKit::UserMediaCaptureManager::~UserMediaCaptureManager):
3288         * WebProcess/cocoa/UserMediaCaptureManager.h:
3289
3290 2018-12-09  Saam barati  <sbarati@apple.com>
3291
3292         Enable HTTP and HTTPS proxies on iOS and make it a property of the NSURLSession
3293         https://bugs.webkit.org/show_bug.cgi?id=192374
3294         <rdar://problem/46506286>
3295
3296         Reviewed by Alex Christensen.
3297
3298         This patch makes it so that we can use HTTP/HTTPS proxies on iOS as well.
3299         To enable on iOS, you can do something like:
3300         $ defaults write -g WebKit2HTTPProxy -string "http://localhost:8080"
3301         $ defaults write -g WebKit2HTTPSProxy -string "http://localhost:8080"
3302         
3303         This patch also changes the Proxy to be enabled on a per NSURLSession
3304         basis instead of a per process basis.
3305
3306         * NetworkProcess/NetworkProcess.cpp:
3307         (WebKit::NetworkProcess::initializeNetworkProcess):
3308         * NetworkProcess/NetworkSessionCreationParameters.cpp:
3309         (WebKit::NetworkSessionCreationParameters::privateSessionParameters):
3310         (WebKit::NetworkSessionCreationParameters::encode const):
3311         (WebKit::NetworkSessionCreationParameters::decode):
3312         * NetworkProcess/NetworkSessionCreationParameters.h:
3313         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3314         (WebKit::proxyDictionary):
3315         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
3316         * NetworkProcess/mac/NetworkProcessMac.mm:
3317         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
3318         (WebKit::overrideSystemProxies): Deleted.
3319         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3320         (-[WKWebsiteDataStore _initWithConfiguration:]):
3321         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
3322         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
3323         (-[_WKWebsiteDataStoreConfiguration httpProxy]):
3324         (-[_WKWebsiteDataStoreConfiguration setHTTPProxy:]):
3325         (-[_WKWebsiteDataStoreConfiguration httpsProxy]):
3326         (-[_WKWebsiteDataStoreConfiguration setHTTPSProxy:]):
3327         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3328         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
3329         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
3330         (WebKit::WebsiteDataStore::parameters):
3331         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
3332         (WebKit::WebsiteDataStoreConfiguration::copy):
3333         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
3334         (WebKit::WebsiteDataStoreConfiguration::httpProxy const):
3335         (WebKit::WebsiteDataStoreConfiguration::setHTTPProxy):
3336         (WebKit::WebsiteDataStoreConfiguration::httpsProxy const):
3337         (WebKit::WebsiteDataStoreConfiguration::setHTTPSProxy):
3338
3339 2018-12-09  Adrian Perez de Castro  <aperez@igalia.com>
3340
3341         Build failure due to missing include of APIWebsiteDataStore.h
3342         https://bugs.webkit.org/show_bug.cgi?id=192541
3343
3344         Reviewed by Youenn Fablet.
3345
3346         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp: Add missing
3347         include of APIWebsiteDataStore.h
3348
3349 2018-12-09  Wenson Hsieh  <wenson_hsieh@apple.com>
3350
3351         [iOS device] Crash when attempting to call -[_WKAttachment info] for an editable image
3352         https://bugs.webkit.org/show_bug.cgi?id=192538
3353
3354         Reviewed by Tim Horton.
3355
3356         Fix the crash by ensuring that the result of `-renderedDrawing` survives long enough to be wrapped by a
3357         `RetainPtr` in `-PNGRepresentation`. This isn't currently testable, since this codepath isn't supported on the
3358         iOS simulator; instead, I manually verified using MobileAttachments.app.
3359
3360         * UIProcess/ios/WKDrawingView.mm:
3361         (-[WKDrawingView renderedDrawing]):
3362
3363 2018-12-09  Commit Queue  <commit-queue@webkit.org>
3364
3365         Unreviewed, rolling out r239010.
3366         https://bugs.webkit.org/show_bug.cgi?id=192537
3367
3368         Breaks fast/visual-viewport/tiled-drawing/zoomed-fixed-
3369         scrolling-layers-state.html again (Requested by ap on
3370         #webkit).
3371
3372         Reverted changeset:
3373
3374         "Allow control over child order when adding nodes to the
3375         scrolling tree"
3376         https://bugs.webkit.org/show_bug.cgi?id=176914
3377         https://trac.webkit.org/changeset/239010
3378
3379 2018-12-08  Alex Christensen  <achristensen@webkit.org>
3380
3381         Don't programmatically capitalize safe browsing warning buttons
3382         https://bugs.webkit.org/show_bug.cgi?id=192531
3383         <rdar://problem/46417791>
3384
3385         Reviewed by Darin Adler.
3386
3387         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
3388         (makeButton):
3389
3390 2018-12-08  Alex Christensen  <achristensen@webkit.org>
3391
3392         Safe browsing warning should respect text size from settings
3393         https://bugs.webkit.org/show_bug.cgi?id=192205
3394
3395         Reviewed by Tim Horton.
3396
3397         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
3398         (fontWithSize):
3399         (makeButton):
3400         (-[WKSafeBrowsingWarning addContent]):
3401         (-[WKSafeBrowsingWarning showDetailsClicked]):
3402
3403 2018-12-08  Frederic Wang  <fwang@igalia.com>
3404
3405         Allow control over child order when adding nodes to the scrolling tree
3406         https://bugs.webkit.org/show_bug.cgi?id=176914
3407         <rdar://problem/46542237>
3408
3409         Reviewed by Simon Fraser.
3410
3411         Based on an earlier patch by Simon Fraser.
3412
3413         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
3414         (WebKit::RemoteScrollingCoordinatorTransaction::decode):
3415
3416 2018-12-07  Rob Buis  <rbuis@igalia.com>
3417
3418         Remove unused API in NetworkProcess
3419         https://bugs.webkit.org/show_bug.cgi?id=192415
3420
3421         Reviewed by Alex Christensen.
3422
3423         This patch removed some unused API and headers in NetworkProcess.
3424
3425         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
3426         (WebKit::NetworkCORSPreflightChecker::startPreflight):
3427         * NetworkProcess/NetworkCORSPreflightChecker.h:
3428         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3429         * NetworkProcess/NetworkConnectionToWebProcess.h:
3430         * NetworkProcess/NetworkContentRuleListManager.h:
3431         * NetworkProcess/NetworkDataTask.cpp:
3432         * NetworkProcess/NetworkDataTask.h:
3433         * NetworkProcess/NetworkDataTaskBlob.cpp:
3434         * NetworkProcess/NetworkLoad.cpp:
3435         * NetworkProcess/NetworkLoad.h:
3436         * NetworkProcess/NetworkLoadChecker.cpp:
3437         * NetworkProcess/NetworkLoadChecker.h:
3438         * NetworkProcess/NetworkLoadClient.h:
3439         * NetworkProcess/NetworkLoadParameters.h:
3440         * NetworkProcess/NetworkProcess.cpp:
3441         * NetworkProcess/NetworkProcess.h:
3442         * NetworkProcess/NetworkProcessCreationParameters.h:
3443         * NetworkProcess/NetworkResourceLoadParameters.cpp:
3444         (WebKit::NetworkResourceLoadParameters::encode const):
3445         (WebKit::NetworkResourceLoadParameters::decode):
3446         * NetworkProcess/NetworkResourceLoadParameters.h:
3447         * NetworkProcess/NetworkResourceLoader.cpp:
3448         (WebKit::NetworkResourceLoader::didReceiveBuffer):
3449         * NetworkProcess/NetworkResourceLoader.h:
3450         * NetworkProcess/NetworkSession.cpp:
3451         * NetworkProcess/NetworkSession.h:
3452         * NetworkProcess/NetworkSocketStream.cpp:
3453         * NetworkProcess/NetworkSocketStream.h:
3454         * NetworkProcess/PingLoad.cpp:
3455         (WebKit::PingLoad::PingLoad):
3456         * NetworkProcess/PingLoad.h:
3457         * NetworkProcess/PreconnectTask.cpp:
3458         (WebKit::PreconnectTask::PreconnectTask):
3459         (WebKit::PreconnectTask::frameID const): Deleted.
3460         (WebKit::PreconnectTask::pageID const): Deleted.
3461         * NetworkProcess/PreconnectTask.h:
3462
3463 2018-12-07  Eric Carlson  <eric.carlson@apple.com>
3464
3465         [MediaStream] 'devicechange' event should not fire in frames that can't access capture devices
3466         https://bugs.webkit.org/show_bug.cgi?id=192511
3467         <rdar://problem/46562063>
3468
3469         Reviewed by Youenn Fablet.
3470
3471         * UIProcess/UserMediaPermissionCheckProxy.cpp:
3472         (WebKit::UserMediaPermissionCheckProxy::UserMediaPermissionCheckProxy): Remove userMediaID parameter.
3473         (WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo): ID not passed to callback.
3474         * UIProcess/UserMediaPermissionCheckProxy.h:
3475         (WebKit::UserMediaPermissionCheckProxy::create):
3476         (WebKit::UserMediaPermissionCheckProxy::completionHandler): Deleted.
3477
3478         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
3479         (WebKit::generateRequestID): New.
3480         (WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged): Don't notify if
3481         the page does not have a granted request and does not have persistent access.
3482         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Use generateRequestID.
3483         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo): Change variable name.
3484         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Use generateRequestID.
3485         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
3486
3487 2018-12-07  Saam Barati  <sbarati@apple.com>
3488
3489         WKWebProcessPlugInLoadDelegate should have API for saying which rendering events it wants to listen for
3490         https://bugs.webkit.org/show_bug.cgi?id=192473
3491
3492         Reviewed by Andy Estes.
3493
3494         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h:
3495         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
3496         (PageLoaderClient::layoutMilestones const):
3497
3498 2018-12-07  Youenn Fablet  <youenn@apple.com>
3499
3500         Update libwebrtc up to 0d007d7c4f
3501         https://bugs.webkit.org/show_bug.cgi?id=192316
3502
3503         Reviewed by Eric Carlson.
3504
3505         Update code base according new libwebrtc backend
3506         In particular, use directly int64_t for packet time.
3507
3508         * Configurations/WebKit.xcconfig:
3509         * NetworkProcess/webrtc/LibWebRTCSocketClient.cpp:
3510         (WebKit::LibWebRTCSocketClient::signalReadPacket):
3511         * NetworkProcess/webrtc/LibWebRTCSocketClient.h:
3512         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
3513         * NetworkProcess/webrtc/NetworkRTCSocket.h:
3514         * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
3515         (WebKit::LibWebRTCSocket::signalReadPacket):
3516
3517 2018-12-07  Truitt Savell  <tsavell@apple.com>
3518
3519         Unreviewed, rolling out r238947.
3520
3521         Revision caused fast/visual-viewport/tiled-drawing/zoomed-
3522         fixed-scrolling-layers-state.html to constantly fail
3523
3524         Reverted changeset:
3525
3526         "Allow control over child order when adding nodes to the
3527         scrolling tree"
3528         https://bugs.webkit.org/show_bug.cgi?id=176914
3529         https://trac.webkit.org/changeset/238947
3530
3531 2018-12-06  David Kilzer  <ddkilzer@apple.com>
3532
3533         Injected bundle for WebKitTestRunner leaks WKTypeRef objects
3534         <https://webkit.org/b/192481>
3535         <rdar://problem/46539059>
3536
3537         Reviewed by Simon Fraser.
3538
3539         Change function parameter name from `returnData[Ref]` to
3540         `returnRetainedData[Ref]` to document that the value returned is
3541         a +1 retained WKTypeRef object.
3542
3543         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
3544         (WKBundlePostSynchronousMessage):
3545         * WebProcess/InjectedBundle/API/c/WKBundle.h:
3546         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
3547         (WKBundlePagePostSynchronousMessageForTesting):
3548         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
3549
3550 2018-12-06  Frederic Wang  <fwang@igalia.com>
3551
3552         Allow control over child order when adding nodes to the scrolling tree
3553         https://bugs.webkit.org/show_bug.cgi?id=176914
3554
3555         Reviewed by Simon Fraser.
3556
3557         Based on an earlier patch by Simon Fraser.
3558
3559         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
3560         (WebKit::RemoteScrollingCoordinatorTransaction::decode): Make explicit that we want to append
3561         the new node at the end of child list.
3562
3563 2018-12-06  Yongjun Zhang  <yongjun_zhang@apple.com>
3564
3565         We should ignore minimumEffectiveDeviceWidth if the page specifies device-width in viewport meta-tag.
3566         https://bugs.webkit.org/show_bug.cgi?id=192377
3567         <rdar://problem/46364206>
3568
3569         Reviewed by Tim Horton.
3570
3571         Since we are using page's viewport arguments to decide the default viewport parameters and
3572         whether we can use mininum effective device width, we should always call setViewportArguments()
3573         regardless of shouldIgnoreMetaViewport settings.
3574
3575         * WebProcess/WebPage/WebPage.cpp:
3576         (WebKit::WebPage::viewportPropertiesDidChange): Always call setViewportArguments().
3577         (WebKit::WebPage::didCommitLoad): Ditto.
3578
3579 2018-12-06  Tim Horton  <timothy_horton@apple.com>
3580
3581         Web Share API: share overlay does not stick to the Safari window
3582         https://bugs.webkit.org/show_bug.cgi?id=192469
3583         <rdar://problem/46074833>
3584
3585         Reviewed by Wenson Hsieh.
3586
3587         * UIProcess/Cocoa/WKShareSheet.mm:
3588         (-[WKShareSheet sharingServicePicker:didChooseSharingService:]):
3589         (-[WKShareSheet sharingServicePicker:delegateForSharingService:]):
3590         (-[WKShareSheet sharingService:sourceWindowForShareItems:sharingContentScope:]):
3591         (-[WKShareSheet sharingService:didFailToShareItems:error:]):
3592         (-[WKShareSheet sharingService:didShareItems:]):
3593         Implement another NSSharingServicePickerDelegate method to return
3594         an *NSSharingService* delegate when needed.
3595
3596         Implement an NSSharingServiceDelegate method to return the window that
3597         the service's UI should attach to.
3598
3599         Also, instead of notifying the Web Content process when a service is picked
3600         (or not) in the NSSharingServicePicker, wait until the share has completed
3601         (or failed) to send didComplete. This both makes the return completion
3602         value more accurate (matching iOS, if you cancel the share during the
3603         recipient choice step, it will now fail), and avoids explicitly tearing
3604         down the NSSharingServicePicker too early, which breaks the UI attaching mechanism.
3605
3606 2018-12-06  Wenson Hsieh  <wenson_hsieh@apple.com>
3607
3608         [iOS] WKWebView should match UITextView behavior when editing text with an RTL keyboard
3609         https://bugs.webkit.org/show_bug.cgi?id=187554
3610         <rdar://problem/42075638>
3611
3612         Reviewed by Tim Horton.
3613
3614         Add support for automatically switching the base writing direction to the default writing direction with respect
3615         to the current keyboard in an editable WKWebView by implementing `-setBaseWritingDirection:forRange:`. On iOS 12
3616         and earlier, UIKit invokes this protocol method whenever the keyboard is changed to one with a different writing
3617         direction, although in some other versions of iOS, this only happens when first focusing an editable area.
3618
3619         Test: editing/input/ios/rtl-keyboard-input-on-focus.html
3620
3621         * Platform/spi/ios/UIKitSPI.h:
3622
3623         Declare UIKeyboardImpl IPI methods mostly for use in WebKitTestRunner (with the exception of
3624         `-setInitialDirection`, which we may invoke when we receive the first post-layout EditorState update after
3625         focusing an editable element).
3626
3627         * UIProcess/PageClient.h:
3628         * UIProcess/WebPageProxy.cpp:
3629         (WebKit::WebPageProxy::increaseListLevel):
3630         (WebKit::WebPageProxy::decreaseListLevel):
3631         (WebKit::WebPageProxy::changeListType):
3632         (WebKit::WebPageProxy::setBaseWritingDirection):
3633
3634         Drive-by style fixes: make these bail and return early if `!isValid()`.
3635
3636         (WebKit::WebPageProxy::resetStateAfterProcessExited):
3637
3638         Reset assisted node state in the UI process upon web process termination.
3639
3640         * UIProcess/WebPageProxy.h:
3641
3642         Add plumbing for `setBaseWritingDirection`, from `WebPageProxy` to `WebPage` to `Editor`.
3643
3644         * UIProcess/ios/PageClientImplIOS.h:
3645         * UIProcess/ios/PageClientImplIOS.mm:
3646         (WebKit::PageClientImpl::didReceiveEditorStateUpdateAfterFocus):
3647         * UIProcess/ios/WKContentViewInteraction.h:
3648         * UIProcess/ios/WKContentViewInteraction.mm:
3649         (-[WKContentView baseWritingDirectionForPosition:inDirection:]):
3650         (coreWritingDirection):
3651         (-[WKContentView setBaseWritingDirection:forRange:]):
3652
3653         Support `-setBaseWritingDirectionForPosition:forRange:`, but only in the case where the given range is the
3654         selected range. This is all that's currently needed to fulfill the requirements in <rdar://problem/42075638>,
3655         though we could potentially add full support for this in the future by mapping the given text range to a DOM
3656         range and moving the selection prior to setting the base writing direction.
3657
3658         (-[WKContentView _didReceiveEditorStateUpdateAfterFocus]):
3659
3660         Add a hook to notify WKContentView when the first post-layout EditorState has been received in the UI process.
3661         When this is invoked, if the web view is editable and the selection is not a range, we call into `UIKeyboardImpl`
3662         to change the initial writing direction if necessary.
3663
3664         * UIProcess/ios/WebPageProxyIOS.mm:
3665         (WebKit::WebPageProxy::startAssistingNode):
3666         (WebKit::WebPageProxy::stopAssistingNode):
3667         (WebKit::WebPageProxy::editorStateChanged):
3668         * WebProcess/WebPage/WebPage.cpp:
3669         (WebKit::WebPage::setBaseWritingDirection):
3670         * WebProcess/WebPage/WebPage.h:
3671         * WebProcess/WebPage/WebPage.messages.in:
3672
3673 2018-12-06  David Quesada  <david_quesada@apple.com>
3674
3675         -[WKProcessPool _resumeDownloadFromData:path:] should allow specifying the originating web view
3676         https://bugs.webkit.org/show_bug.cgi?id=192411
3677         rdar://problem/46492487
3678
3679         Reviewed by Alex Christensen.
3680
3681         * UIProcess/API/C/WKContext.cpp:
3682         (WKContextResumeDownload):
3683         * UIProcess/API/Cocoa/WKProcessPool.mm:
3684         (-[WKProcessPool _resumeDownloadFromData:path:originatingWebView:]):
3685         (-[WKProcessPool _resumeDownloadFromData:path:]): Deleted.
3686         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
3687         * UIProcess/WebProcessPool.cpp:
3688         (WebKit::WebProcessPool::resumeDownload):
3689          - Set the originating page of the DownloadProxy.
3690          - If the originating page is non-null, use its session ID for the download.
3691          - Remove a FIXME. It's possible to do this now by providing the web view whose session
3692            should be used for the download.
3693         * UIProcess/WebProcessPool.h:
3694
3695 2018-12-06  Jiewen Tan  <jiewen_tan@apple.com>
3696
3697         Unreviewed, a quick fix after r238919
3698
3699         Add an early return such that the error message is actually meaningful.
3700
3701         * UIProcess/WebAuthentication/Mock/MockHidService.cpp:
3702         (WebKit::MockHidService::platformStartDiscovery):
3703
3704 2018-12-06  Alex Christensen  <achristensen@webkit.org>
3705
3706         Remove unused LoaderStrategy::storeDerivedDataToCache and associated dead code
3707         https://bugs.webkit.org/show_bug.cgi?id=192452
3708
3709         Reviewed by Anders Carlsson.
3710
3711         This was introduced in r210835 but never used.
3712         It's preventing me from making the disk cache associated with a SessionID/NetworkSession.
3713
3714         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3715         (WebKit::NetworkConnectionToWebProcess::storeDerivedDataToCache): Deleted.
3716         * NetworkProcess/NetworkConnectionToWebProcess.h:
3717         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
3718         * NetworkProcess/NetworkResourceLoadParameters.cpp:
3719         (WebKit::NetworkResourceLoadParameters::encode const):
3720         (WebKit::NetworkResourceLoadParameters::decode):
3721         * NetworkProcess/NetworkResourceLoadParameters.h:
3722         * NetworkProcess/NetworkResourceLoader.cpp:
3723         (WebKit::NetworkResourceLoader::continueDidReceiveResponse):
3724         (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
3725         (WebKit::NetworkResourceLoader::continueProcessingCachedEntryAfterDidReceiveResponse): Deleted.
3726         * NetworkProcess/NetworkResourceLoader.h:
3727         * WebProcess/Network/WebLoaderStrategy.cpp:
3728         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
3729         (WebKit::WebLoaderStrategy::storeDerivedDataToCache): Deleted.
3730         * WebProcess/Network/WebLoaderStrategy.h:
3731         * WebProcess/Network/WebResourceLoader.cpp:
3732         (WebKit::WebResourceLoader::didRetrieveDerivedData): Deleted.
3733         * WebProcess/Network/WebResourceLoader.messages.in:
3734
3735 2018-12-06  Carlos Eduardo Ramalho  <cadubentzen@gmail.com>
3736
3737         REGRESSION(r231043): [GTK] Undefined references to WebCore::LayerRepresentation::* with -DENABLE_OPENGL=OFF builds
3738         https://bugs.webkit.org/show_bug.cgi?id=191997
3739
3740         Reviewed by Philippe Normand.
3741
3742         Fix build with -DENABLE_OPENGL=OFF and -DENABLE_VIDEO=OFF.
3743
3744         * Shared/WebEventConversion.cpp:
3745         (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent): add required #if ENABLE(ASYNC_SCROLLING)
3746
3747 2018-12-05  Ryosuke Niwa  <rniwa@webkit.org>
3748
3749         REGRESSION(PSON): Process swapping code doesn't set DisplayID in WebContent process
3750         https://bugs.webkit.org/show_bug.cgi?id=192290
3751
3752         Reviewed by Simon Fraser.
3753
3754         Fixed the bug by updating the DisplayID upon attaching to a WebContent process
3755         after a process swap as well as after the previous WebContent process had crashed.
3756
3757         Unfortunately no new tests since WebKitTestRunner / DumpRenderTree should use 0 as DisplayID
3758         as they have an off-screen NSWindow. The issue that this results in no fallback for
3759         the animation timer is tracked by webkit.org/b/192448.
3760
3761         * UIProcess/Cocoa/WebViewImpl.mm:
3762         (WebKit::WebViewImpl::didRelaunchProcess):
3763
3764 2018-12-05  Youenn Fablet  <youenn@apple.com>
3765
3766         Remove a document entry from NetworkMDNSRegister::m_services when document goes away
3767         https://bugs.webkit.org/show_bug.cgi?id=192429
3768
3769         Reviewed by Eric Carlson.
3770
3771         * NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
3772         (WebKit::NetworkMDNSRegister::unregisterMDNSNames):
3773         We should remove the entry to limit the size of the map.
3774
3775 2018-12-05  Jiewen Tan  <jiewen_tan@apple.com>
3776
3777         [Mac] Layout Test http/wpt/webauthn/public-key-credential-create-success-hid.https.html and http/wpt/webauthn/public-key-credential-get-success-hid.https.html are flaky
3778         https://bugs.webkit.org/show_bug.cgi?id=192061
3779
3780         Reviewed by Dewei Zhu.
3781
3782         Part 1.
3783
3784         Add some loggings to determine possible causes for the flakiness.
3785
3786         * UIProcess/WebAuthentication/Cocoa/HidService.mm:
3787         (WebKit::HidService::continueAddDeviceAfterGetInfo):
3788         * UIProcess/WebAuthentication/Mock/MockHidService.cpp:
3789         (WebKit::MockHidService::platformStartDiscovery):
3790
3791 2018-12-05  Chris Dumez  <cdumez@apple.com>
3792
3793         Simplify logic inside WebPageProxy::continueNavigationInNewProcess()
3794         https://bugs.webkit.org/show_bug.cgi?id=192404
3795
3796         Reviewed by Alex Christensen.
3797
3798         Simplify get the item state from the current back/forward list item, instead of
3799         relying on WebBackForwardList::filteredItemStates().
3800
3801         * UIProcess/WebPageProxy.cpp:
3802         (WebKit::WebPageProxy::continueNavigationInNewProcess):
3803
3804 2018-12-05  Youenn Fablet  <youenn@apple.com>
3805
3806         Enable the possibility to do video capture in UIProcess
3807         https://bugs.webkit.org/show_bug.cgi?id=192394
3808
3809         Reviewed by Eric Carlson.
3810
3811         Add two web preferences to toggle audio/video capture in UIProcess or WebProcess.
3812         Add mechanism for video capture that was not implemented yet.
3813
3814         * Shared/WebPreferences.yaml:
3815         * Shared/WebPreferencesDefaultValues.h:
3816         * Shared/WebProcessCreationParameters.cpp:
3817         (WebKit::WebProcessCreationParameters::encode const):
3818         (WebKit::WebProcessCreationParameters::decode):
3819         * Shared/WebProcessCreationParameters.h:
3820         * UIProcess/API/APIProcessPoolConfiguration.h:
3821         * UIProcess/API/C/WKPreferences.cpp:
3822         (WKPreferencesSetCaptureAudioInUIProcessEnabled):
3823         (WKPreferencesGetCaptureAudioInUIProcessEnabled):
3824         (WKPreferencesSetCaptureVideoInUIProcessEnabled):
3825         (WKPreferencesGetCaptureVideoInUIProcessEnabled):
3826         * UIProcess/API/C/WKPreferencesRef.h:
3827         * UIProcess/WebPreferences.cpp:
3828         (WebKit::WebPreferences::updateBoolValueForInternalDebugFeatureKey):
3829         * UIProcess/WebProcessPool.cpp:
3830         (WebKit::WebProcessPool::initializeNewWebProcess):
3831         (WebKit::WebProcessPool::createWebPage):
3832         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
3833         (WebKit::UserMediaCaptureManager::initialize):
3834
3835 2018-12-05  Alex Christensen  <achristensen@webkit.org>
3836
3837         Make WebsiteDataStoreConfiguration a proper API object
3838         https://bugs.webkit.org/show_bug.cgi?id=192380
3839
3840         Reviewed by Youenn Fablet.
3841
3842         In the immediate future I'll need to add things to _WKWebsiteDataStoreConfiguration.
3843         Instead of making ivars, setting them, copying them to a local object, make this a wrapper of an API::Object
3844         like all our other ObjC API objects are.
3845
3846         * Shared/API/APIObject.h:
3847         (API::Object::wrapper const):
3848         (API::Object::wrapper): Deleted.
3849         * Shared/Cocoa/APIObject.mm:
3850         (API::Object::ref const):
3851         (API::Object::deref const):
3852         (API::Object::newObject):
3853         (API::Object::ref): Deleted.
3854         (API::Object::deref): Deleted.
3855         * Sources.txt:
3856         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3857         (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
3858         * UIProcess/API/APIProcessPoolConfiguration.h:
3859         * UIProcess/API/APIWebsiteDataStore.cpp:
3860         (API::WebsiteDataStore::createLegacy):
3861         (API::WebsiteDataStore::WebsiteDataStore):
3862         (API::WebsiteDataStore::legacyDefaultDataStoreConfiguration):
3863         * UIProcess/API/APIWebsiteDataStore.h:
3864         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
3865         (API::WebsiteDataStore::defaultDataStoreConfiguration):
3866         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3867         (-[WKWebsiteDataStore _initWithConfiguration:]):
3868         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
3869         (-[_WKWebsiteDataStoreConfiguration _webStorageDirectory]):
3870         (-[_WKWebsiteDataStoreConfiguration _setWebStorageDirectory:]):
3871         (-[_WKWebsiteDataStoreConfiguration _indexedDBDatabaseDirectory]):
3872         (-[_WKWebsiteDataStoreConfiguration _setIndexedDBDatabaseDirectory:]):
3873         (-[_WKWebsiteDataStoreConfiguration _webSQLDatabaseDirectory]):
3874         (-[_WKWebsiteDataStoreConfiguration _setWebSQLDatabaseDirectory:]):
3875         (-[_WKWebsiteDataStoreConfiguration _cookieStorageFile]):
3876         (-[_WKWebsiteDataStoreConfiguration _setCookieStorageFile:]):
3877         (-[_WKWebsiteDataStoreConfiguration _resourceLoadStatisticsDirectory]):
3878         (-[_WKWebsiteDataStoreConfiguration _setResourceLoadStatisticsDirectory:]):
3879         (-[_WKWebsiteDataStoreConfiguration _cacheStorageDirectory]):
3880         (-[_WKWebsiteDataStoreConfiguration _setCacheStorageDirectory:]):
3881         (-[_WKWebsiteDataStoreConfiguration _serviceWorkerRegistrationDirectory]):
3882         (-[_WKWebsiteDataStoreConfiguration _setServiceWorkerRegistrationDirectory:]):
3883         (-[_WKWebsiteDataStoreConfiguration setSourceApplicationBundleIdentifier:]):
3884         (-[_WKWebsiteDataStoreConfiguration sourceApplicationBundleIdentifier]):
3885         (-[_WKWebsiteDataStoreConfiguration sourceApplicationSecondaryIdentifier]):
3886         (-[_WKWebsiteDataStoreConfiguration setSourceApplicationSecondaryIdentifier:]):
3887         (-[_WKWebsiteDataStoreConfiguration _apiObject]):
3888         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfigurationInternal.h: Added.
3889         * UIProcess/Network/NetworkProcessProxy.cpp:
3890         (WebKit::NetworkProcessProxy::retrieveCacheStorageParameters):
3891         * UIProcess/WebProcessPool.cpp:
3892         (WebKit::legacyWebsiteDataStoreConfiguration):
3893         (WebKit::WebProcessPool::mayHaveRegisteredServiceWorkers):
3894         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
3895         (WebKit::WebsiteDataStore::parameters):
3896         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3897         (WebKit::WebsiteDataStore::create):
3898         (WebKit::WebsiteDataStore::WebsiteDataStore):
3899         (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
3900         (WebKit::WebsiteDataStore::fetchDataAndApply):
3901         (WebKit::WebsiteDataStore::removeData):
3902         (WebKit::WebsiteDataStore::parameters):
3903         (WebKit::WebsiteDataStore::Configuration::Configuration): Deleted.
3904         * UIProcess/WebsiteData/WebsiteDataStore.h:
3905         (WebKit::WebsiteDataStore::cacheStoragePerOriginQuota const):
3906         (WebKit::WebsiteDataStore::setCacheStoragePerOriginQuota):
3907         (WebKit::WebsiteDataStore::cacheStorageDirectory const):
3908         (WebKit::WebsiteDataStore::setCacheStorageDirectory):
3909         (WebKit::WebsiteDataStore::serviceWorkerRegistrationDirectory const):
3910         (WebKit::WebsiteDataStore::setServiceWorkerRegistrationDirectory):
3911         (WebKit::WebsiteDataStore::resolvedApplicationCacheDirectory const):
3912         (WebKit::WebsiteDataStore::resolvedMediaCacheDirectory const):
3913         (WebKit::WebsiteDataStore::resolvedMediaKeysDirectory const):
3914         (WebKit::WebsiteDataStore::resolvedDatabaseDirectory const):
3915         (WebKit::WebsiteDataStore::resolvedJavaScriptConfigurationDirectory const):
3916         (WebKit::WebsiteDataStore::resolvedCookieStorageFile const):
3917         (WebKit::WebsiteDataStore::resolvedIndexedDatabaseDirectory const):
3918         (WebKit::WebsiteDataStore::resolvedServiceWorkerRegistrationDirectory const):
3919         (WebKit::WebsiteDataStore::resolvedResourceLoadStatisticsDirectory const):
3920         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp: Added.
3921         (WebKit::WebsiteDataStoreConfiguration::WebsiteDataStoreConfiguration):
3922         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h: Added.
3923         (WebKit::WebsiteDataStoreConfiguration::create):
3924         (WebKit::WebsiteDataStoreConfiguration::cacheStoragePerOriginQuota):
3925         (WebKit::WebsiteDataStoreConfiguration::setCacheStoragePerOriginQuota):
3926         (WebKit::WebsiteDataStoreConfiguration::applicationCacheDirectory const):
3927         (WebKit::WebsiteDataStoreConfiguration::setApplicationCacheDirectory):
3928         (WebKit::WebsiteDataStoreConfiguration::mediaCacheDirectory const):
3929         (WebKit::WebsiteDataStoreConfiguration::setMediaCacheDirectory):
3930         (WebKit::WebsiteDataStoreConfiguration::mediaKeysStorageDirectory const):
3931         (WebKit::WebsiteDataStoreConfiguration::setMediaKeysStorageDirectory):
3932         (WebKit::WebsiteDataStoreConfiguration::javaScriptConfigurationDirectory const):
3933         (WebKit::WebsiteDataStoreConfiguration::setJavaScriptConfigurationDirectory):
3934         (WebKit::WebsiteDataStoreConfiguration::webStorageDirectory const):
3935         (WebKit::WebsiteDataStoreConfiguration::setWebStorageDirectory):
3936         (WebKit::WebsiteDataStoreConfiguration::indexedDBDatabaseDirectory const):
3937         (WebKit::WebsiteDataStoreConfiguration::setIndexedDBDatabaseDirectory):
3938         (WebKit::WebsiteDataStoreConfiguration::webSQLDatabaseDirectory const):
3939         (WebKit::WebsiteDataStoreConfiguration::setWebSQLDatabaseDirectory):
3940         (WebKit::WebsiteDataStoreConfiguration::localStorageDirectory const):
3941         (WebKit::WebsiteDataStoreConfiguration::setLocalStorageDirectory):
3942         (WebKit::WebsiteDataStoreConfiguration::cookieStorageFile const):
3943         (WebKit::WebsiteDataStoreConfiguration::setCookieStorageFile):
3944         (WebKit::WebsiteDataStoreConfiguration::resourceLoadStatisticsDirectory const):
3945         (WebKit::WebsiteDataStoreConfiguration::setResourceLoadStatisticsDirectory):
3946         (WebKit::WebsiteDataStoreConfiguration::networkCacheDirectory const):
3947         (WebKit::WebsiteDataStoreConfiguration::setNetworkCacheDirectory):
3948         (WebKit::WebsiteDataStoreConfiguration::cacheStorageDirectory const):
3949         (WebKit::WebsiteDataStoreConfiguration::setCacheStorageDirectory):
3950         (WebKit::WebsiteDataStoreConfiguration::applicationCacheFlatFileSubdirectoryName const):
3951         (WebKit::WebsiteDataStoreConfiguration::setApplicationCacheFlatFileSubdirectoryName):
3952         (WebKit::WebsiteDataStoreConfiguration::serviceWorkerRegistrationDirectory const):
3953         (WebKit::WebsiteDataStoreConfiguration::setServiceWorkerRegistrationDirectory):
3954         (WebKit::WebsiteDataStoreConfiguration::sourceApplicationBundleIdentifier const):
3955         (WebKit::WebsiteDataStoreConfiguration::setSourceApplicationBundleIdentifier):
3956         (WebKit::WebsiteDataStoreConfiguration::sourceApplicationSecondaryIdentifier const):
3957         (WebKit::WebsiteDataStoreConfiguration::setSourceApplicationSecondaryIdentifier):
3958         * WebKit.xcodeproj/project.pbxproj:
3959
3960 2018-12-05  Wenson Hsieh  <wenson_hsieh@apple.com>
3961
3962         Turn WritingDirection into an enum class
3963         https://bugs.webkit.org/show_bug.cgi?id=192401
3964         Work towards <rdar://problem/42075638>
3965
3966         Reviewed by Dan Bernstein.
3967
3968         Change WritingDirection from an enum to an enum class. No change in behavior.
3969
3970         * WebProcess/WebPage/WebFrame.cpp:
3971         (WebKit::WebFrame::setTextDirection):
3972
3973 2018-12-05  Rob Buis  <rbuis@igalia.com>
3974
3975         [Mac] HEAD requests changed to GET after 301, 302, and 303 redirections (http/tests/xmlhttprequest/head-redirection.html)
3976         https://bugs.webkit.org/show_bug.cgi?id=114965
3977
3978         Reviewed by Frédéric Wang.
3979
3980         HEAD requests should not be changed to GET after 303 redirects, see [1].
3981         This was fixed earlier for GTK [2].
3982
3983         Behavior matches Firefox and Chrome.
3984
3985         [1] http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-21#section-7.4
3986         [2] https://bugs.webkit.org/show_bug.cgi?id=110127
3987
3988         Tests: web-platform-tests/fetch/api/redirect/redirect-method.html
3989                web-platform-tests/fetch/api/redirect/redirect-method-worker.html
3990                http/tests/xmlhttprequest/head-redirection.html
3991
3992         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3993         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
3994
3995 2018-12-04  Fujii Hironori  <Hironori.Fujii@sony.com>
3996
3997         Remove using namespace WebCore and WebKit under WebKit/Shared/API
3998         https://bugs.webkit.org/show_bug.cgi?id=192352
3999
4000         Reviewed by Alex Christensen.
4001
4002         Removed using namespace statements, and use namespace prefix
4003         instead.
4004
4005         * Shared/API/APIURLRequest.cpp:
4006         * Shared/API/APIURLResponse.cpp:
4007         * Shared/API/c/WKArray.cpp:
4008         * Shared/API/c/WKCertificateInfo.cpp:
4009         * Shared/API/c/WKConnectionRef.cpp:
4010         * Shared/API/c/WKContextMenuItem.cpp:
4011         * Shared/API/c/WKData.cpp:
4012         * Shared/API/c/WKDictionary.cpp:
4013         * Shared/API/c/WKErrorRef.cpp:
4014         * Shared/API/c/WKGeometry.cpp: