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