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