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