Add USE(LIBWPE) for WebKit events
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-11-19  Don Olmstead  <don.olmstead@sony.com>
2
3         Add USE(LIBWPE) for WebKit events
4         https://bugs.webkit.org/show_bug.cgi?id=191842
5
6         Reviewed by Michael Catanzaro.
7
8         Moves all WPE events to USE(LIBWPE) instead of PLATFORM(WPE). Updates
9         filenames to LibWPE.
10
11         * PlatformWPE.cmake:
12         * Shared/NativeWebKeyboardEvent.h:
13         * Shared/NativeWebMouseEvent.h:
14         * Shared/NativeWebTouchEvent.h:
15         * Shared/NativeWebWheelEvent.h:
16         * Shared/WebCoreArgumentCoders.cpp:
17         * Shared/WebCoreArgumentCoders.h:
18         * Shared/WebEvent.h:
19         * Shared/WebKeyboardEvent.cpp:
20         (WebKit::WebKeyboardEvent::WebKeyboardEvent):
21         * Shared/libwpe/NativeWebKeyboardEventLibWPE.cpp: Renamed from Source/WebKit/Shared/wpe/NativeWebKeyboardEventWPE.cpp.
22         * Shared/libwpe/NativeWebMouseEventLibWPE.cpp: Renamed from Source/WebKit/Shared/wpe/NativeWebMouseEventWPE.cpp.
23         * Shared/libwpe/NativeWebTouchEventLibWPE.cpp: Renamed from Source/WebKit/Shared/wpe/NativeWebTouchEventWPE.cpp.
24         * Shared/libwpe/NativeWebWheelEventLibWPE.cpp: Renamed from Source/WebKit/Shared/wpe/NativeWebWheelEventWPE.cpp.
25         * Shared/libwpe/WebEventFactory.cpp: Renamed from Source/WebKit/Shared/wpe/WebEventFactory.cpp.
26         * Shared/libwpe/WebEventFactory.h: Renamed from Source/WebKit/Shared/wpe/WebEventFactory.h.
27         * SourcesWPE.txt:
28
29 2018-11-19  David Quesada  <david_quesada@apple.com>
30
31         EXC_BAD_ACCESS when invoking a DownloadProxy's destination decision handler after the download has been canceled
32         https://bugs.webkit.org/show_bug.cgi?id=191762
33         rdar://problem/46151509
34
35         Reviewed by Dean Jackson.
36
37         When the DownloadClient calls the decision handler with a destination path, check if
38         m_processPool is null before trying to access its network process. This can happen
39         if a download is canceled before the client decides its destination.
40
41         * UIProcess/Downloads/DownloadProxy.cpp:
42         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync):
43
44 2018-11-19  Tomoki Imai  <Tomoki.Imai@sony.com>
45
46         [cairo] BackingStore::incorporateUpdate should use CompositeCopy to support drawsBackground=false in general Cairo ports
47         https://bugs.webkit.org/show_bug.cgi?id=191577
48
49         Reviewed by Carlos Garcia Campos.
50
51         We should use CompositeCopy operator to update bitmap to overwrite existing bitmap even if source contains
52         transparent parts. It enables ports which uses Cairo to set drawsBackground to false.
53         GTK ports has custom background extension, and in such case, we need to use CompositeSourceOver to retain
54         custom background.
55
56         * UIProcess/cairo/BackingStoreCairo.cpp:
57         (WebKit::BackingStore::incorporateUpdate): Use CompositeCopy operator to update bitmap.
58
59 2018-11-19  Joseph Pecoraro  <pecoraro@apple.com>
60
61         Web Inspector: "Reload Web Inspector" button no longer partially works
62         https://bugs.webkit.org/show_bug.cgi?id=191773
63         <rdar://problem/46139932>
64
65         Reviewed by Devin Rousso.
66
67         * UIProcess/RemoteWebInspectorProxy.cpp:
68         (WebKit::RemoteWebInspectorProxy::load):
69         (WebKit::RemoteWebInspectorProxy::reopen):
70         * UIProcess/RemoteWebInspectorProxy.h:
71         * UIProcess/RemoteWebInspectorProxy.messages.in:
72         * WebProcess/WebPage/RemoteWebInspectorUI.cpp:
73         (WebKit::RemoteWebInspectorUI::reopen):
74         * WebProcess/WebPage/RemoteWebInspectorUI.h:
75         * WebProcess/WebPage/WebInspector.cpp:
76         (WebKit::WebInspector::reopen):
77         * WebProcess/WebPage/WebInspector.h:
78         * WebProcess/WebPage/WebInspector.messages.in:
79         * WebProcess/WebPage/WebInspectorUI.cpp:
80         (WebKit::WebInspectorUI::reopen):
81         * WebProcess/WebPage/WebInspectorUI.h:
82
83 2018-11-19  Alejandro G. Castro  <alex@igalia.com>
84
85         [GTK][WPE] Solve some issues in the enumerateDevices code
86         https://bugs.webkit.org/show_bug.cgi?id=191832
87
88         Reviewed by Carlos Garcia Campos.
89
90         * UIProcess/API/glib/WebKitDeviceInfoPermissionRequest.cpp:
91         Increase the version to 2.24.
92         (webkitDeviceInfoPermissionRequestAllow):
93         (webkitDeviceInfoPermissionRequestDeny):
94         * UIProcess/API/glib/WebKitDeviceInfoPermissionRequestPrivate.h:
95         Replace the forward declaration with the include.
96         * UIProcess/API/gtk/WebKitDeviceInfoPermissionRequest.h: Typo.
97         * UIProcess/API/gtk/WebKitWebsiteData.h:
98         Increase the version to 2.24.
99         * UIProcess/API/wpe/WebKitDeviceInfoPermissionRequest.h: Typo.
100         * UIProcess/API/wpe/WebKitWebsiteData.h:
101         Increase the version to 2.24.
102
103 2018-11-19  Carlos Garcia Campos  <cgarcia@igalia.com>
104
105         Unreviewed. Fix GTK+ build after r238318.
106
107         Add new symbols to API documentation files. They should have been added in r237031, but r238318 revealed it.
108
109         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
110         * UIProcess/API/gtk/docs/webkit2gtk-4.0.types:
111         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
112
113 2018-11-19  Joseph Pecoraro  <pecoraro@apple.com>
114
115         Regression(r238330): A lot of WebInspector tests are crashing on the bots
116         https://bugs.webkit.org/show_bug.cgi?id=191814
117
118         Reviewed by Ryosuke Niwa.
119
120         Expose the expected connection type from the UIProcess into the WebProcess.
121         When there is a local inspector connection to the UIProcess expose it as
122         a local frontend channel to the inspector controllers in the Page.
123
124         * UIProcess/WebPageInspectorTargetAgent.h:
125         * UIProcess/WebPageInspectorTargetAgent.cpp:
126         (WebKit::WebPageInspectorTargetAgent::frontendChannel):
127         An additional FrontendChannel class is not needed, just use self.
128
129         (WebKit::WebPageInspectorTargetAgent::WebPageInspectorTargetAgent):
130         (WebKit::WebPageInspectorTargetAgent::connectionType const):
131         (WebKit::WebPageInspectorTargetAgent::sendMessageToFrontend):
132         Expose the channel to targets as local if there is a local frontend
133         in the UIProcess.
134
135 2018-11-18  Joseph Pecoraro  <pecoraro@apple.com>
136
137         Regression(r238330) ProcessSwap.WebInspector API test is a flaky crash in debug
138         https://bugs.webkit.org/show_bug.cgi?id=191812
139
140         Reviewed by Chris Dumez.
141
142         * WebProcess/WebPage/WebInspector.cpp:
143         (WebKit::WebInspector::setFrontendConnection):
144         It can be possible to receive a frontend connection multiple times
145         if another WebProcess opened the inspector and this WebProcess got
146         swapped in before the InspectorProcess notified the WebProcess of
147         a connection to use. It is always best to use the latest connection
148         we have received, since any others would have been invalidated.
149
150 2018-11-18  Chris Dumez  <cdumez@apple.com>
151
152         [PSON] Received an invalid message "WebPageProxy.DidPerformClientRedirect" from the web process
153         https://bugs.webkit.org/show_bug.cgi?id=191828
154
155         Reviewed by Antti Koivisto.
156
157         WebPageProxy::didPerformClientRedirect() had a MESSAGE_CHECK_URL() for both the source
158         and the destination URL. The macro calls WebProcessProxy::checkURLReceivedFromWebProcess()
159         to make sure that both URLs were actually loaded by this WebContent process.
160
161         However, now that we're enabled process-swap on cross-site navigation, these checks are no
162         longer fully valid. If the client-side redirect is cross-site, then the source and destination
163         URLs get loaded by 2 different WebContent processes. Since didPerformClientRedirect() gets
164         called after the redirect and gets set by the new WebContent process, only the destination URL
165         is guaranteed to have been loaded by this process. The source URL may have been loaded in
166         another process so this patch drops the message check for the source URL.
167
168         * UIProcess/WebPageProxy.cpp:
169         (WebKit::WebPageProxy::didPerformClientRedirect):
170
171 2018-11-18  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
172
173         Use Box<BinarySemaphore> instead of dispatch_semaphore_t
174         https://bugs.webkit.org/show_bug.cgi?id=189691
175
176         Reviewed by Ryosuke Niwa.
177
178         Use Box<BinarySemaphore> instead, which utilizes our WTF::Lock mechanism.
179
180         * NetworkProcess/watchos/NetworkProximityManager.mm:
181         (WebKit::NetworkProximityManager::updateRecommendation):
182
183 2018-11-17  Wenson Hsieh  <wenson_hsieh@apple.com>
184
185         [iOS] Remove all usages of UIItemProvider, UIItemProviderReading, and related classes
186         https://bugs.webkit.org/show_bug.cgi?id=191819
187
188         Reviewed by Dan Bernstein.
189
190         Replace UIItemProvider (and related classes) with NSItemProvider.
191
192         * Platform/spi/ios/UIKitSPI.h:
193         * UIProcess/ios/WKContentViewInteraction.mm:
194         (-[WKContentView _itemsForBeginningOrAddingToSessionWithRegistrationList:stagedDragSource:]):
195         (-[WKContentView dropInteraction:performDrop:]):
196
197 2018-11-17  Ross Kirsling  <ross.kirsling@sony.com>
198
199         Unreviewed WinCairo build fix for r238353.
200
201         * UIProcess/WebPageProxy.cpp:
202         (WebKit::WebPageProxy::continueNavigationInNewProcess):
203
204 2018-11-17  Chris Dumez  <cdumez@apple.com>
205
206         ASSERTION FAILED: m_messageReceivers.contains(...) under ViewGestureController removeMessageReceiver
207         https://bugs.webkit.org/show_bug.cgi?id=191734
208         <rdar://problem/46151497>
209
210         Reviewed by Ryosuke Niwa.
211
212         When a WebProcess crashes, we destroy the ViewGestureController and reconstruct it later
213         after we've relaunched a new WebProcess. The ViewGestureController controller takes care
214         of adding itself as an IPC message receiver to the WebProcessProxy, and the destructor
215         takes care of removing itself as an IPC message receiver.
216
217         However, when process-swapping on navigation, we do not destroy the ViewGestureController
218         because doing so would take down the swipe gesture snapshot on cross-site swipe navigation.
219         This led to hitting this assertion later on because the ViewGestureController is still
220         registered as an IPC message receiver with the old process after process swapping.
221
222         To address the issue, we now make sure the ViewGestureController unregisters itself from
223         the old process and registers itself with the new process on process-swap.
224
225         * UIProcess/Cocoa/ViewGestureController.cpp:
226         (WebKit::ViewGestureController::ViewGestureController):
227         (WebKit::ViewGestureController::~ViewGestureController):
228         (WebKit::ViewGestureController::disconnectFromProcess):
229         (WebKit::ViewGestureController::connectToProcess):
230         * UIProcess/Cocoa/ViewGestureController.h:
231         * UIProcess/Cocoa/WebViewImpl.mm:
232         (WebKit::WebViewImpl::processWillSwap):
233         (WebKit::WebViewImpl::didRelaunchProcess):
234
235 2018-11-17  Chris Dumez  <cdumez@apple.com>
236
237         [PSON] ASSERTION FAILED: m_uncommittedState.state == State::Committed
238         https://bugs.webkit.org/show_bug.cgi?id=191781
239
240         Reviewed by Ryosuke Niwa.
241
242         The crash was happening when switching to a suspended page that is not yet done
243         suspending (e.g. in case of very fast back/forward navigation). The WebPageProxy
244         would reattach to the suspended process and get load notifications that it did
245         not expect since it did not schedule any load yet. Those notifications are for
246         the about:blank load we do for page suspension.
247
248         To address the issue, make swapToWebProcess() asynchronous and take a completion
249         handler. When we try to unsuspend a SuspendedPageProxy, we first make sure it
250         is actually done suspending. If it is not done suspending, we wait until it is
251         before telling in to unsuspend and proceeding with the new load.
252
253         * UIProcess/SuspendedPageProxy.cpp:
254         (WebKit::SuspendedPageProxy::unsuspend):
255         (WebKit::SuspendedPageProxy::didFinishLoad):
256         * UIProcess/SuspendedPageProxy.h:
257         * UIProcess/WebPageProxy.cpp:
258         (WebKit::WebPageProxy::swapToWebProcess):
259         (WebKit::WebPageProxy::continueNavigationInNewProcess):
260         * UIProcess/WebPageProxy.h:
261
262 2018-11-17  Chris Dumez  <cdumez@apple.com>
263
264         Unreviewed follow-up to r238343 to address debug assertions in 2 API tests.
265
266         * UIProcess/Network/NetworkProcessProxy.cpp:
267         (WebKit::NetworkProcessProxy::networkProcessCrashed):
268
269 2018-11-17  Devin Rousso  <drousso@apple.com>
270
271         Web Inspector: Network: add button to show system certificate dialog
272         https://bugs.webkit.org/show_bug.cgi?id=191458
273         <rdar://problem/45977019>
274
275         Reviewed by Joseph Pecoraro.
276
277         * UIProcess/WebInspectorProxy.messages.in:
278         * UIProcess/WebInspectorProxy.h:
279         * UIProcess/WebInspectorProxy.cpp:
280         (WebKit::WebInspectorProxy::showCertificate): Added.
281         (WebKit::WebInspectorProxy::platformShowCertificate): Added.
282         * UIProcess/mac/WebInspectorProxyGtk.cpp:
283         (WebKit::WebInspectorProxy::platformShowCertificate): Added.
284         * UIProcess/mac/WebInspectorProxyMac.mm:
285         (WebKit::WebInspectorProxy::platformShowCertificate): Added.
286         * UIProcess/mac/WebInspectorProxyWPE.cpp:
287         (WebKit::WebInspectorProxy::platformShowCertificate): Added.
288         * UIProcess/mac/WebInspectorProxyWin.cpp:
289         (WebKit::WebInspectorProxy::platformShowCertificate): Added.
290         * WebProcess/WebPage/WebInspectorUI.h:
291         * WebProcess/WebPage/WebInspectorUI.cpp:
292         (WebKit::WebInspectorUI::showCertificate): Added.
293
294         * UIProcess/RemoteWebInspectorProxy.messages.in:
295         * UIProcess/RemoteWebInspectorProxy.h:
296         * UIProcess/RemoteWebInspectorProxy.cpp:
297         (WebKit::RemoteWebInspectorProxy::showCertificate): Added.
298         (WebKit::RemoteWebInspectorProxy::platformShowCertificate): Added.
299         * UIProcess/mac/RemoteWebInspectorProxyGtk.cpp:
300         (WebKit::RemoteWebInspectorProxy::platformShowCertificate): Added.
301         * UIProcess/mac/RemoteWebInspectorProxyMac.mm:
302         (WebKit::RemoteWebInspectorProxy::platformShowCertificate): Added.
303         * WebProcess/WebPage/RemoteWebInspectorUI.h:
304         * WebProcess/WebPage/RemoteWebInspectorUI.cpp:
305         (WebKit::RemoteWebInspectorUI::showCertificate): Added.
306
307         * NetworkProcess/cache/NetworkCacheCoders.h:
308         * NetworkProcess/cache/NetworkCacheCodersCocoa.cpp: Removed.
309         * NetworkProcess/cache/NetworkCacheCodersCurl.cpp: Removed.
310         * NetworkProcess/cache/NetworkCacheCodersSoup.cpp: Removed.
311         Moved `WebCore::CertificateInfo` code for `WTF::Encoder` and `WTF::Decoder` into their
312         respective platform's CertificateInfo.h file.
313
314         * UIProcess/Authentication/mac/WebCredentialMac.mm:
315
316         * Configurations/WebKit.xcconfig:
317         * PlatformMac.cmake:
318         * PlatformWin.cmake:
319         * SourcesCocoa.txt:
320         * SourcesGTK.txt:
321         * SourcesWPE.txt:
322         * WebKit.xcodeproj/project.pbxproj:
323
324 2018-11-16  Chris Dumez  <cdumez@apple.com>
325
326         Regression(ProcessPrewarming) Assertion hit in NetworkProcessProxy destructor
327         https://bugs.webkit.org/show_bug.cgi?id=191800
328
329         Reviewed by Ryosuke Niwa.
330
331         Make sure the NetworkProcessProxy destructor calls its remaining m_pendingConnectionReplies
332         completion handlers to avoid hitting an assertion in the CompletionHandler destructor.
333
334         Prewarmed WebProcess do not keep the ProcessPool alive and thus not the NetworkProcessProxy
335         either. As a result, it is possible for NetworkProcessProxy to have pending connection
336         requests from those prewarmed processes when it is destroyed. Similar story for the
337         suspended page processes when they are destroyed.
338
339         * UIProcess/Network/NetworkProcessProxy.cpp:
340         (WebKit::NetworkProcessProxy::~NetworkProcessProxy):
341
342 2018-11-16  Alex Christensen  <achristensen@webkit.org>
343
344         Tweak _showSafeBrowsingWarningWithTitle SPI
345         https://bugs.webkit.org/show_bug.cgi?id=191799
346
347         Reviewed by Wenson Hsieh.
348
349         * UIProcess/API/Cocoa/WKWebView.mm:
350         (-[WKWebView _showSafeBrowsingWarningWithTitle:warning:details:completionHandler:]):
351         (+[WKWebView _visitUnsafeWebsiteSentinel]):
352         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
353         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
354         (-[WKSafeBrowsingWarning clickedOnLink:]):
355         I need to localize "Continue" and "Cancel" so they aren't always in English.
356
357 2018-11-16  Chris Dumez  <cdumez@apple.com>
358
359         WKWebViewMacEditingTests.DoNotCrashWhenInterpretingKeyEventWhileDeallocatingView API test is crashing in debug
360         https://bugs.webkit.org/show_bug.cgi?id=191797
361
362         Reviewed by Ryosuke Niwa.
363
364         We were hitting the assertion because the error handler was first getting called. It would
365         deallocate the send right, cancel/null out the XPC connection and call
366         didFinishLaunchingProcess(0, IPC::Connection::Identifier()).
367
368         Then the xpc_connection_send_message_with_reply() block would get called later and
369         would try to deallocate the send right again, and call
370         didFinishLaunchingProcess(0, IPC::Connection::Identifier()) again because the xpc
371         connection is null.
372
373         Handle this case by having the xpc_connection_send_message_with_reply() block check
374         that we're still launching (i.e. didFinishLaunchingProcess() has not been called
375         yet).
376
377         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
378         (WebKit::ProcessLauncher::launchProcess):
379
380 2018-11-16  Joseph Pecoraro  <pecoraro@apple.com>
381
382         Unreviewed follow-up to r238330.
383
384         * UIProcess/WebPageProxy.cpp:
385         (WebKit::WebPageProxy::close):
386         Don't clear the pointer after invalidating since the pointer is
387         used later one. We don't mind it being used after invalidation
388         it will do the right thing, we'd rather have the WebInspectorProxy
389         lifetime match the WebPageProxy.
390
391 2018-11-16  Chris Dumez  <cdumez@apple.com>
392
393         ProcessSwap.NavigationWithLockedHistoryWithoutPSON API test is a flaky crash in debug
394         https://bugs.webkit.org/show_bug.cgi?id=191795
395
396         Reviewed by Alex Christensen.
397
398         If the WebProcessPool is getting destroyed while there is a prewarmed WebContent process
399         that is awaiting its connnection to the network process, then we'll hit the
400         process->hasOneRef() assertion in the WebProcessPool destructor. This is because
401         NetworkProcessProxy::m_pendingConnectionReplies keeps a RefPtr to the WebProcessProxy
402         that is awaiting the connection. The NetworkProcessProxy does not really need to keep
403         the WebProcessProxy alive in this case so this patch switches to using a WeakPtr instead.
404
405         * UIProcess/Network/NetworkProcessProxy.cpp:
406         (WebKit::NetworkProcessProxy::getNetworkProcessConnection):
407         (WebKit::NetworkProcessProxy::networkProcessCrashed):
408         * UIProcess/Network/NetworkProcessProxy.h:
409         * UIProcess/WebProcessProxy.h:
410
411 2018-11-16  Chris Dumez  <cdumez@apple.com>
412
413         [macOS] Label "prewarmed" WebContent processes in Activity Monitor
414         https://bugs.webkit.org/show_bug.cgi?id=191765
415         <rdar://problem/45953463>
416
417         Reviewed by Geoffrey Garen.
418
419         Label "prewarmed" WebContent processes in Activity Monitor to facilitate debugging.
420
421         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
422         (WebKit::XPCServiceInitializerDelegate::getExtraInitializationData):
423         * UIProcess/WebProcessProxy.cpp:
424         (WebKit::WebProcessProxy::getLaunchOptions):
425         (WebKit::WebProcessProxy::markIsNoLongerInPrewarmedPool):
426         * WebProcess/WebProcess.cpp:
427         (WebKit::WebProcess::markIsNoLongerPrewarmed):
428         * WebProcess/WebProcess.h:
429         * WebProcess/WebProcess.messages.in:
430         * WebProcess/cocoa/WebProcessCocoa.mm:
431         (WebKit::WebProcess::initializeProcessName):
432         (WebKit::WebProcess::updateProcessName):
433         (WebKit::WebProcess::platformInitializeProcess):
434
435 2018-11-16  Joseph Pecoraro  <pecoraro@apple.com>
436
437         Web Inspector: Keep Web Inspector window alive across process swaps (PSON) (Local Inspector)
438         https://bugs.webkit.org/show_bug.cgi?id=191740
439         <rdar://problem/45470897>
440
441         Reviewed by Timothy Hatcher.
442
443         When a web page asks to open a local Web Inspector, that inspector
444         will now connect in the UIProcess (WebPageProxy / WebPageInspectorController)
445         instead of the WebContentProcess (WebKit::WebInspector / InspectorController).
446
447         Previously a WebInspectorProxy was re-created every time the WebPageProxy's
448         WebPage / WebProcess was changed, effectively closing the Web Inspector
449         frontend when the WebPage was swapped or crashed.
450
451         This change keeps the WebInspectorProxy alive as long as the WebPageProxy
452         is alive. During process swaps, or process crashes, the WebInspectorProxy
453         is reset when the page is reset and updated when the page's WebProcess
454         changes. Since WebInspectorProxy owns the Web Inspector view / window
455         the Web Inspector window can be kept alive across (and attached state)
456         across WebPage / WebProcess changes.
457
458         Previously the WebContentProcess's WebKit::WebInspector was the Local
459         FrontendChannel for the WebCore::InspectorController. This can't
460         outlive the single WebContentProcess.
461
462         This change makes the UIProcesses' WebInspectorProxy the Local FrontendChannel
463         for the WebKit::WebPageInspectorController. Given the WebInspectorProxy
464         now stays alive alongside the WebPageProxy this will live across process changes.
465         This means that the WebInspectorUI process must send its backend messages to
466         the WebInspectorProxy -> WebPageInspectorController now instead of the
467         old path WebInspector -> WebCore::InspectorController.
468
469         A direct IPC connection is still maintained between the WebContentProcess's
470         WebKit::WebInspector and the InspectorProcess's WebInspectorUI. Previously
471         this connection was established by WebKit::WebInspector vending an
472         IPC::Attachment to the WebInspectorUI process. This patch inverts that
473         relationship, because the WebInspectorUI process now lives across multiple
474         WebContentProcess changes. The WebInspectorUI now vends the IPC::Attachment
475         to the WebContentProcess each time the process changes. This way they can both
476         still communicate through normal Messages::WebInspector/WebInspectorUI
477         messages and everything behaves as previously expected.
478
479         * Scripts/webkit/messages.py:
480         Header for Inspector::FrontendChannel::ConnectionType.
481
482         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
483         (WebKit::WebInspectorClient::openLocalFrontend):
484         * WebProcess/WebPage/WebInspector.cpp:
485         (WebKit::WebInspector::openLocalInspectorFrontend):
486         (WebKit::WebInspector::setFrontendConnection):
487         (WebKit::WebInspector::closeFrontendConnection):
488         (WebKit::WebInspector::close):
489         (WebKit::WebInspector::openFrontendConnection): Deleted.
490         (WebKit::WebInspector::sendMessageToBackend): Deleted.
491         (WebKit::WebInspector::sendMessageToFrontend): Deleted.
492         On the WebProcess side we ask the UIProcess to open a local frontend and now
493         receive instead of vend an IPC connection to the WebInspectorUI process.
494
495         * UIProcess/WebPageProxy.cpp:
496         (WebKit::WebPageProxy::finishAttachingToWebProcess):
497         (WebKit::WebPageProxy::close):
498         (WebKit::WebPageProxy::resetState):
499         Keep the WebInspectorProxy alive alongside the WebPageProxy.
500         Update it as processes / states change.
501
502         * UIProcess/WebInspectorProxy.h:
503         * UIProcess/WebInspectorProxy.messages.in:
504         * UIProcess/WebInspectorProxy.cpp:
505         (WebKit::WebInspectorProxy::openLocalInspectorFrontend):
506         (WebKit::WebInspectorProxy::createInspectorPage): Deleted.
507         (WebKit::WebInspectorProxy::sendMessageToFrontend):
508         (WebKit::WebInspectorProxy::closeFrontendPageAndWindow):
509         Open and close a local frontend by being the FrontendChannel on the UIProcess side.
510
511         (WebKit::WebInspectorProxy::sendMessageToBackend):
512         Dispatch WebInspectorUI backend messages to the UIProcess's InspectorController
513         now that the InspectorController is here instead of in the WebProcess.
514
515         (WebKit::WebInspectorProxy::setFrontendConnection):
516         Transfer the WebProcess <-> InspectorProcess IPC connection through us
517         because we are the one link between them when processes change.
518
519         (WebKit::WebInspectorProxy::invalidate):
520         (WebKit::WebInspectorProxy::frontendLoaded):
521         Be safer and handle inspectedPage being potentially null.
522
523         * WebProcess/WebPage/WebPageInspectorTargetController.cpp:
524         (WebKit::WebPageInspectorTargetController::connectInspector):
525         * WebProcess/WebPage/WebPageInspectorTargetController.h:
526         * WebProcess/WebPage/WebPageInspectorTargetFrontendChannel.cpp:
527         (WebKit::WebPageInspectorTargetFrontendChannel::create):
528         (WebKit::WebPageInspectorTargetFrontendChannel::WebPageInspectorTargetFrontendChannel):
529         * WebProcess/WebPage/WebPageInspectorTargetFrontendChannel.h:
530         * UIProcess/InspectorTargetProxy.cpp:
531         (WebKit::InspectorTargetProxy::connect):
532         Proxy the ConnectionType received on the UIProcess side to the WebProcess side
533         when connecting to sub-targets.
534
535         * WebProcess/WebPage/WebPage.cpp:
536         (WebKit::WebPage::connectInspector):
537         (WebKit::WebPage::setHasLocalInspectorFrontend): Deleted.
538         * WebProcess/WebPage/WebPage.h:
539         * WebProcess/WebPage/WebPage.messages.in:
540         * UIProcess/WebPageProxy.h:
541         (WebKit::WebPageProxy::hasLocalInspectorFrontend const): Deleted.
542         (WebKit::WebPageProxy::setHasLocalInspectorFrontend): Deleted.
543         * UIProcess/WebPageProxy.messages.in:
544         * UIProcess/WebProcessPool.cpp:
545         (WebKit::WebProcessPool::processForNavigationInternal):
546         Eliminate the hasLocalInspectorFrontend state that was only used
547         to disable PSON. PSON no longer needs to be disabled for this reason.
548
549         * WebProcess/WebPage/WebInspector.h:
550         * WebProcess/WebPage/WebInspector.messages.in:
551         * WebProcess/WebPage/WebInspectorUI.cpp:
552         (WebKit::WebInspectorUI::establishConnection):
553         (WebKit::WebInspectorUI::updateConnection):
554         (WebKit::WebInspectorUI::closeWindow):
555         (WebKit::WebInspectorUI::sendMessageToBackend):
556         * WebProcess/WebPage/WebInspectorUI.h:
557         * WebProcess/WebPage/WebInspectorUI.messages.in:
558         Vend an IPC connection on demand to the WebProcess side.
559
560 2018-11-16  Michael Catanzaro  <mcatanzaro@igalia.com>
561
562         [GTK][WPE] Add "WebKitDeviceInfoPermissionRequest.h" into webkit2.h
563         https://bugs.webkit.org/show_bug.cgi?id=191744
564         <rdar://problem/46125461>
565
566         Unreviewed, install the file.
567
568         * PlatformGTK.cmake:
569         * PlatformWPE.cmake:
570
571 2018-11-16  Zalan Bujtas  <zalan@apple.com>
572
573         Add DidFirstMeaningfulPaint milestone.
574         https://bugs.webkit.org/show_bug.cgi?id=191754
575
576         Reviewed by Simon Fraser.
577
578         * Shared/API/c/WKPageLoadTypes.h:
579         * Shared/API/c/WKSharedAPICast.h:
580         (WebKit::toWKLayoutMilestones):
581         (WebKit::toLayoutMilestones):
582         * UIProcess/API/C/WKPageRenderingProgressEvents.h:
583         * UIProcess/API/C/WKPageRenderingProgressEventsInternal.h:
584         (pageRenderingProgressEvents):
585
586 2018-11-16  Chris Dumez  <cdumez@apple.com>
587
588         Automatic process prewarming should be turned on if PSON is enabled via experimental features
589         https://bugs.webkit.org/show_bug.cgi?id=191761
590
591         Reviewed by Ryosuke Niwa.
592
593         m_isAutomaticProcessWarmingEnabledByClient is a std::optional and should not be initialized to
594         true / false until the client calls API to toggle the feature. When m_isAutomaticProcessWarmingEnabledByClient
595         is std::nullopt then m_processSwapsOnNavigationFromExperimentalFeatures controls automatic
596         process prewarming.
597
598         * UIProcess/API/APIProcessPoolConfiguration.h:
599
600 2018-11-16  Alex Christensen  <achristensen@webkit.org>
601
602         Add API to disable safe browsing checks
603         https://bugs.webkit.org/show_bug.cgi?id=191610
604
605         Reviewed by Dean Jackson.
606
607         * UIProcess/API/Cocoa/WKPreferences.h:
608         * UIProcess/API/Cocoa/WKPreferences.mm:
609         (-[WKPreferences setSafeBrowsingEnabled:]):
610         (-[WKPreferences isSafeBrowsingEnabled]):
611         (-[WKPreferences _setSafeBrowsingEnabled:]): Deleted.
612         (-[WKPreferences _safeBrowsingEnabled]): Deleted.
613         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
614
615 2018-11-16  Chris Dumez  <cdumez@apple.com>
616
617         WebKit.UnavailablePlugIn API test is crashing in debug
618         https://bugs.webkit.org/show_bug.cgi?id=191753
619
620         Reviewed by Alex Christensen.
621
622         Add missing early returns. Those were mistakenly dropped in r235200.
623
624         * UIProcess/Cocoa/NavigationState.mm:
625         (WebKit::NavigationState::NavigationClient::decidePolicyForPluginLoad):
626
627 2018-11-16  Chris Dumez  <cdumez@apple.com>
628
629         [Mac] Regression: WebContent process's display name is no longer set
630         https://bugs.webkit.org/show_bug.cgi?id=191722
631         <rdar://problem/45960550>
632
633         Reviewed by Per Arne Vollan.
634
635         Make sure The WebContent process calls _RegisterApplication() during initialization and
636         *before* trying to set its display name. Setting the display name fails otherwise.
637
638         * WebProcess/cocoa/WebProcessCocoa.mm:
639         (WebKit::WebProcess::initializeProcessName):
640         (WebKit::WebProcess::platformInitializeProcess):
641
642 2018-11-16  Ryosuke Niwa  <rniwa@webkit.org>
643
644         Enable process swap on cross-site navigation by default on iOS
645         https://bugs.webkit.org/show_bug.cgi?id=191735
646
647         Reviewed by Chris Dumez.
648
649         Enabled the feature.
650
651         * Shared/WebPreferencesDefaultValues.h:
652
653 2018-11-16  Antti Koivisto  <antti@apple.com>
654
655         REGRESSION(r237467) [PSON] iOS: Going back to a page sometimes doesn't restore the full page
656         https://bugs.webkit.org/show_bug.cgi?id=191737
657
658         Reviewed by Simon Fraser.
659
660         * WebProcess/WebPage/WebPage.cpp:
661         (WebKit::WebPage::setLayerTreeStateIsFrozen):
662
663         Layer tree should stay frozen in m_shouldResetDrawingArea state. Otherwise spurious commit transactions may
664         mess up state on UI process side.
665
666         Specifically WKWebView._needsResetViewStateAfterCommitLoadForMainFrame would get stuck to TRUE and prevent
667         all viewport updates because WKWebView._firstPaintAfterCommitLoadTransactionID has value greater
668         than any current transaction IDs.
669
670 2018-11-16  Chris Dumez  <cdumez@apple.com>
671
672         Unreviewed typo fix in comment added in r238250.
673
674         * UIProcess/WebProcessPool.cpp:
675         (WebKit::WebProcessPool::ensureNetworkProcess):
676
677 2018-11-16  Sihui Liu  <sihui_liu@apple.com>
678
679         Storing blobs in IDB on iOS: "Error preparing blob/file"
680         https://bugs.webkit.org/show_bug.cgi?id=188438
681         <rdar://problem/43097279>
682
683         Reviewed by Alex Christensen.
684
685         Grant sandbox extension of temp folder to network process, and clean up some code that managed sandbox extension
686         of IDB temporary blob files in network process.
687
688         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
689         (WebKit::NetworkBlobRegistry::registerBlobURLOptionallyFileBacked):
690         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
691         (WebKit::WebIDBConnectionToClient::handleGetResult):
692         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
693         (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
694         (WebKit::NetworkConnectionToWebProcess::preregisterSandboxExtensionsForOptionallyFileBackedBlob): Deleted.
695         (WebKit::NetworkConnectionToWebProcess::getBlobDataFileReferenceForPath): Deleted.
696         * NetworkProcess/NetworkConnectionToWebProcess.h:
697         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
698         * NetworkProcess/NetworkProcess.cpp:
699         (WebKit::NetworkProcess::accessToTemporaryFileComplete):
700         (WebKit::NetworkProcess::getSandboxExtensionsForBlobFiles):
701         (WebKit::NetworkProcess::prepareForAccessToTemporaryFile): Deleted.
702         (WebKit::NetworkProcess::updateTemporaryFileSandboxExtensions): Deleted.
703         * NetworkProcess/NetworkProcess.h:
704         * NetworkProcess/NetworkProcessCreationParameters.cpp:
705         (WebKit::NetworkProcessCreationParameters::encode const):
706         (WebKit::NetworkProcessCreationParameters::decode):
707         * NetworkProcess/NetworkProcessCreationParameters.h:
708         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
709         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
710         * UIProcess/WebProcessPool.cpp:
711         (WebKit::WebProcessPool::ensureNetworkProcess):
712         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
713         (WebKit::WebIDBConnectionToServer::didGetRecord):
714         (WebKit::WebIDBConnectionToServer::didGetAllRecords):
715         (WebKit::WebIDBConnectionToServer::didOpenCursor):
716         (WebKit::WebIDBConnectionToServer::didIterateCursor):
717         (WebKit::preregisterSandboxExtensionsIfNecessary): Deleted.
718
719 2018-11-16  Don Olmstead  <don.olmstead@sony.com>
720
721         Add USE(LIBWPE) to WebCore
722         https://bugs.webkit.org/show_bug.cgi?id=191401
723
724         Reviewed by Michael Catanzaro.
725
726         Rename PlatformDisplayWPE to PlatformDisplayLibWPE.
727
728         * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp:
729         (WebKit::AcceleratedSurfaceWPE::initialize):
730         * WebProcess/wpe/WebProcessMainWPE.cpp:
731
732 2018-11-16  Thibault Saunier  <tsaunier@igalia.com>
733
734         [GStreamer][WebRTC] Add API to enable/disable device mocks
735         https://bugs.webkit.org/show_bug.cgi?id=191699
736
737         This basically us to test MediaStream/WebRTC support without
738         requiring cameras or microphones and is quite useful.
739
740         Also fix the GStreamerAudioMock by:
741           - Stop setting `leaky-upstream` on the GStreamerCapturer queue,
742             this was usefull when we were trying to bring the MediaStream
743             sources inside the main pipeline, it is not the case anymore
744             (and not doable with latest version of LibWebRTC).
745           - Use a 'ticks' wave on the gstreamer audiotestsrc so the test
746             stream is similar to what Apple port does.
747
748         Reviewed by Xabier Rodriguez-Calvar.
749
750         The mocks are already tested and the API is really simple.
751
752         * UIProcess/API/glib/WebKitSettings.cpp:
753         (webKitSettingsSetProperty):
754         (webKitSettingsGetProperty):
755         (webkit_settings_class_init):
756         (webkit_settings_get_enable_mock_capture_devices):
757         (webkit_settings_set_enable_mock_capture_devices):
758         * UIProcess/API/gtk/WebKitSettings.h:
759         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
760
761 2018-11-16  Thibault Saunier  <tsaunier@igalia.com>
762
763         [GTK][WPE] Add "WebKitDeviceInfoPermissionRequest.h" into webkit2.h
764         https://bugs.webkit.org/show_bug.cgi?id=191744
765
766         It should always have been there.
767
768         Reviewed by Carlos Garcia Campos.
769
770         * UIProcess/API/gtk/webkit2.h:
771
772 2018-11-16  Antoine Quint  <graouts@apple.com>
773
774         PointerEvents should not require touch event listeners to be registered
775         https://bugs.webkit.org/show_bug.cgi?id=191333
776         <rdar://problem/45857523>
777
778         Reviewed by Dean Jackson.
779
780         * UIProcess/WebPageProxy.cpp:
781         (WebKit::WebPageProxy::updateTouchEventTracking):
782         (WebKit::WebPageProxy::touchEventTrackingType const):
783         (WebKit::WebPageProxy::handleTouchEventSynchronously):
784         (WebKit::WebPageProxy::handleTouchEventAsynchronously):
785         (WebKit::WebPageProxy::handleTouchEvent):
786         (WebKit::WebPageProxy::resetState):
787         * UIProcess/WebPageProxy.h:
788
789 2018-11-15  Myles C. Maxfield  <mmaxfield@apple.com>
790
791         WKPreferencesSetFontSmoothingLevel doesn't actually do anything
792         https://bugs.webkit.org/show_bug.cgi?id=191708
793
794         Reviewed by Simon Fraser.
795
796         Delete the symbol because no one calls it and it doesn't do anything
797
798         * Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb:
799         * Shared/FontSmoothingLevel.h: Removed.
800         * Shared/WebPreferences.yaml:
801         * UIProcess/API/C/WKAPICast.h:
802         (WebKit::toFontSmoothingLevel): Deleted.
803         * UIProcess/API/C/WKPreferences.cpp:
804         (WKPreferencesSetFontSmoothingLevel): Deleted.
805         (WKPreferencesGetFontSmoothingLevel): Deleted.
806         * UIProcess/API/C/WKPreferencesRefPrivate.h:
807         * UIProcess/WebPreferences.h:
808         * WebKit.xcodeproj/project.pbxproj:
809         * mac/WebKit2.order:
810
811 2018-11-15  Truitt Savell  <tsavell@apple.com>
812
813         Unreviewed, rolling out r238244.
814
815         Caused High Sierra test runs to fail early with 50 crashes and
816         casued 25 API failures.
817
818         Reverted changeset:
819
820         "[css-logical] Implement flow-relative margin, padding and
821         border shorthands"
822         https://bugs.webkit.org/show_bug.cgi?id=188697
823         https://trac.webkit.org/changeset/238244
824
825 2018-11-15  Joseph Pecoraro  <pecoraro@apple.com>
826
827         Web Inspector: Remove unused WebInspectorProxy code
828         https://bugs.webkit.org/show_bug.cgi?id=191674
829
830         Reviewed by Dean Jackson.
831
832         * UIProcess/WebInspectorProxy.cpp:
833         (WebKit::WebInspectorProxy::createInspectorPage):
834         (WebKit::WebInspectorProxy::closeFrontendPageAndWindow):
835         * UIProcess/WebInspectorProxy.h:
836         * UIProcess/mac/WebInspectorProxyMac.mm:
837         (WebKit::WebInspectorProxy::setInspectorWindowFrame): Deleted.
838         (WebKit::WebInspectorProxy::inspectorWindowFrame): Deleted.
839         * WebProcess/WebPage/WebInspector.h:
840
841 2018-11-15  Ryosuke Niwa  <rniwa@webkit.org>
842
843         Enable process swap on cross-site navigation by default on macOS
844         https://bugs.webkit.org/show_bug.cgi?id=191572
845
846         Reviewed by Chris Dumez.
847
848         Enabled the feature by default on macOS.
849
850         * Shared/WebPreferences.yaml:
851         * Shared/WebPreferencesDefaultValues.h:
852
853 2018-11-15  Chris Dumez  <cdumez@apple.com>
854
855         IndexedDB.IndexedDBTempFileSize API test times out with process prewarming enabled
856         https://bugs.webkit.org/show_bug.cgi?id=191671
857         <rdar://problem/46086062>
858
859         Reviewed by Alex Christensen.
860
861         Enabling process prewarming caused IndexedDB.IndexedDBTempFileSize API to time out and print
862         the following line:
863         "Attempted to create a NetworkLoad with a session (id=2) that does not exist."
864
865         This actually identified a pre-existing bug with our handling of non-default data store.
866         Whenever a page starts using a data store, we call WebProcessPool::pageBeginUsingWebsiteDataStore()
867         which will call NetworkProcessProxy::addSession() if the network process was already started
868         to let the network process know about this non-default session. There are several issues with the
869         current model:
870         1. If the network process was not created yet when pageBeginUsingWebsiteDataStore() is called,
871            then the network process will not know about the non-default session when it actually gets
872            started later on. This is unlikely to happen in practice, except in case of network process
873            crash because we create the network process as soon as we initialize the first WebProcessProxy.
874         2. Even if we successfuly managed to register the session with the network process proxy, we get
875            in trouble if the network process crashes or is terminated later on as we do not re-register
876            those sessions with the new network process.
877
878         To address these 2 issues, WebProcessPool::ensureNetworkProcess() now takes care of registering
879         all the non-default sessions (that are associated with this process pool) with the new network
880         process. The WebProcessPool knows about these sessions because it adds them to m_sessionToPagesMap
881         whenever WebProcessPool::pageBeginUsingWebsiteDataStore() is called, even if the network process
882         proxy was not created yet.
883
884         The reason the IndexedDB.IndexedDBTempFileSize API test was failing was because it did:
885         1. A load in a WebView V1 with a non-default session
886         2. Process prewarming kicked in after this load and would create a new WebProcessProxy.
887         3. Terminate the network process
888         4. Another load in a WebView V2 with the same non-defaut session, which would reuse the
889           prewarmed process. Because the network process was terminated, constructing the new
890           page would not register the session ID with the new network process when
891           pageBeginUsingWebsiteDataStore() is called.
892         -> The load would hang because the new network process would not know about the
893            non-default session when started later on.
894
895         The bug was previously hidden without process prewarming because step 4 would create a *new*
896         WebProcessProxy and WebProcessPool::initializeNewWebProcess() would call ensureNetworkProcess()
897         so that pageBeginUsingWebsiteDataStore() would successfuly register the session with the
898         network process later on.
899
900         I wrote a second API test (WebKit.DoLoadWithNonDefaultDataStoreAfterTerminatingNetworkProcess)
901         to demonstrate the pre-existing bug without process prewarming enabled.
902
903         * UIProcess/WebProcessPool.cpp:
904         (WebKit::WebProcessPool::ensureNetworkProcess):
905
906 2018-11-15  Vivek Seth  <v_seth@apple.com>
907
908         Create feature flag (HTTPS_UPGRADE)
909         https://bugs.webkit.org/show_bug.cgi?id=191613
910         <rdar://problem/45851068>
911
912         Reviewed by Dean Jackson.
913
914         * config.h:
915
916 2018-11-15  Chris Dumez  <cdumez@apple.com>
917
918         Regression(r238215) WKProcessPool.WarmInitialProcess API test is failing
919         https://bugs.webkit.org/show_bug.cgi?id=191693
920
921         Reviewed by Alex Christensen.
922
923         Allow *explicit* process prewarming to construct the default data store if necessary or we would
924         not be obeying the client's request. Only automatic process prewarming should avoid constructing
925         the default data store unnecessarily to avoid causing memory regressions.
926
927         * UIProcess/API/C/WKContext.cpp:
928         (WKContextWarmInitialProcess):
929         * UIProcess/API/Cocoa/WKProcessPool.mm:
930         (-[WKProcessPool _warmInitialProcess]):
931         * UIProcess/WebProcessPool.cpp:
932         (WebKit::WebProcessPool::prewarmProcess):
933         (WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
934         * UIProcess/WebProcessPool.h:
935         (WebKit::WebProcessPool::sendToOneProcess):
936
937 2018-11-14  Jiewen Tan  <jiewen_tan@apple.com>
938
939         Unreviewed, comment improvement over r238166.
940
941         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
942         (WKWebsiteDataStoreSetWebAuthenticationMockConfiguration):
943         * UIProcess/WebAuthentication/fido/CtapHidAuthenticator.h:
944
945 2018-11-15  Jiewen Tan  <jiewen_tan@apple.com>
946
947         [WebAuthN] Use a real nonce for CTAPHID_INIT
948         https://bugs.webkit.org/show_bug.cgi?id=191533
949         <rdar://problem/46103502>
950
951         Reviewed by Brent Fulgham.
952
953         Use a real nonce for CTAPHID_INIT request according to:
954         https://fidoalliance.org/specs/fido-v2.0-ps-20170927/fido-client-to-authenticator-protocol-v2.0-ps-20170927.html#ctaphid_init-0x06.
955         The challenge here is the new transaction needs to start in the next runloop otherwise a dead lock will form:
956         wrong nonce -> new transaction -> new nonce -> write init request -> read init response from last run as it
957         piped in the run loop -> wrong nonce of course -> ...
958         To break the above dead lock, we have to start the new transaction in the next run. However, that isn't
959         sufficient as the arrived init response will be piped in HidConnection::m_inputReports, which is designed
960         on purpose to store any data packets within (initialized, terminated) time interval to prevent data loss in
961         the case when HidConnection::registerDataReceivedCallback is called after the first data packet's arrival.
962         In order to break the dead lock completely, HidConnection::invalidateCache will bnnne called prior to every
963         send to delete any potential init response from last run. HidConnection::invalidateCache is not necessary
964         for other protocols though. The above scenario is more or less a design flaw in CTAP HID.
965
966         Of course, all above scenarios are covered in our mock tests.
967
968         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
969         (WKWebsiteDataStoreSetWebAuthenticationMockConfiguration):
970         * UIProcess/WebAuthentication/Cocoa/HidConnection.h:
971         (WebKit::HidConnection::invalidateCache):
972         * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
973         (WebKit::MockHidConnection::send):
974         (WebKit::MockHidConnection::parseRequest):
975         (WebKit::MockHidConnection::feedReports):
976         * UIProcess/WebAuthentication/Mock/MockHidConnection.h:
977         * UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h:
978         * UIProcess/WebAuthentication/fido/CtapHidDriver.cpp:
979         (WebKit::CtapHidDriver::Worker::transact):
980         (WebKit::CtapHidDriver::CtapHidDriver):
981         (WebKit::CtapHidDriver::transact):
982         (WebKit::CtapHidDriver::continueAfterChannelAllocated):
983         (WebKit::CtapHidDriver::returnResponse):
984         * UIProcess/WebAuthentication/fido/CtapHidDriver.h:
985
986 2018-11-15  Oriol Brufau  <obrufau@igalia.com>
987
988         [css-logical] Implement flow-relative margin, padding and border shorthands
989         https://bugs.webkit.org/show_bug.cgi?id=188697
990
991         Reviewed by Simon Fraser and Antti Koivisto.
992
993         Add a CSSLogicalEnabled runtime flag.
994
995         * Shared/WebPreferences.yaml:
996
997 2018-11-15  Jiewen Tan  <jiewen_tan@apple.com>
998
999         [WebAuthN] PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::AuthenticatorAttachment should be optional
1000         https://bugs.webkit.org/show_bug.cgi?id=191522
1001
1002         Reviewed by Brent Fulgham.
1003
1004         * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
1005         (WebKit::AuthenticatorManagerInternal::collectTransports):
1006
1007 2018-11-15  Michael Catanzaro  <mcatanzaro@igalia.com>
1008
1009         [SOUP] Make Accept-Languages header look more like other browsers
1010         https://bugs.webkit.org/show_bug.cgi?id=191614
1011
1012         Reviewed by Carlos Garcia Campos.
1013
1014         This changes our Accept-Language header to better match other browsers, from something
1015         like this:
1016
1017         Accept-Language: en-us, en;q=0.90, es-es;q=0.80, es;q=0.70
1018
1019         to something like this:
1020
1021         Accept-Language: en-US,en;q=0.90,es-ES;q=0.80,es;q=0.70
1022
1023         There's no particular motivation for this change. I just noticed we were different for no
1024         clear reason.
1025
1026         * NetworkProcess/soup/NetworkProcessSoup.cpp:
1027         (WebKit::buildAcceptLanguages):
1028         * UIProcess/API/glib/WebKitWebContext.cpp:
1029         (webkit_web_context_set_preferred_languages):
1030
1031 2018-11-15  Daniel Bates  <dabates@apple.com>
1032
1033         [iOS] Shift + Tab does not focus previous field
1034         https://bugs.webkit.org/show_bug.cgi?id=191596
1035         <rdar://problem/45892053>
1036
1037         Reviewed by Wenson Hsieh.
1038
1039         Wire up the the tab and shift + tab key commands to the WKWebView/WKContentView's
1040         action forwarding mechanism. Also rename -_prevAccessoryTab to -_previousAccessoryTab.
1041
1042         * Platform/spi/ios/UIKitSPI.h: Add more SPI.
1043         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1044         * UIProcess/ios/WKContentViewInteraction.h:
1045         * UIProcess/ios/WKContentViewInteraction.mm:
1046         (-[WKContentView canPerformActionForWebView:withSender:]):
1047         (-[WKContentView keyCommands]):
1048         (-[WKContentView _nextAccessoryTabForWebView:]): Added.
1049         (-[WKContentView _previousAccessoryTabForWebView:]): Added.
1050         (-[WKContentView _nextAccessoryTab:]): Deleted.
1051         (-[WKContentView _prevAccessoryTab:]): Deleted.
1052
1053 2018-11-15  Keith Rollin  <krollin@apple.com>
1054
1055         Delete old .xcfilelist files
1056         https://bugs.webkit.org/show_bug.cgi?id=191669
1057         <rdar://problem/46081994>
1058
1059         Reviewed by Chris Dumez.
1060
1061         .xcfilelist files were created and added to the Xcode project files in
1062         https://trac.webkit.org/changeset/238008/webkit. However, they caused
1063         build issues and they were removed from the Xcode projects in
1064         https://trac.webkit.org/changeset/238055/webkit. This check-in removes
1065         the files from the repository altogether. They'll ultimately be
1066         replaced with new files with names that indicate whether the
1067         associated files are inputs to the Run Script phase or are files
1068         created by the Run Script phase.
1069
1070         * DerivedSources.xcfilelist: Removed.
1071         * UnifiedSources.xcfilelist: Removed.
1072
1073 2018-11-15  Frederic Wang  <fwang@igalia.com>
1074
1075         [WebAuthN] Make AuthenticatorManager
1076         https://bugs.webkit.org/show_bug.cgi?id=189279
1077
1078         Unreviewed build fix.
1079
1080         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm: Add missing header.
1081         * UIProcess/WebAuthentication/Cocoa/LocalConnection.mm: Ditto.
1082         * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp: Ditto.
1083
1084 2018-11-14  Keith Rollin  <krollin@apple.com>
1085
1086         Move scripts for Derived and Unified Sources to external files
1087         https://bugs.webkit.org/show_bug.cgi?id=191670
1088         <rdar://problem/46082278>
1089
1090         Reviewed by Keith Miller.
1091
1092         Move the scripts in the Generate Derived Sources and Generate Unified
1093         Sources Run Script phases from the Xcode projects to external shell
1094         script files. Then invoke those scripts from the Run Script phases.
1095         This refactoring is being performed to support later work that will
1096         invoke these scripts in other contexts.
1097
1098         The scripts were maintained as-is when making the move. I did a little
1099         reformatting and added 'set -e' to the top of each file, but that's
1100         it.
1101
1102         * Scripts/generate-derived-sources.sh: Added.
1103         * Scripts/generate-unified-sources.sh: Added.
1104         * WebKit.xcodeproj/project.pbxproj:
1105
1106 2018-11-14  Chris Dumez  <cdumez@apple.com>
1107
1108         WebKit.DecidePolicyForNavigationActionForHyperlinkThatRedirects API fails when PSON is enabled
1109         https://bugs.webkit.org/show_bug.cgi?id=191640
1110
1111         Reviewed by Alex Christensen.
1112
1113         The issue was that when process-swapping on a redirect, the parameters provided by the new
1114         WebContent process for navigationActionData / originatingFrameInfoData / frameSecurityOrigin
1115         are not correct because it does not have sufficient information (it does not know a swap
1116         happened).
1117
1118         To address the issue, we now store the navigationActionData / originatingFrameInfoData /
1119         frameSecurityOrigin on the Navigation object whenever decidePolicyForNavigationAction is
1120         called. If the decidePolicyForNavigationAction is for a redirect, use the ones we stored
1121         on the Navigation object instead of the ones provided by the WebContent process. In case
1122         of redirect, those do not change anyway.
1123
1124         This fixes all WebKit.DecidePolicyForNavigationAction* tests with PSON enabled.
1125
1126         * UIProcess/API/APINavigation.h:
1127         (API::Navigation::currentRequestIsRedirect const):
1128         (API::Navigation::wasUserInitiated const):
1129         (API::Navigation::shouldForceDownload const):
1130         (API::Navigation::treatAsSameOriginNavigation const):
1131         (API::Navigation::hasOpenedFrames const):
1132         (API::Navigation::openedViaWindowOpenWithOpener const):
1133         (API::Navigation::opener const):
1134         (API::Navigation::requesterOrigin const):
1135         (API::Navigation::lockHistory const):
1136         (API::Navigation::lockBackForwardList const):
1137         (API::Navigation::clientRedirectSourceForHistory const):
1138         (API::Navigation::setLastNavigationAction):
1139         (API::Navigation::lastNavigationAction const):
1140         (API::Navigation::setOriginatingFrameInfo):
1141         (API::Navigation::originatingFrameInfo const):
1142         (API::Navigation::setDestinationFrameSecurityOrigin):
1143         (API::Navigation::destinationFrameSecurityOrigin const):
1144         * UIProcess/WebPageProxy.cpp:
1145         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
1146         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1147         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
1148         * UIProcess/WebPageProxy.h:
1149
1150 2018-11-14  Chris Dumez  <cdumez@apple.com>
1151
1152         WebKit.WebsiteDataStoreCustomPaths API test is failing when enabling process prewarming
1153         https://bugs.webkit.org/show_bug.cgi?id=191638
1154
1155         Reviewed by Alex Christensen.
1156
1157         WebProcessPool::prewarmProcess() should not create the default WebSite Data Store if it
1158         does not exist yet. This is bad for memory consumption and it is what was causing this
1159         API test to fail.
1160
1161         WebProcessPool::prewarmProcess() now tries to use the following data stores in this
1162         order of preference:
1163         1. WebProcessPool::m_websiteDataStore (aka this process pool's primary data store)
1164         2. The data store of the last WebProcessProxy that was created
1165         3. The default data store if it exists
1166
1167         If no suitable data store is found, we cancel the process prewarming and log a console
1168         message instead.
1169
1170         * UIProcess/WebProcessPool.cpp:
1171         (WebKit::WebProcessPool::prewarmProcess):
1172
1173 2018-11-14  Timothy Hatcher  <timothy@apple.com>
1174
1175         Enabled dark mode CSS support by default.
1176         https://bugs.webkit.org/show_bug.cgi?id=191609
1177         rdar://problem/46046861
1178
1179         Reviewed by Megan Gardner.
1180
1181         * Shared/WebPreferences.yaml: Set DarkModeCSSEnabled's defaultValue to true.
1182
1183 2018-11-14  Timothy Hatcher  <timothy@apple.com>
1184
1185         Default the view background color and text color to different values when in dark mode.
1186         https://bugs.webkit.org/show_bug.cgi?id=191607
1187         rdar://problem/46045854
1188
1189         Reviewed by Dean Jackson.
1190
1191         * UIProcess/Cocoa/WebViewImpl.mm:
1192         (WebKit::WebViewImpl::backgroundColor const): Use controlBackgroundColor.
1193         (WebKit::WebViewImpl::updateLayer): Simplified and use backgroundColor() getter.
1194         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1195         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): Drop backgroundColor.
1196         * WebProcess/WebPage/WebPage.cpp:
1197         (WebKit::WebPage::setDrawsBackground): Drop backgroundColor.
1198
1199 2018-11-14  Joseph Pecoraro  <pecoraro@apple.com>
1200
1201         Web Inspector: Pass Inspector::FrontendChannel as a reference connect/disconnect methods
1202         https://bugs.webkit.org/show_bug.cgi?id=191612
1203
1204         Reviewed by Matt Baker.
1205
1206         * UIProcess/Automation/WebAutomationSession.cpp:
1207         (WebKit::WebAutomationSession::connect):
1208         (WebKit::WebAutomationSession::disconnect):
1209         (WebKit::WebAutomationSession::terminate):
1210         * UIProcess/Automation/WebAutomationSession.h:
1211         * UIProcess/WebPageDebuggable.cpp:
1212         (WebKit::WebPageDebuggable::connect):
1213         (WebKit::WebPageDebuggable::disconnect):
1214         * UIProcess/WebPageDebuggable.h:
1215         * UIProcess/WebPageInspectorController.cpp:
1216         (WebKit::WebPageInspectorController::connectFrontend):
1217         (WebKit::WebPageInspectorController::disconnectFrontend):
1218         * UIProcess/WebPageInspectorController.h:
1219         * WebProcess/WebPage/WebInspector.cpp:
1220         (WebKit::WebInspector::close):
1221         * WebProcess/WebPage/WebPageInspectorTarget.cpp:
1222         (WebKit::WebPageInspectorTarget::connect):
1223         (WebKit::WebPageInspectorTarget::disconnect):
1224
1225 2018-11-14  Joseph Pecoraro  <pecoraro@apple.com>
1226
1227         Unreviewed attempted wincairo build fix after 238192.
1228
1229         * WebProcess/WebPage/WebPageInspectorTargetController.h:
1230         * WebProcess/WebPage/WebPageInspectorTargetFrontendChannel.cpp:
1231
1232 2018-11-14  Joseph Pecoraro  <pecoraro@apple.com>
1233
1234         Web Inspector: Follow-up: Keep Disabling Process Swap for Local Web Inspector
1235         https://bugs.webkit.org/show_bug.cgi?id=191494
1236         <rdar://problem/45469854>
1237
1238         Reviewed by Devin Rousso.
1239
1240         Continue to have the Local Inspector disable PSON while open
1241         until support is added.
1242
1243         * UIProcess/WebPageProxy.cpp:
1244         (WebKit::WebPageProxy::resetState):
1245         * UIProcess/WebPageProxy.h:
1246         (WebKit::WebPageProxy::hasLocalInspectorFrontend const):
1247         (WebKit::WebPageProxy::setHasLocalInspectorFrontend):
1248         * UIProcess/WebPageProxy.messages.in:
1249         * UIProcess/WebProcessPool.cpp:
1250         (WebKit::WebProcessPool::processForNavigationInternal):
1251         * WebProcess/WebPage/WebInspector.cpp:
1252         (WebKit::WebInspector::openFrontendConnection):
1253         (WebKit::WebInspector::closeFrontendConnection):
1254         * WebProcess/WebPage/WebPage.cpp:
1255         (WebKit::WebPage::setHasLocalInspectorFrontend):
1256         * WebProcess/WebPage/WebPage.h:
1257
1258 2018-11-14  Joseph Pecoraro  <pecoraro@apple.com>
1259
1260         Web Inspector: Keep Web Inspector window alive across process swaps (PSON) (Remote Inspector)
1261         https://bugs.webkit.org/show_bug.cgi?id=191494
1262         <rdar://problem/45469854>
1263
1264         Reviewed by Devin Rousso.
1265
1266         To support process swapping a slim Web Inspector backend lives in the UIProcess.
1267         The Web Inspector frontend connects to it and is told about sub-targets, namely
1268         pages, that it can further connect to. When performing a process swap the backend
1269         tells the frontend to destroy existing targets and create new targets.
1270
1271         In the UIProcess the WebPageProxy has a WebPageInspectorController, with a single
1272         TargetAgent holding InspectorTargetProxies to targets it knows about. Inspector
1273         protocol messages go through this inspector controller and are routed to the
1274         WebPage and its WebCore::Page's InspectorController. The WebPageProxy decides
1275         when to close and expose new page targets during process swap, or basically
1276         any time it reconnects to a WebProcess. So this patch also makes Web Inspector
1277         stay alive and reconnect to a page when the inspected page crashes!
1278
1279         In the WebContentProcess the WebPage has a WebPageInspectorTarget. It also
1280         has a WebPageInspectorTargetController in anticipation of further sub-targets
1281         within the page (workers, frames) but none exist at the moment. The WebPage
1282         relies on the WebPageProxy to know when to expose this target as a debuggable.
1283
1284         * Sources.txt:
1285         * WebKit.xcodeproj/project.pbxproj:
1286         New files.
1287
1288         * Shared/WebPageCreationParameters.cpp:
1289         (WebKit::WebPageCreationParameters::encode const):
1290         (WebKit::WebPageCreationParameters::decode):
1291         * Shared/WebPageCreationParameters.h:
1292         Remote inspector state can now stay in the UIProcess and does not need to
1293         be passed down to the WebContentProcess.
1294
1295         * UIProcess/WebPageDebuggable.cpp: Copied from Source/WebCore/page/PageDebuggable.cpp.
1296         (WebKit::WebPageDebuggable::WebPageDebuggable):
1297         (WebKit::WebPageDebuggable::name const):
1298         (WebKit::WebPageDebuggable::url const):
1299         (WebKit::WebPageDebuggable::hasLocalDebugger const):
1300         (WebKit::WebPageDebuggable::connect):
1301         (WebKit::WebPageDebuggable::disconnect):
1302         (WebKit::WebPageDebuggable::dispatchMessageFromRemote):
1303         (WebKit::WebPageDebuggable::setIndicating):
1304         (WebKit::WebPageDebuggable::setNameOverride):
1305         * UIProcess/WebPageDebuggable.h: Copied from Source/WebCore/page/PageDebuggable.h.
1306         Remote debuggable entry point into the UIProcess for a page.
1307         This is pretty much identical to the PageDebuggable in WebCore.
1308
1309         * Scripts/webkit/messages.py:
1310         * UIProcess/WebPageProxy.messages.in:
1311         * UIProcess/WebPageProxy.cpp:
1312         (WebKit::m_resetRecentCrashCountTimer):
1313         (WebKit::WebPageProxy::finishAttachingToWebProcess):
1314         (WebKit::WebPageProxy::close):
1315         (WebKit::WebPageProxy::createInspectorTarget):
1316         (WebKit::WebPageProxy::destroyInspectorTarget):
1317         (WebKit::WebPageProxy::sendMessageToInspectorFrontend):
1318         (WebKit::WebPageProxy::setIndicating):
1319         (WebKit::WebPageProxy::allowsRemoteInspection const):
1320         (WebKit::WebPageProxy::setAllowsRemoteInspection):
1321         (WebKit::WebPageProxy::remoteInspectionNameOverride const):
1322         (WebKit::WebPageProxy::setRemoteInspectionNameOverride):
1323         (WebKit::WebPageProxy::remoteInspectorInformationDidChange):
1324         (WebKit::WebPageProxy::clearInspectorTargets):
1325         (WebKit::WebPageProxy::createInspectorTargets):
1326         (WebKit::WebPageProxy::didCommitLoadForFrame):
1327         (WebKit::WebPageProxy::didReceiveTitleForFrame):
1328         (WebKit::WebPageProxy::creationParameters):
1329         * UIProcess/WebPageProxy.h:
1330         (WebKit::WebPageProxy::inspectorController):
1331         (WebKit::WebPageProxy::allowsRemoteInspection const): Deleted.
1332         (WebKit::WebPageProxy::remoteInspectionNameOverride const): Deleted.
1333         Own more inspector state in the UIProcess including a debuggable and inspector controller.
1334
1335         * UIProcess/WebPageInspectorController.h: Added.
1336         * UIProcess/WebPageInspectorController.cpp: Added.
1337         (WebKit::WebPageInspectorController::WebPageInspectorController):
1338         (WebKit::WebPageInspectorController::pageClosed):
1339         (WebKit::WebPageInspectorController::hasLocalFrontend const):
1340         (WebKit::WebPageInspectorController::hasRemoteFrontend const):
1341         (WebKit::WebPageInspectorController::connectFrontend):
1342         (WebKit::WebPageInspectorController::disconnectFrontend):
1343         (WebKit::WebPageInspectorController::disconnectAllFrontends):
1344         (WebKit::WebPageInspectorController::dispatchMessageFromFrontend):
1345         (WebKit::WebPageInspectorController::setIndicating):
1346         (WebKit::WebPageInspectorController::clearTargets):
1347         (WebKit::WebPageInspectorController::createInspectorTarget):
1348         (WebKit::WebPageInspectorController::destroyInspectorTarget):
1349         (WebKit::WebPageInspectorController::sendMessageToInspectorFrontend):
1350         InspectorController with a single TargetAgent in the UIProcess.
1351
1352         * UIProcess/WebPageInspectorTargetAgent.h:
1353         * UIProcess/WebPageInspectorTargetAgent.cpp:
1354         (WebKit::WebPageInspectorTargetAgent::WebPageInspectorTargetAgent):
1355         (WebKit::WebPageInspectorTargetAgent::frontendChannel):
1356         Target agent implementation.
1357
1358         * UIProcess/InspectorTargetProxy.cpp:
1359         (WebKit::InspectorTargetProxy::create):
1360         (WebKit::InspectorTargetProxy::InspectorTargetProxy):
1361         (WebKit::InspectorTargetProxy::connect):
1362         (WebKit::InspectorTargetProxy::disconnect):
1363         (WebKit::InspectorTargetProxy::sendMessageToTargetBackend):
1364         * UIProcess/InspectorTargetProxy.h:
1365         UIProcess proxy for an InspectorTarget in the WebContentProcess.
1366
1367         * UIProcess/WebProcessPool.cpp:
1368         (WebKit::WebProcessPool::processForNavigationInternal):
1369
1370         * WebProcess/WebPage/WebPage.cpp:
1371         (WebKit::m_shouldAttachDrawingAreaOnPageTransition):
1372         (WebKit::WebPage::connectInspector):
1373         (WebKit::WebPage::disconnectInspector):
1374         (WebKit::WebPage::sendMessageToTargetBackend):
1375         (WebKit::WebPage::setIndicating):
1376         (WebKit::WebPage::setAllowsRemoteInspection): Deleted.
1377         (WebKit::WebPage::setRemoteInspectionNameOverride): Deleted.
1378         * WebProcess/WebPage/WebPage.h:
1379         * WebProcess/WebPage/WebPage.messages.in:
1380
1381         * WebProcess/WebPage/WebPageInspectorTarget.h:
1382         * WebProcess/WebPage/WebPageInspectorTarget.cpp:
1383         (WebKit::WebPageInspectorTarget::WebPageInspectorTarget):
1384         (WebKit::WebPageInspectorTarget::identifier const):
1385         (WebKit::WebPageInspectorTarget::connect):
1386         (WebKit::WebPageInspectorTarget::disconnect):
1387         (WebKit::WebPageInspectorTarget::sendMessageToTargetBackend):
1388         InspectorTarget for this WebPage.
1389
1390         * WebProcess/WebPage/WebPageInspectorTargetController.cpp: Added.
1391         (WebKit::WebPageInspectorTargetController::WebPageInspectorTargetController):
1392         (WebKit::WebPageInspectorTargetController::~WebPageInspectorTargetController):
1393         (WebKit::WebPageInspectorTargetController::addTarget):
1394         (WebKit::WebPageInspectorTargetController::removeTarget):
1395         (WebKit::WebPageInspectorTargetController::connectInspector):
1396         (WebKit::WebPageInspectorTargetController::disconnectInspector):
1397         (WebKit::WebPageInspectorTargetController::sendMessageToTargetBackend):
1398         (WebKit::WebPageInspectorTargetController::sendMessageToTargetFrontend):
1399         * WebProcess/WebPage/WebPageInspectorTargetController.h:
1400         * WebProcess/WebPage/WebPageInspectorTargetFrontendChannel.h:
1401         * WebProcess/WebPage/WebPageInspectorTargetFrontendChannel.cpp:
1402         (WebKit::WebPageInspectorTargetFrontendChannel::create):
1403         (WebKit::WebPageInspectorTargetFrontendChannel::WebPageInspectorTargetFrontendChannel):
1404         (WebKit::WebPageInspectorTargetFrontendChannel::sendMessageToFrontend):
1405         Preparation for more target managment in the WebContentProcess.
1406
1407 2018-11-14  Alex Christensen  <achristensen@webkit.org>
1408
1409         Add SPI to show a safe browsing warning
1410         https://bugs.webkit.org/show_bug.cgi?id=191604
1411
1412         Reviewed by Andy Estes.
1413
1414         Safari has a case where it shows safe browsing warnings for a reason other than being told to by the SafeBrowsing framework.
1415         Because safe browsing is moving to WebKit, we will have Safari call this WebKit SPI in that case.
1416         The warning looks a little different, so I had to change the structure of a SafeBrowsingResult and the location of the string processing,
1417         but the existing behavior is the same as verified by existing unit tests.  I added a unit test to verify behavior of the new SPI.
1418
1419         * SourcesCocoa.txt:
1420         * UIProcess/API/Cocoa/WKWebView.mm:
1421         (-[WKWebView _showSafeBrowsingWarningWithTitle:warning:details:completionHandler:]):
1422         (-[WKWebView _showSafeBrowsingWarning:completionHandler:]):
1423         (+[WKWebView _confirmMalwareSentinel]):
1424         (+[WKWebView _visitUnsafeWebsiteSentinel]):
1425         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1426         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1427         * UIProcess/Cocoa/SafeBrowsingResultCocoa.mm: Removed.
1428         * UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm: Copied from Source/WebKit/UIProcess/Cocoa/SafeBrowsingResultCocoa.mm.
1429         (WebKit::malwareDetailsBase):
1430         (WebKit::learnMoreURL):
1431         (WebKit::reportAnErrorBase):
1432         (WebKit::localizedProvider):
1433         (WebKit::SafeBrowsingWarning::visitUnsafeWebsiteSentinel):
1434         (WebKit::SafeBrowsingWarning::confirmMalwareSentinel):
1435         (WebKit::replace):
1436         (WebKit::addLinkAndReplace):
1437         (WebKit::reportAnErrorURL):
1438         (WebKit::malwareDetailsURL):
1439         (WebKit::safeBrowsingTitleText):
1440         (WebKit::safeBrowsingWarningText):
1441         (WebKit::safeBrowsingDetailsText):
1442         (WebKit::SafeBrowsingWarning::SafeBrowsingWarning):
1443         (WebKit::learnMore): Deleted.
1444         (WebKit::SafeBrowsingResult::SafeBrowsingResult): Deleted.
1445         * UIProcess/Cocoa/WKSafeBrowsingWarning.h:
1446         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
1447         (-[WKSafeBrowsingWarning initWithFrame:safeBrowsingWarning:completionHandler:]):
1448         (-[WKSafeBrowsingWarning addContent]):
1449         (-[WKSafeBrowsingWarning showDetailsClicked]):
1450         (-[WKSafeBrowsingWarning clickedOnLink:]):
1451         (-[WKSafeBrowsingTextView initWithAttributedString:forWarning:]):
1452         (confirmMalwareSentinel): Deleted.
1453         (visitUnsafeWebsiteSentinel): Deleted.
1454         (replace): Deleted.
1455         (addLinkAndReplace): Deleted.
1456         (reportAnErrorURL): Deleted.
1457         (malwareDetailsURL): Deleted.
1458         (titleText): Deleted.
1459         (warningText): Deleted.
1460         (detailsText): Deleted.
1461         (-[WKSafeBrowsingWarning initWithFrame:safeBrowsingResult:completionHandler:]): Deleted.
1462         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
1463         (WebKit::WebPageProxy::beginSafeBrowsingCheck):
1464         * UIProcess/Cocoa/WebViewImpl.h:
1465         * UIProcess/Cocoa/WebViewImpl.mm:
1466         (WebKit::WebViewImpl::showSafeBrowsingWarning):
1467         * UIProcess/PageClient.h:
1468         (WebKit::PageClient::showSafeBrowsingWarning):
1469         * UIProcess/SafeBrowsingResult.h: Removed.
1470         * UIProcess/SafeBrowsingWarning.h: Copied from Source/WebKit/UIProcess/SafeBrowsingResult.h.
1471         (WebKit::SafeBrowsingWarning::create):
1472         (WebKit::SafeBrowsingWarning::title const):
1473         (WebKit::SafeBrowsingWarning::warning const):
1474         (WebKit::SafeBrowsingWarning::details const):
1475         (WebKit::SafeBrowsingResult::create): Deleted.
1476         (WebKit::SafeBrowsingResult::isPhishing const): Deleted.
1477         (WebKit::SafeBrowsingResult::isMalware const): Deleted.
1478         (WebKit::SafeBrowsingResult::isUnwantedSoftware const): Deleted.
1479         (WebKit::SafeBrowsingResult::url const): Deleted.
1480         (WebKit::SafeBrowsingResult::provider const): Deleted.
1481         (WebKit::SafeBrowsingResult::localizedProviderName const): Deleted.
1482         (WebKit::SafeBrowsingResult::malwareDetailsURLBase const): Deleted.
1483         (WebKit::SafeBrowsingResult::reportAnErrorURLBase const): Deleted.
1484         (WebKit::SafeBrowsingResult::learnMoreURL const): Deleted.
1485         (WebKit::SafeBrowsingResult::needsSafeBrowsingWarning const): Deleted.
1486         (): Deleted.
1487         * UIProcess/WebFramePolicyListenerProxy.cpp:
1488         (WebKit::WebFramePolicyListenerProxy::didReceiveSafeBrowsingResults):
1489         (WebKit::WebFramePolicyListenerProxy::use):
1490         * UIProcess/WebFramePolicyListenerProxy.h:
1491         * UIProcess/WebFrameProxy.cpp:
1492         (WebKit::WebFrameProxy::WebFrameProxy):
1493         (WebKit::WebFrameProxy::setUpPolicyListenerProxy):
1494         (WebKit::WebFrameProxy::didHandleContentFilterUnblockNavigation):
1495         * UIProcess/WebFrameProxy.h:
1496         (WebKit::WebFrameProxy::create):
1497         (WebKit::WebFrameProxy::page const):
1498         * UIProcess/WebPageProxy.cpp:
1499         (WebKit::WebPageProxy::swapToWebProcess):
1500         (WebKit::WebPageProxy::didCreateMainFrame):
1501         (WebKit::WebPageProxy::didCreateSubframe):
1502         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1503         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
1504         (WebKit::WebPageProxy::decidePolicyForResponse):
1505         * UIProcess/ios/PageClientImplIOS.h:
1506         * UIProcess/ios/PageClientImplIOS.mm:
1507         (WebKit::PageClientImpl::showSafeBrowsingWarning):
1508         * UIProcess/mac/PageClientImplMac.h:
1509         * UIProcess/mac/PageClientImplMac.mm:
1510         (WebKit::PageClientImpl::showSafeBrowsingWarning):
1511         * UIProcess/mac/WebDataListSuggestionsDropdownMac.mm:
1512         * WebKit.xcodeproj/project.pbxproj:
1513
1514 2018-11-14  Wenson Hsieh  <wenson_hsieh@apple.com>
1515
1516         [iOS] A few drag and drop tests are crashing after r238146
1517         https://bugs.webkit.org/show_bug.cgi?id=191617
1518
1519         Reviewed by Dean Jackson.
1520
1521         The notion of temporarily suppressing the selection assistant was introduced during iOS drag and drop
1522         development as a way of allowing both the selection view and dropped content snapshot to fade in simultaneously
1523         during a drop in an editable element. r238146 piggy-backs on this mechanism by changing selection suppression
1524         state when an element is focused, when the selection changes, and when an element is blurred, depending on
1525         whether the currently focused element is transparent.
1526
1527         However, in the case where the selection assistant is suppressed due to a running drop animation, if focus moves
1528         to an element that is not fully transparent, we end up prematurely unsuppressing the text selection assistant.
1529         This subsequently causes selection UI to immediately show up after a drop instead of animating in alongside a
1530         snapshot of the inserted document fragment, if the drop moved focus to an editable element.
1531
1532         A number of drag and drop tests on iOS exercised this codepath by dragging content into editable fields and/or
1533         moving content between editable elements in a web view. These tests began to crash due to selection views and
1534         the accompanying callout bar appearing earlier than usual, which triggers an unrelated UIKit assertion in
1535         <https://webkit.org/b/190401>.
1536
1537         This patch fixes the failing tests by refactoring our selection assistant suppression code. Instead of
1538         maintaining a single `BOOL` flag indicating whether the selection is suppressed, we use an `OptionSet` of
1539         `SuppressSelectionAssistantReason`s, which (at the moment) only include (1) a running drop animation, and (2)
1540         focusing a transparent element. The text selection assistant is considered suppressed when either of the reasons
1541         apply. This allows us to correctly handle a drop animation that occurs simultaneously as an element is focused
1542         without unsuppressing the selection assistant early, and also allows us to handle selection assistant
1543         suppression in more nuanced ways, depending on the suppression reason.
1544
1545         * UIProcess/ios/WKContentViewInteraction.h:
1546         * UIProcess/ios/WKContentViewInteraction.mm:
1547         (-[WKContentView cleanupInteraction]):
1548         (-[WKContentView _displayFormNodeInputView]):
1549
1550         Only prevent zooming to the focused element during drop if we're suppressing the selection assistant due to
1551         focusing a transparent element. In the case of a drop, we still want to allow scrolling and zooming.
1552
1553         (-[WKContentView canShowNonEmptySelectionView]):
1554         (-[WKContentView hasSelectablePositionAtPoint:]):
1555         (-[WKContentView pointIsNearMarkedText:]):
1556         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
1557         (-[WKContentView _startAssistingKeyboard]):
1558         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
1559         (-[WKContentView _stopAssistingNode]):
1560         (-[WKContentView _updateChangedSelection:]):
1561         (-[WKContentView _shouldSuppressSelectionCommands]):
1562         (-[WKContentView _beginSuppressingSelectionAssistantForReason:]):
1563         (-[WKContentView _stopSuppressingSelectionAssistantForReason:]):
1564
1565         Add helper methods for adding or removing selection assistant suppression reasons. When the last selection
1566         assistant suppression reason is removed, we activate the selection assistant, and conversely, when the first
1567         suppression reason is added, we deactivate the selection assistant.
1568
1569         (-[WKContentView _didConcludeEditDataInteraction:]):
1570         (-[WKContentView _didPerformDragOperation:]):
1571         (-[WKContentView dropInteraction:performDrop:]):
1572         (-[WKContentView suppressAssistantSelectionView]): Deleted.
1573         (-[WKContentView setSuppressAssistantSelectionView:]): Deleted.
1574
1575 2018-11-14  Wenson Hsieh  <wenson_hsieh@apple.com>
1576
1577         [Cocoa] [WebKit2] Hook up some more editing actions (-_pasteAndMatchStyle:, -makeTextWritingDirectionNatural:)
1578         https://bugs.webkit.org/show_bug.cgi?id=191605
1579         <rdar://problem/45813991>
1580
1581         Reviewed by Dean Jackson.
1582
1583         Hook up a couple of editing actions on iOS and macOS. The `-pasteAndMatchStyle:` selector is privately declared
1584         in UIKit, but does not exist on macOS; as such, add `-_pasteAndMatchStyle:` as SPI on WKWebView, and
1585         additionally implement the unprefixed version, `-pasteAndMatchStyle:`, on iOS.
1586
1587         Since `-makeTextWritingDirectionNatural:` is already declared on both iOS and macOS (SPI on UIResponder and API
1588         on macOS, respectively) we simply implement the unprefixed variant on both platforms.
1589
1590         * Platform/spi/ios/UIKitSPI.h:
1591         * UIProcess/API/Cocoa/WKWebView.mm:
1592         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1593         * UIProcess/ios/WKContentViewInteraction.h:
1594         * UIProcess/ios/WKContentViewInteraction.mm:
1595         (-[WKContentView makeTextWritingDirectionNaturalForWebView:]):
1596         (-[WKContentView canPerformActionForWebView:withSender:]):
1597
1598 2018-11-14  Per Arne Vollan  <pvollan@apple.com>
1599
1600         REGRESSION (WEBPROCESS_WINDOWSERVER_BLOCKING): requestAnimationFrame Stops Completing
1601         https://bugs.webkit.org/show_bug.cgi?id=190884
1602
1603         Reviewed by Dean Jackson.
1604
1605         Since the Web page currently owns the display link on the UI process side, the display link will be
1606         deleted in the UI process when a Web page is closed. This is incorrect, since a display link can be
1607         reused between Web pages in the WebContent process. This patch moves the ownership of the UI process
1608         display links to the Web process object to address this issue. Also, the display ID of the display
1609         being updated is included in the message to the WebContent process.
1610
1611         * UIProcess/WebPageProxy.cpp:
1612         (WebKit::WebPageProxy::close):
1613         (WebKit::WebPageProxy::resetStateAfterProcessExited):
1614         * UIProcess/WebPageProxy.h:
1615         * UIProcess/WebPageProxy.messages.in:
1616         * UIProcess/WebProcessProxy.h:
1617         * UIProcess/WebProcessProxy.messages.in:
1618         * UIProcess/mac/DisplayLink.cpp:
1619         (WebKit::DisplayLink::DisplayLink):
1620         (WebKit::DisplayLink::displayLinkCallback):
1621         * UIProcess/mac/DisplayLink.h:
1622         (WebKit::DisplayLink::displayID const):
1623         * UIProcess/mac/WebPageProxyMac.mm:
1624         (WebKit::WebPageProxy::startDisplayLink): Deleted.
1625         (WebKit::WebPageProxy::stopDisplayLink): Deleted.
1626         * UIProcess/mac/WebProcessProxyMac.mm:
1627         (WebKit::WebProcessProxy::startDisplayLink):
1628         (WebKit::WebProcessProxy::stopDisplayLink):
1629         * WebProcess/WebPage/DrawingArea.h:
1630         * WebProcess/WebPage/DrawingArea.messages.in:
1631         * WebProcess/WebPage/mac/DrawingAreaMac.cpp:
1632         (WebKit::DisplayRefreshMonitorMac::create):
1633         (WebKit::DisplayRefreshMonitorMac::DisplayRefreshMonitorMac):
1634         (WebKit::DisplayRefreshMonitorMac::~DisplayRefreshMonitorMac):
1635         (WebKit::DisplayRefreshMonitorMac::requestRefreshCallback):
1636         (WebKit::DrawingArea::createDisplayRefreshMonitor):
1637         (WebKit::DrawingArea::displayWasRefreshed): Deleted.
1638         * WebProcess/WebProcess.h:
1639         * WebProcess/WebProcess.messages.in:
1640         * WebProcess/cocoa/WebProcessCocoa.mm:
1641         (WebKit::WebProcess::displayWasRefreshed):
1642
1643 2018-11-14  Chris Dumez  <cdumez@apple.com>
1644
1645         Client should be able to disable PSON even if the experimental feature is on by default
1646         https://bugs.webkit.org/show_bug.cgi?id=191634
1647
1648         Reviewed by Dean Jackson.
1649
1650         Instead of overriding the APIProcessPoolConfiguration's m_processSwapsOnNavigation flag to true
1651         when the experimental is enabled, use a separate flag to store this information. If the client
1652         explicitly sets the APIProcessPoolConfiguration's m_processSwapsOnNavigation flag then we obey
1653         the client's request, otherwise, we fall back to using the state from experimental features.
1654
1655         This allows:
1656         - API tests to explicitely disable PSON / Process prewarming even if those are on by default
1657           in experimental features.
1658         - If the client does not set those flags on the APIProcessPoolConfiguration (Safari for e.g.),
1659           then the experimental feature flag still fully controls the feature.
1660
1661         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1662         (API::ProcessPoolConfiguration::copy):
1663         * UIProcess/API/APIProcessPoolConfiguration.h:
1664         * UIProcess/WebProcessPool.cpp:
1665         (WebKit::WebProcessPool::createWebPage):
1666
1667 2018-11-14  Chris Dumez  <cdumez@apple.com>
1668
1669         WebKit.ApplicationManifestBasic API test is failing when enabling PSON
1670         https://bugs.webkit.org/show_bug.cgi?id=191602
1671
1672         Reviewed by Alex Christensen.
1673
1674         Add support for process swapping for a [WKWebView loadHTML:] load by storing
1675         the necessary data on the API::Navigation and doing a loadData() instead of
1676         a loadRequest() after process swapping when this data is present on the
1677         navigation.
1678
1679         * UIProcess/API/APINavigation.cpp:
1680         (API::Navigation::Navigation):
1681         * UIProcess/API/APINavigation.h:
1682         (API::Navigation::create):
1683         (API::Navigation::substituteData const):
1684         * UIProcess/WebNavigationState.cpp:
1685         (WebKit::WebNavigationState::createLoadDataNavigation):
1686         * UIProcess/WebNavigationState.h:
1687         * UIProcess/WebPageProxy.cpp:
1688         (WebKit::WebPageProxy::loadData):
1689         (WebKit::WebPageProxy::continueNavigationInNewProcess):
1690
1691 2018-11-14  Antti Koivisto  <antti@apple.com>
1692
1693         Align Mac WK2 layer flush throttling with iOS
1694         https://bugs.webkit.org/show_bug.cgi?id=191632
1695
1696         Reviewed by Zalan Bujtas.
1697
1698         Currently Mac WK2 uses WebCore side throttling implementation in RenderLayerCompositor. This code has
1699         throttling timer per-frame while the actual decision making and layer flushes itself are per page. These
1700         timers generate way more flushes than expected in presence of multiple frames. There are also bugs in how
1701         flushing state is updated when frames are created dynamically.
1702
1703         On iOS WK2 throttling is implemented on WebKit side and controlled by a per-page timer. Recent fixes also
1704         make this implementation visually fast. We should align the Mac implementation and eventually unify them.
1705
1706         This patch implements throttling in TiledCoreAnimationDrawingArea mirroring the iOS RemoteLayerTreeDrawingArea
1707         implementation. There are some adjustments for platform differences (local vs remote layers) and we continue
1708         using runloop observer for the actual flushes. Timings are as in the existing Mac code.
1709
1710         The patch appears to be a significant performance progression.
1711
1712         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
1713         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1714         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
1715         (WebKit::TiledCoreAnimationDrawingArea::setLayerTreeStateIsFrozen):
1716
1717         Schedule an immediate flush when layers are unfrozen.
1718
1719         (WebKit::TiledCoreAnimationDrawingArea::scheduleCompositingLayerFlush):
1720         (WebKit::TiledCoreAnimationDrawingArea::scheduleCompositingLayerFlushImmediately):
1721
1722         Track pending flushes with m_hasPendingFlush bit.
1723         Delay flush if the flush throttling timer is active. Start it if we throttling but it is not active yet.
1724
1725         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
1726
1727         Clear m_hasPendingFlush if the flush succeeded.
1728         Restart the throttling timer if we are still throttling.
1729         Manage runloop observer invalidation here instead of the caller (and stop returning value).
1730
1731         (WebKit::TiledCoreAnimationDrawingArea::layerFlushRunLoopCallback):
1732         (WebKit::TiledCoreAnimationDrawingArea::adjustLayerFlushThrottling):
1733
1734         Returning 'true' here disables WebCore side throttling code.
1735
1736         Start or stop the throttling timer on state changes.
1737
1738         (WebKit::TiledCoreAnimationDrawingArea::layerFlushThrottlingIsActive const):
1739
1740         This is used to control style and layout timers on WebCore side. Return false on frozen
1741         state since unfreezing depends on style and layout.
1742
1743         (WebKit::TiledCoreAnimationDrawingArea::startLayerFlushThrottlingTimer):
1744         (WebKit::TiledCoreAnimationDrawingArea::layerFlushThrottlingTimerFired):
1745
1746 2018-11-14  Chris Dumez  <cdumez@apple.com>
1747
1748         WebKit.WKHTTPCookieStoreWithoutProcessPool API test is failing with process prewarming is enabled
1749         https://bugs.webkit.org/show_bug.cgi?id=191624
1750
1751         Reviewed by Alex Christensen.
1752
1753         Stop setting the WebProcessPool's primary data store (m_websiteDataStore) to the default one in
1754         WebProcessPool::prewarmProcess(). We did not really need to, we can pass the default data store
1755         to the new WebPageProxy without having to set m_websiteDataStore. m_websiteDataStore only gets
1756         set upon constructor if thr default data store already exists or later on when creating a WebPage
1757         that uses the default data store.
1758
1759         In the case of the API test, the following was happening:
1760         1. Create an ephemeral data store EDS
1761         2. Create a WebView V1 using datastore EDS
1762         3. Do a load in V1
1763         4. Process prewarming would kick in and wrongly associated V1's process pool PP1 with the default data store
1764         5. Create/Get the default datastore and set a few cookies on it
1765         6. Create a WebView V2 using default datastore and a fresh new process pool PP2
1766         7. Do a load in V2 and expect the cookies to be there
1767
1768         In HTTPCookieStore::setCookie() that is called at step 5, we call:
1769         m_owningDataStore->processPoolForCookieStorageOperations()
1770
1771         In this case, m_owningDataStore is the default datastore and this call would previously return null because
1772         there is no WebProcessPool yet associated with the default datastore. However, with the process prewarming
1773         bug at step 4, the process pool PP1 would be returned since it was wrongly associated with the default
1774         data store. As a result, we would call setCookie() on PP1's WebCookieManagerProxy and this would fail
1775         because PP1's network process knows nothing about this session ID (it was only ever used with an ephemeral
1776         session).
1777
1778         * UIProcess/WebProcessPool.cpp:
1779         (WebKit::WebProcessPool::prewarmProcess):
1780
1781 2018-11-13  Jiewen Tan  <jiewen_tan@apple.com>
1782
1783         [WebAuthN] Support CTAP HID authenticators on macOS
1784         https://bugs.webkit.org/show_bug.cgi?id=188623
1785         <rdar://problem/43353777>
1786
1787         Reviewed by Brent Fulgham and Chris Dumez.
1788
1789         This patch introduces a primitive support of CTAP HID authenticators for WebAuthN in macOS.
1790         It involves low level HID device management&communication, high level CTAP HID authenticator
1791         management&communication, and mock testing. The above three aspects will be covered in details:
1792         1) Low level HID device management&communication: HidService&HidConnection
1793         It relies on IOHIDManager to discover appropriate hid devices by passing a matching dictionary:
1794         { PrimaryUsagePage: 0xf1d0, PrimaryUsage: 0x01}. For communication, it utilizes HID reports.
1795         To send a report, it calls IOHIDDeviceSetReport since the async version is not implemented.
1796         To recieve a report, it calls IOHIDDeviceRegisterInputReportCallback to asynchronously wait
1797         for incoming reports.
1798         Here is the corresponding reference:
1799         https://developer.apple.com/library/archive/documentation/DeviceDrivers/Conceptual/HID/new_api_10_5/tn2187.html#//apple_ref/doc/uid/TP40000970-CH214-SW2
1800         2) High level CTAP HID authenticator management&communication: HidService&CtapHidDriver
1801         Whenever an appropriate hid device is discovered by IOHIDManager, an AuthenticatorGetInfo command
1802         is sent to the device to determine properties of the authenticator, says, which version of protocol
1803         it supports, i.e. CTAP or U2F. So far, we only support CTAP authenticators. Once the authenticator
1804         is determined to support CTAP, we then instantiate CtapHidAuthenticator which will then take care
1805         of even higher level WebAuthN requests&responses.
1806         Binaries are constructed and packaged according to the CTAP HID porotocol. CtapHidDriver takes care
1807         of concurrency and channels, i.e. allocating channel and establishing the actual request/response
1808         transaction. At the meantime, CtapHidDriver::Worker is then responsible for each single transaction.
1809         Here is the corresponding reference:
1810         https://fidoalliance.org/specs/fido-v2.0-ps-20170927/fido-client-to-authenticator-protocol-v2.0-ps-20170927.html#usb.
1811         3) Mock Testing: MockHidService & MockHidConnection
1812         A CTAP hid authenticator is simulated within MockHidConnection with options of specifying specific
1813         error scenarios and of course could take care of successful cases. Four stages are presented in the
1814         simulated authenticator to reflect: a) allocating channel for AuthenticatorGetInfo, b) sending
1815         AuthenticatorGetInfo, c) allocating channel for actual request, and d) sending the actual request.
1816
1817         Besides implementing the above, it also does a few other things:
1818         1) Make AuthenticatorManager::clearState asynchronous to avoid cyclic dependency:
1819         Authenticator::returnResponse => AuthenticatorManager::respondReceived => AuthenticatorManager::clearState
1820         => Authenticator::~Authenticator.
1821         2) Reorganize unified build sources to make it clear that which files are .mm and which are .cpp.
1822         3) Import LocalAuthentication.framework in LocalAuthenticationSoftLink instead of being scattered.
1823
1824         * Sources.txt:
1825         * SourcesCocoa.txt:
1826         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
1827         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1828         (WKWebsiteDataStoreSetWebAuthenticationMockConfiguration):
1829         * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
1830         (WebKit::AuthenticatorManagerInternal::collectTransports):
1831         (WebKit::AuthenticatorManager::clearStateAsync):
1832         (WebKit::AuthenticatorManager::respondReceived):
1833         (WebKit::AuthenticatorManager::initTimeOutTimer):
1834         * UIProcess/WebAuthentication/AuthenticatorManager.h:
1835         * UIProcess/WebAuthentication/AuthenticatorTransportService.cpp:
1836         (WebKit::AuthenticatorTransportService::create):
1837         (WebKit::AuthenticatorTransportService::createMock):
1838         (WebKit::AuthenticatorTransportService::startDiscovery):
1839         (WebKit::AuthenticatorTransportService::startDiscovery const): Deleted.
1840         * UIProcess/WebAuthentication/AuthenticatorTransportService.h:
1841         * UIProcess/WebAuthentication/Cocoa/HidConnection.h: Copied from Source/WebKit/UIProcess/WebAuthentication/AuthenticatorTransportService.h.
1842         * UIProcess/WebAuthentication/Cocoa/HidConnection.mm: Added.
1843         (WebKit::reportReceived):
1844         (WebKit::HidConnection::HidConnection):
1845         (WebKit::HidConnection::~HidConnection):
1846         (WebKit::HidConnection::initialize):
1847         (WebKit::HidConnection::terminate):
1848         (WebKit::HidConnection::send):
1849         (WebKit::HidConnection::registerDataReceivedCallback):
1850         (WebKit::HidConnection::unregisterDataReceivedCallback):
1851         (WebKit::HidConnection::receiveReport):
1852         (WebKit::HidConnection::consumeReports):
1853         (WebKit::HidConnection::registerDataReceivedCallbackInternal):
1854         * UIProcess/WebAuthentication/Cocoa/HidService.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalService.h.
1855         * UIProcess/WebAuthentication/Cocoa/HidService.mm: Added.
1856         (WebKit::deviceAddedCallback):
1857         (WebKit::deviceRemovedCallback):
1858         (WebKit::HidService::HidService):
1859         (WebKit::HidService::~HidService):
1860         (WebKit::HidService::startDiscoveryInternal):
1861         (WebKit::HidService::platformStartDiscovery):
1862         (WebKit::HidService::createHidConnection const):
1863         (WebKit::HidService::deviceAdded):
1864         (WebKit::HidService::continueAddDeviceAfterGetInfo):
1865         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticationSoftLink.h:
1866         * UIProcess/WebAuthentication/Cocoa/LocalConnection.mm:
1867         * UIProcess/WebAuthentication/Cocoa/LocalService.h:
1868         * UIProcess/WebAuthentication/Cocoa/LocalService.mm:
1869         (WebKit::LocalService::startDiscoveryInternal):
1870         (WebKit::LocalService::startDiscoveryInternal const): Deleted.
1871         * UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.cpp:
1872         (WebKit::MockAuthenticatorManager::respondReceivedInternal):
1873         * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp: Added.
1874         (WebKit::MockHidConnection::MockHidConnection):
1875         (WebKit::MockHidConnection::initialize):
1876         (WebKit::MockHidConnection::terminate):
1877         (WebKit::MockHidConnection::send):
1878         (WebKit::MockHidConnection::registerDataReceivedCallbackInternal):
1879         (WebKit::MockHidConnection::assembleRequest):
1880         (WebKit::MockHidConnection::parseRequest):
1881         (WebKit::MockHidConnection::feedReports):
1882         (WebKit::MockHidConnection::stagesMatch const):
1883         (WebKit::MockHidConnection::shouldContinueFeedReports):
1884         (WebKit::MockHidConnection::continueFeedReports):
1885         * UIProcess/WebAuthentication/Mock/MockHidConnection.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Mock/MockLocalConnection.h.
1886         * UIProcess/WebAuthentication/Mock/MockHidService.cpp: Copied from Source/WebKit/UIProcess/WebAuthentication/Mock/MockLocalService.cpp.
1887         (WebKit::MockHidService::MockHidService):
1888         (WebKit::MockHidService::platformStartDiscovery):
1889         (WebKit::MockHidService::createHidConnection const):
1890         * UIProcess/WebAuthentication/Mock/MockHidService.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Mock/MockLocalConnection.h.
1891         * UIProcess/WebAuthentication/Mock/MockLocalConnection.h:
1892         * UIProcess/WebAuthentication/Mock/MockLocalConnection.mm:
1893         * UIProcess/WebAuthentication/Mock/MockLocalService.mm: Renamed from Source/WebKit/UIProcess/WebAuthentication/Mock/MockLocalService.cpp.
1894         (WebKit::MockLocalService::MockLocalService):
1895         (WebKit::MockLocalService::platformStartDiscovery const):
1896         (WebKit::MockLocalService::createLocalConnection const):
1897         * UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h:
1898         * UIProcess/WebAuthentication/fido/CtapHidAuthenticator.cpp: Added.
1899         (WebKit::CtapHidAuthenticator::CtapHidAuthenticator):
1900         (WebKit::CtapHidAuthenticator::makeCredential):
1901         (WebKit::CtapHidAuthenticator::continueMakeCredentialAfterResponseReceived const):
1902         (WebKit::CtapHidAuthenticator::getAssertion):
1903         (WebKit::CtapHidAuthenticator::continueGetAssertionAfterResponseReceived const):
1904         * UIProcess/WebAuthentication/fido/CtapHidAuthenticator.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalService.h.
1905         * UIProcess/WebAuthentication/fido/CtapHidDriver.cpp: Added.
1906         (WebKit::CtapHidDriver::Worker::Worker):
1907         (WebKit::CtapHidDriver::Worker::~Worker):
1908         (WebKit::CtapHidDriver::Worker::transact):
1909         (WebKit::CtapHidDriver::Worker::write):
1910         (WebKit::CtapHidDriver::Worker::read):
1911         (WebKit::CtapHidDriver::Worker::returnMessage):
1912         (WebKit::CtapHidDriver::CtapHidDriver):
1913         (WebKit::CtapHidDriver::transact):
1914         (WebKit::CtapHidDriver::continueAfterChannelAllocated):
1915         (WebKit::CtapHidDriver::continueAfterResponseReceived):
1916         (WebKit::CtapHidDriver::returnResponse):
1917         * UIProcess/WebAuthentication/fido/CtapHidDriver.h: Added.
1918         * UIProcess/mac/WebDataListSuggestionsDropdownMac.mm:
1919         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
1920         * WebKit.xcodeproj/project.pbxproj:
1921
1922 2018-11-13  Ross Kirsling  <ross.kirsling@sony.com>
1923
1924         Unreviewed correction to previous build fix to avoid any internal/downstream repercussions.
1925
1926         * WebProcess/Network/webrtc/LibWebRTCProvider.h:
1927
1928 2018-11-13  Ross Kirsling  <ross.kirsling@sony.com>
1929
1930         Unreviewed GTK/WPE build fix for r238159. 
1931
1932         * WebProcess/Network/webrtc/LibWebRTCProvider.h:
1933
1934 2018-11-13  Timothy Hatcher  <timothy@apple.com>
1935
1936         Use a light scrollbar for transparent web views in dark mode.
1937         https://bugs.webkit.org/show_bug.cgi?id=191559
1938         rdar://problem/46000489
1939
1940         Reviewed by Dean Jackson.
1941
1942         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
1943         (WebKit::InjectedBundleRangeHandle::renderedImage): Use FrameView's useDarkAppaearance().
1944         * WebProcess/WebPage/WebPage.cpp:
1945         (WebKit::WebPage::drawRect): Ditto.
1946
1947 2018-11-13  Wenson Hsieh  <wenson_hsieh@apple.com>
1948
1949         [iOS] Do not show selection UI for editable elements with opacity near zero
1950         https://bugs.webkit.org/show_bug.cgi?id=191442
1951         <rdar://problem/45958625>
1952
1953         Reviewed by Simon Fraser.
1954
1955         Add support for suppressing native selection UI (for instance, selection highlight views, selection handles, and
1956         selection-related gestures) when the selection is inside a transparent editable element. This helps maintain
1957         compatibility with text editors that work by capturing key events and input events hidden contenteditable
1958         elements, and reflect these changes in different document or different part of the document.
1959
1960         Since selection UI is rendered in the UI process on iOS using element geometry propagated from the web process,
1961         selection rendering is entirely decoupled from the process of painting in the web process. This means that if
1962         the editable root has an opacity of 0, we would correctly hide the caret and selection on macOS, but draw over
1963         the transparent element on iOS. When these hidden editable elements are focused, this often results in unwanted
1964         behaviors, such as double caret painting, native and custom selection UI from the page being drawn on top of one
1965         another, and the ability to change selection via tap and loupe gestures within hidden text.
1966
1967         To fix this, we compute whether the focused element is transparent when an element is focused, or when the
1968         selection changes, and send this information over to the UI process via `AssistedNodeInformation` and
1969         `EditorState`. In the UI process, we then respect this information by suppressing the selection assistant if the
1970         focused element is transparent; this disables showing and laying out selection views, as well as gestures
1971         associated with selection overlays. However, this still allows for contextual autocorrection and spell checking.
1972
1973         * Shared/AssistedNodeInformation.cpp:
1974         (WebKit::AssistedNodeInformation::encode const):
1975         (WebKit::AssistedNodeInformation::decode):
1976         * Shared/AssistedNodeInformation.h:
1977         * Shared/EditorState.cpp:
1978         (WebKit::EditorState::PostLayoutData::encode const):
1979         (WebKit::EditorState::PostLayoutData::decode):
1980         * Shared/EditorState.h:
1981
1982         Add `elementIsTransparent` flags, and also add boilerplate IPC code.
1983
1984         * UIProcess/ios/WKContentViewInteraction.mm:
1985         (-[WKContentView _displayFormNodeInputView]):
1986
1987         Prevent zooming to the focused element if the focused element is hidden.
1988
1989         (-[WKContentView hasSelectablePositionAtPoint:]):
1990         (-[WKContentView pointIsNearMarkedText:]):
1991         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
1992
1993         Don't allow these text interaction gestures to begin while suppressing the selection assistant.
1994
1995         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
1996
1997         When an element is focused, begin suppressing the selection assistant if the element is fully transparent.
1998
1999         (-[WKContentView _stopAssistingNode]):
2000
2001         When the focused element is blurred, reset state by ending selection assistant suppression (additionally
2002         reactivating the selection assistant if needed). This ensures that selection in non-editable text isn't broken
2003         after focusing a hidden editable element.
2004
2005         (-[WKContentView _updateChangedSelection:]):
2006
2007         If needed, suppress or un-suppress the selection assistant when the selection changes. On certain rich text
2008         editors, a combination of custom selection UI and native selection UI is used. For instance, on Microsoft Office
2009         365, caret selections are rendered using the native caret view, but as soon as the selection becomes ranged, the
2010         editable root becomes fully transparent, and Office's selection UI takes over.
2011
2012         (-[WKContentView _shouldSuppressSelectionCommands]):
2013
2014         Override this UIKit SPI hook to suppress selection commands (e.g. the callout bar) when suppressing the
2015         selection assistant.
2016
2017         * WebProcess/WebPage/ios/WebPageIOS.mm:
2018         (WebKit::WebPage::platformEditorState const):
2019         (WebKit::WebPage::getAssistedNodeInformation):
2020
2021         Compute and set `elementIsTransparent` using the assisted node.
2022
2023 2018-11-13  Ryan Haddad  <ryanhaddad@apple.com>
2024
2025         Unreviewed, rolling out r238137.
2026
2027         Introduced API test failures on macOS.
2028
2029         Reverted changeset:
2030
2031         "Enable process swap on cross-site navigation by default on
2032         macOS"
2033         https://bugs.webkit.org/show_bug.cgi?id=191572
2034         https://trac.webkit.org/changeset/238137
2035
2036 2018-11-13  Ryosuke Niwa  <rniwa@webkit.org>
2037
2038         Enable process swap on cross-site navigation by default on macOS
2039         https://bugs.webkit.org/show_bug.cgi?id=191572
2040
2041         Reviewed by Chris Dumez.
2042
2043         Enabled the feature by default on macOS.
2044
2045         * Shared/WebPreferences.yaml:
2046         * Shared/WebPreferencesDefaultValues.h:
2047
2048 2018-11-13  Daniel Bates  <dabates@apple.com>
2049
2050         Consolidate WebKit UIKitSPI.h and UIKitTestSPI.h
2051         https://bugs.webkit.org/show_bug.cgi?id=173341
2052         <rdar://problem/32752890>
2053
2054         Reviewed by Simon Fraser.
2055
2056         * Platform/spi/ios/UIKitSPI.h:
2057
2058 2018-11-13  Alex Christensen  <achristensen@webkit.org>
2059
2060         Fix internal builds after r238115
2061         https://bugs.webkit.org/show_bug.cgi?id=191441
2062
2063         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
2064         (-[WKSafeBrowsingTextView intrinsicContentSize]):
2065         Some iOS-like operating systems don't have safe browsing.  Don't use symbols that don't exist on those systems.
2066
2067 2018-11-13  Ali Juma  <ajuma@chromium.org>
2068
2069         Turn Intersection Observer on by default
2070         https://bugs.webkit.org/show_bug.cgi?id=191569
2071
2072         Reviewed by Simon Fraser.
2073
2074         * Shared/WebPreferences.yaml:
2075
2076 2018-11-12  Darshan Kadu  <darsh7807@gmail.com>
2077
2078         Implement Cache API support for WPE/GTK
2079         https://bugs.webkit.org/show_bug.cgi?id=178316
2080
2081         Reviewed by Michael Catanzaro.
2082
2083         Added a new API function WKWebsiteDataStoreSetCacheStoragePerOriginQuota which sets the
2084         cache limit per origin.
2085
2086         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2087         (WKWebsiteDataStoreSetCacheStoragePerOriginQuota):
2088         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
2089
2090 2018-11-12  Alex Christensen  <achristensen@webkit.org>
2091
2092         [iOS] Implement safe browsing in WebKit
2093         https://bugs.webkit.org/show_bug.cgi?id=191441
2094
2095         Reviewed by Tim Horton.
2096
2097         In r237863 I implemented this for Mac.  This refines the UI and implements it for iOS.
2098
2099         * Shared/WebPreferences.yaml:
2100         * Shared/WebPreferencesDefaultValues.h:
2101         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
2102         (WKContextHandlesSafeBrowsing):
2103         * UIProcess/API/Cocoa/WKWebView.mm:
2104         (-[WKWebView _showSafeBrowsingWarning:completionHandler:]):
2105         (-[WKWebView _clearSafeBrowsingWarning]):
2106         (-[WKWebView layoutSubviews]):
2107         (-[WKWebView setFrameSize:]):
2108         (+[WKWebView _handlesSafeBrowsing]):
2109         (-[WKWebView _safeBrowsingWarningForTesting]):
2110         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2111         * UIProcess/Cocoa/PageClientImplCocoa.h:
2112         * UIProcess/Cocoa/PageClientImplCocoa.mm:
2113         (WebKit::PageClientImplCocoa::allocFileWrapperInstance const):
2114         (WebKit::PageClientImplCocoa::serializableFileWrapperClasses const):
2115         * UIProcess/Cocoa/WKSafeBrowsingWarning.h:
2116         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
2117         (confirmMalwareSentinel):
2118         (visitUnsafeWebsiteSentinel):
2119         (colorForItem):
2120         (addLinkAndReplace):
2121         (-[WKSafeBrowsingExclamationPoint drawRect:]):
2122         (makeButton):
2123         (makeTitleLabel):
2124         (setBackground):
2125         (-[WKSafeBrowsingWarning initWithFrame:safeBrowsingResult:completionHandler:]):
2126         (-[WKSafeBrowsingWarning addContent]):
2127         (-[WKSafeBrowsingWarning showDetailsClicked]):
2128         (-[WKSafeBrowsingWarning layoutText]):
2129         (-[WKSafeBrowsingWarning textView:clickedOnLink:atIndex:]):
2130         (-[WKSafeBrowsingWarning layout]):
2131         (-[WKSafeBrowsingWarning layoutSubviews]):
2132         (-[WKSafeBrowsingWarning textView:shouldInteractWithURL:inRange:interaction:]):
2133         (-[WKSafeBrowsingWarning didMoveToWindow]):
2134         (-[WKSafeBrowsingWarning clickedOnLink:]):
2135         (-[WKSafeBrowsingTextView initWithAttributedString:forWarning:]):
2136         (-[WKSafeBrowsingTextView intrinsicContentSize]):
2137         (colorNamed): Deleted.
2138         (+[WKSafeBrowsingTextView viewWithAttributedString:linkTarget:]): Deleted.
2139         (+[WKSafeBrowsingTextView viewWithString:]): Deleted.
2140         (-[WKSafeBrowsingTextView clickedOnLink:atIndex:]): Deleted.
2141         * UIProcess/ios/PageClientImplIOS.mm:
2142         (WebKit::PageClientImpl::isViewWindowActive):
2143         (WebKit::PageClientImpl::isViewFocused):
2144         (WebKit::PageClientImpl::isViewVisible):
2145         (WebKit::PageClientImpl::isViewInWindow):
2146         (WebKit::PageClientImpl::decidePolicyForGeolocationPermissionRequest):
2147         (WebKit::PageClientImpl::enterAcceleratedCompositingMode):
2148         (WebKit::PageClientImpl::showSafeBrowsingWarning):
2149         (WebKit::PageClientImpl::clearSafeBrowsingWarning):
2150         (WebKit::PageClientImpl::mimeTypesWithCustomContentProviders):
2151         (WebKit::PageClientImpl::navigationGestureDidBegin):
2152         (WebKit::PageClientImpl::navigationGestureWillEnd):
2153         (WebKit::PageClientImpl::navigationGestureDidEnd):
2154         (WebKit::PageClientImpl::willRecordNavigationSnapshot):
2155         (WebKit::PageClientImpl::didRemoveNavigationGestureSnapshot):
2156         (WebKit::PageClientImpl::requestPasswordForQuickLookDocument):
2157         * UIProcess/mac/PageClientImplMac.mm:
2158         (WebKit::PageClientImpl::showShareSheet):
2159         (WebKit::PageClientImpl::navigationGestureDidBegin):
2160         (WebKit::PageClientImpl::navigationGestureWillEnd):
2161         (WebKit::PageClientImpl::navigationGestureDidEnd):
2162         (WebKit::PageClientImpl::willRecordNavigationSnapshot):
2163         (WebKit::PageClientImpl::didRemoveNavigationGestureSnapshot):
2164
2165 2018-11-12  Tim Horton  <timothy_horton@apple.com>
2166
2167         Make it possible to edit images inline
2168         https://bugs.webkit.org/show_bug.cgi?id=191352
2169         <rdar://problem/30107985>
2170
2171         Reviewed by Dean Jackson.
2172
2173         * Platform/spi/ios/PencilKitSPI.h: Added.
2174         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
2175         (WebKit::RemoteLayerBackingStore::drawInContext):
2176         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
2177         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
2178         (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::LayerCreationProperties):
2179         (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::encode const):
2180         (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::decode):
2181         * WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.cpp:
2182         (WebKit::GraphicsLayerCARemote::createPlatformCALayerForEmbeddedView):
2183         * WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.h:
2184         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
2185         (WebKit::PlatformCALayerRemote::createForEmbeddedView):
2186         (WebKit::PlatformCALayerRemote::PlatformCALayerRemote):
2187         (WebKit::PlatformCALayerRemote::embeddedViewID const):
2188         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:
2189         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
2190         (WebKit::RemoteLayerTreeContext::layerWasCreated):
2191         Propagate EmbeddedViewID through the PlatformCALayer constructor and
2192         through the layer creation parameters to the UI process.
2193
2194         * Shared/WebPreferences.yaml:
2195         * UIProcess/API/Cocoa/WKWebView.mm:
2196         (-[WKWebView _initializeWithConfiguration:]):
2197         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2198         (-[WKWebViewConfiguration init]):
2199         (-[WKWebViewConfiguration copyWithZone:]):
2200         (-[WKWebViewConfiguration _setEditableImagesEnabled:]):
2201         (-[WKWebViewConfiguration _editableImagesEnabled]):
2202         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2203         Add a preference to enable editable images.
2204
2205         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h:
2206         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
2207         (WebKit::RemoteLayerTreeHost::layerWillBeRemoved):
2208         (WebKit::RemoteLayerTreeHost::clearLayers):
2209         (WebKit::RemoteLayerTreeHost::createLayer):
2210         Keep track of "embedded views" in two maps: embeddedViewID->UIView,
2211         and layerID->embeddedViewID. Clean them up when layers go away.
2212         If a embedded view is reparented, currently it must be added to a new
2213         layer in the same commit as it is removed from the previous layer
2214         in order to persist the view's state (otherwise the view will be
2215         destroyed and recreated). This will be less of a problem after future
2216         patches introduce serialization of image data and whatnot.
2217
2218         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
2219         (WebKit::RemoteLayerTreeHost::createLayer):
2220         (WebKit::RemoteLayerTreeHost::createEmbeddedView):
2221         Move the various remote layer tree UIView subclasses out into a separate file.
2222
2223         Add createEmbeddedView, which is used for LayerTypeEditableImageLayer,
2224         and creates a WKDrawingView and sticks it in the maps.
2225
2226         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h: Added.
2227         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm: Added.
2228         (-[UIView _web_recursiveFindDescendantInteractibleViewAtPoint:withEvent:]):
2229         (-[UIView _web_findDescendantViewAtPoint:withEvent:]):
2230         (-[WKCompositingView hitTest:withEvent:]):
2231         (-[WKCompositingView description]):
2232         (+[WKTransformView layerClass]):
2233         (+[WKSimpleBackdropView layerClass]):
2234         (+[WKShapeView layerClass]):
2235         (-[WKRemoteView initWithFrame:contextID:]):
2236         (+[WKRemoteView layerClass]):
2237         (-[WKBackdropView hitTest:withEvent:]):
2238         (-[WKBackdropView description]):
2239         (-[WKChildScrollView initWithFrame:]):
2240         Move various remote layer tree UIView subclasses here, to their own file.
2241         Make our UIView hit testing override test for views that conform to the
2242         protocol "WKNativelyInteractible", which switches to normal UIView hit
2243         testing. WKDrawingView will be the one such view.
2244
2245         Add WKChildScrollView and pull the one thing we customize out into it,
2246         to make RemoteLayerTreeHost::createLayer less logic-ful.
2247
2248         * UIProcess/ios/WKDrawingView.h: Added.
2249         * UIProcess/ios/WKDrawingView.mm: Added.
2250         (-[WKDrawingView init]):
2251         (-[WKDrawingView layoutSubviews]):
2252         Add a very simple WKDrawingView, which uses PKCanvasView to edit the image.
2253
2254         * WebKit.xcodeproj/project.pbxproj:
2255         * SourcesCocoa.txt:
2256         Add the new files.
2257
2258 2018-11-12  Don Olmstead  <don.olmstead@sony.com>
2259
2260         Shipped PNGs include bad profiles: iCCP: known incorrect sRGB profile
2261         https://bugs.webkit.org/show_bug.cgi?id=189230
2262         <rdar://problem/44050379>
2263
2264         Reviewed by Joseph Pecoraro.
2265
2266         Runs all png images through zopflipng. This results in a smaller file
2267         size and takes care of this issue as a byproduct.
2268
2269         * Resources/ios/iOS.xcassets/StartPictureInPictureButton.imageset/StartPictureInPictureButton@1x.png:
2270         * Resources/ios/iOS.xcassets/StartPictureInPictureButton.imageset/StartPictureInPictureButton@2x.png:
2271         * Resources/ios/iOS.xcassets/StartPictureInPictureButton.imageset/StartPictureInPictureButton@3x.png:
2272         * Resources/ios/iOS.xcassets/StopPictureInPictureButton.imageset/StopPictureInPictureButton@1x.png:
2273         * Resources/ios/iOS.xcassets/StopPictureInPictureButton.imageset/StopPictureInPictureButton@2x.png:
2274         * Resources/ios/iOS.xcassets/StopPictureInPictureButton.imageset/StopPictureInPictureButton@3x.png:
2275
2276 2018-11-12  Eric Carlson  <eric.carlson@apple.com>
2277
2278         [MediaStream] Screen capture should be an experimental feature on OSX only
2279         https://bugs.webkit.org/show_bug.cgi?id=191552
2280         <rdar://problem/45994142>
2281
2282         Reviewed by Youenn Fablet.
2283
2284         * Shared/WebPreferences.yaml: Make ScreenCaptureEnabled.condition ENABLE(MEDIA_STREAM) && PLATFORM(MAC).
2285
2286 2018-11-12  Takashi Komori  <Takashi.Komori@sony.com>
2287
2288         Resurrect WebKitTestRunner for Windows port
2289         https://bugs.webkit.org/show_bug.cgi?id=189257
2290
2291         Reviewed by Fujii Hironori.
2292
2293         * PlatformWin.cmake:
2294
2295 2018-11-12  Antoine Quint  <graouts@apple.com>
2296
2297         [Web Animations] Turn Web Animations experimental
2298         https://bugs.webkit.org/show_bug.cgi?id=191543
2299
2300         Reviewed by Dean Jackson.
2301
2302         * Shared/WebPreferences.yaml:
2303
2304 2018-11-11  Wenson Hsieh  <wenson_hsieh@apple.com>
2305
2306         Implement a new edit command to change the enclosing list type
2307         https://bugs.webkit.org/show_bug.cgi?id=191487
2308         <rdar://problem/45955922>
2309
2310         Reviewed by Ryosuke Niwa.
2311
2312         * UIProcess/WebEditCommandProxy.cpp:
2313         (WebKit::WebEditCommandProxy::nameForEditAction):
2314
2315         Add undo/redo edit action strings for ConvertToOrderedList and ConvertToUnorderedList.
2316
2317         * WebProcess/WebPage/WebPage.cpp:
2318         (WebKit::WebPage::increaseListLevel):
2319         (WebKit::WebPage::decreaseListLevel):
2320         (WebKit::WebPage::changeListType):
2321
2322         Remove preflight checks for these list editing commands. These are not necessary because these commands fall
2323         back to being noops if these checks return false. This avoids an extraneous ancestor walk to determine the
2324         enclosing list element when changing list type.
2325
2326 2018-11-11  Daniel Bates  <dabates@apple.com>
2327
2328         [iOS] Draw caps lock indicator in password fields
2329         https://bugs.webkit.org/show_bug.cgi?id=190565
2330         <rdar://problem/45262343>
2331
2332         Reviewed by Dean Jackson.
2333
2334         Notify the WebContent process with the current modifer state on window activation changes. Notify
2335         the WebContent process when hardware keyboard availability changes (e.g. a keyboard is attached).
2336
2337         * UIProcess/API/Cocoa/WKWebView.mm:
2338         (-[WKWebView _initializeWithConfiguration:]): Register for hardware keyboard availability changed notifications.
2339         (-[WKWebView dealloc]): Unregister from hardware availability changed notifications.
2340         (hardwareKeyboardAvailabilityChangedCallback): Added.
2341         * UIProcess/WebPageProxy.cpp:
2342         (WebKit::WebPageProxy::updateCurrentModifierState): Compile this code when building for iOS.
2343         * UIProcess/WebPageProxy.h:
2344         * UIProcess/ios/WKContentViewInteraction.mm:
2345         (-[WKContentView _handleKeyUIEvent:]): Update the current modifier state if this event is a hardware
2346         keyboard flags changed event.
2347         * UIProcess/ios/WebPageProxyIOS.mm:
2348         (WebKit::WebPageProxy::hardwareKeyboardAvailabilityChanged): Added.
2349
2350         * WebProcess/WebPage/WebPage.h:
2351         * WebProcess/WebPage/WebPage.messages.in:
2352         * WebProcess/WebPage/ios/WebPageIOS.mm:
2353         (WebKit::WebPage::hardwareKeyboardAvailabilityChanged):
2354         Added new message HardwareKeyboardAvailabilityChanged. Notify the focused HTML input element (if we have
2355         one) that the caps lock state may have changed when we receive message HardwareKeyboardAvailabilityChanged
2356         so that we toggle visibility of the caps lock indicator.
2357
2358 2018-11-11  Dan Bernstein  <mitz@apple.com>
2359
2360         ProcessPoolConfiguration::copy() doesn’t copy m_customWebContentServiceBundleIdentifier
2361         https://bugs.webkit.org/show_bug.cgi?id=191514
2362
2363         Reviewed by Geoffrey Garen.
2364
2365         Test: WebKitCocoa/WKProcessPoolConfiguration.mm
2366
2367         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2368         (API::ProcessPoolConfiguration::copy): Copy m_customWebContentServiceBundleIdentifier.
2369
2370 2018-11-11  Benjamin Poulain  <benjamin@webkit.org>
2371
2372         Fix a fixme: rename wtfObjcMsgSend to wtfObjCMsgSend
2373         https://bugs.webkit.org/show_bug.cgi?id=191492
2374
2375         Reviewed by Alex Christensen.
2376
2377         * Platform/mac/StringUtilities.mm:
2378         * UIProcess/ApplicationStateTracker.mm:
2379         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
2380         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
2381
2382 2018-11-10  Benjamin Poulain  <benjamin@webkit.org>
2383
2384         Fix a fixme: rename wtfObjcMsgSend to wtfObjCMsgSend
2385         https://bugs.webkit.org/show_bug.cgi?id=191492
2386
2387         Reviewed by Alex Christensen.
2388
2389         * Platform/mac/StringUtilities.mm:
2390         * UIProcess/ApplicationStateTracker.mm:
2391         (WebKit::ApplicationStateTracker::applicationDidEnterBackground):
2392         (WebKit::ApplicationStateTracker::applicationDidFinishSnapshottingAfterEnteringBackground):
2393         (WebKit::ApplicationStateTracker::applicationWillEnterForeground):
2394         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
2395         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
2396
2397 2018-11-10  Ryan Haddad  <ryanhaddad@apple.com>
2398
2399         Unreviewed, rolling out r238065.
2400
2401         Breaks internal builds.
2402
2403         Reverted changeset:
2404
2405         "Make it possible to edit images inline"
2406         https://bugs.webkit.org/show_bug.cgi?id=191352
2407         https://trac.webkit.org/changeset/238065
2408
2409 2018-11-10  Tim Horton  <timothy_horton@apple.com>
2410
2411         Make it possible to edit images inline
2412         https://bugs.webkit.org/show_bug.cgi?id=191352
2413         <rdar://problem/30107985>
2414
2415         Reviewed by Dean Jackson.
2416
2417         * Platform/spi/ios/PencilKitSPI.h: Added.
2418         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
2419         (WebKit::RemoteLayerBackingStore::drawInContext):
2420         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
2421         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
2422         (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::LayerCreationProperties):
2423         (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::encode const):
2424         (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::decode):
2425         * WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.cpp:
2426         (WebKit::GraphicsLayerCARemote::createPlatformCALayerForEmbeddedView):
2427         * WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.h:
2428         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
2429         (WebKit::PlatformCALayerRemote::createForEmbeddedView):
2430         (WebKit::PlatformCALayerRemote::PlatformCALayerRemote):
2431         (WebKit::PlatformCALayerRemote::embeddedViewID const):
2432         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:
2433         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
2434         (WebKit::RemoteLayerTreeContext::layerWasCreated):
2435         Propagate EmbeddedViewID through the PlatformCALayer constructor and
2436         through the layer creation parameters to the UI process.
2437
2438         * Shared/WebPreferences.yaml:
2439         * UIProcess/API/Cocoa/WKWebView.mm:
2440         (-[WKWebView _initializeWithConfiguration:]):
2441         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2442         (-[WKWebViewConfiguration init]):
2443         (-[WKWebViewConfiguration copyWithZone:]):
2444         (-[WKWebViewConfiguration _setEditableImagesEnabled:]):
2445         (-[WKWebViewConfiguration _editableImagesEnabled]):
2446         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2447         Add a preference to enable editable images.
2448
2449         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h:
2450         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
2451         (WebKit::RemoteLayerTreeHost::layerWillBeRemoved):
2452         (WebKit::RemoteLayerTreeHost::clearLayers):
2453         (WebKit::RemoteLayerTreeHost::createLayer):
2454         Keep track of "embedded views" in two maps: embeddedViewID->UIView,
2455         and layerID->embeddedViewID. Clean them up when layers go away.
2456         If a embedded view is reparented, currently it must be added to a new
2457         layer in the same commit as it is removed from the previous layer
2458         in order to persist the view's state (otherwise the view will be
2459         destroyed and recreated). This will be less of a problem after future
2460         patches introduce serialization of image data and whatnot.
2461
2462         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
2463         (WebKit::RemoteLayerTreeHost::createLayer):
2464         (WebKit::RemoteLayerTreeHost::createEmbeddedView):
2465         Move the various remote layer tree UIView subclasses out into a separate file.
2466
2467         Add createEmbeddedView, which is used for LayerTypeEditableImageLayer,
2468         and creates a WKDrawingView and sticks it in the maps.
2469
2470         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h: Added.
2471         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm: Added.
2472         (-[UIView _web_recursiveFindDescendantInteractibleViewAtPoint:withEvent:]):
2473         (-[UIView _web_findDescendantViewAtPoint:withEvent:]):
2474         (-[WKCompositingView hitTest:withEvent:]):
2475         (-[WKCompositingView description]):
2476         (+[WKTransformView layerClass]):
2477         (+[WKSimpleBackdropView layerClass]):
2478         (+[WKShapeView layerClass]):
2479         (-[WKRemoteView initWithFrame:contextID:]):
2480         (+[WKRemoteView layerClass]):
2481         (-[WKBackdropView hitTest:withEvent:]):
2482         (-[WKBackdropView description]):
2483         (-[WKChildScrollView initWithFrame:]):
2484         Move various remote layer tree UIView subclasses here, to their own file.
2485         Make our UIView hit testing override test for views that conform to the
2486         protocol "WKNativelyInteractible", which switches to normal UIView hit
2487         testing. WKDrawingView will be the one such view.
2488
2489         Add WKChildScrollView and pull the one thing we customize out into it,
2490         to make RemoteLayerTreeHost::createLayer less logic-ful.
2491
2492         * UIProcess/ios/WKDrawingView.h: Added.
2493         * UIProcess/ios/WKDrawingView.mm: Added.
2494         (-[WKDrawingView init]):
2495         (-[WKDrawingView layoutSubviews]):
2496         Add a very simple WKDrawingView, which uses PKCanvasView to edit the image.
2497
2498         * WebKit.xcodeproj/project.pbxproj:
2499         * SourcesCocoa.txt:
2500         Add the new files.
2501
2502 2018-11-09  Zalan Bujtas  <zalan@apple.com>
2503
2504         [iOS] Issue initial paint soon after the visuallyNonEmpty milestone is fired.
2505         https://bugs.webkit.org/show_bug.cgi?id=191078
2506         <rdar://problem/45736178>
2507
2508         Reviewed by Antti Koivisto.
2509
2510         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2511         (WebKit::WebChromeClient::layerFlushThrottlingIsActive const):
2512         * WebProcess/WebCoreSupport/WebChromeClient.h:
2513         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
2514         (WebKit::AcceleratedDrawingArea::scheduleInitialDeferredPaint):
2515         * WebProcess/WebPage/AcceleratedDrawingArea.h:
2516         * WebProcess/WebPage/DrawingArea.h:
2517         (WebKit::DrawingArea::layerFlushThrottlingIsActive const):
2518         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
2519         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
2520         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
2521         (WebKit::RemoteLayerTreeDrawingArea::setLayerTreeStateIsFrozen):
2522         (WebKit::RemoteLayerTreeDrawingArea::initialDeferredPaint):
2523         (WebKit::RemoteLayerTreeDrawingArea::scheduleInitialDeferredPaint):
2524         (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush):
2525         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
2526         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2527         (WebKit::TiledCoreAnimationDrawingArea::scheduleInitialDeferredPaint):
2528
2529 2018-11-09  John Wilander  <wilander@apple.com>
2530
2531         Add ability to configure document.cookie lifetime cap through user defaults
2532         https://bugs.webkit.org/show_bug.cgi?id=191480
2533         <rdar://problem/45240871>
2534
2535         Reviewed by Chris Dumez.
2536
2537         This change makes the capped lifetime in seconds configurable through
2538         user defaults.
2539
2540         * NetworkProcess/NetworkProcess.cpp:
2541         (WebKit::NetworkProcess::setAgeCapForClientSideCookies):
2542         (WebKit::NetworkProcess::setShouldCapLifetimeForClientSideCookies): Deleted.
2543             Renamed setAgeCapForClientSideCookies().
2544         * NetworkProcess/NetworkProcess.h:
2545         * NetworkProcess/NetworkProcess.messages.in:
2546         * UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm:
2547         (WebKit::ResourceLoadStatisticsMemoryStore::registerUserDefaultsIfNeeded):
2548         * UIProcess/Network/NetworkProcessProxy.cpp:
2549         (WebKit::NetworkProcessProxy::setAgeCapForClientSideCookies):
2550         (WebKit::NetworkProcessProxy::didSetAgeCapForClientSideCookies):
2551         (WebKit::NetworkProcessProxy::setShouldCapLifetimeForClientSideCookies): Deleted.
2552             Renamed setAgeCapForClientSideCookies().
2553         (WebKit::NetworkProcessProxy::didSetShouldCapLifetimeForClientSideCookies): Deleted.
2554             Renamed didSetAgeCapForClientSideCookies().
2555         * UIProcess/Network/NetworkProcessProxy.h:
2556         * UIProcess/Network/NetworkProcessProxy.messages.in:
2557         * UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
2558         (WebKit::ResourceLoadStatisticsMemoryStore::setAgeCapForClientSideCookies):
2559         (WebKit::ResourceLoadStatisticsMemoryStore::updateClientSideCookiesAgeCap):
2560         (WebKit::ResourceLoadStatisticsMemoryStore::didCreateNetworkProcess):
2561             New function that handles all the things that need to be done when a network
2562             process has been created.
2563         * UIProcess/ResourceLoadStatisticsMemoryStore.h:
2564         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2565         (WebKit::WebResourceLoadStatisticsStore::didCreateNetworkProcess):
2566             Now just calls the corresponding function on its memory store where all the
2567             configuration parameters are available.
2568         * UIProcess/WebResourceLoadStatisticsStore.h:
2569         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2570         (WebKit::WebsiteDataStore::setAgeCapForClientSideCookies):
2571         (WebKit::WebsiteDataStore::setShouldCapLifetimeForClientSideCookies): Deleted.
2572             Renamed setAgeCapForClientSideCookies().
2573         * UIProcess/WebsiteData/WebsiteDataStore.h:
2574
2575 2018-11-09  Ryan Haddad  <ryanhaddad@apple.com>
2576
2577         Unreviewed, rolling out r238047.
2578
2579         Introduced layout test failures on iOS simulator.
2580
2581         Reverted changeset:
2582
2583         "[iOS] Draw caps lock indicator in password fields"
2584         https://bugs.webkit.org/show_bug.cgi?id=190565
2585         https://trac.webkit.org/changeset/238047
2586
2587 2018-11-09  Chris Dumez  <cdumez@apple.com>
2588
2589         Suspended page persists even after back/forward list item is gone
2590         https://bugs.webkit.org/show_bug.cgi?id=191488
2591         <rdar://problem/45953006>
2592
2593         Reviewed by Geoffrey Garen.
2594
2595         Currently, the WebProcessPool owns the SuspendedPageProxy objects and makes sure we cap how
2596         many we can have. The WebBackForwardListItem merely has a WeakPtr to its associated
2597         SuspendedPageProxy. However, there is no point in having the WebProcessPool keeping a
2598         SuspendedPageProxy object alive if there is no longer any WebBackForwardListItem pointing
2599         to it.
2600
2601         To address the issue, WebBackForwardListItem nows tells the WebProcessPool to destroy
2602         its SuspendedPageProxy when necessary. WebBackForwardList also takes care of nulling
2603         out the WebBackForwardListItem's SuspendedPageProxy after the item has been removed
2604         from the list (in case somebody keeps the item alive).
2605
2606         * Shared/WebBackForwardListItem.cpp:
2607         (WebKit::WebBackForwardListItem::~WebBackForwardListItem):
2608         (WebKit::WebBackForwardListItem::setSuspendedPage):
2609         (WebKit::WebBackForwardListItem::suspendedPageIsNoLongerNeeded):
2610         * Shared/WebBackForwardListItem.h:
2611         * UIProcess/SuspendedPageProxy.cpp:
2612         (WebKit::SuspendedPageProxy::SuspendedPageProxy):
2613         * UIProcess/WebBackForwardList.cpp:
2614         (WebKit::WebBackForwardList::didRemoveItem):
2615         * UIProcess/WebProcessPool.cpp:
2616         (WebKit::WebProcessPool::removeSuspendedPageProxy):
2617         * UIProcess/WebProcessPool.h:
2618
2619 2018-11-09  Wenson Hsieh  <wenson_hsieh@apple.com>
2620
2621         [Cocoa] Implement SPI on WKWebView to increase and decrease list levels
2622         https://bugs.webkit.org/show_bug.cgi?id=191471
2623         <rdar://problem/45952472>
2624
2625         Reviewed by Tim Horton.
2626
2627         Implement these method stubs by calling into Editor.
2628
2629         Test: WKWebViewEditActions.ModifyListLevel
2630
2631         * WebProcess/WebPage/WebPage.cpp:
2632         (WebKit::WebPage::increaseListLevel):
2633         (WebKit::WebPage::decreaseListLevel):
2634         (WebKit::WebPage::changeListType):
2635
2636 2018-11-09  Keith Rollin  <krollin@apple.com>
2637
2638         Unreviewed build fix after https://bugs.webkit.org/show_bug.cgi?id=191324
2639
2640         Remove the use of .xcfilelists until their side-effects are better
2641         understood.
2642
2643         * WebKit.xcodeproj/project.pbxproj:
2644
2645 2018-11-09  Basuke Suzuki  <basuke.suzuki@sony.com>
2646
2647         [Curl][WebKit] Implement Proxy configuration API.
2648         https://bugs.webkit.org/show_bug.cgi?id=189053
2649
2650         Reviewed by Youenn Fablet.
2651
2652         Added proxy configuration API to WebsiteDataStore. Three API were added in WKWebsiteDataStoreRefCurl.h:
2653         - WKWebsiteDataStoreEnableDefaultNetworkProxySettings(WKWebsiteDataStoreRef)
2654         - WKWebsiteDataStoreEnableCustomNetworkProxySettings(WKWebsiteDataStoreRef, WKURLRef, WKStringRef ignoreHosts)
2655         - WKWebsiteDataStoreDisableNetworkProxySettings(WKWebsiteDataStoreRef)
2656
2657         * NetworkProcess/NetworkProcess.h:
2658         * NetworkProcess/NetworkProcess.messages.in:
2659         * NetworkProcess/NetworkSessionCreationParameters.h:
2660         (WebKit::NetworkSessionCreationParameters::encode const):
2661         (WebKit::NetworkSessionCreationParameters::decode):
2662         * NetworkProcess/curl/NetworkProcessCurl.cpp:
2663         (WebKit::NetworkProcess::setNetworkProxySettings):
2664         * NetworkProcess/curl/NetworkSessionCurl.cpp:
2665         (WebKit::NetworkSessionCurl::NetworkSessionCurl):
2666         * NetworkProcess/curl/RemoteNetworkingContextCurl.cpp:
2667         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
2668         * PlatformWin.cmake:
2669         * Shared/WebCoreArgumentCoders.h:
2670         * Shared/curl/WebCoreArgumentCodersCurl.cpp:
2671         (IPC::ArgumentCoder<CurlProxySettings>::encode):
2672         (IPC::ArgumentCoder<CurlProxySettings>::decode):
2673         * UIProcess/API/C/curl/WKWebsiteDataStoreRefCurl.cpp:
2674           Copied from Source/WebKit/NetworkProcess/curl/NetworkSessionCurl.cpp.
2675         (WKWebsiteDataStoreEnableDefaultNetworkProxySettings):
2676         (WKWebsiteDataStoreEnableCustomNetworkProxySettings):
2677         (WKWebsiteDataStoreDisableNetworkProxySettings):
2678         * UIProcess/API/C/curl/WKWebsiteDataStoreRefCurl.h:
2679           Copied from Source/WebKit/NetworkProcess/curl/NetworkSessionCurl.cpp.
2680         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2681         (WebKit::WebsiteDataStore::parameters):
2682         * UIProcess/WebsiteData/WebsiteDataStore.h:
2683         (WebKit::WebsiteDataStore::networkProxySettings const):
2684         * UIProcess/WebsiteData/curl/WebsiteDataStoreCurl.cpp:
2685           Copied from Source/WebKit/NetworkProcess/curl/NetworkSessionCurl.cpp.
2686         (WebKit::WebsiteDataStore::platformSetParameters):
2687         (WebKit::WebsiteDataStore::setNetworkProxySettings):
2688
2689 2018-11-09  Wenson Hsieh  <wenson_hsieh@apple.com>
2690
2691         [Cocoa] Introduce WKWebView SPI to insert nested ordered and unordered lists
2692         https://bugs.webkit.org/show_bug.cgi?id=191410
2693         <rdar://problem/45898610>
2694
2695         Reviewed by Dean Jackson.
2696
2697         Prefixes a few iOS-only SPI methods declared on WKWebView in r236867 with underscores, and also exposes some
2698         more cross-platform Cocoa editing SPI. Once the unprefixed SPI methods are no longer used by internal clients,
2699         these will need to be removed (see followup bug: webkit.org/b/191450). See below for more details.
2700
2701         Covered by new and existing API tests in WKWebViewEditActions.
2702
2703         * UIProcess/API/Cocoa/WKWebView.mm:
2704
2705         Hoist the definition (and undefinition) of `FORWARD_ACTION_TO_WKCONTENTVIEW` to encompass both the WKWebView
2706         implementation and the WKWebView (WKPrivate) implementation. This allows us to use this macro when implementing
2707         SPI methods in the WKPrivate category, as well as methods that are part of the main WKWebView implementation.
2708
2709         (-[WKWebView canPerformAction:withSender:]):
2710         (-[WKWebView targetForAction:withSender:]):
2711
2712         Add forwarding for the new editing commands in -canPerformAction: and -targetForAction:.
2713
2714         (-[WKWebView _toggleStrikeThrough:]):
2715         (-[WKWebView _increaseListLevel:]):
2716         (-[WKWebView _decreaseListLevel:]):
2717         (-[WKWebView _changeListType:]):
2718         (-[WKWebView _setFont:sender:]):
2719         (-[WKWebView _setFontSize:sender:]):
2720         (-[WKWebView _setTextColor:sender:]):
2721
2722         Add definitions for the new editing methods on WKWebView, using macros (`WEBCORE_PRIVATE_COMMAND` on macOS and
2723         `FORWARD_ACTION_TO_WKCONTENTVIEW` on iOS) to help reduce the code duplication.
2724
2725         (-[WKWebView _pasteAsQuotation:]): Deleted.
2726
2727         Remove this method definition, which is now replaced by macros on iOS and macOS.
2728
2729         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2730
2731         Introduce the new SPI to WKWebView (WKPrivate), and add FIXMEs to remove old, unprefixed variants of the SPI.
2732
2733         * UIProcess/WebPageProxy.cpp:
2734         (WebKit::WebPageProxy::increaseListLevel):
2735         (WebKit::WebPageProxy::decreaseListLevel):
2736         (WebKit::WebPageProxy::changeListType):
2737
2738         Add plumbing for these list editing commands.
2739
2740         * UIProcess/WebPageProxy.h:
2741         * UIProcess/ios/WKContentViewInteraction.h:
2742         * UIProcess/ios/WKContentViewInteraction.mm:
2743         (-[WKContentView _increaseListLevelForWebView:]):
2744         (-[WKContentView _decreaseListLevelForWebView:]):
2745         (-[WKContentView _changeListTypeForWebView:]):
2746         (-[WKContentView _toggleStrikeThroughForWebView:]):
2747         (-[WKContentView _setFontForWebView:sender:]):
2748         (-[WKContentView _setFontSizeForWebView:sender:]):
2749         (-[WKContentView _setTextColorForWebView:sender:]):
2750         (-[WKContentView toggleStrikeThroughForWebView:]):
2751         (-[WKContentView setFontForWebView:sender:]):
2752         (-[WKContentView setFontSizeForWebView:sender:]):
2753         (-[WKContentView setTextColorForWebView:sender:]):
2754         (-[WKContentView canPerformActionForWebView:withSender:]):
2755
2756         Check for the new action selectors here, and additionally add validation for `_pasteAsQuotation:`. Let the
2757         unprefixed versions of these methods simply call the prefixed versions (these method implementations will be
2758         removed in a followup once doing so would not affect any clients of WebKit).
2759
2760         * WebKit.xcodeproj/project.pbxproj:
2761         * WebProcess/WebPage/WebPage.cpp:
2762         (WebKit::WebPage::increaseListLevel):
2763         (WebKit::WebPage::decreaseListLevel):
2764         (WebKit::WebPage::changeListType):
2765         * WebProcess/WebPage/WebPage.h:
2766         * WebProcess/WebPage/WebPage.messages.in:
2767
2768         Add stubs for several list editing commands that are yet to be hooked up to WebCore. These will be implemented
2769         in a future patch.
2770
2771 2018-11-09  Antti Koivisto  <antti@apple.com>
2772
2773         Use OptionSet for layout milestones
2774         https://bugs.webkit.org/show_bug.cgi?id=191470
2775
2776         Reviewed by Dean Jackson.
2777
2778         * Shared/API/Cocoa/_WKRenderingProgressEventsInternal.h:
2779         (renderingProgressEvents):
2780         * Shared/API/c/WKSharedAPICast.h:
2781         (WebKit::toWKLayoutMilestones):
2782         (WebKit::toLayoutMilestones):
2783         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
2784         (WebKit::RemoteLayerTreeTransaction::newlyReachedLayoutMilestones const):
2785         (WebKit::RemoteLayerTreeTransaction::setNewlyReachedLayoutMilestones):
2786         * Shared/WebPageCreationParameters.cpp:
2787         (WebKit::WebPageCreationParameters::encode const):
2788         (WebKit::WebPageCreationParameters::decode):
2789         * Shared/WebPageCreationParameters.h:
2790         * UIProcess/API/APILoaderClient.h:
2791         (API::LoaderClient::didReachLayoutMilestone):
2792         * UIProcess/API/APINavigationClient.h:
2793         (API::NavigationClient::renderingProgressDidChange):
2794         * UIProcess/API/C/WKPage.cpp:
2795         (WKPageSetPageLoaderClient):
2796         (WKPageSetPageNavigationClient):
2797         * UIProcess/API/C/WKPageRenderingProgressEventsInternal.h:
2798         (pageRenderingProgressEvents):
2799         * UIProcess/API/Cocoa/WKWebView.mm:
2800         (layoutMilestones):
2801         * UIProcess/Cocoa/NavigationState.h:
2802         * UIProcess/Cocoa/NavigationState.mm:
2803         (WebKit::NavigationState::NavigationClient::renderingProgressDidChange):
2804         * UIProcess/WebPageProxy.cpp:
2805         (WebKit::WebPageProxy::listenForLayoutMilestones):
2806         (WebKit::WebPageProxy::didLayoutForCustomContentProvider):
2807         (WebKit::WebPageProxy::didReachLayoutMilestone):
2808         * UIProcess/WebPageProxy.h:
2809         * UIProcess/WebPageProxy.messages.in:
2810         * UIProcess/ios/WebPageProxyIOS.mm:
2811         (WebKit::WebPageProxy::didCommitLayerTree):
2812         * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
2813         (API::InjectedBundle::PageLoaderClient::didReachLayoutMilestone):
2814         (API::InjectedBundle::PageLoaderClient::layoutMilestones const):
2815         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
2816         (WebKit::InjectedBundlePageLoaderClient::didReachLayoutMilestone):
2817         (WebKit::InjectedBundlePageLoaderClient::layoutMilestones const):
2818         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
2819         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2820         (WebKit::WebFrameLoaderClient::dispatchDidReachLayoutMilestone):
2821         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2822         * WebProcess/WebPage/DrawingArea.h:
2823         (WebKit::DrawingArea::dispatchDidReachLayoutMilestone):
2824         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
2825         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
2826         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
2827         (WebKit::RemoteLayerTreeDrawingArea::dispatchDidReachLayoutMilestone):
2828         * WebProcess/WebPage/WebPage.cpp:
2829         (WebKit::m_shouldAttachDrawingAreaOnPageTransition):
2830         (WebKit::WebPage::listenForLayoutMilestones):
2831         (WebKit::WebPage::dispatchDidReachLayoutMilestone):
2832         * WebProcess/WebPage/WebPage.h:
2833         * WebProcess/WebPage/WebPage.messages.in:
2834         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
2835         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2836         (WebKit::TiledCoreAnimationDrawingArea::sendPendingNewlyReachedLayoutMilestones):
2837         (WebKit::TiledCoreAnimationDrawingArea::dispatchDidReachLayoutMilestone):
2838
2839 2018-11-09  Daniel Bates  <dabates@apple.com>
2840
2841         [iOS] Draw caps lock indicator in password fields
2842         https://bugs.webkit.org/show_bug.cgi?id=190565
2843         <rdar://problem/45262343>
2844
2845         Reviewed by Dean Jackson.
2846
2847         Notify the WebContent process with the current modifer state on window activation changes. Notify
2848         the WebContent process when hardware keyboard availability changes (e.g. a keyboard is attached).
2849
2850         * UIProcess/API/Cocoa/WKWebView.mm:
2851         (-[WKWebView _initializeWithConfiguration:]): Register for hardware keyboard availability changed notifications.
2852         (-[WKWebView dealloc]): Unregister from hardware availability changed notifications.
2853         (hardwareKeyboardAvailabilityChangedCallback): Added.
2854         * UIProcess/WebPageProxy.cpp:
2855         (WebKit::WebPageProxy::updateCurrentModifierState): Compile this code when building for iOS.
2856         * UIProcess/WebPageProxy.h:
2857         * UIProcess/ios/WKContentViewInteraction.mm:
2858         (-[WKContentView _handleKeyUIEvent:]): Update the current modifier state if this event is a hardware
2859         keyboard flags changed event.
2860         * UIProcess/ios/WebPageProxyIOS.mm:
2861         (WebKit::WebPageProxy::hardwareKeyboardAvailabilityChanged): Added.
2862
2863         * WebProcess/WebPage/WebPage.h:
2864         * WebProcess/WebPage/WebPage.messages.in:
2865         * WebProcess/WebPage/ios/WebPageIOS.mm:
2866         (WebKit::WebPage::hardwareKeyboardAvailabilityChanged):
2867         Added new message HardwareKeyboardAvailabilityChanged. Notify the focused HTML input element (if we have
2868         one) that the caps lock state may have changed when we receive message HardwareKeyboardAvailabilityChanged
2869         so that we toggle visibility of the caps lock indicator.
2870
2871 2018-11-09  Tim Horton  <timothy_horton@apple.com>
2872
2873         Make use of _UIRemoteView instead of CALayerHost if possible for WKRemoteView
2874         https://bugs.webkit.org/show_bug.cgi?id=191449
2875         <rdar://problem/45884977>
2876
2877         Reviewed by Eric Carlson.
2878
2879         UIRemoteView has some nice process assertion management that it would
2880         be nice to not duplicate. So, we can just use it instead of CALayerHost!
2881
2882         * Platform/spi/ios/UIKitSPI.h:
2883         * UIProcess/DrawingAreaProxy.h:
2884         (WebKit::DrawingAreaProxy::page const):
2885         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
2886         (-[WKUIRemoteView hitTest:withEvent:]):
2887         (-[WKUIRemoteView description]):
2888         (createRemoteView):
2889         (WebKit::RemoteLayerTreeHost::createLayer):
2890
2891 2018-11-09  Eric Carlson  <eric.carlson@apple.com>
2892
2893         [MediaStream] Make screen capture an experimental feature
2894         https://bugs.webkit.org/show_bug.cgi?id=191472
2895         <rdar://problem/45946499>
2896
2897         Reviewed by Jer Noble.
2898
2899         * Shared/WebPreferences.yaml: Make ScreenCaptureEnabled an experimental feature.
2900
2901 2018-11-09  Daniel Bates  <dabates@apple.com>
2902
2903         [iOS] Pressing forward delete key in text field does nothing and we should not invoke an editor
2904         action when forward delete is pressed outside a text field
2905         https://bugs.webkit.org/show_bug.cgi?id=190566
2906         <rdar://problem/45262367>
2907
2908         Reviewed by Wenson Hsieh.
2909
2910         Override -_deleteForwardAndNotify to perform a forward deletion and remove the dead code that
2911         expected UIKit to send us a character string with 0xF728 for the forward delete key. UIKit
2912         ceased doing this many years ago. We may revist this decision once <rdar://problem/45772078>
2913         is fixed.
2914
2915         * UIProcess/ios/WKContentViewInteraction.mm:
2916         (-[WKContentView _interpretKeyEvent:isCharEvent:]):
2917         (-[WKContentView _deleteForwardAndNotify:]):
2918
2919 2018-11-08  Wenson Hsieh  <wenson_hsieh@apple.com>
2920
2921         Unreviewed, try to fix the 32-bit macOS build
2922
2923         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2924         (WebKit::PDFPlugin::showDefinitionForAttributedString):
2925
2926 2018-11-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
2927
2928         Add an SPI to allow WebView clients to add additional supported image formats
2929         https://bugs.webkit.org/show_bug.cgi?id=190454
2930
2931         Reviewed by Simon Fraser.
2932
2933         * Platform/mac/StringUtilities.h:
2934         * Platform/mac/StringUtilities.mm:
2935         (WebKit::webCoreStringVectorFromNSStringArray):
2936         A helper function which converts an NSArray of NSStrings to a Vector of
2937         WTFString.
2938
2939         * Shared/WebPageCreationParameters.cpp:
2940         (WebKit::WebPageCreationParameters::encode const):
2941         (WebKit::WebPageCreationParameters::decode):
2942         * Shared/WebPageCreationParameters.h:
2943         Handle encoding and decoding the AdditionalSupportedImageTypes which will
2944         allow transferring it from the UI process to the web process.
2945
2946         * UIProcess/API/APIPageConfiguration.h:
2947         (API::PageConfiguration::additionalSupportedImageTypes const):
2948         (API::PageConfiguration::setAdditionalSupportedImageTypes):
2949         Store the AdditionalSupportedImageTypes in the APIPageConfiguration
2950         which is used when creating the WebPageProxy in the UIPorcess.
2951
2952         * UIProcess/API/Cocoa/WKWebView.mm:
2953         (-[WKWebView _initializeWithConfiguration:]):
2954         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2955         (-[WKWebViewConfiguration copyWithZone:]):
2956         (-[WKWebViewConfiguration _additionalSupportedImageTypes]):
2957         (-[WKWebViewConfiguration _setAdditionalSupportedImageTypes:]):
2958         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2959         Setter/Getter for the AdditionalSupportedImageTypes.
2960
2961         * UIProcess/WebPageProxy.cpp:
2962         (WebKit::WebPageProxy::creationParameters):
2963         Copy the AdditionalSupportedImageTypes from APIPageConfiguration to 
2964         WebPageCreationParameters.
2965
2966         * UIProcess/WebPageProxy.h:
2967         Delete unimplemented function.
2968
2969         * WebProcess/WebPage/WebPage.cpp:
2970         (WebKit::m_shouldAttachDrawingAreaOnPageTransition):
2971         Copy the AdditionalSupportedImageTypes from WebPageCreationParameters to
2972         WebCore.
2973
2974 2018-11-08  Megan Gardner  <megan_gardner@apple.com>
2975
2976         Adopt Reveal Framework to replace Lookup
2977         https://bugs.webkit.org/show_bug.cgi?id=191097
2978         <rdar://problem/45924508>
2979
2980         Reviewed by Tim Horton.
2981
2982         Pass in what it needed to clear the textIndicators. This is better than
2983         the current notification structure.
2984
2985         * UIProcess/Cocoa/WebViewImpl.mm:
2986         (-[WKWindowVisibilityObserver dealloc]):
2987         (-[WKWindowVisibilityObserver startObservingLookupDismissalIfNeeded]):
2988         * UIProcess/mac/PageClientImplMac.mm:
2989         (WebKit::PageClientImpl::didPerformDictionaryLookup):
2990         * UIProcess/mac/WKImmediateActionController.mm:
2991         (-[WKImmediateActionController _animationControllerForText]):
2992         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2993         (WebKit::PDFPlugin::showDefinitionForAttributedString):
2994
2995         Generate and pass in the text indicator information, as this is needed now.
2996
2997         * WebProcess/WebPage/mac/WebPageMac.mm:
2998         (WebKit::WebPage::dictionaryPopupInfoForSelectionInPDFPlugin):
2999
3000 2018-11-08  Keith Rollin  <krollin@apple.com>
3001
3002         Create .xcfilelist files
3003         https://bugs.webkit.org/show_bug.cgi?id=191324
3004         <rdar://problem/45852819>
3005
3006         Reviewed by Alex Christensen.
3007
3008         As part of preparing for enabling XCBuild, create and use .xcfilelist
3009         files. These files are using during Run Script build phases in an
3010         Xcode project. If a Run Script build phase produces new files that are
3011         used later as inputs to subsequent build phases, XCBuild needs to know
3012         about these files. These files can be either specified in an "output
3013         files" section of the Run Script phase editor, or in .xcfilelist files
3014         that are associated with the Run Script build phase.
3015
3016         This patch takes the second approach. It consists of three sets of changes:
3017
3018         - Modify the DerivedSources.make files to have a
3019           'print_all_generated_files" target that produces a list of the files
3020           they create.
3021
3022         - Create a shell script that produces .xcfilelist files from the
3023           output of the previous step, as well as for the files created in the
3024           Generate Unified Sources build steps.
3025
3026         - Add the new .xcfilelist files to the associated projects.
3027
3028         Note that, with these changes, the Xcode workspace and projects can no
3029         longer be fully loaded into Xcode 9. Xcode will attempt to load the
3030         projects that have .xcfilelist files associated with them, but will
3031         fail and display a placeholder for those projects instead. It's
3032         expected that all developers are using Xcode 10 by now and that not
3033         being able to load into Xcode 9 is not a practical issue. Keep in mind
3034         that this is strictly an IDE issue, and that the projects can still be
3035         built with `xcodebuild`.
3036
3037         Also note that the shell script that creates the .xcfilelist files can
3038         also be used to verify that the set of files that's currently checked
3039         in is up-to-date. This checking can be used as part of a check-in hook
3040         or part of check-webkit-style to sooner catch cases where the
3041         .xcfilelist files need to be regenerated.
3042
3043         * DerivedSources.make:
3044         * DerivedSources.xcfilelist: Added.
3045         * UnifiedSources.xcfilelist: Added.
3046         * WebKit.xcodeproj/project.pbxproj:
3047
3048 2018-11-08  Timothy Hatcher  <timothy@apple.com>
3049
3050         Add experimental support for a `supported-color-schemes` CSS property.
3051         https://bugs.webkit.org/show_bug.cgi?id=191319
3052         rdar://problem/45852261
3053
3054         Reviewed by Dean Jackson.
3055
3056         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
3057         (WebKit::InjectedBundleRangeHandle::renderedImage):
3058         * WebProcess/WebPage/WebPage.cpp:
3059         (WebKit::WebPage::drawRect):
3060
3061 2018-11-08  Eric Carlson  <eric.carlson@apple.com>
3062
3063         [MediaStream] Use DeviceIdHashSaltStorage to generate device ID hash salt
3064         https://bugs.webkit.org/show_bug.cgi?id=190825
3065         <rdar://problem/45486085>
3066
3067         Reviewed by Youenn Fablet.
3068
3069         * UIProcess/API/C/WKUserMediaPermissionCheck.cpp:
3070         (WKUserMediaPermissionCheckSetUserMediaAccessInfo):
3071         * UIProcess/API/glib/WebKitDeviceInfoPermissionRequest.cpp:
3072         (webkitDeviceInfoPermissionRequestAllow):
3073         (webkitDeviceInfoPermissionRequestDeny):
3074         * UIProcess/Cocoa/UIDelegate.mm:
3075         (WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin):
3076         * UIProcess/DeviceIdHashSaltStorage.cpp:
3077         (WebKit::DeviceIdHashSaltStorage::regenerateDeviceIdHashSaltForOrigin):
3078         (WebKit::DeviceIdHashSaltStorage::deleteDeviceIdHashSaltForOrigin):
3079         * UIProcess/DeviceIdHashSaltStorage.h:
3080         * UIProcess/UserMediaPermissionCheckProxy.cpp:
3081         (WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo):
3082         * UIProcess/UserMediaPermissionCheckProxy.h:
3083         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
3084         (WebKit::UserMediaPermissionRequestManagerProxy::createPermissionRequest):
3085         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
3086         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
3087         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo):
3088         (WebKit::UserMediaPermissionRequestManagerProxy::updateDeviceIDHashSalt):
3089         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
3090         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
3091         * UIProcess/UserMediaPermissionRequestProxy.cpp:
3092         (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy):
3093         * UIProcess/UserMediaPermissionRequestProxy.h:
3094         (WebKit::UserMediaPermissionRequestProxy::create):
3095         (WebKit::UserMediaPermissionRequestProxy::deviceIdentifierHashSalt const): Deleted.
3096
3097 2018-11-08  Carlos Garcia Campos  <cgarcia@igalia.com>
3098
3099         [GTK] Crash when running with sandbox enabled
3100         https://bugs.webkit.org/show_bug.cgi?id=191353
3101
3102         Reviewed by Michael Catanzaro.
3103
3104         g_key_file_set_string_list() expects a null-terminated array as parameter.
3105
3106         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
3107         (WebKit::createFlatpakInfo): Append nullptr to sharedPermissions array.
3108
3109 2018-11-07  Chris Dumez  <cdumez@apple.com>
3110
3111         Unreviewed, fix iOS build with recent SDKs.
3112
3113         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
3114         (-[WKFullScreenWindowController _EVOrganizationName]):
3115
3116 2018-11-07  John Wilander  <wilander@apple.com>
3117
3118         Resource Load Statistics: Enable cap on partitioned cache max age
3119         https://bugs.webkit.org/show_bug.cgi?id=191395
3120         <rdar://problem/45885977>
3121
3122         Reviewed by Chris Dumez.
3123
3124         This change does not bump the network cache revision number.
3125         It's not needed since it was done just a week ago.
3126
3127         * UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
3128         (WebKit::ResourceLoadStatisticsMemoryStore::setCacheMaxAgeCap):
3129         (WebKit::ResourceLoadStatisticsMemoryStore::updateCacheMaxAgeCap):
3130         * UIProcess/ResourceLoadStatisticsMemoryStore.h:
3131         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3132         (WebKit::WebResourceLoadStatisticsStore::didCreateNetworkProcess):
3133
3134 2018-11-07  Daniel Bates  <dabates@apple.com>
3135
3136         [iOS] Support deleting to the start of the line and to the end of the line
3137         https://bugs.webkit.org/show_bug.cgi?id=191389
3138         <rdar://problem/45883972>
3139
3140         Reviewed by Wenson Hsieh.
3141
3142         Add support for the key commands Command + Delete and Control + K to delete to the start
3143         of the line and to delete to the end of the line, respectively.
3144
3145         * UIProcess/ios/WKContentViewInteraction.mm:
3146         (-[WKContentView _deleteToStartOfLine]): Added.
3147         (-[WKContentView _deleteToEndOfLine]): Added.
3148
3149 2018-11-07  Daniel Bates  <dabates@apple.com>
3150
3151         [iOS] Option + Delete should delete previous word
3152         https://bugs.webkit.org/show_bug.cgi?id=191381
3153         <rdar://problem/23681351>
3154
3155         Reviewed by Wenson Hsieh.
3156
3157         Implement support for pressing Option + Delete to delete the previous word. This makes text editing
3158         in WebKit more closely match the platform conventions.
3159
3160         * UIProcess/ios/WKContentViewInteraction.mm:
3161         (-[WKContentView _deleteByWord]):
3162
3163 2018-11-07  Daniel Bates  <dabates@apple.com>
3164
3165         Override +[UIKeyboard isInHardwareKeyboardMode] in WebKitTestRunner and DumpRenderTree
3166         https://bugs.webkit.org/show_bug.cgi?id=190141
3167
3168         Reviewed by Darin Adler.
3169
3170         Directly use +[UIKeyboard isInHardwareKeyboardMode]. We will override this class method
3171         in DumpRenderTree and WebKitTestRunner to always return NO so as to make test runs
3172         deterministic regardless of whether a hardware keyboard is attached.
3173
3174         * Shared/NativeWebKeyboardEvent.h:
3175         * Shared/ios/NativeWebKeyboardEventIOS.mm:
3176         (WebKit::isInHardwareKeyboardMode): Deleted.
3177         * UIProcess/ios/WKContentViewInteraction.mm:
3178         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
3179         * WebProcess/WebPage/ios/WebPageIOS.mm:
3180         (WebKit::WebPage::platformEditorState const):
3181
3182 2018-11-07  Zamiul Haque  <zhaque@apple.com>
3183
3184         Force a gregorian calendar to show for credit card expiration date inputs
3185         (autocomplete='cc-exp'*) regardless of default system settings.
3186         https://bugs.webkit.org/show_bug.cgi?id=191096
3187         rdar://problem/42640256
3188
3189         Reviewed by Tim Horton.
3190
3191         Added some plumbing code to expose the calendar identifier of the calendar used by a
3192         presented date picker. Added shouldPresentGregorianCalendar:, to be used for
3193         determining what property values a date input control must present a Gregorian
3194         calendar for.
3195
3196         * UIProcess/ios/WKContentViewInteraction.mm:
3197         (-[WKContentView formInputPeripheral]):
3198         * UIProcess/ios/forms/WKFormInputControl.mm:
3199
3200 2018-11-07  Carlos Garcia Campos  <cgarcia@igalia.com>
3201
3202         Unreviewed. Fix GTK/WPE build when memfd is not available after r237922.
3203
3204         * Platform/unix/SharedMemoryUnix.cpp:
3205         (WebKit::createSharedMemory):
3206
3207 2018-11-07  Carlos Garcia Campos  <cgarcia@igalia.com>
3208
3209         [Linux] Use memfd_create when available in SharedMemory implementation
3210         https://bugs.webkit.org/show_bug.cgi?id=189741
3211
3212         Reviewed by Michael Catanzaro.
3213
3214         If memfd is available, use it instead of shm_open.
3215
3216         * Platform/unix/SharedMemoryUnix.cpp:
3217         (WebKit::createSharedMemory): Helper to create the shared memory, trying first with memfd and falling back to
3218         shm if it's not available.
3219         (WebKit::SharedMemory::create): Use createSharedMemory() helper.
3220
3221 2018-11-06  Justin Fan  <justin_fan@apple.com>
3222
3223         [WebGPU] Experimental prototype for WebGPURenderPipeline and WebGPUSwapChain
3224         https://bugs.webkit.org/show_bug.cgi?id=191291
3225
3226         Reviewed by Myles Maxfield.
3227
3228         Properly disable WEBGPU on all non-Metal platforms for now.
3229
3230         * Configurations/FeatureDefines.xcconfig:
3231
3232 2018-11-06  Youenn Fablet  <youenn@apple.com>
3233
3234         Make mDNS ICE Candidate an experimental flag again
3235         https://bugs.webkit.org/show_bug.cgi?id=191262
3236
3237         Reviewed by Dean Jackson.
3238
3239         * Shared/WebPreferences.yaml:
3240         * UIProcess/API/C/WKPreferences.cpp:
3241         (WKPreferencesSetWebRTCMDNSICECandidatesEnabled):
3242         (WKPreferencesGetWebRTCMDNSICECandidatesEnabled):
3243         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3244         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
3245
3246 2018-11-06  Suresh Koppisetty  <skoppisetty@apple.com>
3247
3248         Don’t use the main queue to create an XPC connection.
3249         https://bugs.webkit.org/show_bug.cgi?id=191160
3250         <rdar://problem/45736262>
3251
3252         Reviewed by Geoffrey Garen.
3253
3254         Don't use the main queue to create an XPC connection. xpc_connection_set_bootstrap does
3255         dispatch_mach_send_barrier_f on this queue which delays the sending of the subsequent
3256         bootstrap message (sent to launchd for launching a new target process) when the main queue is busy.
3257
3258         Now that the XPC connection runs on the default concurrent queue, errorHandler could be invoked
3259         by any thread. The job of errorHandler is to dispatch errorHandlerImpl to the main thread,
3260         where errorHandlerImpl is responsible for the actual handling of errors if any.
3261
3262         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
3263         (WebKit::ProcessLauncher::launchProcess):
3264
3265 2018-11-06  Brian Burg  <bburg@apple.com>
3266
3267         Add missing iOS availability macro to _WKAutomationSessionConfiguration
3268         https://bugs.webkit.org/show_bug.cgi?id=191320
3269
3270         Reviewed by Tim Horton.
3271
3272         * UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.h:
3273
3274 2018-11-06  John Wilander  <wilander@apple.com>
3275
3276         Resource Load Statistics: Remove cap on partitioned cache max age if it matches a network reload (redirect-only)
3277         https://bugs.webkit.org/show_bug.cgi?id=189760
3278         <rdar://problem/44612242>
3279
3280         Reviewed by Youenn Fablet and Antti Koivisto.
3281
3282         When a redirect cache entry for a prevalent resource reaches its max
3283         age cap, it is loaded again from the network and the network response
3284         is compared with what's in the cache. If it's a match, the cache entry
3285         is fully accepted. If not, a new capped cache entry is created.
3286
3287         This feature is still off by default.
3288
3289         * NetworkProcess/NetworkResourceLoader.cpp:
3290         (WebKit::NetworkResourceLoader::canUseCachedRedirect const):
3291             Now checks the new member m_cacheEntryForMaxAgeCapValidation.
3292         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
3293             New case handled for entry->hasReachedPrevalentResourceAgeCap().
3294         (WebKit::NetworkResourceLoader::validateCacheEntryForMaxAgeCapValidation):
3295             This is where the new logic compares the incoming redirect with the
3296             cached one. If they match, an uncapped entry is allowed to be stored.
3297             If they don't match, a new capped entry will be stored.
3298         (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
3299             Now calls the new
3300             NetworkResourceLoader::validateCacheEntryForMaxAgeCapValidation()
3301             function.
3302         * NetworkProcess/NetworkResourceLoader.h:
3303             Added the m_cacheEntryForMaxAgeCapValidation member.
3304         * NetworkProcess/cache/NetworkCache.cpp:
3305         (WebKit::NetworkCache::makeUseDecision):
3306             Restored to previous behavior which means
3307             UseDecision::NoDueToPrevalentResourceAgeCap was removed.
3308         (WebKit::NetworkCache::Cache::retrieve):
3309             Restored to previous behavior.
3310         (WebKit::NetworkCache::Cache::storeRedirect):
3311             Now takes the optional maxAgeCap and caps the entry's max age if it's set.
3312         (WebKit::NetworkCache::hasReachedPrevalentResourceAgeCap): Deleted.
3313         * NetworkProcess/cache/NetworkCache.h:
3314         * NetworkProcess/cache/NetworkCacheEntry.cpp:
3315         (WebKit::NetworkCache::Entry::encodeAsStorageRecord const):
3316             Now encodes m_maxAgeCap.
3317         (WebKit::NetworkCache::Entry::decodeStorageRecord):
3318             Now decodes m_maxAgeCap.
3319         (WebKit::NetworkCache::Entry::hasReachedPrevalentResourceAgeCap const):
3320             Added.
3321         (WebKit::NetworkCache::Entry::capMaxAge):
3322             Added.
3323         * NetworkProcess/cache/NetworkCacheEntry.h:
3324             Added the optional m_maxAgeCap.
3325         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
3326         (WebKit::NetworkCache::SpeculativeLoad::willSendRedirectedRequest):
3327             Now gets the optional max age cap from the NetworkStorageSession and sends it
3328             to Cache::storeRedirect().
3329         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
3330         (WebKit::NetworkCache::cachedEntryReuseFailureToDiagnosticKey):
3331             Removed handling of UseDecision::NoDueToPrevalentResourceAgeCap.
3332
3333 2018-11-06  Per Arne Vollan  <pvollan@apple.com>
3334
3335         REGRESSION (r230523): Caps lock indicator not shown in password field
3336         https://bugs.webkit.org/show_bug.cgi?id=190056
3337
3338         Reviewed by Ryosuke Niwa.
3339
3340         Update cached modifier state in the WebProcess when WebKit::WebPage::keyEvent is called, and
3341         when the window becomes active.
3342
3343         * UIProcess/WebPageProxy.cpp:
3344         (WebKit::WebPageProxy::dispatchActivityStateChange):
3345         (WebKit::WebPageProxy::updateCurrentModifierState):
3346         * UIProcess/WebPageProxy.h:
3347         * WebProcess/WebPage/WebPage.cpp:
3348         (WebKit::WebPage::keyEvent):
3349         (WebKit::WebPage::updateCurrentModifierState):
3350         * WebProcess/WebPage/WebPage.h:
3351         * WebProcess/WebPage/WebPage.messages.in:
3352
3353 2018-11-06  Alex Christensen  <achristensen@webkit.org>
3354
3355         Add ObjC SPI equivalent of WKContextHandlesSafeBrowsing
3356         https://bugs.webkit.org/show_bug.cgi?id=191329
3357
3358         Reviewed by Tim Horton.
3359
3360         Like WKContextHandlesSafeBrowsing, this is so I can make one change in WebKit and enable safe browsing
3361         in WKWebView and disable it in Safari at the same time without broken revisions between landing two changes
3362         in two repositories.
3363
3364         * UIProcess/API/Cocoa/WKWebView.mm:
3365         (+[WKWebView handlesSafeBrowsing]):
3366         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3367
3368 2018-11-06  Eric Carlson  <eric.carlson@apple.com>
3369
3370         [MediaStream] User should not be prompted again after denying getDisplayMedia request
3371         https://bugs.webkit.org/show_bug.cgi?id=191227
3372         <rdar://problem/45784512>
3373
3374         Reviewed by Youenn Fablet.
3375
3376         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
3377         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied):
3378         (WebKit::UserMediaPermissionRequestManagerProxy::wasRequestDenied):
3379         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
3380         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
3381
3382 2018-11-06  Fujii Hironori  <Hironori.Fujii@sony.com>
3383
3384         [MediaStream] User should not be prompted again after denying getDisplayMedia request
3385         https://bugs.webkit.org/show_bug.cgi?id=191227
3386         <rdar://problem/45784512>
3387
3388         Unreviewed build fix of ports not ENABLE(MEDIA_STREAM).
3389
3390         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: Define getRequestAction only if ENABLE(MEDIA_STREAM).
3391         * UIProcess/UserMediaPermissionRequestManagerProxy.h: Ditto.
3392
3393 2018-11-03  Alex Christensen  <achristensen@webkit.org>
3394
3395         [Mac] Implement safe browsing in WebKit
3396         https://bugs.webkit.org/show_bug.cgi?id=188871
3397