Update 'Save Image' to more clear instructions
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2019-04-11  Megan Gardner  <megan_gardner@apple.com>
2
3         Update 'Save Image' to more clear instructions
4         https://bugs.webkit.org/show_bug.cgi?id=196833
5         <rdar://problem/47446845>
6
7         Reviewed by Wenson Hsieh.
8
9         Just updating to a new string.
10
11         * UIProcess/API/Cocoa/_WKElementAction.mm:
12         (+[_WKElementAction _elementActionWithType:customTitle:assistant:]):
13
14 2019-04-11  Chris Dumez  <cdumez@apple.com>
15
16         Unable to run system Safari with trunk WebKit
17         https://bugs.webkit.org/show_bug.cgi?id=196777
18         <rdar://problem/49784574>
19
20         Reviewed by Alex Christensen.
21
22         * UIProcess/API/Cocoa/WKWebView.mm:
23         (-[WKWebView _initializeWithConfiguration:]):
24         Add a linkedOnAfter check so that throwing exceptions when related web views use a different
25         data store only happens for apps rebuilt using recent SDK.
26
27         * UIProcess/Cocoa/VersionChecks.h:
28         * UIProcess/Cocoa/VersionChecks.mm:
29         (WebKit::linkedOnOrAfter):
30         - By default, linkedOnOrAfter assumed Safari / MobileSafari is always linked-on-after. To satisfy my
31           use cases, I introduced a new AssumeSafariIsAlwaysLinkedOnAfter parameter so that this behavior can
32           be controlled by the caller.
33         - In the header, DYLD_IOS_VERSION_* / DYLD_MACOS_VERSION_* constants are 0 when building with the
34           non-internal SDK. As a result, the check instead linkedOnOrAfter() would cause us to always return
35           true, which was wrong. I therefore updated the check inside linkedOnOrAfter() to special-case the
36           0 value for sdkVersion.
37
38 2019-04-11  Zalan Bujtas  <zalan@apple.com>
39
40         Add @page margin support
41         https://bugs.webkit.org/show_bug.cgi?id=196680
42         <rdar://problem/45217707>
43
44         Reviewed by Tim Horton.
45
46         * Shared/PrintInfo.cpp:
47         (WebKit::PrintInfo::encode const):
48         (WebKit::PrintInfo::decode):
49         * Shared/PrintInfo.h:
50         * Shared/WebPreferences.yaml:
51         * Shared/gtk/PrintInfoGtk.cpp:
52         (WebKit::PrintInfo::PrintInfo):
53         * Shared/mac/PrintInfoMac.mm:
54         (WebKit::PrintInfo::PrintInfo):
55         * UIProcess/API/C/WKPage.cpp:
56         (WKPageComputePagesForPrinting):
57         * UIProcess/API/C/WKPreferences.cpp:
58         (WKPreferencesSetPageAtRuleSupportEnabled):
59         (WKPreferencesGetPageAtRuleSupportEnabled):
60         * UIProcess/API/C/WKPreferencesRefPrivate.h:
61         * UIProcess/GenericCallback.h:
62         * UIProcess/WebPageProxy.cpp:
63         (WebKit::WebPageProxy::computedPagesCallback):
64         * UIProcess/WebPageProxy.h:
65         * UIProcess/WebPageProxy.messages.in:
66         * UIProcess/mac/WKPrintingView.mm:
67         (pageDidComputePageRects):
68         (-[WKPrintingView _askPageToComputePageRects]):
69         * WebProcess/WebPage/WebPage.cpp:
70         (WebKit::WebPage::beginPrinting):
71         (WebKit::WebPage::computePagesForPrinting):
72         (WebKit::WebPage::computePagesForPrintingImpl):
73         * WebProcess/WebPage/WebPage.h:
74         * WebProcess/WebPage/ios/WebPageIOS.mm:
75         (WebKit::WebPage::computePagesForPrintingAndDrawToPDF):
76
77 2019-04-11  Dean Jackson  <dino@apple.com>
78
79         Extract UTI mapping and allow for additions
80         https://bugs.webkit.org/show_bug.cgi?id=196822
81         <rdar://problem/49822339>
82
83         Reviewed by Tim Horton.
84
85         Use the new helper to map MIME type to UTI.
86
87         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
88         (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
89         * UIProcess/ios/WKSystemPreviewView.mm:
90         (getUTIForSystemPreviewMIMEType):
91
92
93 2019-04-11  Said Abou-Hallawa  <sabouhallawa@apple.com>
94
95         REGRESSION (r244182): RemoteLayerTreeDrawingArea::flushLayers() should not be reentrant
96         https://bugs.webkit.org/show_bug.cgi?id=196825
97
98         Reviewed by Simon Fraser.
99
100         Ensure the layer transactions IDs are sequential. So bail out of
101         RemoteLayerTreeDrawingArea::flushLayers() if reentrancy is detected.
102
103         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
104         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
105         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
106
107 2019-04-11  Wenson Hsieh  <wenson_hsieh@apple.com>
108
109         Allow the MediaSource API to be enabled via website policy
110         https://bugs.webkit.org/show_bug.cgi?id=196429
111         <rdar://problem/48774333>
112
113         Reviewed by Tim Horton.
114
115         Adds support for using WebsitePolicies to determine whether to enable the MediaSource API.
116
117         * Shared/WebPreferences.yaml:
118
119         Disengage the mediaSourceEnabled internal preference from the corresponding WebCore setting; to ensure that
120         setting the preference to `true` still results in enabling the MediaSource API, we instead make it such that
121         turning on mediaSourceEnabled causes WebsitePolicies to set its WebsiteMediaSourcePolicy to Enable.
122
123         In the future, we should deprecate and remove this preference, in favor of simply setting preferred
124         compatibility mode on WKWebpagePreferences.
125
126         * Shared/WebPreferences.yaml:
127         * Shared/WebsiteMediaSourcePolicy.h: Copied from Source/WebKit/Shared/WebsitePoliciesData.h.
128         * Shared/WebsitePoliciesData.cpp:
129         (WebKit::WebsitePoliciesData::encode const):
130         (WebKit::WebsitePoliciesData::decode):
131
132         Add plumbing for m_mediaSourcePolicy in the set of website policies.
133
134         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
135
136         Update the document loader with the given media source policy. There are two possibilities when applying the set
137         of policies to the document loader; either the document loader is already attached to a Frame, or the document
138         loader is yet to be attached to a Frame.
139
140         In the first case, we update Frame's settings on the spot, by calling the new applyPoliciesToSettings helper
141         method. In the second scenario, we stash the policy state on DocumentLoader; when the DocumentLoader is attached
142         to a Frame, we'll then update the Frame's settings using DocumentLoader's policy.
143
144         * Shared/WebsitePoliciesData.h:
145         * UIProcess/API/APIWebsitePolicies.cpp:
146         (API::WebsitePolicies::data):
147         * UIProcess/API/APIWebsitePolicies.h:
148         * UIProcess/API/C/WKPage.cpp:
149         (WKPageSetPageNavigationClient):
150         * UIProcess/Cocoa/NavigationState.mm:
151         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
152
153         Move code that adjusts website policies after deciding policies for the navigation action from NavigationClient
154         ::decidePolicyForNavigationAction to the completion handler of the policy listener. This allows us to respect
155         default website policies on the web view configuration, even when using the C API to set the navigation client,
156         and also allows us to have a single call site for adjustPoliciesForCompatibilityMode. This also enables our
157         layout tests to opt into modern compatibility mode by default, when specifying modern compatibility mode on
158         webpage preferences.
159
160         * UIProcess/WebPageProxy.cpp:
161         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
162         (WebKit::WebPageProxy::adjustPoliciesForCompatibilityMode):
163         * UIProcess/WebPageProxy.h:
164         * WebKit.xcodeproj/project.pbxproj:
165
166 2019-04-11  Antti Koivisto  <antti@apple.com>
167
168         REGRESSION: changing iPad orientation on blogger.com crashes under RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations()
169         https://bugs.webkit.org/show_bug.cgi?id=196813
170         <rdar://problem/49393264>
171
172         Reviewed by Simon Fraser.
173
174         No test, can't repro.
175
176         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
177         (WebKit::RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations):
178
179         Null check the nodes.
180
181 2019-04-10  Chris Dumez  <cdumez@apple.com>
182
183         Regression(r244144) ProcessSwap.ReuseSuspendedProcessLoadHTMLString API test is flaky
184         https://bugs.webkit.org/show_bug.cgi?id=196784
185
186         Reviewed by Antti Koivisto.
187
188         When we enter accelerated compositing mode in the new process, we supposed to *close* the last
189         SuspendedPageProxy, not destroy it. This was causing flakiness in the test because it was testing
190         that we were using the SuspendedPageProxy's process for a cross-site link navigation, which is
191         an optimization. This optimization was partly broken by r244144 as the SuspendedPageProxy would
192         not sometimes be gone by the time we need it.
193
194         * UIProcess/SuspendedPageProxy.cpp:
195         (WebKit::SuspendedPageProxy::pageEnteredAcceleratedCompositingMode):
196
197 2019-04-10  Alex Christensen  <achristensen@webkit.org>
198
199         WKNavigationResponse._downloadAttribute should be nil when no download attribute is present
200         https://bugs.webkit.org/show_bug.cgi?id=196809
201         <rdar://49800762>
202
203         Reviewed by Brady Eidson.
204
205         * UIProcess/API/Cocoa/WKNavigationResponse.mm:
206         (-[WKNavigationResponse _downloadAttribute]):
207
208 2019-04-10  Tim Horton  <timothy_horton@apple.com>
209
210         REGRESSION (r241734): ⌥⌘↑ and ⌥⌘↓ no longer navigate to previous/next Reading List article
211         https://bugs.webkit.org/show_bug.cgi?id=196797
212         <rdar://problem/48484715>
213
214         Reviewed by Simon Fraser.
215
216         * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
217         (-[WKKeyboardScrollingAnimator keyboardScrollForEvent:]):
218         Validate the set of modifier keys pressed when handling a key event for scrolling:
219         Ignore key events with multiple modifier keys pressed.
220         Ignore key events with an invalid modifier key pressed for a given primary key.
221
222 2019-04-10  Said Abou-Hallawa  <sabouhallawa@apple.com>
223
224         requestAnimationFrame should execute before the next frame
225         https://bugs.webkit.org/show_bug.cgi?id=177484
226
227         Reviewed by Simon Fraser.
228
229         Replace the calls to Page::layoutIfNeeded() and willDisplayPage() by
230         a single call to Page::updateRendering(). This new function implements 
231         "Update the rendering" step of the HTML Event Loop specification
232         <https://html.spec.whatwg.org/multipage/webappapis.html#update-the-rendering>.
233
234         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
235         (WebKit::DrawingAreaCoordinatedGraphics::scheduleCompositingLayerFlush):
236         (WebKit::DrawingAreaCoordinatedGraphics::updateBackingStoreState):
237         (WebKit::DrawingAreaCoordinatedGraphics::display):
238         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
239         (WebKit::LayerTreeHost::layerFlushTimerFired):
240
241         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
242         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
243         -- Call Page::updateRendering() to make sure that "Update the rendering"
244            happens immediately before updating the page.
245
246         -- Move the call to RemoteLayerBackingStoreCollection::willFlushLayers()
247            to be exactly before flushing the layers. This fixes the assertion
248            ASSERT(m_inLayerFlush) which was firing when running a layout test.
249            RemoteLayerTreeDrawingArea::flushLayers() now can call itself through
250            TestRunner::notifyDone(). flushLayers() was calling willFlushLayers()
251            twice before calling didFlushLayers().
252
253         * WebProcess/WebPage/WebPage.cpp:
254         (WebKit::WebPage::layoutIfNeeded):
255         (WebKit::WebPage::updateRendering):
256         (WebKit::WebPage::willDisplayPage): Deleted.
257         * WebProcess/WebPage/WebPage.h:
258         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
259         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
260
261 2019-04-10  Devin Rousso  <drousso@apple.com>
262
263         Web Inspector: save sheet should be anchored underneath the tab bar when detached
264         https://bugs.webkit.org/show_bug.cgi?id=196722
265         <rdar://problem/49613280>
266
267         Reviewed by Timothy Hatcher.
268
269         * WebProcess/WebPage/WebInspectorUI.h:
270         * WebProcess/WebPage/WebInspectorUI.cpp:
271         (WebKit::WebInspectorUI::changeSheetRect): Added.
272         * UIProcess/WebInspectorProxy.messages.in:
273         * UIProcess/WebInspectorProxy.h:
274         (WebKit::WebInspectorProxy::sheetRect const): Added.
275         * UIProcess/WebInspectorProxy.cpp:
276         (WebKit::WebInspectorProxy::setSheetRect): Added.
277         (WebKit::WebInspectorProxy::platformSetSheetRect): Added.
278         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
279         (WebKit::WebInspectorProxy::platformSetSheetRect): Added.
280         * UIProcess/mac/WebInspectorProxyMac.mm:
281         (-[WKWebInspectorProxyObjCAdapter window:willPositionSheet:usingRect:]): Added.
282         (WebKit::WebInspectorProxy::platformSetSheetRect): Added.
283         * UIProcess/win/WebInspectorProxyWin.cpp:
284         (WebKit::WebInspectorProxy::platformSetSheetRect): Added.
285         * UIProcess/wpe/WebInspectorProxyWPE.cpp:
286         (WebKit::WebInspectorProxy::platformSetSheetRect): Added.
287
288         * WebProcess/WebPage/RemoteWebInspectorUI.h:
289         * WebProcess/WebPage/RemoteWebInspectorUI.cpp:
290         (WebKit::RemoteWebInspectorUI::changeSheetRect): Added.
291         * UIProcess/RemoteWebInspectorProxy.messages.in:
292         * UIProcess/RemoteWebInspectorProxy.h:
293         (WebKit::RemoteWebInspectorProxy::sheetRect const): Added.
294         * UIProcess/RemoteWebInspectorProxy.cpp:
295         (WebKit::RemoteWebInspectorProxy::setSheetRect): Added.
296         (WebKit::RemoteWebInspectorProxy::platformSetSheetRect): Added.
297         * UIProcess/gtk/RemoteWebInspectorProxyGtk.cpp:
298         (WebKit::RemoteWebInspectorProxy::platformSetSheetRect): Added.
299         * UIProcess/mac/RemoteWebInspectorProxyMac.mm:
300         (-[WKRemoteWebInspectorProxyObjCAdapter window:willPositionSheet:usingRect:]): Added.
301         (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
302         (WebKit::RemoteWebInspectorProxy::platformSetSheetRect): Added.
303
304 2019-04-10  Andy Estes  <aestes@apple.com>
305
306         [iOS] Let PDFHostViewController specify the background color to use for WKPDFView
307         https://bugs.webkit.org/show_bug.cgi?id=196785
308         <rdar://problem/48240051>
309
310         Reviewed by Tim Horton.
311
312         * UIProcess/ios/WKPDFView.mm:
313         (-[WKPDFView web_initWithFrame:webView:mimeType:]):
314
315 2019-04-10  Chris Dumez  <cdumez@apple.com>
316
317         Unreviewed, rolling out r244146.
318
319         Caused a few DeviceOrientation API test failures on iOS
320
321         Reverted changeset:
322
323         "Unable to run system Safari with trunk WebKit"
324         https://bugs.webkit.org/show_bug.cgi?id=196777
325         https://trac.webkit.org/changeset/244146
326
327 2019-04-10  Devin Rousso  <drousso@apple.com>
328
329         Web Inspector: REGRESSION: lazy agents used outside of frontend/instrumentation can be accessed before being created
330         https://bugs.webkit.org/show_bug.cgi?id=196725
331         <rdar://problem/49669810>
332
333         Reviewed by Timothy Hatcher.
334
335         * WebProcess/WebPage/WebInspector.cpp:
336         (WebKit::WebInspector::showMainResourceForFrame):
337
338 2019-04-10  Youenn Fablet  <youenn@apple.com>
339
340         Clear Cache Storage structures before removing all related files
341         https://bugs.webkit.org/show_bug.cgi?id=196650
342
343         Reviewed by Alex Christensen.
344
345         Previously, we were clearing files in parallel to clearing the internal CacheStorage structures.
346         To make things more deterministic, clear files/folders directly
347         after CachesStorage structures have finished being cleared.
348
349         * NetworkProcess/cache/CacheStorageEngine.cpp:
350         (WebKit::CacheStorage::Engine::clearAllCaches):
351         (WebKit::CacheStorage::Engine::clearCachesForOrigin):
352
353 2019-04-10  Alex Christensen  <achristensen@webkit.org>
354
355         Add SPI WKNavigationResponse._downloadAttribute
356         https://bugs.webkit.org/show_bug.cgi?id=196755
357         <rdar://49587365>
358
359         Reviewed by Brady Eidson.
360
361         * UIProcess/API/APINavigationResponse.h:
362         * UIProcess/API/Cocoa/WKNavigationResponse.mm:
363         (-[WKNavigationResponse _downloadAttribute]):
364         * UIProcess/API/Cocoa/WKNavigationResponsePrivate.h:
365         * UIProcess/ProvisionalPageProxy.cpp:
366         (WebKit::ProvisionalPageProxy::decidePolicyForResponse):
367         * UIProcess/ProvisionalPageProxy.h:
368         * UIProcess/WebPageProxy.cpp:
369         (WebKit::WebPageProxy::decidePolicyForResponse):
370         (WebKit::WebPageProxy::decidePolicyForResponseShared):
371         * UIProcess/WebPageProxy.h:
372         * UIProcess/WebPageProxy.messages.in:
373         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
374         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
375         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
376
377 2019-04-10  Youenn Fablet  <youenn@apple.com>
378
379         SWClientConnection should not double hop to fire some events
380         https://bugs.webkit.org/show_bug.cgi?id=196735
381
382         Reviewed by Alex Christensen.
383
384         Removed unnecessary method.
385
386         * WebProcess/Storage/WebSWClientConnection.cpp:
387         * WebProcess/Storage/WebSWClientConnection.h:
388
389 2019-04-10  Per Arne Vollan  <pvollan@apple.com>
390
391         [iOS] Fix iokit-get-properties sandbox violations
392         https://bugs.webkit.org/show_bug.cgi?id=196782
393         <rdar://problem/49497720>
394
395         Reviewed by Brent Fulgham.
396
397         Add iokit properties to the WebContent sandbox on iOS.
398
399         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
400
401 2019-04-10  Tim Horton  <timothy_horton@apple.com>
402
403         Add modern API for overriding the page's specified viewport configuration
404         https://bugs.webkit.org/show_bug.cgi?id=167734
405         <rdar://problem/30331795>
406
407         Reviewed by Simon Fraser.
408
409         * Shared/WebPageCreationParameters.cpp:
410         (WebKit::WebPageCreationParameters::encode const):
411         (WebKit::WebPageCreationParameters::decode):
412         * Shared/WebPageCreationParameters.h:
413         Plumb overrideViewportArguments in WebPageCreationParameters, so that
414         if the process crashes (or swaps) they are maintained.
415
416         * UIProcess/API/Cocoa/WKWebView.mm:
417         (viewportArgumentsFromDictionary):
418         (-[WKWebView _overrideViewportWithArguments:]):
419         Add SPI to set override viewport arguments. Parse them into a ViewportArguments
420         object and use the existing (now improved) overrideViewportArguments mechanism
421         to take over the page's viewport arguments.
422
423         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
424         * UIProcess/WebPageProxy.cpp:
425         (WebKit::WebPageProxy::creationParameters):
426         * UIProcess/WebPageProxy.h:
427         * UIProcess/ios/WebPageProxyIOS.mm:
428         (WebKit::WebPageProxy::setOverrideViewportArguments):
429         * WebProcess/WebPage/WebPage.cpp:
430         Plumb overrideViewportArguments around more.
431
432 2019-04-10  Jiewen Tan  <jiewen_tan@apple.com>
433
434         Add runJavaScriptInFrame for WebPageProxy/WebPage
435         https://bugs.webkit.org/show_bug.cgi?id=196750
436         <rdar://problem/49755738>
437
438         Reviewed by Youenn Fablet.
439
440         Tests of the new method will be covered by the internal counterpart.
441
442         * UIProcess/WebFrameProxy.cpp:
443         (WebKit::WebFrameProxy::loadData):
444         * UIProcess/WebFrameProxy.h:
445         Add a comment.
446         * UIProcess/WebPageProxy.cpp:
447         (WebKit::WebPageProxy::runJavaScriptInMainFrame):
448         (WebKit::WebPageProxy::runJavaScriptInMainFrameScriptWorld):
449         Merge the above two runJavaScriptInMainFrame*.
450         (WebKit::WebPageProxy::runJavaScriptInFrame):
451         * UIProcess/WebPageProxy.h:
452         * WebProcess/WebPage/WebPage.cpp:
453         (WebKit::WebPage::loadDataInFrame):
454         Add an assertion.
455         (WebKit::WebPage::runJavaScript):
456         (WebKit::WebPage::runJavaScriptInMainFrameScriptWorld):
457         (WebKit::WebPage::runJavaScriptInFrame):
458         (WebKit::WebPage::runJavaScriptInMainFrame): Deleted.
459         * WebProcess/WebPage/WebPage.h:
460         * WebProcess/WebPage/WebPage.messages.in:
461
462 2019-04-10  Chris Dumez  <cdumez@apple.com>
463
464         Unable to run system Safari with trunk WebKit
465         https://bugs.webkit.org/show_bug.cgi?id=196777
466         <rdar://problem/49784574>
467
468         Reviewed by Alex Christensen.
469
470         * UIProcess/API/Cocoa/WKWebView.mm:
471         (-[WKWebView _initializeWithConfiguration:]):
472         Add a linkedOnAfter check so that throwing exceptions when related web views use a different
473         data store only happens for apps rebuilt using recent SDK.
474
475         * UIProcess/Cocoa/VersionChecks.h:
476         * UIProcess/Cocoa/VersionChecks.mm:
477         (WebKit::linkedOnOrAfter):
478         - By default, linkedOnOrAfter assumed Safari / MobileSafari is always linked-on-after. To satisfy my
479           use cases, I introduced a new AssumeSafariIsAlwaysLinkedOnAfter parameter so that this behavior can
480           be controlled by the caller.
481         - In the header, DYLD_IOS_VERSION_* / DYLD_MACOS_VERSION_* constants are 0 when building with the
482           non-internal SDK. As a result, the check instead linkedOnOrAfter() would cause us to always return
483           true, which was wrong. I therefore updated the check inside linkedOnOrAfter() to special-case the
484           0 value for sdkVersion.
485
486 2019-04-10  Chris Dumez  <cdumez@apple.com>
487
488         Regression(r240562) Audio sometimes keeps playing in previous process after a process-swap
489         https://bugs.webkit.org/show_bug.cgi?id=196774
490         <rdar://problem/49460572>
491
492         Reviewed by Alex Christensen.
493
494         r240562 added logic to prevent flashing on navigation. When we receive the DidFailToSuspendAfterProcessSwap
495         IPC from the previous process, we would delay closing the WebPage in that process until EnterAcceleratedCompositingMode
496         IPC is received from the new process. The issue is that this was racy as we would receive the EnterAcceleratedCompositingMode
497         IPC from the new process *before* receiving the DidFailToSuspendAfterProcessSwap IPC from the previous process, which which
498         case we would fail to close the WebPage and audio could keep playing.
499
500         To address the issue, the WebPageProxy keeps track of its last suspended page and notifies it whenever it receives the
501         EnterAcceleratedCompositingMode IPC. If the suspended page already received the DidFailToSuspendAfterProcessSwap IPC, it
502         will close the page. Otherwise, it will set a boolean data member indicating that we should not delay page closing when
503         the DidFailToSuspendAfterProcessSwap is eventually received.
504
505         * UIProcess/SuspendedPageProxy.cpp:
506         (WebKit::SuspendedPageProxy::SuspendedPageProxy):
507         (WebKit::SuspendedPageProxy::pageEnteredAcceleratedCompositingMode):
508         (WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
509         * UIProcess/SuspendedPageProxy.h:
510         * UIProcess/WebPageProxy.cpp:
511         (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
512         (WebKit::WebPageProxy::enterAcceleratedCompositingMode):
513         * UIProcess/WebPageProxy.h:
514         * UIProcess/WebProcessPool.cpp:
515         * UIProcess/WebProcessPool.h:
516
517 2019-04-10  Timothy Hatcher  <timothy@apple.com>
518
519         WKScrollView background color does not match WKWebView before content is loaded.
520         https://bugs.webkit.org/show_bug.cgi?id=196745
521         rdar://problem/49750810
522
523         Reviewed by Megan Gardner.
524
525         * UIProcess/API/Cocoa/WKWebView.mm:
526         (scrollViewBackgroundColor): Default to _contentView.backgroundColor on invalid base color.
527         (-[WKWebView _processDidExit]): Reset to _contentView.backgroundColor.
528         (-[WKWebView setBackgroundColor:]): Call _updateScrollViewBackground since it can use
529         _contentView.backgroundColor and it has changed.
530
531 2019-04-10  Megan Gardner  <megan_gardner@apple.com>
532
533         Fix text autoscrolling when typing in modern webkit
534         https://bugs.webkit.org/show_bug.cgi?id=196718
535         <rdar://problem/49225507>
536
537         Reviewed by Tim Horton.
538
539         For staging only. We need to turn off UIKit's scrolling behavior to land
540         the changes we are making. To keep from the build ever breaking,
541         I am temporarily circumventing the changes in UIKit. This will be removed
542         once the next UIKit submission happens.
543
544         * UIProcess/ios/WKContentViewInteraction.mm:
545         (-[WKUIWKTextInteractionAssistant scrollSelectionToVisible]):
546         (-[WKContentView setUpTextSelectionAssistant]):
547
548 2019-04-10  Wenson Hsieh  <wenson_hsieh@apple.com>
549
550         [iOSMac] Opt into modern compatibility mode by default
551         https://bugs.webkit.org/show_bug.cgi?id=196763
552         <rdar://problem/49038732>
553
554         Reviewed by Tim Horton.
555
556         Achieve this by limiting legacy compatibility mode by default to non-iOSMac iOS only.
557
558         * Shared/WebPreferences.yaml:
559         * Shared/WebPreferencesDefaultValues.h:
560
561 2019-04-10  Alex Christensen  <achristensen@webkit.org>
562
563         RemoteObjectRegistry message receiver should be removed when WebPage::close is called instead of waiting until dealloc
564         https://bugs.webkit.org/show_bug.cgi?id=196744
565         <rdar://49415309>
566
567         Reviewed by Chris Dumez.
568
569         This is a similar problem to the one I fixed in r241306 so I piggy-backed on the same test.
570         When you do a cross site navigation but the previous page is in a suspended process then you navigate back,
571         you can get two WebPage objects in the same process with the same IDs.  WebPage::close has been called
572         on the old one which is supposed to make it so all the message receivers associated with it have been removed
573         so we don't have any loss of communication, but we missed the RemoteObjectRegistry messages, which are owned
574         by the ObjC bundle object wrapping the WebPage (which can keep it alive if a strong reference to it is held).
575         To fix the assertion that happens in this case and the resulting communication breakage, teach the WebPage about
576         these messages so it can tear down the message receiver with the others it removes at close time.
577
578         * Shared/API/Cocoa/RemoteObjectRegistry.h:
579         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
580         (-[WKWebProcessPlugInBrowserContextController dealloc]):
581         (-[WKWebProcessPlugInBrowserContextController _remoteObjectRegistry]):
582         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
583         (WebKit::WebPage::addRemoteObjectRegistry):
584         * WebProcess/WebPage/WebPage.cpp:
585         (WebKit::WebPage::close):
586         * WebProcess/WebPage/WebPage.h:
587
588 2019-04-10  Chris Dumez  <cdumez@apple.com>
589
590         Unreviewed, drop SuspendedPageProxy data member that is unused after r244075.
591
592         * UIProcess/SuspendedPageProxy.h:
593
594 2019-04-10  Antoine Quint  <graouts@apple.com>
595
596         Enable Pointer Events on watchOS
597         https://bugs.webkit.org/show_bug.cgi?id=196771
598         <rdar://problem/49040909>
599
600         Reviewed by Dean Jackson.
601
602         * Configurations/FeatureDefines.xcconfig:
603
604 2019-04-10  Brady Eidson  <beidson@apple.com>
605
606         Background tabs are not fully reactivated after a link is opened from an external application.
607         <rdar://problem/49533278> and https://bugs.webkit.org/show_bug.cgi?id=196705
608
609         Reviewed by Chris Dumez.
610
611         If an app unparents a WKWebView right after activation but before the "applicationWillEnterForeground" notification
612         is dispatched, then that WKWebView is in a broken state with a frozen layer tree.
613
614         The WKApplicationStateTrackingView logic needs to be a little more resilient.
615
616         * UIProcess/ios/WKApplicationStateTrackingView.mm:
617         (-[WKApplicationStateTrackingView willMoveToWindow:]): When clearing the window, remember the current background state.
618         (-[WKApplicationStateTrackingView didMoveToWindow]): If our last observed background state doesn't match the current
619           background state then fake the relevant notification.
620         (-[WKApplicationStateTrackingView _applicationDidEnterBackground]): Remember that we've observed a backgrounding.
621         (-[WKApplicationStateTrackingView _applicationWillEnterForeground]): Remember that we've observed a foregrounding.
622
623 2019-04-10  Diego Pino Garcia  <dpino@igalia.com>
624
625         Unreviewed, build fix for r244097
626
627         * NetworkProcess/NetworkProcess.cpp:
628         (WebKit::NetworkProcess::actualPrepareToSuspend):
629         (WebKit::NetworkProcess::resume):
630         Added guards for ENABLE(SERVICE_WORKER)
631
632 2019-04-09  Keith Rollin  <krollin@apple.com>
633
634         Unreviewed build maintenance -- update .xcfilelists.
635
636         * DerivedSources-input.xcfilelist:
637         * DerivedSources-output.xcfilelist:
638
639 2019-04-09  Zalan Bujtas  <zalan@apple.com>
640
641         [AutoSizing] Avoid making text paragraphs scroll horizontally when there is a wide table
642         https://bugs.webkit.org/show_bug.cgi?id=196743
643         <rdar://problem/43897551>
644
645         Reviewed by Tim Horton.
646
647         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
648         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
649         * WebProcess/WebPage/WebPage.cpp:
650         (WebKit::WebPage::setViewLayoutSize):
651
652 2019-04-09  Youenn Fablet  <youenn@apple.com>
653
654         Close service worker database on network process suspension
655         https://bugs.webkit.org/show_bug.cgi?id=196623
656         <rdar://problem/48930869>
657
658         Reviewed by Alex Christensen.
659
660         Close service worker database when preparing to suspend.
661         On resume, push changes if any is needed.
662
663         * NetworkProcess/NetworkProcess.cpp:
664         (WebKit::NetworkProcess::actualPrepareToSuspend):
665         (WebKit::NetworkProcess::cancelPrepareToSuspend):
666         (WebKit::NetworkProcess::processDidResume):
667         * UIProcess/API/Cocoa/WKProcessPool.mm:
668         (-[WKProcessPool _sendNetworkProcessWillSuspendImminently]):
669         (-[WKProcessPool _sendNetworkProcessDidResume]):
670         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
671         * UIProcess/Network/NetworkProcessProxy.h:
672         * UIProcess/WebProcessPool.cpp:
673         (WebKit::WebProcessPool::sendNetworkProcessWillSuspendImminently):
674         (WebKit::WebProcessPool::sendNetworkProcessDidResume):
675         * UIProcess/WebProcessPool.h:
676
677 2019-04-09  Daniel Bates  <dabates@apple.com>
678
679         [iPad] Should open popover when the spacebar is pressed
680         https://bugs.webkit.org/show_bug.cgi?id=196360
681         <rdar://problem/49389129>
682
683         Reviewed by Brent Fulgham.
684
685         Pressing the spacebar should open the popover for a focused popup button (e.g. <select>) on iOS
686         just like it does on the Mac.
687
688         For now, we keep the iPhone behavior of blurring the element when the Done button is pressed and
689         hence pressing spacebar does nothing (because there is no focused element).
690
691         * UIProcess/ios/WKContentViewInteraction.h:
692         * UIProcess/ios/WKContentViewInteraction.mm:
693         (-[WKContentView accessoryOpen]): Added. Extracted the logic from -_elementDidFocus to scroll to
694         the focused element, update the accessory and then tell the accessory to begin editing.
695         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
696         Write in terms of -accessoryOpen.
697         * UIProcess/ios/forms/WKFormPeripheralBase.mm:
698         (-[WKFormPeripheralBase handleKeyEvent:]): Interpret the spacebar when the peripheral is closed (!_editing)
699         and call -accessoryOpen to ultimately call back to this peripheral to tell it to begin editing,
700         which will cause the popover to appear again.
701
702 2019-04-09  Chris Dumez  <cdumez@apple.com>
703
704         Unreviewed, fix webkitpy failure after r244085.
705
706         Use a list instead of a set for header includes so that the order is
707         maintained.
708
709         * Scripts/webkit/messages.py:
710
711 2019-04-09  Andy Estes  <aestes@apple.com>
712
713         [Apple Pay] Add release logging to PaymentCoordinator
714         https://bugs.webkit.org/show_bug.cgi?id=196738
715
716         Reviewed by Alex Christensen.
717
718         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
719         (WebKit::WebPaymentCoordinator::isAlwaysOnLoggingAllowed const):
720         * WebProcess/ApplePay/WebPaymentCoordinator.h:
721
722 2019-04-09  Jer Noble  <jer.noble@apple.com>
723
724         [Cocoa] Awaken UIProcess if WebContent process is awakened from suspensions unexpectedly.
725         https://bugs.webkit.org/show_bug.cgi?id=196659
726
727         Reviewed by Chris Dumez.
728
729         * Platform/IPC/Connection.h:
730         (IPC::Connection::sendWithAsyncReply):
731         * Platform/spi/ios/AssertionServicesSPI.h:
732         * Shared/Cocoa/ProcessTaskStateObserver.h: Added.
733         (WebKit::ProcessTaskStateObserver::setClient):
734         (WebKit::ProcessTaskStateObserver::client):
735         (WebKit::ProcessTaskStateObserver::taskState const):
736         * Shared/Cocoa/ProcessTaskStateObserver.mm: Added.
737         (-[WKProcessTaskStateObserverDelegate process:taskStateDidChange:]):
738         (WebKit::toProcessTaskStateObserverTaskState):
739         (WebKit::ProcessTaskStateObserver::ProcessTaskStateObserver):
740         (WebKit::ProcessTaskStateObserver::~ProcessTaskStateObserver):
741         (WebKit::ProcessTaskStateObserver::setTaskState):
742         * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
743         (WebKit::WebProcessProxy::processWasUnexpectedlyUnsuspended):
744         * UIProcess/ProcessAssertion.h:
745         * UIProcess/ProcessThrottler.cpp:
746         (WebKit::ProcessThrottler::updateAssertion):
747         * UIProcess/ProcessThrottler.h:
748         (WebKit::ProcessThrottler::shouldBeRunnable const):
749         * UIProcess/WebProcessProxy.h:
750         * UIProcess/WebProcessProxy.messages.in:
751         * UIProcess/ios/ProcessAssertionIOS.mm:
752         (WebKit::reasonForState):
753         (WebKit::toBKSProcessAssertionReason):
754         (WebKit::ProcessAssertion::ProcessAssertion):
755         * WebKit.xcodeproj/project.pbxproj:
756         * WebProcess/WebProcess.cpp:
757         (WebKit::WebProcess::actualPrepareToSuspend):
758         (WebKit::WebProcess::cancelPrepareToSuspend):
759         (WebKit::WebProcess::processDidResume):
760         * WebProcess/WebProcess.h:
761         * WebProcess/cocoa/WebProcessCocoa.mm:
762         (WebKit::WebProcess::processTaskStateDidChange):
763
764 2019-04-09  Alex Christensen  <achristensen@webkit.org>
765
766         Clicking "Go Back" from a safe browsing warning from an iframe should navigate the WKWebView back to the previous page
767         https://bugs.webkit.org/show_bug.cgi?id=196665
768         <rdar://45115669>
769
770         Reviewed by Geoff Garen.
771
772         It is insufficient to just not navigate the subframe.  We must leave the page that contained it.
773
774         * UIProcess/API/Cocoa/WKWebView.mm:
775         (-[WKWebView _showSafeBrowsingWarning:completionHandler:]):
776         * UIProcess/Cocoa/WebViewImpl.mm:
777         (WebKit::WebViewImpl::showSafeBrowsingWarning):
778
779 2019-04-09  John Wilander  <wilander@apple.com>
780
781         Pick up Ad Click Attribution conversions in NetworkResourceLoader::willSendRedirectedRequest()
782         https://bugs.webkit.org/show_bug.cgi?id=196558
783         <rdar://problem/47650245>
784
785         Reviewed by Youenn Fablet.
786
787         So called pixel requests have traditionally been used to send ad click
788         attribution data to click sources. The privacy implications of such
789         pixel requests are severe which is in part why browsers have started to
790         block cookies from being sent in such third-party requests.
791
792         To allow for a smooth transition to more privacy-friendly ad click
793         attribution, we should allow servers to make a redirect to
794         https://click-source.example/.well-known/ad-click-attribution/ to
795         trigger a so called conversion.
796
797         This patch checks for the well-known location in the path component of
798         the redirect URL. If the request indeed goes to the well-known location,
799         we parse the conversion data and send it to the storage in the network
800         session.
801
802         * NetworkProcess/NetworkAdClickAttribution.cpp:
803         (WebKit::NetworkAdClickAttribution::convert):
804             Reporting function.
805         * NetworkProcess/NetworkAdClickAttribution.h:
806         * NetworkProcess/NetworkResourceLoader.cpp:
807         (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
808             Now checks for the well-known location through a call to
809             WebCore::AdClickAttribution::parseConversionRequest().
810         * NetworkProcess/NetworkSession.cpp:
811         (WebKit::NetworkSession::convertAdClickAttribution):
812             Piping to WebKit::NetworkAdClickAttribution::convert().
813         * NetworkProcess/NetworkSession.h:
814
815 2019-04-09  Chris Dumez  <cdumez@apple.com>
816
817         [iOS] WebContent processes should be marked as "Foreground Running" when their view is visible
818         https://bugs.webkit.org/show_bug.cgi?id=196695
819         <rdar://problem/48073787>
820
821         Reviewed by Tim Horton.
822
823         In order for WebContent processes to get marked as "Foreground Running" when their view
824         is visible on iOS, we now construct a _UILayerHostView in the UIProcess and add it as
825         a subview of the WKContentView. The _UILayerHostView's visibility target is the
826         WebContent process currently associated with the view.
827
828         * Platform/spi/ios/UIKitSPI.h:
829         * UIProcess/PageClient.h:
830         (WebKit::PageClient::didCreateContextForVisibilityPropagation):
831         * UIProcess/WebPageProxy.h:
832         * UIProcess/WebProcessProxy.h:
833         (WebKit::WebProcessProxy::contextIDForVisibilityPropagation):
834         * UIProcess/WebProcessProxy.messages.in:
835         * UIProcess/ios/PageClientImplIOS.h:
836         * UIProcess/ios/PageClientImplIOS.mm:
837         (WebKit::PageClientImpl::didCreateContextForVisibilityPropagation):
838         * UIProcess/ios/WKContentView.h:
839         * UIProcess/ios/WKContentView.mm:
840         (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
841         (-[WKContentView _setupVisibilityPropagationView]):
842         (-[WKContentView _processDidExit]):
843         (-[WKContentView _didRelaunchProcess]):
844         (-[WKContentView _processDidCreateContextForVisibilityPropagation]):
845         * UIProcess/ios/WebPageProxyIOS.mm:
846         (WebKit::WebPageProxy::didCreateContextForVisibilityPropagation):
847         * UIProcess/ios/WebProcessProxyIOS.mm:
848         (WebKit::WebProcessProxy::didCreateContextForVisibilityPropagation):
849         * WebProcess/WebProcess.h:
850         * WebProcess/cocoa/WebProcessCocoa.mm:
851         (WebKit::WebProcess::platformInitializeWebProcess):
852
853 2019-04-09  Sihui Liu  <sihui_liu@apple.com>
854
855         Remove unnecessary network process assertion for IDB close
856         https://bugs.webkit.org/show_bug.cgi?id=196693
857
858         Reviewed by Geoffrey Garen.
859
860         * NetworkProcess/NetworkProcess.cpp:
861         (WebKit::NetworkProcess::createIDBServer):
862         (WebKit::NetworkProcess::notifyHoldingLockedFiles): Deleted.
863         * NetworkProcess/NetworkProcess.h:
864         * UIProcess/Network/NetworkProcessProxy.cpp:
865         (WebKit::NetworkProcessProxy::didClose):
866         (WebKit::NetworkProcessProxy::setIsIDBDatabaseHoldingLockedFiles): Deleted.
867         * UIProcess/Network/NetworkProcessProxy.h:
868         * UIProcess/Network/NetworkProcessProxy.messages.in:
869
870 2019-04-09  Chris Dumez  <cdumez@apple.com>
871
872         Loads using loadHTMLString() cause flashing when process-swapping
873         https://bugs.webkit.org/show_bug.cgi?id=196714
874         <rdar://problem/49637354>
875
876         Reviewed by Antti Koivisto.
877
878         Our logic to decide if we should construct a SuspendedPageProxy on process-swap was assuming
879         a SuspendedPageProxy is only useful for PageCache and would therefore not create one if PageCache
880         is disabled or if there is no associated WebBackForwardListItem. However, constructing a
881         SuspendedPageProxy is also useful to prevent flashing when process-swapping as we need to keep
882         displaying the layer of the previous process until there is something meaningful to show in the
883         new process.
884
885         This patch makes it so that we now construct a SuspendedPageProxy on process-swap, even if
886         PageCache is disabled or if there is no associated WebBackForwardListItem. The process in
887         question will not be useful for PageCache but it will avoid flashing. The SuspendedPageProxy's
888         process may also get used for future navigations to the same site (as demonstrated by the
889         API test) which is beneficial for performance.
890
891         * UIProcess/SuspendedPageProxy.cpp:
892         (WebKit::SuspendedPageProxy::SuspendedPageProxy):
893         * UIProcess/SuspendedPageProxy.h:
894         * UIProcess/WebPageProxy.cpp:
895         (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
896         * UIProcess/WebProcessPool.cpp:
897         (WebKit::WebProcessPool::findReusableSuspendedPageProcess):
898
899 2019-04-08  Don Olmstead  <don.olmstead@sony.com>
900
901         [CMake][WinCairo] Separate copied headers into different directories
902         https://bugs.webkit.org/show_bug.cgi?id=196655
903
904         Reviewed by Michael Catanzaro.
905
906         * CMakeLists.txt:
907         * PlatformWin.cmake:
908
909 2019-04-08  Wenson Hsieh  <wenson_hsieh@apple.com>
910
911         [iOS] Do not allow starting selection drags when selection views are not visible
912         https://bugs.webkit.org/show_bug.cgi?id=196686
913         <rdar://problem/49399192>
914
915         Reviewed by Tim Horton.
916
917         Currently, on iOS, it's possible to start dragging selected text in a web view even if the selection itself is
918         not visible. This can happen if the user selects some text, focuses a native text field, and then long presses
919         the previously selected text. This is because the text is still selected in the document since we don't clear
920         the selection when resigning first responder on iOS, despite the fact that the native selection view is no
921         longer present.
922
923         To fix this, we add plumbing to specify the set of allowed drag source actions when requesting drag start; this
924         set of allowed drag source actions only includes DragSourceActionSelection if the selection view can be visible
925         (i.e. the content view is first responder, and isn't suppressing text interactions). We then update WebPage's
926         allowed drag source actions with this given set of actions, while sending "dragstart" to the page.
927
928         * UIProcess/WebPageProxy.h:
929         * UIProcess/ios/WKContentViewInteraction.mm:
930         (-[WKContentView hasSelectablePositionAtPoint:]):
931         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
932
933         Only bail out of text selection in text that is already selected if the web view allows dragging text selections
934         (i.e. the web view is first responder, and is not suppressing text interactions).
935
936         (-[WKContentView _allowedDragSourceActions]):
937         (-[WKContentView _dragInteraction:itemsForAddingToSession:withTouchAtPoint:completion:]):
938         (-[WKContentView _dragInteraction:prepareForSession:completion:]):
939
940         Pass the set of allowed drag source actions when requesting a drag start or adding items to an existing session.
941
942         * UIProcess/ios/WebPageProxyIOS.mm:
943         (WebKit::WebPageProxy::requestDragStart):
944         (WebKit::WebPageProxy::requestAdditionalItemsForDragSession):
945
946         Plumb the allowed drag source actions from the UI process (WKContentView) over to the web process (WebPage).
947
948         * WebProcess/WebCoreSupport/WebDragClient.cpp:
949         (WebKit::WebDragClient::dragSourceActionMaskForPoint):
950
951         Instead of always returning Any, consult WebPage's allowed drag source actions.
952
953         * WebProcess/WebPage/WebPage.h:
954         (WebKit::WebPage::allowedDragSourceActions const):
955         * WebProcess/WebPage/WebPage.messages.in:
956         * WebProcess/WebPage/ios/WebPageIOS.mm:
957         (WebKit::WebPage::requestDragStart):
958         (WebKit::WebPage::requestAdditionalItemsForDragSession):
959
960         Set WebPage's allowed drag source actions to the given set of actions when sending a drag start to the page.
961
962 2019-04-08  Justin Fan  <justin_fan@apple.com>
963
964         [Web GPU] Fix Web GPU experimental feature on iOS
965         https://bugs.webkit.org/show_bug.cgi?id=196632
966
967         Reviewed by Myles C. Maxfield.
968
969         Add feature conditionals for iOS 11.
970         Properly make Web GPU available on iOS 11+.
971
972         * Configurations/FeatureDefines.xcconfig:
973         * Configurations/WebKitTargetConditionals.xcconfig:
974
975 2019-04-08  Alex Christensen  <achristensen@webkit.org>
976
977         Fix selector name after r243834
978         https://bugs.webkit.org/show_bug.cgi?id=196549
979
980         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
981         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
982         I forgot the colon in the setter's name.
983
984 2019-04-08  Antti Koivisto  <antti@apple.com>
985
986         Compute touch actions for touch point from remote layer tree regions
987         https://bugs.webkit.org/show_bug.cgi?id=196701
988
989         Reviewed by Simon Fraser.
990
991         Add a function for finding the right layer and getting the touch actions in UI process side.
992
993         The code is not used yet.
994
995         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h:
996         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
997         (WebKit::touchActionsForPoint):
998
999         Use the same code as overlap hit testing for collecting the candidate layers for the touch point,
1000         taking event regions into account.
1001         Return the touch actions from the deepest event sensitive layer hit.
1002
1003         (-[UIView _web_findDescendantViewAtPoint:withEvent:]):
1004
1005         Modernize.
1006
1007 2019-04-08  Brent Fulgham  <bfulgham@apple.com>
1008
1009         Make HSTS list handling more robust against unexpected content 
1010         https://bugs.webkit.org/show_bug.cgi?id=196552
1011         <rdar://problem/43403817>
1012
1013         Reviewed by Chris Dumez.
1014
1015         Crash logs indicate we sometimes encounter null key values during processing.
1016         This patch adds some debug assertions to catch this in test environments, and
1017         allows the code to skip the bad entries if encountered.
1018
1019         It also avoids calling CFDictionaryApplyFunction when the HSTS policies returned
1020         by _CFNetworkCopyHSTSPolicies is nullptr, which is a possible return value.
1021
1022         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1023         (WebKit::filterPreloadHSTSEntry):
1024         (WebKit::NetworkProcess::getHostNamesWithHSTSCache):
1025
1026 2019-04-05  Brian Burg  <bburg@apple.com>
1027
1028         Web Automation: clean up some WebAutomationSession methods to use modern async IPC
1029         https://bugs.webkit.org/show_bug.cgi?id=196168
1030
1031         Reviewed by Devin Rousso.
1032
1033         Modern WebKit IPC is capable of providing completion handlers and can track callback IDs.
1034         So, most messages between WebAutomationSession and its proxy can use this facility and stop
1035         keeping track of callback IDs manually. This makes most code easier to read on both the
1036         sender and receiver side.
1037
1038         There are two cases that could not be converted:
1039         - For evaluateJavaScript, we cannot use async IPC because WebAutomationSession expects to
1040         be able to cancel all pending replies when a page navigates away, the web process crashes,
1041         or when handling an alert.
1042         - For takeScreenshot, there is not currently support in the modern async IPC code paths for
1043         sending the result back. ShareableBitmap and friends lack a modern decoder implementation.
1044
1045         * UIProcess/Automation/WebAutomationSession.cpp:
1046         (WebKit::WebAutomationSession::resolveChildFrameHandle):
1047         (WebKit::WebAutomationSession::resolveParentFrameHandle):
1048         (WebKit::WebAutomationSession::computeElementLayout):
1049         (WebKit::WebAutomationSession::selectOptionElement):
1050         (WebKit::WebAutomationSession::getAllCookies):
1051         (WebKit::WebAutomationSession::deleteSingleCookie):
1052         (WebKit::WebAutomationSession::viewportInViewCenterPointOfElement):
1053         (WebKit::WebAutomationSession::didResolveChildFrame): Deleted.
1054         (WebKit::WebAutomationSession::didResolveParentFrame): Deleted.
1055         (WebKit::WebAutomationSession::didComputeElementLayout): Deleted.
1056         (WebKit::WebAutomationSession::didSelectOptionElement): Deleted.
1057         (WebKit::WebAutomationSession::didGetCookiesForFrame): Deleted.
1058         (WebKit::WebAutomationSession::didDeleteCookie): Deleted.
1059         * UIProcess/Automation/WebAutomationSession.h:
1060         * UIProcess/Automation/WebAutomationSession.messages.in:
1061         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
1062         (WebKit::WebAutomationSessionProxy::resolveChildFrameWithOrdinal):
1063         (WebKit::WebAutomationSessionProxy::resolveChildFrameWithNodeHandle):
1064         (WebKit::WebAutomationSessionProxy::resolveChildFrameWithName):
1065         (WebKit::WebAutomationSessionProxy::resolveParentFrame):
1066         (WebKit::WebAutomationSessionProxy::computeElementLayout):
1067         (WebKit::WebAutomationSessionProxy::selectOptionElement):
1068         (WebKit::WebAutomationSessionProxy::getCookiesForFrame):
1069         (WebKit::WebAutomationSessionProxy::deleteCookie):
1070         * WebProcess/Automation/WebAutomationSessionProxy.h:
1071         * WebProcess/Automation/WebAutomationSessionProxy.messages.in:
1072
1073 2019-04-08  Alex Christensen  <achristensen@webkit.org>
1074
1075         REGRESSION(236463) DownloadManager can call a null CompletionHandler
1076         https://bugs.webkit.org/show_bug.cgi?id=196414
1077         <rdar://problem/48389434>
1078
1079         Reviewed by Geoff Garen.
1080
1081         * NetworkProcess/NetworkResourceLoader.cpp:
1082         (WebKit::NetworkResourceLoader::convertToDownload):
1083         DownloadManager::continueDecidePendingDownloadDestination is being called when there is no completion handler.
1084         r236463 introduced an unchecked code path that can allow this to happen.
1085
1086 2019-04-07  Commit Queue  <commit-queue@webkit.org>
1087
1088         Unreviewed, rolling out r243956.
1089         https://bugs.webkit.org/show_bug.cgi?id=196688
1090
1091         Broke API Test SafeBrowsing.WKWebViewGoBackIFrame (Requested
1092         by aakashjain on #webkit).
1093
1094         Reverted changeset:
1095
1096         "Clicking "Go Back" from a safe browsing warning from an
1097         iframe should navigate the WKWebView back to the previous
1098         page"
1099         https://bugs.webkit.org/show_bug.cgi?id=196665
1100         https://trac.webkit.org/changeset/243956
1101
1102 2019-04-07  Geoffrey Garen  <ggaren@apple.com>
1103
1104         Remove stray byte added by r241131
1105         https://bugs.webkit.org/show_bug.cgi?id=196682
1106
1107         Reviewed by Alexey Proskuryakov.
1108
1109         Sublime Text thinks WKWebView.mm is binary instead of text.
1110
1111         According to online documentation and bisecting, this is because r241131
1112         introduced a stray byte (probably a null byte?) into the file.
1113
1114         I fixed this with Cmd-C Cmd-V.
1115
1116         * UIProcess/API/Cocoa/WKWebView.mm:
1117         (-[WKWebView _initializeWithConfiguration:]):
1118
1119 2019-04-06  Wenson Hsieh  <wenson_hsieh@apple.com>
1120
1121         Hide next and previous form control buttons when WKWebView is editable
1122         https://bugs.webkit.org/show_bug.cgi?id=196672
1123         <rdar://problem/35625321>
1124
1125         Reviewed by Tim Horton.
1126
1127         Adopt new UIKit SPI to hide or show next and previous controls in the form accessory view when changing
1128         editability.
1129
1130         Test: KeyboardInputTests.FormNavigationAssistantBarButtonItems
1131
1132         * Platform/spi/ios/UIKitSPI.h:
1133         * UIProcess/API/Cocoa/WKWebView.mm:
1134         (-[WKWebView _setEditable:]):
1135         * UIProcess/ios/WKContentViewInteraction.h:
1136         * UIProcess/ios/WKContentViewInteraction.mm:
1137         (-[WKContentView _updateAccessory]):
1138         (-[WKContentView _didChangeWebViewEditability]):
1139
1140 2019-04-06  Antti Koivisto  <antti@apple.com>
1141
1142         Combine event and touch action regions into a single class
1143         https://bugs.webkit.org/show_bug.cgi?id=196644
1144         <rdar://problem/49643614>
1145
1146         Reviewed by Darin Adler.
1147
1148         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
1149         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
1150         (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
1151         * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h:
1152         (WebKit::RemoteLayerTreeNode::eventRegion const):
1153         * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm:
1154         (WebKit::RemoteLayerTreeNode::setEventRegion):
1155         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
1156         (WebKit::PlatformCALayerRemote::setEventRegion):
1157         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:
1158
1159 2019-04-05  Yongjun Zhang  <yongjun_zhang@apple.com>
1160
1161         We should pass minimumEffectiveDeviceWidth to web process on new page creation.
1162         https://bugs.webkit.org/show_bug.cgi?id=196077
1163         <rdar://problem/49108202>
1164
1165         Reviewed by Chris Dumez.
1166
1167         When a new web view is created, it is possible we don't have the web content process till a load
1168         is requested. This patch stashes minimumEffectiveDeviceWidth in WebPageProxy.cpp and passes that
1169         value down to web process via WebPageCreationParameters when a new process is created, just like
1170         we did for other values like viewportConfigurationLayoutSizeScaleFactor or viewportConfigurationViewLayoutSize.
1171
1172         * Shared/WebPageCreationParameters.cpp:
1173         (WebKit::WebPageCreationParameters::encode const): Encode viewportConfigurationMinimumEffectiveDeviceWidth value.
1174         (WebKit::WebPageCreationParameters::decode): Decode viewportConfigurationMinimumEffectiveDeviceWidth value.
1175         * Shared/WebPageCreationParameters.h:
1176         * UIProcess/API/Cocoa/WKWebView.mm: Now that we stash the minimumEffectiveDeviceWidth value in WebPageProxy, we
1177             don't need the iVar in WKWebView any more.
1178         (-[WKWebView _dispatchSetViewLayoutSize:]): Use _page->minimumEffectiveDeviceWidth().
1179         (-[WKWebView _setViewScale:]): Ditto.
1180         (-[WKWebView _setMinimumEffectiveDeviceWidth:]): Ditto.
1181         (-[WKWebView _minimumEffectiveDeviceWidth]): Ditto.
1182         * UIProcess/WebPageProxy.cpp:
1183         (WebKit::WebPageProxy::creationParameters): Also add viewportConfigurationMinimumEffectiveDeviceWidth to
1184             web process creation parameter.
1185         * UIProcess/WebPageProxy.h:
1186         (WebKit::WebPageProxy::minimumEffectiveDeviceWidth const): Returns m_viewportConfigurationMinimumEffectiveDeviceWidth.
1187         * UIProcess/ios/WebPageProxyIOS.mm:
1188         (WebKit::WebPageProxy::setViewportConfigurationViewLayoutSize): Pass parameters.viewportConfigurationMinimumEffectiveDeviceWidth
1189             to web process.
1190         * WebProcess/WebPage/WebPage.cpp:
1191         (WebKit::WebPage::WebPage): Take viewportConfigurationMinimumEffectiveDeviceWidth value from the parameter and
1192             set that to viewport configuration.
1193
1194 2019-04-05  Jer Noble  <jer.noble@apple.com>
1195
1196         [Cocoa] Deactivate the audio session before the WebProcess suspends.
1197         https://bugs.webkit.org/show_bug.cgi?id=196658
1198
1199         Reviewed by Eric Carlson.
1200
1201         Notify the PlatformMediaSessionManager when the process suspends or resumes.
1202
1203         * WebProcess/WebProcess.cpp:
1204         (WebKit::WebProcess::actualPrepareToSuspend):
1205         (WebKit::WebProcess::cancelPrepareToSuspend):
1206         (WebKit::WebProcess::processDidResume):
1207
1208 2019-04-05  Sihui Liu  <sihui_liu@apple.com>
1209
1210         [iOS] Web process gets suspended while holding locked database files
1211         https://bugs.webkit.org/show_bug.cgi?id=196519
1212         <rdar://problem/49531797>
1213
1214         Reviewed by Chris Dumez.
1215
1216         * WebProcess/WebProcess.cpp:
1217         (WebKit::WebProcess::actualPrepareToSuspend):
1218
1219 2019-04-05  Alex Christensen  <achristensen@webkit.org>
1220
1221         Clicking "Go Back" from a safe browsing warning from an iframe should navigate the WKWebView back to the previous page
1222         https://bugs.webkit.org/show_bug.cgi?id=196665
1223         <rdar://45115669>
1224
1225         Reviewed by Geoff Garen.
1226
1227         It is insufficient to just not navigate the subframe.  We must leave the page that contained it.
1228
1229         * UIProcess/API/Cocoa/WKWebView.mm:
1230         (-[WKWebView _showSafeBrowsingWarning:completionHandler:]):
1231         * UIProcess/Cocoa/WebViewImpl.mm:
1232         (WebKit::WebViewImpl::showSafeBrowsingWarning):
1233
1234 2019-04-05  Alex Christensen  <achristensen@webkit.org>
1235
1236         Undeprecate WKNavigationData
1237         https://bugs.webkit.org/show_bug.cgi?id=196559
1238         <rdar://44927425>
1239
1240         Reviewed by Geoff Garen.
1241
1242         * UIProcess/API/Cocoa/WKNavigationData.h:
1243         It is used to communicate information from FrameLoaderClient::updateGlobalHistory() to the application.
1244         This use in WKBrowsingContextHistoryDelegate is definitely still deprecated, but its use in
1245         WKHistoryDelegatePrivate does not have an adequate replacement yet, so it must remain undeprecated SPI.
1246
1247 2019-04-05  Sihui Liu  <sihui_liu@apple.com>
1248
1249         [iOS] Web process gets suspended while holding locked database files
1250         https://bugs.webkit.org/show_bug.cgi?id=196519
1251         <rdar://problem/49531797>
1252
1253         Reviewed by Chris Dumez.
1254
1255         * Shared/WebSQLiteDatabaseTracker.cpp:
1256         (WebKit::WebSQLiteDatabaseTracker::~WebSQLiteDatabaseTracker):
1257         * Shared/WebSQLiteDatabaseTracker.h:
1258         * WebProcess/WebProcess.cpp:
1259         (WebKit::m_webSQLiteDatabaseTracker):
1260         (WebKit::WebProcess::actualPrepareToSuspend):
1261         (WebKit::WebProcess::processWillSuspendImminently):
1262         (WebKit::WebProcess::cancelPrepareToSuspend):
1263         (WebKit::WebProcess::processDidResume):
1264         * WebProcess/WebProcess.h:
1265
1266 2019-04-05  Commit Queue  <commit-queue@webkit.org>
1267
1268         Unreviewed, rolling out r243833.
1269         https://bugs.webkit.org/show_bug.cgi?id=196645
1270
1271         This change breaks build of WPE and GTK ports (Requested by
1272         annulen on #webkit).
1273
1274         Reverted changeset:
1275
1276         "[CMake][WTF] Mirror XCode header directories"
1277         https://bugs.webkit.org/show_bug.cgi?id=191662
1278         https://trac.webkit.org/changeset/243833
1279
1280 2019-04-05  David Kilzer  <ddkilzer@apple.com>
1281
1282         REGRESSION(r240685): Remove duplicate Headers entry for _WKInspectorWindow.h in Xcode project
1283         <https://bugs.webkit.org/show_bug.cgi?id=193951>
1284         <rdar://problem/47621366>
1285
1286         Fixes the following build warnings:
1287             Warning: Multiple build commands for output file WebKit2_WebKit.roots/BuildRecords/WebKit2_installhdrs/Root/System/Library/Frameworks/WebKit.framework/PrivateHeaders/_WKInspectorWindow.h
1288             Warning: Multiple build commands for output file WebKit2_WebKit.roots/BuildRecords/WebKit2_installapi/Root/System/Library/Frameworks/WebKit.framework/PrivateHeaders/_WKInspectorWindow.h
1289             Warning: Multiple build commands for output file WebKit2_WebKit.roots/BuildRecords/WebKit2_install/Root/System/Library/Frameworks/WebKit.framework/PrivateHeaders/_WKInspectorWindow.h
1290
1291         * WebKit.xcodeproj/project.pbxproj: Remove duplicate entry for
1292         _WKInspectorWindow.h.  In r240685, a second Headers entry was
1293         added, but the first one was never removed.
1294
1295 2019-04-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1296
1297         [ATK] Use a smart pointer for AccessibilityObject wrapper and remove GTK specific code
1298         https://bugs.webkit.org/show_bug.cgi?id=196593
1299         <rdar://problem/49599153>
1300
1301         Reviewed by Michael Catanzaro.
1302
1303         * WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.cpp:
1304         (accessibilityRootObjectWrapper): Cast wrapper() as AtkObject.
1305
1306 2019-04-04  Simon Fraser  <simon.fraser@apple.com>
1307
1308         Simple iframe scrolling test fails to get a composited scrolling frame in WebKitTestRunnerApp
1309         https://bugs.webkit.org/show_bug.cgi?id=196635
1310
1311         Reviewed by Antti Koivisto.
1312
1313         Remove WKBundleSetAsyncFrameScrollingEnabled().
1314
1315         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
1316         (WKBundleSetAsyncFrameScrollingEnabled): Deleted.
1317         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
1318
1319 2019-04-04  Simon Fraser  <simon.fraser@apple.com>
1320
1321         [iOS WK2] REGRESSION (r242687): Programmatic scroll of overflow scroll results in bad rendering
1322         https://bugs.webkit.org/show_bug.cgi?id=195584
1323
1324         Reviewed by Zalan Bujtas.
1325
1326         Push data to the scrolling tree about whether an overflow:scroll scroll was programmatic, by having
1327         RenderLayer::scrollToOffset() call into AsyncScrollingCoordinator::requestScrollPositionUpdate(),
1328         just as we do for frames.
1329
1330         AsyncScrollingCoordinator::requestScrollPositionUpdate() is generalized to take any ScrollableArea.
1331
1332         Fix an assumption in the ScrollingTree that we only care about programmatic scrolls on the root node.
1333         ScrollingTree::commitTreeState() no longer sets isHandlingProgrammaticScroll; instead,
1334         callers of ScrollingTreeScrollingNode::scrollTo() pass a ScrollType. Commit functions pass
1335         ScrollType::Programmatic when handling RequestedScrollPosition changes as necessary.
1336
1337         Programmatic scrolls need to get to the scrolling tree in the UI process so that we update
1338         the tree's notion of scroll position, and trigger actual UIScrollView scrolls (layers may have
1339         already been put in the right locations, but the UI process needs to know that a scroll happened).
1340         However, we need to prevent notifications from programmatic scrolls getting back to the
1341         web process, because this causes jumpiness. This is done via an early return in
1342         RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll().
1343
1344         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
1345         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
1346         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
1347         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateAfterChildren): Subframe nodes have
1348         a delegate, and that will take care of the requestedScrollPosition update.
1349         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
1350         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
1351         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateAfterChildren):
1352         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
1353         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):
1354
1355 2019-04-04  Ryan Haddad  <ryanhaddad@apple.com>
1356
1357         Unreviewed, rolling out r243888.
1358
1359         Introduced layout test crashes.
1360
1361         Reverted changeset:
1362
1363         "[macOS][iOS] Add filter to syscall sandbox rule"
1364         https://bugs.webkit.org/show_bug.cgi?id=196613
1365         https://trac.webkit.org/changeset/243888
1366
1367 2019-04-04  Youenn Fablet  <youenn@apple.com>
1368
1369         Pass storage quota parameters from UIProcess to NetworkProcess as part of WebsiteDataStore parameters
1370         https://bugs.webkit.org/show_bug.cgi?id=196543
1371
1372         Reviewed by Alex Christensen.
1373
1374         Renamed methods used to set cache storage quota to be storage generic
1375         since they will apply to all storage.
1376
1377         Pass quota parameters as part of WebsiteDataStoreParameters from UIProcess
1378         to NetworkProcess (start-up time and new WebsiteDataStore time).
1379
1380         Compute on UIProcess the quota for third party origins using the default rule of dividing by 10.
1381
1382         * NetworkProcess/NetworkProcess.cpp:
1383         (WebKit::NetworkProcess::initializeNetworkProcess):
1384         (WebKit::NetworkProcess::addWebsiteDataStore):
1385         (WebKit::NetworkProcess::initializeStorageQuota):
1386         (WebKit::NetworkProcess::setCacheStorageParameters):
1387         * NetworkProcess/NetworkProcess.h:
1388         * NetworkProcess/NetworkProcess.messages.in:
1389         * Shared/WebsiteDataStoreParameters.cpp:
1390         (WebKit::WebsiteDataStoreParameters::encode const):
1391         (WebKit::WebsiteDataStoreParameters::decode):
1392         * Shared/WebsiteDataStoreParameters.h:
1393         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1394         (WKWebsiteDataStoreSetPerOriginStorageQuota):
1395         (WKWebsiteDataStoreSetCacheStoragePerOriginQuota): Deleted.
1396         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
1397         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1398         (-[WKWebsiteDataStore _perOriginStorageQuota]):
1399         (-[WKWebsiteDataStore _setPerOriginStorageQuota:]):
1400         (-[WKWebsiteDataStore _cacheStoragePerOriginQuota]): Deleted.
1401         (-[WKWebsiteDataStore _setCacheStoragePerOriginQuota:]): Deleted.
1402         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
1403         * UIProcess/Network/NetworkProcessProxy.cpp:
1404         (WebKit::NetworkProcessProxy::retrieveCacheStorageParameters):
1405         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1406         (WebKit::WebsiteDataStore::parameters):
1407         * UIProcess/WebsiteData/WebsiteDataStore.h:
1408         (WebKit::WebsiteDataStore::perOriginStorageQuota const):
1409         (WebKit::WebsiteDataStore::setPerOriginStorageQuota):
1410         (WebKit::WebsiteDataStore::cacheStoragePerOriginQuota const): Deleted.
1411         (WebKit::WebsiteDataStore::setCacheStoragePerOriginQuota): Deleted.
1412         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
1413         (WebKit::WebsiteDataStoreConfiguration::copy):
1414         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
1415         (WebKit::WebsiteDataStoreConfiguration::perOriginStorageQuota):
1416         (WebKit::WebsiteDataStoreConfiguration::setPerOriginStorageQuota):
1417         (WebKit::WebsiteDataStoreConfiguration::cacheStoragePerOriginQuota): Deleted.
1418         (WebKit::WebsiteDataStoreConfiguration::setCacheStoragePerOriginQuota): Deleted.
1419
1420 2019-04-04  Wenson Hsieh  <wenson_hsieh@apple.com>
1421
1422         Changing default website policies shouldn't change default website policies in subsequent navigations
1423         https://bugs.webkit.org/show_bug.cgi?id=196562
1424         <rdar://problem/49573377>
1425
1426         Reviewed by Tim Horton.
1427
1428         Currently, changing the default WKWebpagePreferences object when deciding navigation policy causes the set of
1429         default policies to change in subsequent navigations. Among other things, this prevents clients from passing
1430         a modified version of the default website policies into the decision handler without impacting future
1431         navigations. To fix this, teach API::WebsitePolicies to make a copy of itself, and then use this to pass a copy
1432         of the default website policies to the navigation delegate when deciding navigation policies.
1433
1434         Test: DoNotAllowChangingDefaultWebpagePreferencesInDelegateMethod
1435
1436         * UIProcess/API/APIWebsitePolicies.cpp:
1437         (API::WebsitePolicies::copy const):
1438
1439         Add a helper method to copy a set of website policies.
1440
1441         * UIProcess/API/APIWebsitePolicies.h:
1442         * UIProcess/Cocoa/NavigationState.mm:
1443         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
1444
1445 2019-04-04  Michael Catanzaro  <mcatanzaro@igalia.com>
1446
1447         Unreviewed, fix -Wreturn-type warning
1448
1449         * Shared/WebsiteData/WebsiteData.cpp:
1450         (WebKit::WebsiteData::ownerProcess):
1451
1452 2019-04-04  Per Arne Vollan  <pvollan@apple.com>
1453
1454         [macOS] Fix sandbox violations
1455         https://bugs.webkit.org/show_bug.cgi?id=196616
1456         <rdar://problem/49498040>
1457
1458         Reviewed by Brent Fulgham.
1459
1460         Fix some observed sandbox violations in the WebContent process on macOS.
1461
1462         * WebProcess/com.apple.WebProcess.sb.in:
1463
1464 2019-04-04  Eric Carlson  <eric.carlson@apple.com>
1465
1466         [MediaStream] Host should be able to mute screen capture and camera/microphone independently
1467         https://bugs.webkit.org/show_bug.cgi?id=196555
1468         <rdar://problem/47303865>
1469
1470         Reviewed by Youenn Fablet.
1471
1472         * UIProcess/API/C/WKPagePrivate.h: Add kWKMediaScreenCaptureMuted.
1473
1474         * UIProcess/API/Cocoa/WKWebView.mm:
1475         (-[WKWebView _setPageMuted:]):
1476         (-[WKWebView _setMediaCaptureMuted:]): Deleted, it was unused.
1477         (-[WKWebView _muteMediaCapture]): Deleted, it was unused.
1478         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1479
1480         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1481         (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionValidRequest): Fix
1482         a log comment typo.
1483
1484         * UIProcess/WebPageProxy.cpp:
1485         (WebKit::WebPageProxy::setMediaStreamCaptureMuted): Use the new flag.
1486         (WebKit::WebPageProxy::activateMediaStreamCaptureInPage): Ditto.
1487         (WebKit::WebPageProxy::setMuted): Ditto.
1488         * UIProcess/WebPageProxy.h:
1489         (WebKit::WebPageProxy::isMediaStreamCaptureMuted const): Ditto.
1490
1491 2019-04-04  Per Arne Vollan  <pvollan@apple.com>
1492
1493         [macOS][iOS] Add filter to syscall sandbox rule
1494         https://bugs.webkit.org/show_bug.cgi?id=196613
1495         <rdar://problem/49531420>
1496
1497         Reviewed by Brent Fulgham.
1498
1499         This will restrict the existing sandbox rule for the syscall.
1500
1501         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1502         * WebProcess/com.apple.WebProcess.sb.in:
1503
1504 2019-04-04  Youenn Fablet  <youenn@apple.com>
1505
1506         Service Worker Process does not have the right domain name
1507         https://bugs.webkit.org/show_bug.cgi?id=196585
1508
1509         Reviewed by Chris Dumez.
1510
1511         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm:
1512         (WebKit::XPCServiceInitializerDelegate::getExtraInitializationData):
1513         Updated extraInitializationData to go from "security-origin" to "registrable-domain".
1514
1515 2019-04-04  Chris Dumez  <cdumez@apple.com>
1516
1517         Temporarily disable delayed WebProcess launch on iOS to address PLT regression
1518         https://bugs.webkit.org/show_bug.cgi?id=196604
1519         <rdar://problem/49074131>
1520
1521         Reviewed by Geoffrey Garen.
1522
1523         Temporarily disable delayed WebProcess launch on iOS to address PLT regression. This
1524         is while I figure out how to enable this on iOS without regressed PLT.
1525
1526         * UIProcess/WebProcessPool.h:
1527
1528 2019-04-04  Miguel Gomez  <magomez@igalia.com>
1529
1530         [CoordGraphics] Revalidate need for 'coordinated update completion' in ThreadedCompositor
1531         https://bugs.webkit.org/show_bug.cgi?id=188839
1532
1533         Reviewed by Žan Doberšek.
1534
1535         Even if a platform layer has changed, don't wait for a main thread callback to finish the
1536         CompositingRunLoop update. It can be finished as soon as we receive the frameComplete signal.
1537
1538         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
1539         (WebKit::CompositingRunLoop::scheduleUpdate):
1540         (WebKit::CompositingRunLoop::stopUpdates):
1541         (WebKit::CompositingRunLoop::updateCompleted):
1542         (WebKit::CompositingRunLoop::updateTimerFired):
1543         (WebKit::CompositingRunLoop::compositionCompleted): Deleted.
1544         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
1545         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1546         (WebKit::ThreadedCompositor::renderLayerTree):
1547         (WebKit::ThreadedCompositor::sceneUpdateFinished):
1548         (WebKit::ThreadedCompositor::displayRefreshMonitor):
1549         (WebKit::ThreadedCompositor::handleDisplayRefreshMonitorUpdate): Deleted.
1550         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
1551         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
1552         (WebKit::LayerTreeHost::handleDisplayRefreshMonitorUpdate):
1553
1554 2019-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1555
1556         [ATK] Cleanup WebPageAccessibilityObjectAtk
1557         https://bugs.webkit.org/show_bug.cgi?id=196537
1558
1559         Reviewed by Michael Catanzaro.
1560
1561         Several changes and cleanups:
1562
1563          - Add WebKit prefix so that style checker doesn't complain about GObject conventions.
1564          - Rename the header to remove the Atk prefix to match the cpp file and class name.
1565          - Use pragma once.
1566          - Use nullptr instead of 0.
1567          - Use WEBKIT_DEFINE_TYPE instead of G_DEFINE_TYPE.
1568          - Return generic AtkObject* from constructor.
1569
1570         * SourcesGTK.txt:
1571         * WebProcess/WebPage/WebPage.h:
1572         * WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.cpp: Renamed from Source/WebKit/WebProcess/WebPage/atk/WebPageAccessibilityObjectAtk.cpp.
1573         (accessibilityRootObjectWrapper):
1574         (webkitWebPageAccessibilityObjectInitialize):
1575         (webkitWebPageAccessibilityObjectGetIndexInParent):
1576         (webkitWebPageAccessibilityObjectGetNChildren):
1577         (webkitWebPageAccessibilityObjectRefChild):
1578         (webkit_web_page_accessibility_object_class_init):
1579         (webkitWebPageAccessibilityObjectNew):
1580         (webkitWebPageAccessibilityObjectRefresh):
1581         * WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.h: Added.
1582         * WebProcess/WebPage/atk/WebPageAccessibilityObject.h: Removed.
1583         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
1584         (WebKit::WebPage::platformInitialize):
1585         (WebKit::WebPage::updateAccessibilityTree):
1586
1587 2019-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1588
1589         [ATK] Set ATK_STATE_TRANSIENT on the atk socket until it's embedded
1590         https://bugs.webkit.org/show_bug.cgi?id=196535
1591
1592         Reviewed by Michael Catanzaro.
1593
1594         This way the properties are not cached. Right now, if number of children is queried before the socket is
1595         embedded, 0 is returned and cached, so ATs don't see the child even after the socket has been embedded.
1596
1597         * UIProcess/API/gtk/WebKitWebViewBaseAccessible.cpp:
1598         (webkitWebViewBaseAccessibleRefStateSet): Set ATK_STATE_TRANSIENT is the socket is not occupied.
1599         * UIProcess/gtk/WebPageProxyGtk.cpp:
1600         (WebKit::WebPageProxy::bindAccessibilityTree): Unset ATK_STATE_TRANSIENT.
1601
1602 2019-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1603
1604         [ATK] Embed the AtkSocket as soon as we receive the plug ID
1605         https://bugs.webkit.org/show_bug.cgi?id=196534
1606
1607         Reviewed by Michael Catanzaro.
1608
1609         We are currently storing the ID and waiting for the next time get_accessible is called to embed the socket. We
1610         can simply embed the socket when the plug ID is received.
1611
1612         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1613         (webkitWebViewBaseGetAccessible):
1614         * UIProcess/WebPageProxy.h:
1615         * UIProcess/gtk/WebPageProxyGtk.cpp:
1616         (WebKit::WebPageProxy::bindAccessibilityTree):
1617
1618 2019-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1619
1620         [ATK] Don't touch accessibility tree in WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld
1621         https://bugs.webkit.org/show_bug.cgi?id=193914
1622
1623         Reviewed by Michael Catanzaro.
1624
1625         Move it to dispatchDidFinishDocumentLoad, since we know we have the document at that point and we can create the
1626         root accessibility object wrapper.
1627
1628         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1629         (WebKit::WebFrameLoaderClient::dispatchDidFinishDocumentLoad):
1630         (WebKit::WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld):
1631
1632 2019-04-03  Simon Fraser  <simon.fraser@apple.com>
1633
1634         Simplify some "programmaticScroll" code paths
1635         https://bugs.webkit.org/show_bug.cgi?id=196589
1636
1637         Reviewed by Zalan Bujtas.
1638
1639         * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm: Remove the parameter.
1640         (WebKit::RemoteScrollingCoordinator::scrollPositionChangedForNode): Use the enum type.
1641         * WebProcess/WebPage/ios/WebPageIOS.mm:
1642         (WebKit::WebPage::updateVisibleContentRects):
1643
1644 2019-04-03  Chris Dumez  <cdumez@apple.com>
1645
1646         The page's focusedFrame / frameSetLargestFrame do not get cleared on process swap or crash
1647         https://bugs.webkit.org/show_bug.cgi?id=196588
1648         <rdar://problem/49365787>
1649
1650         Reviewed by Ryosuke Niwa.
1651
1652         The page's focusedFrame / frameSetLargestFrame do not get cleared on process swap or crash.
1653         This can lead to returning stale frames to the client if it asks for those.
1654
1655         * UIProcess/WebPageProxy.cpp:
1656         (WebKit::WebPageProxy::resetState):
1657
1658 2019-04-03  Simon Fraser  <simon.fraser@apple.com>
1659
1660         Remove the isProgrammaticScroll argument to requestScroll() because no-one uses it
1661         https://bugs.webkit.org/show_bug.cgi?id=196587
1662
1663         Reviewed by Zalan Bujtas.
1664
1665         This argument was unused.
1666
1667         * UIProcess/API/gtk/PageClientImpl.cpp:
1668         (WebKit::PageClientImpl::requestScroll):
1669         * UIProcess/API/gtk/PageClientImpl.h:
1670         * UIProcess/API/wpe/PageClientImpl.cpp:
1671         (WebKit::PageClientImpl::requestScroll):
1672         * UIProcess/API/wpe/PageClientImpl.h:
1673         * UIProcess/PageClient.h:
1674         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
1675         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
1676         * UIProcess/WebPageProxy.cpp:
1677         (WebKit::WebPageProxy::requestScroll):
1678         * UIProcess/WebPageProxy.h:
1679         * UIProcess/ios/PageClientImplIOS.h:
1680         * UIProcess/ios/PageClientImplIOS.mm:
1681         (WebKit::PageClientImpl::requestScroll):
1682         * UIProcess/mac/PageClientImplMac.h:
1683         * UIProcess/mac/PageClientImplMac.mm:
1684         (WebKit::PageClientImpl::requestScroll):
1685         * UIProcess/win/PageClientImpl.cpp:
1686         (WebKit::PageClientImpl::requestScroll):
1687         * UIProcess/win/PageClientImpl.h:
1688
1689 2019-04-03  Myles C. Maxfield  <mmaxfield@apple.com>
1690
1691         -apple-trailing-word is needed for browser detection
1692         https://bugs.webkit.org/show_bug.cgi?id=196575
1693
1694         Unreviewed.
1695
1696         * Configurations/FeatureDefines.xcconfig:
1697
1698 2019-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>
1699
1700         Add a WebKit internal feature flag to always enable modern compatibility mode by default
1701         https://bugs.webkit.org/show_bug.cgi?id=196526
1702         <rdar://problem/49532923>
1703
1704         Reviewed by Tim Horton.
1705
1706         Change UseModernCompatibilityModeByDefault from an internal preference to a debug preference, so that it may be
1707         enabled for all apps on the system.
1708
1709         * Shared/WebPreferences.yaml:
1710
1711 2019-04-03  Alex Christensen  <achristensen@webkit.org>
1712
1713         Fix internal build after r243829
1714         https://bugs.webkit.org/show_bug.cgi?id=196549
1715
1716         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1717         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1718         Some SDK's don't include this selector in the header.
1719         Use NSSelectorFromString.
1720
1721 2019-04-03  Don Olmstead  <don.olmstead@sony.com>
1722
1723         [CMake][WTF] Mirror XCode header directories
1724         https://bugs.webkit.org/show_bug.cgi?id=191662
1725
1726         Reviewed by Konstantin Tokarev.
1727
1728         Use WTFFramework as a dependency and include frameworks/WTF.cmake for AppleWin internal
1729         builds.
1730
1731         * CMakeLists.txt:
1732
1733 2019-04-03  Alex Christensen  <achristensen@webkit.org>
1734
1735         Add SPI to disable legacy TLS fallback
1736         https://bugs.webkit.org/show_bug.cgi?id=196549
1737         <rdar://44979744>
1738
1739         Reviewed by Geoffrey Garen.
1740
1741         * NetworkProcess/NetworkSessionCreationParameters.cpp:
1742         (WebKit::NetworkSessionCreationParameters::privateSessionParameters):
1743         (WebKit::NetworkSessionCreationParameters::encode const):
1744         (WebKit::NetworkSessionCreationParameters::decode):
1745         * NetworkProcess/NetworkSessionCreationParameters.h:
1746         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1747         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1748         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1749         (-[WKWebsiteDataStore _setAllowsTLSFallback:]):
1750         (-[WKWebsiteDataStore _allowsTLSFallback]):
1751         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
1752         * UIProcess/WebProcessPool.cpp:
1753         (WebKit::WebProcessPool::ensureNetworkProcess):
1754         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
1755         (WebKit::WebsiteDataStore::parameters):
1756         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1757         (WebKit::WebsiteDataStore::setSourceApplicationSecondaryIdentifier):
1758         (WebKit::WebsiteDataStore::setAllowsTLSFallback):
1759         (WebKit::WebsiteDataStore::setSourceApplicationBundleIdentifier):
1760         * UIProcess/WebsiteData/WebsiteDataStore.h:
1761         (WebKit::WebsiteDataStore::allowsTLSFallback const):
1762         (WebKit::WebsiteDataStore::networkingHasBegun):
1763         (WebKit::WebsiteDataStore::finalizeApplicationIdentifiers): Deleted.
1764
1765 2019-04-03  Myles C. Maxfield  <mmaxfield@apple.com>
1766
1767         Remove support for -apple-trailing-word
1768         https://bugs.webkit.org/show_bug.cgi?id=196525
1769
1770         Reviewed by Zalan Bujtas.
1771
1772         This CSS property is nonstandard and not used.
1773
1774         * Configurations/FeatureDefines.xcconfig:
1775
1776 2019-04-03  Alex Christensen  <achristensen@webkit.org>
1777
1778         Resurrect and fix layout test http/tests/adClickAttribution/store-ad-click-attribution.html
1779         https://bugs.webkit.org/show_bug.cgi?id=196476
1780
1781         Reviewed by Chris Dumez.
1782
1783         Re-apply a change I reverted in r241754 now that it's safe to do so.
1784
1785         * UIProcess/WebPageProxy.cpp:
1786         (WebKit::WebPageProxy::didCommitLoadForFrame):
1787
1788 2019-04-03  Daniel Bates  <dabates@apple.com>
1789
1790         [iOS] Should be able to dismiss picker or popover using the keyboard
1791         https://bugs.webkit.org/show_bug.cgi?id=196272
1792         <rdar://problem/48943170>
1793
1794         Reviewed by Wenson Hsieh.
1795
1796         Intercept key events and route them to the current input peripheral (if we have one). Add a base key event handler
1797         for all form peripherals that dismisses the accessory when either the Escape key is pressed or Command + . is pressed.
1798         I will fix this issue for the file upload picker/popover in <https://bugs.webkit.org/show_bug.cgi?id=196287>.
1799
1800         * SourcesCocoa.txt: Add file WKFormPeripheralBase.mm.
1801         * UIProcess/ios/WKContentViewInteraction.mm:
1802         (-[WKContentView endEditingAndUpdateFocusAppearanceWithReason]): Added.
1803         (-[WKContentView resignFirstResponderForWebView]): Write in terms of -endEditingAndUpdateFocusAppearance.
1804         (-[WKContentView inputView]): Code style nit while I am here; add an empty line to demarcate the "crazy"
1805         code that the FIXME is referring to and should ideally be removed from the code that is sane to always do.
1806         (-[WKContentView accessoryDone]): When the accessory is dismissed via the Done button (iPhone) or by pressing
1807         Escape or Command + . using a hardware keyboard (iPhone or iPad) then end the current editing session, but
1808         do not resign first responder status as the page activation state should not be changed.
1809         (-[WKContentView _handleKeyUIEvent:]): Bring back this code when building with USE(UIKIT_KEYBOARD_ADDITIONS)
1810         as we need to route key events to the input peripheral (if we have one). If the input peripheral handles it
1811         then we're done: no need to let UIKit or WebKit handle it when building with USE(UIKIT_KEYBOARD_ADDITIONS),
1812         respectively. If the input peripheral does not handle it then do what we do now.
1813         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
1814         If the element is re-focused and we have an input peripheral then we want to ensure we are first responder,
1815         reveal the focused element, update the accessory and tell the peripheral that editing has begun (again).
1816         For all other element re-focusing where we don't have a peripheral do what we do now. Also, update _isEditable
1817         to reflect whether the focused element contains selectable text. This is what UIKit wants to know when it queries
1818         -isEditable. Now that we no longer blur the focused element on iPad when the popover is dismissed and keep the
1819         peripheral until there is a focus change we need to ensure that we give the correct answer to UIKit on view
1820         editability. Otherwise, UIKit thinks it needs to update the text selection state when a popup button is tapped
1821         again (as part of its gesture recognizer logic) and this causes an assertion failure in UIKit after it calls back
1822         into us to ask for selection details, which we correctly respond with the equivalent of "we have none" and is
1823         not the answer UIKit expects since we told it we are editable. (Currently we manage to get away with telling UIKit
1824         we are always editable because it is not possible to perform a selection operation when we have a popover open.
1825         Closing the popover blurs the element, setting -isEditable to NO and deallocates the peripheral avoiding this issue).
1826         * UIProcess/ios/forms/WKFormColorControl.h:
1827         * UIProcess/ios/forms/WKFormColorControl.mm:
1828         (-[WKColorPopover controlEndEditing]): Dismiss the popover.
1829         (-[WKFormColorControl initWithView:]): Modified to call base class initializer.
1830         (-[WKFormColorControl assistantView]): Deleted.
1831         (-[WKFormColorControl beginEditing]): Deleted.
1832         (-[WKFormColorControl endEditing]): Deleted.
1833         * UIProcess/ios/forms/WKFormInputControl.h:
1834         * UIProcess/ios/forms/WKFormInputControl.mm:
1835         (-[WKFormInputControl initWithView:]): Modified to call base class initializer.
1836         (-[WKFormInputControl dateTimePickerCalendarType]): Write in terms of self.control.
1837         (-[WKDateTimePopover controlEndEditing]): Dismiss the popover and tell the controller that editing ended.
1838         (-[WKFormInputControl beginEditing]): Deleted.
1839         (-[WKFormInputControl endEditing]): Deleted.
1840         (-[WKFormInputControl assistantView]): Deleted.
1841         * UIProcess/ios/forms/WKFormPeripheral.h:
1842         * UIProcess/ios/forms/WKFormPeripheralBase.h: Added.
1843         * UIProcess/ios/forms/WKFormPeripheralBase.mm: Added.
1844         (-[WKFormPeripheralBase initWithView:control:]): Take ownership of the passed WKFormControl.
1845         (-[WKFormPeripheralBase beginEditing]): Turn around and tell the control.
1846         (-[WKFormPeripheralBase endEditing]): Ditto.
1847         (-[WKFormPeripheralBase assistantView]): Ditto.
1848         (-[WKFormPeripheralBase control]): Return the control.
1849         (-[WKFormPeripheralBase handleKeyEvent:]): Dismiss the accessory (in the same way we dismiss when the Done
1850         button is pressed on iPhone) on keydown of the Escape key or when we receive a UIKeyInputEscape event (for
1851         Command + .).
1852         * UIProcess/ios/forms/WKFormSelectControl.h:
1853         * UIProcess/ios/forms/WKFormSelectControl.mm:
1854         (-[WKFormSelectControl initWithView:]): Modified to call base class initializer.
1855         (-[WKFormSelectControl selectRow:inComponent:extendingSelection:]): Write in terms of self.control.
1856         (-[WKFormSelectControl selectFormPopoverTitle]): Ditto.
1857         (-[WKFormSelectControl assistantView]): Deleted.
1858         (-[WKFormSelectControl beginEditing]): Deleted.
1859         (-[WKFormSelectControl endEditing]): Deleted.
1860         * UIProcess/ios/forms/WKFormSelectPopover.mm:
1861         (-[WKSelectPopover controlEndEditing]): Dismiss the popover.
1862         * WebKit.xcodeproj/project.pbxproj: Add files WKFormPeripheralBase.{h, mm}.
1863
1864 2019-04-03  Youenn Fablet  <youenn@apple.com>
1865
1866         Resetting quota should take into account third party origins
1867         https://bugs.webkit.org/show_bug.cgi?id=196462
1868
1869         Reviewed by Geoffrey Garen.
1870
1871         When clearing the storage quota, we were resetting it to the default value
1872         without taking care of whether third party or not.
1873         Updated the code to ensure that the default quota is computed based on the origin.
1874
1875         Updated existing test to cover this case.
1876
1877         * NetworkProcess/NetworkProcess.cpp:
1878         (WebKit::NetworkProcess::clearStorageQuota):
1879         (WebKit::NetworkProcess::setCacheStorageParameters):
1880         (WebKit::NetworkProcess::updateQuotaBasedOnSpaceUsageForTesting):
1881         (WebKit::NetworkProcess::storageQuotaManager):
1882         * NetworkProcess/NetworkProcess.h:
1883         (WebKit::NetworkProcess::StorageQuotaManagers::defaultQuota const):
1884         (WebKit::NetworkProcess::StorageQuotaManagers::setDefaultQuotas):
1885         (WebKit::NetworkProcess::StorageQuotaManagers::managersPerOrigin):
1886
1887 2019-04-03  Michael Catanzaro  <mcatanzaro@igalia.com>
1888
1889         Get rid of HTMLInputElement::setEditingValue
1890         https://bugs.webkit.org/show_bug.cgi?id=196402
1891
1892         Reviewed by Darin Adler.
1893
1894         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMElement.cpp:
1895         (webkit_dom_element_html_input_element_set_editing_value):
1896         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
1897         (webkit_dom_html_input_element_set_editing_value):
1898
1899 2019-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>
1900
1901         Add a WebKit internal feature flag to always enable modern compatibility mode by default
1902         https://bugs.webkit.org/show_bug.cgi?id=196526
1903         <rdar://problem/49532923>
1904
1905         Reviewed by Antoine Quint.
1906
1907         * Shared/WebPreferences.yaml:
1908
1909 2019-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>
1910
1911         Introduce and add plumbing for a website policy for meta viewport tag handling
1912         https://bugs.webkit.org/show_bug.cgi?id=196285
1913
1914         Reviewed by Tim Horton.
1915
1916         Add WebsiteMetaViewportPolicy, a bit that can be used to determine whether to respect or ignore the meta
1917         viewport tag and use native web page parameters instead of the default parameters.
1918
1919         * Shared/WebsiteMetaViewportPolicy.h: Copied from Source/WebKit/Shared/WebsitePoliciesData.h.
1920         * Shared/WebsitePoliciesData.cpp:
1921         (WebKit::WebsitePoliciesData::encode const):
1922         (WebKit::WebsitePoliciesData::decode):
1923         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
1924
1925         Convert WebKit::WebsiteMetaViewportPolicy into WebCore::MetaViewportPolicy.
1926
1927         * Shared/WebsitePoliciesData.h:
1928         * UIProcess/API/APIWebsitePolicies.cpp:
1929         (API::WebsitePolicies::data):
1930         * UIProcess/API/APIWebsitePolicies.h:
1931
1932         Add additional plumbing for the policy flag.
1933
1934         * WebKit.xcodeproj/project.pbxproj:
1935         * WebProcess/WebPage/ios/WebPageIOS.mm:
1936         (WebKit::WebPage::resetViewportDefaultConfiguration):
1937
1938         Use native web page parameters if either "shouldIgnoreMetaViewport" is enabled, or the new policy is set.
1939         Eventually, the policy should completely replace the former preference once no internal clients depend on it.
1940
1941 2019-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>
1942
1943         Add plumbing for a compatibility mode preference in WebKit
1944         https://bugs.webkit.org/show_bug.cgi?id=196005
1945
1946         Reviewed by Tim Horton.
1947
1948         Add plumbing between the Cocoa API object (WKWebpagePreferences) and the inner C++ API object
1949         (API::WebsitePolicies) for compatibility mode.
1950
1951         * Shared/WebCompatibilityMode.h: Added.
1952         * UIProcess/API/APIWebsitePolicies.h:
1953         * UIProcess/API/Cocoa/WKWebpagePreferences.mm:
1954         * UIProcess/Cocoa/NavigationState.mm:
1955         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
1956         * UIProcess/WebPageProxy.cpp:
1957         (WebKit::WebPageProxy::adjustPoliciesForCompatibilityMode):
1958         * UIProcess/WebPageProxy.h:
1959         * UIProcess/ios/WebPageProxyIOS.mm:
1960         * WebKit.xcodeproj/project.pbxproj:
1961
1962 2019-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1963
1964         [CoordinatedGraphics] Hidden pages are not suspended after a web view resize
1965         https://bugs.webkit.org/show_bug.cgi?id=196487
1966
1967         Reviewed by Žan Doberšek.
1968
1969         When resizing the window, the hidden tabs are updated too, to avoid flickering or getting the old size when
1970         switching tabs. For that we need to resume painting but we are not suspending it again after the update.
1971
1972         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
1973         (WebKit::DrawingAreaCoordinatedGraphics::updateBackingStoreState): Suspend the painting again after a
1974         synchronous update if needed.
1975
1976 2019-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1977
1978         Web Inspector: [GTK] Copy copies to nowhere
1979         https://bugs.webkit.org/show_bug.cgi?id=181228
1980
1981         Reviewed by Michael Catanzaro.
1982
1983         The thing is that those items are actually submenu items, with options, for example in the case of Copy to copy
1984         HTML, Text, XPath, etc. We are not correctly handling submenus when populating the context menu received from
1985         the web process.
1986
1987         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
1988         (WebKit::WebContextMenuProxyGtk::populateSubMenu): Helper to populate submenu items recursively.
1989         (WebKit::WebContextMenuProxyGtk::populate): Handle submenu items.
1990         * UIProcess/gtk/WebContextMenuProxyGtk.h:
1991
1992 2019-04-02  Wenson Hsieh  <wenson_hsieh@apple.com>
1993
1994         [Cocoa] Add new API around WKWebpagePreferences in WKNavigationDelegate and WKWebViewConfiguration
1995         https://bugs.webkit.org/show_bug.cgi?id=196284
1996         <rdar://problem/47228232>
1997
1998         Reviewed by Tim Horton.
1999
2000         Tests for both of these APIs will be added in a subsequent patch.
2001
2002         * Shared/API/Cocoa/WebKit.h:
2003         * UIProcess/API/APIPageConfiguration.cpp:
2004         (API::PageConfiguration::defaultWebsitePolicies const):
2005         (API::PageConfiguration::setDefaultWebsitePolicies):
2006         * UIProcess/API/APIPageConfiguration.h:
2007         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
2008
2009         Add a new navigation delegate hook to allow clients to return a WKWebpagePreference targeting the given
2010         navigation action.
2011
2012         * UIProcess/API/Cocoa/WKWebView.mm:
2013         (-[WKWebView _initializeWithConfiguration:]):
2014         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
2015         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2016
2017         Add new API on WKWebViewConfiguration to specify a default WKWebpagePreference to use when navigating.
2018
2019         (-[WKWebViewConfiguration copyWithZone:]):
2020         (-[WKWebViewConfiguration defaultWebpagePreferences]):
2021         (-[WKWebViewConfiguration setDefaultWebpagePreferences:]):
2022         * UIProcess/API/Cocoa/WKWebpagePreferences.h:
2023         * UIProcess/Cocoa/NavigationState.h:
2024         * UIProcess/Cocoa/NavigationState.mm:
2025         (WebKit::NavigationState::setNavigationDelegate):
2026         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
2027
2028         Invoke the new WKWebpagePreferences-based navigation delegate method.
2029
2030         * WebKit.xcodeproj/project.pbxproj:
2031         * mac/postprocess-framework-headers.sh:
2032         * mac/replace-webkit-additions-in-framework-headers.sh: Added.
2033
2034         Move logic in the "Postprocess Framework Headers" step responsible for stripping away included files from
2035         WebKitAdditions out into a separate build phase, called "Replace WebKitAdditions in Framework Headers". This
2036         ensures headers attempting to include from WebKitAdditions have these additional statements removed.
2037
2038 2019-04-02  Geoffrey Garen  <ggaren@apple.com>
2039
2040         Eliminate plugin sandbox exceptions
2041         https://bugs.webkit.org/show_bug.cgi?id=196510
2042
2043         Reviewed by Chris Dumez.
2044
2045         * PluginProcess/mac/PluginProcessMac.mm:
2046         (WebKit::PluginProcess::initializeSandbox):
2047         * UIProcess/Plugins/PluginInfoStore.cpp:
2048         (WebKit::PluginInfoStore::shouldAllowPluginToRunUnsandboxed): Deleted.
2049         * UIProcess/Plugins/PluginInfoStore.h:
2050         * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
2051         (WebKit::PluginInfoStore::shouldUsePlugin):
2052         (WebKit::PluginInfoStore::shouldAllowPluginToRunUnsandboxed): Deleted.
2053
2054 2019-04-02  Alex Christensen  <achristensen@webkit.org>
2055
2056         Fix assertion in http/tests/adClickAttribution/store-ad-click-attribution.html
2057         https://bugs.webkit.org/show_bug.cgi?id=196503
2058
2059         Reviewed by Chris Dumez.
2060
2061         In WebPageProxy::didDestroyNavigation we try to ignore a request to destroy a navigation from a page being navigated from
2062         during a cross-site navigation, but if the old web process sends the message after WebPageProxy::commitProvisionalPage
2063         has been called, we can still destroy a navigation when we are continuing a navigation in another process.  To prevent this,
2064         have the process not send the message when it knows the navigation is continuing in another process.
2065         Also make the use of unchecked navigation pointers more robust by checking it for nullity.
2066
2067         * UIProcess/WebPageProxy.cpp:
2068         (WebKit::WebPageProxy::didCommitLoadForFrame):
2069         * WebProcess/WebPage/WebFrame.cpp:
2070         (WebKit::WebFrame::didReceivePolicyDecision):
2071         (WebKit::WebFrame::documentLoaderDetached):
2072         * WebProcess/WebPage/WebFrame.h:
2073
2074 2019-04-02  Per Arne Vollan  <pvollan@apple.com>
2075
2076         [iOS] Fix iokit-get-properties sandbox violation in the WebContent process
2077         https://bugs.webkit.org/show_bug.cgi?id=196500
2078         <rdar://problem/49497788>
2079
2080         Reviewed by Brent Fulgham.
2081
2082         Attempting to get the iokit properties 'product-description', 'artwork-display-gamut' and
2083         'artwork-scale-factor' is causing sandbox violations.
2084
2085         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2086
2087 2019-04-02  Chris Dumez  <cdumez@apple.com>
2088
2089         [WK2] Add support for Window's beforeprint / afterprint events
2090         https://bugs.webkit.org/show_bug.cgi?id=196478
2091
2092         Reviewed by Alex Christensen.
2093
2094         Add support for Window's beforeprint / afterprint events as per:
2095         - https://html.spec.whatwg.org/#dom-print
2096
2097         Blink and Gecko already support this.
2098
2099         * WebProcess/WebPage/WebPage.cpp:
2100         (WebKit::WebPage::beginPrinting):
2101         (WebKit::WebPage::endPrinting):
2102
2103 2019-04-02  Wenson Hsieh  <wenson_hsieh@apple.com>
2104
2105         REGRESSION (r243726): Crash at unrecognized selector: -[WKWebpagePreferences webpagePreferences]
2106         https://bugs.webkit.org/show_bug.cgi?id=196496
2107         <rdar://problem/49521634>
2108
2109         Reviewed by Chris Dumez.
2110
2111         r243726 made an incorrect assumption that all callers of -decidePolicyForNavigationAction:decisionHandler: and
2112         -decidePolicyForNavigationAction:userInfo:decisionHandler: must be instances of _WKWebsitePolicies, as opposed
2113         to the new WKWebpagePreferences. However, it's possible for clients (in this case, Safari) to already generate
2114         and pass in an instance of WKWebpagePreferences by bridging the C API opaque ref (WKWebsitePoliciesRef) into the
2115         Objective-C object (which is now WKWebpagePreferences, after my change).
2116
2117         To maintain binary compatibility of trunk WebKit against prior versions of Safari, we need to handle both
2118         WKWebpagePreferences and the soon-to-be-deprecated _WKWebsitePolicies in the navigation action policy decision
2119         handler.
2120
2121         Tests:  WebKit.WebsitePoliciesWithBridgingCast
2122                 WebKit.WebsitePoliciesWithUnexpectedType
2123
2124         * UIProcess/Cocoa/NavigationState.mm:
2125         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
2126
2127 2019-04-01  Chris Dumez  <cdumez@apple.com>
2128
2129         Unreviewed, drop debug logging landed as part of r242903 by mistake.
2130
2131         * UIProcess/WebPageProxy.cpp:
2132         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2133
2134 2019-04-01  Remy Demarest  <rdemarest@apple.com>
2135
2136         Add SPI to give injected bundles access to displayed PDFDocuments
2137         https://bugs.webkit.org/show_bug.cgi?id=196471
2138         <rdar://problem/48080768>
2139
2140         Reviewed by Tim Horton.
2141
2142         * WebKit.xcodeproj/project.pbxproj:
2143
2144         * WebProcess/InjectedBundle/API/c/mac/WKBundlePageMac.h: Added.
2145         * WebProcess/InjectedBundle/API/c/mac/WKBundlePageMac.mm: Added.
2146         (WKBundlePageGetPDFDocumentInFrame):
2147
2148 2019-04-01  Wenson Hsieh  <wenson_hsieh@apple.com>
2149
2150         [WebKit2] Introduce a public version of WKWebsitePolicies
2151         https://bugs.webkit.org/show_bug.cgi?id=195989
2152         <rdar://problem/47228232>
2153
2154         Reviewed by Tim Horton.
2155
2156         Expose the existing _WKWebsitePolicies object as WKWebpagePreferences, in what will eventually become a public
2157         header in the WebKit SDK (WKWebpagePreferences.h). Following a similar transitioning strategy as
2158         _WKWebsiteDataStore and WKWebsiteDataStore, we move existing logic from _WKWebsitePolicies to WKWebpagePreferences
2159         and make _WKWebsitePolicies a wrapper around WKWebpagePreferences.
2160
2161         No change in behavior.
2162
2163         * Shared/Cocoa/APIObject.mm:
2164         (API::Object::newObject):
2165
2166         Wrap API::WebsitePolicies with WKWebpagePreferences.
2167
2168         * SourcesCocoa.txt:
2169         * UIProcess/API/Cocoa/WKWebView.mm:
2170         (-[WKWebView _updateWebsitePolicies:]):
2171         * UIProcess/API/Cocoa/WKWebpagePreferences.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKWebsitePoliciesInternal.h.
2172         * UIProcess/API/Cocoa/WKWebpagePreferences.mm: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKWebsitePolicies.mm.
2173
2174         Introduce WKWebpagePreferences.
2175
2176         (+[WKWebpagePreferences defaultPreferences]):
2177         (-[WKWebpagePreferences dealloc]):
2178         (-[WKWebpagePreferences init]):
2179         (-[WKWebpagePreferences _setContentBlockersEnabled:]):
2180         (-[WKWebpagePreferences _contentBlockersEnabled]):
2181         (-[WKWebpagePreferences _setAllowedAutoplayQuirks:]):
2182         (-[WKWebpagePreferences _allowedAutoplayQuirks]):
2183         (-[WKWebpagePreferences _setAutoplayPolicy:]):
2184         (-[WKWebpagePreferences _autoplayPolicy]):
2185         (-[WKWebpagePreferences _setDeviceOrientationAndMotionAccessPolicy:]):
2186         (-[WKWebpagePreferences _deviceOrientationAndMotionAccessPolicy]):
2187         (-[WKWebpagePreferences _setPopUpPolicy:]):
2188         (-[WKWebpagePreferences _popUpPolicy]):
2189         (-[WKWebpagePreferences _customHeaderFields]):
2190         (-[WKWebpagePreferences _setCustomHeaderFields:]):
2191         (-[WKWebpagePreferences _websiteDataStore]):
2192         (-[WKWebpagePreferences _setWebsiteDataStore:]):
2193         (-[WKWebpagePreferences _setCustomUserAgent:]):
2194         (-[WKWebpagePreferences _customUserAgent]):
2195         (-[WKWebpagePreferences _setCustomJavaScriptUserAgentAsSiteSpecificQuirks:]):
2196         (-[WKWebpagePreferences _customJavaScriptUserAgentAsSiteSpecificQuirks]):
2197         (-[WKWebpagePreferences _setCustomNavigatorPlatform:]):
2198         (-[WKWebpagePreferences _customNavigatorPlatform]):
2199         (-[WKWebpagePreferences _apiObject]):
2200         * UIProcess/API/Cocoa/WKWebpagePreferencesInternal.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKWebsitePoliciesInternal.h.
2201         * UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKWebsitePolicies.h.
2202
2203         Reintroduce all the interfaces currently available on _WKWebsitePolicies as underscore-prefixed SPI on
2204         WKWebpagePreferences.
2205
2206         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
2207         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
2208
2209         Make _WKWebsitePolicies wrap WKWebpagePreferences, and plumb all existing SPI on WKWebsitePolicies through to
2210         WKWebpagePreferences.
2211
2212         (-[_WKWebsitePolicies init]):
2213         (-[_WKWebsitePolicies webpagePreferences]):
2214         (-[_WKWebsitePolicies setContentBlockersEnabled:]):
2215         (-[_WKWebsitePolicies contentBlockersEnabled]):
2216         (-[_WKWebsitePolicies setAllowedAutoplayQuirks:]):
2217         (-[_WKWebsitePolicies allowedAutoplayQuirks]):
2218         (-[_WKWebsitePolicies setAutoplayPolicy:]):
2219         (-[_WKWebsitePolicies autoplayPolicy]):
2220         (-[_WKWebsitePolicies setDeviceOrientationAndMotionAccessPolicy:]):
2221         (-[_WKWebsitePolicies deviceOrientationAndMotionAccessPolicy]):
2222         (-[_WKWebsitePolicies setPopUpPolicy:]):
2223         (-[_WKWebsitePolicies popUpPolicy]):
2224         (-[_WKWebsitePolicies customHeaderFields]):
2225         (-[_WKWebsitePolicies setCustomHeaderFields:]):
2226         (-[_WKWebsitePolicies websiteDataStore]):
2227         (-[_WKWebsitePolicies setWebsiteDataStore:]):
2228         (-[_WKWebsitePolicies setCustomUserAgent:]):
2229         (-[_WKWebsitePolicies customUserAgent]):
2230         (-[_WKWebsitePolicies setCustomJavaScriptUserAgentAsSiteSpecificQuirks:]):
2231         (-[_WKWebsitePolicies customJavaScriptUserAgentAsSiteSpecificQuirks]):
2232         (-[_WKWebsitePolicies setCustomNavigatorPlatform:]):
2233         (-[_WKWebsitePolicies customNavigatorPlatform]):
2234         (-[_WKWebsitePolicies description]):
2235         (-[_WKWebsitePolicies _apiObject]):
2236         (-[_WKWebsitePolicies dealloc]): Deleted.
2237         * UIProcess/API/Cocoa/_WKWebsitePoliciesInternal.h:
2238         * UIProcess/Cocoa/NavigationState.mm:
2239         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
2240         * WebKit.xcodeproj/project.pbxproj:
2241
2242 2019-04-01  Wenson Hsieh  <wenson_hsieh@apple.com>
2243
2244         Unable to copy and paste a PDF from Notes into Mail compose body
2245         https://bugs.webkit.org/show_bug.cgi?id=196442
2246         <rdar://problem/48573098>
2247
2248         Reviewed by Tim Horton.
2249
2250         Relax the -canPerformAction: logic in the case of pasting an attachment. Consider an NSItemProvider to possibly
2251         paste as an attachment if either it has a preferred presentation style of UIPreferredPresentationStyleAttachment
2252         or has a style of UIPreferredPresentationStyleUnspecified, but has a suggested file name.
2253
2254         This allows for the "Paste" action to be shown in the callout menu when copying and pasting a non-text file.
2255
2256         * UIProcess/ios/WKContentViewInteraction.mm:
2257         (-[WKContentView canPerformActionForWebView:withSender:]):
2258
2259 2019-04-01  Tim Horton  <timothy_horton@apple.com>
2260
2261         Make UIWKDocumentContext rects per-character instead of per-word
2262         https://bugs.webkit.org/show_bug.cgi?id=196459
2263
2264         Reviewed by Wenson Hsieh.
2265
2266         * WebProcess/WebPage/ios/WebPageIOS.mm:
2267         (WebKit::WebPage::requestDocumentEditingContext):
2268         Switch to CharacterIterator instead of TextIterator directly, to get
2269         per-character rects as the API requests.
2270
2271 2019-04-01  Chris Dumez  <cdumez@apple.com>
2272
2273         UIProcess crash when a prewarmed process is terminated
2274         https://bugs.webkit.org/show_bug.cgi?id=196451
2275         <rdar://problem/49245471>
2276
2277         Reviewed by Geoffrey Garen.
2278
2279         Stop assuming that WebProcessProxy::m_websiteDataStore is non-null as this is no longer
2280         true after r243384. For example, prewarmed WebContent processe do not get a data store
2281         until they actually get used.
2282
2283         * UIProcess/API/Cocoa/WKProcessPool.mm:
2284         (-[WKProcessPool _prewarmedProcessIdentifier]):
2285         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2286         * UIProcess/WebProcessPool.cpp:
2287         (WebKit::WebProcessPool::networkProcessIdentifier):
2288         (WebKit::WebProcessPool::prewarmedProcessIdentifier):
2289         * UIProcess/WebProcessPool.h:
2290         * UIProcess/WebProcessProxy.cpp:
2291         (WebKit::WebProcessProxy::didClose):
2292         (WebKit::WebProcessProxy::didFinishLaunching):
2293         (WebKit::WebProcessProxy::requestTermination):
2294         (WebKit::WebProcessProxy::isReleaseLoggingAllowed const):
2295         * UIProcess/WebProcessProxy.h:
2296
2297 2019-04-01  Patrick Griffis  <pgriffis@igalia.com>
2298
2299         [GTK][WPE] Add more websitedatastore directories to web process sandbox
2300         https://bugs.webkit.org/show_bug.cgi?id=196447
2301
2302         Reviewed by Michael Catanzaro.
2303
2304         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
2305         (WebKit::bubblewrapSpawn):
2306         * UIProcess/glib/WebProcessProxyGLib.cpp:
2307         (WebKit::WebProcessProxy::platformGetLaunchOptions):
2308
2309 2019-04-01  Per Arne Vollan  <pvollan@apple.com>
2310
2311         [macOS] Crash when loading Twitter with autoplay video enabled.
2312         https://bugs.webkit.org/show_bug.cgi?id=196446
2313         <rdar://problem/49060359>
2314
2315         Reviewed by Brent Fulgham.
2316
2317         This is caused by a syscall violation.
2318
2319         * WebProcess/com.apple.WebProcess.sb.in:
2320
2321 2019-04-01  Patrick Griffis  <pgriffis@igalia.com>
2322
2323         [GTK][WPE] Fix seccomp rule for blacklisting TIOCSTI
2324         https://bugs.webkit.org/show_bug.cgi?id=196297
2325
2326         Reviewed by Michael Catanzaro.
2327
2328         More information can be found here: https://www.exploit-db.com/exploits/46594
2329
2330         Note that this sandbox never made it into production so does not
2331         warrant any CVE specific to WebKit.
2332
2333         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
2334         (WebKit::setupSeccomp):
2335
2336 2019-03-31  Wenson Hsieh  <wenson_hsieh@apple.com>
2337
2338         [iOS] Crash when changing inputmode for certain types of focusable elements
2339         https://bugs.webkit.org/show_bug.cgi?id=196431
2340         <rdar://problem/49454962>
2341
2342         Reviewed by Tim Horton.
2343
2344         The crash is happening because WebPage::focusedElementDidChangeInputMode assumes that the document's focused
2345         element must be the same as m_focusedElement in WebPage. However, this is not the case, since m_focusedElement
2346         is only set for certain types of elements that require user input (e.g. text fields, editable content, select
2347         menus, etc.). The function then attempts to dereference m_focusedElement, which may be null if the document's
2348         focused element doesn't fall into one of the aforementioned categories.
2349
2350         To fix this, bail if the element that is changing inputmode is not equal to the WebPage's current focused
2351         element. See below for more details.
2352
2353         Test: fast/forms/change-inputmode-crash.html
2354
2355         * WebProcess/WebPage/WebPage.cpp:
2356         (WebKit::isTextFormControlOrEditableContent):
2357
2358         Clean up some existing logic by introducing a helper method for determining whether an element should
2359         propagate inputmode attribute changes to the UI process. Also, check the element type using type traits instead
2360         of checking against the tag name.
2361
2362         (WebKit::WebPage::elementDidFocus):
2363         (WebKit::WebPage::focusedElementDidChangeInputMode):
2364
2365 2019-03-31  Sam Weinig  <weinig@apple.com>
2366
2367         Remove more i386 specific configurations
2368         https://bugs.webkit.org/show_bug.cgi?id=196430
2369
2370         Reviewed by Alexey Proskuryakov.
2371
2372         * Configurations/BaseTarget.xcconfig:
2373         WK_HAVE_CORE_PREDICTION can now be enabled unconditionally.
2374  
2375         * Configurations/FeatureDefines.xcconfig:
2376         ENABLE_WEB_AUTHN_macosx can now be enabled unconditionally on macOS.
2377
2378 2019-03-31  Andy Estes  <aestes@apple.com>
2379
2380         [iOS] WebKit should consult the navigation response policy delegate before previewing a QuickLook document
2381         https://bugs.webkit.org/show_bug.cgi?id=196433
2382         <rdar://problem/49293305>
2383
2384         Reviewed by Tim Horton.
2385
2386         Added WKWebViewConfiguration SPI for setting the QuickLook navigation response policy
2387         decision behavior. The configuration setting defaults to YES for clients linked on or after
2388         this WebKit change and NO otherwise.
2389
2390         * NetworkProcess/NetworkResourceLoader.cpp:
2391         (WebKit::NetworkResourceLoader::shouldInterruptLoadForCSPFrameAncestorsOrXFrameOptions):
2392         * Shared/WebPreferences.yaml:
2393         * Shared/ios/QuickLookDocumentData.cpp:
2394         (WebKit::QuickLookDocumentData::isEmpty const):
2395         * Shared/ios/QuickLookDocumentData.h:
2396         * UIProcess/API/Cocoa/WKWebView.mm:
2397         (-[WKWebView _initializeWithConfiguration:]):
2398         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2399         (defaultShouldDecidePolicyBeforeLoadingQuickLookPreview):
2400         (-[WKWebViewConfiguration init]):
2401         (-[WKWebViewConfiguration encodeWithCoder:]):
2402         (-[WKWebViewConfiguration initWithCoder:]):
2403         (-[WKWebViewConfiguration copyWithZone:]):
2404         (-[WKWebViewConfiguration _shouldDecidePolicyBeforeLoadingQuickLookPreview]):
2405         (-[WKWebViewConfiguration _setShouldDecidePolicyBeforeLoadingQuickLookPreview:]):
2406         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2407         * UIProcess/Cocoa/VersionChecks.h:
2408         * WebProcess/WebCoreSupport/ios/WebPreviewLoaderClient.cpp:
2409         (WebKit::WebPreviewLoaderClient::didReceiveDataArray):
2410
2411 2019-03-30  Zalan Bujtas  <zalan@apple.com>
2412
2413         [ContentChangeObserver] Subframe load should not reset content observation on the mainframe
2414         https://bugs.webkit.org/show_bug.cgi?id=196408
2415         <rdar://problem/49436797>
2416
2417         Reviewed by Simon Fraser.
2418
2419         Hover intent fails when an unrelated frame commits a load the same time.
2420         cancelPotentialTapInFrame is called from didCommitLoad, but what we are looking for here is the user initiated cancel of a tap (cancelPotentialTap).
2421         (If the current frame navigates away, willDetachPage takes care of canceling the observation.)
2422
2423         * WebProcess/WebPage/ios/WebPageIOS.mm:
2424         (WebKit::WebPage::cancelPotentialTap):
2425         (WebKit::WebPage::cancelPotentialTapInFrame):
2426
2427 2019-03-29  John Wilander  <wilander@apple.com>
2428
2429         Move WebResourceLoadStatisticsStore IPC calls from the UI process to the network process
2430         https://bugs.webkit.org/show_bug.cgi?id=196407
2431         <rdar://problem/47859936>
2432
2433         Reviewed by Brent Fulgham.
2434
2435         The two WebResourceLoadStatisticsStore IPC endpoints were left behind when we
2436         moved Resource Load Statistics from the UI process to the network process. One
2437         of the endpoints is the message RequestStorageAccessUnderOpener which underpins
2438         our compatibility fix for federated logins using popups. This patch redirects
2439         these IPC calls to the network process and cleans up some assumptions around
2440         them.
2441
2442         * CMakeLists.txt:
2443             Removed the old IPC receiver.
2444         * DerivedSources.make:
2445             Removed the old IPC receiver.
2446         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
2447         (WebKit::WebResourceLoadStatisticsStore::requestUpdate): Deleted.
2448             This is no longer needed since there is a dedicated update mechanism
2449             that actually sends the update.
2450         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
2451         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2452         (WebKit::NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated):
2453         (WebKit::NetworkConnectionToWebProcess::requestStorageAccessUnderOpener):
2454             Two new IPC receivers to pipe the calls to the network process.
2455         (WebKit::NetworkConnectionToWebProcess::requestResourceLoadStatisticsUpdate): Deleted.
2456             NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated now serves
2457             this purpose.
2458         * NetworkProcess/NetworkConnectionToWebProcess.h:
2459         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2460         * UIProcess/WebResourceLoadStatisticsStore.messages.in: Removed.
2461             Removed the old IPC receiver.
2462         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2463         * WebKit.xcodeproj/project.pbxproj:
2464         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
2465         (WKBundleResourceLoadStatisticsNotifyObserver):
2466             Function name update.
2467         * WebProcess/WebProcess.cpp:
2468             Now calls IPC to the network process instead of the UI process.
2469
2470 2019-03-29  Myles C. Maxfield  <mmaxfield@apple.com>
2471
2472         Delete WebMetal implementation in favor of WebGPU
2473         https://bugs.webkit.org/show_bug.cgi?id=195418
2474
2475         Reviewed by Dean Jackson.
2476
2477         * Configurations/FeatureDefines.xcconfig:
2478         * Shared/WebPreferences.yaml:
2479         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2480         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2481
2482 2019-03-29  Takashi Komori  <Takashi.Komori@sony.com>
2483
2484         [Curl] Add Server Trust Evaluation Support.
2485         https://bugs.webkit.org/show_bug.cgi?id=191646
2486
2487         Reviewed by Fujii Hironori.
2488
2489         Tests: http/tests/ssl/iframe-upgrade.https.html
2490                http/tests/ssl/mixedContent/insecure-websocket.html
2491                http/tests/ssl/upgrade-origin-usage.html
2492
2493         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
2494         (WebKit::NetworkDataTaskCurl::curlDidFailWithError):
2495         (WebKit::NetworkDataTaskCurl::tryServerTrustEvaluation):
2496         (WebKit::NetworkDataTaskCurl::restartWithCredential):
2497         * NetworkProcess/curl/NetworkDataTaskCurl.h:
2498
2499 2019-03-29  Cathie Chen  <cathiechen@igalia.com>
2500
2501         Implement ResizeObserver.
2502         https://bugs.webkit.org/show_bug.cgi?id=157743
2503
2504         Reviewed by Simon Fraser.
2505
2506         Add WebPreferences and FeatureDefines for ResizeObserver.
2507
2508         * Configurations/FeatureDefines.xcconfig:
2509         * Shared/WebPreferences.yaml:
2510
2511 2019-03-28  Timothy Hatcher  <timothy@apple.com>
2512
2513         CFDictionary encoder crashes on non-string keys.
2514         https://bugs.webkit.org/show_bug.cgi?id=196388
2515         rdar://problem/49339242
2516
2517         Reviewed by Ryosuke Niwa.
2518
2519         Allow non-string keys in CFDictionary encoding/decoding. Encode the correct
2520         size for dictionaries and arrays when unknown keys or values are skipped.
2521         Allow null array encoding and decoding like dictionary already allowed.
2522
2523         * Shared/cf/ArgumentCodersCF.cpp:
2524         (IPC::encode):
2525         (IPC::decode):
2526
2527 2019-03-28  John Wilander  <wilander@apple.com>
2528
2529         Resource Load Statistics: IPC to the WebsiteDataStore in the UI process from NetworkProcess::deleteWebsiteDataForRegistrableDomains()
2530         https://bugs.webkit.org/show_bug.cgi?id=196281
2531         <rdar://problem/48938748>
2532
2533         Reviewed by Alex Christensen.
2534
2535         The move of Resource Load Statistics to the network process requires that it
2536         calls the UI process when clearing website data (previously the other way
2537         around). This patch achieves that.
2538
2539         Specifically, NetworkProcess::deleteWebsiteDataForRegistrableDomains() now
2540         filters its WebsiteDataTypes down to just the ones applicable for the UI
2541         process and then calls DeleteWebsiteDataInUIProcessForRegistrableDomains over
2542         IPC.
2543
2544         NetworkProcessProxy::deleteWebsiteDataInUIProcessForRegistrableDomains() on
2545         the UI process side makes use of the re-introduced
2546         WebsiteDataStore::fetchDataForRegistrableDomains() function to get the relevant
2547         data records and call WebsiteDataStore::removeData(). The re-introduced
2548         WebsiteDataStore::fetchDataForRegistrableDomains() was removed as dead code in
2549         https://trac.webkit.org/changeset/242056/webkit, then under the name
2550         WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains(). The reason it
2551         was dead code was the lack of IPC call that this patch adds.
2552
2553         * NetworkProcess/NetworkProcess.cpp:
2554         (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
2555            Now calls DeleteWebsiteDataInUIProcessForRegistrableDomains over IPC if there
2556            are WebsiteDataTypes applicable to the UI process.
2557         * NetworkProcess/NetworkProcess.h:
2558         * Shared/WebsiteData/WebsiteData.cpp:
2559         (WebKit::WebsiteData::ownerProcess):
2560         (WebKit::WebsiteData::filter):
2561             Convenience functions to manage process ownership of website data types.
2562         * Shared/WebsiteData/WebsiteData.h:
2563         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2564         (WKWebsiteDataStoreStatisticsHasLocalStorage):
2565             Test infrastructure, called by the TestRunner.
2566         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
2567         * UIProcess/Network/NetworkProcessProxy.cpp:
2568         (WebKit::NetworkProcessProxy::deleteWebsiteDataInUIProcessForRegistrableDomains):
2569             New function to be called from the network process.
2570         * UIProcess/Network/NetworkProcessProxy.h:
2571         * UIProcess/Network/NetworkProcessProxy.messages.in:
2572         * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
2573         (WebKit::WebsiteDataRecord::matches const):
2574             Now matches with WebCore::RegistrableDomain instead of a string.
2575         (WebKit::WebsiteDataRecord::matchesTopPrivatelyControlledDomain const): Deleted.
2576             Replaced by WebsiteDataRecord::matches().
2577         * UIProcess/WebsiteData/WebsiteDataRecord.h:
2578         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2579         (WebKit::WebsiteDataStore::fetchDataForRegistrableDomains):
2580             Re-introduced. It was removed as dead code in r242056.
2581         (WebKit::computeNetworkProcessAccessTypeForDataRemoval):
2582         (WebKit::WebsiteDataStore::hasLocalStorageForTesting const):
2583             Test infrastructure, called by the TestRunner.
2584         * UIProcess/WebsiteData/WebsiteDataStore.h:
2585
2586 2019-03-28  Jiewen Tan  <jiewen_tan@apple.com>
2587
2588         API::Data::createWithoutCopying should do a null check before calling CFRelease
2589         https://bugs.webkit.org/show_bug.cgi?id=196276
2590         <rdar://problem/48059859>
2591
2592         Reviewed by Alex Christensen.
2593
2594         * Shared/Cocoa/APIDataCocoa.mm:
2595         (API::Data::createWithoutCopying):
2596
2597 2019-03-28  Per Arne Vollan  <pvollan@apple.com>
2598
2599         [iOS] Automatic focus of input field is flaky
2600         https://bugs.webkit.org/show_bug.cgi?id=196302
2601
2602         Reviewed by Brent Fulgham.
2603
2604         Sometimes the status of whether a keyboard is connected can be incorrect, both in the UI process, and in
2605         the WebContent process. Fix this by sending the keyboard status to the WebContent process as part of the
2606         Web page creation parameters. Stop caching the keyboard status in the Web process proxy, and call
2607         [UIKeyboard isInHardwareKeyboardMode] instead, since this method is swizzled in the test harness.
2608
2609         * Shared/WebPageCreationParameters.cpp:
2610         (WebKit::WebPageCreationParameters::encode const):
2611         (WebKit::WebPageCreationParameters::decode):
2612         * Shared/WebPageCreationParameters.h:
2613         * UIProcess/API/Cocoa/WKWebView.mm:
2614         (hardwareKeyboardAvailabilityChangedCallback):
2615         * UIProcess/WebPageProxy.cpp:
2616         (WebKit::WebPageProxy::creationParameters):
2617         * UIProcess/WebPageProxy.h:
2618         * UIProcess/WebProcessProxy.cpp:
2619         * UIProcess/WebProcessProxy.h:
2620         (WebKit::WebProcessProxy::setKeyboardIsAttached): Deleted.
2621         (WebKit::WebProcessProxy::keyboardIsAttached const): Deleted.
2622         * UIProcess/ios/WKContentViewInteraction.mm:
2623         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
2624         * UIProcess/ios/WebPageProxyIOS.mm:
2625         (WebKit::WebPageProxy::isInHardwareKeyboardMode):
2626         (WebKit::WebPageProxy::applicationWillEnterForeground):
2627         * WebProcess/WebPage/WebPage.cpp:
2628         * WebProcess/WebPage/WebPage.h:
2629
2630 2019-03-28  Tim Horton  <timothy_horton@apple.com>
2631
2632         Fix the build.
2633
2634         * UIProcess/ios/WKActionSheetAssistant.mm:
2635         (-[WKActionSheetAssistant showImageSheet]):
2636         * UIProcess/ios/WKContentViewInteraction.mm:
2637         (-[WKContentView actionSheetAssistant:showCustomSheetForElement:]):
2638
2639 2019-03-28  Michael Catanzaro  <mcatanzaro@igalia.com>
2640
2641         [WPE][GTK] webkit_web_resource_get_data_finish can return NULL without setting error
2642         https://bugs.webkit.org/show_bug.cgi?id=186276
2643
2644         Reviewed by Carlos Garcia Campos.
2645
2646         Currently it's possible for webkit_web_resource_get_data_finish() to return NULL without
2647         setting the error parameter. This is illegal because it is an API guarantee (and a GObject
2648         convention) that if an error parameter exists, it should be set whenever a function call
2649         returns NULL. Epiphany correctly dereferences the error in this case without checking if it
2650         is NULL, because it knows it does not have to, and crashes. Fix this. We'll return a byte
2651         array of length 1 containing a NUL character. This isn't great, but there's not really any
2652         better solution without deprecating the API or returning an error code to indicate an empty
2653         resource, and it at least fixes the Epiphany crash.
2654
2655         This does not fix bug #186276, in which this function incorrectly returns no data when it
2656         ought to. But that is a different bug. Now, at least we won't crash when no data is
2657         available.
2658
2659         * UIProcess/API/glib/WebKitWebResource.cpp:
2660         (resourceDataCallback):
2661
2662 2019-03-28  Daniel Bates  <dabates@apple.com>
2663
2664         [iPad] Tapping on a popup form control may not show a popover
2665         https://bugs.webkit.org/show_bug.cgi?id=196322
2666         <rdar://problem/49229632>
2667
2668         Reviewed by Wenson Hsieh.
2669
2670         Stop taking advantage of -[WKContentView inputView] being called when we invoke -reloadInputViews
2671         to "lazily" allocate the input peripheral for the currently focused element. In theory, UIKit only
2672         needs to call -inputView when it actually needs to display the input view (the keyboard). For
2673         popup menu buttons, like <select>, no keyboard is needed. Instead we should create the peripheral
2674         as part of the logic in the UI process to focus a new element before we call -reloadInputViews.
2675
2676         * UIProcess/ios/WKContentViewInteraction.mm:
2677         (-[WKContentView inputView]): Extract logic to allocate the peripheral from here and moved it to createInputPeripheralWithView().
2678         (-[WKContentView accessoryTab:]): While I am here, add a FIXME comment to explain why we need to
2679         end the input sessions and nullify the input peripheral before we tell the web process to switch
2680         focus as opposed to letting this happen after the web process tells us it focused a new element.
2681         (createInputPeripheralWithView): Added.
2682         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
2683         Write in terms of createInputPeripheralWithView(). Create the input peripheral after becoming
2684         first responder because creating the peripheral has known side-effects: for popup buttons it
2685         tells the popup controller to present the popover. For key input to popovers to work from the get-go,
2686         the content view must be the first responder. See <https://bugs.webkit.org/show_bug.cgi?id=196272>
2687         for more details.
2688
2689 2019-03-28  Víctor Manuel Jáquez Leal  <vjaquez@igalia.com>
2690
2691         Silence lot of warnings when compiling with clang
2692         https://bugs.webkit.org/show_bug.cgi?id=196310
2693
2694         Reviewed by Michael Catanzaro.
2695
2696         * UIProcess/API/glib/WebKitInjectedBundleClient.cpp: add missing
2697         override clause.
2698         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h: add
2699         missing override clause.
2700
2701 2019-03-27  Ryosuke Niwa  <rniwa@webkit.org>
2702
2703         [macOS] Select element doesn't show popup if select element had lost focus while popup was previosuly shown
2704         https://bugs.webkit.org/show_bug.cgi?id=196336
2705
2706         Reviewed by Tim Horton.
2707
2708         The bug was caused by WebPopupMenu::hide never notifying PopupClient that the popup had been dismissed.
2709         This resulted in RenderMenuList::m_popupIsVisible to be never reset.
2710
2711         Also fixed a bug in WebPopupMenuProxyMac::hidePopupMenu that this function was never dismissing
2712         the popup as the selector "dismissPopUp", on the contrary to its name, does not dimiss the popup.
2713         Send cancelTracking to NSMenu instead, which DOES dismiss the popup.
2714
2715         Tests: fast/forms/select/mac-wk2/blur-dismisses-select-popup.html
2716                fast/forms/select/mac-wk2/open-select-popup-after-dismissing-by-blur.html
2717
2718         * UIProcess/mac/WebPopupMenuProxyMac.mm:
2719         (WebKit::WebPopupMenuProxyMac::hidePopupMenu):
2720         * WebProcess/WebCoreSupport/WebPopupMenu.cpp:
2721         (WebKit::WebPopupMenu::hide):
2722
2723 2019-03-27  Dean Jackson  <dino@apple.com>
2724
2725         [ARKit] Black view when opening a 3D model usdz file in new tab
2726         https://bugs.webkit.org/show_bug.cgi?id=196333
2727         <rdar://problem/47693367>
2728
2729         Reviewed by Tim Horton.
2730
2731         When opening a new WKSystemPreviewView, we were exiting if there was no
2732         presentingViewController. This code was unnecessary, and causing blank
2733         content when opening a new tab.
2734
2735         * UIProcess/ios/WKSystemPreviewView.mm:
2736         (-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]):
2737         Remove the code looking for a presentingViewController.
2738
2739 2019-03-27  Wenson Hsieh  <wenson_hsieh@apple.com>
2740
2741         Need a way to include WebKitAdditions code in WebKit API headers
2742         https://bugs.webkit.org/show_bug.cgi?id=196173
2743
2744         Reviewed by Tim Horton.
2745
2746         Introduce a mechanism that allows us to insert code from WebKitAdditions into public or private SDK headers
2747         using `#import`s of the form:
2748
2749         ```
2750         #if USE(APPLE_INTERNAL_SDK)
2751         #import <WebKitAdditions/WKWebViewConfigurationAdditions.h>
2752         #endif
2753         ```
2754
2755         The resulting header in the built products directory will contain the contents of the imported file inserted in
2756         place of the `#if USE(APPLE_INTERNAL_SDK) … #endif` block; however, when building with the Apple internal SDK,
2757         the additions header content will be imported by the usual means.
2758
2759         * mac/postprocess-framework-headers.sh:
2760         * mac/replace-webkit-additions-includes.py: Added.
2761
2762         Add a step when post-processing framework headers to replace instances of `#if USE(APPLE_INTERNAL_SDK) … #endif`
2763         with the text content of the additions files. The replacement script first searches in the built products
2764         directory for the matching additions file, and falls back to the SDK if no matching file is found. If neither
2765         are present (e.g. a build using the public SDK), then the block is simply replaced by the empty string.
2766
2767         (read_content_from_webkit_additions):
2768         (main):
2769
2770 2019-03-27  Andy Estes  <aestes@apple.com>
2771
2772         REGRESSION (r242686): package-root creates roots with broken symlinks in WebKit.framework/XPCServices/
2773         https://bugs.webkit.org/show_bug.cgi?id=196317
2774
2775         Reviewed by Dan Bernstein.
2776
2777         Removed some remnants of the Storage Process.
2778
2779         * Configurations/BaseTarget.xcconfig:
2780         * Resources/SandboxProfiles/ios/com.apple.WebKit.Storage.sb: Removed.
2781         * WebKit.xcodeproj/project.pbxproj:
2782
2783 2019-03-27  Keith Rollin  <krollin@apple.com>
2784
2785         Include the CFNetworking task UUID to the NSError when a resource-load fails
2786         https://bugs.webkit.org/show_bug.cgi?id=196156
2787
2788         Reviewed by Alex Christensen.
2789
2790         In order to help track the connection between a failed resource-load
2791         and a user-visible error message, include the CFNetworking task UUID
2792         in the associated error as an element of the userInfo property. This
2793         can then be pulled out and reported in the logging at the point the
2794         error is reported to the user.
2795
2796         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2797         (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
2798
2799 2019-03-27  Chris Dumez  <cdumez@apple.com>
2800
2801         [ iOS Sim ] REGRESSION (r242277) Layout Test http/tests/cookies/same-site/lax-samesite-cookie-after-cross-site-history-load.php is a flaky timeout
2802         https://bugs.webkit.org/show_bug.cgi?id=195425
2803         <rdar://problem/48682403>
2804
2805         Reviewed by Alex Christensen.
2806
2807         When process-swapping on history navigation, we lookup the WebProcessProxy we'd like to use from the
2808         process identifier that is saved on the WebBackForwardListItem, to try and load the item in the process
2809         in which it was previously loaded. However, we were failing to check if the WebProcess in question was
2810         still running so we could potentially try to use a process that's already exited.
2811
2812         * UIProcess/WebProcessPool.cpp:
2813         (WebKit::WebProcessPool::processForNavigationInternal):
2814
2815 2019-03-27  Zalan Bujtas  <zalan@apple.com>
2816
2817         [ContentChangeObserver] Always dispatch the synthetic click asynchronously
2818         https://bugs.webkit.org/show_bug.cgi?id=196278
2819         <rdar://problem/49299968>
2820
2821         Reviewed by Simon Fraser.
2822
2823         This patch ensures that all completeSyntheticClick() calls happen in an asynchronous manner (unless the feature is turned off).
2824
2825         * WebProcess/WebPage/ios/WebPageIOS.mm:
2826         (WebKit::dispatchSyntheticMouseMove):
2827         (WebKit::WebPage::handleSyntheticClick):
2828
2829 2019-03-27  Tim Horton  <timothy_horton@apple.com>
2830
2831         Fix some more deprecation warnings in WKDrawingView
2832         https://bugs.webkit.org/show_bug.cgi?id=196282
2833         <rdar://problem/47637608>
2834
2835         Reviewed by Wenson Hsieh.
2836
2837         * Platform/spi/ios/PencilKitSPI.h:
2838         * SourcesCocoa.txt:
2839         * UIProcess/ios/PencilKitSoftLink.h:
2840         * UIProcess/ios/PencilKitSoftLink.mm:
2841         * UIProcess/ios/WKContentViewInteraction.mm:
2842         * UIProcess/ios/WKDrawingCoordinator.h:
2843         * UIProcess/ios/WKDrawingCoordinator.mm:
2844         (-[WKDrawingCoordinator initWithContentView:]):
2845         (-[WKDrawingCoordinator currentInk]):
2846         (-[WKDrawingCoordinator undoManagerForInkPicker:]):
2847         (-[WKDrawingCoordinator containingViewForInkPicker:]):
2848         (-[WKDrawingCoordinator inkPickerDidToggleRuler:]):
2849         (-[WKDrawingCoordinator inkPickerDidChangeInk:]):
2850         (-[WKDrawingCoordinator installInkPickerForDrawing:]):
2851         (-[WKDrawingCoordinator uninstallInkPicker]):
2852         (-[WKDrawingCoordinator inkPicker]): Deleted.
2853         (-[WKDrawingCoordinator didChangeRulerState:]): Deleted.
2854         (-[WKDrawingCoordinator didChangeInk:]): Deleted.
2855         * UIProcess/ios/WKDrawingView.mm:
2856         (-[WKDrawingView _canvasViewWillBeginDrawing:]):
2857         * UIProcess/ios/WKInkPickerView.h: Removed.
2858         * UIProcess/ios/WKInkPickerView.mm: Removed.
2859         * WebKit.xcodeproj/project.pbxproj:
2860         Adopt the new names.
2861
2862 2019-03-27  Carlos Garcia Campos  <cgarcia@igalia.com>
2863
2864         Geolocation request not complete when watch request was started in a different web process
2865         https://bugs.webkit.org/show_bug.cgi?id=195996
2866
2867         Reviewed by Alex Christensen.
2868
2869         In WebGeolocationManagerProxy::startUpdating() we do nothing when the provider is already updating. We should
2870         reply with a DidChangePosition using the last known position, if available. If we are updating, but we still
2871         don't have a known position, the request will be completed when
2872         WebGeolocationManagerProxy::providerDidChangePosition() is called since it always notifies all web
2873         processes.
2874
2875         * UIProcess/WebGeolocationManagerProxy.cpp:
2876         (WebKit::WebGeolocationManagerProxy::providerDidChangePosition): Cache the position.
2877         (WebKit::WebGeolocationManagerProxy::startUpdating): Reply using cached position if already known.
2878         * UIProcess/WebGeolocationManagerProxy.h:
2879         (WebKit::WebGeolocationManagerProxy::lastPosition const): Return cached position.
2880         * WebProcess/WebCoreSupport/WebGeolocationClient.cpp:
2881         (WebKit::WebGeolocationClient::lastPosition): Remove the FIXME since we don't want this feature.
2882
2883 2019-03-26  Brent Fulgham  <bfulgham@apple.com>
2884
2885         [macOS] Correct kerberos-related sandbox violations
2886         https://bugs.webkit.org/show_bug.cgi?id=196279
2887         <rdar://problem/48622502>
2888
2889         Reviewed by Per Arne Vollan.
2890
2891         We need to allow communications with a Kerberos-related service on macOS
2892         until <rdar://problem/35542803> is fixed.
2893
2894         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
2895
2896 2019-03-26  Chris Dumez  <cdumez@apple.com>
2897
2898         [macOS] The network process is not exiting reliably when the WebProcessPool is destroyed
2899         https://bugs.webkit.org/show_bug.cgi?id=196277
2900         <rdar://problem/49127581>
2901
2902         Reviewed by Alex Christensen.
2903
2904         When, an AuxiliaryProcess receives the AuxiliaryProcess::Terminate IPC, it calls stopRunLoop()
2905         to exit. WebProcess overrides AuxiliaryProcess::stopRunLoop() to call exit(0) on the main
2906         thread. Other auxiliary processes such as the NetworkProcess would end up calling
2907         platformStopRunLoop(). On iOS and iOSMac, platformStopRunLoop() calls XPCServiceExit(), which
2908         makes sense since auxiliary processes run their run loop by calling xpc_main(). However, on
2909         macOS, platformStopRunLoop() was calling RunLoop::main().stop() to exit instead, which was
2910         unreliable as demonstrated by the test app attached to the radar.
2911
2912         Updating platformStopRunLoop() to call XPCServiceExit() on macOS fixes the problem and I now
2913         see the NetworkProcess exiting reliably there. This is the approach I have chosen in this
2914         patch since it appears to be reliable and it makes the code consistent on all Cocoa platforms.
2915
2916         * Shared/AuxiliaryProcess.cpp:
2917         * Shared/Cocoa/AuxiliaryProcessCocoa.mm:
2918         (WebKit::AuxiliaryProcess::platformStopRunLoop):
2919         * Shared/ios/AuxiliaryProcessIOS.mm:
2920         (WebKit::AuxiliaryProcess::platformStopRunLoop): Deleted.
2921         * Shared/mac/AuxiliaryProcessMac.mm:
2922         (WebKit::AuxiliaryProcess::platformStopRunLoop): Deleted.
2923
2924 2019-03-26  Keith Rollin  <krollin@apple.com>
2925
2926         Inhibit CFNetwork logging in private sessions
2927         https://bugs.webkit.org/show_bug.cgi?id=196268
2928         <rdar://problem/48210793>
2929
2930         Reviewed by Alex Christensen.
2931
2932         Before performing any logging, the NetworkProcess checks to see if
2933         it's performing an operation associated with a private (ephemeral)
2934         browsing session. If so, it skips the logging. However, networking
2935         layers below the NetworkProcess don't know about private browsing, so
2936         they would still perform their own logging. CFNetwork now has a flag
2937         that lets us control that, so set it to False if private browsing.
2938
2939         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2940         (WebKit::configurationForSessionID):
2941
2942 2019-03-26  Chris Dumez  <cdumez@apple.com>
2943
2944         Add basic layout test coverage for File Picker on iOS
2945         https://bugs.webkit.org/show_bug.cgi?id=196265
2946
2947         Reviewed by Wenson Hsieh.
2948
2949         Add layout test infrastructure to test the file picker on iOS.
2950
2951         * UIProcess/API/Cocoa/WKWebView.mm:
2952         (-[WKWebView _dismissFilePicker]):
2953         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2954         * UIProcess/ios/WKContentViewInteraction.h:
2955         * UIProcess/ios/WKContentViewInteraction.mm:
2956         (-[WKContentView dismissFilePicker]):
2957         (-[WKContentView _contentsOfUserInterfaceItem:]):
2958         * UIProcess/ios/forms/WKFileUploadPanel.h:
2959         * UIProcess/ios/forms/WKFileUploadPanel.mm:
2960         (-[WKFileUploadPanel currentAvailableActionTitles]):
2961
2962 2019-03-26  Daniel Bates  <dabates@apple.com>
2963
2964         [iOS][WK2] Use a better concept to describe the reason we defer zooming a focused element: selectabiltiy
2965         https://bugs.webkit.org/show_bug.cgi?id=196264
2966
2967         Reviewed by Wenson Hsieh.
2968
2969         Rename shouldDeferZoomingToSelectionWhenRevealingFocusedElement() to mayContainSelectableText() to describe
2970         the criterion that we will use to decide whether to defer zooming or not. We defer zooming only for elements
2971         that may support text selection on initial focus because we do not have an up-to-date selection rect at that
2972         time. For element, like <select>, that do not support text selection, we can zoom them immediately when focused.
2973
2974         * UIProcess/ios/WKContentViewInteraction.mm:
2975         (mayContainSelectableText): Renamed from shouldDeferZoomingToSelectionWhenRevealingFocusedElement.
2976         List all the input types in the switch block and remove the default case to force the compiler to check that we
2977         covered all cases. This will prevent unforseen keyboard issues (why isn't the keyboard shown? or why is the keyboard shown?)
2978         for future input types that we may add.
2979         (rectToRevealWhenZoomingToFocusedElement): Update for renaming.
2980         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]): Add a
2981         comment to explain why we may need to defer the zoom: the focused element supports text selection and we need
2982         to wait for the web process to call back to provide an up-to-date selection rect for us to zoom and reveal.
2983         (-[WKContentView _didReceiveEditorStateUpdateAfterFocus]): Update for renaming.
2984         (shouldDeferZoomingToSelectionWhenRevealingFocusedElement): Deleted.
2985
2986 2019-03-26  Wenson Hsieh  <wenson_hsieh@apple.com>
2987
2988         Implement async paste method on UIWKInteractionViewProtocol
2989         https://bugs.webkit.org/show_bug.cgi?id=196267
2990         <rdar://problem/49236346>
2991
2992         Reviewed by Tim Horton.
2993
2994         Implement a new UIWKInteractionViewProtocol hook to perform a paste command, and invoke the given completion
2995         handler when pasting is finished.
2996
2997         Test: UIPasteboardTests.PasteWithCompletionHandler
2998
2999         * UIProcess/ios/WKContentViewInteraction.mm:
3000         (-[WKContentView pasteWithCompletionHandler:]):
3001
3002 2019-03-26  Per Arne Vollan  <pvollan@apple.com>
3003
3004         [macOS] Fix sandbox violations
3005         https://bugs.webkit.org/show_bug.cgi?id=196262
3006         <rdar://problem/47738015>
3007
3008         Reviewed by Brent Fulgham.
3009
3010         Fix various observed sandbox violations.
3011
3012         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
3013         * WebProcess/com.apple.WebProcess.sb.in:
3014
3015 2019-03-26  Tomoki Imai  <Tomoki.Imai@sony.com>
3016
3017         Assertion failure !isInAcceleratedCompositingMode() in DrawingAreaProxyCoordinatedGraphics::incorporateUpdate when forceCompositingMode is turned on
3018         https://bugs.webkit.org/show_bug.cgi?id=195879
3019
3020         Reviewed by Carlos Garcia Campos.
3021
3022         The root cause is that DrawingAreaProxyCoordinatedGraphics::isInAcceleratedCompositingMode checks both of alwaysUseCompositing() and !m_layerTreeContext.isEmpty().
3023         alwaysUseCompositing() refers preferences, which is written by the application (UIProcess).
3024         On the other hand, m_layerTreeContext is changed when it receives enterAcceleratedCompositingMode/exitAcceleratedCompositingMode from WebProcess.
3025
3026         It results when we set forceCompositingMode and acceleratedCompositingEnabled to true, WebProcess and UIProcess is out of sync until WebProcess sends enterAcceleratedCompositingMode message.
3027         In such situation, WebProcess sends incorporateUpdate to UIProcess because WebProcess is in non-AC mode, but isInAcceleratedCompositingMode becomes true in UIProcess side.
3028
3029         * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:
3030         (WebKit::DrawingAreaProxyCoordinatedGraphics::~DrawingAreaProxyCoordinatedGraphics): Should call exitAcceleratedCompositingMode even when alwaysUseCompositing is true.
3031         (WebKit::DrawingAreaProxyCoordinatedGraphics::enterAcceleratedCompositingMode): enterAcceleratedCompositingMode should check enterAcceleratedCompositingMode is not called twice.
3032         * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h: Remove alwaysUseCompositing from isInAcceleratedCompositingMode
3033
3034 2019-03-26  Antoine Quint  <graouts@apple.com>
3035
3036         Remove mousemoveEventHandlingPreventsDefault internal setting and quirk
3037         https://bugs.webkit.org/show_bug.cgi?id=196254
3038         <rdar://problem/49124334>
3039
3040         Reviewed by Dean Jackson.
3041
3042         * Shared/WebPreferences.yaml:
3043
3044 2019-03-26  Philippe Normand  <pnormand@igalia.com>
3045
3046         [WPE][Qt] Uninitialized racy ViewBackend
3047         https://bugs.webkit.org/show_bug.cgi?id=196247
3048
3049         Reviewed by Carlos Garcia Campos.
3050
3051         * UIProcess/API/wpe/qt/WPEQtView.h: Initialize the backend pointer to nullptr.
3052
3053 2019-03-26  Carlos Garcia Campos  <cgarcia@igalia.com>
3054
3055         Unreviewed. Fix typo in GLib geolocation API after r243285.
3056
3057         gelocation -> geolocation.
3058
3059         * UIProcess/API/glib/WebKitGeolocationManager.cpp:
3060         (webkit_geolocation_manager_class_init):
3061         (webkit_geolocation_manager_update_position):
3062         (webkit_geolocation_manager_failed):
3063         (webkit_gelocation_manager_update_position): Deleted.
3064         (webkit_gelocation_manager_failed): Deleted.
3065         * UIProcess/API/gtk/WebKitGeolocationManager.h:
3066         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
3067         * UIProcess/API/wpe/WebKitGeolocationManager.h:
3068         * UIProcess/API/wpe/docs/wpe-1.0-sections.txt:
3069
3070 2019-03-26  Patrick Griffis  <pgriffis@igalia.com>
3071
3072         [GTK][WPE] Disable process warming
3073         https://bugs.webkit.org/show_bug.cgi?id=196208
3074
3075         Reviewed by Chris Dumez.
3076
3077         Fixes crash caused by r243384.
3078
3079         Process warming is incompatible with our launcher as it expects a valid
3080         WebsiteDataStore at initialization time for sandbox permissions.
3081
3082         * UIProcess/glib/WebProcessPoolGLib.cpp:
3083         (WebKit::WebProcessPool::platformInitialize):
3084
3085 2019-03-25  Alex Christensen  <achristensen@webkit.org>
3086
3087         Do not terminate the NetworkProcess if a third party application sends a NSCredential with a SecIdentityRef
3088         https://bugs.webkit.org/show_bug.cgi?id=196213
3089
3090         Reviewed by Geoff Garen.
3091
3092         A release assertion added in r230225 was reachable.  I reached it in a unit test that responds to a challenge
3093         with a SecIdentityRef wrapped in an NSCredential.
3094
3095         * Shared/cf/ArgumentCodersCF.cpp:
3096         (IPC::decode):
3097
3098 2019-03-25  Chris Dumez  <cdumez@apple.com>
3099
3100         Regression(r242369) Trying to change profile picture on linked in shows file picker, not the image picker
3101         https://bugs.webkit.org/show_bug.cgi?id=196205
3102         <rdar://problem/49083324>
3103
3104         Reviewed by Geoffrey Garen.
3105
3106         Update our FileUploadPanel code on iOS to properly deal with the MIME types containing
3107         wild cards (e.g. "image/*") that are defined in the HTML specification:
3108         - https://html.spec.whatwg.org/multipage/input.html#attr-input-accept
3109
3110         Previously, we would fail to convert those to UTIs.
3111
3112         * UIProcess/ios/forms/WKFileUploadPanel.mm:
3113
3114 2019-03-25  Tim Horton  <timothy_horton@apple.com>
3115
3116         Remove some now-unnecessary dynamic class lookup
3117         https://bugs.webkit.org/show_bug.cgi?id=196237
3118
3119         Reviewed by Simon Fraser.
3120
3121         * Shared/DocumentEditingContext.mm:
3122         (WebKit::DocumentEditingContext::toPlatformContext):
3123
3124 2019-03-25  Tim Horton  <timothy_horton@apple.com>
3125
3126         Get rid of ENABLE(ANIMATED_KEYBOARD_SCROLLING)
3127         https://bugs.webkit.org/show_bug.cgi?id=196224
3128
3129         Reviewed by Simon Fraser.
3130
3131         * Platform/spi/ios/AccessibilitySupportSPI.h:
3132         * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
3133         (-[WKKeyboardScrollingAnimator invalidate]):
3134         (perpendicularAbsoluteUnitVector):
3135         (-[WKKeyboardScrollingAnimator beginWithEvent:]):
3136         (-[WKKeyboardScrollingAnimator stopAnimatedScroll]):
3137         (-[WKKeyboardScrollingAnimator willStartInteractiveScroll]):
3138         (-[WKKeyboardScrollViewAnimator scrollToContentOffset:animated:]):
3139         (-[WKKeyboardScrollViewAnimator scrollWithScrollToExtentAnimationTo:]):
3140         (-[WKKeyboardScrollingAnimator startRepeatTimerIfNeeded]): Deleted.
3141         (-[WKKeyboardScrollingAnimator stopRepeatTimer]): Deleted.
3142         (-[WKKeyboardScrollingAnimator performDiscreteScroll]): Deleted.
3143
3144 2019-03-25  Fujii Hironori  <Hironori.Fujii@sony.com>
3145
3146         Enable IPC sending and receiving non-default-constructible types
3147         https://bugs.webkit.org/show_bug.cgi?id=196132
3148         <rdar://problem/49229221>
3149
3150         Unreviewed build fix for WinCairo port.
3151
3152         error C2440: '=': cannot convert from 'int' to 'HANDLE'
3153
3154         * Platform/win/SharedMemoryWin.cpp:
3155         (WebKit::SharedMemory::Handle::Handle): std::exchange HANDLE with nullptr, not 0.
3156         (WebKit::SharedMemory::Handle::operator=): Ditto.
3157
3158 2019-03-25  Fujii Hironori  <Hironori.Fujii@sony.com>
3159
3160         [Coordinated Graphics][WinCairo] ASSERTION FAILED: state.id == m_nicosia.state.id
3161         https://bugs.webkit.org/show_bug.cgi?id=196190
3162
3163         Reviewed by Žan Doberšek.
3164
3165         This assertion assumes the pre-committed and the committed scenes
3166         are identical. But, the pre-committed scene is updated in the main
3167         thread. Removed the false assertion.
3168
3169         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
3170         (WebKit::CoordinatedGraphicsScene::purgeGLResources): Remove the
3171         assertion. Removed layers of committed scene, not pre-committed
3172         scene.
3173
3174 2019-03-25  Brady Eidson  <beidson@apple.com>
3175
3176         Add socket-delegate to another entitlements config
3177         rdar://problem/48090350 and https://bugs.webkit.org/show_bug.cgi?id=196227
3178
3179         Reviewed by Geoffrey Garen.
3180
3181         * Configurations/Network-iOSMac.entitlements:
3182
3183 2019-03-25  Commit Queue  <commit-queue@webkit.org>
3184
3185         Unreviewed, rolling out r243465.
3186         https://bugs.webkit.org/show_bug.cgi?id=196226
3187
3188         the test doesn't build (Requested by thorton on #webkit).
3189
3190         Reverted changeset:
3191
3192         "Do not terminate the NetworkProcess if a third party
3193         application sends a NSCredential with a SecIdentityRef"
3194         https://bugs.webkit.org/show_bug.cgi?id=196213
3195         https://trac.webkit.org/changeset/243465
3196
3197 2019-03-25  Simon Fraser  <simon.fraser@apple.com>
3198
3199         REGRESSION (r242687): Flicker when pinch-zooming pages in macOS Safari
3200         https://bugs.webkit.org/show_bug.cgi?id=196126
3201         rdar://problem/49095791
3202
3203         Reviewed by Tim Horton.
3204         
3205         I fumbled the commit after the enum rename. Make this actually work.
3206
3207         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3208         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
3209
3210 2019-03-25  Simon Fraser  <simon.fraser@apple.com>
3211
3212         Zoom on macOS is centered around a point lower than the cursor
3213         https://bugs.webkit.org/show_bug.cgi?id=196225
3214         rdar://problem/49213574
3215
3216         Reviewed by Tim Horton.
3217         
3218         The origin handed to ViewGestureController::handleMagnificationGestureEvent is in WKWebView
3219         coordinates, but we end up setting the transform on the RenderView's layer, so we need
3220         to subtract the topContentInset.
3221
3222         * UIProcess/mac/ViewGestureControllerMac.mm:
3223         (WebKit::ViewGestureController::handleMagnificationGestureEvent):
3224
3225 2019-03-25  Alex Christensen  <achristensen@webkit.org>
3226
3227         Do not terminate the NetworkProcess if a third party application sends a NSCredential with a SecIdentityRef
3228         https://bugs.webkit.org/show_bug.cgi?id=196213
3229
3230         Reviewed by Geoff Garen.
3231
3232         A release assertion added in r230225 was reachable.  I reached it in a unit test that responds to a challenge
3233         with a SecIdentityRef wrapped in an NSCredential.
3234
3235         * Shared/cf/ArgumentCodersCF.cpp:
3236         (IPC::decode):
3237
3238 2019-03-25  Chris Dumez  <cdumez@apple.com>
3239
3240         Get rid of WebPage::m_shouldResetDrawingAreaAfterSuspend flag
3241         https://bugs.webkit.org/show_bug.cgi?id=196210
3242         <rdar://problem/48681326>
3243
3244         Reviewed by Geoffrey Garen.
3245
3246         Get rid of WebPage::m_shouldResetDrawingAreaAfterSuspend flag and use the drawing area identifier
3247         instead to reset the DrawingArea in the WebProcess whenever the UIProcess did.
3248
3249         This is less error-prone and guarantees that the WebProcess and the UIProcess can reliably
3250         communicate via DrawingArea IPC.
3251
3252         * WebProcess/WebPage/WebPage.cpp:
3253         (WebKit::WebPage::reinitializeWebPage):
3254         (WebKit::WebPage::setIsSuspended):
3255         * WebProcess/WebPage/WebPage.h:
3256
3257 2019-03-25  Alex Christensen  <achristensen@webkit.org>
3258
3259         Enable IPC sending and receiving non-default-constructible types
3260         https://bugs.webkit.org/show_bug.cgi?id=196132
3261
3262         Reviewed by Geoff Garen.
3263
3264         * Platform/IPC/ArgumentCoder.h:
3265         * Platform/IPC/ArgumentCoders.h:
3266         (IPC::TupleEncoder::encode):
3267         (IPC::tupleFromTupleAndObject):
3268         (IPC::TupleDecoderImpl::decode):
3269         (IPC::TupleDecoderImpl<Type>::decode):
3270         (IPC::TupleDecoder::decode):
3271         (IPC::TupleDecoder<0>::decode):
3272         (IPC::TupleCoder::encode): Deleted.
3273         (IPC::TupleCoder::decode): Deleted.
3274         * Platform/IPC/Connection.h:
3275         (IPC::Connection::sendWithReply):
3276         (IPC::TupleMover::move):
3277         (IPC::moveTuple):
3278         (IPC::Connection::sendSync):
3279         * Platform/IPC/Decoder.h:
3280         (IPC::Decoder::decode):
3281         (IPC::Decoder::operator>>):
3282         * Platform/IPC/HandleMessage.h:
3283         (IPC::handleMessage):
3284         (IPC::handleMessageSynchronous):
3285         (IPC::handleMessageSynchronousWantsConnection):
3286         (IPC::handleMessageAsync):
3287         * Platform/SharedMemory.h:
3288         * Scripts/webkit/LegacyMessages-expected.h:
3289         * Scripts/webkit/Messages-expected.h:
3290         * Scripts/webkit/MessagesSuperclass-expected.h:
3291         * Scripts/webkit/messages.py:
3292         * Shared/Databases/IndexedDB/WebIDBResult.h:
3293         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
3294         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
3295         * Shared/ShareableBitmap.h:
3296         * Shared/ShareableResource.h:
3297         * Shared/UpdateInfo.h:
3298         * Shared/WebEvent.h:
3299         * Shared/WebProcessCreationParameters.cpp:
3300         * Shared/WebProcessCreationParameters.h:
3301         * Shared/mac/SecItemResponseData.cpp:
3302         (WebKit::SecItemResponseData::SecItemResponseData):
3303         (WebKit::SecItemResponseData::decode):
3304         * Shared/mac/SecItemResponseData.h:
3305         * WebProcess/MediaStream/MediaDeviceSandboxExtensions.h:
3306
3307 2019-03-25  Tim Horton  <timothy_horton@apple.com>
3308
3309         Animated keyboard scrolling is extremely chaotic
3310         https://bugs.webkit.org/show_bug.cgi?id=196164
3311         <rdar://problem/48702444>
3312
3313         Reviewed by Simon Fraser.
3314
3315         * UIProcess/ios/WKContentViewInteraction.mm:
3316         (-[WKContentView _interpretKeyEvent:isCharEvent:]):
3317         Consume keyboard events instead of interpreting them traditionally
3318         if WKKeyboardScrollingAnimator is animating.
3319
3320         * UIProcess/ios/WKKeyboardScrollingAnimator.h:
3321         * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
3322         (-[WKKeyboardScrollingAnimator beginWithEvent:]):
3323         (-[WKKeyboardScrollingAnimator handleKeyEvent:]):
3324         (-[WKKeyboardScrollingAnimator stopAnimatedScroll]):
3325         (-[WKKeyboardScrollingAnimator scrollTriggeringKeyIsPressed]):
3326         (-[WKKeyboardScrollingAnimator displayLinkFired:]):
3327         (-[WKKeyboardScrollViewAnimator scrollTriggeringKeyIsPressed]):
3328         Expose the current state of interactive scrolling, and rename the related member.
3329
3330 2019-03-25  Keith Rollin  <krollin@apple.com>
3331
3332         Add WebKit logging for first paint and other interesting layout milestones
3333         https://bugs.webkit.org/show_bug.cgi?id=196159
3334         <rdar://problem/49128952>
3335
3336         Reviewed by Simon Fraser.
3337
3338         Add some logging to indicate what layout milestones have been reached.
3339         This should help us determine if there's a client, rendering, layout,
3340         or some other issue when page content does not appear in the client
3341         window.
3342
3343         The logging is being added to
3344         WebFrameLoaderClient::dispatchDidReachLayoutMilestone. This seems like
3345         a nice central place to capture layout milestones. However, it will
3346         only log notifications that are being sent to clients. It does not
3347         indicate all milestones that have occurred. That is, it does not
3348         report milestones that are filtered out due to client disinterest.
3349         There doesn't seem to be a good central place to capture all
3350         milestones, regardless of client interest.
3351
3352         * Platform/Logging.h:
3353         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3354         (WebKit::WebFrameLoaderClient::dispatchDidReachLayoutMilestone):
3355
3356 2019-03-25  Patrick Griffis  <pgriffis@igalia.com>
3357
3358         [GTK][WPE] Remove network access from web process sandbox
3359         https://bugs.webkit.org/show_bug.cgi?id=189967
3360
3361         Reviewed by Michael Catanzaro.
3362
3363         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
3364         (WebKit::createFlatpakInfo):
3365         (WebKit::bubblewrapSpawn):
3366         * UIProcess/Launcher/glib/FlatpakLauncher.cpp:
3367         (WebKit::flatpakSpawn):
3368
3369 2019-03-25  Andy Estes  <aestes@apple.com>
3370
3371         [Apple Pay] Call +canMakePayments on a work queue
3372         https://bugs.webkit.org/show_bug.cgi?id=196179
3373         <rdar://problem/45388749>
3374
3375         Reviewed by Brady Eidson.
3376
3377         Calling +canMakePayments on either PKPaymentAuthorizationController or
3378         PKPaymentAuthorizationViewController results in synchronous IPC and is therefore very
3379         expensive to call on the main thread. On iOS, these calls are made in the network process,
3380         and on Mac in the UI process.
3381
3382         Call these methods on a work queue to avoid main thread spins.
3383
3384         * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp:
3385         (WebKit::WebPaymentCoordinatorProxy::canMakePayments):
3386         * Shared/ApplePay/WebPaymentCoordinatorProxy.h:
3387         * Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
3388         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments):
3389         * Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
3390         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments):
3391
3392 2019-03-25  Andy Estes  <aestes@apple.com>
3393
3394         [Apple Pay] Remove the AvailablePaymentNetworks synchronous message
3395         https://bugs.webkit.org/show_bug.cgi?id=196180
3396
3397         Reviewed by Youenn Fablet.
3398
3399         Unlike many PassKit interactions, it's ok to call +[PKPaymentRequest availableNetworks]
3400         without an entitlement. Therefore, we can call it from the web process directly rather than
3401         synchronously messaging the entitled UI or networking process.
3402
3403         * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp:
3404         * Shared/ApplePay/WebPaymentCoordinatorProxy.h:
3405         * Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in:
3406         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
3407         * SourcesCocoa.txt:
3408         * WebKit.xcodeproj/project.pbxproj:
3409         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
3410         (WebKit::WebPaymentCoordinator::availablePaymentNetworks):
3411         * WebProcess/ApplePay/WebPaymentCoordinator.h:
3412         * WebProcess/ApplePay/cocoa/WebPaymentCoordinatorCocoa.mm: Added.
3413         (WebKit::WebPaymentCoordinator::platformAvailablePaymentNetworks const):
3414         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
3415         (-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]):
3416         (-[WKAccessibilityWebPageObjectBase setWebPage:]):
3417
3418 2019-03-25  Chris Dumez  <cdumez@apple.com>
3419
3420         Unreviewed, tiny fix after r243388 to address API test failures on iOS
3421
3422         m_processType was properly initialized on macOS but not iOS.
3423
3424         * WebProcess/cocoa/WebProcessCocoa.mm:
3425         (WebKit::WebProcess::platformInitializeProcess):
3426
3427 2019-03-25  Carlos Garcia Campos  <cgarcia@igalia.com>
3428
3429         [GTK][WPE] Do not allow changes in active URI before provisional load starts for non-API requests
3430         https://bugs.webkit.org/show_bug.cgi?id=194208
3431
3432         Reviewed by Michael Catanzaro.
3433
3434         * UIProcess/API/glib/WebKitWebView.cpp:
3435         (webkitWebViewWillStartLoad): Block updates of active URL.
3436         (webkitWebViewLoadChanged): Unblock updates of active URL on WEBKIT_LOAD_STARTED.
3437
3438 2019-03-25  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3439
3440         Remove NavigatorContentUtils in WebCore/Modules
3441         https://bugs.webkit.org/show_bug.cgi?id=196070
3442
3443         Reviewed by Alex Christensen.
3444
3445         NavigatorContentUtils was to support the custom scheme spec [1].
3446         However, in WebKit side, no port has supported the feature in
3447         WebKit layer after EFL port was removed. So there has been the
3448         only IDL implementation of the NavigatorContentUtils in WebCore.
3449         So we don't need to keep the implementation in WebCore anymore.
3450
3451         [1] https://html.spec.whatwg.org/multipage/system-state.html#custom-handlers
3452
3453         * Configurations/FeatureDefines.xcconfig:
3454         * WebProcess/WebCoreSupport/WebNavigatorContentUtilsClient.h: Removed.
3455
3456 2019-03-24  Zan Dobersek  <zdobersek@igalia.com>
3457
3458         Unreviewed WPE build fix.
3459
3460         * UIProcess/wpe/WebPasteboardProxyWPE.cpp:
3461         Add an explicit CompletionHandler.h include to avoid a trip-up in
3462         unified builds.
3463
3464 2019-03-24  Fujii Hironori  <Hironori.Fujii@sony.com>
3465
3466         [WinCairo] WebProcessDataStoreParameters.h(32): error C2653: 'SandboxExtension': is not a class or namespace name
3467         https://bugs.webkit.org/show_bug.cgi?id=196192
3468
3469         Unreviewed for WinCairo port.
3470
3471         * Shared/WebProcessDataStoreParameters.h: Added #include "SandboxExtension.h".
3472
3473 2019-03-24  Andy Estes  <aestes@apple.com>
3474
3475         [watchOS] Remove unused Proximity Networking code
3476         https://bugs.webkit.org/show_bug.cgi?id=196188
3477
3478         Reviewed by Tim Horton.
3479
3480         * Configurations/WebKit.xcconfig:
3481         * NetworkProcess/NetworkProcess.cpp:
3482         (WebKit::NetworkProcess::NetworkProcess):
3483         * NetworkProcess/NetworkProcess.h:
3484         * NetworkProcess/NetworkProcessCreationParameters.cpp:
3485         (WebKit::NetworkProcessCreationParameters::encode const):
3486         (WebKit::NetworkProcessCreationParameters::decode):
3487         * NetworkProcess/NetworkProcessCreationParameters.h:
3488         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
3489         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3490         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
3491         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3492         (WebKit::NetworkProcess::platformPrepareToSuspend):
3493         (WebKit::NetworkProcess::platformProcessDidResume):
3494         (WebKit::NetworkProcess::platformProcessDidTransitionToBackground):
3495         (WebKit::NetworkProcess::platformProcessDidTransitionToForeground):
3496         * NetworkProcess/watchos/NetworkProximityAssertion.h: Removed.
3497         * NetworkProcess/watchos/NetworkProximityAssertion.mm: Removed.
3498         * NetworkProcess/watchos/NetworkProximityManager.h: Removed.
3499         * NetworkProcess/watchos/NetworkProximityManager.mm: Removed.
3500         * SourcesCocoa.txt:
3501         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3502         (API::ProcessPoolConfiguration::copy):
3503         * UIProcess/API/APIProcessPoolConfiguration.h:
3504         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
3505         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
3506         (-[_WKProcessPoolConfiguration wirelessContextIdentifier]):
3507         (-[_WKProcessPoolConfiguration setWirelessContextIdentifier:]):
3508         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3509         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
3510         * WebKit.xcodeproj/project.pbxproj:
3511
3512 2019-03-23  Chris Dumez  <cdumez@apple.com>
3513
3514         Unreviewed, fix typo in comment added in r243379.
3515
3516         * UIProcess/API/Cocoa/WKProcessGroup.mm:
3517         (-[WKProcessGroup setDelegate:]):
3518
3519 2019-03-23  Simon Fraser  <simon.fraser@apple.com>
3520
3521         REGRESSION (iOS 8): Scrollbar can't be hidden when webkit-overflow-scrolling is set to touch
3522         https://bugs.webkit.org/show_bug.cgi?id=137043
3523         rdar://problem/16595330
3524
3525         Reviewed by Zalan Bujtas.
3526
3527         Plumb horizontalScrollbarHiddenByStyle/verticalScrollbarHiddenByStyle through ScrollableAreaParameters
3528         to the UI process, and use it to set UIScrollView indicators visible or not.
3529         
3530         The scroll snap changes in ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren() fix a bug
3531         where hasChangedProperty(HorizontalSnapOffsets) was nested inside another set of hasChangedProperty()
3532         tests, so would never get called.
3533
3534         * Shared/WebCoreArgumentCoders.cpp:
3535         (IPC::ArgumentCoder<ScrollableAreaParameters>::encode):
3536         (IPC::ArgumentCoder<ScrollableAreaParameters>::decode):
3537         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
3538         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):
3539
3540 2019-03-23  Zalan Bujtas  <zalan@apple.com>
3541
3542         [ContentChangeObserver] Taping on a form control should always result in click.
3543         https://bugs.webkit.org/show_bug.cgi?id=196177
3544
3545         Reviewed by Simon Fraser.
3546
3547         This patch enures that we send a synthetic click when the traget node is a form control (button, edit field etc) even if
3548         the mousemove brings up some hover content.
3549
3550         * WebProcess/WebPage/ios/WebPageIOS.mm:
3551         (WebKit::WebPage::handleSyntheticClick):
3552
3553 2019-03-23  Andy Estes  <aestes@apple.com>
3554
3555         [Apple Pay] Stop calling PKPaymentAuthorizationViewController class methods on iOS
3556         https://bugs.webkit.org/show_bug.cgi?id=196163
3557         <rdar://problem/48787564>
3558
3559         Reviewed by Anders Carlsson.
3560
3561         Now that we've transitioned to PKPaymentAuthorizationController on iOS, we should stop
3562         calling PKPaymentAuthorizationViewController class methods on iOS in favor of their
3563         PKPaymentAuthorizationController alternatives.
3564
3565         While we're here, we should also transition to calling
3566         +paymentServicesMerchantURLForAPIType:completion: on both
3567         PKPaymentAuthorizationViewController and PKPaymentAuthorizationController.
3568
3569         * Platform/cocoa/PaymentAuthorizationViewController.mm:
3570         (-[WKPaymentAuthorizationViewControllerDelegate _paymentServicesMerchantURLForAPIType:completion:]):
3571         * Platform/cocoa/WKPaymentAuthorizationDelegate.h:
3572         * Platform/cocoa/WKPaymentAuthorizationDelegate.mm:
3573         (-[WKPaymentAuthorizationDelegate _initWithRequest:presenter:]):
3574         (-[WKPaymentAuthorizationDelegate _paymentServicesMerchantURLForAPIType:completion:]):
3575         * Platform/ios/PaymentAuthorizationController.mm:
3576         (-[WKPaymentAuthorizationControllerDelegate _paymentServicesMerchantURLForAPIType:completion:]):
3577         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
3578         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments): Deleted.
3579         * Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
3580         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments):
3581         * Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
3582         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments):
3583
3584 2019-03-23  Carlos Garcia Campos  <cgarcia@igalia.com>
3585
3586         Unreviewed. Fix GTK build after r243409.
3587
3588         Build failure is actually unrelated to r243409, it's yet another unified build failure that happens when source
3589         file list changes.
3590
3591         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
3592         (WebKit::WebInspectorProxy::platformShowCertificate): Use WebCore namespace for CertificateInfo parameter.
3593
3594 2019-03-23  Carlos Garcia Campos  <cgarcia@igalia.com>
3595
3596         [GTK] Remove build time dependency on Geoclue2
3597         https://bugs.webkit.org/show_bug.cgi?id=195994
3598
3599         Reviewed by Michael Catanzaro.
3600
3601         Add GeoclueGeolocationProvider class to provide geolocation position updates using Geoclue2 DBus service.
3602
3603         * PlatformGTK.cmake:
3604         * PlatformWPE.cmake:
3605         * SourcesGTK.txt:
3606         * SourcesWPE.txt:
3607         * UIProcess/API/glib/WebKitGeolocationManager.cpp:
3608         (_WebKitGeolocationPosition::_WebKitGeolocationPosition):
3609         (webkitGeolocationManagerStop):
3610         (webkitGeolocationManagerSetEnableHighAccuracy):
3611         (webkitGeolocationManagerDispose):
3612         (webkit_geolocation_manager_class_init):
3613         * UIProcess/geoclue/GeoclueGeolocationProvider.cpp: Added.
3614         (WebKit::GeoclueGeolocationProvider::GeoclueGeolocationProvider):
3615         (WebKit::GeoclueGeolocationProvider::~GeoclueGeolocationProvider):
3616         (WebKit::GeoclueGeolocationProvider::start):
3617         (WebKit::GeoclueGeolocationProvider::stop):
3618         (WebKit::GeoclueGeolocationProvider::setEnableHighAccuracy):
3619         (WebKit::GeoclueGeolocationProvider::destroyManagerLater):
3620         (WebKit::GeoclueGeolocationProvider::destroyManager):
3621         (WebKit::GeoclueGeolocationProvider::setupManager):
3622         (WebKit::GeoclueGeolocationProvider::createClient):
3623         (WebKit::GeoclueGeolocationProvider::setupClient):
3624         (WebKit::GeoclueGeolocationProvider::startClient):
3625         (WebKit::GeoclueGeolocationProvider::stopClient):
3626         (WebKit::GeoclueGeolocationProvider::requestAccuracyLevel):
3627         (WebKit::GeoclueGeolocationProvider::clientLocationUpdatedCallback):
3628         (WebKit::GeoclueGeolocationProvider::createLocation):
3629         (WebKit::GeoclueGeolocationProvider::locationUpdated):
3630         (WebKit::GeoclueGeolocationProvider::didFail):
3631         * UIProcess/geoclue/GeoclueGeolocationProvider.h: Added.
3632
3633 2019-03-22  Simon Fraser  <simon.fraser@apple.com>
3634
3635         Undo collision with r243390.
3636
3637         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3638         (stringForSSLProtocol):
3639
3640 2019-03-22  Simon Fraser  <simon.fraser@apple.com>
3641
3642         Fix internal builds.
3643
3644         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3645         (stringForSSLProtocol):
3646
3647 2019-03-22  Keith Rollin  <krollin@apple.com>
3648
3649         Enable ThinLTO support in Production builds
3650         https://bugs.webkit.org/show_bug.cgi?id=190758
3651         <rdar://problem/45413233>
3652
3653         Reviewed by Daniel Bates.
3654
3655         Enable building with Thin LTO in Production when using Xcode 10.2 or
3656         later. This change results in a 1.45% progression in PLT5. Full
3657         Production build times increase about 2-3%. Incremental build times
3658         are more severely affected, and so LTO is not enabled for local
3659         engineering builds.
3660
3661         LTO is enabled only on macOS for now, until rdar://problem/49013399,
3662         which affects ARM builds, is fixed.
3663
3664         To change the LTO setting when building locally:
3665
3666         - If building with `make`, specify WK_LTO_MODE={none,thin,full} on the
3667           command line.
3668         - If building with `build-webkit`, specify --lto-mode={none,thin,full}
3669           on the command line.
3670         - If building with `build-root`, specify --lto={none,thin,full} on the
3671           command line.
3672         - If building with Xcode, create a LocalOverrides.xcconfig file at the
3673           top level of your repository directory (if needed) and define
3674           WK_LTO_MODE to full, thin, or none.
3675
3676         * Configurations/Base.xcconfig:
3677
3678 2019-03-22  Chris Dumez  <cdumez@apple.com>
3679
3680         Unreviewed build fix after r243388.
3681
3682         * WebProcess/WebProcess.h:
3683
3684 2019-03-22  Per Arne Vollan  <pvollan@apple.com>
3685
3686         [macOS] Fix sandbox violation
3687         https://bugs.webkit.org/show_bug.cgi?id=196153
3688         <rdar://problem/49123855>
3689
3690         Reviewed by Brent Fulgham.
3691
3692         The sandbox on macOS is blocking the mach lookup.
3693
3694         * WebProcess/com.apple.WebProcess.sb.in:
3695
3696 2019-03-21  Ryan Haddad  <ryanhaddad@apple.com>
3697
3698         Unreviewed, fix the build with recent SDKs.
3699
3700         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3701         (stringForSSLProtocol):
3702
3703 2019-03-22  Chris Dumez  <cdumez@apple.com>
3704
3705         Implement WebProcess freezer opt-in completely on WebContent process side
3706         https://bugs.webkit.org/show_bug.cgi?id=196149
3707
3708         Reviewed by Brady Eidson.
3709
3710         Implement WebProcess freezer opt-in completely on WebContent process side, we do not need
3711         to involve the UIProcess with this and rely on IPC which may be fragile.
3712
3713         In the future, we may want to set freezable state from the UIProcess when the API supports
3714         it. We can move the logic to be fully on the UIProcess side then. In the mean time, it is
3715         likely best not to rely on IPC and process coordination for this.
3716
3717         * UIProcess/WebProcessProxy.cpp:
3718         (WebKit::globalPageMap):
3719         (WebKit::WebProcessProxy::WebProcessProxy):
3720         (WebKit::WebProcessProxy::setIsInProcessCache):
3721         (WebKit::WebProcessProxy::markIsNoLongerInPrewarmedPool):
3722         (WebKit::WebProcessProxy::didFinishLaunching):
3723         (WebKit::WebProcessProxy::validateFreezerStatus): Deleted.
3724         * UIProcess/WebProcessProxy.h:
3725         (WebKit::WebProcessProxy::removeProvisionalPageProxy):
3726         (WebKit::WebProcessProxy::WebPageProxyMap::WebPageProxyMap): Deleted.
3727         (WebKit::WebProcessProxy::WebPageProxyMap::size const): Deleted.
3728         (WebKit::WebProcessProxy::WebPageProxyMap::values): Deleted.
3729         (WebKit::WebProcessProxy::WebPageProxyMap::values const): Deleted.
3730         (WebKit::WebProcessProxy::WebPageProxyMap::begin): Deleted.
3731         (WebKit::WebProcessProxy::WebPageProxyMap::end): Deleted.
3732         (WebKit::WebProcessProxy::WebPageProxyMap::get): Deleted.
3733         (WebKit::WebProcessProxy::WebPageProxyMap::contains const): Deleted.
3734         (WebKit::WebProcessProxy::WebPageProxyMap::isEmpty const): Deleted.
3735         (WebKit::WebProcessProxy::WebPageProxyMap::set): Deleted.
3736         (WebKit::WebProcessProxy::WebPageProxyMap::take): Deleted.
3737         * WebProcess/WebProcess.cpp:
3738         (WebKit::WebProcess::setIsInProcessCache):
3739         (WebKit::WebProcess::markIsNoLongerPrewarmed):
3740         (WebKit::WebProcess::actualPrepareToSuspend):
3741         (WebKit::WebProcess::setFreezable): Deleted.
3742         * WebProcess/WebProcess.h:
3743         * WebProcess/WebProcess.messages.in:
3744         * WebProcess/cocoa/WebProcessCocoa.mm:
3745         (WebKit::WebProcess::updateProcessName):
3746         (WebKit::WebProcess::shouldFreezeOnSuspension const):
3747         (WebKit::WebProcess::updateFreezerStatus):
3748
3749 2019-03-22  Chris Dumez  <cdumez@apple.com>
3750
3751         Prewarmed processes should be usable with any website data store
3752         https://bugs.webkit.org/show_bug.cgi?id=196104
3753
3754         Reviewed by Alex Christensen.
3755
3756         Split WebsiteDataStore-specific data out of WebProcessCreationParameters and into a new
3757         WebProcessDataStoreParameters struct so that we do not need a WebsiteDataStore in order
3758         to lauch and initialize a WebProcess. When the process finally gets used and we thus
3759         know which WebsiteDataStore they will be used for, we send the WebProcessDataStoreParameters
3760         to the process to that it can do its data store-specific initialization.
3761
3762         This allows prewarmed processes not not have a WebsiteDataStore assocated with them. They
3763         can then be used for any WebsiteDataStore when we need them.
3764
3765         This is also used by our dummy WebProcessProxy since it does not have a backing process and
3766         thus has no associated WebsiteDataStore.
3767
3768         * Shared/WebProcessCreationParameters.cpp:
3769         (WebKit::WebProcessCreationParameters::encode const):
3770         (WebKit::WebProcessCreationParameters::decode):
3771         * Shared/WebProcessCreationParameters.h:
3772         * Shared/WebProcessDataStoreParameters.h: Added.
3773         (WebKit::WebProcessDataStoreParameters::encode const):
3774         (WebKit::WebProcessDataStoreParameters::decode):
3775         * UIProcess/API/C/WKContext.cpp:
3776         (WKContextWarmInitialProcess):
3777         * UIProcess/API/Cocoa/WKProcessPool.mm:
3778         (-[WKProcessPool _warmInitialProcess]):
3779         * UIProcess/ServiceWorkerProcessProxy.cpp:
3780         (WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
3781         * UIProcess/WebPageProxy.cpp:
3782         (WebKit::WebPageProxy::notifyProcessPoolToPrewarm):
3783         * UIProcess/WebProcessPool.cpp:
3784         (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
3785         (WebKit::WebProcessPool::createNewWebProcess):
3786         (WebKit::WebProcessPool::tryTakePrewarmedProcess):
3787         (WebKit::WebProcessPool::sendWebProcessDataStoreParameters):
3788         (WebKit::WebProcessPool::initializeNewWebProcess):
3789         (WebKit::WebProcessPool::prewarmProcess):
3790         (WebKit::WebProcessPool::processForRegistrableDomain):
3791         (WebKit::WebProcessPool::createWebPage):
3792         (WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
3793         * UIProcess/WebProcessPool.h:
3794         (WebKit::WebProcessPool::sendToOneProcess):
3795         * UIProcess/WebProcessProxy.cpp:
3796         (WebKit::WebProcessProxy::create):
3797         (WebKit::WebProcessProxy::WebProcessProxy):
3798         (WebKit::WebProcessProxy::setWebsiteDataStore):
3799         (WebKit::WebProcessProxy::addExistingWebPage):
3800         * UIProcess/WebProcessProxy.h:
3801         (WebKit::WebProcessProxy::websiteDataStore const):
3802         * WebKit.xcodeproj/project.pbxproj:
3803         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
3804         (WebKit::WebMediaKeyStorageManager::setWebsiteDataStore):
3805         * WebProcess/MediaCache/WebMediaKeyStorageManager.h:
3806         * WebProcess/WebProcess.cpp:
3807         (WebKit::WebProcess::initializeWebProcess):
3808         (WebKit::WebProcess::setWebsiteDataStoreParameters):
3809         * WebProcess/WebProcess.h:
3810         * WebProcess/WebProcess.messages.in:
3811         * WebProcess/WebProcessSupplement.h:
3812         (WebKit::WebProcessSupplement::initialize):
3813         (WebKit::WebProcessSupplement::setWebsiteDataStore):
3814         * WebProcess/cocoa/WebProcessCocoa.mm:
3815         (WebKit::WebProcess::platformInitializeWebProcess):
3816         (WebKit::WebProcess::platformSetWebsiteDataStoreParameters):
3817         * WebProcess/win/WebProcessWin.cpp:
3818         (WebKit::WebProcess::platformInitializeWebProcess):
3819         (WebKit::WebProcess::platformSetWebsiteDataStoreParameters):
3820
3821 2019-03-22  Simon Fraser  <simon.fraser@apple.com>
3822
3823         REGRESSION (r242687): Flicker when pinch-zooming pages in macOS Safari
3824         https://bugs.webkit.org/show_bug.cgi?id=196126
3825         rdar://problem/49095791
3826
3827         Reviewed by Antti Koivisto.
3828
3829         The scrolling tree doesn't have an accurate picture of the main view's scroll position
3830         during pinch-zooming, so don't have it apply layer positions if a transient zoom is
3831         in progress.
3832
3833         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
3834         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3835         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
3836         (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToPage):
3837
3838 2019-03-22  Antti Koivisto  <antti@apple.com>
3839
3840         Handle UI side hit testing for ScrollPositioningBehavior::Stationary positioned nodes
3841         https://bugs.webkit.org/show_bug.cgi?id=196100
3842         <rdar://problem/49117933>
3843
3844         Reviewed by Simon Fraser.
3845
3846         Test: fast/scrolling/ios/overflow-scroll-overlap-6.html
3847
3848         * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h:
3849         (WebKit::RemoteLayerTreeNode::relatedScrollContainerIDs const):
3850         (WebKit::RemoteLayerTreeNode::relatedScrollContainerPositioningBehavior const):
3851
3852         Make more generic and save the associated positioning behavior.
3853
3854         (WebKit::RemoteLayerTreeNode::nonAncestorScrollContainerIDs const): Deleted.
3855         (WebKit::RemoteLayerTreeNode::addNonAncestorScrollContainerID): Deleted.
3856         (WebKit::RemoteLayerTreeNode::clearNonAncestorScrollContainerIDs): Deleted.
3857         * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm:
3858         (WebKit::RemoteLayerTreeNode::setRelatedScrollContainerBehaviorAndIDs):
3859         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
3860         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
3861         (WebKit::isScrolledBy):
3862
3863         Stationary relationship means the layer won't scroll the scroller.
3864
3865         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
3866         (WebKit::RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations):
3867
3868 2019-03-22  Chris Dumez  <cdumez@apple.com>
3869
3870         REGRESSION (r243094): ePub files do not render or open in Books
3871         https://bugs.webkit.org/show_bug.cgi?id=196119
3872         <rdar://problem/49121686>
3873
3874         Reviewed by Brady Eidson.
3875
3876         Do not delay the WebProcess launch until a load when contructing a web view and the client
3877         may observe when its injected bundle is loaded via WKProcessGroupDelegate's
3878         didCreateConnectionToWebProcessPlugIn.
3879
3880         * UIProcess/API/Cocoa/WKProcessGroup.mm:
3881         (-[WKProcessGroup setDelegate:]):
3882         * UIProcess/WebInspectorUtilities.cpp:
3883         (WebKit::inspectorProcessPool):
3884         * UIProcess/WebProcessPool.cpp:
3885         (WebKit::WebProcessPool::createWebPage):
3886         * UIProcess/WebProcessPool.h:
3887
3888 2019-03-22  Carlos Garcia Campos  <cgarcia@igalia.com>
3889
3890         REGRESSION(r243094): Automation: browser crash in WebAutomationSession::exitFullscreenWindowForPage()
3891         https://bugs.webkit.org/show_bug.cgi?id=196140
3892
3893         Reviewed by Chris Dumez.
3894
3895         Since r243094, the WebPageProxy fullscreen manager is not created in the constructor, but once the page has a
3896         process launched.
3897
3898         * UIProcess/Automation/WebAutomationSession.cpp:
3899         (WebKit::WebAutomationSession::exitFullscreenWindowForPage): Null check WebPageProxy::fullScreenManager() before
3900         using it.
3901
3902 2019-03-22  Timothy Hatcher  <timothy@apple.com>
3903
3904         Change macosx() to macos() in WK_API... and JSC_API... macros.
3905         https://bugs.webkit.org/show_bug.cgi?id=196106
3906
3907         Reviewed by Brian Burg.
3908
3909         * Shared/API/Cocoa/WKBrowsingContextHandle.h:
3910         * Shared/API/Cocoa/WKDragDestinationAction.h:
3911         * Shared/API/Cocoa/WKMain.h:
3912         * Shared/API/Cocoa/_WKFrameHandle.h:
3913         * Shared/API/Cocoa/_WKHitTestResult.h:
3914         * Shared/API/Cocoa/_WKNSWindowExtras.h:
3915         * Shared/API/Cocoa/_WKRemoteObjectInterface.h:
3916         * Shared/API/Cocoa/_WKRemoteObjectRegistry.h:
3917         * Shared/API/Cocoa/_WKRenderingProgressEvents.h:
3918         * Shared/API/Cocoa/_WKSameDocumentNavigationType.h:
3919         * UIProcess/API/C/WKPage.h:
3920         * UIProcess/API/Cocoa/NSAttributedString.h:
3921         * UIProcess/API/Cocoa/WKBackForwardList.h:
3922         * UIProcess/API/Cocoa/WKBackForwardListItem.h:
3923         * UIProcess/API/Cocoa/WKBackForwardListItemPrivate.h:
3924         * UIProcess/API/Cocoa/WKBrowsingContextLoadDelegate.h:
3925         * UIProcess/API/Cocoa/WKContentRuleList.h:
3926         * UIProcess/API/Cocoa/WKContentRuleListStore.h:
3927         * UIProcess/API/Cocoa/WKError.h:
3928         * UIProcess/API/Cocoa/WKErrorPrivate.h:
3929         * UIProcess/API/Cocoa/WKFrameInfo.h:
3930         * UIProcess/API/Cocoa/WKFrameInfoPrivate.h:
3931         * UIProcess/API/Cocoa/WKHTTPCookieStore.h:
3932         * UIProcess/API/Cocoa/WKMenuItemIdentifiersPrivate.h:
3933         * UIProcess/API/Cocoa/WKNavigation.h:
3934         * UIProcess/API/Cocoa/WKNavigationAction.h:
3935         * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
3936         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
3937         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
3938         * UIProcess/API/Cocoa/WKNavigationResponse.h:
3939         * UIProcess/API/Cocoa/WKOpenPanelParameters.h:
3940         * UIProcess/API/Cocoa/WKOpenPanelParametersPrivate.h:
3941         * UIProcess/API/Cocoa/WKPreferences.h:
3942         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
3943         * UIProcess/API/Cocoa/WKProcessPool.h:
3944         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
3945         * UIProcess/API/Cocoa/WKScriptMessage.h:
3946         * UIProcess/API/Cocoa/WKSecurityOrigin.h:
3947         * UIProcess/API/Cocoa/WKSnapshotConfiguration.h:
3948         * UIProcess/API/Cocoa/WKUIDelegate.h:
3949         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3950         * UIProcess/API/Cocoa/WKURLSchemeHandler.h:
3951         * UIProcess/API/Cocoa/WKURLSchemeTask.h:
3952         * UIProcess/API/Cocoa/WKURLSchemeTaskPrivate.h:
3953         * UIProcess/API/Cocoa/WKUserContentController.h:
3954         * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h:
3955         * UIProcess/API/Cocoa/WKUserScript.h:
3956         * UIProcess/API/Cocoa/WKUserScriptPrivate.h:
3957         * UIProcess/API/Cocoa/WKViewPrivate.h:
3958         * UIProcess/API/Cocoa/WKWebView.h:
3959         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
3960         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
3961         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3962         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
3963         * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h:
3964         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
3965         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
3966         * UIProcess/API/Cocoa/WKWindowFeatures.h:
3967         * UIProcess/API/Cocoa/WKWindowFeaturesPrivate.h:
3968         * UIProcess/API/Cocoa/_WKActivatedElementInfo.h:
3969         * UIProcess/API/Cocoa/_WKApplicationManifest.h:
3970         * UIProcess/API/Cocoa/_WKAttachment.h:
3971         * UIProcess/API/Cocoa/_WKAutomationDelegate.h:
3972         * UIProcess/API/Cocoa/_WKAutomationSession.h:
3973         * UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.h:
3974         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
3975         * UIProcess/API/Cocoa/_WKContextMenuElementInfo.h:
3976         * UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h:
3977         * UIProcess/API/Cocoa/_WKDownload.h:
3978         * UIProcess/API/Cocoa/_WKDownloadDelegate.h:
3979         * UIProcess/API/Cocoa/_WKElementAction.h:
3980         * UIProcess/API/Cocoa/_WKExperimentalFeature.h:
3981         * UIProcess/API/Cocoa/_WKFindOptions.h:
3982         * UIProcess/API/Cocoa/_WKFocusedElementInfo.h:
3983         * UIProcess/API/Cocoa/_WKFormInputSession.h:
3984         * UIProcess/API/Cocoa/_WKFullscreenDelegate.h:
3985         * UIProcess/API/Cocoa/_WKGeolocationCoreLocationProvider.h:
3986         * UIProcess/API/Cocoa/_WKInspector.h:
3987         * UIProcess/API/Cocoa/_WKInspectorWindow.h:
3988         * UIProcess/API/Cocoa/_WKInternalDebugFeature.h:
3989         * UIProcess/API/Cocoa/_WKLayoutMode.h:
3990         * UIProcess/API/Cocoa/_WKLinkIconParameters.h:
3991         * UIProcess/API/Cocoa/_WKOverlayScrollbarStyle.h:
3992         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
3993         * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.h:
3994         * UIProcess/API/Cocoa/_WKSessionState.h:
3995         * UIProcess/API/Cocoa/_WKTextInputContext.h:
3996         * UIProcess/API/Cocoa/_WKThumbnailView.h:
3997         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.h:
3998         * UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h:
3999         * UIProcess/API/Cocoa/_WKUserContentFilter.h:
4000         * UIProcess/API/Cocoa/_WKUserContentFilterPrivate.h:
4001         * UIProcess/API/Cocoa/_WKUserContentWorld.h:
4002         * UIProcess/API/Cocoa/_WKUserInitiatedAction.h:
4003         * UIProcess/API/Cocoa/_WKUserStyleSheet.h:
4004         * UIProcess/API/Cocoa/_WKVisitedLinkStore.h:
4005         * UIProcess/API/Cocoa/_WKWebsiteDataSize.h:
4006      &n