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