95b080b506a51565f375a5476db1771d8409f4cc
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-11-16  Thibault Saunier  <tsaunier@igalia.com>
2
3         [GTK][WPE] Add "WebKitDeviceInfoPermissionRequest.h" into webkit2.h
4         https://bugs.webkit.org/show_bug.cgi?id=191744
5
6         It should always have been there.
7
8         Reviewed by Carlos Garcia Campos.
9
10         * UIProcess/API/gtk/webkit2.h:
11
12 2018-11-16  Antoine Quint  <graouts@apple.com>
13
14         PointerEvents should not require touch event listeners to be registered
15         https://bugs.webkit.org/show_bug.cgi?id=191333
16         <rdar://problem/45857523>
17
18         Reviewed by Dean Jackson.
19
20         * UIProcess/WebPageProxy.cpp:
21         (WebKit::WebPageProxy::updateTouchEventTracking):
22         (WebKit::WebPageProxy::touchEventTrackingType const):
23         (WebKit::WebPageProxy::handleTouchEventSynchronously):
24         (WebKit::WebPageProxy::handleTouchEventAsynchronously):
25         (WebKit::WebPageProxy::handleTouchEvent):
26         (WebKit::WebPageProxy::resetState):
27         * UIProcess/WebPageProxy.h:
28
29 2018-11-15  Myles C. Maxfield  <mmaxfield@apple.com>
30
31         WKPreferencesSetFontSmoothingLevel doesn't actually do anything
32         https://bugs.webkit.org/show_bug.cgi?id=191708
33
34         Reviewed by Simon Fraser.
35
36         Delete the symbol because no one calls it and it doesn't do anything
37
38         * Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb:
39         * Shared/FontSmoothingLevel.h: Removed.
40         * Shared/WebPreferences.yaml:
41         * UIProcess/API/C/WKAPICast.h:
42         (WebKit::toFontSmoothingLevel): Deleted.
43         * UIProcess/API/C/WKPreferences.cpp:
44         (WKPreferencesSetFontSmoothingLevel): Deleted.
45         (WKPreferencesGetFontSmoothingLevel): Deleted.
46         * UIProcess/API/C/WKPreferencesRefPrivate.h:
47         * UIProcess/WebPreferences.h:
48         * WebKit.xcodeproj/project.pbxproj:
49         * mac/WebKit2.order:
50
51 2018-11-15  Truitt Savell  <tsavell@apple.com>
52
53         Unreviewed, rolling out r238244.
54
55         Caused High Sierra test runs to fail early with 50 crashes and
56         casued 25 API failures.
57
58         Reverted changeset:
59
60         "[css-logical] Implement flow-relative margin, padding and
61         border shorthands"
62         https://bugs.webkit.org/show_bug.cgi?id=188697
63         https://trac.webkit.org/changeset/238244
64
65 2018-11-15  Joseph Pecoraro  <pecoraro@apple.com>
66
67         Web Inspector: Remove unused WebInspectorProxy code
68         https://bugs.webkit.org/show_bug.cgi?id=191674
69
70         Reviewed by Dean Jackson.
71
72         * UIProcess/WebInspectorProxy.cpp:
73         (WebKit::WebInspectorProxy::createInspectorPage):
74         (WebKit::WebInspectorProxy::closeFrontendPageAndWindow):
75         * UIProcess/WebInspectorProxy.h:
76         * UIProcess/mac/WebInspectorProxyMac.mm:
77         (WebKit::WebInspectorProxy::setInspectorWindowFrame): Deleted.
78         (WebKit::WebInspectorProxy::inspectorWindowFrame): Deleted.
79         * WebProcess/WebPage/WebInspector.h:
80
81 2018-11-15  Ryosuke Niwa  <rniwa@webkit.org>
82
83         Enable process swap on cross-site navigation by default on macOS
84         https://bugs.webkit.org/show_bug.cgi?id=191572
85
86         Reviewed by Chris Dumez.
87
88         Enabled the feature by default on macOS.
89
90         * Shared/WebPreferences.yaml:
91         * Shared/WebPreferencesDefaultValues.h:
92
93 2018-11-15  Chris Dumez  <cdumez@apple.com>
94
95         IndexedDB.IndexedDBTempFileSize API test times out with process prewarming enabled
96         https://bugs.webkit.org/show_bug.cgi?id=191671
97         <rdar://problem/46086062>
98
99         Reviewed by Alex Christensen.
100
101         Enabling process prewarming caused IndexedDB.IndexedDBTempFileSize API to time out and print
102         the following line:
103         "Attempted to create a NetworkLoad with a session (id=2) that does not exist."
104
105         This actually identified a pre-existing bug with our handling of non-default data store.
106         Whenever a page starts using a data store, we call WebProcessPool::pageBeginUsingWebsiteDataStore()
107         which will call NetworkProcessProxy::addSession() if the network process was already started
108         to let the network process know about this non-default session. There are several issues with the
109         current model:
110         1. If the network process was not created yet when pageBeginUsingWebsiteDataStore() is called,
111            then the network process will not know about the non-default session when it actually gets
112            started later on. This is unlikely to happen in practice, except in case of network process
113            crash because we create the network process as soon as we initialize the first WebProcessProxy.
114         2. Even if we successfuly managed to register the session with the network process proxy, we get
115            in trouble if the network process crashes or is terminated later on as we do not re-register
116            those sessions with the new network process.
117
118         To address these 2 issues, WebProcessPool::ensureNetworkProcess() now takes care of registering
119         all the non-default sessions (that are associated with this process pool) with the new network
120         process. The WebProcessPool knows about these sessions because it adds them to m_sessionToPagesMap
121         whenever WebProcessPool::pageBeginUsingWebsiteDataStore() is called, even if the network process
122         proxy was not created yet.
123
124         The reason the IndexedDB.IndexedDBTempFileSize API test was failing was because it did:
125         1. A load in a WebView V1 with a non-default session
126         2. Process prewarming kicked in after this load and would create a new WebProcessProxy.
127         3. Terminate the network process
128         4. Another load in a WebView V2 with the same non-defaut session, which would reuse the
129           prewarmed process. Because the network process was terminated, constructing the new
130           page would not register the session ID with the new network process when
131           pageBeginUsingWebsiteDataStore() is called.
132         -> The load would hang because the new network process would not know about the
133            non-default session when started later on.
134
135         The bug was previously hidden without process prewarming because step 4 would create a *new*
136         WebProcessProxy and WebProcessPool::initializeNewWebProcess() would call ensureNetworkProcess()
137         so that pageBeginUsingWebsiteDataStore() would successfuly register the session with the
138         network process later on.
139
140         I wrote a second API test (WebKit.DoLoadWithNonDefaultDataStoreAfterTerminatingNetworkProcess)
141         to demonstrate the pre-existing bug without process prewarming enabled.
142
143         * UIProcess/WebProcessPool.cpp:
144         (WebKit::WebProcessPool::ensureNetworkProcess):
145
146 2018-11-15  Vivek Seth  <v_seth@apple.com>
147
148         Create feature flag (HTTPS_UPGRADE)
149         https://bugs.webkit.org/show_bug.cgi?id=191613
150         <rdar://problem/45851068>
151
152         Reviewed by Dean Jackson.
153
154         * config.h:
155
156 2018-11-15  Chris Dumez  <cdumez@apple.com>
157
158         Regression(r238215) WKProcessPool.WarmInitialProcess API test is failing
159         https://bugs.webkit.org/show_bug.cgi?id=191693
160
161         Reviewed by Alex Christensen.
162
163         Allow *explicit* process prewarming to construct the default data store if necessary or we would
164         not be obeying the client's request. Only automatic process prewarming should avoid constructing
165         the default data store unnecessarily to avoid causing memory regressions.
166
167         * UIProcess/API/C/WKContext.cpp:
168         (WKContextWarmInitialProcess):
169         * UIProcess/API/Cocoa/WKProcessPool.mm:
170         (-[WKProcessPool _warmInitialProcess]):
171         * UIProcess/WebProcessPool.cpp:
172         (WebKit::WebProcessPool::prewarmProcess):
173         (WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
174         * UIProcess/WebProcessPool.h:
175         (WebKit::WebProcessPool::sendToOneProcess):
176
177 2018-11-14  Jiewen Tan  <jiewen_tan@apple.com>
178
179         Unreviewed, comment improvement over r238166.
180
181         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
182         (WKWebsiteDataStoreSetWebAuthenticationMockConfiguration):
183         * UIProcess/WebAuthentication/fido/CtapHidAuthenticator.h:
184
185 2018-11-15  Jiewen Tan  <jiewen_tan@apple.com>
186
187         [WebAuthN] Use a real nonce for CTAPHID_INIT
188         https://bugs.webkit.org/show_bug.cgi?id=191533
189         <rdar://problem/46103502>
190
191         Reviewed by Brent Fulgham.
192
193         Use a real nonce for CTAPHID_INIT request according to:
194         https://fidoalliance.org/specs/fido-v2.0-ps-20170927/fido-client-to-authenticator-protocol-v2.0-ps-20170927.html#ctaphid_init-0x06.
195         The challenge here is the new transaction needs to start in the next runloop otherwise a dead lock will form:
196         wrong nonce -> new transaction -> new nonce -> write init request -> read init response from last run as it
197         piped in the run loop -> wrong nonce of course -> ...
198         To break the above dead lock, we have to start the new transaction in the next run. However, that isn't
199         sufficient as the arrived init response will be piped in HidConnection::m_inputReports, which is designed
200         on purpose to store any data packets within (initialized, terminated) time interval to prevent data loss in
201         the case when HidConnection::registerDataReceivedCallback is called after the first data packet's arrival.
202         In order to break the dead lock completely, HidConnection::invalidateCache will bnnne called prior to every
203         send to delete any potential init response from last run. HidConnection::invalidateCache is not necessary
204         for other protocols though. The above scenario is more or less a design flaw in CTAP HID.
205
206         Of course, all above scenarios are covered in our mock tests.
207
208         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
209         (WKWebsiteDataStoreSetWebAuthenticationMockConfiguration):
210         * UIProcess/WebAuthentication/Cocoa/HidConnection.h:
211         (WebKit::HidConnection::invalidateCache):
212         * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
213         (WebKit::MockHidConnection::send):
214         (WebKit::MockHidConnection::parseRequest):
215         (WebKit::MockHidConnection::feedReports):
216         * UIProcess/WebAuthentication/Mock/MockHidConnection.h:
217         * UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h:
218         * UIProcess/WebAuthentication/fido/CtapHidDriver.cpp:
219         (WebKit::CtapHidDriver::Worker::transact):
220         (WebKit::CtapHidDriver::CtapHidDriver):
221         (WebKit::CtapHidDriver::transact):
222         (WebKit::CtapHidDriver::continueAfterChannelAllocated):
223         (WebKit::CtapHidDriver::returnResponse):
224         * UIProcess/WebAuthentication/fido/CtapHidDriver.h:
225
226 2018-11-15  Oriol Brufau  <obrufau@igalia.com>
227
228         [css-logical] Implement flow-relative margin, padding and border shorthands
229         https://bugs.webkit.org/show_bug.cgi?id=188697
230
231         Reviewed by Simon Fraser and Antti Koivisto.
232
233         Add a CSSLogicalEnabled runtime flag.
234
235         * Shared/WebPreferences.yaml:
236
237 2018-11-15  Jiewen Tan  <jiewen_tan@apple.com>
238
239         [WebAuthN] PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::AuthenticatorAttachment should be optional
240         https://bugs.webkit.org/show_bug.cgi?id=191522
241
242         Reviewed by Brent Fulgham.
243
244         * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
245         (WebKit::AuthenticatorManagerInternal::collectTransports):
246
247 2018-11-15  Michael Catanzaro  <mcatanzaro@igalia.com>
248
249         [SOUP] Make Accept-Languages header look more like other browsers
250         https://bugs.webkit.org/show_bug.cgi?id=191614
251
252         Reviewed by Carlos Garcia Campos.
253
254         This changes our Accept-Language header to better match other browsers, from something
255         like this:
256
257         Accept-Language: en-us, en;q=0.90, es-es;q=0.80, es;q=0.70
258
259         to something like this:
260
261         Accept-Language: en-US,en;q=0.90,es-ES;q=0.80,es;q=0.70
262
263         There's no particular motivation for this change. I just noticed we were different for no
264         clear reason.
265
266         * NetworkProcess/soup/NetworkProcessSoup.cpp:
267         (WebKit::buildAcceptLanguages):
268         * UIProcess/API/glib/WebKitWebContext.cpp:
269         (webkit_web_context_set_preferred_languages):
270
271 2018-11-15  Daniel Bates  <dabates@apple.com>
272
273         [iOS] Shift + Tab does not focus previous field
274         https://bugs.webkit.org/show_bug.cgi?id=191596
275         <rdar://problem/45892053>
276
277         Reviewed by Wenson Hsieh.
278
279         Wire up the the tab and shift + tab key commands to the WKWebView/WKContentView's
280         action forwarding mechanism. Also rename -_prevAccessoryTab to -_previousAccessoryTab.
281
282         * Platform/spi/ios/UIKitSPI.h: Add more SPI.
283         * UIProcess/API/Cocoa/WKWebViewInternal.h:
284         * UIProcess/ios/WKContentViewInteraction.h:
285         * UIProcess/ios/WKContentViewInteraction.mm:
286         (-[WKContentView canPerformActionForWebView:withSender:]):
287         (-[WKContentView keyCommands]):
288         (-[WKContentView _nextAccessoryTabForWebView:]): Added.
289         (-[WKContentView _previousAccessoryTabForWebView:]): Added.
290         (-[WKContentView _nextAccessoryTab:]): Deleted.
291         (-[WKContentView _prevAccessoryTab:]): Deleted.
292
293 2018-11-15  Keith Rollin  <krollin@apple.com>
294
295         Delete old .xcfilelist files
296         https://bugs.webkit.org/show_bug.cgi?id=191669
297         <rdar://problem/46081994>
298
299         Reviewed by Chris Dumez.
300
301         .xcfilelist files were created and added to the Xcode project files in
302         https://trac.webkit.org/changeset/238008/webkit. However, they caused
303         build issues and they were removed from the Xcode projects in
304         https://trac.webkit.org/changeset/238055/webkit. This check-in removes
305         the files from the repository altogether. They'll ultimately be
306         replaced with new files with names that indicate whether the
307         associated files are inputs to the Run Script phase or are files
308         created by the Run Script phase.
309
310         * DerivedSources.xcfilelist: Removed.
311         * UnifiedSources.xcfilelist: Removed.
312
313 2018-11-15  Frederic Wang  <fwang@igalia.com>
314
315         [WebAuthN] Make AuthenticatorManager
316         https://bugs.webkit.org/show_bug.cgi?id=189279
317
318         Unreviewed build fix.
319
320         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm: Add missing header.
321         * UIProcess/WebAuthentication/Cocoa/LocalConnection.mm: Ditto.
322         * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp: Ditto.
323
324 2018-11-14  Keith Rollin  <krollin@apple.com>
325
326         Move scripts for Derived and Unified Sources to external files
327         https://bugs.webkit.org/show_bug.cgi?id=191670
328         <rdar://problem/46082278>
329
330         Reviewed by Keith Miller.
331
332         Move the scripts in the Generate Derived Sources and Generate Unified
333         Sources Run Script phases from the Xcode projects to external shell
334         script files. Then invoke those scripts from the Run Script phases.
335         This refactoring is being performed to support later work that will
336         invoke these scripts in other contexts.
337
338         The scripts were maintained as-is when making the move. I did a little
339         reformatting and added 'set -e' to the top of each file, but that's
340         it.
341
342         * Scripts/generate-derived-sources.sh: Added.
343         * Scripts/generate-unified-sources.sh: Added.
344         * WebKit.xcodeproj/project.pbxproj:
345
346 2018-11-14  Chris Dumez  <cdumez@apple.com>
347
348         WebKit.DecidePolicyForNavigationActionForHyperlinkThatRedirects API fails when PSON is enabled
349         https://bugs.webkit.org/show_bug.cgi?id=191640
350
351         Reviewed by Alex Christensen.
352
353         The issue was that when process-swapping on a redirect, the parameters provided by the new
354         WebContent process for navigationActionData / originatingFrameInfoData / frameSecurityOrigin
355         are not correct because it does not have sufficient information (it does not know a swap
356         happened).
357
358         To address the issue, we now store the navigationActionData / originatingFrameInfoData /
359         frameSecurityOrigin on the Navigation object whenever decidePolicyForNavigationAction is
360         called. If the decidePolicyForNavigationAction is for a redirect, use the ones we stored
361         on the Navigation object instead of the ones provided by the WebContent process. In case
362         of redirect, those do not change anyway.
363
364         This fixes all WebKit.DecidePolicyForNavigationAction* tests with PSON enabled.
365
366         * UIProcess/API/APINavigation.h:
367         (API::Navigation::currentRequestIsRedirect const):
368         (API::Navigation::wasUserInitiated const):
369         (API::Navigation::shouldForceDownload const):
370         (API::Navigation::treatAsSameOriginNavigation const):
371         (API::Navigation::hasOpenedFrames const):
372         (API::Navigation::openedViaWindowOpenWithOpener const):
373         (API::Navigation::opener const):
374         (API::Navigation::requesterOrigin const):
375         (API::Navigation::lockHistory const):
376         (API::Navigation::lockBackForwardList const):
377         (API::Navigation::clientRedirectSourceForHistory const):
378         (API::Navigation::setLastNavigationAction):
379         (API::Navigation::lastNavigationAction const):
380         (API::Navigation::setOriginatingFrameInfo):
381         (API::Navigation::originatingFrameInfo const):
382         (API::Navigation::setDestinationFrameSecurityOrigin):
383         (API::Navigation::destinationFrameSecurityOrigin const):
384         * UIProcess/WebPageProxy.cpp:
385         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
386         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
387         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
388         * UIProcess/WebPageProxy.h:
389
390 2018-11-14  Chris Dumez  <cdumez@apple.com>
391
392         WebKit.WebsiteDataStoreCustomPaths API test is failing when enabling process prewarming
393         https://bugs.webkit.org/show_bug.cgi?id=191638
394
395         Reviewed by Alex Christensen.
396
397         WebProcessPool::prewarmProcess() should not create the default WebSite Data Store if it
398         does not exist yet. This is bad for memory consumption and it is what was causing this
399         API test to fail.
400
401         WebProcessPool::prewarmProcess() now tries to use the following data stores in this
402         order of preference:
403         1. WebProcessPool::m_websiteDataStore (aka this process pool's primary data store)
404         2. The data store of the last WebProcessProxy that was created
405         3. The default data store if it exists
406
407         If no suitable data store is found, we cancel the process prewarming and log a console
408         message instead.
409
410         * UIProcess/WebProcessPool.cpp:
411         (WebKit::WebProcessPool::prewarmProcess):
412
413 2018-11-14  Timothy Hatcher  <timothy@apple.com>
414
415         Enabled dark mode CSS support by default.
416         https://bugs.webkit.org/show_bug.cgi?id=191609
417         rdar://problem/46046861
418
419         Reviewed by Megan Gardner.
420
421         * Shared/WebPreferences.yaml: Set DarkModeCSSEnabled's defaultValue to true.
422
423 2018-11-14  Timothy Hatcher  <timothy@apple.com>
424
425         Default the view background color and text color to different values when in dark mode.
426         https://bugs.webkit.org/show_bug.cgi?id=191607
427         rdar://problem/46045854
428
429         Reviewed by Dean Jackson.
430
431         * UIProcess/Cocoa/WebViewImpl.mm:
432         (WebKit::WebViewImpl::backgroundColor const): Use controlBackgroundColor.
433         (WebKit::WebViewImpl::updateLayer): Simplified and use backgroundColor() getter.
434         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
435         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): Drop backgroundColor.
436         * WebProcess/WebPage/WebPage.cpp:
437         (WebKit::WebPage::setDrawsBackground): Drop backgroundColor.
438
439 2018-11-14  Joseph Pecoraro  <pecoraro@apple.com>
440
441         Web Inspector: Pass Inspector::FrontendChannel as a reference connect/disconnect methods
442         https://bugs.webkit.org/show_bug.cgi?id=191612
443
444         Reviewed by Matt Baker.
445
446         * UIProcess/Automation/WebAutomationSession.cpp:
447         (WebKit::WebAutomationSession::connect):
448         (WebKit::WebAutomationSession::disconnect):
449         (WebKit::WebAutomationSession::terminate):
450         * UIProcess/Automation/WebAutomationSession.h:
451         * UIProcess/WebPageDebuggable.cpp:
452         (WebKit::WebPageDebuggable::connect):
453         (WebKit::WebPageDebuggable::disconnect):
454         * UIProcess/WebPageDebuggable.h:
455         * UIProcess/WebPageInspectorController.cpp:
456         (WebKit::WebPageInspectorController::connectFrontend):
457         (WebKit::WebPageInspectorController::disconnectFrontend):
458         * UIProcess/WebPageInspectorController.h:
459         * WebProcess/WebPage/WebInspector.cpp:
460         (WebKit::WebInspector::close):
461         * WebProcess/WebPage/WebPageInspectorTarget.cpp:
462         (WebKit::WebPageInspectorTarget::connect):
463         (WebKit::WebPageInspectorTarget::disconnect):
464
465 2018-11-14  Joseph Pecoraro  <pecoraro@apple.com>
466
467         Unreviewed attempted wincairo build fix after 238192.
468
469         * WebProcess/WebPage/WebPageInspectorTargetController.h:
470         * WebProcess/WebPage/WebPageInspectorTargetFrontendChannel.cpp:
471
472 2018-11-14  Joseph Pecoraro  <pecoraro@apple.com>
473
474         Web Inspector: Follow-up: Keep Disabling Process Swap for Local Web Inspector
475         https://bugs.webkit.org/show_bug.cgi?id=191494
476         <rdar://problem/45469854>
477
478         Reviewed by Devin Rousso.
479
480         Continue to have the Local Inspector disable PSON while open
481         until support is added.
482
483         * UIProcess/WebPageProxy.cpp:
484         (WebKit::WebPageProxy::resetState):
485         * UIProcess/WebPageProxy.h:
486         (WebKit::WebPageProxy::hasLocalInspectorFrontend const):
487         (WebKit::WebPageProxy::setHasLocalInspectorFrontend):
488         * UIProcess/WebPageProxy.messages.in:
489         * UIProcess/WebProcessPool.cpp:
490         (WebKit::WebProcessPool::processForNavigationInternal):
491         * WebProcess/WebPage/WebInspector.cpp:
492         (WebKit::WebInspector::openFrontendConnection):
493         (WebKit::WebInspector::closeFrontendConnection):
494         * WebProcess/WebPage/WebPage.cpp:
495         (WebKit::WebPage::setHasLocalInspectorFrontend):
496         * WebProcess/WebPage/WebPage.h:
497
498 2018-11-14  Joseph Pecoraro  <pecoraro@apple.com>
499
500         Web Inspector: Keep Web Inspector window alive across process swaps (PSON) (Remote Inspector)
501         https://bugs.webkit.org/show_bug.cgi?id=191494
502         <rdar://problem/45469854>
503
504         Reviewed by Devin Rousso.
505
506         To support process swapping a slim Web Inspector backend lives in the UIProcess.
507         The Web Inspector frontend connects to it and is told about sub-targets, namely
508         pages, that it can further connect to. When performing a process swap the backend
509         tells the frontend to destroy existing targets and create new targets.
510
511         In the UIProcess the WebPageProxy has a WebPageInspectorController, with a single
512         TargetAgent holding InspectorTargetProxies to targets it knows about. Inspector
513         protocol messages go through this inspector controller and are routed to the
514         WebPage and its WebCore::Page's InspectorController. The WebPageProxy decides
515         when to close and expose new page targets during process swap, or basically
516         any time it reconnects to a WebProcess. So this patch also makes Web Inspector
517         stay alive and reconnect to a page when the inspected page crashes!
518
519         In the WebContentProcess the WebPage has a WebPageInspectorTarget. It also
520         has a WebPageInspectorTargetController in anticipation of further sub-targets
521         within the page (workers, frames) but none exist at the moment. The WebPage
522         relies on the WebPageProxy to know when to expose this target as a debuggable.
523
524         * Sources.txt:
525         * WebKit.xcodeproj/project.pbxproj:
526         New files.
527
528         * Shared/WebPageCreationParameters.cpp:
529         (WebKit::WebPageCreationParameters::encode const):
530         (WebKit::WebPageCreationParameters::decode):
531         * Shared/WebPageCreationParameters.h:
532         Remote inspector state can now stay in the UIProcess and does not need to
533         be passed down to the WebContentProcess.
534
535         * UIProcess/WebPageDebuggable.cpp: Copied from Source/WebCore/page/PageDebuggable.cpp.
536         (WebKit::WebPageDebuggable::WebPageDebuggable):
537         (WebKit::WebPageDebuggable::name const):
538         (WebKit::WebPageDebuggable::url const):
539         (WebKit::WebPageDebuggable::hasLocalDebugger const):
540         (WebKit::WebPageDebuggable::connect):
541         (WebKit::WebPageDebuggable::disconnect):
542         (WebKit::WebPageDebuggable::dispatchMessageFromRemote):
543         (WebKit::WebPageDebuggable::setIndicating):
544         (WebKit::WebPageDebuggable::setNameOverride):
545         * UIProcess/WebPageDebuggable.h: Copied from Source/WebCore/page/PageDebuggable.h.
546         Remote debuggable entry point into the UIProcess for a page.
547         This is pretty much identical to the PageDebuggable in WebCore.
548
549         * Scripts/webkit/messages.py:
550         * UIProcess/WebPageProxy.messages.in:
551         * UIProcess/WebPageProxy.cpp:
552         (WebKit::m_resetRecentCrashCountTimer):
553         (WebKit::WebPageProxy::finishAttachingToWebProcess):
554         (WebKit::WebPageProxy::close):
555         (WebKit::WebPageProxy::createInspectorTarget):
556         (WebKit::WebPageProxy::destroyInspectorTarget):
557         (WebKit::WebPageProxy::sendMessageToInspectorFrontend):
558         (WebKit::WebPageProxy::setIndicating):
559         (WebKit::WebPageProxy::allowsRemoteInspection const):
560         (WebKit::WebPageProxy::setAllowsRemoteInspection):
561         (WebKit::WebPageProxy::remoteInspectionNameOverride const):
562         (WebKit::WebPageProxy::setRemoteInspectionNameOverride):
563         (WebKit::WebPageProxy::remoteInspectorInformationDidChange):
564         (WebKit::WebPageProxy::clearInspectorTargets):
565         (WebKit::WebPageProxy::createInspectorTargets):
566         (WebKit::WebPageProxy::didCommitLoadForFrame):
567         (WebKit::WebPageProxy::didReceiveTitleForFrame):
568         (WebKit::WebPageProxy::creationParameters):
569         * UIProcess/WebPageProxy.h:
570         (WebKit::WebPageProxy::inspectorController):
571         (WebKit::WebPageProxy::allowsRemoteInspection const): Deleted.
572         (WebKit::WebPageProxy::remoteInspectionNameOverride const): Deleted.
573         Own more inspector state in the UIProcess including a debuggable and inspector controller.
574
575         * UIProcess/WebPageInspectorController.h: Added.
576         * UIProcess/WebPageInspectorController.cpp: Added.
577         (WebKit::WebPageInspectorController::WebPageInspectorController):
578         (WebKit::WebPageInspectorController::pageClosed):
579         (WebKit::WebPageInspectorController::hasLocalFrontend const):
580         (WebKit::WebPageInspectorController::hasRemoteFrontend const):
581         (WebKit::WebPageInspectorController::connectFrontend):
582         (WebKit::WebPageInspectorController::disconnectFrontend):
583         (WebKit::WebPageInspectorController::disconnectAllFrontends):
584         (WebKit::WebPageInspectorController::dispatchMessageFromFrontend):
585         (WebKit::WebPageInspectorController::setIndicating):
586         (WebKit::WebPageInspectorController::clearTargets):
587         (WebKit::WebPageInspectorController::createInspectorTarget):
588         (WebKit::WebPageInspectorController::destroyInspectorTarget):
589         (WebKit::WebPageInspectorController::sendMessageToInspectorFrontend):
590         InspectorController with a single TargetAgent in the UIProcess.
591
592         * UIProcess/WebPageInspectorTargetAgent.h:
593         * UIProcess/WebPageInspectorTargetAgent.cpp:
594         (WebKit::WebPageInspectorTargetAgent::WebPageInspectorTargetAgent):
595         (WebKit::WebPageInspectorTargetAgent::frontendChannel):
596         Target agent implementation.
597
598         * UIProcess/InspectorTargetProxy.cpp:
599         (WebKit::InspectorTargetProxy::create):
600         (WebKit::InspectorTargetProxy::InspectorTargetProxy):
601         (WebKit::InspectorTargetProxy::connect):
602         (WebKit::InspectorTargetProxy::disconnect):
603         (WebKit::InspectorTargetProxy::sendMessageToTargetBackend):
604         * UIProcess/InspectorTargetProxy.h:
605         UIProcess proxy for an InspectorTarget in the WebContentProcess.
606
607         * UIProcess/WebProcessPool.cpp:
608         (WebKit::WebProcessPool::processForNavigationInternal):
609
610         * WebProcess/WebPage/WebPage.cpp:
611         (WebKit::m_shouldAttachDrawingAreaOnPageTransition):
612         (WebKit::WebPage::connectInspector):
613         (WebKit::WebPage::disconnectInspector):
614         (WebKit::WebPage::sendMessageToTargetBackend):
615         (WebKit::WebPage::setIndicating):
616         (WebKit::WebPage::setAllowsRemoteInspection): Deleted.
617         (WebKit::WebPage::setRemoteInspectionNameOverride): Deleted.
618         * WebProcess/WebPage/WebPage.h:
619         * WebProcess/WebPage/WebPage.messages.in:
620
621         * WebProcess/WebPage/WebPageInspectorTarget.h:
622         * WebProcess/WebPage/WebPageInspectorTarget.cpp:
623         (WebKit::WebPageInspectorTarget::WebPageInspectorTarget):
624         (WebKit::WebPageInspectorTarget::identifier const):
625         (WebKit::WebPageInspectorTarget::connect):
626         (WebKit::WebPageInspectorTarget::disconnect):
627         (WebKit::WebPageInspectorTarget::sendMessageToTargetBackend):
628         InspectorTarget for this WebPage.
629
630         * WebProcess/WebPage/WebPageInspectorTargetController.cpp: Added.
631         (WebKit::WebPageInspectorTargetController::WebPageInspectorTargetController):
632         (WebKit::WebPageInspectorTargetController::~WebPageInspectorTargetController):
633         (WebKit::WebPageInspectorTargetController::addTarget):
634         (WebKit::WebPageInspectorTargetController::removeTarget):
635         (WebKit::WebPageInspectorTargetController::connectInspector):
636         (WebKit::WebPageInspectorTargetController::disconnectInspector):
637         (WebKit::WebPageInspectorTargetController::sendMessageToTargetBackend):
638         (WebKit::WebPageInspectorTargetController::sendMessageToTargetFrontend):
639         * WebProcess/WebPage/WebPageInspectorTargetController.h:
640         * WebProcess/WebPage/WebPageInspectorTargetFrontendChannel.h:
641         * WebProcess/WebPage/WebPageInspectorTargetFrontendChannel.cpp:
642         (WebKit::WebPageInspectorTargetFrontendChannel::create):
643         (WebKit::WebPageInspectorTargetFrontendChannel::WebPageInspectorTargetFrontendChannel):
644         (WebKit::WebPageInspectorTargetFrontendChannel::sendMessageToFrontend):
645         Preparation for more target managment in the WebContentProcess.
646
647 2018-11-14  Alex Christensen  <achristensen@webkit.org>
648
649         Add SPI to show a safe browsing warning
650         https://bugs.webkit.org/show_bug.cgi?id=191604
651
652         Reviewed by Andy Estes.
653
654         Safari has a case where it shows safe browsing warnings for a reason other than being told to by the SafeBrowsing framework.
655         Because safe browsing is moving to WebKit, we will have Safari call this WebKit SPI in that case.
656         The warning looks a little different, so I had to change the structure of a SafeBrowsingResult and the location of the string processing,
657         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.
658
659         * SourcesCocoa.txt:
660         * UIProcess/API/Cocoa/WKWebView.mm:
661         (-[WKWebView _showSafeBrowsingWarningWithTitle:warning:details:completionHandler:]):
662         (-[WKWebView _showSafeBrowsingWarning:completionHandler:]):
663         (+[WKWebView _confirmMalwareSentinel]):
664         (+[WKWebView _visitUnsafeWebsiteSentinel]):
665         * UIProcess/API/Cocoa/WKWebViewInternal.h:
666         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
667         * UIProcess/Cocoa/SafeBrowsingResultCocoa.mm: Removed.
668         * UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm: Copied from Source/WebKit/UIProcess/Cocoa/SafeBrowsingResultCocoa.mm.
669         (WebKit::malwareDetailsBase):
670         (WebKit::learnMoreURL):
671         (WebKit::reportAnErrorBase):
672         (WebKit::localizedProvider):
673         (WebKit::SafeBrowsingWarning::visitUnsafeWebsiteSentinel):
674         (WebKit::SafeBrowsingWarning::confirmMalwareSentinel):
675         (WebKit::replace):
676         (WebKit::addLinkAndReplace):
677         (WebKit::reportAnErrorURL):
678         (WebKit::malwareDetailsURL):
679         (WebKit::safeBrowsingTitleText):
680         (WebKit::safeBrowsingWarningText):
681         (WebKit::safeBrowsingDetailsText):
682         (WebKit::SafeBrowsingWarning::SafeBrowsingWarning):
683         (WebKit::learnMore): Deleted.
684         (WebKit::SafeBrowsingResult::SafeBrowsingResult): Deleted.
685         * UIProcess/Cocoa/WKSafeBrowsingWarning.h:
686         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
687         (-[WKSafeBrowsingWarning initWithFrame:safeBrowsingWarning:completionHandler:]):
688         (-[WKSafeBrowsingWarning addContent]):
689         (-[WKSafeBrowsingWarning showDetailsClicked]):
690         (-[WKSafeBrowsingWarning clickedOnLink:]):
691         (-[WKSafeBrowsingTextView initWithAttributedString:forWarning:]):
692         (confirmMalwareSentinel): Deleted.
693         (visitUnsafeWebsiteSentinel): Deleted.
694         (replace): Deleted.
695         (addLinkAndReplace): Deleted.
696         (reportAnErrorURL): Deleted.
697         (malwareDetailsURL): Deleted.
698         (titleText): Deleted.
699         (warningText): Deleted.
700         (detailsText): Deleted.
701         (-[WKSafeBrowsingWarning initWithFrame:safeBrowsingResult:completionHandler:]): Deleted.
702         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
703         (WebKit::WebPageProxy::beginSafeBrowsingCheck):
704         * UIProcess/Cocoa/WebViewImpl.h:
705         * UIProcess/Cocoa/WebViewImpl.mm:
706         (WebKit::WebViewImpl::showSafeBrowsingWarning):
707         * UIProcess/PageClient.h:
708         (WebKit::PageClient::showSafeBrowsingWarning):
709         * UIProcess/SafeBrowsingResult.h: Removed.
710         * UIProcess/SafeBrowsingWarning.h: Copied from Source/WebKit/UIProcess/SafeBrowsingResult.h.
711         (WebKit::SafeBrowsingWarning::create):
712         (WebKit::SafeBrowsingWarning::title const):
713         (WebKit::SafeBrowsingWarning::warning const):
714         (WebKit::SafeBrowsingWarning::details const):
715         (WebKit::SafeBrowsingResult::create): Deleted.
716         (WebKit::SafeBrowsingResult::isPhishing const): Deleted.
717         (WebKit::SafeBrowsingResult::isMalware const): Deleted.
718         (WebKit::SafeBrowsingResult::isUnwantedSoftware const): Deleted.
719         (WebKit::SafeBrowsingResult::url const): Deleted.
720         (WebKit::SafeBrowsingResult::provider const): Deleted.
721         (WebKit::SafeBrowsingResult::localizedProviderName const): Deleted.
722         (WebKit::SafeBrowsingResult::malwareDetailsURLBase const): Deleted.
723         (WebKit::SafeBrowsingResult::reportAnErrorURLBase const): Deleted.
724         (WebKit::SafeBrowsingResult::learnMoreURL const): Deleted.
725         (WebKit::SafeBrowsingResult::needsSafeBrowsingWarning const): Deleted.
726         (): Deleted.
727         * UIProcess/WebFramePolicyListenerProxy.cpp:
728         (WebKit::WebFramePolicyListenerProxy::didReceiveSafeBrowsingResults):
729         (WebKit::WebFramePolicyListenerProxy::use):
730         * UIProcess/WebFramePolicyListenerProxy.h:
731         * UIProcess/WebFrameProxy.cpp:
732         (WebKit::WebFrameProxy::WebFrameProxy):
733         (WebKit::WebFrameProxy::setUpPolicyListenerProxy):
734         (WebKit::WebFrameProxy::didHandleContentFilterUnblockNavigation):
735         * UIProcess/WebFrameProxy.h:
736         (WebKit::WebFrameProxy::create):
737         (WebKit::WebFrameProxy::page const):
738         * UIProcess/WebPageProxy.cpp:
739         (WebKit::WebPageProxy::swapToWebProcess):
740         (WebKit::WebPageProxy::didCreateMainFrame):
741         (WebKit::WebPageProxy::didCreateSubframe):
742         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
743         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
744         (WebKit::WebPageProxy::decidePolicyForResponse):
745         * UIProcess/ios/PageClientImplIOS.h:
746         * UIProcess/ios/PageClientImplIOS.mm:
747         (WebKit::PageClientImpl::showSafeBrowsingWarning):
748         * UIProcess/mac/PageClientImplMac.h:
749         * UIProcess/mac/PageClientImplMac.mm:
750         (WebKit::PageClientImpl::showSafeBrowsingWarning):
751         * UIProcess/mac/WebDataListSuggestionsDropdownMac.mm:
752         * WebKit.xcodeproj/project.pbxproj:
753
754 2018-11-14  Wenson Hsieh  <wenson_hsieh@apple.com>
755
756         [iOS] A few drag and drop tests are crashing after r238146
757         https://bugs.webkit.org/show_bug.cgi?id=191617
758
759         Reviewed by Dean Jackson.
760
761         The notion of temporarily suppressing the selection assistant was introduced during iOS drag and drop
762         development as a way of allowing both the selection view and dropped content snapshot to fade in simultaneously
763         during a drop in an editable element. r238146 piggy-backs on this mechanism by changing selection suppression
764         state when an element is focused, when the selection changes, and when an element is blurred, depending on
765         whether the currently focused element is transparent.
766
767         However, in the case where the selection assistant is suppressed due to a running drop animation, if focus moves
768         to an element that is not fully transparent, we end up prematurely unsuppressing the text selection assistant.
769         This subsequently causes selection UI to immediately show up after a drop instead of animating in alongside a
770         snapshot of the inserted document fragment, if the drop moved focus to an editable element.
771
772         A number of drag and drop tests on iOS exercised this codepath by dragging content into editable fields and/or
773         moving content between editable elements in a web view. These tests began to crash due to selection views and
774         the accompanying callout bar appearing earlier than usual, which triggers an unrelated UIKit assertion in
775         <https://webkit.org/b/190401>.
776
777         This patch fixes the failing tests by refactoring our selection assistant suppression code. Instead of
778         maintaining a single `BOOL` flag indicating whether the selection is suppressed, we use an `OptionSet` of
779         `SuppressSelectionAssistantReason`s, which (at the moment) only include (1) a running drop animation, and (2)
780         focusing a transparent element. The text selection assistant is considered suppressed when either of the reasons
781         apply. This allows us to correctly handle a drop animation that occurs simultaneously as an element is focused
782         without unsuppressing the selection assistant early, and also allows us to handle selection assistant
783         suppression in more nuanced ways, depending on the suppression reason.
784
785         * UIProcess/ios/WKContentViewInteraction.h:
786         * UIProcess/ios/WKContentViewInteraction.mm:
787         (-[WKContentView cleanupInteraction]):
788         (-[WKContentView _displayFormNodeInputView]):
789
790         Only prevent zooming to the focused element during drop if we're suppressing the selection assistant due to
791         focusing a transparent element. In the case of a drop, we still want to allow scrolling and zooming.
792
793         (-[WKContentView canShowNonEmptySelectionView]):
794         (-[WKContentView hasSelectablePositionAtPoint:]):
795         (-[WKContentView pointIsNearMarkedText:]):
796         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
797         (-[WKContentView _startAssistingKeyboard]):
798         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
799         (-[WKContentView _stopAssistingNode]):
800         (-[WKContentView _updateChangedSelection:]):
801         (-[WKContentView _shouldSuppressSelectionCommands]):
802         (-[WKContentView _beginSuppressingSelectionAssistantForReason:]):
803         (-[WKContentView _stopSuppressingSelectionAssistantForReason:]):
804
805         Add helper methods for adding or removing selection assistant suppression reasons. When the last selection
806         assistant suppression reason is removed, we activate the selection assistant, and conversely, when the first
807         suppression reason is added, we deactivate the selection assistant.
808
809         (-[WKContentView _didConcludeEditDataInteraction:]):
810         (-[WKContentView _didPerformDragOperation:]):
811         (-[WKContentView dropInteraction:performDrop:]):
812         (-[WKContentView suppressAssistantSelectionView]): Deleted.
813         (-[WKContentView setSuppressAssistantSelectionView:]): Deleted.
814
815 2018-11-14  Wenson Hsieh  <wenson_hsieh@apple.com>
816
817         [Cocoa] [WebKit2] Hook up some more editing actions (-_pasteAndMatchStyle:, -makeTextWritingDirectionNatural:)
818         https://bugs.webkit.org/show_bug.cgi?id=191605
819         <rdar://problem/45813991>
820
821         Reviewed by Dean Jackson.
822
823         Hook up a couple of editing actions on iOS and macOS. The `-pasteAndMatchStyle:` selector is privately declared
824         in UIKit, but does not exist on macOS; as such, add `-_pasteAndMatchStyle:` as SPI on WKWebView, and
825         additionally implement the unprefixed version, `-pasteAndMatchStyle:`, on iOS.
826
827         Since `-makeTextWritingDirectionNatural:` is already declared on both iOS and macOS (SPI on UIResponder and API
828         on macOS, respectively) we simply implement the unprefixed variant on both platforms.
829
830         * Platform/spi/ios/UIKitSPI.h:
831         * UIProcess/API/Cocoa/WKWebView.mm:
832         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
833         * UIProcess/ios/WKContentViewInteraction.h:
834         * UIProcess/ios/WKContentViewInteraction.mm:
835         (-[WKContentView makeTextWritingDirectionNaturalForWebView:]):
836         (-[WKContentView canPerformActionForWebView:withSender:]):
837
838 2018-11-14  Per Arne Vollan  <pvollan@apple.com>
839
840         REGRESSION (WEBPROCESS_WINDOWSERVER_BLOCKING): requestAnimationFrame Stops Completing
841         https://bugs.webkit.org/show_bug.cgi?id=190884
842
843         Reviewed by Dean Jackson.
844
845         Since the Web page currently owns the display link on the UI process side, the display link will be
846         deleted in the UI process when a Web page is closed. This is incorrect, since a display link can be
847         reused between Web pages in the WebContent process. This patch moves the ownership of the UI process
848         display links to the Web process object to address this issue. Also, the display ID of the display
849         being updated is included in the message to the WebContent process.
850
851         * UIProcess/WebPageProxy.cpp:
852         (WebKit::WebPageProxy::close):
853         (WebKit::WebPageProxy::resetStateAfterProcessExited):
854         * UIProcess/WebPageProxy.h:
855         * UIProcess/WebPageProxy.messages.in:
856         * UIProcess/WebProcessProxy.h:
857         * UIProcess/WebProcessProxy.messages.in:
858         * UIProcess/mac/DisplayLink.cpp:
859         (WebKit::DisplayLink::DisplayLink):
860         (WebKit::DisplayLink::displayLinkCallback):
861         * UIProcess/mac/DisplayLink.h:
862         (WebKit::DisplayLink::displayID const):
863         * UIProcess/mac/WebPageProxyMac.mm:
864         (WebKit::WebPageProxy::startDisplayLink): Deleted.
865         (WebKit::WebPageProxy::stopDisplayLink): Deleted.
866         * UIProcess/mac/WebProcessProxyMac.mm:
867         (WebKit::WebProcessProxy::startDisplayLink):
868         (WebKit::WebProcessProxy::stopDisplayLink):
869         * WebProcess/WebPage/DrawingArea.h:
870         * WebProcess/WebPage/DrawingArea.messages.in:
871         * WebProcess/WebPage/mac/DrawingAreaMac.cpp:
872         (WebKit::DisplayRefreshMonitorMac::create):
873         (WebKit::DisplayRefreshMonitorMac::DisplayRefreshMonitorMac):
874         (WebKit::DisplayRefreshMonitorMac::~DisplayRefreshMonitorMac):
875         (WebKit::DisplayRefreshMonitorMac::requestRefreshCallback):
876         (WebKit::DrawingArea::createDisplayRefreshMonitor):
877         (WebKit::DrawingArea::displayWasRefreshed): Deleted.
878         * WebProcess/WebProcess.h:
879         * WebProcess/WebProcess.messages.in:
880         * WebProcess/cocoa/WebProcessCocoa.mm:
881         (WebKit::WebProcess::displayWasRefreshed):
882
883 2018-11-14  Chris Dumez  <cdumez@apple.com>
884
885         Client should be able to disable PSON even if the experimental feature is on by default
886         https://bugs.webkit.org/show_bug.cgi?id=191634
887
888         Reviewed by Dean Jackson.
889
890         Instead of overriding the APIProcessPoolConfiguration's m_processSwapsOnNavigation flag to true
891         when the experimental is enabled, use a separate flag to store this information. If the client
892         explicitly sets the APIProcessPoolConfiguration's m_processSwapsOnNavigation flag then we obey
893         the client's request, otherwise, we fall back to using the state from experimental features.
894
895         This allows:
896         - API tests to explicitely disable PSON / Process prewarming even if those are on by default
897           in experimental features.
898         - If the client does not set those flags on the APIProcessPoolConfiguration (Safari for e.g.),
899           then the experimental feature flag still fully controls the feature.
900
901         * UIProcess/API/APIProcessPoolConfiguration.cpp:
902         (API::ProcessPoolConfiguration::copy):
903         * UIProcess/API/APIProcessPoolConfiguration.h:
904         * UIProcess/WebProcessPool.cpp:
905         (WebKit::WebProcessPool::createWebPage):
906
907 2018-11-14  Chris Dumez  <cdumez@apple.com>
908
909         WebKit.ApplicationManifestBasic API test is failing when enabling PSON
910         https://bugs.webkit.org/show_bug.cgi?id=191602
911
912         Reviewed by Alex Christensen.
913
914         Add support for process swapping for a [WKWebView loadHTML:] load by storing
915         the necessary data on the API::Navigation and doing a loadData() instead of
916         a loadRequest() after process swapping when this data is present on the
917         navigation.
918
919         * UIProcess/API/APINavigation.cpp:
920         (API::Navigation::Navigation):
921         * UIProcess/API/APINavigation.h:
922         (API::Navigation::create):
923         (API::Navigation::substituteData const):
924         * UIProcess/WebNavigationState.cpp:
925         (WebKit::WebNavigationState::createLoadDataNavigation):
926         * UIProcess/WebNavigationState.h:
927         * UIProcess/WebPageProxy.cpp:
928         (WebKit::WebPageProxy::loadData):
929         (WebKit::WebPageProxy::continueNavigationInNewProcess):
930
931 2018-11-14  Antti Koivisto  <antti@apple.com>
932
933         Align Mac WK2 layer flush throttling with iOS
934         https://bugs.webkit.org/show_bug.cgi?id=191632
935
936         Reviewed by Zalan Bujtas.
937
938         Currently Mac WK2 uses WebCore side throttling implementation in RenderLayerCompositor. This code has
939         throttling timer per-frame while the actual decision making and layer flushes itself are per page. These
940         timers generate way more flushes than expected in presence of multiple frames. There are also bugs in how
941         flushing state is updated when frames are created dynamically.
942
943         On iOS WK2 throttling is implemented on WebKit side and controlled by a per-page timer. Recent fixes also
944         make this implementation visually fast. We should align the Mac implementation and eventually unify them.
945
946         This patch implements throttling in TiledCoreAnimationDrawingArea mirroring the iOS RemoteLayerTreeDrawingArea
947         implementation. There are some adjustments for platform differences (local vs remote layers) and we continue
948         using runloop observer for the actual flushes. Timings are as in the existing Mac code.
949
950         The patch appears to be a significant performance progression.
951
952         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
953         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
954         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
955         (WebKit::TiledCoreAnimationDrawingArea::setLayerTreeStateIsFrozen):
956
957         Schedule an immediate flush when layers are unfrozen.
958
959         (WebKit::TiledCoreAnimationDrawingArea::scheduleCompositingLayerFlush):
960         (WebKit::TiledCoreAnimationDrawingArea::scheduleCompositingLayerFlushImmediately):
961
962         Track pending flushes with m_hasPendingFlush bit.
963         Delay flush if the flush throttling timer is active. Start it if we throttling but it is not active yet.
964
965         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
966
967         Clear m_hasPendingFlush if the flush succeeded.
968         Restart the throttling timer if we are still throttling.
969         Manage runloop observer invalidation here instead of the caller (and stop returning value).
970
971         (WebKit::TiledCoreAnimationDrawingArea::layerFlushRunLoopCallback):
972         (WebKit::TiledCoreAnimationDrawingArea::adjustLayerFlushThrottling):
973
974         Returning 'true' here disables WebCore side throttling code.
975
976         Start or stop the throttling timer on state changes.
977
978         (WebKit::TiledCoreAnimationDrawingArea::layerFlushThrottlingIsActive const):
979
980         This is used to control style and layout timers on WebCore side. Return false on frozen
981         state since unfreezing depends on style and layout.
982
983         (WebKit::TiledCoreAnimationDrawingArea::startLayerFlushThrottlingTimer):
984         (WebKit::TiledCoreAnimationDrawingArea::layerFlushThrottlingTimerFired):
985
986 2018-11-14  Chris Dumez  <cdumez@apple.com>
987
988         WebKit.WKHTTPCookieStoreWithoutProcessPool API test is failing with process prewarming is enabled
989         https://bugs.webkit.org/show_bug.cgi?id=191624
990
991         Reviewed by Alex Christensen.
992
993         Stop setting the WebProcessPool's primary data store (m_websiteDataStore) to the default one in
994         WebProcessPool::prewarmProcess(). We did not really need to, we can pass the default data store
995         to the new WebPageProxy without having to set m_websiteDataStore. m_websiteDataStore only gets
996         set upon constructor if thr default data store already exists or later on when creating a WebPage
997         that uses the default data store.
998
999         In the case of the API test, the following was happening:
1000         1. Create an ephemeral data store EDS
1001         2. Create a WebView V1 using datastore EDS
1002         3. Do a load in V1
1003         4. Process prewarming would kick in and wrongly associated V1's process pool PP1 with the default data store
1004         5. Create/Get the default datastore and set a few cookies on it
1005         6. Create a WebView V2 using default datastore and a fresh new process pool PP2
1006         7. Do a load in V2 and expect the cookies to be there
1007
1008         In HTTPCookieStore::setCookie() that is called at step 5, we call:
1009         m_owningDataStore->processPoolForCookieStorageOperations()
1010
1011         In this case, m_owningDataStore is the default datastore and this call would previously return null because
1012         there is no WebProcessPool yet associated with the default datastore. However, with the process prewarming
1013         bug at step 4, the process pool PP1 would be returned since it was wrongly associated with the default
1014         data store. As a result, we would call setCookie() on PP1's WebCookieManagerProxy and this would fail
1015         because PP1's network process knows nothing about this session ID (it was only ever used with an ephemeral
1016         session).
1017
1018         * UIProcess/WebProcessPool.cpp:
1019         (WebKit::WebProcessPool::prewarmProcess):
1020
1021 2018-11-13  Jiewen Tan  <jiewen_tan@apple.com>
1022
1023         [WebAuthN] Support CTAP HID authenticators on macOS
1024         https://bugs.webkit.org/show_bug.cgi?id=188623
1025         <rdar://problem/43353777>
1026
1027         Reviewed by Brent Fulgham and Chris Dumez.
1028
1029         This patch introduces a primitive support of CTAP HID authenticators for WebAuthN in macOS.
1030         It involves low level HID device management&communication, high level CTAP HID authenticator
1031         management&communication, and mock testing. The above three aspects will be covered in details:
1032         1) Low level HID device management&communication: HidService&HidConnection
1033         It relies on IOHIDManager to discover appropriate hid devices by passing a matching dictionary:
1034         { PrimaryUsagePage: 0xf1d0, PrimaryUsage: 0x01}. For communication, it utilizes HID reports.
1035         To send a report, it calls IOHIDDeviceSetReport since the async version is not implemented.
1036         To recieve a report, it calls IOHIDDeviceRegisterInputReportCallback to asynchronously wait
1037         for incoming reports.
1038         Here is the corresponding reference:
1039         https://developer.apple.com/library/archive/documentation/DeviceDrivers/Conceptual/HID/new_api_10_5/tn2187.html#//apple_ref/doc/uid/TP40000970-CH214-SW2
1040         2) High level CTAP HID authenticator management&communication: HidService&CtapHidDriver
1041         Whenever an appropriate hid device is discovered by IOHIDManager, an AuthenticatorGetInfo command
1042         is sent to the device to determine properties of the authenticator, says, which version of protocol
1043         it supports, i.e. CTAP or U2F. So far, we only support CTAP authenticators. Once the authenticator
1044         is determined to support CTAP, we then instantiate CtapHidAuthenticator which will then take care
1045         of even higher level WebAuthN requests&responses.
1046         Binaries are constructed and packaged according to the CTAP HID porotocol. CtapHidDriver takes care
1047         of concurrency and channels, i.e. allocating channel and establishing the actual request/response
1048         transaction. At the meantime, CtapHidDriver::Worker is then responsible for each single transaction.
1049         Here is the corresponding reference:
1050         https://fidoalliance.org/specs/fido-v2.0-ps-20170927/fido-client-to-authenticator-protocol-v2.0-ps-20170927.html#usb.
1051         3) Mock Testing: MockHidService & MockHidConnection
1052         A CTAP hid authenticator is simulated within MockHidConnection with options of specifying specific
1053         error scenarios and of course could take care of successful cases. Four stages are presented in the
1054         simulated authenticator to reflect: a) allocating channel for AuthenticatorGetInfo, b) sending
1055         AuthenticatorGetInfo, c) allocating channel for actual request, and d) sending the actual request.
1056
1057         Besides implementing the above, it also does a few other things:
1058         1) Make AuthenticatorManager::clearState asynchronous to avoid cyclic dependency:
1059         Authenticator::returnResponse => AuthenticatorManager::respondReceived => AuthenticatorManager::clearState
1060         => Authenticator::~Authenticator.
1061         2) Reorganize unified build sources to make it clear that which files are .mm and which are .cpp.
1062         3) Import LocalAuthentication.framework in LocalAuthenticationSoftLink instead of being scattered.
1063
1064         * Sources.txt:
1065         * SourcesCocoa.txt:
1066         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
1067         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1068         (WKWebsiteDataStoreSetWebAuthenticationMockConfiguration):
1069         * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
1070         (WebKit::AuthenticatorManagerInternal::collectTransports):
1071         (WebKit::AuthenticatorManager::clearStateAsync):
1072         (WebKit::AuthenticatorManager::respondReceived):
1073         (WebKit::AuthenticatorManager::initTimeOutTimer):
1074         * UIProcess/WebAuthentication/AuthenticatorManager.h:
1075         * UIProcess/WebAuthentication/AuthenticatorTransportService.cpp:
1076         (WebKit::AuthenticatorTransportService::create):
1077         (WebKit::AuthenticatorTransportService::createMock):
1078         (WebKit::AuthenticatorTransportService::startDiscovery):
1079         (WebKit::AuthenticatorTransportService::startDiscovery const): Deleted.
1080         * UIProcess/WebAuthentication/AuthenticatorTransportService.h:
1081         * UIProcess/WebAuthentication/Cocoa/HidConnection.h: Copied from Source/WebKit/UIProcess/WebAuthentication/AuthenticatorTransportService.h.
1082         * UIProcess/WebAuthentication/Cocoa/HidConnection.mm: Added.
1083         (WebKit::reportReceived):
1084         (WebKit::HidConnection::HidConnection):
1085         (WebKit::HidConnection::~HidConnection):
1086         (WebKit::HidConnection::initialize):
1087         (WebKit::HidConnection::terminate):
1088         (WebKit::HidConnection::send):
1089         (WebKit::HidConnection::registerDataReceivedCallback):
1090         (WebKit::HidConnection::unregisterDataReceivedCallback):
1091         (WebKit::HidConnection::receiveReport):
1092         (WebKit::HidConnection::consumeReports):
1093         (WebKit::HidConnection::registerDataReceivedCallbackInternal):
1094         * UIProcess/WebAuthentication/Cocoa/HidService.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalService.h.
1095         * UIProcess/WebAuthentication/Cocoa/HidService.mm: Added.
1096         (WebKit::deviceAddedCallback):
1097         (WebKit::deviceRemovedCallback):
1098         (WebKit::HidService::HidService):
1099         (WebKit::HidService::~HidService):
1100         (WebKit::HidService::startDiscoveryInternal):
1101         (WebKit::HidService::platformStartDiscovery):
1102         (WebKit::HidService::createHidConnection const):
1103         (WebKit::HidService::deviceAdded):
1104         (WebKit::HidService::continueAddDeviceAfterGetInfo):
1105         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticationSoftLink.h:
1106         * UIProcess/WebAuthentication/Cocoa/LocalConnection.mm:
1107         * UIProcess/WebAuthentication/Cocoa/LocalService.h:
1108         * UIProcess/WebAuthentication/Cocoa/LocalService.mm:
1109         (WebKit::LocalService::startDiscoveryInternal):
1110         (WebKit::LocalService::startDiscoveryInternal const): Deleted.
1111         * UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.cpp:
1112         (WebKit::MockAuthenticatorManager::respondReceivedInternal):
1113         * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp: Added.
1114         (WebKit::MockHidConnection::MockHidConnection):
1115         (WebKit::MockHidConnection::initialize):
1116         (WebKit::MockHidConnection::terminate):
1117         (WebKit::MockHidConnection::send):
1118         (WebKit::MockHidConnection::registerDataReceivedCallbackInternal):
1119         (WebKit::MockHidConnection::assembleRequest):
1120         (WebKit::MockHidConnection::parseRequest):
1121         (WebKit::MockHidConnection::feedReports):
1122         (WebKit::MockHidConnection::stagesMatch const):
1123         (WebKit::MockHidConnection::shouldContinueFeedReports):
1124         (WebKit::MockHidConnection::continueFeedReports):
1125         * UIProcess/WebAuthentication/Mock/MockHidConnection.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Mock/MockLocalConnection.h.
1126         * UIProcess/WebAuthentication/Mock/MockHidService.cpp: Copied from Source/WebKit/UIProcess/WebAuthentication/Mock/MockLocalService.cpp.
1127         (WebKit::MockHidService::MockHidService):
1128         (WebKit::MockHidService::platformStartDiscovery):
1129         (WebKit::MockHidService::createHidConnection const):
1130         * UIProcess/WebAuthentication/Mock/MockHidService.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Mock/MockLocalConnection.h.
1131         * UIProcess/WebAuthentication/Mock/MockLocalConnection.h:
1132         * UIProcess/WebAuthentication/Mock/MockLocalConnection.mm:
1133         * UIProcess/WebAuthentication/Mock/MockLocalService.mm: Renamed from Source/WebKit/UIProcess/WebAuthentication/Mock/MockLocalService.cpp.
1134         (WebKit::MockLocalService::MockLocalService):
1135         (WebKit::MockLocalService::platformStartDiscovery const):
1136         (WebKit::MockLocalService::createLocalConnection const):
1137         * UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h:
1138         * UIProcess/WebAuthentication/fido/CtapHidAuthenticator.cpp: Added.
1139         (WebKit::CtapHidAuthenticator::CtapHidAuthenticator):
1140         (WebKit::CtapHidAuthenticator::makeCredential):
1141         (WebKit::CtapHidAuthenticator::continueMakeCredentialAfterResponseReceived const):
1142         (WebKit::CtapHidAuthenticator::getAssertion):
1143         (WebKit::CtapHidAuthenticator::continueGetAssertionAfterResponseReceived const):
1144         * UIProcess/WebAuthentication/fido/CtapHidAuthenticator.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalService.h.
1145         * UIProcess/WebAuthentication/fido/CtapHidDriver.cpp: Added.
1146         (WebKit::CtapHidDriver::Worker::Worker):
1147         (WebKit::CtapHidDriver::Worker::~Worker):
1148         (WebKit::CtapHidDriver::Worker::transact):
1149         (WebKit::CtapHidDriver::Worker::write):
1150         (WebKit::CtapHidDriver::Worker::read):
1151         (WebKit::CtapHidDriver::Worker::returnMessage):
1152         (WebKit::CtapHidDriver::CtapHidDriver):
1153         (WebKit::CtapHidDriver::transact):
1154         (WebKit::CtapHidDriver::continueAfterChannelAllocated):
1155         (WebKit::CtapHidDriver::continueAfterResponseReceived):
1156         (WebKit::CtapHidDriver::returnResponse):
1157         * UIProcess/WebAuthentication/fido/CtapHidDriver.h: Added.
1158         * UIProcess/mac/WebDataListSuggestionsDropdownMac.mm:
1159         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
1160         * WebKit.xcodeproj/project.pbxproj:
1161
1162 2018-11-13  Ross Kirsling  <ross.kirsling@sony.com>
1163
1164         Unreviewed correction to previous build fix to avoid any internal/downstream repercussions.
1165
1166         * WebProcess/Network/webrtc/LibWebRTCProvider.h:
1167
1168 2018-11-13  Ross Kirsling  <ross.kirsling@sony.com>
1169
1170         Unreviewed GTK/WPE build fix for r238159. 
1171
1172         * WebProcess/Network/webrtc/LibWebRTCProvider.h:
1173
1174 2018-11-13  Timothy Hatcher  <timothy@apple.com>
1175
1176         Use a light scrollbar for transparent web views in dark mode.
1177         https://bugs.webkit.org/show_bug.cgi?id=191559
1178         rdar://problem/46000489
1179
1180         Reviewed by Dean Jackson.
1181
1182         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
1183         (WebKit::InjectedBundleRangeHandle::renderedImage): Use FrameView's useDarkAppaearance().
1184         * WebProcess/WebPage/WebPage.cpp:
1185         (WebKit::WebPage::drawRect): Ditto.
1186
1187 2018-11-13  Wenson Hsieh  <wenson_hsieh@apple.com>
1188
1189         [iOS] Do not show selection UI for editable elements with opacity near zero
1190         https://bugs.webkit.org/show_bug.cgi?id=191442
1191         <rdar://problem/45958625>
1192
1193         Reviewed by Simon Fraser.
1194
1195         Add support for suppressing native selection UI (for instance, selection highlight views, selection handles, and
1196         selection-related gestures) when the selection is inside a transparent editable element. This helps maintain
1197         compatibility with text editors that work by capturing key events and input events hidden contenteditable
1198         elements, and reflect these changes in different document or different part of the document.
1199
1200         Since selection UI is rendered in the UI process on iOS using element geometry propagated from the web process,
1201         selection rendering is entirely decoupled from the process of painting in the web process. This means that if
1202         the editable root has an opacity of 0, we would correctly hide the caret and selection on macOS, but draw over
1203         the transparent element on iOS. When these hidden editable elements are focused, this often results in unwanted
1204         behaviors, such as double caret painting, native and custom selection UI from the page being drawn on top of one
1205         another, and the ability to change selection via tap and loupe gestures within hidden text.
1206
1207         To fix this, we compute whether the focused element is transparent when an element is focused, or when the
1208         selection changes, and send this information over to the UI process via `AssistedNodeInformation` and
1209         `EditorState`. In the UI process, we then respect this information by suppressing the selection assistant if the
1210         focused element is transparent; this disables showing and laying out selection views, as well as gestures
1211         associated with selection overlays. However, this still allows for contextual autocorrection and spell checking.
1212
1213         * Shared/AssistedNodeInformation.cpp:
1214         (WebKit::AssistedNodeInformation::encode const):
1215         (WebKit::AssistedNodeInformation::decode):
1216         * Shared/AssistedNodeInformation.h:
1217         * Shared/EditorState.cpp:
1218         (WebKit::EditorState::PostLayoutData::encode const):
1219         (WebKit::EditorState::PostLayoutData::decode):
1220         * Shared/EditorState.h:
1221
1222         Add `elementIsTransparent` flags, and also add boilerplate IPC code.
1223
1224         * UIProcess/ios/WKContentViewInteraction.mm:
1225         (-[WKContentView _displayFormNodeInputView]):
1226
1227         Prevent zooming to the focused element if the focused element is hidden.
1228
1229         (-[WKContentView hasSelectablePositionAtPoint:]):
1230         (-[WKContentView pointIsNearMarkedText:]):
1231         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
1232
1233         Don't allow these text interaction gestures to begin while suppressing the selection assistant.
1234
1235         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
1236
1237         When an element is focused, begin suppressing the selection assistant if the element is fully transparent.
1238
1239         (-[WKContentView _stopAssistingNode]):
1240
1241         When the focused element is blurred, reset state by ending selection assistant suppression (additionally
1242         reactivating the selection assistant if needed). This ensures that selection in non-editable text isn't broken
1243         after focusing a hidden editable element.
1244
1245         (-[WKContentView _updateChangedSelection:]):
1246
1247         If needed, suppress or un-suppress the selection assistant when the selection changes. On certain rich text
1248         editors, a combination of custom selection UI and native selection UI is used. For instance, on Microsoft Office
1249         365, caret selections are rendered using the native caret view, but as soon as the selection becomes ranged, the
1250         editable root becomes fully transparent, and Office's selection UI takes over.
1251
1252         (-[WKContentView _shouldSuppressSelectionCommands]):
1253
1254         Override this UIKit SPI hook to suppress selection commands (e.g. the callout bar) when suppressing the
1255         selection assistant.
1256
1257         * WebProcess/WebPage/ios/WebPageIOS.mm:
1258         (WebKit::WebPage::platformEditorState const):
1259         (WebKit::WebPage::getAssistedNodeInformation):
1260
1261         Compute and set `elementIsTransparent` using the assisted node.
1262
1263 2018-11-13  Ryan Haddad  <ryanhaddad@apple.com>
1264
1265         Unreviewed, rolling out r238137.
1266
1267         Introduced API test failures on macOS.
1268
1269         Reverted changeset:
1270
1271         "Enable process swap on cross-site navigation by default on
1272         macOS"
1273         https://bugs.webkit.org/show_bug.cgi?id=191572
1274         https://trac.webkit.org/changeset/238137
1275
1276 2018-11-13  Ryosuke Niwa  <rniwa@webkit.org>
1277
1278         Enable process swap on cross-site navigation by default on macOS
1279         https://bugs.webkit.org/show_bug.cgi?id=191572
1280
1281         Reviewed by Chris Dumez.
1282
1283         Enabled the feature by default on macOS.
1284
1285         * Shared/WebPreferences.yaml:
1286         * Shared/WebPreferencesDefaultValues.h:
1287
1288 2018-11-13  Daniel Bates  <dabates@apple.com>
1289
1290         Consolidate WebKit UIKitSPI.h and UIKitTestSPI.h
1291         https://bugs.webkit.org/show_bug.cgi?id=173341
1292         <rdar://problem/32752890>
1293
1294         Reviewed by Simon Fraser.
1295
1296         * Platform/spi/ios/UIKitSPI.h:
1297
1298 2018-11-13  Alex Christensen  <achristensen@webkit.org>
1299
1300         Fix internal builds after r238115
1301         https://bugs.webkit.org/show_bug.cgi?id=191441
1302
1303         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
1304         (-[WKSafeBrowsingTextView intrinsicContentSize]):
1305         Some iOS-like operating systems don't have safe browsing.  Don't use symbols that don't exist on those systems.
1306
1307 2018-11-13  Ali Juma  <ajuma@chromium.org>
1308
1309         Turn Intersection Observer on by default
1310         https://bugs.webkit.org/show_bug.cgi?id=191569
1311
1312         Reviewed by Simon Fraser.
1313
1314         * Shared/WebPreferences.yaml:
1315
1316 2018-11-12  Darshan Kadu  <darsh7807@gmail.com>
1317
1318         Implement Cache API support for WPE/GTK
1319         https://bugs.webkit.org/show_bug.cgi?id=178316
1320
1321         Reviewed by Michael Catanzaro.
1322
1323         Added a new API function WKWebsiteDataStoreSetCacheStoragePerOriginQuota which sets the
1324         cache limit per origin.
1325
1326         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1327         (WKWebsiteDataStoreSetCacheStoragePerOriginQuota):
1328         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
1329
1330 2018-11-12  Alex Christensen  <achristensen@webkit.org>
1331
1332         [iOS] Implement safe browsing in WebKit
1333         https://bugs.webkit.org/show_bug.cgi?id=191441
1334
1335         Reviewed by Tim Horton.
1336
1337         In r237863 I implemented this for Mac.  This refines the UI and implements it for iOS.
1338
1339         * Shared/WebPreferences.yaml:
1340         * Shared/WebPreferencesDefaultValues.h:
1341         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
1342         (WKContextHandlesSafeBrowsing):
1343         * UIProcess/API/Cocoa/WKWebView.mm:
1344         (-[WKWebView _showSafeBrowsingWarning:completionHandler:]):
1345         (-[WKWebView _clearSafeBrowsingWarning]):
1346         (-[WKWebView layoutSubviews]):
1347         (-[WKWebView setFrameSize:]):
1348         (+[WKWebView _handlesSafeBrowsing]):
1349         (-[WKWebView _safeBrowsingWarningForTesting]):
1350         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1351         * UIProcess/Cocoa/PageClientImplCocoa.h:
1352         * UIProcess/Cocoa/PageClientImplCocoa.mm:
1353         (WebKit::PageClientImplCocoa::allocFileWrapperInstance const):
1354         (WebKit::PageClientImplCocoa::serializableFileWrapperClasses const):
1355         * UIProcess/Cocoa/WKSafeBrowsingWarning.h:
1356         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
1357         (confirmMalwareSentinel):
1358         (visitUnsafeWebsiteSentinel):
1359         (colorForItem):
1360         (addLinkAndReplace):
1361         (-[WKSafeBrowsingExclamationPoint drawRect:]):
1362         (makeButton):
1363         (makeTitleLabel):
1364         (setBackground):
1365         (-[WKSafeBrowsingWarning initWithFrame:safeBrowsingResult:completionHandler:]):
1366         (-[WKSafeBrowsingWarning addContent]):
1367         (-[WKSafeBrowsingWarning showDetailsClicked]):
1368         (-[WKSafeBrowsingWarning layoutText]):
1369         (-[WKSafeBrowsingWarning textView:clickedOnLink:atIndex:]):
1370         (-[WKSafeBrowsingWarning layout]):
1371         (-[WKSafeBrowsingWarning layoutSubviews]):
1372         (-[WKSafeBrowsingWarning textView:shouldInteractWithURL:inRange:interaction:]):
1373         (-[WKSafeBrowsingWarning didMoveToWindow]):
1374         (-[WKSafeBrowsingWarning clickedOnLink:]):
1375         (-[WKSafeBrowsingTextView initWithAttributedString:forWarning:]):
1376         (-[WKSafeBrowsingTextView intrinsicContentSize]):
1377         (colorNamed): Deleted.
1378         (+[WKSafeBrowsingTextView viewWithAttributedString:linkTarget:]): Deleted.
1379         (+[WKSafeBrowsingTextView viewWithString:]): Deleted.
1380         (-[WKSafeBrowsingTextView clickedOnLink:atIndex:]): Deleted.
1381         * UIProcess/ios/PageClientImplIOS.mm:
1382         (WebKit::PageClientImpl::isViewWindowActive):
1383         (WebKit::PageClientImpl::isViewFocused):
1384         (WebKit::PageClientImpl::isViewVisible):
1385         (WebKit::PageClientImpl::isViewInWindow):
1386         (WebKit::PageClientImpl::decidePolicyForGeolocationPermissionRequest):
1387         (WebKit::PageClientImpl::enterAcceleratedCompositingMode):
1388         (WebKit::PageClientImpl::showSafeBrowsingWarning):
1389         (WebKit::PageClientImpl::clearSafeBrowsingWarning):
1390         (WebKit::PageClientImpl::mimeTypesWithCustomContentProviders):
1391         (WebKit::PageClientImpl::navigationGestureDidBegin):
1392         (WebKit::PageClientImpl::navigationGestureWillEnd):
1393         (WebKit::PageClientImpl::navigationGestureDidEnd):
1394         (WebKit::PageClientImpl::willRecordNavigationSnapshot):
1395         (WebKit::PageClientImpl::didRemoveNavigationGestureSnapshot):
1396         (WebKit::PageClientImpl::requestPasswordForQuickLookDocument):
1397         * UIProcess/mac/PageClientImplMac.mm:
1398         (WebKit::PageClientImpl::showShareSheet):
1399         (WebKit::PageClientImpl::navigationGestureDidBegin):
1400         (WebKit::PageClientImpl::navigationGestureWillEnd):
1401         (WebKit::PageClientImpl::navigationGestureDidEnd):
1402         (WebKit::PageClientImpl::willRecordNavigationSnapshot):
1403         (WebKit::PageClientImpl::didRemoveNavigationGestureSnapshot):
1404
1405 2018-11-12  Tim Horton  <timothy_horton@apple.com>
1406
1407         Make it possible to edit images inline
1408         https://bugs.webkit.org/show_bug.cgi?id=191352
1409         <rdar://problem/30107985>
1410
1411         Reviewed by Dean Jackson.
1412
1413         * Platform/spi/ios/PencilKitSPI.h: Added.
1414         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
1415         (WebKit::RemoteLayerBackingStore::drawInContext):
1416         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
1417         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
1418         (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::LayerCreationProperties):
1419         (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::encode const):
1420         (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::decode):
1421         * WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.cpp:
1422         (WebKit::GraphicsLayerCARemote::createPlatformCALayerForEmbeddedView):
1423         * WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.h:
1424         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
1425         (WebKit::PlatformCALayerRemote::createForEmbeddedView):
1426         (WebKit::PlatformCALayerRemote::PlatformCALayerRemote):
1427         (WebKit::PlatformCALayerRemote::embeddedViewID const):
1428         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:
1429         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
1430         (WebKit::RemoteLayerTreeContext::layerWasCreated):
1431         Propagate EmbeddedViewID through the PlatformCALayer constructor and
1432         through the layer creation parameters to the UI process.
1433
1434         * Shared/WebPreferences.yaml:
1435         * UIProcess/API/Cocoa/WKWebView.mm:
1436         (-[WKWebView _initializeWithConfiguration:]):
1437         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1438         (-[WKWebViewConfiguration init]):
1439         (-[WKWebViewConfiguration copyWithZone:]):
1440         (-[WKWebViewConfiguration _setEditableImagesEnabled:]):
1441         (-[WKWebViewConfiguration _editableImagesEnabled]):
1442         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1443         Add a preference to enable editable images.
1444
1445         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h:
1446         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
1447         (WebKit::RemoteLayerTreeHost::layerWillBeRemoved):
1448         (WebKit::RemoteLayerTreeHost::clearLayers):
1449         (WebKit::RemoteLayerTreeHost::createLayer):
1450         Keep track of "embedded views" in two maps: embeddedViewID->UIView,
1451         and layerID->embeddedViewID. Clean them up when layers go away.
1452         If a embedded view is reparented, currently it must be added to a new
1453         layer in the same commit as it is removed from the previous layer
1454         in order to persist the view's state (otherwise the view will be
1455         destroyed and recreated). This will be less of a problem after future
1456         patches introduce serialization of image data and whatnot.
1457
1458         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
1459         (WebKit::RemoteLayerTreeHost::createLayer):
1460         (WebKit::RemoteLayerTreeHost::createEmbeddedView):
1461         Move the various remote layer tree UIView subclasses out into a separate file.
1462
1463         Add createEmbeddedView, which is used for LayerTypeEditableImageLayer,
1464         and creates a WKDrawingView and sticks it in the maps.
1465
1466         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h: Added.
1467         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm: Added.
1468         (-[UIView _web_recursiveFindDescendantInteractibleViewAtPoint:withEvent:]):
1469         (-[UIView _web_findDescendantViewAtPoint:withEvent:]):
1470         (-[WKCompositingView hitTest:withEvent:]):
1471         (-[WKCompositingView description]):
1472         (+[WKTransformView layerClass]):
1473         (+[WKSimpleBackdropView layerClass]):
1474         (+[WKShapeView layerClass]):
1475         (-[WKRemoteView initWithFrame:contextID:]):
1476         (+[WKRemoteView layerClass]):
1477         (-[WKBackdropView hitTest:withEvent:]):
1478         (-[WKBackdropView description]):
1479         (-[WKChildScrollView initWithFrame:]):
1480         Move various remote layer tree UIView subclasses here, to their own file.
1481         Make our UIView hit testing override test for views that conform to the
1482         protocol "WKNativelyInteractible", which switches to normal UIView hit
1483         testing. WKDrawingView will be the one such view.
1484
1485         Add WKChildScrollView and pull the one thing we customize out into it,
1486         to make RemoteLayerTreeHost::createLayer less logic-ful.
1487
1488         * UIProcess/ios/WKDrawingView.h: Added.
1489         * UIProcess/ios/WKDrawingView.mm: Added.
1490         (-[WKDrawingView init]):
1491         (-[WKDrawingView layoutSubviews]):
1492         Add a very simple WKDrawingView, which uses PKCanvasView to edit the image.
1493
1494         * WebKit.xcodeproj/project.pbxproj:
1495         * SourcesCocoa.txt:
1496         Add the new files.
1497
1498 2018-11-12  Don Olmstead  <don.olmstead@sony.com>
1499
1500         Shipped PNGs include bad profiles: iCCP: known incorrect sRGB profile
1501         https://bugs.webkit.org/show_bug.cgi?id=189230
1502         <rdar://problem/44050379>
1503
1504         Reviewed by Joseph Pecoraro.
1505
1506         Runs all png images through zopflipng. This results in a smaller file
1507         size and takes care of this issue as a byproduct.
1508
1509         * Resources/ios/iOS.xcassets/StartPictureInPictureButton.imageset/StartPictureInPictureButton@1x.png:
1510         * Resources/ios/iOS.xcassets/StartPictureInPictureButton.imageset/StartPictureInPictureButton@2x.png:
1511         * Resources/ios/iOS.xcassets/StartPictureInPictureButton.imageset/StartPictureInPictureButton@3x.png:
1512         * Resources/ios/iOS.xcassets/StopPictureInPictureButton.imageset/StopPictureInPictureButton@1x.png:
1513         * Resources/ios/iOS.xcassets/StopPictureInPictureButton.imageset/StopPictureInPictureButton@2x.png:
1514         * Resources/ios/iOS.xcassets/StopPictureInPictureButton.imageset/StopPictureInPictureButton@3x.png:
1515
1516 2018-11-12  Eric Carlson  <eric.carlson@apple.com>
1517
1518         [MediaStream] Screen capture should be an experimental feature on OSX only
1519         https://bugs.webkit.org/show_bug.cgi?id=191552
1520         <rdar://problem/45994142>
1521
1522         Reviewed by Youenn Fablet.
1523
1524         * Shared/WebPreferences.yaml: Make ScreenCaptureEnabled.condition ENABLE(MEDIA_STREAM) && PLATFORM(MAC).
1525
1526 2018-11-12  Takashi Komori  <Takashi.Komori@sony.com>
1527
1528         Resurrect WebKitTestRunner for Windows port
1529         https://bugs.webkit.org/show_bug.cgi?id=189257
1530
1531         Reviewed by Fujii Hironori.
1532
1533         * PlatformWin.cmake:
1534
1535 2018-11-12  Antoine Quint  <graouts@apple.com>
1536
1537         [Web Animations] Turn Web Animations experimental
1538         https://bugs.webkit.org/show_bug.cgi?id=191543
1539
1540         Reviewed by Dean Jackson.
1541
1542         * Shared/WebPreferences.yaml:
1543
1544 2018-11-11  Wenson Hsieh  <wenson_hsieh@apple.com>
1545
1546         Implement a new edit command to change the enclosing list type
1547         https://bugs.webkit.org/show_bug.cgi?id=191487
1548         <rdar://problem/45955922>
1549
1550         Reviewed by Ryosuke Niwa.
1551
1552         * UIProcess/WebEditCommandProxy.cpp:
1553         (WebKit::WebEditCommandProxy::nameForEditAction):
1554
1555         Add undo/redo edit action strings for ConvertToOrderedList and ConvertToUnorderedList.
1556
1557         * WebProcess/WebPage/WebPage.cpp:
1558         (WebKit::WebPage::increaseListLevel):
1559         (WebKit::WebPage::decreaseListLevel):
1560         (WebKit::WebPage::changeListType):
1561
1562         Remove preflight checks for these list editing commands. These are not necessary because these commands fall
1563         back to being noops if these checks return false. This avoids an extraneous ancestor walk to determine the
1564         enclosing list element when changing list type.
1565
1566 2018-11-11  Daniel Bates  <dabates@apple.com>
1567
1568         [iOS] Draw caps lock indicator in password fields
1569         https://bugs.webkit.org/show_bug.cgi?id=190565
1570         <rdar://problem/45262343>
1571
1572         Reviewed by Dean Jackson.
1573
1574         Notify the WebContent process with the current modifer state on window activation changes. Notify
1575         the WebContent process when hardware keyboard availability changes (e.g. a keyboard is attached).
1576
1577         * UIProcess/API/Cocoa/WKWebView.mm:
1578         (-[WKWebView _initializeWithConfiguration:]): Register for hardware keyboard availability changed notifications.
1579         (-[WKWebView dealloc]): Unregister from hardware availability changed notifications.
1580         (hardwareKeyboardAvailabilityChangedCallback): Added.
1581         * UIProcess/WebPageProxy.cpp:
1582         (WebKit::WebPageProxy::updateCurrentModifierState): Compile this code when building for iOS.
1583         * UIProcess/WebPageProxy.h:
1584         * UIProcess/ios/WKContentViewInteraction.mm:
1585         (-[WKContentView _handleKeyUIEvent:]): Update the current modifier state if this event is a hardware
1586         keyboard flags changed event.
1587         * UIProcess/ios/WebPageProxyIOS.mm:
1588         (WebKit::WebPageProxy::hardwareKeyboardAvailabilityChanged): Added.
1589
1590         * WebProcess/WebPage/WebPage.h:
1591         * WebProcess/WebPage/WebPage.messages.in:
1592         * WebProcess/WebPage/ios/WebPageIOS.mm:
1593         (WebKit::WebPage::hardwareKeyboardAvailabilityChanged):
1594         Added new message HardwareKeyboardAvailabilityChanged. Notify the focused HTML input element (if we have
1595         one) that the caps lock state may have changed when we receive message HardwareKeyboardAvailabilityChanged
1596         so that we toggle visibility of the caps lock indicator.
1597
1598 2018-11-11  Dan Bernstein  <mitz@apple.com>
1599
1600         ProcessPoolConfiguration::copy() doesn’t copy m_customWebContentServiceBundleIdentifier
1601         https://bugs.webkit.org/show_bug.cgi?id=191514
1602
1603         Reviewed by Geoffrey Garen.
1604
1605         Test: WebKitCocoa/WKProcessPoolConfiguration.mm
1606
1607         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1608         (API::ProcessPoolConfiguration::copy): Copy m_customWebContentServiceBundleIdentifier.
1609
1610 2018-11-11  Benjamin Poulain  <benjamin@webkit.org>
1611
1612         Fix a fixme: rename wtfObjcMsgSend to wtfObjCMsgSend
1613         https://bugs.webkit.org/show_bug.cgi?id=191492
1614
1615         Reviewed by Alex Christensen.
1616
1617         * Platform/mac/StringUtilities.mm:
1618         * UIProcess/ApplicationStateTracker.mm:
1619         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
1620         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
1621
1622 2018-11-10  Benjamin Poulain  <benjamin@webkit.org>
1623
1624         Fix a fixme: rename wtfObjcMsgSend to wtfObjCMsgSend
1625         https://bugs.webkit.org/show_bug.cgi?id=191492
1626
1627         Reviewed by Alex Christensen.
1628
1629         * Platform/mac/StringUtilities.mm:
1630         * UIProcess/ApplicationStateTracker.mm:
1631         (WebKit::ApplicationStateTracker::applicationDidEnterBackground):
1632         (WebKit::ApplicationStateTracker::applicationDidFinishSnapshottingAfterEnteringBackground):
1633         (WebKit::ApplicationStateTracker::applicationWillEnterForeground):
1634         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
1635         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
1636
1637 2018-11-10  Ryan Haddad  <ryanhaddad@apple.com>
1638
1639         Unreviewed, rolling out r238065.
1640
1641         Breaks internal builds.
1642
1643         Reverted changeset:
1644
1645         "Make it possible to edit images inline"
1646         https://bugs.webkit.org/show_bug.cgi?id=191352
1647         https://trac.webkit.org/changeset/238065
1648
1649 2018-11-10  Tim Horton  <timothy_horton@apple.com>
1650
1651         Make it possible to edit images inline
1652         https://bugs.webkit.org/show_bug.cgi?id=191352
1653         <rdar://problem/30107985>
1654
1655         Reviewed by Dean Jackson.
1656
1657         * Platform/spi/ios/PencilKitSPI.h: Added.
1658         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
1659         (WebKit::RemoteLayerBackingStore::drawInContext):
1660         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
1661         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
1662         (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::LayerCreationProperties):
1663         (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::encode const):
1664         (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::decode):
1665         * WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.cpp:
1666         (WebKit::GraphicsLayerCARemote::createPlatformCALayerForEmbeddedView):
1667         * WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.h:
1668         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
1669         (WebKit::PlatformCALayerRemote::createForEmbeddedView):
1670         (WebKit::PlatformCALayerRemote::PlatformCALayerRemote):
1671         (WebKit::PlatformCALayerRemote::embeddedViewID const):
1672         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:
1673         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
1674         (WebKit::RemoteLayerTreeContext::layerWasCreated):
1675         Propagate EmbeddedViewID through the PlatformCALayer constructor and
1676         through the layer creation parameters to the UI process.
1677
1678         * Shared/WebPreferences.yaml:
1679         * UIProcess/API/Cocoa/WKWebView.mm:
1680         (-[WKWebView _initializeWithConfiguration:]):
1681         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1682         (-[WKWebViewConfiguration init]):
1683         (-[WKWebViewConfiguration copyWithZone:]):
1684         (-[WKWebViewConfiguration _setEditableImagesEnabled:]):
1685         (-[WKWebViewConfiguration _editableImagesEnabled]):
1686         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1687         Add a preference to enable editable images.
1688
1689         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h:
1690         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
1691         (WebKit::RemoteLayerTreeHost::layerWillBeRemoved):
1692         (WebKit::RemoteLayerTreeHost::clearLayers):
1693         (WebKit::RemoteLayerTreeHost::createLayer):
1694         Keep track of "embedded views" in two maps: embeddedViewID->UIView,
1695         and layerID->embeddedViewID. Clean them up when layers go away.
1696         If a embedded view is reparented, currently it must be added to a new
1697         layer in the same commit as it is removed from the previous layer
1698         in order to persist the view's state (otherwise the view will be
1699         destroyed and recreated). This will be less of a problem after future
1700         patches introduce serialization of image data and whatnot.
1701
1702         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
1703         (WebKit::RemoteLayerTreeHost::createLayer):
1704         (WebKit::RemoteLayerTreeHost::createEmbeddedView):
1705         Move the various remote layer tree UIView subclasses out into a separate file.
1706
1707         Add createEmbeddedView, which is used for LayerTypeEditableImageLayer,
1708         and creates a WKDrawingView and sticks it in the maps.
1709
1710         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h: Added.
1711         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm: Added.
1712         (-[UIView _web_recursiveFindDescendantInteractibleViewAtPoint:withEvent:]):
1713         (-[UIView _web_findDescendantViewAtPoint:withEvent:]):
1714         (-[WKCompositingView hitTest:withEvent:]):
1715         (-[WKCompositingView description]):
1716         (+[WKTransformView layerClass]):
1717         (+[WKSimpleBackdropView layerClass]):
1718         (+[WKShapeView layerClass]):
1719         (-[WKRemoteView initWithFrame:contextID:]):
1720         (+[WKRemoteView layerClass]):
1721         (-[WKBackdropView hitTest:withEvent:]):
1722         (-[WKBackdropView description]):
1723         (-[WKChildScrollView initWithFrame:]):
1724         Move various remote layer tree UIView subclasses here, to their own file.
1725         Make our UIView hit testing override test for views that conform to the
1726         protocol "WKNativelyInteractible", which switches to normal UIView hit
1727         testing. WKDrawingView will be the one such view.
1728
1729         Add WKChildScrollView and pull the one thing we customize out into it,
1730         to make RemoteLayerTreeHost::createLayer less logic-ful.
1731
1732         * UIProcess/ios/WKDrawingView.h: Added.
1733         * UIProcess/ios/WKDrawingView.mm: Added.
1734         (-[WKDrawingView init]):
1735         (-[WKDrawingView layoutSubviews]):
1736         Add a very simple WKDrawingView, which uses PKCanvasView to edit the image.
1737
1738         * WebKit.xcodeproj/project.pbxproj:
1739         * SourcesCocoa.txt:
1740         Add the new files.
1741
1742 2018-11-09  Zalan Bujtas  <zalan@apple.com>
1743
1744         [iOS] Issue initial paint soon after the visuallyNonEmpty milestone is fired.
1745         https://bugs.webkit.org/show_bug.cgi?id=191078
1746         <rdar://problem/45736178>
1747
1748         Reviewed by Antti Koivisto.
1749
1750         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1751         (WebKit::WebChromeClient::layerFlushThrottlingIsActive const):
1752         * WebProcess/WebCoreSupport/WebChromeClient.h:
1753         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
1754         (WebKit::AcceleratedDrawingArea::scheduleInitialDeferredPaint):
1755         * WebProcess/WebPage/AcceleratedDrawingArea.h:
1756         * WebProcess/WebPage/DrawingArea.h:
1757         (WebKit::DrawingArea::layerFlushThrottlingIsActive const):
1758         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
1759         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
1760         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
1761         (WebKit::RemoteLayerTreeDrawingArea::setLayerTreeStateIsFrozen):
1762         (WebKit::RemoteLayerTreeDrawingArea::initialDeferredPaint):
1763         (WebKit::RemoteLayerTreeDrawingArea::scheduleInitialDeferredPaint):
1764         (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush):
1765         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
1766         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1767         (WebKit::TiledCoreAnimationDrawingArea::scheduleInitialDeferredPaint):
1768
1769 2018-11-09  John Wilander  <wilander@apple.com>
1770
1771         Add ability to configure document.cookie lifetime cap through user defaults
1772         https://bugs.webkit.org/show_bug.cgi?id=191480
1773         <rdar://problem/45240871>
1774
1775         Reviewed by Chris Dumez.
1776
1777         This change makes the capped lifetime in seconds configurable through
1778         user defaults.
1779
1780         * NetworkProcess/NetworkProcess.cpp:
1781         (WebKit::NetworkProcess::setAgeCapForClientSideCookies):
1782         (WebKit::NetworkProcess::setShouldCapLifetimeForClientSideCookies): Deleted.
1783             Renamed setAgeCapForClientSideCookies().
1784         * NetworkProcess/NetworkProcess.h:
1785         * NetworkProcess/NetworkProcess.messages.in:
1786         * UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm:
1787         (WebKit::ResourceLoadStatisticsMemoryStore::registerUserDefaultsIfNeeded):
1788         * UIProcess/Network/NetworkProcessProxy.cpp:
1789         (WebKit::NetworkProcessProxy::setAgeCapForClientSideCookies):
1790         (WebKit::NetworkProcessProxy::didSetAgeCapForClientSideCookies):
1791         (WebKit::NetworkProcessProxy::setShouldCapLifetimeForClientSideCookies): Deleted.
1792             Renamed setAgeCapForClientSideCookies().
1793         (WebKit::NetworkProcessProxy::didSetShouldCapLifetimeForClientSideCookies): Deleted.
1794             Renamed didSetAgeCapForClientSideCookies().
1795         * UIProcess/Network/NetworkProcessProxy.h:
1796         * UIProcess/Network/NetworkProcessProxy.messages.in:
1797         * UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
1798         (WebKit::ResourceLoadStatisticsMemoryStore::setAgeCapForClientSideCookies):
1799         (WebKit::ResourceLoadStatisticsMemoryStore::updateClientSideCookiesAgeCap):
1800         (WebKit::ResourceLoadStatisticsMemoryStore::didCreateNetworkProcess):
1801             New function that handles all the things that need to be done when a network
1802             process has been created.
1803         * UIProcess/ResourceLoadStatisticsMemoryStore.h:
1804         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1805         (WebKit::WebResourceLoadStatisticsStore::didCreateNetworkProcess):
1806             Now just calls the corresponding function on its memory store where all the
1807             configuration parameters are available.
1808         * UIProcess/WebResourceLoadStatisticsStore.h:
1809         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1810         (WebKit::WebsiteDataStore::setAgeCapForClientSideCookies):
1811         (WebKit::WebsiteDataStore::setShouldCapLifetimeForClientSideCookies): Deleted.
1812             Renamed setAgeCapForClientSideCookies().
1813         * UIProcess/WebsiteData/WebsiteDataStore.h:
1814
1815 2018-11-09  Ryan Haddad  <ryanhaddad@apple.com>
1816
1817         Unreviewed, rolling out r238047.
1818
1819         Introduced layout test failures on iOS simulator.
1820
1821         Reverted changeset:
1822
1823         "[iOS] Draw caps lock indicator in password fields"
1824         https://bugs.webkit.org/show_bug.cgi?id=190565
1825         https://trac.webkit.org/changeset/238047
1826
1827 2018-11-09  Chris Dumez  <cdumez@apple.com>
1828
1829         Suspended page persists even after back/forward list item is gone
1830         https://bugs.webkit.org/show_bug.cgi?id=191488
1831         <rdar://problem/45953006>
1832
1833         Reviewed by Geoffrey Garen.
1834
1835         Currently, the WebProcessPool owns the SuspendedPageProxy objects and makes sure we cap how
1836         many we can have. The WebBackForwardListItem merely has a WeakPtr to its associated
1837         SuspendedPageProxy. However, there is no point in having the WebProcessPool keeping a
1838         SuspendedPageProxy object alive if there is no longer any WebBackForwardListItem pointing
1839         to it.
1840
1841         To address the issue, WebBackForwardListItem nows tells the WebProcessPool to destroy
1842         its SuspendedPageProxy when necessary. WebBackForwardList also takes care of nulling
1843         out the WebBackForwardListItem's SuspendedPageProxy after the item has been removed
1844         from the list (in case somebody keeps the item alive).
1845
1846         * Shared/WebBackForwardListItem.cpp:
1847         (WebKit::WebBackForwardListItem::~WebBackForwardListItem):
1848         (WebKit::WebBackForwardListItem::setSuspendedPage):
1849         (WebKit::WebBackForwardListItem::suspendedPageIsNoLongerNeeded):
1850         * Shared/WebBackForwardListItem.h:
1851         * UIProcess/SuspendedPageProxy.cpp:
1852         (WebKit::SuspendedPageProxy::SuspendedPageProxy):
1853         * UIProcess/WebBackForwardList.cpp:
1854         (WebKit::WebBackForwardList::didRemoveItem):
1855         * UIProcess/WebProcessPool.cpp:
1856         (WebKit::WebProcessPool::removeSuspendedPageProxy):
1857         * UIProcess/WebProcessPool.h:
1858
1859 2018-11-09  Wenson Hsieh  <wenson_hsieh@apple.com>
1860
1861         [Cocoa] Implement SPI on WKWebView to increase and decrease list levels
1862         https://bugs.webkit.org/show_bug.cgi?id=191471
1863         <rdar://problem/45952472>
1864
1865         Reviewed by Tim Horton.
1866
1867         Implement these method stubs by calling into Editor.
1868
1869         Test: WKWebViewEditActions.ModifyListLevel
1870
1871         * WebProcess/WebPage/WebPage.cpp:
1872         (WebKit::WebPage::increaseListLevel):
1873         (WebKit::WebPage::decreaseListLevel):
1874         (WebKit::WebPage::changeListType):
1875
1876 2018-11-09  Keith Rollin  <krollin@apple.com>
1877
1878         Unreviewed build fix after https://bugs.webkit.org/show_bug.cgi?id=191324
1879
1880         Remove the use of .xcfilelists until their side-effects are better
1881         understood.
1882
1883         * WebKit.xcodeproj/project.pbxproj:
1884
1885 2018-11-09  Basuke Suzuki  <basuke.suzuki@sony.com>
1886
1887         [Curl][WebKit] Implement Proxy configuration API.
1888         https://bugs.webkit.org/show_bug.cgi?id=189053
1889
1890         Reviewed by Youenn Fablet.
1891
1892         Added proxy configuration API to WebsiteDataStore. Three API were added in WKWebsiteDataStoreRefCurl.h:
1893         - WKWebsiteDataStoreEnableDefaultNetworkProxySettings(WKWebsiteDataStoreRef)
1894         - WKWebsiteDataStoreEnableCustomNetworkProxySettings(WKWebsiteDataStoreRef, WKURLRef, WKStringRef ignoreHosts)
1895         - WKWebsiteDataStoreDisableNetworkProxySettings(WKWebsiteDataStoreRef)
1896
1897         * NetworkProcess/NetworkProcess.h:
1898         * NetworkProcess/NetworkProcess.messages.in:
1899         * NetworkProcess/NetworkSessionCreationParameters.h:
1900         (WebKit::NetworkSessionCreationParameters::encode const):
1901         (WebKit::NetworkSessionCreationParameters::decode):
1902         * NetworkProcess/curl/NetworkProcessCurl.cpp:
1903         (WebKit::NetworkProcess::setNetworkProxySettings):
1904         * NetworkProcess/curl/NetworkSessionCurl.cpp:
1905         (WebKit::NetworkSessionCurl::NetworkSessionCurl):
1906         * NetworkProcess/curl/RemoteNetworkingContextCurl.cpp:
1907         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
1908         * PlatformWin.cmake:
1909         * Shared/WebCoreArgumentCoders.h:
1910         * Shared/curl/WebCoreArgumentCodersCurl.cpp:
1911         (IPC::ArgumentCoder<CurlProxySettings>::encode):
1912         (IPC::ArgumentCoder<CurlProxySettings>::decode):
1913         * UIProcess/API/C/curl/WKWebsiteDataStoreRefCurl.cpp:
1914           Copied from Source/WebKit/NetworkProcess/curl/NetworkSessionCurl.cpp.
1915         (WKWebsiteDataStoreEnableDefaultNetworkProxySettings):
1916         (WKWebsiteDataStoreEnableCustomNetworkProxySettings):
1917         (WKWebsiteDataStoreDisableNetworkProxySettings):
1918         * UIProcess/API/C/curl/WKWebsiteDataStoreRefCurl.h:
1919           Copied from Source/WebKit/NetworkProcess/curl/NetworkSessionCurl.cpp.
1920         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1921         (WebKit::WebsiteDataStore::parameters):
1922         * UIProcess/WebsiteData/WebsiteDataStore.h:
1923         (WebKit::WebsiteDataStore::networkProxySettings const):
1924         * UIProcess/WebsiteData/curl/WebsiteDataStoreCurl.cpp:
1925           Copied from Source/WebKit/NetworkProcess/curl/NetworkSessionCurl.cpp.
1926         (WebKit::WebsiteDataStore::platformSetParameters):
1927         (WebKit::WebsiteDataStore::setNetworkProxySettings):
1928
1929 2018-11-09  Wenson Hsieh  <wenson_hsieh@apple.com>
1930
1931         [Cocoa] Introduce WKWebView SPI to insert nested ordered and unordered lists
1932         https://bugs.webkit.org/show_bug.cgi?id=191410
1933         <rdar://problem/45898610>
1934
1935         Reviewed by Dean Jackson.
1936
1937         Prefixes a few iOS-only SPI methods declared on WKWebView in r236867 with underscores, and also exposes some
1938         more cross-platform Cocoa editing SPI. Once the unprefixed SPI methods are no longer used by internal clients,
1939         these will need to be removed (see followup bug: webkit.org/b/191450). See below for more details.
1940
1941         Covered by new and existing API tests in WKWebViewEditActions.
1942
1943         * UIProcess/API/Cocoa/WKWebView.mm:
1944
1945         Hoist the definition (and undefinition) of `FORWARD_ACTION_TO_WKCONTENTVIEW` to encompass both the WKWebView
1946         implementation and the WKWebView (WKPrivate) implementation. This allows us to use this macro when implementing
1947         SPI methods in the WKPrivate category, as well as methods that are part of the main WKWebView implementation.
1948
1949         (-[WKWebView canPerformAction:withSender:]):
1950         (-[WKWebView targetForAction:withSender:]):
1951
1952         Add forwarding for the new editing commands in -canPerformAction: and -targetForAction:.
1953
1954         (-[WKWebView _toggleStrikeThrough:]):
1955         (-[WKWebView _increaseListLevel:]):
1956         (-[WKWebView _decreaseListLevel:]):
1957         (-[WKWebView _changeListType:]):
1958         (-[WKWebView _setFont:sender:]):
1959         (-[WKWebView _setFontSize:sender:]):
1960         (-[WKWebView _setTextColor:sender:]):
1961
1962         Add definitions for the new editing methods on WKWebView, using macros (`WEBCORE_PRIVATE_COMMAND` on macOS and
1963         `FORWARD_ACTION_TO_WKCONTENTVIEW` on iOS) to help reduce the code duplication.
1964
1965         (-[WKWebView _pasteAsQuotation:]): Deleted.
1966
1967         Remove this method definition, which is now replaced by macros on iOS and macOS.
1968
1969         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1970
1971         Introduce the new SPI to WKWebView (WKPrivate), and add FIXMEs to remove old, unprefixed variants of the SPI.
1972
1973         * UIProcess/WebPageProxy.cpp:
1974         (WebKit::WebPageProxy::increaseListLevel):
1975         (WebKit::WebPageProxy::decreaseListLevel):
1976         (WebKit::WebPageProxy::changeListType):
1977
1978         Add plumbing for these list editing commands.
1979
1980         * UIProcess/WebPageProxy.h:
1981         * UIProcess/ios/WKContentViewInteraction.h:
1982         * UIProcess/ios/WKContentViewInteraction.mm:
1983         (-[WKContentView _increaseListLevelForWebView:]):
1984         (-[WKContentView _decreaseListLevelForWebView:]):
1985         (-[WKContentView _changeListTypeForWebView:]):
1986         (-[WKContentView _toggleStrikeThroughForWebView:]):
1987         (-[WKContentView _setFontForWebView:sender:]):
1988         (-[WKContentView _setFontSizeForWebView:sender:]):
1989         (-[WKContentView _setTextColorForWebView:sender:]):
1990         (-[WKContentView toggleStrikeThroughForWebView:]):
1991         (-[WKContentView setFontForWebView:sender:]):
1992         (-[WKContentView setFontSizeForWebView:sender:]):
1993         (-[WKContentView setTextColorForWebView:sender:]):
1994         (-[WKContentView canPerformActionForWebView:withSender:]):
1995
1996         Check for the new action selectors here, and additionally add validation for `_pasteAsQuotation:`. Let the
1997         unprefixed versions of these methods simply call the prefixed versions (these method implementations will be
1998         removed in a followup once doing so would not affect any clients of WebKit).
1999
2000         * WebKit.xcodeproj/project.pbxproj:
2001         * WebProcess/WebPage/WebPage.cpp:
2002         (WebKit::WebPage::increaseListLevel):
2003         (WebKit::WebPage::decreaseListLevel):
2004         (WebKit::WebPage::changeListType):
2005         * WebProcess/WebPage/WebPage.h:
2006         * WebProcess/WebPage/WebPage.messages.in:
2007
2008         Add stubs for several list editing commands that are yet to be hooked up to WebCore. These will be implemented
2009         in a future patch.
2010
2011 2018-11-09  Antti Koivisto  <antti@apple.com>
2012
2013         Use OptionSet for layout milestones
2014         https://bugs.webkit.org/show_bug.cgi?id=191470
2015
2016         Reviewed by Dean Jackson.
2017
2018         * Shared/API/Cocoa/_WKRenderingProgressEventsInternal.h:
2019         (renderingProgressEvents):
2020         * Shared/API/c/WKSharedAPICast.h:
2021         (WebKit::toWKLayoutMilestones):
2022         (WebKit::toLayoutMilestones):
2023         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
2024         (WebKit::RemoteLayerTreeTransaction::newlyReachedLayoutMilestones const):
2025         (WebKit::RemoteLayerTreeTransaction::setNewlyReachedLayoutMilestones):
2026         * Shared/WebPageCreationParameters.cpp:
2027         (WebKit::WebPageCreationParameters::encode const):
2028         (WebKit::WebPageCreationParameters::decode):
2029         * Shared/WebPageCreationParameters.h:
2030         * UIProcess/API/APILoaderClient.h:
2031         (API::LoaderClient::didReachLayoutMilestone):
2032         * UIProcess/API/APINavigationClient.h:
2033         (API::NavigationClient::renderingProgressDidChange):
2034         * UIProcess/API/C/WKPage.cpp:
2035         (WKPageSetPageLoaderClient):
2036         (WKPageSetPageNavigationClient):
2037         * UIProcess/API/C/WKPageRenderingProgressEventsInternal.h:
2038         (pageRenderingProgressEvents):
2039         * UIProcess/API/Cocoa/WKWebView.mm:
2040         (layoutMilestones):
2041         * UIProcess/Cocoa/NavigationState.h:
2042         * UIProcess/Cocoa/NavigationState.mm:
2043         (WebKit::NavigationState::NavigationClient::renderingProgressDidChange):
2044         * UIProcess/WebPageProxy.cpp:
2045         (WebKit::WebPageProxy::listenForLayoutMilestones):
2046         (WebKit::WebPageProxy::didLayoutForCustomContentProvider):
2047         (WebKit::WebPageProxy::didReachLayoutMilestone):
2048         * UIProcess/WebPageProxy.h:
2049         * UIProcess/WebPageProxy.messages.in:
2050         * UIProcess/ios/WebPageProxyIOS.mm:
2051         (WebKit::WebPageProxy::didCommitLayerTree):
2052         * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
2053         (API::InjectedBundle::PageLoaderClient::didReachLayoutMilestone):
2054         (API::InjectedBundle::PageLoaderClient::layoutMilestones const):
2055         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
2056         (WebKit::InjectedBundlePageLoaderClient::didReachLayoutMilestone):
2057         (WebKit::InjectedBundlePageLoaderClient::layoutMilestones const):
2058         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
2059         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2060         (WebKit::WebFrameLoaderClient::dispatchDidReachLayoutMilestone):
2061         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2062         * WebProcess/WebPage/DrawingArea.h:
2063         (WebKit::DrawingArea::dispatchDidReachLayoutMilestone):
2064         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
2065         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
2066         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
2067         (WebKit::RemoteLayerTreeDrawingArea::dispatchDidReachLayoutMilestone):
2068         * WebProcess/WebPage/WebPage.cpp:
2069         (WebKit::m_shouldAttachDrawingAreaOnPageTransition):
2070         (WebKit::WebPage::listenForLayoutMilestones):
2071         (WebKit::WebPage::dispatchDidReachLayoutMilestone):
2072         * WebProcess/WebPage/WebPage.h:
2073         * WebProcess/WebPage/WebPage.messages.in:
2074         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
2075         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2076         (WebKit::TiledCoreAnimationDrawingArea::sendPendingNewlyReachedLayoutMilestones):
2077         (WebKit::TiledCoreAnimationDrawingArea::dispatchDidReachLayoutMilestone):
2078
2079 2018-11-09  Daniel Bates  <dabates@apple.com>
2080
2081         [iOS] Draw caps lock indicator in password fields
2082         https://bugs.webkit.org/show_bug.cgi?id=190565
2083         <rdar://problem/45262343>
2084
2085         Reviewed by Dean Jackson.
2086
2087         Notify the WebContent process with the current modifer state on window activation changes. Notify
2088         the WebContent process when hardware keyboard availability changes (e.g. a keyboard is attached).
2089
2090         * UIProcess/API/Cocoa/WKWebView.mm:
2091         (-[WKWebView _initializeWithConfiguration:]): Register for hardware keyboard availability changed notifications.
2092         (-[WKWebView dealloc]): Unregister from hardware availability changed notifications.
2093         (hardwareKeyboardAvailabilityChangedCallback): Added.
2094         * UIProcess/WebPageProxy.cpp:
2095         (WebKit::WebPageProxy::updateCurrentModifierState): Compile this code when building for iOS.
2096         * UIProcess/WebPageProxy.h:
2097         * UIProcess/ios/WKContentViewInteraction.mm:
2098         (-[WKContentView _handleKeyUIEvent:]): Update the current modifier state if this event is a hardware
2099         keyboard flags changed event.
2100         * UIProcess/ios/WebPageProxyIOS.mm:
2101         (WebKit::WebPageProxy::hardwareKeyboardAvailabilityChanged): Added.
2102
2103         * WebProcess/WebPage/WebPage.h:
2104         * WebProcess/WebPage/WebPage.messages.in:
2105         * WebProcess/WebPage/ios/WebPageIOS.mm:
2106         (WebKit::WebPage::hardwareKeyboardAvailabilityChanged):
2107         Added new message HardwareKeyboardAvailabilityChanged. Notify the focused HTML input element (if we have
2108         one) that the caps lock state may have changed when we receive message HardwareKeyboardAvailabilityChanged
2109         so that we toggle visibility of the caps lock indicator.
2110
2111 2018-11-09  Tim Horton  <timothy_horton@apple.com>
2112
2113         Make use of _UIRemoteView instead of CALayerHost if possible for WKRemoteView
2114         https://bugs.webkit.org/show_bug.cgi?id=191449
2115         <rdar://problem/45884977>
2116
2117         Reviewed by Eric Carlson.
2118
2119         UIRemoteView has some nice process assertion management that it would
2120         be nice to not duplicate. So, we can just use it instead of CALayerHost!
2121
2122         * Platform/spi/ios/UIKitSPI.h:
2123         * UIProcess/DrawingAreaProxy.h:
2124         (WebKit::DrawingAreaProxy::page const):
2125         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
2126         (-[WKUIRemoteView hitTest:withEvent:]):
2127         (-[WKUIRemoteView description]):
2128         (createRemoteView):
2129         (WebKit::RemoteLayerTreeHost::createLayer):
2130
2131 2018-11-09  Eric Carlson  <eric.carlson@apple.com>
2132
2133         [MediaStream] Make screen capture an experimental feature
2134         https://bugs.webkit.org/show_bug.cgi?id=191472
2135         <rdar://problem/45946499>
2136
2137         Reviewed by Jer Noble.
2138
2139         * Shared/WebPreferences.yaml: Make ScreenCaptureEnabled an experimental feature.
2140
2141 2018-11-09  Daniel Bates  <dabates@apple.com>
2142
2143         [iOS] Pressing forward delete key in text field does nothing and we should not invoke an editor
2144         action when forward delete is pressed outside a text field
2145         https://bugs.webkit.org/show_bug.cgi?id=190566
2146         <rdar://problem/45262367>
2147
2148         Reviewed by Wenson Hsieh.
2149
2150         Override -_deleteForwardAndNotify to perform a forward deletion and remove the dead code that
2151         expected UIKit to send us a character string with 0xF728 for the forward delete key. UIKit
2152         ceased doing this many years ago. We may revist this decision once <rdar://problem/45772078>
2153         is fixed.
2154
2155         * UIProcess/ios/WKContentViewInteraction.mm:
2156         (-[WKContentView _interpretKeyEvent:isCharEvent:]):
2157         (-[WKContentView _deleteForwardAndNotify:]):
2158
2159 2018-11-08  Wenson Hsieh  <wenson_hsieh@apple.com>
2160
2161         Unreviewed, try to fix the 32-bit macOS build
2162
2163         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2164         (WebKit::PDFPlugin::showDefinitionForAttributedString):
2165
2166 2018-11-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
2167
2168         Add an SPI to allow WebView clients to add additional supported image formats
2169         https://bugs.webkit.org/show_bug.cgi?id=190454
2170
2171         Reviewed by Simon Fraser.
2172
2173         * Platform/mac/StringUtilities.h:
2174         * Platform/mac/StringUtilities.mm:
2175         (WebKit::webCoreStringVectorFromNSStringArray):
2176         A helper function which converts an NSArray of NSStrings to a Vector of
2177         WTFString.
2178
2179         * Shared/WebPageCreationParameters.cpp:
2180         (WebKit::WebPageCreationParameters::encode const):
2181         (WebKit::WebPageCreationParameters::decode):
2182         * Shared/WebPageCreationParameters.h:
2183         Handle encoding and decoding the AdditionalSupportedImageTypes which will
2184         allow transferring it from the UI process to the web process.
2185
2186         * UIProcess/API/APIPageConfiguration.h:
2187         (API::PageConfiguration::additionalSupportedImageTypes const):
2188         (API::PageConfiguration::setAdditionalSupportedImageTypes):
2189         Store the AdditionalSupportedImageTypes in the APIPageConfiguration
2190         which is used when creating the WebPageProxy in the UIPorcess.
2191
2192         * UIProcess/API/Cocoa/WKWebView.mm:
2193         (-[WKWebView _initializeWithConfiguration:]):
2194         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2195         (-[WKWebViewConfiguration copyWithZone:]):
2196         (-[WKWebViewConfiguration _additionalSupportedImageTypes]):
2197         (-[WKWebViewConfiguration _setAdditionalSupportedImageTypes:]):
2198         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2199         Setter/Getter for the AdditionalSupportedImageTypes.
2200
2201         * UIProcess/WebPageProxy.cpp:
2202         (WebKit::WebPageProxy::creationParameters):
2203         Copy the AdditionalSupportedImageTypes from APIPageConfiguration to 
2204         WebPageCreationParameters.
2205
2206         * UIProcess/WebPageProxy.h:
2207         Delete unimplemented function.
2208
2209         * WebProcess/WebPage/WebPage.cpp:
2210         (WebKit::m_shouldAttachDrawingAreaOnPageTransition):
2211         Copy the AdditionalSupportedImageTypes from WebPageCreationParameters to
2212         WebCore.
2213
2214 2018-11-08  Megan Gardner  <megan_gardner@apple.com>
2215
2216         Adopt Reveal Framework to replace Lookup
2217         https://bugs.webkit.org/show_bug.cgi?id=191097
2218         <rdar://problem/45924508>
2219
2220         Reviewed by Tim Horton.
2221
2222         Pass in what it needed to clear the textIndicators. This is better than
2223         the current notification structure.
2224
2225         * UIProcess/Cocoa/WebViewImpl.mm:
2226         (-[WKWindowVisibilityObserver dealloc]):
2227         (-[WKWindowVisibilityObserver startObservingLookupDismissalIfNeeded]):
2228         * UIProcess/mac/PageClientImplMac.mm:
2229         (WebKit::PageClientImpl::didPerformDictionaryLookup):
2230         * UIProcess/mac/WKImmediateActionController.mm:
2231         (-[WKImmediateActionController _animationControllerForText]):
2232         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2233         (WebKit::PDFPlugin::showDefinitionForAttributedString):
2234
2235         Generate and pass in the text indicator information, as this is needed now.
2236
2237         * WebProcess/WebPage/mac/WebPageMac.mm:
2238         (WebKit::WebPage::dictionaryPopupInfoForSelectionInPDFPlugin):
2239
2240 2018-11-08  Keith Rollin  <krollin@apple.com>
2241
2242         Create .xcfilelist files
2243         https://bugs.webkit.org/show_bug.cgi?id=191324
2244         <rdar://problem/45852819>
2245
2246         Reviewed by Alex Christensen.
2247
2248         As part of preparing for enabling XCBuild, create and use .xcfilelist
2249         files. These files are using during Run Script build phases in an
2250         Xcode project. If a Run Script build phase produces new files that are
2251         used later as inputs to subsequent build phases, XCBuild needs to know
2252         about these files. These files can be either specified in an "output
2253         files" section of the Run Script phase editor, or in .xcfilelist files
2254         that are associated with the Run Script build phase.
2255
2256         This patch takes the second approach. It consists of three sets of changes:
2257
2258         - Modify the DerivedSources.make files to have a
2259           'print_all_generated_files" target that produces a list of the files
2260           they create.
2261
2262         - Create a shell script that produces .xcfilelist files from the
2263           output of the previous step, as well as for the files created in the
2264           Generate Unified Sources build steps.
2265
2266         - Add the new .xcfilelist files to the associated projects.
2267
2268         Note that, with these changes, the Xcode workspace and projects can no
2269         longer be fully loaded into Xcode 9. Xcode will attempt to load the
2270         projects that have .xcfilelist files associated with them, but will
2271         fail and display a placeholder for those projects instead. It's
2272         expected that all developers are using Xcode 10 by now and that not
2273         being able to load into Xcode 9 is not a practical issue. Keep in mind
2274         that this is strictly an IDE issue, and that the projects can still be
2275         built with `xcodebuild`.
2276
2277         Also note that the shell script that creates the .xcfilelist files can
2278         also be used to verify that the set of files that's currently checked
2279         in is up-to-date. This checking can be used as part of a check-in hook
2280         or part of check-webkit-style to sooner catch cases where the
2281         .xcfilelist files need to be regenerated.
2282
2283         * DerivedSources.make:
2284         * DerivedSources.xcfilelist: Added.
2285         * UnifiedSources.xcfilelist: Added.
2286         * WebKit.xcodeproj/project.pbxproj:
2287
2288 2018-11-08  Timothy Hatcher  <timothy@apple.com>
2289
2290         Add experimental support for a `supported-color-schemes` CSS property.
2291         https://bugs.webkit.org/show_bug.cgi?id=191319
2292         rdar://problem/45852261
2293
2294         Reviewed by Dean Jackson.
2295
2296         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
2297         (WebKit::InjectedBundleRangeHandle::renderedImage):
2298         * WebProcess/WebPage/WebPage.cpp:
2299         (WebKit::WebPage::drawRect):
2300
2301 2018-11-08  Eric Carlson  <eric.carlson@apple.com>
2302
2303         [MediaStream] Use DeviceIdHashSaltStorage to generate device ID hash salt
2304         https://bugs.webkit.org/show_bug.cgi?id=190825
2305         <rdar://problem/45486085>
2306
2307         Reviewed by Youenn Fablet.
2308
2309         * UIProcess/API/C/WKUserMediaPermissionCheck.cpp:
2310         (WKUserMediaPermissionCheckSetUserMediaAccessInfo):
2311         * UIProcess/API/glib/WebKitDeviceInfoPermissionRequest.cpp:
2312         (webkitDeviceInfoPermissionRequestAllow):
2313         (webkitDeviceInfoPermissionRequestDeny):
2314         * UIProcess/Cocoa/UIDelegate.mm:
2315         (WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin):
2316         * UIProcess/DeviceIdHashSaltStorage.cpp:
2317         (WebKit::DeviceIdHashSaltStorage::regenerateDeviceIdHashSaltForOrigin):
2318         (WebKit::DeviceIdHashSaltStorage::deleteDeviceIdHashSaltForOrigin):
2319         * UIProcess/DeviceIdHashSaltStorage.h:
2320         * UIProcess/UserMediaPermissionCheckProxy.cpp:
2321         (WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo):
2322         * UIProcess/UserMediaPermissionCheckProxy.h:
2323         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2324         (WebKit::UserMediaPermissionRequestManagerProxy::createPermissionRequest):
2325         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
2326         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
2327         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo):
2328         (WebKit::UserMediaPermissionRequestManagerProxy::updateDeviceIDHashSalt):
2329         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
2330         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
2331         * UIProcess/UserMediaPermissionRequestProxy.cpp:
2332         (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy):
2333         * UIProcess/UserMediaPermissionRequestProxy.h:
2334         (WebKit::UserMediaPermissionRequestProxy::create):
2335         (WebKit::UserMediaPermissionRequestProxy::deviceIdentifierHashSalt const): Deleted.
2336
2337 2018-11-08  Carlos Garcia Campos  <cgarcia@igalia.com>
2338
2339         [GTK] Crash when running with sandbox enabled
2340         https://bugs.webkit.org/show_bug.cgi?id=191353
2341
2342         Reviewed by Michael Catanzaro.
2343
2344         g_key_file_set_string_list() expects a null-terminated array as parameter.
2345
2346         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
2347         (WebKit::createFlatpakInfo): Append nullptr to sharedPermissions array.
2348
2349 2018-11-07  Chris Dumez  <cdumez@apple.com>
2350
2351         Unreviewed, fix iOS build with recent SDKs.
2352
2353         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
2354         (-[WKFullScreenWindowController _EVOrganizationName]):
2355
2356 2018-11-07  John Wilander  <wilander@apple.com>
2357
2358         Resource Load Statistics: Enable cap on partitioned cache max age
2359         https://bugs.webkit.org/show_bug.cgi?id=191395
2360         <rdar://problem/45885977>
2361
2362         Reviewed by Chris Dumez.
2363
2364         This change does not bump the network cache revision number.
2365         It's not needed since it was done just a week ago.
2366
2367         * UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
2368         (WebKit::ResourceLoadStatisticsMemoryStore::setCacheMaxAgeCap):
2369         (WebKit::ResourceLoadStatisticsMemoryStore::updateCacheMaxAgeCap):
2370         * UIProcess/ResourceLoadStatisticsMemoryStore.h:
2371         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2372         (WebKit::WebResourceLoadStatisticsStore::didCreateNetworkProcess):
2373
2374 2018-11-07  Daniel Bates  <dabates@apple.com>
2375
2376         [iOS] Support deleting to the start of the line and to the end of the line
2377         https://bugs.webkit.org/show_bug.cgi?id=191389
2378         <rdar://problem/45883972>
2379
2380         Reviewed by Wenson Hsieh.
2381
2382         Add support for the key commands Command + Delete and Control + K to delete to the start
2383         of the line and to delete to the end of the line, respectively.
2384
2385         * UIProcess/ios/WKContentViewInteraction.mm:
2386         (-[WKContentView _deleteToStartOfLine]): Added.
2387         (-[WKContentView _deleteToEndOfLine]): Added.
2388
2389 2018-11-07  Daniel Bates  <dabates@apple.com>
2390
2391         [iOS] Option + Delete should delete previous word
2392         https://bugs.webkit.org/show_bug.cgi?id=191381
2393         <rdar://problem/23681351>
2394
2395         Reviewed by Wenson Hsieh.
2396
2397         Implement support for pressing Option + Delete to delete the previous word. This makes text editing
2398         in WebKit more closely match the platform conventions.
2399
2400         * UIProcess/ios/WKContentViewInteraction.mm:
2401         (-[WKContentView _deleteByWord]):
2402
2403 2018-11-07  Daniel Bates  <dabates@apple.com>
2404
2405         Override +[UIKeyboard isInHardwareKeyboardMode] in WebKitTestRunner and DumpRenderTree
2406         https://bugs.webkit.org/show_bug.cgi?id=190141
2407
2408         Reviewed by Darin Adler.
2409
2410         Directly use +[UIKeyboard isInHardwareKeyboardMode]. We will override this class method
2411         in DumpRenderTree and WebKitTestRunner to always return NO so as to make test runs
2412         deterministic regardless of whether a hardware keyboard is attached.
2413
2414         * Shared/NativeWebKeyboardEvent.h:
2415         * Shared/ios/NativeWebKeyboardEventIOS.mm:
2416         (WebKit::isInHardwareKeyboardMode): Deleted.
2417         * UIProcess/ios/WKContentViewInteraction.mm:
2418         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
2419         * WebProcess/WebPage/ios/WebPageIOS.mm:
2420         (WebKit::WebPage::platformEditorState const):
2421
2422 2018-11-07  Zamiul Haque  <zhaque@apple.com>
2423
2424         Force a gregorian calendar to show for credit card expiration date inputs
2425         (autocomplete='cc-exp'*) regardless of default system settings.
2426         https://bugs.webkit.org/show_bug.cgi?id=191096
2427         rdar://problem/42640256
2428
2429         Reviewed by Tim Horton.
2430
2431         Added some plumbing code to expose the calendar identifier of the calendar used by a
2432         presented date picker. Added shouldPresentGregorianCalendar:, to be used for
2433         determining what property values a date input control must present a Gregorian
2434         calendar for.
2435
2436         * UIProcess/ios/WKContentViewInteraction.mm:
2437         (-[WKContentView formInputPeripheral]):
2438         * UIProcess/ios/forms/WKFormInputControl.mm:
2439
2440 2018-11-07  Carlos Garcia Campos  <cgarcia@igalia.com>
2441
2442         Unreviewed. Fix GTK/WPE build when memfd is not available after r237922.
2443
2444         * Platform/unix/SharedMemoryUnix.cpp:
2445         (WebKit::createSharedMemory):
2446
2447 2018-11-07  Carlos Garcia Campos  <cgarcia@igalia.com>
2448
2449         [Linux] Use memfd_create when available in SharedMemory implementation
2450         https://bugs.webkit.org/show_bug.cgi?id=189741
2451
2452         Reviewed by Michael Catanzaro.
2453
2454         If memfd is available, use it instead of shm_open.
2455
2456         * Platform/unix/SharedMemoryUnix.cpp:
2457         (WebKit::createSharedMemory): Helper to create the shared memory, trying first with memfd and falling back to
2458         shm if it's not available.
2459         (WebKit::SharedMemory::create): Use createSharedMemory() helper.
2460
2461 2018-11-06  Justin Fan  <justin_fan@apple.com>
2462
2463         [WebGPU] Experimental prototype for WebGPURenderPipeline and WebGPUSwapChain
2464         https://bugs.webkit.org/show_bug.cgi?id=191291
2465
2466         Reviewed by Myles Maxfield.
2467
2468         Properly disable WEBGPU on all non-Metal platforms for now.
2469
2470         * Configurations/FeatureDefines.xcconfig:
2471
2472 2018-11-06  Youenn Fablet  <youenn@apple.com>
2473
2474         Make mDNS ICE Candidate an experimental flag again
2475         https://bugs.webkit.org/show_bug.cgi?id=191262
2476
2477         Reviewed by Dean Jackson.
2478
2479         * Shared/WebPreferences.yaml:
2480         * UIProcess/API/C/WKPreferences.cpp:
2481         (WKPreferencesSetWebRTCMDNSICECandidatesEnabled):
2482         (WKPreferencesGetWebRTCMDNSICECandidatesEnabled):
2483         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2484         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2485
2486 2018-11-06  Suresh Koppisetty  <skoppisetty@apple.com>
2487
2488         Don’t use the main queue to create an XPC connection.
2489         https://bugs.webkit.org/show_bug.cgi?id=191160
2490         <rdar://problem/45736262>
2491
2492         Reviewed by Geoffrey Garen.
2493
2494         Don't use the main queue to create an XPC connection. xpc_connection_set_bootstrap does
2495         dispatch_mach_send_barrier_f on this queue which delays the sending of the subsequent
2496         bootstrap message (sent to launchd for launching a new target process) when the main queue is busy.
2497
2498         Now that the XPC connection runs on the default concurrent queue, errorHandler could be invoked
2499         by any thread. The job of errorHandler is to dispatch errorHandlerImpl to the main thread,
2500         where errorHandlerImpl is responsible for the actual handling of errors if any.
2501
2502         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2503         (WebKit::ProcessLauncher::launchProcess):
2504
2505 2018-11-06  Brian Burg  <bburg@apple.com>
2506
2507         Add missing iOS availability macro to _WKAutomationSessionConfiguration
2508         https://bugs.webkit.org/show_bug.cgi?id=191320
2509
2510         Reviewed by Tim Horton.
2511
2512         * UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.h:
2513
2514 2018-11-06  John Wilander  <wilander@apple.com>
2515
2516         Resource Load Statistics: Remove cap on partitioned cache max age if it matches a network reload (redirect-only)
2517         https://bugs.webkit.org/show_bug.cgi?id=189760
2518         <rdar://problem/44612242>
2519
2520         Reviewed by Youenn Fablet and Antti Koivisto.
2521
2522         When a redirect cache entry for a prevalent resource reaches its max
2523         age cap, it is loaded again from the network and the network response
2524         is compared with what's in the cache. If it's a match, the cache entry
2525         is fully accepted. If not, a new capped cache entry is created.
2526
2527         This feature is still off by default.
2528
2529         * NetworkProcess/NetworkResourceLoader.cpp:
2530         (WebKit::NetworkResourceLoader::canUseCachedRedirect const):
2531             Now checks the new member m_cacheEntryForMaxAgeCapValidation.
2532         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
2533             New case handled for entry->hasReachedPrevalentResourceAgeCap().
2534         (WebKit::NetworkResourceLoader::validateCacheEntryForMaxAgeCapValidation):
2535             This is where the new logic compares the incoming redirect with the
2536             cached one. If they match, an uncapped entry is allowed to be stored.
2537             If they don't match, a new capped entry will be stored.
2538         (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
2539             Now calls the new
2540             NetworkResourceLoader::validateCacheEntryForMaxAgeCapValidation()
2541             function.
2542         * NetworkProcess/NetworkResourceLoader.h:
2543             Added the m_cacheEntryForMaxAgeCapValidation member.
2544         * NetworkProcess/cache/NetworkCache.cpp:
2545         (WebKit::NetworkCache::makeUseDecision):
2546             Restored to previous behavior which means
2547             UseDecision::NoDueToPrevalentResourceAgeCap was removed.
2548         (WebKit::NetworkCache::Cache::retrieve):
2549             Restored to previous behavior.
2550         (WebKit::NetworkCache::Cache::storeRedirect):
2551             Now takes the optional maxAgeCap and caps the entry's max age if it's set.
2552         (WebKit::NetworkCache::hasReachedPrevalentResourceAgeCap): Deleted.
2553         * NetworkProcess/cache/NetworkCache.h:
2554         * NetworkProcess/cache/NetworkCacheEntry.cpp:
2555         (WebKit::NetworkCache::Entry::encodeAsStorageRecord const):
2556             Now encodes m_maxAgeCap.
2557         (WebKit::NetworkCache::Entry::decodeStorageRecord):
2558             Now decodes m_maxAgeCap.
2559         (WebKit::NetworkCache::Entry::hasReachedPrevalentResourceAgeCap const):
2560             Added.
2561         (WebKit::NetworkCache::Entry::capMaxAge):
2562             Added.
2563         * NetworkProcess/cache/NetworkCacheEntry.h:
2564             Added the optional m_maxAgeCap.
2565         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
2566         (WebKit::NetworkCache::SpeculativeLoad::willSendRedirectedRequest):
2567             Now gets the optional max age cap from the NetworkStorageSession and sends it
2568             to Cache::storeRedirect().
2569         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
2570         (WebKit::NetworkCache::cachedEntryReuseFailureToDiagnosticKey):
2571             Removed handling of UseDecision::NoDueToPrevalentResourceAgeCap.
2572
2573 2018-11-06  Per Arne Vollan  <pvollan@apple.com>
2574
2575         REGRESSION (r230523): Caps lock indicator not shown in password field
2576         https://bugs.webkit.org/show_bug.cgi?id=190056
2577
2578         Reviewed by Ryosuke Niwa.
2579
2580         Update cached modifier state in the WebProcess when WebKit::WebPage::keyEvent is called, and
2581         when the window becomes active.
2582
2583         * UIProcess/WebPageProxy.cpp:
2584         (WebKit::WebPageProxy::dispatchActivityStateChange):
2585         (WebKit::WebPageProxy::updateCurrentModifierState):
2586         * UIProcess/WebPageProxy.h:
2587         * WebProcess/WebPage/WebPage.cpp:
2588         (WebKit::WebPage::keyEvent):
2589         (WebKit::WebPage::updateCurrentModifierState):
2590         * WebProcess/WebPage/WebPage.h:
2591         * WebProcess/WebPage/WebPage.messages.in:
2592
2593 2018-11-06  Alex Christensen  <achristensen@webkit.org>
2594
2595         Add ObjC SPI equivalent of WKContextHandlesSafeBrowsing
2596         https://bugs.webkit.org/show_bug.cgi?id=191329
2597
2598         Reviewed by Tim Horton.
2599
2600         Like WKContextHandlesSafeBrowsing, this is so I can make one change in WebKit and enable safe browsing
2601         in WKWebView and disable it in Safari at the same time without broken revisions between landing two changes
2602         in two repositories.
2603
2604         * UIProcess/API/Cocoa/WKWebView.mm:
2605         (+[WKWebView handlesSafeBrowsing]):
2606         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2607
2608 2018-11-06  Eric Carlson  <eric.carlson@apple.com>
2609
2610         [MediaStream] User should not be prompted again after denying getDisplayMedia request
2611         https://bugs.webkit.org/show_bug.cgi?id=191227
2612         <rdar://problem/45784512>
2613
2614         Reviewed by Youenn Fablet.
2615
2616         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2617         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied):
2618         (WebKit::UserMediaPermissionRequestManagerProxy::wasRequestDenied):
2619         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
2620         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
2621
2622 2018-11-06  Fujii Hironori  <Hironori.Fujii@sony.com>
2623
2624         [MediaStream] User should not be prompted again after denying getDisplayMedia request
2625         https://bugs.webkit.org/show_bug.cgi?id=191227
2626         <rdar://problem/45784512>
2627
2628         Unreviewed build fix of ports not ENABLE(MEDIA_STREAM).
2629
2630         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: Define getRequestAction only if ENABLE(MEDIA_STREAM).
2631         * UIProcess/UserMediaPermissionRequestManagerProxy.h: Ditto.
2632
2633 2018-11-03  Alex Christensen  <achristensen@webkit.org>
2634
2635         [Mac] Implement safe browsing in WebKit
2636         https://bugs.webkit.org/show_bug.cgi?id=188871
2637
2638         Reviewed by Tim Horton.
2639
2640         * Platform/spi/Cocoa/SafeBrowsingSPI.h:
2641         * Resources/SafeBrowsing.xcassets: Added.
2642         * Resources/SafeBrowsing.xcassets/Contents.json: Added.
2643         * Resources/SafeBrowsing.xcassets/WKSafeBrowsingWarningBackground.colorset: Added.
2644         * Resources/SafeBrowsing.xcassets/WKSafeBrowsingWarningBackground.colorset/Contents.json: Added.
2645         * Resources/SafeBrowsing.xcassets/WKSafeBrowsingWarningText.colorset: Added.
2646         * Resources/SafeBrowsing.xcassets/WKSafeBrowsingWarningText.colorset/Contents.json: Added.
2647         * Resources/SafeBrowsing.xcassets/WKSafeBrowsingWarningTitle.colorset: Added.
2648         * Resources/SafeBrowsing.xcassets/WKSafeBrowsingWarningTitle.colorset/Contents.json: Added.
2649         * Shared/WebPreferences.yaml:
2650         * Shared/WebPreferencesDefaultValues.h:
2651         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
2652         (WKContextHandlesSafeBrowsing):
2653         * UIProcess/Cocoa/SafeBrowsingResultCocoa.mm:
2654         (WebKit::malwareDetailsBase):
2655         (WebKit::learnMore):
2656         (WebKit::reportAnErrorBase):
2657         (WebKit::localizedProvider):
2658         (WebKit::SafeBrowsingResult::SafeBrowsingResult):
2659         * UIProcess/Cocoa/WKSafeBrowsingWarning.h: Added.
2660         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm: Added.
2661         (confirmMalwareSentinel):
2662         (visitUnsafeWebsiteSentinel):
2663         (colorNamed):
2664         (replace):
2665         (addLinkAndReplace):
2666         (-[WKSafeBrowsingExclamationPoint drawRect:]):
2667         (-[WKSafeBrowsingExclamationPoint intrinsicContentSize]):
2668         (reportAnErrorURL):
2669         (malwareDetailsURL):
2670         (titleText):
2671         (warningText):
2672         (detailsText):
2673         (-[WKSafeBrowsingWarning initWithFrame:safeBrowsingResult:completionHandler:]):
2674         (-[WKSafeBrowsingWarning dealloc]):
2675         (-[WKSafeBrowsingWarning goBackClicked]):
2676         (-[WKSafeBrowsingWarning clickedOnLink:]):
2677         (-[WKSafeBrowsingWarning showDetailsClicked]):
2678         (+[WKSafeBrowsingTextView viewWithAttributedString:linkTarget:]):
2679         (+[WKSafeBrowsingTextView viewWithString:]):
2680         (-[WKSafeBrowsingTextView intrinsicContentSize]):
2681         (-[WKSafeBrowsingTextView clickedOnLink:atIndex:]):
2682         * UIProcess/Cocoa/WebViewImpl.h:
2683         * UIProcess/Cocoa/WebViewImpl.mm:
2684         (WebKit::WebViewImpl::showSafeBrowsingWarning):
2685         (WebKit::WebViewImpl::clearSafeBrowsingWarning):
2686         (WebKit::WebViewImpl::setFrameSize):
2687         * UIProcess/PageClient.h:
2688         (WebKit::PageClient::showSafeBrowsingWarning):
2689         (WebKit::PageClient::clearSafeBrowsingWarning):
2690         * UIProcess/SafeBrowsingResult.h:
2691         (WebKit::SafeBrowsingResult::url const):
2692         (WebKit::SafeBrowsingResult::provider const):
2693         (WebKit::SafeBrowsingResult::localizedProviderName const):
2694         (WebKit::SafeBrowsingResult::malwareDetailsURLBase const):
2695         (WebKit::SafeBrowsingResult::reportAnErrorURLBase const):
2696         (WebKit::SafeBrowsingResult::learnMoreURL const):
2697         (WebKit::SafeBrowsingResult::needsSafeBrowsingWarning const):
2698         (WebKit::SafeBrowsingResult::isKnownToBeUnsafe const): Deleted.
2699         * UIProcess/WebPageProxy.cpp:
2700         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2701         * UIProcess/ios/PageClientImplIOS.h:
2702         * UIProcess/ios/PageClientImplIOS.mm:
2703         (WebKit::PageClientImpl::showSafeBrowsingWarning):
2704         (WebKit::PageClientImpl::clearSafeBrowsingWarning):
2705         * UIProcess/mac/PageClientImplMac.h:
2706         * UIProcess/mac/PageClientImplMac.mm:
2707         (WebKit::PageClientImpl::setImpl):
2708         (WebKit::PageClientImpl::showSafeBrowsingWarning):
2709         (WebKit::PageClientImpl::clearSafeBrowsingWarning):
2710         * WebKit.xcodeproj/project.pbxproj:
2711
2712 2018-11-05  Zan Dobersek  <zdobersek@igalia.com>
2713
2714         [WPE] Remove BackingStore, BackingStoreCairo implementation files from build
2715         https://bugs.webkit.org/show_bug.cgi?id=191269
2716
2717         Reviewed by Michael Catanzaro.
2718
2719         * SourcesWPE.txt: Drop the BackingStore.cpp and BackingStoreCairo.cpp
2720         files from the WPE build. These are not used at all in WPE configuration
2721         as they are only used by the GTK+ port for non-AC functionality.
2722
2723 2018-11-05  Chris Dumez  <cdumez@apple.com>
2724
2725         Use same limit for page cache and suspended pages
2726         https://bugs.webkit.org/show_bug.cgi?id=191266
2727
2728         Reviewed by Geoffrey Garen.
2729
2730         Use same limit for page cache and suspended pages as they serve the same purpose.
2731
2732         * UIProcess/API/Cocoa/WKProcessPool.mm:
2733         (-[WKProcessPool _maximumSuspendedPageCount]):
2734         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2735         * UIProcess/WebProcessPool.cpp:
2736         (WebKit::WebProcessPool::updateMaxSuspendedPageCount):
2737         (WebKit::WebProcessPool::setCacheModel):
2738         (WebKit::WebProcessPool::addSuspendedPageProxy):
2739         * UIProcess/WebProcessPool.h:
2740
2741 2018-11-05  Wenson Hsieh  <wenson_hsieh@apple.com>
2742
2743         [iOS] Allow WKWebView clients to customize bar button item groups in the accessory view when editing
2744         https://bugs.webkit.org/show_bug.cgi?id=191240
2745         <rdar://problem/44872806>
2746
2747         Reviewed by Tim Horton.
2748
2749         Allow WKWebView clients to override WKContentView's default input assistant item by plumbing the call to
2750         `-inputAssistantItem` through `-[WKWebView inputAssistantItem]`, such that if a client asks WKWebView for its
2751         input assistant item and changes its leading or trailing bar button groups, the changes will be reflected by
2752         WKContentView; additionally, this allows clients to achieve the same effect by overriding `-inputAssistantItem`
2753         on WKWebView.
2754
2755         Test:   KeyboardInputTests.ModifyInputAssistantItemBarButtonGroups
2756                 KeyboardInputTests.OverrideInputAssistantItemBarButtonGroups
2757
2758         * UIProcess/API/Cocoa/WKWebView.mm:
2759         (-[WKWebView inputAssistantItem]):
2760         * UIProcess/ios/WKContentViewInteraction.h:
2761         * UIProcess/ios/WKContentViewInteraction.mm:
2762         (-[WKContentView inputAssistantItem]):
2763
2764         Route the call to `[super inputAssistantItem]` through `-[WKWebView inputAssistantItem]`, so that the input
2765         assistant item may be overridden via WKWebView.
2766
2767         (-[WKContentView inputAssistantItemForWebView]):
2768
2769 2018-11-05  Ryan Haddad  <ryanhaddad@apple.com>
2770
2771         Unreviewed, rolling out r237785.
2772
2773         Introduced layout test and API test failures on macOS and iOS.
2774
2775         Reverted changeset:
2776
2777         "[iOS] Issue initial paint soon after the visuallyNonEmpty
2778         milestone is fired."
2779         https://bugs.webkit.org/show_bug.cgi?id=191078
2780         https://trac.webkit.org/changeset/237785
2781
2782 2018-11-05  Commit Queue  <commit-queue@webkit.org>
2783
2784         Unreviewed, rolling out r237784 and r237788.
2785         https://bugs.webkit.org/show_bug.cgi?id=191270
2786
2787         Caused mediastream layout test failures (Requested by
2788         ryanhaddad on #webkit).
2789
2790         Reverted changesets:
2791
2792         "[MediaStream] User should not be prompted again after denying
2793         getDisplayMedia request"
2794         https://bugs.webkit.org/show_bug.cgi?id=191227
2795         https://trac.webkit.org/changeset/237784
2796
2797         "[MediaStream] User should not be prompted again after denying
2798         getDisplayMedia request"
2799         https://bugs.webkit.org/show_bug.cgi?id=191227
2800         https://trac.webkit.org/changeset/237788
2801
2802 2018-11-04  Fujii Hironori  <Hironori.Fujii@sony.com>
2803
2804         [MediaStream] User should not be prompted again after denying getDisplayMedia request
2805         https://bugs.webkit.org/show_bug.cgi?id=191227
2806         <rdar://problem/45784512>
2807
2808         Unreviewed build fix of ports not ENABLE(MEDIA_STREAM).
2809
2810         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: Define getRequestAction only if ENABLE(MEDIA_STREAM).
2811         * UIProcess/UserMediaPermissionRequestManagerProxy.h: Ditto.
2812
2813 2018-11-04  Zalan Bujtas  <zalan@apple.com>
2814
2815         [iOS] Issue initial paint soon after the visuallyNonEmpty milestone is fired.
2816         https://bugs.webkit.org/show_bug.cgi?id=191078
2817         <rdar://problem/45736178>
2818
2819         Reviewed by Antti Koivisto.
2820
2821         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2822         (WebKit::WebChromeClient::layerFlushThrottlingIsActive const):
2823         * WebProcess/WebCoreSupport/WebChromeClient.h:
2824         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
2825         (WebKit::AcceleratedDrawingArea::scheduleInitialDeferredPaint):
2826         * WebProcess/WebPage/AcceleratedDrawingArea.h:
2827         * WebProcess/WebPage/DrawingArea.h:
2828         (WebKit::DrawingArea::layerFlushThrottlingIsActive const):
2829         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
2830         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
2831         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
2832         (WebKit::RemoteLayerTreeDrawingArea::setLayerTreeStateIsFrozen):
2833         (WebKit::RemoteLayerTreeDrawingArea::initialDeferredPaint):
2834         (WebKit::RemoteLayerTreeDrawingArea::scheduleInitialDeferredPaint):
2835         (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush):
2836         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
2837         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2838         (WebKit::TiledCoreAnimationDrawingArea::scheduleInitialDeferredPaint):
2839
2840 2018-11-04  Eric Carlson  <eric.carlson@apple.com>
2841
2842         [MediaStream] User should not be prompted again after denying getDisplayMedia request
2843         https://bugs.webkit.org/show_bug.cgi?id=191227
2844         <rdar://problem/45784512>
2845
2846         Reviewed by Youenn Fablet.
2847
2848         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2849         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied):
2850         (WebKit::UserMediaPermissionRequestManagerProxy::wasRequestDenied):
2851         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
2852         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
2853
2854 2018-11-03  Alex Christensen  <achristensen@webkit.org>
2855
2856         Mac production builds should sign the network process xpc service with entitlements
2857         https://bugs.webkit.org/show_bug.cgi?id=191209
2858         <rdar://problem/45377609>
2859
2860         Reviewed by Geoff Garen.
2861
2862         * Configurations/Network-OSX.entitlements: Copied from Configurations/Network-OSX-sandbox.entitlements.
2863         * Configurations/NetworkService.xcconfig:
2864         Set CODE_SIGN_ENTITLEMENTS_COCOA_TOUCH_NO like we do for the web process,
2865         except with the corresponoding network process entitlements file.
2866         * UIProcess/API/Cocoa/WKProcessPool.mm:
2867         (-[WKProcessPool _networkProcessHasEntitlementForTesting:]):
2868         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2869         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2870         (WebKit::WebProcessPool::networkProcessHasEntitlementForTesting):
2871         * UIProcess/WebProcessPool.h:
2872         * WebKit.xcodeproj/project.pbxproj:
2873         Add infrastructure to test that the network process actually has an entitlement.
2874
2875 2018-11-03  Philippe Normand  <pnormand@igalia.com>
2876
2877         [WPE] Add the WebKitVersion.h header
2878         https://bugs.webkit.org/show_bug.cgi?id=191015
2879         <rdar://problem/45647211>
2880
2881         Reviewed by Michael Catanzaro.
2882
2883         * PlatformWPE.cmake: Install the generated header as well.
2884
2885 2018-11-02  Alex Christensen  <achristensen@webkit.org>
2886
2887         Unreviewed, rolling out r237761.
2888
2889         Makes most API tests timeout and WK2 tests crash
2890
2891         Reverted changeset:
2892
2893         "Mac production builds should sign the network process xpc
2894         service with entitlements"
2895         https://bugs.webkit.org/show_bug.cgi?id=191209
2896         https://trac.webkit.org/changeset/237761
2897
2898 2018-11-02  Ryan Haddad  <ryanhaddad@apple.com>
2899
2900         Unreviewed, attempt to fix the build with recent SDKs.
2901
2902         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
2903         (WebKit::XPCServiceExit):
2904
2905 2018-11-02  Alex Christensen  <achristensen@webkit.org>
2906
2907         Mac production builds should sign the network process xpc service with entitlements
2908         https://bugs.webkit.org/show_bug.cgi?id=191209
2909         <rdar://problem/45377609>
2910
2911         Reviewed by Geoff Garen.
2912
2913         * Configurations/NetworkService.xcconfig:
2914         Set CODE_SIGN_ENTITLEMENTS_COCOA_TOUCH_NO like we do for the web process,
2915         except with the corresponoding network process entitlements file.
2916         * UIProcess/API/Cocoa/WKProcessPool.mm:
2917         (-[WKProcessPool _networkProcessHasEntitlementForTesting:]):
2918         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2919         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2920         (WebKit::WebProcessPool::networkProcessHasEntitlementForTesting):
2921         * UIProcess/WebProcessPool.h:
2922         Add infrastructure to test that the network process actually has an entitlement.
2923
2924 2018-11-02  Daniel Bates  <dabates@apple.com>
2925
2926         [iOS] WebKit should dispatch DOM events when a modifier key is pressed
2927         https://bugs.webkit.org/show_bug.cgi?id=190487
2928
2929         Reviewed by Tim Horton.
2930
2931         Add support for modifier flags change events dispatched by UIKit.
2932
2933         * Shared/ios/WebIOSEventFactory.mm:
2934         (modifiersForEvent): Update for renamed enumerations.
2935         (WebIOSEventFactory::createWebKeyboardEvent): Modifier keys do not have an associated
2936         character and do not participate in key repeat.
2937         * UIProcess/Automation/ios/WebAutomationSessionIOS.mm:
2938         (WebKit::WebAutomationSession::platformSimulateKeyboardInteraction): Update for renamed enumerations.
2939         * UIProcess/ios/WKContentViewInteraction.mm:
2940         (-[WKContentView _interpretKeyEvent:isCharEvent:]): Return NO if the event represents a
2941         modifier flags change to allow the default handling.
2942         * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
2943         (-[WKKeyboardScrollingAnimator keyboardScrollForEvent:]): Update for renamed enumerations.
2944
2945 2018-11-02  Chris Dumez  <cdumez@apple.com>
2946
2947         [PSON] Reuse SuspendedPages' process when possible, for performance
2948         https://bugs.webkit.org/show_bug.cgi?id=191166
2949
2950         Reviewed by Geoffrey Garen.
2951
2952         When process-swapping check if there is an existing SuspendedPage for the domain we're going to.
2953         If there is, use this SuspendedPage's process for the navigation instead of a fresh new process.
2954         This change should be beneficial for performance as it:
2955         - Avoids spinning up a new process (CPU & memory cost)
2956         - Likely better leverages caches since this process already loaded this domain in the past
2957
2958         Due to current limitations, using a SuspendedPage's proxy may consume the SuspendedPage, which
2959         means that it can no longer be used for PageCache on history navigations. We need to do this when
2960         the SuspendedPageProxy in question was created for the current WebPageProxy because:
2961         - This SuspendedPageProxy's process already has a suspended WebPage with this WebPageProxy's pageID
2962         and
2963         - We do not currently support having more than one WebPage with a given pageID within a single
2964           WebProcess.
2965
2966         * UIProcess/SuspendedPageProxy.cpp:
2967         (WebKit::SuspendedPageProxy::SuspendedPageProxy):
2968         * UIProcess/SuspendedPageProxy.h:
2969         * UIProcess/WebProcessPool.cpp:
2970         (WebKit::WebProcessPool::processForNavigationInternal):
2971
2972 2018-11-01  Fujii Hironori  <Hironori.Fujii@sony.com>
2973
2974         Rename <wtf/unicode/UTF8.h> to <wtf/unicode/UTF8Conversion.h> in order to avoid conflicting with ICU's unicode/utf8.h
2975         https://bugs.webkit.org/show_bug.cgi?id=189693
2976
2977         Reviewed by Yusuke Suzuki.
2978
2979         * Shared/API/APIString.h: Replaced <wtf/unicode/UTF8.h> with <wtf/unicode/UTF8Conversion.h>.
2980
2981 2018-11-01  Daniel Bates  <dabates@apple.com>
2982
2983         Cleanup: Extraneous platform guarding of -_setUpSQLiteDatabaseTrackerClient
2984         https://bugs.webkit.org/show_bug.cgi?id=191124
2985
2986         Reviewed by Tim Horton.
2987
2988         Remove the platform guard around the call to -_setUpSQLiteDatabaseTrackerClient as the
2989         implementation of that message is already guarded.
2990
2991         * UIProcess/API/Cocoa/WKWebView.mm:
2992         (-[WKWebView _initializeWithConfiguration:]):
2993
2994 2018-11-01  Ryan Haddad  <ryanhaddad@apple.com>
2995
2996         Unreviewed, attempt to fix the build with recent SDKs.
2997
2998         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
2999         (WebKit::XPCServiceInitializer):
3000
3001 2018-11-01  Sihui Liu  <sihui_liu@apple.com>
3002
3003         Add a storage limit for IndexedDB
3004         https://bugs.webkit.org/show_bug.cgi?id=190598
3005         <rdar://problem/44654715>
3006
3007         Reviewed by Chris Dumez.
3008
3009         Add SPI for testing.
3010
3011         * NetworkProcess/NetworkProcess.cpp:
3012         (WebKit::NetworkProcess::NetworkProcess):
3013         (WebKit::NetworkProcess::idbServer):
3014         (WebKit::NetworkProcess::setIDBPerOriginQuota):
3015         * NetworkProcess/NetworkProcess.h:
3016         * NetworkProcess/NetworkProcess.messages.in:
3017         * UIProcess/API/C/WKContext.cpp:
3018         (WKContextSetIDBPerOriginQuota):
3019         * UIProcess/API/C/WKContextPrivate.h:
3020         * UIProcess/WebProcessPool.cpp:
3021         (WebKit::WebProcessPool::setIDBPerOriginQuota):
3022         * UIProcess/WebProcessPool.h:
3023
3024 2018-11-01  Chris Dumez  <cdumez@apple.com>
3025
3026         [PSON] WebPageProxy::receivedNavigationPolicyDecision() should not schedule the new load asynchronously when process-swapping
3027         https://bugs.webkit.org/show_bug.cgi?id=191076
3028
3029         Reviewed by Geoffrey Garen.
3030
3031         WebPageProxy::receivedNavigationPolicyDecision() should not schedule the new load asynchronously when process-swapping.
3032         The client can request a new load synchronously after answering the policy decision, in which case we'd end up loading
3033         the wrong URL.
3034
3035         * UIProcess/WebPageProxy.cpp:
3036         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
3037         * UIProcess/WebProcessPool.cpp:
3038         (WebKit::WebProcessPool::processForNavigation):
3039         (WebKit::WebProcessPool::processForNavigationInternal):
3040         * UIProcess/WebProcessPool.h:
3041
3042 2018-11-01  Chris Dumez  <cdumez@apple.com>
3043
3044         [PSON] Unable to submit a file in FormData cross-site
3045         https://bugs.webkit.org/show_bug.cgi?id=191138
3046
3047         Reviewed by Alex Christensen.
3048
3049         When PSON is enabled, we are unable to submit a file in FormData cross-site. Although we encode the
3050         request body over IPC since r237639, we're missing the right sandbox extensions for its to work for
3051         files.
3052
3053         Update FormDataReference encoder to pass along the necessary sandbox extensions for files in the
3054         FormData, and have its decoder consume those extensions so that the recipient has access to those
3055         files. Also update LoadParameters's IPC encoder / decoder to encoder an IPC::FormDataReference
3056         (which encodes both FormData and sandbox extensions) instead of a FormData.
3057
3058         * Platform/IPC/FormDataReference.h:
3059         (IPC::FormDataReference::encode const):
3060         (IPC::FormDataReference::decode):
3061         * Shared/LoadParameters.cpp:
3062         (WebKit::LoadParameters::encode const):
3063         (WebKit::LoadParameters::decode):
3064
3065 2018-11-01  Claudio Saavedra  <csaavedra@igalia.com>
3066
3067         ERROR: ResourceLoadStatisticsPersistentStorage: Unable to delete statistics file
3068         https://bugs.webkit.org/show_bug.cgi?id=191152
3069
3070         Reviewed by Chris Dumez.
3071
3072         The statistics file is not created unconditionally, so
3073         make sure it exists before logging an error.
3074
3075         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
3076         (WebKit::ResourceLoadStatisticsPersistentStorage::clear):
3077         Check that the file exists before logging an error.
3078
3079 2018-11-01  Claudio Saavedra  <csaavedra@igalia.com>
3080
3081         [GLIB] Silent a build warning when not using Wayland
3082
3083         Unreviewed.
3084
3085         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
3086
3087 2018-11-01  Frederic Wang  <fwang@igalia.com>
3088
3089         [WebAuthN] Make AuthenticatorManager
3090         https://bugs.webkit.org/show_bug.cgi?id=189279
3091
3092         Unreviewed build fix.
3093
3094         * UIProcess/WebAuthentication/Cocoa/LocalConnection.h: Add missing headers.
3095
3096 2018-10-31  Wenson Hsieh  <wenson_hsieh@apple.com>
3097
3098         API test WKAttachmentTests.CopyAndPasteBetweenWebViews fails on macOS 10.13
3099         https://bugs.webkit.org/show_bug.cgi?id=191114
3100         <rdar://problem/45700410>
3101
3102         Reviewed by Dean Jackson.
3103
3104         Followup to r237648: also make sure that we insecurely unarchive NSFileWrapper on platforms that don't support
3105         secure archiving of file wrappers.
3106
3107         * UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
3108         (API::Attachment::updateFromSerializedRepresentation):
3109
3110 2018-10-31  Dean Jackson  <dino@apple.com>
3111
3112         Forward original fragment identifier into System Preview
3113         https://bugs.webkit.org/show_bug.cgi?id=191141
3114         <rdar://problem/45717542>
3115
3116         Reviewed by Wenson Hsieh.
3117
3118         If the URL used by the page includes a fragment identifier, use
3119         it when telling QuickLook to open a local file.
3120
3121         * UIProcess/Cocoa/DownloadClient.mm:
3122         (WebKit::DownloadClient::didFinish): Append original fragment identifier
3123         to the destination URL.
3124
3125 2018-10-31  Zalan Bujtas  <zalan@apple.com>
3126
3127         [iOS] Do not paint tap highlight unless it is above a certain threshold
3128         https://bugs.webkit.org/show_bug.cgi?id=191134
3129         <rdar://problem/43615142>
3130
3131         Flashing a large portion of the screen on every tap looks unpleasant.
3132         This patch impoves the existing heuristic by adding area check and a % threshold.  
3133
3134         Reviewed by Tim Horton.
3135
3136         * UIProcess/ios/WKContentViewInteraction.mm:
3137         (-[WKContentView _showTapHighlight]):
3138         (highlightedQuadsAreSmallerThanRect): Deleted.
3139
3140 2018-10-31  Wenson Hsieh  <wenson_hsieh@apple.com>
3141
3142         API test WKAttachmentTests.CopyAndPasteBetweenWebViews fails on macOS 10.13
3143         https://bugs.webkit.org/show_bug.cgi?id=191114
3144         <rdar://problem/45700410>
3145
3146         Reviewed by Dean Jackson.
3147
3148         On macOS 10.12, we don't attempt secure archival at all because SECURE_ARCHIVER_API is turned off, and on macOS
3149         10.14, NSFileWrapper supports secure coding. However, on macOS 10.13, SECURE_ARCHIVER_API is on despite
3150         NSFileWrapper not being securely codable, so we're unable to serialize attachment data.
3151
3152         To fix this, we only use the secure archiver on ≥ macOS 10.14 and ≥ iOS 12.
3153
3154         * UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
3155         (API::Attachment::createSerializedRepresentation const):
3156
3157 2018-10-31  Zach Li  <zacharyli323@gmail.com>
3158
3159         Add credit card autofill button
3160         https://bugs.webkit.org/show_bug.cgi?id=191051
3161         <rdar://problem/45657011>
3162
3163         Reviewed by Wenson Hsieh.
3164
3165         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
3166         (toAutoFillButtonType):
3167         (toWKAutoFillButtonType):
3168         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandlePrivate.h:
3169         Introduce a new button type for credit card autofill.
3170         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
3171         (toAutoFillButtonType):
3172         (toWKAutoFillButtonType):
3173         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h:
3174
3175 2018-10-31  Chris Dumez  <cdumez@apple.com>
3176
3177         [PSON] When process-swapping for a POST request the HTTP body gets dropped
3178         https://bugs.webkit.org/show_bug.cgi?id=191046
3179         <rdar://problem/45229732>
3180
3181         Reviewed by Alex Christensen.
3182
3183         For performance reasons, the ResourceRequest IPC encoder does not encode the request's HTTP body (aka form data).
3184         When we decide to process-swap for a POST request in WebPageProxy::decidePolicyForNavigationAction(), the request
3185         we pass the new WebProcess thus no longer has a HTTP body and the load will likely fail in the new process.
3186
3187         To address the issue, we now pass the request body along with the request when sending the DecidePolicyForNavigationActionAsync
3188         / DecidePolicyForNavigationActionSync IPC from the WebProcess to the UIProcess. No action is needed for the
3189         LoadRequest IPC to the new WebProcess since the LoadParameters' IPC encoder takes care of encoding the request's
3190         body already.
3191
3192         * UIProcess/WebPageProxy.cpp:
3193         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
3194         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
3195         * UIProcess/WebPageProxy.h:
3196         * UIProcess/WebPageProxy.messages.in:
3197         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3198         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
3199
3200 2018-10-31  Antti Koivisto  <antti@apple.com>
3201
3202         Stop using LayerFlushScheduler in WK2
3203         https://bugs.webkit.org/show_bug.cgi?id=191065
3204
3205         Reviewed by Tim Horton.
3206
3207         Code gets more understandable when TiledCoreAnimationDrawingArea simply uses RunLoopObserver
3208         directly for flush scheduling. LayerFlushScheduler can be later moved to WK1.
3209
3210         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
3211         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3212         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
3213         (WebKit::TiledCoreAnimationDrawingArea::~TiledCoreAnimationDrawingArea):
3214         (WebKit::TiledCoreAnimationDrawingArea::setLayerTreeStateIsFrozen):
3215         (WebKit::TiledCoreAnimationDrawingArea::scheduleCompositingLayerFlush):
3216         (WebKit::TiledCoreAnimationDrawingArea::dispatchAfterEnsuringUpdatedScrollPosition):
3217         (WebKit::TiledCoreAnimationDrawingArea::layerFlushRunLoopCallback):
3218         (WebKit::TiledCoreAnimationDrawingArea::invalidateLayerFlushRunLoopObserver):
3219         (WebKit::TiledCoreAnimationDrawingArea::scheduleLayerFlushRunLoopObserver):
3220
3221 2018-10-31  Claudio Saavedra  <csaavedra@igalia.com>
3222
3223         [WPE][GTK] Certificates loaded from the cache don't include the certificate chain
3224         https://bugs.webkit.org/show_bug.cgi?id=190956
3225
3226         Reviewed by Youenn Fablet.
3227
3228         Similarly to what was done for the IPC coders, serialize
3229         the entire certificate chain in the cache coder. Bump
3230         the cache version due to the caching format changes.
3231
3232         * NetworkProcess/cache/NetworkCacheCoders.h: Add GRefPtr<GByteArray> coders.
3233         * NetworkProcess/cache/NetworkCacheCodersSoup.cpp:
3234         (WTF::Persistence::certificatesDataListFromCertificateInfo):
3235         (WTF::Persistence::certificateFromCertificatesDataList): Helpers.
3236         (WTF::Persistence::Coder<WebCore::CertificateInfo>::encode):
3237         (WTF::Persistence::Coder<WebCore::CertificateInfo>::decode):
3238         (WTF::Persistence::Coder<GRefPtr<GByteArray>>::encode):
3239         (WTF::Persistence::Coder<GRefPtr<GByteArray>>::decode):
3240         * NetworkProcess/cache/NetworkCacheStorage.h: Bump the cache version.
3241
3242 2018-10-30  Wenson Hsieh  <wenson_hsieh@apple.com>
3243
3244         [Cocoa] Attachment dropped from one web view to another is missing its file wrapper
3245         https://bugs.webkit.org/show_bug.cgi?id=190530
3246         <rdar://problem/45232149>
3247
3248         Reviewed by Tim Horton.
3249
3250         See WebCore ChangeLog for more details.
3251
3252         * Shared/WebCoreArgumentCoders.cpp:
3253         (IPC::ArgumentCoder<SerializedAttachmentData>::encode):
3254         (IPC::ArgumentCoder<SerializedAttachmentData>::decode):
3255         * Shared/WebCoreArgumentCoders.h:
3256
3257         Add IPC encoding/decoding support for SerializedAttachmentData.
3258
3259         * UIProcess/API/APIAttachment.cpp:
3260         (API::Attachment::createSerializedRepresentation const):
3261         (API::Attachment::updateFromSerializedRepresentation):
3262         * UIProcess/API/APIAttachment.h:
3263         * UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
3264         (API::Attachment::createSerializedRepresentation const):
3265
3266         Add a method to serialize and return attachment info as a blob of data.
3267
3268         (API::Attachment::updateFromSerializedRepresentation):
3269
3270         Add a method to update the attachment, given a serialized blob of data. On Cocoa platforms, this fails
3271         gracefully if the serialized data cannot be decoded.
3272
3273         * UIProcess/Cocoa/PageClientImplCocoa.h:
3274         * UIProcess/Cocoa/PageClientImplCocoa.mm:
3275         (WebKit::PageClientImplCocoa::allocFileWrapperInstance const):
3276         (WebKit::PageClientImplCocoa::serializableFileWrapperClasses const):
3277         (WebKit::PageClientImplCocoa::allocFileWrapperInstance): Deleted.
3278
3279         Add an additional hook to return the list of NSFileWrapper subclasses suitable for deserialization. This
3280         array contains (at minimum) NSFileWrapper, but may additionally include a custom NSFileWrapper subclass, if
3281         configured.
3282
3283         * UIProcess/PageClient.h:
3284         (WebKit::PageClient::allocFileWrapperInstance const):
3285         (WebKit::PageClient::serializableFileWrapperClasses const):
3286         (WebKit::PageClient::allocFileWrapperInstance): Deleted.
3287         * UIProcess/WebPageProxy.cpp:
3288         (WebKit::WebPageProxy::registerAttachmentsFromSerializedData):
3289
3290         Registers the given serialized attachment data, creating new _WKAttachment instances if necessary. Currently,
3291         this does not update the file wrappers of existing _WKAttachments; we should revisit this in the future to see
3292         if we can additionally update file wrappers for existing attachments, without breaking the case where the user
3293         copies and pastes or drags and drops attachments within a single web view and the client expects _WKAttachment
3294         instances to be reused.
3295
3296         (WebKit::WebPageProxy::serializedAttachmentDataForIdentifiers):
3297         * UIProcess/WebPageProxy.h:
3298         * UIProcess/WebPageProxy.messages.in:
3299         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
3300         (WebKit::WebEditorClient::registerAttachments):
3301         (WebKit::WebEditorClient::serializedAttachmentDataForIdentifiers):
3302
3303         Implement a new IPC hook to fetch an array of serialized attachment data blobs, given a list of attachment
3304         identifiers.
3305
3306         * WebProcess/WebCoreSupport/WebEditorClient.h:
3307
3308 2018-10-30  Chris Dumez  <cdumez@apple.com>
3309
3310         [PSON] View gesture snapshot gets taken down early when process-swapping
3311         https://bugs.webkit.org/show_bug.cgi?id=191083
3312         <rdar://problem/45058738>
3313
3314         Reviewed by Alex Christensen.
3315
3316         When process-swapping, we would call WebViewImpl::processDidExit(), which would destroy
3317         the ViewGestureController and thus take down the swipe navigation snapshot before it
3318         should. We now call WebViewImpl::processDidSwap() instead, which does the same thing,
3319         except for destroying the ViewGestureController. As a result, the view snapshot stays
3320         visible as long as it is needed, even in case of process swap.
3321
3322         * UIProcess/Cocoa/WebViewImpl.h:
3323         * UIProcess/Cocoa/WebViewImpl.mm:
3324         (WebKit::WebViewImpl::handleProcessSwapOrExit):
3325         (WebKit::WebViewImpl::processWillSwap):
3326         (WebKit::WebViewImpl::processDidExit):
3327         * UIProcess/mac/PageClientImplMac.mm:
3328         (WebKit::PageClientImpl::processWillSwap):
3329
3330 2018-10-30  Chris Dumez  <cdumez@apple.com>
3331
3332         [PSON] WebView renders with incorrect dimensions after back or forward
3333         https://bugs.webkit.org/show_bug.cgi?id=191071
3334         <rdar://problem/45058950>
3335
3336         Reviewed by Alex Christensen.
3337
3338         Make sure WebPage::reinitializeWebPage() updates the page's dimensions if needed using the
3339         WebPageCreationParameters it is provided.
3340
3341         * WebProcess/WebPage/WebPage.cpp:
3342         (WebKit::WebPage::reinitializeWebPage):
3343
3344 2018-10-30  Dewei Zhu  <dewei_zhu@apple.com>
3345
3346         Move 'ProcessSwapOnCrossSiteNavigationEnabled' to 'experimental' category.
3347         https://bugs.webkit.org/show_bug.cgi?id=191049
3348
3349         Reviewed by Dean Jackson.
3350
3351         Move the feature flag to experimental feature section.
3352
3353         * Shared/WebPreferences.yaml:
3354
3355 2018-10-30  Alexey Proskuryakov  <ap@apple.com>
3356
3357         Enable InstallAPI for iOS unconditionally
3358         https://bugs.webkit.org/show_bug.cgi?id=191043
3359         rdar://problem/32728423
3360
3361         Reviewed by Dan Bernstein.
3362
3363         * Configurations/Base.xcconfig: Enabled it. Added NSURLDownloadSPI.h as an
3364         excluded header - WebKit doesn't export NSURLDownload, so the definition
3365         shouldn't be processed by InstallAPI.
3366
3367 2018-10-30  Alexey Proskuryakov  <ap@apple.com>
3368
3369         Clean up some obsolete MAX_ALLOWED macros
3370         https://bugs.webkit.org/show_bug.cgi?id=190916
3371
3372         Reviewed by Tim Horton.
3373
3374         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3375         (WebKit::NetworkDataTaskCocoa::applySniffingPoliciesAndBindRequestToInferfaceIfNeeded):
3376         * Platform/spi/Cocoa/DeviceIdentitySPI.h:
3377         * Platform/spi/ios/UIKitSPI.h:
3378         * Shared/WebPreferencesDefaultValues.cpp:
3379         (defaultCustomPasteboardDataEnabled):
3380         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
3381         (WebKit::toPKPaymentRequest):
3382         * UIProcess/ios/WKContentViewInteraction.mm:
3383         (-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:]): Deleted.
3384
3385 2018-10-30  Commit Queue  <commit-queue@webkit.org>
3386
3387         Unreviewed, rolling out r237600 and r237604.
3388         https://bugs.webkit.org/show_bug.cgi?id=191086
3389
3390         Breaks internal iOS builds (Requested by ryanhadd_ on
3391         #webkit).
3392
3393         Reverted changesets:
3394
3395         "Enable InstallAPI for iOS unconditionally"
3396         https://bugs.webkit.org/show_bug.cgi?id=191043
3397         https://trac.webkit.org/changeset/237600
3398
3399         "Build fix attempt after enabling InstallAPI for iOS."
3400         https://bugs.webkit.org/show_bug.cgi?id=191043
3401         https://trac.webkit.org/changeset/237604
3402
3403 2018-10-30  Alexey Proskuryakov  <ap@apple.com>
3404
3405         Build fix attempt after enabling InstallAPI for iOS.
3406         https://bugs.webkit.org/show_bug.cgi?id=191043
3407         rdar://problem/32728423
3408
3409         * Configurations/WebKit.xcconfig: Skip NSURLDownloadSPI.h here too.
3410
3411 2018-10-30  Alexey Proskuryakov  <ap@apple.com>
3412
3413         Enable InstallAPI for iOS unconditionally
3414         https://bugs.webkit.org/show_bug.cgi?id=191043
3415         rdar://problem/32728423
3416
3417         Reviewed by Dan Bernstein.
3418
3419         * Configurations/Base.xcconfig: Enabled it.
3420
3421 2018-10-30  Zan Dobersek  <zdobersek@igalia.com>
3422
3423         [CoordGraphics] CoordinatedLayerTreeHost::flushLayersAndForceRepaint() should schedule the flush
3424         https://bugs.webkit.org/show_bug.cgi?id=191066
3425
3426         Reviewed by Michael Catanzaro.
3427
3428         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
3429         (WebKit::CoordinatedLayerTreeHost::flushLayersAndForceRepaint):
3430         Only schedule the layer flush in this call, don't perform it on the
3431         spot. This avoids re-entry of the layer flushing process in cases when
3432         the associated display refresh monitor is requested a callback during
3433         the layout phase that's executed under the initial layer flush.
3434
3435 2018-10-29  Dewei Zhu  <dewei_zhu@apple.com>
3436
3437         Move 'ProcessSwapOnCrossSiteNavigationEnabled' to 'experimental' category.
3438         https://bugs.webkit.org/show_bug.cgi?id=191049
3439
3440         Reviewed by Chris Dumez.
3441
3442         Move 'ProcessSwapOnCrossSiteNavigationEnabled' from 'internal' to 'experimental' category.
3443
3444         * Shared/WebPreferences.yaml:
3445
3446 2018-10-29  Youenn Fablet  <youenn@apple.com>
3447
3448         Handle MDNS resolution of candidates through libwebrtc directly
3449         https://bugs.webkit.org/show_bug.cgi?id=190681
3450
3451         Reviewed by Eric Carlson.
3452
3453         Add support for AsyncResolver to resolve MDNS.
3454         This basically reuse the code path used to resolve STUN server addresses.
3455         Removed MDNS specific resolution.
3456         Use existing CFHost resolution mechanism to do the actual resolution.
3457
3458         Make sure that a resolver is kept alive while iterating through its clients when signaling done.
3459         Some of its clients may indeed call Destroy() on the resolver during that iteration.
3460
3461         * NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
3462         (WebKit::NetworkMDNSRegister::registerMDNSName):
3463         * NetworkProcess/webrtc/NetworkMDNSRegister.messages.in:
3464         * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
3465         (WebKit::LibWebRTCResolver::Destroy):
3466         (WebKit::LibWebRTCResolver::doDestroy):
3467         (WebKit::LibWebRTCResolver::setResolvedAddress):
3468         (WebKit::LibWebRTCResolver::setError):
3469         (WebKit::LibWebRTCProvider::createPeerConnection):
3470         * WebProcess/Network/webrtc/LibWebRTCProvider.h:
3471         * WebProcess/Network/webrtc/LibWebRTCSocketFactory.h:
3472         * WebProcess/Network/webrtc/WebMDNSRegister.cpp:
3473         * WebProcess/Network/webrtc/WebMDNSRegister.h:
3474         * WebProcess/Network/webrtc/WebMDNSRegister.messages.in:
3475
3476 2018-10-29  Tim Horton  <timothy_horton@apple.com>
3477
3478         Modernize WebKit nibs and lprojs for localization's sake
3479         https://bugs.webkit.org/show_bug.cgi?id=190911
3480         <rdar://problem/45349466>
3481
3482         Reviewed by Dan Bernstein.
3483
3484         * Resources/WebContentProcess.xib:
3485         * WebKit.xcodeproj/project.pbxproj:
3486         * en.lproj/InfoPlist.strings: Renamed from Source/WebKit/English.lproj/InfoPlist.strings.
3487         English->en
3488
3489 2018-10-29  Tim Horton  <timothy_horton@apple.com>
3490
3491         Make FindOptionsShowOverlay work on iOS
3492         https://bugs.webkit.org/show_bug.cgi?id=190551
3493
3494         Reviewed by Andy Estes.
3495
3496         * WebProcess/WebPage/FindController.cpp:
3497         (WebKit::FindController::updateFindUIAfterPageScroll):
3498         Update the find indicator after installing the page overlay for the find holes.
3499         This ensures that if the find indicator mechanism also uses page overlays,
3500         as it does on iOS, that they are installed in the correct order (because
3501         order of installation directly affects z-order).
3502
3503         (WebKit::FindController::findIndicatorRadius const):
3504         (WebKit::FindController::shouldHideFindIndicatorOnScroll const):
3505         Add two getters for design differences between find-in-page on iOS vs. other platforms.
3506
3507         (WebKit::FindController::rectsForTextMatchesInRect):
3508         Return FloatRects instead of IntRects for ease of use in the caller.
3509         Don't clip rects for matches that intersect the current tile. We still
3510         drop ones that don't intersect at all, but if they do intersect, we
3511         provide the full rect (which may overlap a different tile), so that
3512         e.g. border drawing will work correctly.
3513
3514         (WebKit::FindController::drawRect):
3515         Adopt shrink-wrapping for find holes. This has minimal impact on macOS,
3516         where the holes don't have rounded corners, but on iOS this makes
3517         overlapping or adjacent holes look great. We already do this for the indicator,
3518         so it only makes sense to do the same for the holes.
3519
3520         In order to support shrink-wrapping here, switch to using a Clear operator
3521         with a path-fill instead of clearRect to clear out the holes.
3522
3523         Avoid hiding the find indicator on scroll if the platform says not to.
3524
3525         * WebProcess/WebPage/FindController.h:
3526         * WebProcess/WebPage/ios/FindControllerIOS.mm:
3527         (WebKit::FindController::findIndicatorRadius const):
3528         (WebKit::FindController::shouldHideFindIndicatorOnScroll const):
3529         Slightly adjust the find indicator's parameters to be compatible with having holes.
3530         Reduce the horizontal margin by half a point so that it fits precisely in the hole.
3531         Drop the "TightlyFitContent" text indicator parameter, because we want 
3532         rects that match the holes, and they do not tightly fit the content's height.
3533         This matches macOS's behavior.
3534
3535 2018-10-29  Jer Noble  <jer.noble@apple.com>
3536
3537         CRASH in CoreGraphics: ERROR_CGDataProvider_BufferIsNotBigEnough
3538         https://bugs.webkit.org/show_bug.cgi?id=190954
3539
3540         Reviewed by Simon Fraser.
3541
3542         * Shared/cg/ShareableBitmapCG.cpp:
3543         (WebKit::ShareableBitmap::makeCGImage):
3544
3545 2018-10-29  Youenn Fablet  <youenn@apple.com>
3546
3547         Guard H264 simulcast with a runtime flag
3548         https://bugs.webkit.org/show_bug.cgi?id=191025
3549
3550         Reviewed by Eric Carlson.
3551
3552         * Shared/WebPreferences.yaml:
3553
3554 2018-10-29  Chris Dumez  <cdumez@apple.com>
3555
3556         [PSON] When Safari restores session state after launching, going back and forward does not swap processes
3557         https://bugs.webkit.org/show_bug.cgi?id=190975
3558         <rdar://problem/45059256>
3559
3560         Reviewed by Antti Koivisto.
3561
3562         When deciding to process-swap or not on a history navigation, we normally check the BackForwardListItems'
3563         process identifiers do check if they come from different WebProcesses or not. However, the check was invalid
3564         in the case where the BackForwardListItems were restored by the client. After a session restore, the
3565         items' process identifier is the UIProcess one. Therefore, we need to disable the BackForwardListItems'
3566         process identifiers check if if the process identifier is the one of the UIProcess.
3567
3568         * UIProcess/WebProcessPool.cpp:
3569         (WebKit::WebProcessPool::processForNavigationInternal):
3570
3571 2018-10-29  Youenn Fablet  <youenn@apple.com>
3572
3573         [WebRTC] Enable VP8 by default
3574         https://bugs.webkit.org/show_bug.cgi?id=190672
3575
3576         Reviewed by Eric Carlson.
3577
3578         * Shared/WebPreferences.yaml:
3579
3580 2018-10-28  Zan Dobersek  <zdobersek@igalia.com>
3581
3582         [WPE] Add the WebKitVersion.h header
3583         https://bugs.webkit.org/show_bug.cgi?id=191015
3584
3585         Reviewed by Michael Catanzaro.
3586
3587         Add the WebKitVersion.h API header for the WPE port. As with other
3588         headers providing the GLib API, we have to provide a WPE-specific
3589         version, but the implementation file can be shared with the GTK port,
3590         and is moved under the UIProcess/API/glib/ directory accordingly.
3591
3592         * PlatformWPE.cmake:
3593         * SourcesWPE.txt:
3594         * UIProcess/API/glib/WebKitVersion.cpp: Renamed from Source/WebKit/UIProcess/API/gtk/WebKitVersion.cpp.
3595         * UIProcess/API/wpe/WebKitVersion.h.in: Added.
3596         * UIProcess/API/wpe/webkit.h:
3597
3598 2018-10-26  Megan Gardner  <megan_gardner@apple.com>
3599
3600         Remove Unused WebSelectionAssistant
3601         https://bugs.webkit.org/show_bug.cgi?id=190939
3602
3603         Reviewed by Tim Horton.
3604
3605         We made webSelectionAssistant alwasys nil last year when we moved to using
3606         the textSelectionAssistant for all text selection on the web. This patch merely 
3607         goes through and cleans out all the references to this object that is always nil.
3608         No functionality should change.
3609
3610         * UIProcess/ios/WKContentView.mm:
3611         (-[WKContentView _didExitStableState]):
3612         * UIProcess/ios/WKContentViewInteraction.h:
3613         * UIProcess/ios/WKContentViewInteraction.mm:
3614         (-[WKContentView cleanupInteraction]):
3615         (-[WKContentView resignFirstResponderForWebView]):
3616         (-[WKContentView _scrollingNodeScrollingWillBegin]):
3617         (-[WKContentView _scrollingNodeScrollingDidEnd]):
3618         (-[WKContentView gestureRecognizer:canBePreventedByGestureRecognizer:]):
3619         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
3620         (-[WKContentView _uiTextSelectionRects]):
3621         (-[WKContentView _singleTapCommited:]):
3622         (-[WKContentView _willStartScrollingOrZooming]):
3623         (-[WKContentView _didEndScrollingOrZooming]):
3624         (-[WKContentView _lookupForWebView:]):
3625         (-[WKContentView _shareForWebView:]):
3626         (-[WKContentView _addShortcutForWebView:]):
3627         (-[WKContentView _showDictionary:]):
3628         (selectionChangedWithGesture):
3629         (selectionChangedWithTouch):
3630         (-[WKContentView selectionInteractionAssistant]):
3631         (-[WKContentView _stopAssistingNode]):
3632         (-[WKContentView _updateChangedSelection:]):
3633         (-[WKContentView actionSheetAssistant:shareElementWithURL:rect:]):
3634         (-[WKContentView _restoreCalloutBarIfNeeded]):
3635         (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
3636         (-[WKContentView webSelectionAssistant]): Deleted.
3637
3638 2018-10-26  Commit Queue  <commit-queue@webkit.org>
3639
3640         Unreviewed, rolling out r237458.
3641         https://bugs.webkit.org/show_bug.cgi?id=190973
3642
3643         broke internal iOS builds (Requested by zalan on #webkit).
3644
3645         Reverted changeset:
3646
3647         "Adopt -setOverrideRouteSharingPolicy:routingContextUID: SPI"
3648         https://bugs.webkit.org/show_bug.cgi?id=190951
3649         https://trac.webkit.org/changeset/237458
3650
3651 2018-10-26  Chris Dumez  <cdumez@apple.com>
3652
3653         [PSON] Only delay attaching drawingArea in case of process swap and drop DidCompletePageTransition IPC handshake
3654         https://bugs.webkit.org/show_bug.cgi?id=190971
3655
3656         Reviewed by Geoffrey Garen.
3657
3658         Only delay attaching drawingArea in case of process swap and drop DidCompletePageTransition IPC handshake.
3659
3660         Since r236257, the WebProcess would always delay attaching the drawing area when a new WebPage is created. The
3661         WebProcess would send a DidCompletePageTransition IPC to the UIProcess when the page transition is complete and
3662         the UIProcess would then send an IPC back to attach the drawing area.
3663
3664         In the new design, WebPageCreationParameters contains a flag indicating if the WebPage should delay attaching
3665         the drawing area or not. We only delay attaching in case of process swap and we've successfuly suspended the
3666         previous page. Then when WebPage::didCompletePageTransition(), we stop sending the DidCompletePageTransition
3667         IPC to the UIProcess and instead have the WebProcess attach the drawing area right away if we've delayed
3668         attaching until then.
3669
3670         * Shared/WebPageCreationParameters.cpp:
3671         (WebKit::WebPageCreationParameters::encode const):
3672         (WebKit::WebPageCreationParameters::decode):
3673         * Shared/WebPageCreationParameters.h:
3674         * UIProcess/DrawingAreaProxy.h:
3675         * UIProcess/WebPageProxy.cpp:
3676         (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
3677         (WebKit::WebPageProxy::swapToWebProcess):
3678         (WebKit::WebPageProxy::finishAttachingToWebProcess):
3679         (WebKit::WebPageProxy::initializeWebPage):
3680         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
3681         * UIProcess/WebPageProxy.h:
3682         * UIProcess/WebPageProxy.messages.in:
3683         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
3684         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
3685         * WebProcess/WebPage/DrawingArea.messages.in:
3686         * WebProcess/WebPage/WebPage.cpp:
3687         (WebKit::m_shouldAttachDrawingAreaOnPageTransition):
3688         (WebKit::WebPage::reinitializeWebPage):
3689         (WebKit::WebPage::didCompletePageTransition):
3690         * WebProcess/WebPage/WebPage.h:
3691         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3692         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
3693
3694 2018-10-26  Chris Dumez  <cdumez@apple.com>
3695
3696         [PSON] Avoid tearing down the drawing area when suspending a WebPage due to process-swap
3697         https://bugs.webkit.org/show_bug.cgi?id=190879
3698
3699         Reviewed by Antti Koivisto.
3700
3701         Avoid tearing down the drawing area when suspending a WebPage due to process-swap. We really only need to reset
3702         the drawing area upon resuming the WebPage. There is no strict need to destroy the drawing area on suspension
3703         and this has caused various crashes because code usually assumes we always have a drawing area.
3704
3705         This patch also drops various drawing area null checks that were added to address PSON crashes.
3706
3707         * UIProcess/SuspendedPageProxy.cpp:
3708         (WebKit::SuspendedPageProxy::tearDownDrawingAreaInWebProcess): Deleted.
3709         * UIProcess/SuspendedPageProxy.h:
3710         * UIProcess/WebPageProxy.cpp:
3711         (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
3712         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
3713         (WebKit::WebPageProxy::didCompletePageTransition):
3714         (WebKit::WebPageProxy::enterAcceleratedCompositingMode):
3715         * UIProcess/WebPageProxy.h:
3716         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3717         (WebKit::WebChromeClient::invalidateContentsAndRootView):
3718         (WebKit::WebChromeClient::invalidateContentsForSlowScroll):
3719         (WebKit::WebChromeClient::contentsSizeChanged const):
3720         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3721         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
3722         * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm:
3723         (WebKit::RemoteScrollingCoordinator::scheduleTreeStateCommit):
3724         * WebProcess/WebPage/WebPage.cpp:
3725         (WebKit::WebPage::reinitializeWebPage):
3726         (WebKit::WebPage::exitAcceleratedCompositingMode):
3727         (WebKit::WebPage::setIsSuspended):
3728         (WebKit::WebPage::tearDownDrawingAreaForSuspend): Deleted.
3729         * WebProcess/WebPage/WebPage.h:
3730         * WebProcess/WebPage/WebPage.messages.in:
3731
3732 2018-10-26  Antti Koivisto  <antti@apple.com>
3733
3734         Use random() instead of begin() to limit cache sizes
3735         https://bugs.webkit.org/show_bug.cgi?id=190957
3736
3737         Reviewed by Chris Dumez.
3738
3739         * UIProcess/WebProcessPool.cpp:
3740         (WebKit::WebProcessPool::didCollectPrewarmInformation):
3741
3742 2018-10-26  Chris Dumez  <cdumez@apple.com>
3743
3744         Modernize / Simplify IPC::Connection::sendOutgoingMessage()
3745         https://bugs.webkit.org/show_bug.cgi?id=190931
3746
3747         Reviewed by Alex Christensen.
3748
3749         * Platform/IPC/mac/ConnectionMac.mm:
3750         (IPC::Connection::sendOutgoingMessage):
3751
3752 2018-10-26  Jer Noble  <jer.noble@apple.com>
3753
3754         Adopt -setOverrideRouteSharingPolicy:routingContextUID: SPI
3755         https://bugs.webkit.org/show_bug.cgi?id=190951
3756         <rdar://problem/45213065>
3757
3758         Reviewed by Alex Christensen.
3759
3760         Add an asyncronous reply request to VideoFullscreenManager.
3761
3762         Drive-by fix: messages.py generates "WTFMove(*arg1, *arg2)" instead of "WTFMove(*arg1), WTFMove(*arg2)"
3763         in its reply handler generation.
3764
3765         * Platform/IPC/MessageSender.h:
3766         (IPC::MessageSender::sendWithAsyncReply):
3767         * Scripts/webkit/messages.py:
3768         * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
3769         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
3770         (WebKit::VideoFullscreenModelContext::requestRouteSharingPolicyAndContextUID):
3771         * WebProcess/cocoa/VideoFullscreenManager.h:
3772         * WebProcess/cocoa/VideoFullscreenManager.messages.in:
3773         * WebProcess/cocoa/VideoFullscreenManager.mm:
3774         (WebKit::VideoFullscreenManager::requestRouteSharingPolicyAndContextUID):
3775
3776 2018-10-25  Michael Catanzaro  <mcatanzaro@igalia.com>
3777
3778         Unreviewed, another try at fixing the GTK build with sandbox enabled
3779
3780         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
3781         (WebKit::memfd_create): Deleted.
3782
3783 2018-10-25  Antoine Quint  <graouts@apple.com>
3784
3785         [Web Animations] Turn Web Animations CSS Integration off by default
3786         https://bugs.webkit.org/show_bug.cgi?id=190901
3787
3788         Reviewed by Dean Jackson.
3789
3790         * Shared/WebPreferences.yaml:
3791
3792 2018-10-25  Michael Catanzaro  <mcatanzaro@igalia.com>
3793
3794         Unreviewed, try to fix GTK build with sandbox enabled
3795
3796         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
3797
3798 2018-10-25  Claudio Saavedra  <csaavedra@igalia.com>
3799
3800         [WPE][GTK] Follow-up fixes to the certificate coders
3801         https://bugs.webkit.org/show_bug.cgi?id=190900
3802
3803         Reviewed by Michael Catanzaro.
3804
3805         Cleanup the GRefPtr mess I created earlier. Also we now bail out
3806         if any certificate in the chain has no data instead of returning a
3807         cropped chain.
3808
3809         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
3810         (IPC::ArgumentCoder<CertificateInfo>::encode):
3811         (IPC::ArgumentCoder<CertificateInfo>::decode):
3812
3813 2018-10-25  Zan Dobersek  <zdobersek@igalia.com>
3814
3815         [GTK][AC] Resizing the window doesn't always update the visible rect
3816         https://bugs.webkit.org/show_bug.cgi?id=189743
3817
3818         Reviewed by Michael Catanzaro.
3819
3820         Disassociate resizing that can be done on an AcceleratedSurface object
3821         between "host resizes" and "client resizes".
3822
3823         The former is done from ThreadedCoordinatedLayerTreeHost directly, and
3824         is currently used only for GTK on X11, where a new pixmap object is
3825         created on each resize, which affects the context ID that is based on
3826         that pixmap object's address.
3827
3828         The latter is done from the composition thread. It's used for GTK on
3829         Wayland and WPE. In both cases, the underlying window object does not
3830         change on each resize, but it's necessary to perform the actual resize
3831         on the composition thread.
3832
3833         So far it hasn't been performed there, which ended up pushing sizes of
3834         the WebKit view and the underlying window object out of sync during
3835         resizing, leaving parts of window unrendered.
3836
3837         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
3838         (WebKit::ThreadedCompositor::renderLayerTree):
3839         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
3840         * WebProcess/WebPage/AcceleratedSurface.cpp:
3841         (WebKit::AcceleratedSurface::hostResize):
3842         (WebKit::AcceleratedSurface::resize): Deleted.
3843         * WebProcess/WebPage/AcceleratedSurface.h:
3844         (WebKit::AcceleratedSurface::clientResize):
3845         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
3846         (WebKit::ThreadedCoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged):
3847         (WebKit::ThreadedCoordinatedLayerTreeHost::sizeDidChange):
3848         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
3849         * WebProcess/WebPage/gtk/AcceleratedSurfaceWayland.cpp:
3850         (WebKit::AcceleratedSurfaceWayland::clientResize):
3851         (WebKit::AcceleratedSurfaceWayland::resize): Deleted.
3852         * WebProcess/WebPage/gtk/AcceleratedSurfaceWayland.h:
3853         * WebProcess/WebPage/gtk/AcceleratedSurfaceX11.cpp:
3854         (WebKit::AcceleratedSurfaceX11::hostResize):
3855         (WebKit::AcceleratedSurfaceX11::resize): Deleted.
3856         * WebProcess/WebPage/gtk/AcceleratedSurfaceX11.h:
3857         * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp:
3858         (WebKit::AcceleratedSurfaceWPE::clientResize):
3859         (WebKit::AcceleratedSurfaceWPE::resize): Deleted.
3860         * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.h:
3861
3862 2018-10-24  Alexey Proskuryakov  <ap@apple.com>
3863
3864         Clean up some obsolete macOS version guards
3865         https://bugs.webkit.org/show_bug.cgi?id=190887
3866
3867         Reviewed by Dan Bernstein.
3868
3869         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
3870         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3871         (WebKit::WebProcessPool::platformInitializeWebProcess):
3872
3873 2018-10-24  Megan Gardner  <megan_gardner@apple.com>
3874
3875         Turn on Conic Gradients
3876         https://bugs.webkit.org/show_bug.cgi?id=190810
3877
3878         Reviewed by Tim Horton.
3879
3880         Remove conic gradients from experimental features and turn it on always.
3881
3882         * Configurations/FeatureDefines.xcconfig:
3883         * Shared/WebPreferences.yaml:
3884
3885 2018-10-24  Said Abou-Hallawa  <sabouhallawa@apple.com>
3886
3887         Cleanup: MIMETypeRegistry functions
3888         https://bugs.webkit.org/show_bug.cgi?id=190838
3889
3890         Reviewed by Simon Fraser.
3891
3892         * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
3893         (-[WKWebViewContentProviderRegistry initWithConfiguration:]):
3894
3895 2018-10-24  Chris Dumez  <cdumez@apple.com>
3896
3897         REGRESSION (r237257): [iOS] Crashes in com.apple.WebKit: WebKit::RemoteScrollingCoordinator::scheduleTreeStateCommit
3898         https://bugs.webkit.org/show_bug.cgi?id=190804
3899
3900         Reviewed by Alex Christensen.
3901
3902         Fix null-dereference of the drawing area in RemoteScrollingCoordinator::scheduleTreeStateCommit.
3903         With process-swap-on-navigation enabled, suspended pages' drawing area gets torn down.
3904
3905         * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm:
3906         (WebKit::RemoteScrollingCoordinator::scheduleTreeStateCommit):
3907
3908 2018-10-24  Claudio Saavedra  <csaavedra@igalia.com>
3909
3910         [WPE][GTK] Cleanups to the certificate decoder
3911         https://bugs.webkit.org/show_bug.cgi?id=190867
3912
3913         Reviewed by Žan Doberšek.
3914
3915         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
3916         (IPC::ArgumentCoder<CertificateInfo>::decode):
3917
3918 2018-10-24  Claudio Saavedra  <csaavedra@igalia.com>
3919
3920         [WPE][GTK] Cleanups to the certificate encoder
3921         https://bugs.webkit.org/show_bug.cgi?id=190865
3922
3923         Reviewed by Žan Doberšek.
3924
3925         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
3926         (IPC::ArgumentCoder<CertificateInfo>::encode):
3927
3928 2018-10-23  Ryan Haddad  <ryanhaddad@apple.com>
3929
3930         Unreviewed, rolling out r237261.
3931
3932         The layout test for this change crashes under GuardMalloc.
3933
3934         Reverted changeset:
3935
3936         "Handle MDNS resolution of candidates through libwebrtc
3937         directly"
3938         https://bugs.webkit.org/show_bug.cgi?id=190681
3939         https://trac.webkit.org/changeset/237261
3940
3941 2018-10-23  David Kilzer  <ddkilzer@apple.com>
3942
3943         Fix false positive leaks when using custom -init methods that don't start with -init
3944         <https://webkit.org/b/190818>
3945         <rdar://problem/45476042>
3946
3947         Reviewed by Dan Bernstein.
3948
3949         * UIProcess/Cocoa/WKWebViewContentProvider.h:
3950         (-[WKWebViewContentProvider web_initWithFrame:webView:mimeType:]):
3951         Add attribute to make this behave like an -init method.
3952
3953 2018-10-23  Chris Dumez  <cdumez@apple.com>
3954
3955         [PSON] Add support for cross-site client-side redirects
3956         https://bugs.webkit.org/show_bug.cgi?id=190806
3957         <rdar://problem/45047344>
3958
3959         Reviewed by Geoffrey Garen.
3960
3961         * Shared/LoadParameters.cpp:
3962         (WebKit::LoadParameters::encode const):
3963         (WebKit::LoadParameters::decode):
3964         * Shared/LoadParameters.h:
3965         * Shared/NavigationActionData.cpp:
3966         (WebKit::NavigationActionData::encode const):
3967         (WebKit::NavigationActionData::decode):
3968         * Shared/NavigationActionData.h:
3969         * Shared/WebBackForwardListItem.cpp:
3970         (WebKit::WebBackForwardListItem::setSuspendedPage):
3971         * UIProcess/API/APINavigation.h:
3972         (API::Navigation::setLockHistory):
3973         (API::Navigation::lockHistory const):
3974         (API::Navigation::setLockBackForwardList):
3975         (API::Navigation::lockBackForwardList const):
3976         (API::Navigation::setClientRedirectSourceForHistory):
3977         (API::Navigation::clientRedirectSourceForHistory const):
3978         * UIProcess/API/APINavigationClient.h:
3979         (API::NavigationClient::willPerformClientRedirect):
3980         (API::NavigationClient::didPerformClientRedirect):
3981         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
3982         * UIProcess/Cocoa/NavigationState.h:
3983         * UIProcess/Cocoa/NavigationState.mm:
3984         (WebKit::NavigationState::setNavigationDelegate):
3985         (WebKit::NavigationState::NavigationClient::didPerformClientRedirect):
3986         * UIProcess/FrameLoadState.h:
3987         (WebKit::FrameLoadState::setURL):
3988         * UIProcess/WebPageProxy.cpp:
3989         (WebKit::WebPageProxy::loadRequestWithNavigation):
3990         (WebKit::WebPageProxy::continueNavigationInNewProcess):
3991         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
3992         (WebKit::WebPageProxy::didPerformClientRedirect):
3993         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3994         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
3995         * WebProcess/WebPage/WebPage.cpp:
3996         (WebKit::WebPage::loadRequest):
3997         (WebKit::WebPage::setCurrentHistoryItemForReattach):
3998         * WebProcess/WebPage/WebPage.h:
3999         * WebProcess/WebPage/WebPage.messages.in:
4000
4001 2018-10-23  Claudio Saavedra  <csaavedra@igalia.com>