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