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