Web Inspector: provide a way to edit page settings on a remote target
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2019-01-25  Devin Rousso  <drousso@apple.com>
2
3         Web Inspector: provide a way to edit page settings on a remote target
4         https://bugs.webkit.org/show_bug.cgi?id=193813
5         <rdar://problem/47359510>
6
7         Reviewed by Joseph Pecoraro.
8
9         * WebProcess/WebPage/WebInspectorUI.h:
10         (WebKit::WebInspectorUI::isRemote() const): Added.
11         * WebProcess/WebPage/RemoteWebInspectorUI.h:
12         (WebKit::RemoteWebInspectorUI::isRemote() const): Added.
13
14 2019-01-25  Dean Jackson  <dino@apple.com>
15
16         REGRESSION: Some USDz from 3rd party websites don't go directly to AR QL
17         https://bugs.webkit.org/show_bug.cgi?id=193831
18         <rdar://problem/47399263>
19
20         Reviewed by Chris Dumez.
21
22         A System Preview (<a rel="ar">) displays in a modal and doesn't trigger
23         a navigation. If the link was cross origin, it was causing a process swap,
24         which meant that the response defaulted back to a navigation.
25
26         The fix is to not cause a PSON when the navigation is a system preview.
27
28         * UIProcess/API/APINavigation.h:
29         (API::Navigation::shouldForceDownload const): This is now just tracking
30         the "download" attribute, and not including System Preview.
31         (API::Navigation::isSystemPreview const): New method to check for a
32         navigation triggered as a System Preview.
33         * UIProcess/WebPageProxy.cpp: Move the code from receivedPolicyDecision to
34         receivedNavigationPolicyDecision, so that downloads and System Previews are
35         detected before we decide to change process.
36         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
37         (WebKit::WebPageProxy::receivedPolicyDecision):
38
39 2019-01-25  Tim Horton  <timothy_horton@apple.com>
40
41         Find-in-page on nyt.com scrolls around without touching the screen when find holes are visible
42         https://bugs.webkit.org/show_bug.cgi?id=193853
43
44         Reviewed by Simon Fraser.
45
46         * WebProcess/WebPage/ios/FindControllerIOS.mm:
47         (WebKit::FindController::updateFindIndicator):
48         There is no reason to scroll/zoom to the find indicator just because the
49         holes are up, we should only do it on initial indicator presentation.
50         This was a mistake in r178755 that was previously never exercised because
51         isShowingOverlay was always false.
52
53 2019-01-25  Keith Rollin  <krollin@apple.com>
54
55         Update Xcode projects with "Check .xcfilelists" build phase
56         https://bugs.webkit.org/show_bug.cgi?id=193790
57         <rdar://problem/47201374>
58
59         Reviewed by Alex Christensen.
60
61         Support for XCBuild includes specifying inputs and outputs to various
62         Run Script build phases. These inputs and outputs are specified as
63         .xcfilelist files. Once created, these .xcfilelist files need to be
64         kept up-to-date. In order to check that they are up-to-date or not,
65         add an Xcode build step that invokes an external script that performs
66         the checking. If the .xcfilelists are found to be out-of-date, update
67         them, halt the build, and instruct the developer to restart the build
68         with up-to-date files.
69
70         At this time, the checking and regenerating is performed only if the
71         WK_ENABLE_CHECK_XCFILELISTS environment variable is set to 1. People
72         who want to use this facility can set this variable and test out the
73         checking/regenerating. Once it seems like there are no egregious
74         issues that upset a developer's workflow, we'll unconditionally enable
75         this facility.
76
77         * Scripts/check-xcfilelists.sh: Added.
78         * WebKit.xcodeproj/project.pbxproj:
79
80 2019-01-25  Alex Christensen  <achristensen@webkit.org>
81
82         Move logic from ChildProcess::setApplicationIsDaemon to NetworkProcess::initializeProcess
83         https://bugs.webkit.org/show_bug.cgi?id=193844
84
85         Reviewed by Andy Estes.
86
87         This simplifies ChildProcess and removes NetworkProcess-specific code from this generic abstraction.
88
89         * NetworkProcess/mac/NetworkProcessMac.mm:
90         (WebKit::NetworkProcess::initializeProcess):
91         * Shared/ios/ChildProcessIOS.mm:
92         (WebKit::ChildProcess::setApplicationIsDaemon): Deleted.
93         * Shared/mac/ChildProcessMac.mm:
94         (WebKit::ChildProcess::setApplicationIsDaemon): Deleted.
95
96 2019-01-25  Keith Rollin  <krollin@apple.com>
97
98         Update Xcode projects with "Apply Configuration to XCFileLists" build target
99         https://bugs.webkit.org/show_bug.cgi?id=193781
100         <rdar://problem/47201153>
101
102         Reviewed by Alex Christensen.
103
104         Part of generating the .xcfilelists used as part of adopting XCBuild
105         includes running `make DerivedSources.make` from a standalone script.
106         It’s important for this invocation to have the same environment as
107         when the actual build invokes `make DerivedSources.make`. If the
108         environments are different, then the two invocations will provide
109         different results. In order to get the same environment in the
110         standalone script, have the script launch xcodebuild targeting the
111         "Apply Configuration to XCFileLists" build target, which will then
112         re-invoke our standalone script. The script is now running again, this
113         time in an environment with all workspace, project, target, xcconfig
114         and other environment variables established.
115
116         The "Apply Configuration to XCFileLists" build target accomplishes
117         this task via a small embedded shell script that consists only of:
118
119             eval "${WK_SUBLAUNCH_SCRIPT_PARAMETERS[@]}"
120
121         The process that invokes "Apply Configuration to XCFileLists" first
122         sets WK_SUBLAUNCH_SCRIPT_PARAMETERS to an array of commands to be
123         evaluated and exports it into the shell environment. When xcodebuild
124         is invoked, it inherits the value of this variable and can `eval` the
125         contents of that variable. Our external standalone script can then set
126         WK_SUBLAUNCH_SCRIPT_PARAMETERS to the path to itself, along with a set
127         of command-line parameters needed to restart itself in the appropriate
128         state.
129
130         * WebKit.xcodeproj/project.pbxproj:
131
132 2019-01-25  Alex Christensen  <achristensen@webkit.org>
133
134         Add SPI to inform an application that "Go Back" has been clicked from a safe browsing warning
135         https://bugs.webkit.org/show_bug.cgi?id=193802
136         <rdar://problem/46010580>
137
138         Reviewed by Andy Estes.
139
140         * UIProcess/API/APIUIClient.h:
141         (API::UIClient::didClickGoBackFromSafeBrowsingWarning):
142         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
143         * UIProcess/Cocoa/UIDelegate.h:
144         * UIProcess/Cocoa/UIDelegate.mm:
145         (WebKit::UIDelegate::setDelegate):
146         (WebKit::UIDelegate::UIClient::didClickGoBackFromSafeBrowsingWarning):
147         * UIProcess/WebPageProxy.cpp:
148         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
149
150 2019-01-25  Daniel Bates  <dabates@apple.com>
151
152         [iOS] Pressing Tab key doesn't move to next cell with Google Sheets
153         https://bugs.webkit.org/show_bug.cgi?id=193048
154         <rdar://problem/46433836>
155
156         Reviewed by Brent Fulgham.
157
158         WebCore knows how interpret the Tab and Shift + Tab keys. When building with UIKit keyboard additions
159         we do not need to register key commands for handling them from the UIProcess code. Instead UIKit will
160         sends key events for these commands to us. This will make the behavior of these key commands when executed
161         in an editable field match the behavior of these command when executed in a non-editable field since
162         both code paths will now go through WebCore.
163
164         * UIProcess/ios/WKContentViewInteraction.mm:
165         (-[WKContentView keyCommands]): Only compile when building with !USE(UIKIT_KEYBOARD_ADDITIONS).
166
167 2019-01-25  Alex Christensen  <achristensen@webkit.org>
168
169         Fix Linux build.
170
171         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
172         (WebKit::NetworkConnectionToWebProcess::requestResourceLoadStatisticsUpdate):
173
174 2019-01-25  Keith Rollin  <krollin@apple.com>
175
176         Update WebKitAdditions.xcconfig with correct order of variable definitions
177         https://bugs.webkit.org/show_bug.cgi?id=193793
178         <rdar://problem/47532439>
179
180         Reviewed by Alex Christensen.
181
182         XCBuild changes the way xcconfig variables are evaluated. In short,
183         all config file assignments are now considered in part of the
184         evaluation. When using the new build system and an .xcconfig file
185         contains multiple assignments of the same build setting:
186
187         - Later assignments using $(inherited) will inherit from earlier
188           assignments in the xcconfig file.
189         - Later assignments not using $(inherited) will take precedence over
190           earlier assignments. An assignment to a more general setting will
191           mask an earlier assignment to a less general setting. For example,
192           an assignment without a condition ('FOO = bar') will completely mask
193           an earlier assignment with a condition ('FOO[sdk=macos*] = quux').
194
195         This affects some of our .xcconfig files, in that sometimes platform-
196         or sdk-specific definitions appear before the general definitions.
197         Under the new evaluations rules, the general definitions alway take
198         effect because they always overwrite the more-specific definitions. The
199         solution is to swap the order, so that the general definitions are
200         established first, and then conditionally overwritten by the
201         more-specific definitions.
202
203         * Configurations/BaseTarget.xcconfig:
204         * Configurations/Version.xcconfig:
205         * Configurations/WebKit.xcconfig:
206
207 2019-01-25  Keith Rollin  <krollin@apple.com>
208
209         Update existing .xcfilelists
210         https://bugs.webkit.org/show_bug.cgi?id=193791
211         <rdar://problem/47201706>
212
213         Reviewed by Alex Christensen.
214
215         Many .xcfilelist files were added in r238824 in order to support
216         XCBuild. Update these with recent changes to the set of build files
217         and with the current generate-xcfilelist script.
218
219         * DerivedSources-input.xcfilelist:
220         * DerivedSources-output.xcfilelist:
221         * UnifiedSources-input.xcfilelist:
222         * UnifiedSources-output.xcfilelist:
223
224 2019-01-25  Per Arne Vollan  <pvollan@apple.com>
225
226         [iOS] Deny mach lookups to services not used.
227         https://bugs.webkit.org/show_bug.cgi?id=193828
228
229         Reviewed by Brent Fulgham.
230
231         Start denying mach lookups to iOS services, which were previously allowed with reporting.
232         Living-on has indicated that these services are not used.
233
234         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
235
236 2019-01-25  Brent Fulgham  <bfulgham@apple.com>
237
238         Activate the WebResourceLoadStatisticsStore in the NetworkProcess and deactivate it in the UIProcess.
239         https://bugs.webkit.org/show_bug.cgi?id=193297
240         <rdar://problem/47158841>
241
242         Reviewed by Alex Christensen.
243
244         This patch activates the ResourceLoadStatistics code in the NetworkProcess, and turns
245         it off in the UIProcess. It also updates test infrastructure to work with this change
246         in architecture.
247
248         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
249         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceLoading): Added.
250         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceRedirect): Added.
251         (WebKit::ResourceLoadStatisticsMemoryStore::logWebSocketLoading): Added.
252         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
253         (WebKit::WebResourceLoadStatisticsStore::logSubresourceLoading): Added.
254         (WebKit::WebResourceLoadStatisticsStore::logSubresourceRedirect): Added.
255         (WebKit::WebResourceLoadStatisticsStore::logWebSocketLoading): Added.
256         (WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess):
257         (WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCap):
258         (WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCapForPrevalentResources): Deleted.
259         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
260         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
261         (WebKit::NetworkConnectionToWebProcess::logSubresourceLoading): Added.
262         (WebKit::NetworkConnectionToWebProcess::logSubresourceRedirect): Added.
263         (WebKit::NetworkConnectionToWebProcess::logWebSocketLoading): Added.
264         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
265         * NetworkProcess/NetworkSession.cpp:
266         (WebKit::NetworkSession::setResourceLoadStatisticsEnabled):
267         * UIProcess/WebProcessPool.cpp:
268         (WebKit::WebProcessPool::ensureNetworkProcess):
269         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
270         (WebKit::WebsiteDataStore::parameters):
271         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
272         (WebKit::WebsiteDataStore::removeData):
273         (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
274         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
275         * Webprocess/WebProcess.cpp:
276         (WebKit::WebProcess::initializeWebProcess): Register new ResourceLoadObserver callbacks.
277
278 2019-01-25  Ryosuke Niwa  <rniwa@webkit.org>
279
280         iOS: inputmode="none" disables hardware keyboard's globe key
281         https://bugs.webkit.org/show_bug.cgi?id=193811
282         <rdar://problem/47406553>
283
284         Reviewed by Wenson Hsieh.
285
286         Removed the support for inputmode="none" for now since we need a new SPI from UIKit
287         to properly implement this feature some time in the future.
288
289         * UIProcess/ios/WKContentViewInteraction.mm:
290         (-[WKContentView _zoomToRevealFocusedElement]):
291         (-[WKContentView inputView]):
292         (-[WKContentView requiresAccessoryView]):
293         (-[WKContentView textInputTraits]):
294
295 2019-01-25  David Kilzer  <ddkilzer@apple.com>
296
297         Move soft-linking of Lookup.framework out of LookupSPI.h
298         <https://webkit.org/b/193815>
299
300         Reviewed by Tim Horton.
301
302         * UIProcess/Cocoa/WebViewImpl.mm:
303         (-[WKWindowVisibilityObserver dealloc]):
304         (-[WKWindowVisibilityObserver startObservingLookupDismissalIfNeeded]):
305         - Move soft-linking to LookupSoftLink.{h,mm}.
306
307 2019-01-25  Antti Koivisto  <antti@apple.com>
308
309         REGRESSION (PSON): After swipe back, first few attempts to swipe forward not recognized as swipe gestures
310         https://bugs.webkit.org/show_bug.cgi?id=193818
311         <rdar://problem/47456584>
312
313         Reviewed by Tim Horton.
314
315         We don't hit the RenderTreeSizeThreshold milestone to remove the snapshot and allow interaction because we request it
316         from a wrong process (the one we are leaving behind).
317
318         * UIProcess/Cocoa/ViewGestureController.cpp:
319         (WebKit::ViewGestureController::didStartProvisionalLoadForMainFrame):
320
321         Request the RenderTreeSizeThreshold notification when the load has started and we know the process to use.
322
323         (WebKit::ViewGestureController::SnapshotRemovalTracker::hasOutstandingEvent):
324         * UIProcess/Cocoa/ViewGestureController.h:
325         (WebKit::ViewGestureController::SnapshotRemovalTracker::renderTreeSizeThreshold const):
326         (WebKit::ViewGestureController::SnapshotRemovalTracker::setRenderTreeSizeThreshold):
327         * UIProcess/mac/ViewGestureControllerMac.mm:
328         (WebKit::ViewGestureController::endSwipeGesture):
329
330         Don't request immediately, save the threshold to SnapshotRemovalTracker.
331
332         (WebKit::ViewGestureController::requestRenderTreeSizeNotificationIfNeeded):
333
334         Do the request to the right process.
335
336         * WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
337         (WebKit::ViewGestureGeometryCollector::setRenderTreeSizeNotificationThreshold):
338
339         Ensure we send the notification even if we reached the threshold before it was requested.
340
341         (WebKit::ViewGestureGeometryCollector::sendDidHitRenderTreeSizeThresholdIfNeeded):
342         (WebKit::ViewGestureGeometryCollector::mainFrameDidLayout):
343         * WebProcess/WebPage/ViewGestureGeometryCollector.h:
344         (WebKit::ViewGestureGeometryCollector::setRenderTreeSizeNotificationThreshold): Deleted.
345
346 2019-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
347
348         [iOS] Rename some WebKit-internal functions and variables that reference "data interaction"
349         https://bugs.webkit.org/show_bug.cgi?id=193829
350
351         Reviewed by Tim Horton.
352
353         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
354         (WebKit::WebPageProxy::setDragCaretRect):
355         * UIProcess/PageClient.h:
356         * UIProcess/WebPageProxy.h:
357         * UIProcess/WebPageProxy.messages.in:
358         * UIProcess/ios/PageClientImplIOS.h:
359         * UIProcess/ios/PageClientImplIOS.mm:
360         (WebKit::PageClientImpl::didHandleDragStartRequest):
361         (WebKit::PageClientImpl::didConcludeEditDrag):
362         (WebKit::PageClientImpl::didChangeDragCaretRect):
363         (WebKit::PageClientImpl::didHandleStartDataInteractionRequest): Deleted.
364         (WebKit::PageClientImpl::didConcludeEditDataInteraction): Deleted.
365         (WebKit::PageClientImpl::didChangeDataInteractionCaretRect): Deleted.
366         * UIProcess/ios/WKContentViewInteraction.h:
367         * UIProcess/ios/WKContentViewInteraction.mm:
368         (-[WKContentView setupInteraction]):
369         (-[WKContentView cleanupInteraction]):
370         (-[WKContentView setupDragAndDropInteractions]):
371         (-[WKContentView teardownDragAndDropInteractions]):
372         (-[WKContentView _didHandleDragStartRequest:]):
373         (-[WKContentView _didConcludeEditDrag:]):
374         (-[WKContentView _didChangeDragCaretRect:currentRect:]):
375         (-[WKContentView _dragInteraction:prepareForSession:completion:]):
376         (-[WKContentView setupDataInteractionDelegates]): Deleted.
377         (-[WKContentView teardownDataInteractionDelegates]): Deleted.
378         (-[WKContentView _didHandleStartDataInteractionRequest:]): Deleted.
379         (-[WKContentView _didConcludeEditDataInteraction:]): Deleted.
380         (-[WKContentView _didChangeDataInteractionCaretRect:currentRect:]): Deleted.
381         * UIProcess/ios/WebPageProxyIOS.mm:
382         (WebKit::WebPageProxy::didHandleDragStartRequest):
383         (WebKit::WebPageProxy::requestDragStart):
384         (WebKit::WebPageProxy::didConcludeEditDrag):
385         (WebKit::WebPageProxy::didHandleStartDataInteractionRequest): Deleted.
386         (WebKit::WebPageProxy::requestStartDataInteraction): Deleted.
387         (WebKit::WebPageProxy::didConcludeEditDataInteraction): Deleted.
388         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
389         (WebKit::WebDragClient::didConcludeEditDrag):
390         * WebProcess/WebPage/WebPage.h:
391         * WebProcess/WebPage/WebPage.messages.in:
392         * WebProcess/WebPage/ios/WebPageIOS.mm:
393         (WebKit::WebPage::requestDragStart):
394         (WebKit::WebPage::requestAdditionalItemsForDragSession):
395         (WebKit::WebPage::didConcludeEditDrag):
396         (WebKit::WebPage::requestStartDataInteraction): Deleted.
397         (WebKit::WebPage::didConcludeEditDataInteraction): Deleted.
398
399 2019-01-25  Alex Christensen  <achristensen@webkit.org>
400
401         WKWebView.goBack should reload if there is a safe browsing warning
402         https://bugs.webkit.org/show_bug.cgi?id=193805
403         <rdar://problem/46908216>
404
405         Reviewed by Geoff Garen.
406
407         If a WKWebView is showing a safe browsing warning and the user clicks a back button
408         in the app which calls WKWebView.goBack, the WKWebView is in a state where it has not navigated yet,
409         so actually going back will appear to the user to go back twice.  We can't just do nothing because the
410         app is in a state where it is expecting a navigation to happen.  Reloading achieves what the user expects
411         and makes the app work like the app expects.
412
413         * UIProcess/API/C/WKPage.cpp:
414         (WKPageGoBack):
415         * UIProcess/API/Cocoa/WKWebView.mm:
416         (-[WKWebView goBack]):
417         * UIProcess/PageClient.h:
418         (WebKit::PageClient::hasSafeBrowsingWarning const):
419         * UIProcess/mac/PageClientImplMac.h:
420         * UIProcess/mac/PageClientImplMac.mm:
421         (WebKit::PageClientImpl::hasSafeBrowsingWarning const):
422
423 2019-01-25  Chris Dumez  <cdumez@apple.com>
424
425         Regression(PSON) cross-site provisional page is not canceled if a new same-site one is started
426         https://bugs.webkit.org/show_bug.cgi?id=193788
427         <rdar://problem/47531231>
428
429         Reviewed by Alex Christensen.
430
431         When the page starts a new provisional load, make sure we cancel any pending one in the provisional
432         process, as it would have happened in the first provisional load happened in the same process.
433         Without this, we could have 2 parallel loads happening, one in the committed process and another
434         in the provisional one, leading to assertion failures in debug.
435
436         * UIProcess/WebPageProxy.cpp:
437         (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
438
439 2019-01-25  Chris Dumez  <cdumez@apple.com>
440
441         Drop WebKit::WebKitPolicyAction type as it is no longer needed
442         https://bugs.webkit.org/show_bug.cgi?id=193827
443
444         Reviewed by Antti Koivisto.
445
446         Drop WebKit::WebKitPolicyAction type as it is no longer needed. It is now identical to
447         WebCore::PolicyAction.
448
449         * Shared/WebPolicyAction.h: Removed.
450         * UIProcess/WebFramePolicyListenerProxy.cpp:
451         (WebKit::WebFramePolicyListenerProxy::didReceiveSafeBrowsingResults):
452         (WebKit::WebFramePolicyListenerProxy::use):
453         (WebKit::WebFramePolicyListenerProxy::download):
454         (WebKit::WebFramePolicyListenerProxy::ignore):
455         * UIProcess/WebFramePolicyListenerProxy.h:
456         * UIProcess/WebFrameProxy.cpp:
457         (WebKit::WebFrameProxy::setUpPolicyListenerProxy):
458         * UIProcess/WebFrameProxy.h:
459         * UIProcess/WebPageProxy.cpp:
460         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
461         (WebKit::WebPageProxy::receivedPolicyDecision):
462         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
463         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
464         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
465         (WebKit::WebPageProxy::decidePolicyForResponseShared):
466         * UIProcess/WebPageProxy.h:
467         * WebKit.xcodeproj/project.pbxproj:
468         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
469         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
470         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
471         * WebProcess/WebPage/WebFrame.cpp:
472         (WebKit::WebFrame::didReceivePolicyDecision):
473         (WebKit::toPolicyAction): Deleted.
474         * WebProcess/WebPage/WebFrame.h:
475         * WebProcess/WebPage/WebPage.cpp:
476         (WebKit::WebPage::didReceivePolicyDecision):
477         * WebProcess/WebPage/WebPage.h:
478
479 2019-01-25  Per Arne Vollan  <pvollan@apple.com>
480
481         [iOS] Add logging of calls
482         https://bugs.webkit.org/show_bug.cgi?id=193784
483
484         Reviewed by Brent Fulgham.
485
486         Add permissive logging of calls on iOS.
487
488         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
489
490 2019-01-25  Chris Dumez  <cdumez@apple.com>
491
492         Regression(PSON?) Crash under NavigationState::NavigationClient::decidePolicyForNavigationAction()
493         https://bugs.webkit.org/show_bug.cgi?id=193779
494         <rdar://problem/46170903>
495
496         Reviewed by Antti Koivisto.
497
498         * UIProcess/Cocoa/NavigationState.mm:
499         (WebKit::tryAppLink):
500         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
501         We were crashing when trying to get the URL of the main frame, which was sad because we never
502         ended up using the main frame URL. Therefore, this patch drops the code in question.
503
504         * UIProcess/ProvisionalPageProxy.cpp:
505         (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionAsync):
506         Add assertion to make sure that the DecidePolicyForNavigationActionAsync IPC it is getting
507         from the process is related to its main frame.
508
509 2019-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
510
511         Need a way for JavaScript (or bundle) code to participate in undo
512         https://bugs.webkit.org/show_bug.cgi?id=190009
513         <rdar://problem/44807048>
514
515         Reviewed by Ryosuke Niwa.
516
517         Invalidate undo steps when removing them from WebPage. Invalidation is a no-op for editing actions that come
518         from the UA, but for custom undo steps backed by an UndoItem, we clear out the custom undo step's pointer to its
519         UndoItem and additionally disconnect the UndoItem from its UndoManager.
520
521         * WebProcess/WebPage/WebPage.cpp:
522         (WebKit::WebPage::addWebUndoStep):
523         (WebKit::WebPage::removeWebEditCommand):
524         * WebProcess/WebPage/WebUndoStep.h:
525         (WebKit::WebUndoStep::invalidate):
526
527 2019-01-25  Patrick Griffis  <pgriffis@igalia.com>
528
529         [GTK][WPE] Add API to add paths to sandbox
530         https://bugs.webkit.org/show_bug.cgi?id=193571
531
532         This allows applications to add paths to the web process
533         if required by web extensions.
534
535         Reviewed by Michael Catanzaro.
536
537         * UIProcess/API/glib/WebKitWebContext.cpp:
538         (webkit_web_context_add_path_to_sandbox):
539         * UIProcess/API/gtk/WebKitWebContext.h:
540         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
541         * UIProcess/API/wpe/docs/wpe-0.1-sections.txt:
542         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
543         (WebKit::bubblewrapSpawn):
544         * UIProcess/WebProcessPool.h:
545         * UIProcess/glib/WebProcessProxyGLib.cpp:
546         (WebKit::WebProcessProxy::platformGetLaunchOptions):
547
548 2019-01-24  Ryosuke Niwa  <rniwa@webkit.org>
549
550         iOS: Split keyboard should not shrink visualViewport.height
551         https://bugs.webkit.org/show_bug.cgi?id=193798
552
553         Reviewed by Tim Horton.
554
555         Treat a split keyboard like a floating keyboard and don't consider its input view bounds in computing the visible content rects.
556
557         No new tests since while it's possible to transition between split and merged keyboard using some SPI,
558         there isn't a reliable mechanism to reset the keyboard state. e.g. we need to wait for a hard-coded amount of time.
559
560         * Platform/spi/ios/UIKitSPI.h:
561         * UIProcess/API/Cocoa/WKWebView.mm:
562         (-[WKWebView _keyboardChangedWithInfo:adjustScrollView:]):
563
564 2019-01-24  Eric Carlson  <eric.carlson@apple.com>
565
566         [iOS] Silence MediaPlayer compile warnings
567         https://bugs.webkit.org/show_bug.cgi?id=193780
568         <rdar://problem/47518428>
569
570         Reviewed by Jer Noble.
571
572         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
573
574 2019-01-24  Truitt Savell  <tsavell@apple.com>
575
576         Unreviewed, rolling out r240446.
577
578         Casued 5 API failures
579
580         Reverted changeset:
581
582         "Activate the WebResourceLoadStatisticsStore in the
583         NetworkProcess and deactivate it in the UIProcess."
584         https://bugs.webkit.org/show_bug.cgi?id=193297
585         https://trac.webkit.org/changeset/240446
586
587 2019-01-24  Brent Fulgham  <bfulgham@apple.com>
588
589         Activate the WebResourceLoadStatisticsStore in the NetworkProcess and deactivate it in the UIProcess.
590         https://bugs.webkit.org/show_bug.cgi?id=193297
591         <rdar://problem/47158841>
592
593         Reviewed by Alex Christensen.
594
595         This patch activates the ResourceLoadStatistics code in the NetworkProcess, and turns
596         it off in the UIProcess. It also updates test infrastructure to work with this change
597         in architecture.
598
599         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
600         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceLoading): Added.
601         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceRedirect): Added.
602         (WebKit::ResourceLoadStatisticsMemoryStore::logWebSocketLoading): Added.
603         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
604         (WebKit::WebResourceLoadStatisticsStore::logSubresourceLoading): Added.
605         (WebKit::WebResourceLoadStatisticsStore::logSubresourceRedirect): Added.
606         (WebKit::WebResourceLoadStatisticsStore::logWebSocketLoading): Added.
607         (WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess):
608         (WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCap):
609         (WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCapForPrevalentResources): Deleted.
610         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
611         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
612         (WebKit::NetworkConnectionToWebProcess::logSubresourceLoading): Added.
613         (WebKit::NetworkConnectionToWebProcess::logSubresourceRedirect): Added.
614         (WebKit::NetworkConnectionToWebProcess::logWebSocketLoading): Added.
615         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
616         * NetworkProcess/NetworkSession.cpp:
617         (WebKit::NetworkSession::setResourceLoadStatisticsEnabled):
618         * UIProcess/WebProcessPool.cpp:
619         (WebKit::WebProcessPool::ensureNetworkProcess):
620         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
621         (WebKit::WebsiteDataStore::parameters):
622         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
623         (WebKit::WebsiteDataStore::removeData):
624         (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
625         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
626         * Webprocess/WebProcess.cpp:
627         (WebKit::WebProcess::initializeWebProcess): Register new ResourceLoadObserver callbacks.
628
629 2019-01-24  John Wilander  <wilander@apple.com>
630
631         Add Ad Click Attribution as an internal/experimental feature
632         https://bugs.webkit.org/show_bug.cgi?id=193685
633         <rdar://problem/47450399>
634
635         Reviewed by Brent Fulgham.
636
637         * Shared/WebPreferences.yaml:
638             Added AdClickAttributionEnabled as a runtime enabled feature, off by default.
639
640 2019-01-24  Antti Koivisto  <antti@apple.com>
641
642         [PSON] Flash on back navigation on Mac
643         https://bugs.webkit.org/show_bug.cgi?id=193716
644         <rdar://problem/47148458>
645
646         Reviewed by Chris Dumez.
647
648         We close the page immediately if we fail to suspend. Layers disappear and we get a flash.
649
650         * UIProcess/SuspendedPageProxy.cpp:
651         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
652         (WebKit::SuspendedPageProxy::close):
653
654         Track closed state so we don't send the message twice, causing unhandled message errors in web process.
655
656         (WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
657
658         Close the suspended page if the suspension fails.
659         Skip this if we are using web process side compositing on Mac.
660
661         * UIProcess/SuspendedPageProxy.h:
662         * UIProcess/WebPageProxy.cpp:
663         (WebKit::WebPageProxy::enterAcceleratedCompositingMode):
664
665         On Mac, close the failed SuspendedPageProxy when entering compositing mode. At this point we don't need it to keep layers alive.
666
667         * UIProcess/WebProcessPool.cpp:
668         (WebKit::WebProcessPool::closeFailedSuspendedPagesForPage):
669         * UIProcess/WebProcessPool.h:
670         * WebProcess/WebPage/WebPage.cpp:
671         (WebKit::WebPage::suspendForProcessSwap):
672
673         Don't close the page on suspension failure. This is now managed by the UI process.
674
675 2019-01-24  Chris Dumez  <cdumez@apple.com>
676
677         Regression(PSON) Back/Forward list items' URL sometimes gets replaced with the URL of a subframe
678         https://bugs.webkit.org/show_bug.cgi?id=193761
679         <rdar://problem/47456405>
680
681         Reviewed by Alex Christensen.
682
683         When doing a history navigation cross-process, the UIProcess would first send the back/forward list items
684         to the destination WebProcess via WebPage::updateBackForwardListForReattach(), then ask the process to
685         navigate to the expected back/forward list item.
686
687         WebPage::updateBackForwardListForReattach() would call restoreSessionInternal(), which would call
688         toHistoryItem() on each BackForwardListItem. This may end up creating more than one HistoryItem for each
689         BackForwardListItem because HistoryItems are part of a tree (each frame has its own list of history items).
690
691         Note that BackForwardListItems and HistoryItem share a BackForwardItemIdentifier which is a
692         (processIdentifier, itemIdentifier) pair. We normally generate the HistoryItem's identifier from inside
693         its constructor like so:
694         `{ Process::identifier(), generateObjectIdentifier<BackForwardItemIdentifier::ItemIdentifierType>() }`
695
696         However, when calling updateBackForwardListForReattach() and constructing children HistoryItem,
697         applyFrameState() would generate the identifier by itself and passing it to the HistoryItem constructor.
698         Its genegates the ID the exact same way so this would in theory not be a problem. Unfortunately, both
699         calls to generateObjectIdentifier() get inlined and both call sites end up with their own static counter
700         to generate ids. As a result, we may end up with conflicts as HistoryItems for child frames (restored
701         by restoreSessionInternal()) can end up with the same identifier as HistoryItems for top frames.
702
703         This confusion would lead to the WebContent process sending the UIProcess bad information and the URL
704         of subframes could end up as the WebBackForwardListItem's mainframe URL.
705
706         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
707         (WebKit::applyFrameState):
708         Stop calling generateObjectIdentifier() explicitly and let the HistoryItem constructor take care of it.
709         Calling generateObjectIdentifier() for the same type from different places is not safe due to inlining.
710
711 2019-01-24  Ross Kirsling  <ross.kirsling@sony.com>
712
713         Move FileSystem to WTF
714         https://bugs.webkit.org/show_bug.cgi?id=193602
715
716         Reviewed by Yusuke Suzuki.
717
718         * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.cpp:
719         * NetworkProcess/NetworkDataTaskBlob.h:
720         * NetworkProcess/NetworkProcess.cpp:
721         * NetworkProcess/cache/CacheStorageEngine.cpp:
722         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
723         * NetworkProcess/cache/NetworkCache.cpp:
724         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
725         * NetworkProcess/cache/NetworkCacheData.cpp:
726         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
727         * NetworkProcess/cache/NetworkCacheFileSystem.h:
728         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
729         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
730         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
731         * NetworkProcess/cache/NetworkCacheStorage.cpp:
732         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
733         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
734         * NetworkProcess/mac/NetworkProcessMac.mm:
735         * NetworkProcess/soup/NetworkProcessSoup.cpp:
736         * PluginProcess/unix/PluginProcessMainUnix.cpp:
737         * Shared/PersistencyUtils.cpp:
738         * Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp:
739         * Shared/Plugins/unix/PluginSearchPath.cpp:
740         * Shared/WebMemorySampler.h:
741         * Shared/glib/ProcessExecutablePathGLib.cpp:
742         * Shared/ios/ChildProcessIOS.mm:
743         * Shared/mac/ChildProcessMac.mm:
744         * Shared/mac/SandboxExtensionMac.mm:
745         * UIProcess/API/APIContentRuleListStore.cpp:
746         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
747         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
748         * UIProcess/API/glib/IconDatabase.cpp:
749         * UIProcess/API/glib/WebKitFaviconDatabase.cpp:
750         * UIProcess/API/glib/WebKitFileChooserRequest.cpp:
751         * UIProcess/API/glib/WebKitWebContext.cpp:
752         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
753         * UIProcess/API/win/APIWebsiteDataStoreWin.cpp:
754         * UIProcess/Automation/WebAutomationSession.cpp:
755         * UIProcess/Cocoa/DownloadClient.mm:
756         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
757         * UIProcess/Cocoa/WebViewImpl.mm:
758         * UIProcess/DeviceIdHashSaltStorage.cpp:
759         * UIProcess/Downloads/DownloadProxy.cpp:
760         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
761         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
762         * UIProcess/Plugins/gtk/PluginInfoCache.cpp:
763         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
764         * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
765         * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
766         * UIProcess/ServiceWorkerProcessProxy.cpp:
767         * UIProcess/WebStorage/LocalStorageDatabase.cpp:
768         * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
769         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
770         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
771         * UIProcess/glib/WebProcessProxyGLib.cpp:
772         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
773         * UIProcess/gtk/WebProcessPoolGtk.cpp:
774         * UIProcess/ios/WKContentViewInteraction.mm:
775         * UIProcess/ios/forms/WKFileUploadPanel.mm:
776         * UIProcess/mac/WebPageProxyMac.mm:
777         * UIProcess/win/WebProcessPoolWin.cpp:
778         * UIProcess/win/WebView.cpp:
779         * UIProcess/wpe/WebProcessPoolWPE.cpp:
780         * WebProcess/InjectedBundle/API/glib/WebKitExtensionManager.cpp:
781         * WebProcess/InjectedBundle/glib/InjectedBundleGlib.cpp:
782         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
783         * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
784         * WebProcess/Plugins/PluginProcessConnection.cpp:
785         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
786         * WebProcess/WebPage/gtk/WebInspectorUIGtk.cpp:
787         * WebProcess/WebPage/win/WebInspectorUIWin.cpp:
788         * WebProcess/cocoa/WebProcessCocoa.mm:
789
790 2019-01-23  Simon Fraser  <simon.fraser@apple.com>
791
792         Create "frame hosting" nodes for the scrolling tree
793         https://bugs.webkit.org/show_bug.cgi?id=193753
794
795         Reviewed by Antti Koivisto.
796
797         When the scrolling tree crosses frame boundaries, mutations in the parent frame currently
798         require the iframe's scrolling node to get reparented in a new ancestor, which requires
799         a layer tree walk of the parent frame. This is error-prone, and not very future-proof.
800
801         Fix this by introducing "frame hosting" scrolling tree nodes. These are mostly inert
802         nodes that are owned by the RenderIFrame's layer backing in the parent frame, and exist
803         to provide a consistent parent node for the subframe's scrolling node.
804
805         This patch adds the node types, but does not instantiate them yet.
806
807         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
808         (ArgumentCoder<ScrollingStateFrameHostingNode>::encode):
809         (ArgumentCoder<ScrollingStateFrameHostingNode>::decode):
810         (WebKit::encodeNodeAndDescendants):
811         (WebKit::RemoteScrollingCoordinatorTransaction::decode):
812         (WebKit::dump):
813         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
814         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
815         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
816         (WebKit::RemoteScrollingTree::createScrollingTreeNode):
817         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
818         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
819
820 2019-01-23  Ross Kirsling  <ross.kirsling@sony.com>
821
822         [Curl] Unreviewed build fix for r240292 and friends.
823
824         WinCairo test stability must be restored in subsequent patch.
825
826         * NetworkProcess/curl/NetworkProcessCurl.cpp:
827         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
828         (WebKit::NetworkProcess::setNetworkProxySettings):
829
830 2019-01-23  Commit Queue  <commit-queue@webkit.org>
831
832         Unreviewed, rolling out r240403.
833         https://bugs.webkit.org/show_bug.cgi?id=193757
834
835         "Causes multiple crashes on macOS port (probably used wrong
836         ENABLE macro)" (Requested by ddkilzer on #webkit).
837
838         Reverted changeset:
839
840         "[Curl] Unreviewed build fix for r240292 and friends."
841         https://trac.webkit.org/changeset/240403
842
843 2019-01-23  Ross Kirsling  <ross.kirsling@sony.com>
844
845         [Curl] Unreviewed build fix for r240292 and friends.
846
847         WinCairo test stability must be restored in subsequent patch.
848
849         * NetworkProcess/curl/NetworkProcessCurl.cpp:
850         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
851         (WebKit::NetworkProcess::setNetworkProxySettings):
852
853 2019-01-23  Alex Christensen  <achristensen@webkit.org>
854
855         Stop using NetworkProcess::singleton
856         https://bugs.webkit.org/show_bug.cgi?id=193700
857
858         Reviewed by Don Olmstead.
859
860         This replaces it with a NeverDestroyed<NetworkProcess> and paves the way for more interesting things.
861
862         * NetworkProcess/CustomProtocols/soup/LegacyCustomProtocolManagerSoup.cpp:
863         * NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm:
864         (WebKit::initializeChildProcess<WebKit::NetworkProcess>):
865         * NetworkProcess/NetworkProcess.cpp:
866         (WebKit::NetworkProcess::NetworkProcess):
867         (WebKit::NetworkProcess::singleton): Deleted.
868         * NetworkProcess/NetworkProcess.h:
869         * NetworkProcess/soup/NetworkProcessMainSoup.cpp:
870         (WebKit::initializeChildProcess<WebKit::NetworkProcess>):
871         * NetworkProcess/win/NetworkProcessMainWin.cpp:
872         (WebKit::initializeChildProcess<WebKit::NetworkProcess>):
873         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
874         (WebKit::initializeChildProcess):
875         (WebKit::XPCServiceInitializer):
876
877 2019-01-23  Ryan Haddad  <ryanhaddad@apple.com>
878
879         Unreviewed, rolling out r240343.
880
881         Caused 4 PSON API test failures.
882
883         Reverted changeset:
884
885         "[PSON] Flash on back navigation on Mac"
886         https://bugs.webkit.org/show_bug.cgi?id=193716
887         https://trac.webkit.org/changeset/240343
888
889 2019-01-23  Chris Dumez  <cdumez@apple.com>
890
891         Deprecate API to limit the maximum number of WebProcesses
892         https://bugs.webkit.org/show_bug.cgi?id=193725
893         <rdar://problem/47464879>
894
895         Reviewed by Geoff Garen.
896
897         Deprecate API to limit the maximum number of WebProcesses and make it a no-op. It adds
898         complexity and is not safe (conflicts with PSON).
899
900         Add a new usesSingleWebProcess SPI to _WKProcessPoolConfiguration to be used by
901         Minibrowser / Safari in order to disable process per tab (can be useful for debugging).
902         Note that enabling the single WebProcess mode will disable PSON and process prewarming.
903
904         * UIProcess/API/APIProcessPoolConfiguration.cpp:
905         (API::ProcessPoolConfiguration::createWithLegacyOptions):
906         (API::ProcessPoolConfiguration::copy):
907         * UIProcess/API/APIProcessPoolConfiguration.h:
908         * UIProcess/API/C/WKContext.cpp:
909         (WKContextSetMaximumNumberOfProcesses):
910         (WKContextGetMaximumNumberOfProcesses):
911         * UIProcess/API/C/WKContext.h:
912         * UIProcess/API/Cocoa/WKProcessPool.mm:
913         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
914         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
915         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
916         (-[_WKProcessPoolConfiguration maximumProcessCount]):
917         (-[_WKProcessPoolConfiguration setMaximumProcessCount:]):
918         (-[_WKProcessPoolConfiguration usesSingleWebProcess]):
919         (-[_WKProcessPoolConfiguration setUsesSingleWebProcess:]):
920         (-[_WKProcessPoolConfiguration description]):
921         * UIProcess/API/glib/WebKitWebContext.cpp:
922         (webkitWebContextConstructed):
923         (webkit_web_context_set_process_model):
924         (webkit_web_context_set_web_process_count_limit):
925         * UIProcess/WebProcessPool.cpp:
926         (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
927         (WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
928         (WebKit::WebProcessPool::processForNavigationInternal):
929         * UIProcess/WebProcessPool.h:
930
931 2019-01-23  Brent Fulgham  <bfulgham@apple.com>
932
933         Switch NetworkStorageSession portions of ResourceLoadStatistics to Async message passing style
934         https://bugs.webkit.org/show_bug.cgi?id=193659
935         <rdar://problem/47433290>
936
937         Reviewed by Alex Christensen.
938
939         Change the implementations of ResourceLoadStatistics code in NetworkStorageSession to use the
940         'sendWithAsyncReply' so that more of the code is autogenerated. This should make test runs more
941         consistent, and should reduce the possibility of bookkeeping errors in the message handling
942         implementations.
943
944         Fix the implementation of NetworkProcessProxy::clearCallbackStates to remove the manually constructed
945         (and incomplete) message callbacks. These errors are a big reason to move to the auto-generated
946         'sendWithAsyncReply' implementatoin. Ditto for NetworkProcessProxy::didClose.
947
948         This patch also moves an initializaton call (WebsiteDataStore::didCreateNetworkProcess) from
949         'ensureNetworkProcess' to 'processDidFinishLaunching'. In current code, the call happens before
950         a connection is established to the network process, causing initialization messages to get dropped
951         leading to test system flakiness.
952
953         Finally: The WK API test code was updated to ensure that completion handlers are always called, even
954         when built without ENABLE_RESOURCE_LOAD_STATISTICS defined.
955
956         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
957         * NetworkProcess/Classifier/ShouldGrandfatherStatistics.h: Added.
958         * NetworkProcess/Classifier/StorageAccessStatus.h: Added.
959         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
960         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
961         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
962         * NetworkProcess/NetworkProcess.cpp:
963         (WebKit::NetworkProcess::updatePrevalentDomainsToBlockCookiesFor):
964         (WebKit::NetworkProcess::setAgeCapForClientSideCookies):
965         (WebKit::NetworkProcess::scheduleClearInMemoryAndPersistent):
966         (WebKit::NetworkProcess::hasStorageAccessForFrame):
967         (WebKit::NetworkProcess::requestStorageAccess):
968         (WebKit::NetworkProcess::grantStorageAccess):
969         (WebKit::NetworkProcess::removeAllStorageAccess):
970         (WebKit::NetworkProcess::setCacheMaxAgeCapForPrevalentResources):
971         (WebKit::NetworkProcess::resetCacheMaxAgeCapForPrevalentResources):
972         (WebKit::NetworkProcess::deleteWebsiteData):
973         * NetworkProcess/NetworkProcess.h:
974         * NetworkProcess/NetworkProcess.messages.in:
975         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
976         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
977         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
978         (WKWebsiteDataStoreStatisticsResetToConsistentState):
979         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
980         * UIProcess/Network/NetworkProcessProxy.cpp:
981         (WebKit::NetworkProcessProxy::clearCallbackStates): Remove incomplete clean-up code that
982         is now autogenerated.
983         (WebKit::NetworkProcessProxy::didClose): Ditto.
984         (WebKit::NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor):
985         (WebKit::NetworkProcessProxy::scheduleClearInMemoryAndPersistent):
986         (WebKit::NetworkProcessProxy::setAgeCapForClientSideCookies):
987         (WebKit::NetworkProcessProxy::hasStorageAccessForFrame):
988         (WebKit::NetworkProcessProxy::requestStorageAccess):
989         (WebKit::NetworkProcessProxy::grantStorageAccess):
990         (WebKit::NetworkProcessProxy::removeAllStorageAccess):
991         (WebKit::NetworkProcessProxy::setCacheMaxAgeCapForPrevalentResources):
992         (WebKit::NetworkProcessProxy::setCacheMaxAgeCap):
993         (WebKit::NetworkProcessProxy::resetCacheMaxAgeCapForPrevalentResources):
994         (WebKit::NetworkProcessProxy::didUpdateBlockCookies): Deleted.
995         (WebKit::NetworkProcessProxy::didSetAgeCapForClientSideCookies): Deleted.
996         (WebKit::NetworkProcessProxy::didUpdateRuntimeSettings): Deleted.
997         (WebKit::NetworkProcessProxy::storageAccessRequestResult): Deleted.
998         (WebKit::NetworkProcessProxy::storageAccessOperationResult): Deleted.
999         (WebKit::NetworkProcessProxy::didRemoveAllStorageAccess): Deleted.
1000         (WebKit::NetworkProcessProxy::didSetCacheMaxAgeCapForPrevalentResources): Deleted.
1001         * UIProcess/Network/NetworkProcessProxy.h:
1002         * UIProcess/Network/NetworkProcessProxy.messages.in:
1003         * UIProcess/WebPageProxy.cpp:
1004         * UIProcess/WebProcessPool.cpp:
1005         (WebKit::WebProcessPool::ensureNetworkProcess): Move WebsiteDataStore 'didCreateNetworkProcess'
1006         to 'processDidFinishLaunching'. Currently the call happens before a connection is established,
1007         causing initialization messages to get dropped.
1008         (WebKit::WebProcessPool::processDidFinishLaunching): Ditto.
1009         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1010         (WebKit::WebsiteDataStore::removeData):
1011         (WebKit::WebsiteDataStore::setMaxStatisticsEntries):
1012         (WebKit::WebsiteDataStore::setPruneEntriesDownTo):
1013         (WebKit::WebsiteDataStore::setGrandfatheringTime):
1014         (WebKit::WebsiteDataStore::setCacheMaxAgeCap):
1015         (WebKit::WebsiteDataStore::setMinimumTimeBetweenDataRecordsRemoval):
1016         (WebKit::WebsiteDataStore::setPrevalentResource):
1017         (WebKit::WebsiteDataStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
1018         (WebKit::WebsiteDataStore::scheduleClearInMemoryAndPersistent):
1019         (WebKit::WebsiteDataStore::setAgeCapForClientSideCookies):
1020         (WebKit::WebsiteDataStore::setNotifyPagesWhenDataRecordsWereScanned):
1021         (WebKit::WebsiteDataStore::setNotifyPagesWhenTelemetryWasCaptured):
1022         (WebKit::WebsiteDataStore::setTimeToLiveUserInteraction):
1023         (WebKit::WebsiteDataStore::setCacheMaxAgeCapForPrevalentResources):
1024         (WebKit::WebsiteDataStore::setResourceLoadStatisticsDebugMode):
1025         * UIProcess/WebsiteData/WebsiteDataStore.h:
1026         * WebKit.xcodeproj/project.pbxproj:
1027
1028 2019-01-23  Sihui Liu  <sihui_liu@apple.com>
1029
1030         Clean up IndexedDB files between tests
1031         https://bugs.webkit.org/show_bug.cgi?id=192796
1032         <rdar://problem/46824999>
1033
1034         Reviewed by Geoffrey Garen.
1035
1036         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1037         (WKWebsiteDataStoreRemoveAllIndexedDatabases):
1038         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
1039
1040 2019-01-23  Wenson Hsieh  <wenson_hsieh@apple.com>
1041
1042         [iOS] fast/events/touch/ios/hover-when-style-change-is-async.html times out
1043         https://bugs.webkit.org/show_bug.cgi?id=193182
1044         <rdar://problem/47452154>
1045
1046         Reviewed by Tim Horton.
1047
1048         Fix an existing bug where blurring an element doesn't always un-suppress text interactions.
1049
1050         * UIProcess/ios/WKContentViewInteraction.mm:
1051         (-[WKContentView _elementDidBlur]):
1052
1053 2019-01-23  Michael Catanzaro  <mcatanzaro@igalia.com>
1054
1055         Minor improvements to NetworkProcess
1056         https://bugs.webkit.org/show_bug.cgi?id=193708
1057
1058         Reviewed by Alex Christensen.
1059
1060         * NetworkProcess/NetworkProcess.cpp:
1061         (WebKit::NetworkProcess::switchToNewTestingSession): Fix a spelling error.
1062         (WebKit::NetworkProcess::ensureSession): Add useful assertion.
1063         (WebKit::NetworkProcess::defaultStorageSession const): Split into platform functions.
1064         (WebKit::NetworkProcess::destroySession): Add useful assertion.
1065         * NetworkProcess/NetworkProcess.h:
1066         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1067         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
1068         * NetworkProcess/curl/NetworkProcessCurl.cpp:
1069         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
1070         * NetworkProcess/soup/NetworkProcessSoup.cpp:
1071         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
1072
1073 2019-01-23  Daniel Bates  <dabates@apple.com>
1074
1075         Fix the Apple Internal build. See <rdar://problem/47486758>.
1076
1077         * UIProcess/ios/WKContentViewInteraction.mm:
1078         (-[WKContentView dropInteraction:previewForDroppingItem:withDefault:]):
1079
1080 2019-01-23  Per Arne Vollan  <pvollan@apple.com>
1081
1082         [macOS] Sandbox fails to compile
1083         https://bugs.webkit.org/show_bug.cgi?id=193727
1084         <rdar://problem/47476903>
1085
1086         Reviewed by Brent Fulgham.
1087
1088         Use '(with send-signal SIGKILL)' instead of '(with termination)'.
1089
1090         * WebProcess/com.apple.WebProcess.sb.in:
1091
1092 2019-01-23  Brent Fulgham  <bfulgham@apple.com>
1093
1094         REGRESSION (r240243): CrashTracer: WebKitTestRunnerApp at com.apple.WebKit: WebKit::WebResourceLoadStatisticsStore::sendDiagnosticMessageWithValue const + 32
1095         https://bugs.webkit.org/show_bug.cgi?id=193723
1096         <rdar://problem/47476802>
1097
1098         Reviewed by David Kilzer.
1099
1100         The new code added in r240243 could attempt to submit telemetry after the relevant
1101         WebResourceLoadStatisticsStore was destroyed. We should guard against this possibility.
1102
1103         * NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp:
1104         (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
1105
1106 2019-01-23  Antti Koivisto  <antti@apple.com>
1107
1108         [PSON] Flash on back navigation on Mac
1109         https://bugs.webkit.org/show_bug.cgi?id=193716
1110         <rdar://problem/47148458>
1111
1112         Reviewed by Chris Dumez.
1113
1114         We close the page immediately if we fail to suspend. Layers disappear and we get a flash.
1115
1116         * UIProcess/SuspendedPageProxy.cpp:
1117         (WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
1118
1119         Remove the suspended page (so closing it on web process side) if the suspension fails.
1120         Skip this if we are using web process side compositing on Mac.
1121
1122         * UIProcess/WebPageProxy.cpp:
1123         (WebKit::WebPageProxy::enterAcceleratedCompositingMode):
1124
1125         On Mac, remove failed SuspendedPageProxy when entering compositing mode. At this point we don't need it to keep layers alive.
1126
1127         * UIProcess/WebProcessPool.cpp:
1128         (WebKit::WebProcessPool::removeFailedSuspendedPagesForPage):
1129         * UIProcess/WebProcessPool.h:
1130         * WebProcess/WebPage/WebPage.cpp:
1131         (WebKit::WebPage::suspendForProcessSwap):
1132
1133         Don't close the page on suspension failure.
1134
1135 2019-01-23  Wenson Hsieh  <wenson_hsieh@apple.com>
1136
1137         Introduce UndoStep::label() and adopt it in WebKitLegacy and WebKit
1138         https://bugs.webkit.org/show_bug.cgi?id=193706
1139         <rdar://problem/44807048>
1140
1141         Reviewed by Ryosuke Niwa.
1142
1143         * UIProcess/Cocoa/WebViewImpl.mm:
1144         (WebKit::WebViewImpl::registerEditCommand):
1145         * UIProcess/WebEditCommandProxy.cpp:
1146         (WebKit::WebEditCommandProxy::WebEditCommandProxy):
1147         * UIProcess/WebEditCommandProxy.h:
1148
1149         Drive-by tweak: make WebEditCommandProxy's backpointer to its WebPageProxy a WeakPtr instead of a raw pointer.
1150         Additionally, call clear() instead of setting m_page to 0 upon invalidation. Also, turn the WebPageProxy*
1151         argument into a WebPageProxy&, since the WebPageProxy must exist when it creates a new WebEditCommandProxy.
1152
1153         (WebKit::WebEditCommandProxy::create):
1154         (WebKit::WebEditCommandProxy::label const):
1155         (WebKit::WebEditCommandProxy::invalidate):
1156         (WebKit::WebEditCommandProxy::editAction const): Deleted.
1157
1158         Adjust UI-side logic to just handle the undo/redo label, rather than map the edit action to a localized string.
1159
1160         * UIProcess/WebPageProxy.cpp:
1161         (WebKit::WebPageProxy::registerEditCommandForUndo):
1162         (WebKit::WebPageProxy::resetState):
1163
1164         Tweak this to use std::exchange instead of copying all the WebEditCommandProxy RefPtrs into a separate Vector
1165         and then iterating over the Vector.
1166
1167         * UIProcess/WebPageProxy.h:
1168         * UIProcess/WebPageProxy.messages.in:
1169
1170         Adjust this so that we only send the undo/redo label over IPC, rather than the edit action type.
1171
1172         * UIProcess/ios/PageClientImplIOS.mm:
1173         (WebKit::PageClientImpl::registerEditCommand):
1174         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1175         (WebKit::WebEditorClient::registerUndoStep):
1176
1177 2019-01-23  Michael Catanzaro  <mcatanzaro@igalia.com>
1178
1179         [SOUP] Remove libsoup cruft from WebProcess
1180         https://bugs.webkit.org/show_bug.cgi?id=193710
1181
1182         Reviewed by Carlos Garcia Campos.
1183
1184         SoupNetworkSession is no longer accessible from the web process because it's owned
1185         (indirectly) by NetworkProcess after r240292. It doesn't make sense to have any libsoup
1186         code under WebProcess anymore. The current libsoup code consists of (a) unused stuff to be
1187         removed, (b) stuff unrelated to libsoup, which should move to a WebProcessGLib.cpp, and (c)
1188         WebKitSoupRequestInputStream, which is only used by NetworkProcess and should move there
1189
1190         * NetworkProcess/soup/WebKitSoupRequestInputStream.cpp: Renamed from Source/WebKit/WebProcess/soup/WebKitSoupRequestInputStream.cpp.
1191         (AsyncReadData::AsyncReadData):
1192         (webkitSoupRequestInputStreamReadAsyncResultComplete):
1193         (webkitSoupRequestInputStreamPendingReadAsyncComplete):
1194         (webkitSoupRequestInputStreamHasDataToRead):
1195         (webkitSoupRequestInputStreamIsWaitingForData):
1196         (webkitSoupRequestInputStreamReadAsync):
1197         (webkitSoupRequestInputStreamReadFinish):
1198         (webkitSoupRequestInputStreamFinalize):
1199         (webkit_soup_request_input_stream_init):
1200         (webkit_soup_request_input_stream_class_init):
1201         (webkitSoupRequestInputStreamNew):
1202         (webkitSoupRequestInputStreamAddData):
1203         (webkitSoupRequestInputStreamDidFailWithError):
1204         (webkitSoupRequestInputStreamFinished):
1205         * NetworkProcess/soup/WebKitSoupRequestInputStream.h: Renamed from Source/WebKit/WebProcess/soup/WebKitSoupRequestInputStream.h.
1206         * SourcesGTK.txt:
1207         * SourcesWPE.txt:
1208         * UIProcess/soup/WebProcessPoolSoup.cpp:
1209         (WebKit::WebProcessPool::setNetworkProxySettings): Don't send message to web processes.
1210         * WebProcess/WebProcess.h:
1211         * WebProcess/WebProcess.messages.in:
1212         * WebProcess/glib/WebProcessGLib.cpp: Renamed from Source/WebKit/WebProcess/soup/WebProcessSoup.cpp.
1213         (WebKit::WebProcess::platformSetCacheModel):
1214         (WebKit::WebProcess::platformInitializeWebProcess):
1215         (WebKit::WebProcess::platformTerminate):
1216
1217 2019-01-23  Michael Catanzaro  <mcatanzaro@igalia.com>
1218
1219         [SOUP] Clean up NetworkStorageSession
1220         https://bugs.webkit.org/show_bug.cgi?id=193707
1221
1222         Reviewed by Carlos Garcia Campos.
1223
1224         Restore an important call to clearSoupNetworkSession that was removed in r240292. Also,
1225         adapt to NetworkStorageSessions API changes.
1226
1227         * NetworkProcess/CustomProtocols/soup/LegacyCustomProtocolManagerSoup.cpp:
1228         (WebKit::LegacyCustomProtocolManager::registerScheme):
1229         * NetworkProcess/soup/NetworkProcessMainSoup.cpp:
1230         * NetworkProcess/soup/NetworkProcessSoup.cpp:
1231         (WebKit::NetworkProcess::userPreferredLanguagesChanged):
1232         (WebKit::NetworkProcess::setNetworkProxySettings):
1233         * NetworkProcess/soup/NetworkSessionSoup.cpp:
1234         (WebKit::NetworkSessionSoup::soupSession const):
1235
1236 2019-01-23  Philippe Normand  <pnormand@igalia.com>
1237
1238         [GTK] Crash when browsing inspector:// uri without port set
1239         https://bugs.webkit.org/show_bug.cgi?id=193721
1240
1241         Reviewed by Michael Catanzaro.
1242
1243         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
1244         (WebKit::RemoteInspectorProtocolHandler::handleRequest): Return
1245         back to caller after setting the error, if no port was provided
1246         along with the inspector URL.
1247
1248 2019-01-23  David Kilzer  <ddkilzer@apple.com>
1249
1250         Switch remaining CoreMedia soft-linking in WebKit over to CoreMediaSoftLink.{cpp,h}
1251         <https://webkit.org/b/193694>
1252         <rdar://problem/47464025>
1253
1254         Reviewed by Tim Horton.
1255
1256         * Shared/ios/WebIconUtilities.mm:
1257         - Switch to using CoreMediaSoftLink.{h,mm} in PAL.
1258
1259 2019-01-22  Chris Dumez  <cdumez@apple.com>
1260
1261         Regression(r240178) Some API tests are crashing
1262         https://bugs.webkit.org/show_bug.cgi?id=193680
1263
1264         Reviewed by Alex Christensen.
1265
1266         r240178 made sure that userScripts / scriptMessageHandlers / contentExtensions are always
1267         properly populated in the WebPageCreationParameters. This was needed in case we need to
1268         reconstruct the WebUserContentController on the WebProcess side. However, this caused a
1269         regression in the case we reuse a process where the WebUserContentController still exists
1270         (because it was kept alive, e.g. by the WebPageGroup). In that case, we would add duplicate
1271         entries to the existing WebUserContentController instance because its "add" methods did not
1272         have duplicate checks. To address the issue, this patch adds duplicate checks to the
1273         WebUserContentController "add" methods.
1274
1275         * WebProcess/UserContent/WebUserContentController.cpp:
1276         (WebKit::WebUserContentController::addUserScriptMessageHandlerInternal):
1277         (WebKit::WebUserContentController::removeUserScriptMessageHandlerInternal):
1278         (WebKit::WebUserContentController::addUserScriptInternal):
1279         (WebKit::WebUserContentController::removeUserScriptInternal):
1280         (WebKit::WebUserContentController::addUserStyleSheetInternal):
1281         (WebKit::WebUserContentController::removeUserStyleSheetInternal):
1282         (WebKit::WebUserContentController::forEachUserMessageHandler const):
1283         * WebProcess/UserContent/WebUserContentController.h:
1284
1285 2019-01-22  Michael Catanzaro  <mcatanzaro@igalia.com>
1286
1287         Unreviewed attempt to fix GTK/WPE bots
1288         https://bugs.webkit.org/show_bug.cgi?id=193580
1289         <rdar://problem/47457742>
1290
1291         Doesn't make sense to clear the storage session right after creating it. This should fix
1292         network process crash on startup under G_DEBUG=fatal-criticals due to the storage session
1293         not having a cookie jar.
1294
1295         * NetworkProcess/NetworkProcess.cpp:
1296         (WebKit::NetworkProcess::NetworkProcess):
1297
1298 2019-01-22  Megan Gardner  <megan_gardner@apple.com>
1299
1300         Cancel Web Touches Properly so that long presses on YouTube links do not incorrectly trigger a load
1301         https://bugs.webkit.org/show_bug.cgi?id=193687
1302         <rdar://problem/47056717>
1303
1304         Reviewed by Tim Horton.
1305
1306         Cancel web gestures when a long press is recognized.
1307
1308         * Platform/spi/ios/UIKitSPI.h:
1309         * UIProcess/ios/WKContentViewInteraction.mm:
1310         (-[WKContentView _cancelWebGestureRecognizer]):
1311         (-[WKContentView _longPressRecognized:]):
1312
1313 2019-01-22  Alex Christensen  <achristensen@webkit.org>
1314
1315         Fix an internal build failure after r240292
1316         https://bugs.webkit.org/show_bug.cgi?id=193580
1317
1318         Rubber-stamped by Wenson Hsieh.
1319
1320         * SourcesCocoa.txt:
1321         * UIProcess/mac/WebContextMenuProxyMac.mm:
1322         (-[WKMenuTarget forwardContextMenuAction:]):
1323         * WebKit.xcodeproj/project.pbxproj:
1324         It was apparently unclear to the compiler sometimes which "state" selector to use, and this apparently mattered.
1325         Tell the compiler to use the NSMenuItem selector, but at runtime it doesn't matter.
1326
1327 2019-01-22  Michael Catanzaro  <mcatanzaro@igalia.com>
1328
1329         Unreviewed, fix -Wunused-but-set-variable warning
1330         https://bugs.webkit.org/show_bug.cgi?id=193660
1331         <rdar://problem/47433602>
1332
1333         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1334         (WebKit::WebsiteDataStore::removeData):
1335
1336 2019-01-22  Michael Catanzaro  <mcatanzaro@igalia.com>
1337
1338         Unreviewed, further build fixes after r240292
1339         https://bugs.webkit.org/show_bug.cgi?id=193580
1340         <rdar://problem/47457742>
1341
1342         Oops.
1343
1344         * NetworkProcess/NetworkProcess.cpp:
1345         (WebKit::NetworkProcess::defaultStorageSession const):
1346
1347 2019-01-22  Michael Catanzaro  <mcatanzaro@igalia.com>
1348
1349         Unreviewed, further build fixes after r240292
1350         https://bugs.webkit.org/show_bug.cgi?id=193580
1351         <rdar://problem/47457742>
1352
1353         This builds for libsoup. Doesn't work, but at least builds.
1354
1355         Also, speculative fixes for curl.
1356
1357         * NetworkProcess/NetworkProcess.cpp:
1358         (WebKit::NetworkProcess::defaultStorageSession const):
1359
1360 2019-01-22  Michael Catanzaro  <mcatanzaro@igalia.com>
1361
1362         Unreviewed, further build fixes after r240292
1363         https://bugs.webkit.org/show_bug.cgi?id=193580
1364         <rdar://problem/47457742>
1365
1366         Still not working yet.
1367
1368         * NetworkProcess/NetworkProcess.cpp:
1369         (WebKit::NetworkProcess::NetworkProcess):
1370         * UIProcess/API/APIHTTPCookieStore.h:
1371
1372 2019-01-22  Antti Koivisto  <antti@apple.com>
1373
1374         [iOS] Flash when swiping back to Google search result page
1375         https://bugs.webkit.org/show_bug.cgi?id=193668
1376         <rdar://problem/47071684>
1377
1378         Reviewed by Simon Fraser.
1379
1380         If the google page is scrolled, there is sometimes a short flash.
1381
1382         When restoring the page state we also restore exposedContentRect which is used to determine
1383         which part of the page to create layers for. Scroll position is restored by the UI process
1384         later so we rely on this to get the right layers for the initial view update.
1385
1386         A viewport configuration update may sometimes trample over the restored exposedContentRect,
1387         moving it to top left. In this case the initial layer tree unfreeze commit may not have
1388         layers to cover the actual visible view position.
1389
1390         * WebProcess/WebPage/WebPage.cpp:
1391         (WebKit::WebPage::didCommitLoad):
1392         * WebProcess/WebPage/WebPage.h:
1393         * WebProcess/WebPage/ios/WebPageIOS.mm:
1394         (WebKit::WebPage::restorePageState):
1395
1396         Set a bit to indicate we have already restored the exposedContentRect.
1397
1398         (WebKit::WebPage::viewportConfigurationChanged):
1399
1400         Only reset exposedContentRect if wasn't already set by restorePageState.
1401
1402 2019-01-22  Alex Christensen  <achristensen@webkit.org>
1403
1404         Fix more builds.
1405
1406         * SourcesCocoa.txt:
1407         * WebKit.xcodeproj/project.pbxproj:
1408
1409 2019-01-22  Michael Catanzaro  <mcatanzaro@igalia.com>
1410
1411         Another build fix after r240292
1412         https://bugs.webkit.org/show_bug.cgi?id=193580
1413         <rdar://problem/47457742>
1414
1415         Unreviewed, still not enough to fix soup builds, but closer.
1416
1417         * UIProcess/API/APIHTTPCookieStore.h:
1418
1419 2019-01-22  Alex Christensen  <achristensen@webkit.org>
1420
1421         Fix some builds after r240292
1422         https://bugs.webkit.org/show_bug.cgi?id=193580
1423
1424         * NetworkProcess/NetworkProcess.cpp:
1425         (WebKit::NetworkProcess::switchToNewTestingSession):
1426         * NetworkProcess/cache/NetworkCache.cpp:
1427         (WebKit::NetworkCache::Cache::retrieve):
1428
1429 2019-01-22  Brian Burg  <bburg@apple.com>
1430
1431         Automation.computeElementLayout should return visual viewport-aware coordinates
1432         https://bugs.webkit.org/show_bug.cgi?id=193598
1433         <rdar://problem/35325644>
1434
1435         Unreviewed, restore a mistakenly-deleted line whose absence causes hangs.
1436
1437         * Shared/CoordinateSystem.h:
1438
1439 2019-01-22  Alex Christensen  <achristensen@webkit.org>
1440
1441         Move NetworkStorageSession ownership to NetworkProcess
1442         https://bugs.webkit.org/show_bug.cgi?id=193580
1443
1444         Reviewed by Geoff Garen.
1445
1446         * NetworkProcess/Cookies/WebCookieManager.cpp:
1447         (WebKit::WebCookieManager::WebCookieManager):
1448         (WebKit::WebCookieManager::getHostnamesWithCookies):
1449         (WebKit::WebCookieManager::deleteCookiesForHostname):
1450         (WebKit::WebCookieManager::deleteAllCookies):
1451         (WebKit::WebCookieManager::deleteCookie):
1452         (WebKit::WebCookieManager::deleteAllCookiesModifiedSince):
1453         (WebKit::WebCookieManager::getAllCookies):
1454         (WebKit::WebCookieManager::getCookies):
1455         (WebKit::WebCookieManager::setCookie):
1456         (WebKit::WebCookieManager::setCookies):
1457         (WebKit::WebCookieManager::startObservingCookieChanges):
1458         (WebKit::WebCookieManager::stopObservingCookieChanges):
1459         * NetworkProcess/Cookies/WebCookieManager.h:
1460         * NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
1461         (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
1462         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1463         (WebKit::storageSession):
1464         (WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
1465         (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
1466         (WebKit::NetworkConnectionToWebProcess::cookiesEnabled):
1467         (WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue):
1468         (WebKit::NetworkConnectionToWebProcess::getRawCookies):
1469         (WebKit::NetworkConnectionToWebProcess::deleteCookie):
1470         (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForFrame):
1471         (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForAllFramesOnPage):
1472         * NetworkProcess/NetworkProcess.cpp:
1473         (WebKit::NetworkProcess::initializeNetworkProcess):
1474         (WebKit::NetworkProcess::clearCachedCredentials):
1475         (WebKit::NetworkProcess::switchToNewTestingSession):
1476         (WebKit::NetworkProcess::ensureSession):
1477         (WebKit::NetworkProcess::storageSession const):
1478         (WebKit::NetworkProcess::defaultStorageSession const):
1479         (WebKit::NetworkProcess::forEachNetworkStorageSession):
1480         (WebKit::NetworkProcess::destroySession):
1481         (WebKit::NetworkProcess::updatePrevalentDomainsToBlockCookiesFor):
1482         (WebKit::NetworkProcess::setAgeCapForClientSideCookies):
1483         (WebKit::NetworkProcess::hasStorageAccessForFrame):
1484         (WebKit::NetworkProcess::getAllStorageAccessEntries):
1485         (WebKit::NetworkProcess::grantStorageAccess):
1486         (WebKit::NetworkProcess::removeAllStorageAccess):
1487         (WebKit::NetworkProcess::removePrevalentDomains):
1488         (WebKit::NetworkProcess::setCacheMaxAgeCapForPrevalentResources):
1489         (WebKit::NetworkProcess::resetCacheMaxAgeCapForPrevalentResources):
1490         (WebKit::NetworkProcess::fetchWebsiteData):
1491         (WebKit::NetworkProcess::deleteWebsiteData):
1492         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
1493         * NetworkProcess/NetworkProcess.h:
1494         * NetworkProcess/NetworkResourceLoader.cpp:
1495         (WebKit::NetworkResourceLoader::validateCacheEntryForMaxAgeCapValidation):
1496         (WebKit::NetworkResourceLoader::logCookieInformation const):
1497         * NetworkProcess/NetworkSession.cpp:
1498         (WebKit::NetworkSession::networkStorageSession const):
1499         * NetworkProcess/NetworkStorageSessionProvider.h:
1500         * NetworkProcess/cache/NetworkCache.cpp:
1501         (WebKit::NetworkCache::makeUseDecision):
1502         (WebKit::NetworkCache::Cache::retrieve):
1503         (WebKit::NetworkCache::Cache::makeEntry):
1504         (WebKit::NetworkCache::Cache::makeRedirectEntry):
1505         (WebKit::NetworkCache::Cache::update):
1506         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
1507         (WebKit::NetworkCache::SpeculativeLoad::willSendRedirectedRequest):
1508         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1509         (WebKit::NetworkProcess::platformSyncAllCookies):
1510         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1511         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
1512         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
1513         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
1514         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1515         * NetworkProcess/mac/RemoteNetworkingContext.mm:
1516         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
1517         * SourcesCocoa.txt:
1518         * UIProcess/API/APIHTTPCookieStore.cpp:
1519         (API::HTTPCookieStore::~HTTPCookieStore):
1520         (API::HTTPCookieStore::cookies):
1521         (API::HTTPCookieStore::setCookie):
1522         (API::HTTPCookieStore::deleteCookie):
1523         (API::HTTPCookieStore::registerObserver):
1524         (API::HTTPCookieStore::unregisterObserver):
1525         (API::HTTPCookieStore::registerForNewProcessPoolNotifications):
1526         (API::HTTPCookieStore::flushDefaultUIProcessCookieStore):
1527         (API::HTTPCookieStore::getAllDefaultUIProcessCookieStoreCookies):
1528         (API::HTTPCookieStore::setCookieInDefaultUIProcessCookieStore):
1529         (API::HTTPCookieStore::deleteCookieFromDefaultUIProcessCookieStore):
1530         (API::HTTPCookieStore::startObservingChangesToDefaultUIProcessCookieStore):
1531         (API::HTTPCookieStore::stopObservingChangesToDefaultUIProcessCookieStore):
1532         * UIProcess/API/APIHTTPCookieStore.h:
1533         * UIProcess/API/Cocoa/APIHTTPCookieStoreCocoa.mm: Added.
1534         (API::HTTPCookieStore::flushDefaultUIProcessCookieStore):
1535         (API::HTTPCookieStore::getAllDefaultUIProcessCookieStoreCookies):
1536         (API::HTTPCookieStore::setCookieInDefaultUIProcessCookieStore):
1537         (API::HTTPCookieStore::deleteCookieFromDefaultUIProcessCookieStore):
1538         (API::HTTPCookieStore::startObservingChangesToDefaultUIProcessCookieStore):
1539         (API::HTTPCookieStore::stopObservingChangesToDefaultUIProcessCookieStore):
1540         * UIProcess/WebProcessPool.cpp:
1541         (WebKit::WebProcessPool::clearCachedCredentials):
1542         * WebKit.xcodeproj/project.pbxproj:
1543         * WebProcess/Plugins/PluginView.cpp:
1544         (WebKit::PluginView::getAuthenticationInfo):
1545         * WebProcess/WebProcess.cpp:
1546         (WebKit::WebProcess::deleteWebsiteData):
1547         (WebKit::WebProcess::clearCachedCredentials): Deleted.
1548         * WebProcess/WebProcess.h:
1549         * WebProcess/WebProcess.messages.in:
1550
1551 2019-01-22  Per Arne Vollan  <pvollan@apple.com>
1552
1553         [macOS] Adjust logging policy in WebKit's sandbox
1554         https://bugs.webkit.org/show_bug.cgi?id=193454
1555
1556         Reviewed by Brent Fulgham.
1557
1558         Add a rule to initially deny all calls, since the default is to allow every call.
1559         Later rules allow syscalls that we determined are needed for proper WebKit function.
1560         This reduces the API surface available to attackers.
1561
1562         * WebProcess/com.apple.WebProcess.sb.in:
1563
1564 2019-01-22  Daniel Bates  <dabates@apple.com>
1565
1566         [iOS] WebKit should handle shift state changes when using the software keyboard
1567         https://bugs.webkit.org/show_bug.cgi?id=191475
1568         <rdar://problem/45949246>
1569
1570         Reviewed by Brent Fulgham.
1571
1572         Implement UIKit SPI to be notified of shift state changes to the software keyboard
1573         and dispatch a synthetic keydown or keyup event for either the Shift key or Caps Lock
1574         key.
1575
1576         A side benefit of this change is that we now show and hide the caps lock indicator
1577         in a focused password field when caps lock is enabled or disabled using the software
1578         keyboard, respectively.
1579
1580         * Platform/spi/ios/UIKitSPI.h: Expose more SPI.
1581         * SourcesCocoa.txt:
1582         * UIProcess/ios/WKContentViewInteraction.mm:
1583         (-[WKContentView modifierFlagsDidChangeFrom:to:]): Create a synthetic flags changed
1584         web event based on the state change and dispatch it.
1585         (-[WKContentView _didHandleKeyEvent:eventWasHandled:]): Early return if the event
1586         was a synethic flags change event so that we do not notify UIKit about this event
1587         as it does not know anything about such synthetic events.
1588         * UIProcess/ios/WKSyntheticFlagsChangedWebEvent.h: Added.
1589         * UIProcess/ios/WKSyntheticFlagsChangedWebEvent.mm: Added.
1590         (-[WKSyntheticFlagsChangedWebEvent initWithKeyCode:modifiers:keyDown:]):
1591         (-[WKSyntheticFlagsChangedWebEvent initWithCapsLockState:]):
1592         (-[WKSyntheticFlagsChangedWebEvent initWithShiftState:]):
1593         * WebKit.xcodeproj/project.pbxproj:
1594
1595 2019-01-22  Daniel Bates  <dabates@apple.com>
1596
1597         [iOS] Interpret text key commands on keydown and app key commands on keypress
1598         https://bugs.webkit.org/show_bug.cgi?id=192897
1599         <rdar://problem/46857378>
1600
1601         Reviewed by Brent Fulgham.
1602
1603         Adopt SPI to interpret text key commands and app key commands independently on keydown (isCharEvent
1604         is false) and keypress (isCharEvent is true), respectively.
1605
1606         * Platform/spi/ios/UIKitSPI.h: Add more SPI.
1607         * UIProcess/ios/WKContentViewInteraction.mm:
1608         (-[WKContentView _interpretKeyEvent:isCharEvent:]):
1609
1610 2019-01-22  David Kilzer  <ddkilzer@apple.com>
1611
1612         C strings in ClientCertificateAuthenticationXPCConstants.h are duplicated
1613         <https://webkit.org/b/193607>
1614         <rdar://problem/47334613>
1615
1616         Reviewed by Alex Christensen.
1617
1618         * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
1619         (WebKit::AuthenticationManager::initializeConnection):
1620         * UIProcess/Authentication/cocoa/AuthenticationChallengeProxyCocoa.mm:
1621         (WebKit::AuthenticationChallengeProxy::sendClientCertificateCredentialOverXpc):
1622         - Update name of constants.
1623
1624         * Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.cpp: Copied from Source/WebKit/Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.h.
1625         * Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.h:
1626         - Put constant values in a namespace, and move values to
1627           ClientCertificateAuthenticationXPCConstants.cpp.
1628
1629         * SourcesCocoa.txt:
1630         * UnifiedSources-input.xcfilelist:
1631         * WebKit.xcodeproj/project.pbxproj:
1632         - Add ClientCertificateAuthenticationXPCConstants.cpp.
1633
1634 2019-01-22  David Kilzer  <ddkilzer@apple.com>
1635
1636         Switch remaining QuickLook soft-linking in WebCore, WebKit over to QuickLookSoftLink.{cpp,h}
1637         <https://webkit.org/b/193654>
1638         <rdar://problem/47430290>
1639
1640         Reviewed by Alex Christensen.
1641
1642         - Moves QuickLookSoftLink.{h,mm} to PAL.
1643         - Adds soft-link to 3 classes to consolidate QuickLook.framework
1644           soft-linking.
1645         - Updates existing source to work with above changes.
1646
1647         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
1648         (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
1649         (WebKit::SystemPreviewController::start):
1650         * UIProcess/ios/WKSystemPreviewView.mm:
1651         (-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]):
1652         - Switch to using QuickLookSoftLink.{h,mm} in PAL.
1653
1654 2019-01-22  Oriol Brufau  <obrufau@igalia.com>
1655
1656         [css-logical] Implement flow-relative margin, padding and border shorthands
1657         https://bugs.webkit.org/show_bug.cgi?id=188697
1658
1659         Reviewed by Simon Fraser and Antti Koivisto.
1660
1661         Add a CSSLogicalEnabled runtime flag.
1662
1663         * Shared/WebPreferences.yaml:
1664
1665 2019-01-22  Frederic Wang  <fwang@igalia.com>
1666
1667         Enable CSSOMViewScrollingAPI
1668         https://bugs.webkit.org/show_bug.cgi?id=189472
1669
1670         Reviewed by Simon Fraser.
1671
1672         This patch enables the CSSOMViewScrollingAPI option by default. This feature has already been
1673         enabled in tests since r235855. Basically, this change fixes an old compatibility issue
1674         regarding which scrolling element correspond to the viewport in standard mode (WebKit uses
1675         document.body while Gecko/Edge/Chromium use document.documentElement as described in the
1676         CSSOM View specification). WebKit developers writing tests can use document.scrollingElement
1677         for that purpose, so that they work independently of whether the option is enabled.
1678
1679         [1] https://lists.webkit.org/pipermail/webkit-dev/2018-January/029857.html
1680
1681         * Shared/WebPreferences.yaml: Enable by default and remove "experimental" category in
1682         accordance with the new policy. Instead, keep an internal flag only for developers.
1683
1684 2019-01-21  Antti Koivisto  <antti@apple.com>
1685
1686         [iOS] Handle hit testing for subframes
1687         https://bugs.webkit.org/show_bug.cgi?id=192303
1688
1689         Reviewed by Frédéric Wang.
1690
1691         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1692         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
1693
1694         Only set delegatesScrolling for the main frame.
1695
1696 2019-01-21  Brent Fulgham  <bfulgham@apple.com>
1697
1698         Unreviewed test fix after r240243
1699         Nhttps://bugs.webkit.org/show_bug.cgi?id=193660
1700         <rdar://problem/47433602>
1701
1702         The new ResourceLoadStatistics section of 'removeData' was incrementing the
1703         pending callback count before deciding whether to send a message to delete
1704         data. This left the count out-of-balance leading to the operation never
1705         completing.
1706
1707         This patch also prevents sending a second message to the NetworkProcess
1708         requesting data be deleted if the message was already sent in an earlier
1709         section of the method (e.g., as typically happens when all website data
1710         is being deleted).
1711
1712         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1713         (WebKit::WebsiteDataStore::removeData):
1714
1715 2019-01-21  Brent Fulgham  <bfulgham@apple.com>
1716
1717         Implement message handlers for NetworkProcess-based ResourceLoadStatistics
1718         https://bugs.webkit.org/show_bug.cgi?id=193556
1719         <rdar://problem/47368501>
1720
1721         Reviewed by Alex Christensen.
1722
1723         This patch adds a number of sibling methods for tracking ResourceLoadStatistics when the
1724         observations are being handled in the NetworkProcess, rather than the UIProcess. The
1725         original versions of these methods will be removed as part of Bug 193303.
1726
1727         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
1728         (WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords):
1729         (WebKit::ResourceLoadStatisticsMemoryStore::processStatisticsAndDataRecords):
1730         (WebKit::ResourceLoadStatisticsMemoryStore::grandfatherExistingWebsiteData):
1731         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
1732         (WebKit::ResourceLoadStatisticsMemoryStore::store const):
1733         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
1734         (WebKit::WebResourceLoadStatisticsStore::setNotifyPagesWhenDataRecordsWereScanned):
1735         (WebKit::WebResourceLoadStatisticsStore::setNotifyPagesWhenTelemetryWasCaptured):
1736         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
1737         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResourceForDebugMode):
1738         (WebKit::WebResourceLoadStatisticsStore::scheduleStatisticsAndDataRecordsProcessing):
1739         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
1740         (WebKit::WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler):
1741         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
1742         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
1743         (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
1744         (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
1745         (WebKit::WebResourceLoadStatisticsStore::setLastSeen):
1746         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
1747         (WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource):
1748         (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource):
1749         (WebKit::WebResourceLoadStatisticsStore::isVeryPrevalentResource):
1750         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubresourceUnder):
1751         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder):
1752         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo):
1753         (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
1754         (WebKit::WebResourceLoadStatisticsStore::setGrandfathered):
1755         (WebKit::WebResourceLoadStatisticsStore::isGrandfathered):
1756         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
1757         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
1758         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
1759         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom):
1760         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo):
1761         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom):
1762         (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
1763         (WebKit::WebResourceLoadStatisticsStore::logTestingEvent):
1764         (WebKit::WebResourceLoadStatisticsStore::notifyResourceLoadStatisticsProcessed):
1765         (WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
1766         (WebKit::WebResourceLoadStatisticsStore::topPrivatelyControlledDomainsWithWebsiteData):
1767         (WebKit::WebResourceLoadStatisticsStore::sendDiagnosticMessageWithValue const):
1768         (WebKit::WebResourceLoadStatisticsStore::notifyPageStatisticsTelemetryFinished const):
1769         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
1770         * NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp:
1771         (WebKit::submitTopList):
1772         (WebKit::submitTopLists):
1773         (WebKit::notifyPages):
1774         (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
1775         (WebKit::nonEphemeralWebPageProxy): Deleted.
1776         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1777         (WebKit::NetworkConnectionToWebProcess::logUserInteraction):
1778         * NetworkProcess/NetworkConnectionToWebProcess.h:
1779         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1780         * NetworkProcess/NetworkProcess.cpp:
1781         (WebKit::NetworkProcess::dumpResourceLoadStatistics):
1782         (WebKit::NetworkProcess::isGrandfathered):
1783         (WebKit::NetworkProcess::isPrevalentResource):
1784         (WebKit::NetworkProcess::isVeryPrevalentResource):
1785         (WebKit::NetworkProcess::setGrandfathered):
1786         (WebKit::NetworkProcess::setPrevalentResource):
1787         (WebKit::NetworkProcess::setPrevalentResourceForDebugMode):
1788         (WebKit::NetworkProcess::setVeryPrevalentResource):
1789         (WebKit::NetworkProcess::clearPrevalentResource):
1790         (WebKit::NetworkProcess::submitTelemetry):
1791         (WebKit::NetworkProcess::scheduleCookieBlockingUpdate):
1792         (WebKit::NetworkProcess::scheduleClearInMemoryAndPersistent):
1793         (WebKit::NetworkProcess::resetParametersToDefaultValues):
1794         (WebKit::NetworkProcess::scheduleStatisticsAndDataRecordsProcessing):
1795         (WebKit::NetworkProcess::setNotifyPagesWhenDataRecordsWereScanned):
1796         (WebKit::NetworkProcess::setNotifyPagesWhenTelemetryWasCaptured):
1797         (WebKit::NetworkProcess::setSubframeUnderTopFrameOrigin):
1798         (WebKit::NetworkProcess::isRegisteredAsRedirectingTo):
1799         (WebKit::NetworkProcess::isRegisteredAsSubFrameUnder):
1800         (WebKit::NetworkProcess::setSubresourceUnderTopFrameOrigin):
1801         (WebKit::NetworkProcess::setSubresourceUniqueRedirectTo):
1802         (WebKit::NetworkProcess::setSubresourceUniqueRedirectFrom):
1803         (WebKit::NetworkProcess::isRegisteredAsSubresourceUnder):
1804         (WebKit::NetworkProcess::setTopFrameUniqueRedirectTo):
1805         (WebKit::NetworkProcess::setTopFrameUniqueRedirectFrom):
1806         (WebKit::NetworkProcess::setLastSeen):
1807         (WebKit::NetworkProcess::hasStorageAccess):
1808         (WebKit::NetworkProcess::requestStorageAccess):
1809         (WebKit::NetworkProcess::grantStorageAccess):
1810         (WebKit::NetworkProcess::logUserInteraction):
1811         (WebKit::NetworkProcess::hadUserInteraction):
1812         (WebKit::NetworkProcess::clearUserInteraction):
1813         (WebKit::NetworkProcess::setGrandfatheringTime):
1814         (WebKit::NetworkProcess::setMaxStatisticsEntries):
1815         (WebKit::NetworkProcess::setMinimumTimeBetweenDataRecordsRemoval):
1816         (WebKit::NetworkProcess::setPruneEntriesDownTo):
1817         (WebKit::NetworkProcess::setTimeToLiveUserInteraction):
1818         (WebKit::NetworkProcess::setShouldClassifyResourcesBeforeDataRecordsRemoval):
1819         (WebKit::NetworkProcess::setResourceLoadStatisticsEnabled):
1820         (WebKit::NetworkProcess::setResourceLoadStatisticsDebugMode):
1821         (WebKit::NetworkProcess::resetCacheMaxAgeCapForPrevalentResources):
1822         (WebKit::NetworkProcess::deleteWebsiteData):
1823         (WebKit::filterForTopLevelDomains):
1824         (WebKit::NetworkProcess::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
1825         (WebKit::NetworkProcess::topPrivatelyControlledDomainsWithWebsiteData):
1826         * NetworkProcess/NetworkProcess.h:
1827         * NetworkProcess/NetworkProcess.messages.in:
1828         * NetworkProcess/NetworkSession.cpp:
1829         (WebKit::NetworkSession::setResourceLoadStatisticsEnabled):
1830         (WebKit::NetworkSession::notifyResourceLoadStatisticsProcessed):
1831         (WebKit::NetworkSession::logDiagnosticMessageWithValue):
1832         (WebKit::NetworkSession::notifyPageStatisticsTelemetryFinished):
1833         (WebKit::NetworkSession::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
1834         (WebKit::NetworkSession::topPrivatelyControlledDomainsWithWebsiteData):
1835         (WebKit::NetworkSession::enableResourceLoadStatistics): Deleted.
1836         * NetworkProcess/NetworkSession.h:
1837         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1838         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1839         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1840         (WKWebsiteDataStoreSetResourceLoadStatisticsDebugModeWithCompletionHandler):
1841         (WKWebsiteDataStoreSetResourceLoadStatisticsPrevalentResourceForDebugMode):
1842         (WKWebsiteDataStoreSetStatisticsLastSeen):
1843         (WKWebsiteDataStoreSetStatisticsPrevalentResource):
1844         (WKWebsiteDataStoreSetStatisticsVeryPrevalentResource):
1845         (WKWebsiteDataStoreDumpResourceLoadStatistics):
1846         (WKWebsiteDataStoreIsStatisticsPrevalentResource):
1847         (WKWebsiteDataStoreIsStatisticsVeryPrevalentResource):
1848         (WKWebsiteDataStoreIsStatisticsRegisteredAsSubresourceUnder):
1849         (WKWebsiteDataStoreIsStatisticsRegisteredAsSubFrameUnder):
1850         (WKWebsiteDataStoreIsStatisticsRegisteredAsRedirectingTo):
1851         (WKWebsiteDataStoreSetStatisticsHasHadUserInteraction):
1852         (WKWebsiteDataStoreIsStatisticsHasHadUserInteraction):
1853         (WKWebsiteDataStoreSetStatisticsGrandfathered):
1854         (WKWebsiteDataStoreIsStatisticsGrandfathered):
1855         (WKWebsiteDataStoreSetStatisticsSubframeUnderTopFrameOrigin):
1856         (WKWebsiteDataStoreSetStatisticsSubresourceUnderTopFrameOrigin):
1857         (WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectTo):
1858         (WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectFrom):
1859         (WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectTo):
1860         (WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectFrom):
1861         (WKWebsiteDataStoreSetStatisticsTimeToLiveUserInteraction):
1862         (WKWebsiteDataStoreStatisticsProcessStatisticsAndDataRecords):
1863         (WKWebsiteDataStoreStatisticsUpdateCookieBlocking):
1864         (WKWebsiteDataStoreStatisticsSubmitTelemetry):
1865         (WKWebsiteDataStoreSetStatisticsNotifyPagesWhenDataRecordsWereScanned):
1866         (WKWebsiteDataStoreSetStatisticsShouldClassifyResourcesBeforeDataRecordsRemoval):
1867         (WKWebsiteDataStoreSetStatisticsNotifyPagesWhenTelemetryWasCaptured):
1868         (WKWebsiteDataStoreSetStatisticsMinimumTimeBetweenDataRecordsRemoval):
1869         (WKWebsiteDataStoreSetStatisticsGrandfatheringTime):
1870         (WKWebsiteDataStoreSetStatisticsMaxStatisticsEntries):
1871         (WKWebsiteDataStoreSetStatisticsPruneEntriesDownTo):
1872         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
1873         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
1874         (WKWebsiteDataStoreStatisticsResetToConsistentState):
1875         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1876         (-[WKWebsiteDataStore _setResourceLoadStatisticsTestingCallback:]):
1877         * UIProcess/Network/NetworkProcessProxy.cpp:
1878         (WebKit::NetworkProcessProxy::clearCallbackStates):
1879         (WebKit::NetworkProcessProxy::didClose):
1880         (WebKit::nonEphemeralWebPageProxy):
1881         (WebKit::NetworkProcessProxy::logGlobalDiagnosticMessageWithValue):
1882         (WebKit::NetworkProcessProxy::dumpResourceLoadStatistics):
1883         (WebKit::NetworkProcessProxy::didDumpResourceLoadStatistics):
1884         (WebKit::NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor):
1885         (WebKit::NetworkProcessProxy::didUpdateBlockCookies):
1886         (WebKit::NetworkProcessProxy::isPrevalentResource):
1887         (WebKit::NetworkProcessProxy::isPrevalentResourceResult):
1888         (WebKit::NetworkProcessProxy::isVeryPrevalentResource):
1889         (WebKit::NetworkProcessProxy::setPrevalentResource):
1890         (WebKit::NetworkProcessProxy::setPrevalentResourceForDebugMode):
1891         (WebKit::NetworkProcessProxy::setVeryPrevalentResource):
1892         (WebKit::NetworkProcessProxy::didSetResourceLoadStatisticData):
1893         (WebKit::NetworkProcessProxy::setLastSeen):
1894         (WebKit::NetworkProcessProxy::clearPrevalentResource):
1895         (WebKit::NetworkProcessProxy::scheduleCookieBlockingUpdate):
1896         (WebKit::NetworkProcessProxy::didScheduleCookieBlockingUpdate):
1897         (WebKit::NetworkProcessProxy::scheduleClearInMemoryAndPersistent):
1898         (WebKit::NetworkProcessProxy::didScheduleStatisticsProcessing):
1899         (WebKit::NetworkProcessProxy::scheduleStatisticsAndDataRecordsProcessing):
1900         (WebKit::NetworkProcessProxy::logUserInteraction):
1901         (WebKit::NetworkProcessProxy::hasHadUserInteraction):
1902         (WebKit::NetworkProcessProxy::didHaveUserInteraction):
1903         (WebKit::NetworkProcessProxy::clearUserInteraction):
1904         (WebKit::NetworkProcessProxy::setAgeCapForClientSideCookies):
1905         (WebKit::NetworkProcessProxy::didSetAgeCapForClientSideCookies):
1906         (WebKit::NetworkProcessProxy::setTimeToLiveUserInteraction):
1907         (WebKit::NetworkProcessProxy::didUpdateRuntimeSettings):
1908         (WebKit::NetworkProcessProxy::setNotifyPagesWhenTelemetryWasCaptured):
1909         (WebKit::NetworkProcessProxy::setNotifyPagesWhenDataRecordsWereScanned):
1910         (WebKit::NetworkProcessProxy::setSubframeUnderTopFrameOrigin):
1911         (WebKit::NetworkProcessProxy::isRegisteredAsRedirectingTo):
1912         (WebKit::NetworkProcessProxy::didIsRegisteredAsRedirectingTo):
1913         (WebKit::NetworkProcessProxy::isRegisteredAsSubFrameUnder):
1914         (WebKit::NetworkProcessProxy::didIsRegisteredAsSubFrameUnder):
1915         (WebKit::NetworkProcessProxy::setSubresourceUnderTopFrameOrigin):
1916         (WebKit::NetworkProcessProxy::isRegisteredAsSubresourceUnder):
1917         (WebKit::NetworkProcessProxy::didIsRegisteredAsSubresourceUnder):
1918         (WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectTo):
1919         (WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectFrom):
1920         (WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectTo):
1921         (WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectFrom):
1922         (WebKit::NetworkProcessProxy::isGrandfathered):
1923         (WebKit::NetworkProcessProxy::didIsGrandfathered):
1924         (WebKit::NetworkProcessProxy::setGrandfathered):
1925         (WebKit::NetworkProcessProxy::hasStorageAccess):
1926         (WebKit::NetworkProcessProxy::requestStorageAccess):
1927         (WebKit::NetworkProcessProxy::grantStorageAccess):
1928         (WebKit::NetworkProcessProxy::storageAccessRequestResult):
1929         (WebKit::NetworkProcessProxy::storageAccessOperationResult):
1930         (WebKit::NetworkProcessProxy::didRemoveAllStorageAccess):
1931         (WebKit::NetworkProcessProxy::didSetCacheMaxAgeCapForPrevalentResources):
1932         (WebKit::NetworkProcessProxy::setCacheMaxAgeCap):
1933         (WebKit::NetworkProcessProxy::setGrandfatheringTime):
1934         (WebKit::NetworkProcessProxy::setMaxStatisticsEntries):
1935         (WebKit::NetworkProcessProxy::setMinimumTimeBetweenDataRecordsRemoval):
1936         (WebKit::NetworkProcessProxy::setPruneEntriesDownTo):
1937         (WebKit::NetworkProcessProxy::setShouldClassifyResourcesBeforeDataRecordsRemoval):
1938         (WebKit::NetworkProcessProxy::setResourceLoadStatisticsDebugMode):
1939         (WebKit::NetworkProcessProxy::resetParametersToDefaultValues):
1940         (WebKit::NetworkProcessProxy::submitTelemetry):
1941         (WebKit::NetworkProcessProxy::notifyResourceLoadStatisticsProcessed):
1942         (WebKit::NetworkProcessProxy::notifyWebsiteDataDeletionForTopPrivatelyOwnedDomainsFinished):
1943         (WebKit::NetworkProcessProxy::notifyWebsiteDataScanForTopPrivatelyControlledDomainsFinished):
1944         (WebKit::NetworkProcessProxy::notifyResourceLoadStatisticsTelemetryFinished):
1945         (WebKit::NetworkProcessProxy::didLogUserInteraction): Deleted.
1946         (WebKit::NetworkProcessProxy::didResetCacheMaxAgeCapForPrevalentResources): Deleted.
1947         * UIProcess/Network/NetworkProcessProxy.h:
1948         * UIProcess/Network/NetworkProcessProxy.messages.in:
1949         * UIProcess/WebPageProxy.cpp:
1950         (WebKit::WebPageProxy::nonEphemeralWebPageProxy):
1951         * UIProcess/WebPageProxy.h:
1952         * UIProcess/WebProcessPool.cpp:
1953         (WebKit::WebProcessPool::ensureNetworkProcess):
1954         * UIProcess/WebProcessProxy.cpp:
1955         (WebKit::WebProcessProxy::notifyWebsiteDataScanForTopPrivatelyControlledDomainsFinished):
1956         (WebKit::WebProcessProxy::notifyWebsiteDataDeletionForTopPrivatelyOwnedDomainsFinished):
1957         * UIProcess/WebProcessProxy.h:
1958         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
1959         (WebKit::WebsiteDataStore::parameters):
1960         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1961         (WebKit::WebsiteDataStore::removeData):
1962         (WebKit::WebsiteDataStore::setMaxStatisticsEntries):
1963         (WebKit::WebsiteDataStore::setPruneEntriesDownTo):
1964         (WebKit::WebsiteDataStore::setGrandfatheringTime):
1965         (WebKit::WebsiteDataStore::setCacheMaxAgeCap):
1966         (WebKit::WebsiteDataStore::setMinimumTimeBetweenDataRecordsRemoval):
1967         (WebKit::WebsiteDataStore::dumpResourceLoadStatistics):
1968         (WebKit::WebsiteDataStore::isPrevalentResource):
1969         (WebKit::WebsiteDataStore::setPrevalentResource):
1970         (WebKit::WebsiteDataStore::setPrevalentResourceForDebugMode):
1971         (WebKit::WebsiteDataStore::isVeryPrevalentResource):
1972         (WebKit::WebsiteDataStore::setVeryPrevalentResource):
1973         (WebKit::WebsiteDataStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
1974         (WebKit::WebsiteDataStore::setSubframeUnderTopFrameOrigin):
1975         (WebKit::WebsiteDataStore::isRegisteredAsSubFrameUnder):
1976         (WebKit::WebsiteDataStore::setSubresourceUnderTopFrameOrigin):
1977         (WebKit::WebsiteDataStore::isRegisteredAsSubresourceUnder):
1978         (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectTo):
1979         (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectFrom):
1980         (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectTo):
1981         (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectFrom):
1982         (WebKit::WebsiteDataStore::isRegisteredAsRedirectingTo):
1983         (WebKit::WebsiteDataStore::clearPrevalentResource):
1984         (WebKit::WebsiteDataStore::resetParametersToDefaultValues):
1985         (WebKit::WebsiteDataStore::submitTelemetry):
1986         (WebKit::WebsiteDataStore::scheduleClearInMemoryAndPersistent):
1987         (WebKit::WebsiteDataStore::scheduleCookieBlockingUpdate):
1988         (WebKit::WebsiteDataStore::scheduleStatisticsAndDataRecordsProcessing):
1989         (WebKit::WebsiteDataStore::updatePrevalentDomainsToBlockCookiesFor):
1990         (WebKit::WebsiteDataStore::setAgeCapForClientSideCookies):
1991         (WebKit::WebsiteDataStore::setLastSeen):
1992         (WebKit::WebsiteDataStore::setNotifyPagesWhenDataRecordsWereScanned):
1993         (WebKit::WebsiteDataStore::setNotifyPagesWhenTelemetryWasCaptured):
1994         (WebKit::WebsiteDataStore::hasStorageAccessForFrameHandler):
1995         (WebKit::WebsiteDataStore::getAllStorageAccessEntries):
1996         (WebKit::WebsiteDataStore::grantStorageAccessHandler):
1997         (WebKit::WebsiteDataStore::removeAllStorageAccessHandler):
1998         (WebKit::WebsiteDataStore::removePrevalentDomains):
1999         (WebKit::WebsiteDataStore::hasStorageAccess):
2000         (WebKit::WebsiteDataStore::requestStorageAccess):
2001         (WebKit::WebsiteDataStore::grantStorageAccess):
2002         (WebKit::WebsiteDataStore::setTimeToLiveUserInteraction):
2003         (WebKit::WebsiteDataStore::logUserInteraction):
2004         (WebKit::WebsiteDataStore::hasHadUserInteraction):
2005         (WebKit::WebsiteDataStore::clearUserInteraction):
2006         (WebKit::WebsiteDataStore::isGrandfathered):
2007         (WebKit::WebsiteDataStore::setGrandfathered):
2008         (WebKit::WebsiteDataStore::setCacheMaxAgeCapForPrevalentResources):
2009         (WebKit::WebsiteDataStore::resetCacheMaxAgeCapForPrevalentResources):
2010         (WebKit::WebsiteDataStore::webPageWasAdded):
2011         (WebKit::WebsiteDataStore::webPageWasInvalidated):
2012         (WebKit::WebsiteDataStore::webProcessWillOpenConnection):
2013         (WebKit::WebsiteDataStore::webPageWillOpenConnection):
2014         (WebKit::WebsiteDataStore::webPageDidCloseConnection):
2015         (WebKit::WebsiteDataStore::webProcessDidCloseConnection):
2016         (WebKit::WebsiteDataStore::isAssociatedProcessPool const):
2017         (WebKit::WebsiteDataStore::processPools const):
2018         (WebKit::WebsiteDataStore::resourceLoadStatisticsEnabled const):
2019         (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
2020         (WebKit::WebsiteDataStore::setResourceLoadStatisticsDebugMode):
2021         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
2022         (WebKit::WebsiteDataStore::logTestingEvent):
2023         * UIProcess/WebsiteData/WebsiteDataStore.h:
2024         (WebKit::WebsiteDataStore::setStatisticsTestingCallback):
2025         * WebProcess/WebProcess.cpp:
2026         (WebKit::WebProcess::initializeWebProcess):
2027
2028 2019-01-15  Darin Adler  <darin@apple.com>
2029
2030         Use references rather than pointers for register/unregister functions, and more
2031         https://bugs.webkit.org/show_bug.cgi?id=175028
2032
2033         Reviewed by Daniel Bates.
2034
2035         * WebProcess/FullScreen/WebFullScreenManager.cpp:
2036         (WebKit::WebFullScreenManager::willEnterFullScreen): Update for change to the
2037         functions in Document; pass a reference.
2038         (WebKit::WebFullScreenManager::didEnterFullScreen): Ditto, don't pass the element.
2039         (WebKit::WebFullScreenManager::willExitFullScreen): Ditto.
2040         (WebKit::WebFullScreenManager::didExitFullScreen): Ditto.
2041
2042         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
2043         (WebKit::UserMediaPermissionRequestManager::startUserMediaRequest): Pass a reference.
2044         (WebKit::UserMediaPermissionRequestManager::mediaCanStart): Ditto.
2045         (WebKit::UserMediaPermissionRequestManager::removeMediaRequestFromMaps): Ditto.
2046         * WebProcess/Plugins/PluginView.cpp:
2047         (WebKit::PluginView::~PluginView): Ditto.
2048         (WebKit::PluginView::initializePlugin): Ditto.
2049
2050 2019-01-20  Michael Catanzaro  <mcatanzaro@igalia.com>
2051
2052         Unreviewed, fix -Wreturn-type warning
2053         https://bugs.webkit.org/show_bug.cgi?id=193333
2054         <rdar://problem/45649489>
2055
2056         * UIProcess/Automation/WebAutomationSession.cpp:
2057         (WebKit::toProtocol):
2058
2059 2019-01-20  chris fleizach  <cfleizach@apple.com>
2060
2061         AX: Support returning relative frames for accessibility
2062         https://bugs.webkit.org/show_bug.cgi?id=193414
2063         <rdar://problem/47268501>
2064
2065         Reviewed by Zalan Bujtas.
2066
2067         * UIProcess/API/Cocoa/WKWebView.mm:
2068         (-[WKWebView accessibilityAttributeValue:forParameter:]):
2069         (-[WKWebView IGNORE_WARNINGS_END]):
2070         * UIProcess/API/mac/WKView.mm:
2071         (-[WKView accessibilityAttributeValue:forParameter:]):
2072         (-[WKView IGNORE_WARNINGS_END]):
2073         * UIProcess/Cocoa/WebViewImpl.h:
2074         * UIProcess/Cocoa/WebViewImpl.mm:
2075         (WebKit::WebViewImpl::accessibilityAttributeValue):
2076         * UIProcess/ios/WKContentView.mm:
2077         (-[WKContentView accessibilityConvertRelativeFrameFromPage:]):
2078
2079 2019-01-20  Michael Catanzaro  <mcatanzaro@igalia.com>
2080
2081         Unreviewed, rolling out r240209.
2082
2083         Broke GTK/WPE injected bundle
2084
2085         Reverted changeset:
2086
2087         "AX: Support returning relative frames for accessibility"
2088         https://bugs.webkit.org/show_bug.cgi?id=193414
2089         https://trac.webkit.org/changeset/240209
2090
2091 2019-01-12  Dan Bernstein  <mitz@apple.com>
2092
2093         [Cocoa] Avoid importing directly from subumbrella frameworks
2094         https://bugs.webkit.org/show_bug.cgi?id=186016
2095         <rdar://problem/40591038>
2096
2097         Reviewed by Sam Weinig.
2098
2099         * Configurations/BaseTarget.xcconfig: Removed -iframework options from OTHER_CFLAGS and
2100           OTHER_CPLUSPLUSFLAGS.
2101         * UIProcess/Automation/mac/WebAutomationSessionMac.mm: Import Carbon.h instead of an
2102           HIToolbox header.
2103         * UIProcess/Cocoa/WebViewImpl.mm: Ditto.
2104         * UIProcess/mac/WKPrintingView.mm: Import Quartz.h instead of a PDFKit header.
2105         * UIProcess/mac/WKTextInputWindowController.mm: Import Carbon.h instead of an HIToolbox
2106           header.
2107         * WebProcess/Plugins/PDF/PDFAnnotationTextWidgetDetails.h: Import Quartz.h instead of a
2108           PDFKit header.
2109         * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h: Ditto.
2110         * WebProcess/Plugins/PDF/PDFPlugin.mm: Ditto.
2111         * WebProcess/Plugins/PDF/PDFPluginAnnotation.mm: Ditto.
2112         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm: Ditto.
2113         * WebProcess/Plugins/PDF/PDFPluginPasswordField.mm: Ditto.
2114         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm: Ditto.
2115         * WebProcess/WebPage/mac/WebPageMac.mm: Ditto.
2116
2117 2019-01-20  chris fleizach  <cfleizach@apple.com>
2118
2119         AX: Support returning relative frames for accessibility
2120         https://bugs.webkit.org/show_bug.cgi?id=193414
2121         <rdar://problem/47268501>
2122
2123         Reviewed by Zalan Bujtas.
2124
2125         * UIProcess/API/Cocoa/WKWebView.mm:
2126         (-[WKWebView accessibilityAttributeValue:forParameter:]):
2127         (-[WKWebView IGNORE_WARNINGS_END]):
2128         * UIProcess/API/mac/WKView.mm:
2129         (-[WKView accessibilityAttributeValue:forParameter:]):
2130         (-[WKView IGNORE_WARNINGS_END]):
2131         * UIProcess/Cocoa/WebViewImpl.h:
2132         * UIProcess/Cocoa/WebViewImpl.mm:
2133         (WebKit::WebViewImpl::accessibilityAttributeValue):
2134         * UIProcess/ios/WKContentView.mm:
2135         (-[WKContentView accessibilityConvertRelativeFrameFromPage:]):
2136
2137 2019-01-20  Antoine Quint  <graouts@apple.com>
2138
2139         Add a POINTER_EVENTS feature flag
2140         https://bugs.webkit.org/show_bug.cgi?id=193577
2141         <rdar://problem/47408511>
2142
2143         Unreviewed. Also enable Pointer Events for iosmac.
2144
2145         * Configurations/FeatureDefines.xcconfig:
2146
2147 2019-01-19  David Kilzer  <ddkilzer@apple.com>
2148
2149         Follow-up: iOS: Updating input mode should update the software keyboard
2150         <https://bugs.webkit.org/show_bug.cgi?id=193565>
2151         <rdar://problem/47376334>
2152
2153         * WebProcess/WebPage/WebPage.cpp:
2154         (WebKit::WebPage::focusedElementDidChangeInputMode): Fix iOS
2155         Debug builds after r240199 by downcasting `element` to
2156         `HTMLElement` before calling canonicalInputMode().
2157
2158 2019-01-19  David Kilzer  <ddkilzer@apple.com>
2159
2160         Sort WebKit Xcode project file
2161
2162         * WebKit.xcodeproj/project.pbxproj:
2163
2164 2019-01-19  Antoine Quint  <graouts@apple.com>
2165
2166         Add a POINTER_EVENTS feature flag
2167         https://bugs.webkit.org/show_bug.cgi?id=193577
2168
2169         Reviewed by Dean Jackson.
2170
2171         * Configurations/FeatureDefines.xcconfig:
2172
2173 2019-01-18  Ryosuke Niwa  <rniwa@webkit.org>
2174
2175         iOS: Updating input mode should update the software keyboard
2176         https://bugs.webkit.org/show_bug.cgi?id=193565
2177         <rdar://problem/47376334>
2178
2179         Reviewed by Wenson Hsieh.
2180
2181         Update the software keyboard when the inputmode content attribute on the focused element had been mutated.
2182
2183         * Scripts/webkit/messages.py:
2184         * Shared/WebCoreArgumentCoders.h:
2185         * UIProcess/PageClient.h:
2186         * UIProcess/WebPageProxy.h:
2187         * UIProcess/WebPageProxy.messages.in:
2188         * UIProcess/ios/PageClientImplIOS.h:
2189         * UIProcess/ios/PageClientImplIOS.mm:
2190         (WebKit::PageClientImpl::focusedElementDidChangeInputMode):
2191         * UIProcess/ios/WKContentViewInteraction.h:
2192         * UIProcess/ios/WKContentViewInteraction.mm:
2193         (-[WKContentView _didUpdateInputMode:]):
2194         * UIProcess/ios/WebPageProxyIOS.mm:
2195         (WebKit::WebPageProxy::focusedElementDidChangeInputMode):
2196         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2197         (WebKit::WebChromeClient::focusedElementDidChangeInputMode):
2198         * WebProcess/WebCoreSupport/WebChromeClient.h:
2199         * WebProcess/WebPage/WebPage.cpp:
2200         (WebKit::WebPage::focusedElementDidChangeInputMode):
2201         * WebProcess/WebPage/WebPage.h:
2202
2203 2019-01-18  Tim Horton  <timothy_horton@apple.com>
2204
2205         Adjust WKDrawingView protocol method name
2206         https://bugs.webkit.org/show_bug.cgi?id=193604
2207
2208         Reviewed by Wenson Hsieh.
2209
2210         * UIProcess/ios/WKDrawingView.mm:
2211         (-[WKDrawingView canvasViewDrawingDidChange:]):
2212         (-[WKDrawingView drawingDidChange:]): Deleted.
2213
2214 2019-01-18  David Kilzer  <ddkilzer@apple.com>
2215
2216         [WebKit] Change Xcode folders to map to folders on disk
2217
2218         * WebKit.xcodeproj/project.pbxproj: Update these folders:
2219         - Shared/Authentication
2220         - Shared/Authentication/cocoa
2221
2222 2019-01-18  Brian Burg  <bburg@apple.com>
2223
2224         Automation.computeElementLayout should return visual viewport-aware coordinates
2225         https://bugs.webkit.org/show_bug.cgi?id=193598
2226         <rdar://problem/35325644>
2227
2228         Reviewed by Simon Fraser.
2229
2230         Previously I added CoordinateSystem::VisualViewport to stub out this for iOS.
2231         But I think that it's a mistake for safaridriver to care about VisualViewport
2232         being enabled or not, because it is a runtime-switchable setting.
2233
2234         This patch removes CoordinateSystem::VisualViewport. Make the existing
2235         CoordinateSystem::LayoutViewport use visual viewport semantics if needed.
2236
2237         This is tested by WebDriver element clicking tests. There should not be any
2238         difference in behavior until it is possible to zoom with gestures via WebDriver.
2239
2240         * Shared/CoordinateSystem.h:
2241         * UIProcess/Automation/Automation.json:
2242         * UIProcess/Automation/WebAutomationSession.cpp:
2243         (WebKit::protocolStringToCoordinateSystem):
2244         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
2245         (WebKit::WebAutomationSessionProxy::computeElementLayout):
2246
2247 2019-01-18  Daniel Bates  <dabates@apple.com>
2248
2249         Fix some build issues.
2250
2251         Include missing header WKDrawingCoordinator.
2252
2253         * UIProcess/ios/WKInkPickerView.mm:
2254
2255 2019-01-18  Tim Horton  <timothy_horton@apple.com>
2256
2257         Get rid of ADVANCED_SPELL_CHECKING
2258         https://bugs.webkit.org/show_bug.cgi?id=193592
2259
2260         Reviewed by Wenson Hsieh.
2261
2262         * UIProcess/Cocoa/WebViewImpl.mm:
2263         (WebKit::WebViewImpl::requestCandidatesForSelectionIfNeeded):
2264         (WebKit::WebViewImpl::insertText):
2265         * UIProcess/mac/TextCheckerMac.mm:
2266         (WebKit::TextChecker::checkTextOfParagraph):
2267         (WebKit::TextChecker::getGuessesForWord):
2268
2269 2019-01-18  Chris Dumez  <cdumez@apple.com>
2270
2271         Regression(PSON) Content blockers are sometimes lost on back navigation cross-site
2272         https://bugs.webkit.org/show_bug.cgi?id=193588
2273         <rdar://problem/47131566>
2274
2275         Reviewed by Alex Christensen.
2276
2277         When the WebPageProxy needs to create initialization parameters for its WebPage in the
2278         WebContent process, it calls WebProcessProxy::addWebUserContentControllerProxy()
2279         which calls WebUserContentControllerProxy::addProcess(). This last call is supposed to
2280         register the WebProcessProxy with the WebUserContentControllerProxy and adding the
2281         contentRuleLists to the WebPageCreationParameters. The issue is that if the
2282         WebUserContentControllerProxy already knows about this WebProcessProxy, it would return
2283         early and not populate the WebPageCreationParameters.
2284
2285         In PSON world, when navigating back to a page that failed to enter page cache, we reuse
2286         the process where we previously loaded the page but re-create a new WebPage on the
2287         WebContent process site. When this happens, WebUserContentControllerProxy would not
2288         add the contentRuleLists to the WebPageCreationParameters and the new WebPage in the
2289         previously-suspended process would be missing them.
2290
2291         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
2292         (WebKit::WebUserContentControllerProxy::addProcess):
2293
2294 2019-01-18  Jer Noble  <jer.noble@apple.com>
2295
2296         SDK_VARIANT build destinations should be separate from non-SDK_VARIANT builds
2297         https://bugs.webkit.org/show_bug.cgi?id=189553
2298
2299         Reviewed by Tim Horton.
2300
2301         * Configurations/Base.xcconfig:
2302         * Configurations/BaseTarget.xcconfig:
2303         * Configurations/SDKVariant.xcconfig: Added.
2304
2305 2019-01-18  Antti Koivisto  <antti@apple.com>
2306
2307         Implement asynchronous frame scrolling for iOS
2308         https://bugs.webkit.org/show_bug.cgi?id=193539
2309         <rdar://problem/47379873>
2310
2311         Reviewed by Simon Fraser.
2312
2313         Add a scrolling node type that can handle UIScrollView backed frames.
2314         It basically just instantiates and forwards to the existing ScrollingTreeScrollingNodeDelegateIOS.
2315
2316         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
2317         (WebKit::RemoteScrollingTree::createScrollingTreeNode):
2318         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
2319         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
2320         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h: Added.
2321         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm: Added.
2322         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::create):
2323         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::ScrollingTreeFrameScrollingNodeRemoteIOS):
2324         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::~ScrollingTreeFrameScrollingNodeRemoteIOS):
2325         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateBeforeChildren):
2326         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateAfterChildren):
2327         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterAncestorChange):
2328         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::scrollPosition const):
2329         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollLayerPosition):
2330         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterDelegatedScroll):
2331         * WebKit.xcodeproj/project.pbxproj:
2332
2333 2019-01-18  Chris Dumez  <cdumez@apple.com>
2334
2335         Regression(PSON) Scroll position is not always restored properly when navigating back
2336         https://bugs.webkit.org/show_bug.cgi?id=193578
2337         <rdar://problem/47386331>
2338
2339         Reviewed by Tim Horton.
2340
2341         Fix issues causing the scroll position to not be restored at all (or incorrectly) when
2342         navigating back cross-site with PSON enabled. Also make sure that the swipe gesture
2343         snapshot really stays up until we've restored the scroll position.
2344
2345         Note that even after those changes, I can still sometimes reproduce a white flash when
2346         swiping back to Google search results (scroll position being correct now). This is
2347         tracked by <rdar://problem/47071684> and happens even if I disable PSON entirely.
2348
2349         * Shared/SessionState.cpp:
2350         (WebKit::FrameState::encode const):
2351         (WebKit::FrameState::decode):
2352         * Shared/SessionState.h:
2353         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
2354         (WebKit::toFrameState):
2355         (WebKit::applyFrameState):
2356         obscuredInsets is present on the HistoryItem in the WebProcess but was never passed to
2357         or stored by the UIProcess on the WebBackForwardListItem. obscuredInsets is needed to
2358         properly restore the scrollPosition (position was 70px off on my iPad without this).
2359         With PSON enabled, if you swipe back cross-process and the previous page was not put
2360         into PageCache, then the HistoryItem is gone on the WebProcess side. What happens is
2361         that the UIProcess sends its WebBackForwardListItem to the WebProcess, which restores
2362         the HistoryItem there, and then asks it to load it. The obscuredInsets was getting lost
2363         in the process since the UIProcess never knew about it.
2364
2365         * UIProcess/Cocoa/ViewGestureController.cpp:
2366         (WebKit::ViewGestureController::didReachMainFrameLoadTerminalState):
2367         Drop logic that was causing the ViewGestureController to not wait for the scroll position
2368         to be restored before taking down the snapshot, when UI-side compositing is enabled.
2369         If you look at the comment above the code, you'll see that the code in question was meant
2370         to impact only the non-UI side compositing code path. As a matter of fact, when the code
2371         was reviewed at https://bugs.webkit.org/show_bug.cgi?id=151224, it was protected by a
2372         #if PLATFORM(MAC), before getting modified the wrong way before landing. In practice, we
2373         would have often restored the scroll position by the time the load is finished so it would
2374         not cause a flash in most cases. However, with PSON enabled and the layer tree freezing we
2375         do on process-swap, the first post-scroll restoration layer tree commit may now occur a
2376         little bit later and we would lose the race more often.
2377
2378         * UIProcess/WebProcessProxy.cpp:
2379         (WebKit::WebProcessProxy::updateBackForwardItem):
2380         * UIProcess/WebProcessProxy.h:
2381         When adding PageCache support to PSON, we used to navigate the "suspended" page to
2382         about:blank. This would lead to unwanted WebProcessProxy::updateBackForwardItem()
2383         calls from the WebProcess which we wanted to ignore. We thus added logic to ignore
2384         updateBackForwardItem() IPC from the old WebProcess after a swap. The issue with this
2385         is that we sometimes miss/ignore legit updates to the HistoryItem from the old process,
2386         in particular with regards to the scroll position and the pageScaleFactor. So if you
2387         swiped and then quickly enough did a cross-site navigation, the UIProcess'
2388         WebBackForwardList would not get updated with the latest scroll position and we would
2389         thus fail to restore it later on. To address the issue, we now stop ignoring updates
2390         from the old WebProcess after a swap. This logic is no longer needed since we no longer
2391         navigate the old page to about:blank after a swap, we merely suspend it "in place".
2392
2393 2019-01-18  Wenson Hsieh  <wenson_hsieh@apple.com>
2394
2395         Remove some last vestiges of assisted node terminology in WebKit
2396         https://bugs.webkit.org/show_bug.cgi?id=193572
2397
2398         Reviewed by Tim Horton.
2399
2400         * UIProcess/API/Cocoa/_WKFocusedElementInfo.h:
2401         * UIProcess/ios/WKContentViewInteraction.mm:
2402         (-[WKContentView gestureRecognizerShouldBegin:]):
2403         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
2404         (-[WKContentView _showKeyboard]):
2405         (-[WKContentView _hideKeyboard]):
2406
2407         Add a FIXME about invoking `-reloadInputViews` on watchOS when the focused element is blurred.
2408
2409         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
2410         (-[WKContentView _elementDidBlur]):
2411         (-[WKContentView updateCurrentFocusedElementInformation:]):
2412         (-[WKContentView _startAssistingKeyboard]): Deleted.
2413         (-[WKContentView _stopAssistingKeyboard]): Deleted.
2414         * WebProcess/WebPage/ios/WebPageIOS.mm:
2415         (WebKit::WebPage::getFocusedElementInformation):
2416
2417 2019-01-18  Youenn Fablet  <youenn@apple.com>
2418
2419         Add a new SPI to request for cache storage quota increase
2420         https://bugs.webkit.org/show_bug.cgi?id=193323
2421
2422         Reviewed by Alex Christensen.
2423
2424         Add a delegate on the WebSiteDataStore for WebKit to ask for quota update.
2425         The current SPI is currently CacheStorage specific but future work should
2426         make it so that other storage like IDB use the same mechanism.
2427         By default, quota remains unchanged if delegate is not implemented.
2428
2429         * NetworkProcess/NetworkProcess.cpp:
2430         * UIProcess/API/Cocoa/WKStorageQuotaDelegatePrivate.h: Added.
2431         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2432         (WebsiteDataStoreQuotaManager::WebsiteDataStoreQuotaManager):
2433         (-[WKWebsiteDataStore _quotaDelegate]):
2434         (-[WKWebsiteDataStore set_quotaDelegate:]):
2435         * UIProcess/API/Cocoa/WKWebsiteDataStoreInternal.h:
2436         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
2437         * UIProcess/Network/NetworkProcessProxy.cpp:
2438         (WebKit::NetworkProcessProxy::requestCacheStorageSpace):
2439         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2440         (WebKit::WebsiteDataStore::WebsiteDataStore):
2441         * UIProcess/WebsiteData/WebsiteDataStore.h:
2442         (WebKit::WebsiteDataStore::quotaManager):
2443         (WebKit::WebsiteDataStore::setQuotaManager):
2444         * UIProcess/WebsiteData/WebsiteDataStoreQuotaManager.h: Added.
2445         (WebKit::WebsiteDataStoreQuotaManager::~WebsiteDataStoreQuotaManager):
2446         (WebKit::WebsiteDataStoreQuotaManager::requestCacheStorageSpace):
2447         * WebKit.xcodeproj/project.pbxproj:
2448
2449 2019-01-18  Philippe Normand  <pnormand@igalia.com>
2450
2451         [WPE] Add Qt extension
2452         https://bugs.webkit.org/show_bug.cgi?id=191464
2453
2454         Reviewed by Carlos Garcia Campos.
2455
2456         This new extension is a QML plugin embedding a WPE ViewBackend
2457         implementation. It provides a public API very similar to Qt's
2458         WebView module. It comes with a simple mini-browser implemented in
2459         QML.
2460
2461         QtWPE is known to work with the Wayland-EGL (in GNOME and Weston
2462         compositors) and EGLFS QPAs.
2463
2464         * PlatformWPE.cmake:
2465         * UIProcess/API/wpe/qt/WPEQmlExtensionPlugin.cpp: Added.
2466         (WPEQmlExtensionPlugin::registerTypes):
2467         * UIProcess/API/wpe/qt/WPEQmlExtensionPlugin.h: Added.
2468         * UIProcess/API/wpe/qt/WPEQtView.cpp: Added.
2469         (WPEQtView::WPEQtView):
2470         (WPEQtView::~WPEQtView):
2471         (WPEQtView::geometryChanged):
2472         (WPEQtView::configureWindow):
2473         (WPEQtView::createOffscreen):
2474         (WPEQtView::backendCreated):
2475         (WPEQtView::notifyUrlChangedCallback):
2476         (WPEQtView::notifyTitleChangedCallback):
2477         (WPEQtView::notifyLoadProgressCallback):
2478         (WPEQtView::notifyLoadChangedCallback):
2479         (WPEQtView::notifyLoadFailedCallback):
2480         (WPEQtView::updatePaintNode):
2481         (WPEQtView::url const):
2482         (WPEQtView::setUrl):
2483         (WPEQtView::loadProgress const):
2484         (WPEQtView::title const):
2485         (WPEQtView::canGoBack const):
2486         (WPEQtView::isLoading const):
2487         (WPEQtView::canGoForward const):
2488         (WPEQtView::goBack):
2489         (WPEQtView::goForward):
2490         (WPEQtView::reload):
2491         (WPEQtView::stop):
2492         (WPEQtView::loadHtml):
2493         (WPEQtView::jsAsyncReadyCallback):
2494         (WPEQtView::handleJsResult):
2495         (WPEQtView::runJavaScript):
2496         (WPEQtView::mousePressEvent):
2497         (WPEQtView::mouseReleaseEvent):
2498         (WPEQtView::hoverEnterEvent):
2499         (WPEQtView::hoverLeaveEvent):
2500         (WPEQtView::hoverMoveEvent):
2501         (WPEQtView::wheelEvent):
2502         (WPEQtView::keyPressEvent):
2503         (WPEQtView::keyReleaseEvent):
2504         (WPEQtView::touchEvent):
2505         * UIProcess/API/wpe/qt/WPEQtView.h: Added.
2506         * UIProcess/API/wpe/qt/WPEQtViewBackend.cpp: Added.
2507         (configureCallback):
2508         (WPEQtViewBackend::WPEQtViewBackend):
2509         (WPEQtViewBackend::~WPEQtViewBackend):
2510         (WPEQtViewBackend::configureGlibEglDisplay):
2511         (WPEQtViewBackend::configureEglDisplay):
2512         (WPEQtViewBackend::initialize):
2513         (WPEQtViewBackend::backend const):
2514         (WPEQtViewBackend::resize):
2515         (WPEQtViewBackend::getTexture):
2516         (WPEQtViewBackend::initSurface):
2517         (WPEQtViewBackend::displayImage):
2518         (WPEQtViewBackend::modifiers const):
2519         (WPEQtViewBackend::dispatchHoverEnterEvent):
2520         (WPEQtViewBackend::dispatchHoverLeaveEvent):
2521         (WPEQtViewBackend::dispatchHoverMoveEvent):
2522         (WPEQtViewBackend::dispatchMousePressEvent):
2523         (WPEQtViewBackend::dispatchMouseReleaseEvent):
2524         (WPEQtViewBackend::dispatchWheelEvent):
2525         (WPEQtViewBackend::dispatchKeyEvent):
2526         (WPEQtViewBackend::dispatchTouchEvent):
2527         * UIProcess/API/wpe/qt/WPEQtViewBackend.h: Added.
2528         * UIProcess/API/wpe/qt/WPEQtViewLoadRequest.cpp: Added.
2529         (WPEQtViewLoadRequest::WPEQtViewLoadRequest):
2530         (WPEQtViewLoadRequest::~WPEQtViewLoadRequest):
2531         (WPEQtViewLoadRequest::url const):
2532         (WPEQtViewLoadRequest::status const):
2533         (WPEQtViewLoadRequest::errorString const):
2534         * UIProcess/API/wpe/qt/WPEQtViewLoadRequest.h: Added.
2535         * UIProcess/API/wpe/qt/WPEQtViewLoadRequestPrivate.h: Added.
2536         (WPEQtViewLoadRequestPrivate::WPEQtViewLoadRequestPrivate):
2537         (WPEQtViewLoadRequestPrivate::~WPEQtViewLoadRequestPrivate):
2538         * UIProcess/API/wpe/qt/qmldir: Added.
2539
2540 2019-01-17  Wenson Hsieh  <wenson_hsieh@apple.com>
2541
2542         [iOS] Content offset jumps erratically when autoscrolling near scroll view content inset areas
2543         https://bugs.webkit.org/show_bug.cgi?id=193494
2544         <rdar://problem/46859627>
2545
2546         Reviewed by Simon Fraser and Tim Horton.
2547
2548         Adds `contentInsets` to `VisibleContentRectUpdateInfo`. This keeps track of the visible content insets
2549         surrounding the unobscured content rect. See WebCore ChangeLog for more details.
2550
2551         * Shared/VisibleContentRectUpdateInfo.cpp:
2552         (WebKit::VisibleContentRectUpdateInfo::encode const):
2553         (WebKit::VisibleContentRectUpdateInfo::decode):
2554         (WebKit::operator<<):
2555         * Shared/VisibleContentRectUpdateInfo.h:
2556         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
2557         (WebKit::VisibleContentRectUpdateInfo::contentInsets const):
2558         (WebKit::operator==):
2559         * UIProcess/API/Cocoa/WKWebView.mm:
2560         (-[WKWebView _computedObscuredInset]):
2561         (-[WKWebView _computedContentInset]):
2562         (-[WKWebView _computedUnobscuredSafeAreaInset]):
2563
2564         We don't care about source compatibility with iOS 10 and below anymore, so we should change these >= iOS 11
2565         target checks to simply `PLATFORM(IOS)`.
2566
2567         (-[WKWebView _updateVisibleContentRects]):
2568
2569         Compute the visible content insets on all sides of the unobscured content rect. These insets are scaled to
2570         content coordinates.
2571
2572         * UIProcess/ios/WKContentView.h:
2573         * UIProcess/ios/WKContentView.mm:
2574         (floatBoxExtent):
2575
2576         Add a helper to convert `UIEdgeInsets` to `WebCore::FloatBoxExtent`, and use it in a few places below.
2577
2578         (-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
2579         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): Deleted.
2580         * WebProcess/WebPage/ios/WebPageIOS.mm:
2581         (WebKit::WebPage::updateVisibleContentRects):
2582
2583         Update the Page's content insets.
2584
2585 2019-01-17  Truitt Savell  <tsavell@apple.com>
2586
2587         Unreviewed, rolling out r240124.
2588
2589         This commit broke an internal build.
2590
2591         Reverted changeset:
2592
2593         "SDK_VARIANT build destinations should be separate from non-
2594         SDK_VARIANT builds"
2595         https://bugs.webkit.org/show_bug.cgi?id=189553
2596         https://trac.webkit.org/changeset/240124
2597
2598 2019-01-17  John Wilander  <wilander@apple.com>
2599
2600         Add infrastructure to enable/disable ITP Debug Mode through Preferences
2601         https://bugs.webkit.org/show_bug.cgi?id=193510
2602         <rdar://problem/47330969>
2603
2604         Reviewed by Dean Jackson.
2605
2606         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
2607         (WebKit::ResourceLoadStatisticsMemoryStore::ensurePrevalentResourcesForDebugMode):
2608         (WebKit::ResourceLoadStatisticsMemoryStore::setResourceLoadStatisticsDebugMode):
2609         (WebKit::ResourceLoadStatisticsMemoryStore::setPrevalentResourceForDebugMode):
2610             These functions are now suited for runtime switching of ITP Debug Mode.
2611         * Shared/WebPreferences.yaml:
2612             Changed name from ResourceLoadStatisticsDebugMode to ItpDebugModeEnabled.
2613         * UIProcess/API/Cocoa/WKPreferences.mm:
2614         (-[WKPreferences _setItpDebugModeEnabled:]):
2615         (-[WKPreferences _itpDebugModeEnabled]):
2616             New private preferences functions.
2617         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2618         * UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm:
2619         (WebKit::ResourceLoadStatisticsMemoryStore::registerUserDefaultsIfNeeded):
2620             Removed support for old experimental user default. Added a new one that's
2621             not connected to any UI, i.e. merely for command line debugging where
2622             ITP Debug Mode needs to be on all the time.
2623
2624 2019-01-17  Tim Horton  <timothy_horton@apple.com>
2625
2626         Adopt NSTextCheckingSuppressInitialCapitalizationKey
2627         https://bugs.webkit.org/show_bug.cgi?id=193545
2628
2629         Reviewed by Dean Jackson.
2630
2631         * UIProcess/mac/TextCheckerMac.mm:
2632         (WebKit::TextChecker::checkTextOfParagraph):
2633         (WebKit::TextChecker::getGuessesForWord):
2634
2635 2019-01-17  Jer Noble  <jer.noble@apple.com>
2636
2637         SDK_VARIANT build destinations should be separate from non-SDK_VARIANT builds
2638         https://bugs.webkit.org/show_bug.cgi?id=189553
2639
2640         Reviewed by Tim Horton.
2641
2642         * Configurations/Base.xcconfig:
2643         * Configurations/BaseTarget.xcconfig:
2644         * Configurations/SDKVariant.xcconfig: Added.
2645
2646 2019-01-16  Dean Jackson  <dino@apple.com>
2647
2648         (iPad) Link tapping is sluggish on many sites
2649         https://bugs.webkit.org/show_bug.cgi?id=193522
2650         <rdar://problem/47102987>
2651
2652         Reviewed by Wenson Hsieh.
2653
2654         Some WKWebView clients might set the initial zoom scale of the page to
2655         something other than 1, which disables the "fast tap" behaviour.
2656         The fix is very simple -- just check against the initial scale rather
2657         than 1.
2658
2659         The most likely regression from this would be pages designed for desktop,
2660         but provide a viewport tag saying width=device-width and initial-scale.
2661         They might stop allowing double-tap-to-zoom.
2662
2663         * UIProcess/API/Cocoa/WKWebView.mm:
2664         (-[WKWebView _allowsDoubleTapGestures]): Check against initial page scale.
2665
2666 2019-01-17  Alex Christensen  <achristensen@webkit.org>
2667
2668         Stop using NetworkStorageSession::storageSession in WebCore
2669         https://bugs.webkit.org/show_bug.cgi?id=193529
2670
2671         Reviewed by Tim Horton.
2672
2673         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2674         (WebKit::NetworkConnectionToWebProcess::createSocketStream):
2675         * NetworkProcess/NetworkProcess.h:
2676         * NetworkProcess/NetworkSocketStream.cpp:
2677         (WebKit::NetworkSocketStream::create):
2678         (WebKit::NetworkSocketStream::NetworkSocketStream):
2679         * NetworkProcess/NetworkSocketStream.h:
2680         * NetworkProcess/NetworkStorageSessionProvider.h: Added.
2681         * WebKit.xcodeproj/project.pbxproj:
2682         * WebProcess/Network/WebSocketProvider.cpp:
2683         (WebKit::WebSocketProvider::createSocketStreamHandle):
2684         * WebProcess/Network/WebSocketProvider.h:
2685         * WebProcess/WebPage/WebCookieJar.cpp:
2686         (WebKit::WebCookieJar::WebCookieJar):
2687         * WebProcess/WebPage/WebCookieJar.h:
2688
2689 2019-01-16  Youenn Fablet  <youenn@apple.com>
2690
2691         Add a new SPI for controlling getUserMedia
2692         https://bugs.webkit.org/show_bug.cgi?id=192793
2693
2694         Reviewed by Eric Carlson.
2695
2696         Some weaknesses of the current getUserMedia/enumerateDevices SPI were found.
2697         In particular:
2698         - The hash salt should be handled by WebKit not by apps using WebKit.
2699         - No need to expose the frame URL, only the top level origin is needed.
2700         - The names of the callback are changed to improve the intent of these callbacks.
2701         Addressed these by creating a new SPI which will replace the current one.
2702         The current SPI will be removed later on.
2703
2704         Did some refactoring by making the callbacks not return false.
2705         Instead, implement the default behavior inside the request objects as deny methods.
2706         Some further refactoring will be done as a follow-up to better align the C API with the Cocoa API.
2707
2708         * UIProcess/API/APIUIClient.h:
2709         (API::UIClient::decidePolicyForUserMediaPermissionRequest):
2710         (API::UIClient::checkUserMediaPermissionForOrigin):
2711         * UIProcess/API/C/WKPage.cpp:
2712         (WKPageSetPageUIClient):
2713         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2714         * UIProcess/API/Cocoa/WKWebView.mm:
2715         (-[WKWebView _mediaCaptureState]):
2716         (-[WKWebView _setMediaCaptureMuted:]):
2717         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2718         * UIProcess/API/glib/WebKitUIClient.cpp:
2719         * UIProcess/Cocoa/MediaCaptureUtilities.h: Added.
2720         * UIProcess/Cocoa/MediaCaptureUtilities.mm: Added.
2721         * UIProcess/Cocoa/UIDelegate.h:
2722         * UIProcess/Cocoa/UIDelegate.mm:
2723         (WebKit::UIDelegate::setDelegate):
2724         (WebKit::requestUserMediaAuthorizationForFrame):
2725         (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
2726         (WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin):
2727         (WebKit::UIDelegate::UIClient::mediaCaptureStateDidChange):
2728         * UIProcess/UserMediaPermissionCheckProxy.h:
2729         (WebKit::UserMediaPermissionCheckProxy::deny):
2730         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2731         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
2732         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo):
2733         * UIProcess/UserMediaPermissionRequestProxy.h:
2734
2735 2019-01-16  Youenn Fablet  <youenn@apple.com>
2736
2737         Pipe cache quota request from Network Process to UIProcess
2738         https://bugs.webkit.org/show_bug.cgi?id=193296
2739
2740         Reviewed by Alex Christensen.
2741
2742         When cache storage hits quota for a given origin, pipe the request back to NetworkProcess.
2743         No record will be put until the quota request is answered.
2744         The request is sent from CacheStorage::Caches to CacheStorage::Engine and to NetworkProcess.
2745         NetworkProcess then sends it to NetworkProcessProxy.
2746         Currently NetworkProcessProxy just answers by keeping the quota as it is.
2747         In the future, NetworkProcessProxy should make a delegate call to let the app using WebKit
2748         make a decision on the quota. This will allow prompting user to bump it as done for other data.
2749
2750         * NetworkProcess/NetworkProcess.cpp:
2751         (WebKit::NetworkProcess::requestCacheStorageSpace):
2752         * NetworkProcess/NetworkProcess.h:
2753         * NetworkProcess/cache/CacheStorageEngine.cpp:
2754         (WebKit::CacheStorage::Engine::~Engine):
2755         (WebKit::CacheStorage::Engine::from):
2756         (WebKit::CacheStorage::Engine::Engine):
2757         (WebKit::CacheStorage::Engine::requestSpace):
2758         (WebKit::CacheStorage::Engine::requestSpaceCompleted):
2759         * NetworkProcess/cache/CacheStorageEngine.h:
2760         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
2761         (WebKit::CacheStorage::Cache::put):
2762         (WebKit::CacheStorage::Cache::retryPuttingPendingRecords):
2763         * NetworkProcess/cache/CacheStorageEngineCache.h:
2764         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2765         (WebKit::CacheStorage::Caches::requestSpace):
2766         (WebKit::CacheStorage::Caches::notifyCachesOfRequestSpaceEnd):
2767         * NetworkProcess/cache/CacheStorageEngineCaches.h:
2768         (WebKit::CacheStorage::Caches::isRequestingSpace const):
2769         * UIProcess/Network/NetworkProcessProxy.cpp:
2770         (WebKit::NetworkProcessProxy::requestCacheStorageSpace):
2771         * UIProcess/Network/NetworkProcessProxy.h:
2772         * UIProcess/Network/NetworkProcessProxy.messages.in:
2773
2774 2019-01-16  Alex Christensen  <achristensen@webkit.org>
2775
2776         sendBeacon to previously-unvisited https domain always fails
2777         https://bugs.webkit.org/show_bug.cgi?id=193508
2778
2779         Reviewed by Geoffrey Garen.
2780
2781         * NetworkProcess/PingLoad.cpp:
2782         (WebKit::PingLoad::didReceiveChallenge):
2783         If a ping load is doing a TLS handshake, continue if the server has good certificates.
2784
2785 2019-01-16  Youenn Fablet  <youenn@apple.com>
2786
2787         ASSERTION FAILED: m_networkLoadInformationByID.contains(identifier) in WebKit::NetworkConnectionToWebProcess::addNetworkLoadInformationMetrics
2788         https://bugs.webkit.org/show_bug.cgi?id=189097
2789         <rdar://problem/43856423>
2790
2791         Reviewed by Alex Christensen.
2792
2793         In case where the inspector is launched, it will instruct the NetworkConnectionToWebProcess to start capturing network metrics.
2794         If this happens in the middle of a load, addNetworkLoadInformationMetrics might fail since addNetworkLoadInformation will not be called.
2795         To fix this issue, store whether to capture metrics at NetworkResourceLoader level.
2796
2797         To ensure that the case of switching back and forth capture of metrics, disable loader capture of metrics whenver NetworkConnectionToWebProcess is asked to.
2798
2799         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2800         (WebKit::NetworkConnectionToWebProcess::setCaptureExtraNetworkLoadMetricsEnabled):
2801         * NetworkProcess/NetworkConnectionToWebProcess.h:
2802         (WebKit::NetworkConnectionToWebProcess::addNetworkLoadInformationMetrics):
2803         * NetworkProcess/NetworkResourceLoader.cpp:
2804         (WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
2805         (WebKit::NetworkResourceLoader::shouldCaptureExtraNetworkLoadMetrics const):
2806         * NetworkProcess/NetworkResourceLoader.h:
2807
2808 2019-01-16  Alex Christensen  <achristensen@webkit.org>
2809
2810         Revert r239938
2811         https://bugs.webkit.org/show_bug.cgi?id=193267
2812         <rdar://problem/47297304>
2813
2814         * Configurations/WebContent-iOS.entitlements:
2815
2816 2019-01-16  Chris Dumez  <cdumez@apple.com>
2817
2818         Regression(r240046) Several API tests are crashing
2819         https://bugs.webkit.org/show_bug.cgi?id=193509
2820
2821         Reviewed by Geoffrey Garen.
2822
2823         The crashes would happen because loadRequestShared() would take a WebProcessProxy& in parameter but
2824         then call reattachToWebProcess() if the page is not valid, which would replace m_process and invalidate
2825         our process reference.
2826
2827         To address the issue, move the reattachToWebProcess() call to loadRequest(), before calling
2828         loadRequestShared(). Also, update *Shared() methods to take a Ref<WebProcessProxy>&& instead
2829         of a WebProcessProxy& in parameter. Since we call client delegates, we need to make sure
2830         our process stays alive.
2831
2832         * UIProcess/ProvisionalPageProxy.cpp:
2833         (WebKit::ProvisionalPageProxy::loadData):
2834         (WebKit::ProvisionalPageProxy::loadRequest):
2835         (WebKit::ProvisionalPageProxy::didCreateMainFrame):
2836         (WebKit::ProvisionalPageProxy::didPerformClientRedirect):
2837         (WebKit::ProvisionalPageProxy::didStartProvisionalLoadForFrame):
2838         (WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame):
2839         (WebKit::ProvisionalPageProxy::didNavigateWithNavigationData):
2840         (WebKit::ProvisionalPageProxy::didChangeProvisionalURLForFrame):
2841         (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionAsync):
2842         (WebKit::ProvisionalPageProxy::decidePolicyForResponse):
2843         (WebKit::ProvisionalPageProxy::startURLSchemeTask):
2844         (WebKit::ProvisionalPageProxy::backForwardGoToItem):
2845         * UIProcess/WebPageProxy.cpp:
2846         (WebKit::WebPageProxy::loadRequest):
2847         (WebKit::WebPageProxy::loadRequestWithNavigationShared):
2848         (WebKit::WebPageProxy::loadData):
2849         (WebKit::WebPageProxy::loadDataWithNavigationShared):
2850         (WebKit::WebPageProxy::didPerformDragControllerAction):
2851         (WebKit::WebPageProxy::findPlugin):
2852         (WebKit::WebPageProxy::didCreateMainFrame):
2853         (WebKit::WebPageProxy::didCreateSubframe):
2854         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
2855         (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
2856         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
2857         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrameShared):
2858         (WebKit::WebPageProxy::willPerformClientRedirectForFrame):
2859         (WebKit::WebPageProxy::didCancelClientRedirectForFrame):
2860         (WebKit::WebPageProxy::didChangeProvisionalURLForFrame):
2861         (WebKit::WebPageProxy::didChangeProvisionalURLForFrameShared):
2862         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
2863         (WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared):
2864         (WebKit::WebPageProxy::didCommitLoadForFrame):
2865         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
2866         (WebKit::WebPageProxy::didFinishLoadForFrame):
2867         (WebKit::WebPageProxy::didFailLoadForFrame):
2868         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
2869         (WebKit::WebPageProxy::didReceiveTitleForFrame):
2870         (WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame):
2871         (WebKit::WebPageProxy::didDisplayInsecureContentForFrame):
2872         (WebKit::WebPageProxy::didRunInsecureContentForFrame):
2873         (WebKit::WebPageProxy::frameDidBecomeFrameSet):
2874         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
2875         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared):
2876         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2877         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
2878         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
2879         (WebKit::WebPageProxy::decidePolicyForResponse):
2880         (WebKit::WebPageProxy::decidePolicyForResponseShared):
2881         (WebKit::WebPageProxy::unableToImplementPolicy):
2882         (WebKit::WebPageProxy::willSubmitForm):
2883         (WebKit::WebPageProxy::didNavigateWithNavigationData):
2884         (WebKit::WebPageProxy::didNavigateWithNavigationDataShared):
2885         (WebKit::WebPageProxy::didPerformClientRedirect):
2886         (WebKit::WebPageProxy::didPerformClientRedirectShared):
2887         (WebKit::WebPageProxy::didPerformServerRedirect):
2888         (WebKit::WebPageProxy::didUpdateHistoryTitle):
2889         (WebKit::WebPageProxy::createNewPage):
2890         (WebKit::WebPageProxy::runJavaScriptAlert):
2891         (WebKit::WebPageProxy::runJavaScriptConfirm):
2892         (WebKit::WebPageProxy::runJavaScriptPrompt):
2893         (WebKit::WebPageProxy::unavailablePluginButtonClicked):
2894         (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel):
2895         (WebKit::WebPageProxy::runOpenPanel):
2896         (WebKit::WebPageProxy::printFrame):
2897         (WebKit::WebPageProxy::backForwardGoToItem):
2898         (WebKit::WebPageProxy::backForwardGoToItemShared):
2899         (WebKit::WebPageProxy::learnWord):
2900         (WebKit::WebPageProxy::ignoreWord):
2901         (WebKit::WebPageProxy::didReceiveEvent):
2902         (WebKit::WebPageProxy::editingRangeCallback):
2903         (WebKit::WebPageProxy::rectForCharacterRangeCallback):
2904         (WebKit::WebPageProxy::focusedFrameChanged):
2905         (WebKit::WebPageProxy::frameSetLargestFrameChanged):
2906         (WebKit::WebPageProxy::exceededDatabaseQuota):
2907         (WebKit::WebPageProxy::requestGeolocationPermissionForFrame):
2908         (WebKit::WebPageProxy::requestUserMediaPermissionForFrame):
2909         (WebKit::WebPageProxy::enumerateMediaDevicesForFrame):
2910         (WebKit::WebPageProxy::startURLSchemeTask):
2911         (WebKit::WebPageProxy::startURLSchemeTaskShared):
2912         (WebKit::WebPageProxy::stopURLSchemeTask):
2913         (WebKit::WebPageProxy::loadSynchronousURLSchemeTask):
2914         * UIProcess/WebPageProxy.h:
2915
2916 2019-01-16  Chris Dumez  <cdumez@apple.com>
2917
2918         Regression(PSON) View becomes blank after click a cross-site download link
2919         https://bugs.webkit.org/show_bug.cgi?id=193361
2920         <rdar://problem/47099573>
2921
2922         Reviewed by Geoffrey Garen.
2923
2924         The issue tracked by rdar://problem/47099573 is that a provisional load may get
2925         canceled (or converted into a download) *after* we've decided to process-swap.
2926         In such cases, the view should keep displaying the current site and it should
2927         still be interactive. However, with the previous PSON model, the view (pageProxy)
2928         would have already swapped to the new process and would end up displaying the
2929         initially empty document.
2930
2931         To address the issue, this patch introduces the concept of a provisional load
2932         in the UIProcess, handled by a ProvisionalPageProxy which has its own privisional
2933         process. The WebPageProxy owns the ProvisionalPageProxy but we do not commit the
2934         provisional page until after the load was committed in the new process. This means
2935         that the view / WebPageProxy keeps using the old process and displays the current
2936         content until a load has committed in the provisional page. If no load commits
2937         in the provisional process (e.g. because the load is cancelled or converted into
2938         a download), then we merely destroy the ProvisionalPageProxy and terminate its
2939         process, without impacting the WebPageProxy.
2940
2941         * Shared/WebPageCreationParameters.cpp:
2942         (WebKit::WebPageCreationParameters::encode const):
2943         (WebKit::WebPageCreationParameters::decode):
2944         * Shared/WebPageCreationParameters.h:
2945         Rename isSwapFromSuspended to isProcessSwap for clarity as we always want to
2946         delay attaching the drawing area in case of a process-swap, no matter what
2947         now that the previous process is kept alive until the provisional load is
2948         committed in the new process.
2949
2950         * Shared/WebPolicyAction.h:
2951         Drop Suspend policy action. At decidePolicyForNavigationAction time, in case of
2952         process-swap, we now tell the previous process to simply ignore the load, while
2953         we create a ProvisionalPageProxy to do the new load in a new process.
2954         Suspension of the previous page in the old process, happens later, when a load
2955         is actually committed in the new process.
2956
2957         * Sources.txt:
2958         Add new ProvisionalPageProxy file.
2959
2960         * UIProcess/API/Cocoa/WKWebView.mm:
2961         (-[WKWebView _killWebContentProcessAndResetState]):
2962         When calling _killWebContentProcessAndResetState on a WKWebView, kill both the current
2963         process and the provisional one, to maintain previous behavior in our API tests.
2964
2965         * UIProcess/API/gtk/PageClientImpl.cpp:
2966         (WebKit::PageClientImpl::createDrawingAreaProxy):
2967         * UIProcess/API/gtk/PageClientImpl.h:
2968         * UIProcess/API/wpe/PageClientImpl.cpp:
2969         (WebKit::PageClientImpl::createDrawingAreaProxy):
2970         * UIProcess/API/wpe/PageClientImpl.h:
2971         * UIProcess/AcceleratedDrawingAreaProxy.cpp:
2972         (WebKit::AcceleratedDrawingAreaProxy::AcceleratedDrawingAreaProxy):
2973         (WebKit::AcceleratedDrawingAreaProxy::didUpdateBackingStoreState):
2974         (WebKit::AcceleratedDrawingAreaProxy::sendUpdateBackingStoreState):
2975         (WebKit::AcceleratedDrawingAreaProxy::waitForAndDispatchDidUpdateBackingStoreState):
2976         (WebKit::AcceleratedDrawingAreaProxy::setNativeSurfaceHandleForCompositing):
2977         (WebKit::AcceleratedDrawingAreaProxy::destroyNativeSurfaceHandleForCompositing):
2978         * UIProcess/AcceleratedDrawingAreaProxy.h:
2979         * UIProcess/Cocoa/WebViewImpl.h:
2980         * UIProcess/Cocoa/WebViewImpl.mm:
2981         (WebKit::WebViewImpl::createDrawingAreaProxy):
2982         * UIProcess/DrawingAreaProxy.cpp:
2983         (WebKit::DrawingAreaProxy::DrawingAreaProxy):
2984         (WebKit::DrawingAreaProxy::~DrawingAreaProxy):
2985         (WebKit::DrawingAreaProxy::viewExposedRectChangedTimerFired):
2986         * UIProcess/DrawingAreaProxy.h:
2987         (WebKit::DrawingAreaProxy::process):
2988         * UIProcess/DrawingAreaProxyImpl.cpp:
2989         (WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl):
2990         (WebKit::DrawingAreaProxyImpl::update):
2991         * UIProcess/DrawingAreaProxyImpl.h:
2992         * UIProcess/PageClient.h:
2993         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
2994         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
2995         (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
2996         (WebKit::RemoteLayerTreeDrawingAreaProxy::~RemoteLayerTreeDrawingAreaProxy):
2997         (WebKit::RemoteLayerTreeDrawingAreaProxy::deviceScaleFactorDidChange):
2998         (WebKit::RemoteLayerTreeDrawingAreaProxy::sendUpdateGeometry):
2999         (WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidStart):
3000         (WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidEnd):
3001         (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
3002         (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateActivityState):
3003         (WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing):
3004         * UIProcess/ios/PageClientImplIOS.h:
3005         * UIProcess/ios/PageClientImplIOS.mm:
3006         (WebKit::PageClientImpl::createDrawingAreaProxy):
3007         * UIProcess/ios/WKContentView.h:
3008         * UIProcess/ios/WKContentView.mm:
3009         (-[WKContentView _createDrawingAreaProxy:]):
3010         * UIProcess/mac/PageClientImplMac.h:
3011         * UIProcess/mac/PageClientImplMac.mm:
3012         (WebKit::PageClientImpl::createDrawingAreaProxy):
3013         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
3014         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
3015         (WebKit::TiledCoreAnimationDrawingAreaProxy::TiledCoreAnimationDrawingAreaProxy):
3016         (WebKit::TiledCoreAnimationDrawingAreaProxy::deviceScaleFactorDidChange):
3017         (WebKit::TiledCoreAnimationDrawingAreaProxy::colorSpaceDidChange):
3018         (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState):
3019         (WebKit::TiledCoreAnimationDrawingAreaProxy::createFence):
3020         (WebKit::TiledCoreAnimationDrawingAreaProxy::sendUpdateGeometry):
3021         (WebKit::TiledCoreAnimationDrawingAreaProxy::adjustTransientZoom):
3022         (WebKit::TiledCoreAnimationDrawingAreaProxy::commitTransientZoom):
3023         (WebKit::TiledCoreAnimationDrawingAreaProxy::dispatchAfterEnsuringDrawing):
3024         * UIProcess/mac/WebPageProxyMac.mm:
3025         * UIProcess/win/PageClientImpl.cpp:
3026         (WebKit::PageClientImpl::createDrawingAreaProxy):
3027         * UIProcess/win/PageClientImpl.h:
3028         * UIProcess/win/PageClientImpl.cpp:
3029         (WebKit::PageClientImpl::createDrawingAreaProxy):
3030         * UIProcess/win/PageClientImpl.h:
3031         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3032         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
3033         Pass the drawing area's associated process when constructing it and store it as a member
3034         in addition to the page. This is necessary now that a page can be associated with 2
3035         WebProcesses at a time, each having its own drawing area.
3036
3037         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
3038         (WebKit::WebPageProxy::createSandboxExtensionsIfNeeded):
3039         Pass the process.
3040
3041         * UIProcess/ProvisionalPageProxy.cpp: Added.
3042         (WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
3043         (WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
3044         (WebKit::ProvisionalPageProxy::processDidTerminate):
3045         (WebKit::ProvisionalPageProxy::takeDrawingArea):
3046         (WebKit::ProvisionalPageProxy::cancel):
3047         (WebKit::ProvisionalPageProxy::processDidFinishLaunching):
3048         (WebKit::ProvisionalPageProxy::finishInitializingWebPageAfterProcessLaunch):
3049         (WebKit::ProvisionalPageProxy::initializeWebPage):
3050         (WebKit::ProvisionalPageProxy::loadData):
3051         (WebKit::ProvisionalPageProxy::loadRequest):
3052         (WebKit::ProvisionalPageProxy::goToBackForwardItem):
3053         (WebKit::ProvisionalPageProxy::didCreateMainFrame):
3054         (WebKit::ProvisionalPageProxy::didPerformClientRedirect):
3055         (WebKit::ProvisionalPageProxy::didStartProvisionalLoadForFrame):
3056         (WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame):
3057         (WebKit::ProvisionalPageProxy::didCommitLoadForFrame):
3058         (WebKit::ProvisionalPageProxy::didNavigateWithNavigationData):
3059         (WebKit::ProvisionalPageProxy::didChangeProvisionalURLForFrame):
3060         (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionAsync):
3061         (WebKit::ProvisionalPageProxy::decidePolicyForResponse):
3062         (WebKit::ProvisionalPageProxy::startURLSchemeTask):
3063         (WebKit::ProvisionalPageProxy::backForwardGoToItem):
3064         (WebKit::ProvisionalPageProxy::didReceiveMessage):
3065         (WebKit::ProvisionalPageProxy::didReceiveSyncMessage):
3066         * UIProcess/ProvisionalPageProxy.h: Added.
3067         (WebKit::ProvisionalPageProxy::page):
3068         (WebKit::ProvisionalPageProxy::mainFrame const):
3069         (WebKit::ProvisionalPageProxy::process):
3070         (WebKit::ProvisionalPageProxy::processSwapRequestedByClient const):
3071         (WebKit::ProvisionalPageProxy::navigationID const):
3072         (WebKit::ProvisionalPageProxy::drawingArea const):
3073         New WebPageProxy-like class which is owned by the WebPageProxy and proxies IPC from
3074         the provisional process.
3075
3076         * UIProcess/SuspendedPageProxy.cpp:
3077         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
3078         (WebKit::SuspendedPageProxy::unsuspend):
3079         (WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
3080         Unregister the SuspendedPageProxy as an IPC message receiver a little bit earlier
3081         when we're going to unsuspend it. This avoids conflicting with the ProvisionalPageProxy
3082         which tries to register itself as an IPC message receiver for the same pageID when
3083         a process-swap occurs and we're switching to a suspended page.
3084
3085         * UIProcess/WebFrameProxy.cpp:
3086         (WebKit::WebFrameProxy::isMainFrame const):
3087         WebFrameProxy::isMainFrame() relies on checking that the frame is the WebPageProxy's m_mainFrame.
3088         Now that the WebPageProxy can have a ProvisionalPageProxy, also check if it is the ProvisionalPageProxy's
3089         m_mainFrame to maintain previous behavior.
3090
3091         * UIProcess/WebPageProxy.cpp:
3092         (WebKit::WebPageProxy::provisionalDrawingArea const):
3093         Add getter for the provisional drawing area. We normally only deal with the page's current drawing area, but
3094         the ViewGestureController needs access to the provisional once to display the swipe gesture snapshot.
3095
3096         (WebKit::WebPageProxy::swapToWebProcess):
3097         swapToWebProcess() no longer takes care of unsuspending the SuspendedPage because we now call swapToWebProcess()
3098         later, when a load is actually committed in the provisional page / process. swapToWebProcess() now also needs
3099         to initialize some data members such as the drawing area and the main frame as it is transferring them over from
3100         the ProvisionalPageProxy which started the provisional load.
3101
3102         (WebKit::WebPageProxy::finishAttachingToWebProcess):
3103         We no longer need IsSwapFromSuspended parameter as this is called later now, after a load has actually been
3104         committed in the provisional process.
3105
3106         (WebKit::WebPageProxy::setDrawingArea):
3107         (WebKit::WebPageProxy::initializeWebPage):
3108         - We no longer need IsSwapFromSuspended parameter as this is called later now, after a load has actually been
3109           committed in the provisional process.
3110         - Factor some code out to WebPageProxy::setDrawingArea() so that it can be shared with swapToWebProcess().
3111
3112         (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
3113         (WebKit::WebPageProxy::loadRequest):
3114         (WebKit::WebPageProxy::loadRequestWithNavigationShared):
3115         Only call setPendingAPIRequestURL() in loadRequestWithNavigation() only if ShouldTreatAsContinuingLoad is not
3116         Yes. This avoids hitting some assertions as this was already called during the first API call if needed.
3117
3118         (WebKit::WebPageProxy::loadData):
3119         (WebKit::WebPageProxy::loadDataWithNavigationShared):
3120         (WebKit::WebPageProxy::stopLoading):
3121         (WebKit::WebPageProxy::reload):
3122         (WebKit::WebPageProxy::didPerformDragControllerAction):
3123         (WebKit::WebPageProxy::findPlugin):
3124         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
3125         In case of process swap, tell the previous process to ignore the load instead of suspending it right away.
3126         Suspension now happens later, only if we end up committing the provisional load in the new process.
3127         Also discard the SuspendedPage if it failed to suspend (we only reuse its process in this case). This used
3128         to happen a bit later but it is clearer if we do this as early as possible I think.
3129
3130         (WebKit::WebPageProxy::commitProvisionalPage):
3131         When the load is committed in the new process, we call WebPageProxy::commitProvisionalPage(). It takes care of:
3132         - Actually swapping the WebPageProxy to the new process by calling processDidTerminate() / swapToWebProcess().
3133         - Suspending the current page.
3134         - Letting the client know the load is comitted
3135         - Destroy the ProvisionalPageProxy.
3136         This work used to happen earlier in continueNavigationInNewProcess().
3137
3138         (WebKit::WebPageProxy::continueNavigationInNewProcess):
3139         Moved some of the logic to commitProvisionalPage(). We now merely start the load in a new ProvisionalPageProxy,
3140         without actually having the WebPageProxy switch to the new process yet.
3141
3142         (WebKit::WebPageProxy::didCreateMainFrame):
3143         (WebKit::WebPageProxy::didCreateSubframe):
3144         (WebKit::WebPageProxy::didCreateWindow):
3145         Drop some code that is no longer needed, now that the ProvisionalPageProxy takes care of this.
3146
3147         (WebKit::WebPageProxy::didDestroyNavigation):
3148         On process-swap, when telling the previous process to ignore the load and starting the new load in a new
3149         ProvisionalPageProxy, the previous WebPage attempts to destroy the navigation. In this case, we ignore
3150         the call since the navigation is merely taken over by the ProvisionalPageProxy.
3151
3152         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
3153         (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
3154         Moved some PSON logic to the ProvisionalPageProxy instead.
3155
3156         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
3157         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrameShared):
3158         (WebKit::WebPageProxy::willPerformClientRedirectForFrame):
3159         (WebKit::WebPageProxy::didCancelClientRedirectForFrame):
3160         (WebKit::WebPageProxy::didChangeProvisionalURLForFrame):
3161         (WebKit::WebPageProxy::didChangeProvisionalURLForFrameShared):
3162
3163         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
3164         (WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared):
3165         When didFailProvisionalLoadForFrame() is called for a ProvisionalPageProxy, destroy it.
3166
3167         (WebKit::WebPageProxy::didCommitLoadForFrame):
3168         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
3169         (WebKit::WebPageProxy::didFinishLoadForFrame):
3170         (WebKit::WebPageProxy::didFailLoadForFrame):
3171         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
3172         (WebKit::WebPageProxy::didReceiveTitleForFrame):
3173         (WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame):
3174         (WebKit::WebPageProxy::didDisplayInsecureContentForFrame):
3175         (WebKit::WebPageProxy::didRunInsecureContentForFrame):
3176         (WebKit::WebPageProxy::frameDidBecomeFrameSet):
3177         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
3178         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared):
3179         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
3180         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
3181         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
3182         (WebKit::WebPageProxy::decidePolicyForResponse):
3183         (WebKit::WebPageProxy::decidePolicyForResponseShared):
3184         (WebKit::WebPageProxy::unableToImplementPolicy):
3185         (WebKit::WebPageProxy::willSubmitForm):
3186         (WebKit::WebPageProxy::didNavigateWithNavigationData):
3187         (WebKit::WebPageProxy::didNavigateWithNavigationDataShared):
3188         (WebKit::WebPageProxy::didPerformClientRedirect):
3189         (WebKit::WebPageProxy::didPerformClientRedirectShared):
3190         (WebKit::WebPageProxy::didPerformServerRedirect):
3191         (WebKit::WebPageProxy::didUpdateHistoryTitle):
3192         (WebKit::WebPageProxy::createNewPage):
3193         (WebKit::WebPageProxy::runJavaScriptAlert):
3194         (WebKit::WebPageProxy::runJavaScriptConfirm):
3195         (WebKit::WebPageProxy::runJavaScriptPrompt):
3196         (WebKit::WebPageProxy::unavailablePluginButtonClicked):
3197         (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel):
3198         (WebKit::WebPageProxy::runOpenPanel):
3199         (WebKit::WebPageProxy::printFrame):
3200         (WebKit::WebPageProxy::backForwardGoToItem):
3201         (WebKit::WebPageProxy::backForwardGoToItemShared):
3202         (WebKit::WebPageProxy::learnWord):
3203         (WebKit::WebPageProxy::ignoreWord):
3204         (WebKit::WebPageProxy::didReceiveEvent):
3205         (WebKit::WebPageProxy::editingRangeCallback):
3206         (WebKit::WebPageProxy::rectForCharacterRangeCallback):
3207         (WebKit::WebPageProxy::focusedFrameChanged):
3208         (WebKit::WebPageProxy::frameSetLargestFrameChanged):
3209
3210         (WebKit::WebPageProxy::provisionalProcessDidTerminate):
3211         Cancel the provisiona load and destroy the ProvisionalPageProxy if
3212         the provisional process crashes.
3213
3214         (WebKit::WebPageProxy::resetState):
3215         Drop some code that is no longer needed.
3216
3217         (WebKit::WebPageProxy::creationParameters):
3218         - Move the hasRegisteredServiceWorkers flag initialization from the call site to here now that we have
3219         more than one call site. This was just some bad factoring.
3220         - Take the process in parameter now that we page can be associated with several processes at a time.
3221
3222         (WebKit::WebPageProxy::exceededDatabaseQuota):
3223         (WebKit::WebPageProxy::requestGeolocationPermissionForFrame):
3224         (WebKit::WebPageProxy::requestUserMediaPermissionForFrame):
3225         (WebKit::WebPageProxy::enumerateMediaDevicesForFrame):
3226         (WebKit::WebPageProxy::startURLSchemeTask):
3227         (WebKit::WebPageProxy::startURLSchemeTaskShared):
3228         (WebKit::WebPageProxy::stopURLSchemeTask):
3229         (WebKit::WebPageProxy::loadSynchronousURLSchemeTask):
3230         (WebKit::WebPageProxy::checkURLReceivedFromCurrentOrPreviousWebProcess):
3231         (WebKit::WebPageProxy::willAcquireUniversalFileReadSandboxExtension):
3232         * UIProcess/WebPageProxy.h:
3233         (WebKit::WebPageProxy::visitedLinkStore):
3234         (WebKit::WebPageProxy::provisionalPageProxy const):
3235
3236         * UIProcess/WebProcessProxy.cpp:
3237         (WebKit::WebProcessProxy::hasProvisionalPageWithID const):
3238         (WebKit::WebProcessProxy::updateBackForwardItem):
3239         (WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
3240         (WebKit::WebProcessProxy::didFinishLaunching):
3241         (WebKit::WebProcessProxy::canTerminateChildProcess):
3242         * UIProcess/WebProcessProxy.h:
3243         (WebKit::WebProcessProxy::addProvisionalPageProxy):
3244         (WebKit::WebProcessProxy::removeProvisionalPageProxy):
3245         Before updating a BackForwardListItem, we normally make sure the process has a WebPageProxy with the
3246         item's pageID. We have to tweak the logic because there may now be no WebPageProxy with this pageID
3247         associated with this process yet, because it is still a ProvisionalPageProxy.        
3248
3249         * UIProcess/WebURLSchemeHandler.cpp:
3250         (WebKit::WebURLSchemeHandler::startTask):
3251         * UIProcess/WebURLSchemeHandler.h:
3252         * UIProcess/WebURLSchemeTask.cpp:
3253         (WebKit::WebURLSchemeTask::create):
3254         (WebKit::WebURLSchemeTask::WebURLSchemeTask):
3255         (WebKit::WebURLSchemeTask::didPerformRedirection):
3256         (WebKit::WebURLSchemeTask::didReceiveResponse):
3257         (WebKit::WebURLSchemeTask::didReceiveData):
3258         (WebKit::WebURLSchemeTask::didComplete):
3259         (WebKit::WebURLSchemeTask::pageDestroyed):
3260         * UIProcess/WebURLSchemeTask.h:
3261         Pass the process when constructing a WebURLSchemeTask and store it as a data member in addition to
3262         the page. This is necessary now that a WebPageProxy can be associated with several WebProcesses.
3263
3264         * UIProcess/ios/ViewGestureControllerIOS.mm:
3265         (WebKit::ViewGestureController::endSwipeGesture):
3266         Use the provisional drawing area to display the swipe snapshot as it may differ from the one currently
3267         associated with the page in case of process swap.
3268
3269         * WebKit.xcodeproj/project.pbxproj:
3270         Add ProvisionalPageProxy class.
3271
3272         * WebProcess/WebPage/WebFrame.cpp:
3273         (WebKit::toPolicyAction):
3274         (WebKit::WebFrame::didReceivePolicyDecision):
3275         * WebProcess/WebPage/WebPage.cpp:
3276         (WebKit::m_shouldAttachDrawingAreaOnPageTransition):
3277         (WebKit::WebPage::reinitializeWebPage):
3278         (WebKit::WebPage::didReceivePolicyDecision):
3279         Stop dealing with WebPolicyAction::Suspend as it no longer exists.
3280
3281         (WebKit::WebPage::didCompletePageTransition):
3282
3283         (WebKit::WebPage::setIsSuspended):
3284         Suspend the Page when setIsSuspended(true) is called, now that there is no longer a WebPolicyAction::Suspend.
3285         setIsSuspended(true) IPC is sent when we actually commit the provisional page.
3286
3287         * WebProcess/WebPage/WebPage.h:
3288
3289 2019-01-16  Tim Horton  <timothy_horton@apple.com>
3290
3291         Frequent null-deref under TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded()
3292         https://bugs.webkit.org/show_bug.cgi?id=193468
3293         <rdar://problem/38645869>
3294
3295         Reviewed by Zalan Bujtas.
3296
3297         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3298         (WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
3299         Adjust the null-check a bit; Zalan pointed out that the layout could
3300         be responsible for the Frame/RenderView going away, so we should bail
3301         *after* layout, not before.
3302
3303 2019-01-15  Fujii Hironori  <Hironori.Fujii@sony.com>
3304
3305         Unreviewed WinCairo build fix.
3306
3307         * WebProcess/WebPage/WebPageInspectorTargetController.cpp:
3308         (WebKit::WebPageInspectorTargetController::connectInspector): Use 'auto' instead of unprefixed InspectorTarget.
3309         (WebKit::WebPageInspectorTargetController::disconnectInspector): Ditto.
3310         (WebKit::WebPageInspectorTargetController::sendMessageToTargetBackend): Ditto.
3311
3312 2019-01-15  Alex Christensen  <achristensen@webkit.org>
3313
3314         Reduce use of NetworkStorageSession::defaultStorageSession in WebCore
3315         https://bugs.webkit.org/show_bug.cgi?id=193368
3316
3317         Reviewed by Geoff Garen.
3318
3319         * WebProcess/Plugins/PluginView.cpp:
3320         (WebKit::PluginView::getAuthenticationInfo):
3321
3322 2019-01-15  Alex Christensen  <achristensen@webkit.org>
3323
3324         Remove more NetworkProcess::singleton use
3325         https://bugs.webkit.org/show_bug.cgi?id=193484
3326
3327         Reviewed by Geoffrey Garen.
3328
3329         This removes the use of NetworkProcess::singleton in the LegacyCustomProtocolManager.
3330         This is the kind of awful duct tape code that keeps me awake at night, but it's necessary
3331         because we can't quite remove LegacyCustomProtocolManager yet but we need to allow more than
3332         one NetworkProcess object.  To make it work well enough until we remove LegacyCustomProtocolManager,
3333         use the last NetworkProcess object that has been created.
3334
3335         * NetworkProcess/CustomProtocols/Cocoa/LegacyCustomProtocolManagerCocoa.mm:
3336         (newestNetworkProcess):
3337         (LegacyCustomProtocolManager::networkProcessCreated):
3338         (+[WKCustomProtocol canInitWithRequest:]):
3339         (-[WKCustomProtocol initWithRequest:cachedResponse:client:]):
3340         (-[WKCustomProtocol startLoading]):
3341         (-[WKCustomProtocol stopLoading]):
3342         * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.cpp:
3343         (WebKit::LegacyCustomProtocolManager::LegacyCustomProtocolManager):
3344         (WebKit::LegacyCustomProtocolManager::startLoading):
3345         (WebKit::LegacyCustomProtocolManager::stopLoading):
3346         * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.h:
3347         * NetworkProcess/NetworkProcess.cpp:
3348         (WebKit::NetworkProcess::NetworkProcess):
3349
3350 2019-01-15  Alex Christensen  <achristensen@webkit.org>
3351
3352         Fix WinCairo build after r240014
3353         https://bugs.webkit.org/show_bug.cgi?id=161106
3354
3355         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
3356
3357 2019-01-15  Ryosuke Niwa  <rniwa@webkit.org>
3358
3359         VisualViewport API should be updated upon opening of keyboard
3360         https://bugs.webkit.org/show_bug.cgi?id=193475
3361
3362         Reviewed by Simon Fraser.
3363
3364         The bug was caused by the changes to unobscuredContentRectRespectingInputViewBounds not updating the visual viewport
3365         unless it caused a layout to happen. Added a code to update the visual viewport in WebPage::updateVisibleContentRects.
3366
3367         Also fixed the bug that VisibleContentRectUpdateInfo::operator== was not checking differences in
3368         unobscuredContentRectRespectingInputViewBounds which resulted in the visual viewport override not getting updated
3369         while the keyboard is getting brought up.
3370
3371         * Shared/VisibleContentRectUpdateInfo.h:
3372         (WebKit::operator==):
3373         * WebProcess/WebPage/ios/WebPageIOS.mm:
3374         (WebKit::WebPage::updateVisibleContentRects):
3375
3376 2019-01-15  Megan Gardner  <megan_gardner@apple.com>
3377
3378         Add Reveal support in iOSMac
3379         https://bugs.webkit.org/show_bug.cgi?id=193408
3380         <rdar://problem/47300699>
3381
3382         Reviewed by Tim Horton.
3383
3384         Add calls to DictionaryLookup from the appropriate places.
3385
3386         * UIProcess/PageClient.h:
3387         * UIProcess/ios/PageClientImplIOS.h:
3388         * UIProcess/ios/PageClientImplIOS.mm:
3389         (WebKit::PageClientImpl::didPerformDictionaryLookup):
3390         * UIProcess/ios/WebPageProxyIOS.mm:
3391         (WebKit::WebPageProxy::didPerformDictionaryLookup):
3392         * WebProcess/WebPage/Cocoa/WebPageCo