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