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