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