[CoordinatedGraphics] The compositing loop is still running even after exiting AC...
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2019-03-04  Carlos Garcia Campos  <cgarcia@igalia.com>
2
3         [CoordinatedGraphics] The compositing loop is still running even after exiting AC mode
4         https://bugs.webkit.org/show_bug.cgi?id=195270
5
6         Reviewed by Don Olmstead.
7
8         Suspend the threaded compositor when the painting is paused or layer flush disabled, and resume it again when
9         painting is resumed and layer flush enabled.
10
11         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
12         (WebKit::ThreadedCompositor::suspend): Increment the suspend counter and mark the scene as inactive if it was suspended.
13         (WebKit::ThreadedCompositor::resume): Decrement the suspend counter and mark the scene as active if it's now resumed.
14         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
15         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
16         (WebKit::DrawingAreaCoordinatedGraphics::forceRepaint): Return early if layer tree state is frozen.
17         (WebKit::DrawingAreaCoordinatedGraphics::forceRepaintAsync): Ditto.
18         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
19         (WebKit::LayerTreeHost::setLayerFlushSchedulingEnabled): Call ThreadedCompositor::suspend()/resume().
20         (WebKit::LayerTreeHost::pauseRendering): Call ThreadedCompositor::suspend.
21         (WebKit::LayerTreeHost::resumeRendering): Call ThreadedCompositor::resume().
22
23 2019-03-04  Simon Fraser  <simon.fraser@apple.com>
24
25         Share more code between overflow and frame scrolling nodes, fixing overflow scrollbar display
26         https://bugs.webkit.org/show_bug.cgi?id=195258
27
28         Reviewed by Antti Koivisto.
29
30         This patch moves management of scrollbar layers and scrollbar painters ("NSScrollerImp") down to
31         ScrollingStateScrollingNode to be shared between frame and overflow nodes, allowing for
32         scrolling thread updates of overflow scrollbars. It also moves some scrolling tree-side code
33         to ScrollingTreeScrollingNodeDelegateMac to be shared between the "tree" nodes for overflow and frames.
34
35         Layers for scrollbars are given to scrolling state nodes via setNodeLayers() now, and
36         RenderLayerCompositor::updateScrollingNodeLayers() is added to provide a bottleneck to call that.
37         At some point AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange() should be relieved
38         of the responsibility of pushing scrollbar layers (but the scrolling state tree needs to hold
39         references to GraphicsLayers before that becomes safe).
40         
41         The actual fix that allows overflow scrollbars to show is the change in
42         AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange() that calls scrollableArea.*ScrollbarLayerDidChange()
43         for all ScrollableAreas. This ensures that the CALayer is pushed onto the NSScrollerImp.
44
45         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
46         (ArgumentCoder<ScrollingStateScrollingNode>::encode):
47         (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
48         (ArgumentCoder<ScrollingStateScrollingNode>::decode):
49         (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
50         * SourcesCocoa.txt:
51         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
52         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
53         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
54         (WebKit::RemoteScrollingTree::createScrollingTreeNode):
55         * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp:
56         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::commitStateBeforeChildren):
57         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::repositionRelatedLayers):
58         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::handleMouseEvent):
59         * UIProcess/RemoteLayerTree/mac/ScrollingTreeOverflowScrollingNodeRemoteMac.cpp: Copied from Source/WebKit/UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp.
60         (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::create):
61         (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::ScrollingTreeOverflowScrollingNodeRemoteMac):
62         (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::~ScrollingTreeOverflowScrollingNodeRemoteMac):
63         (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::commitStateBeforeChildren):
64         (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::repositionRelatedLayers):
65         (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::handleWheelEvent):
66         (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::handleMouseEvent):
67         * WebKit.xcodeproj/project.pbxproj:
68
69 2019-03-04  Andy Estes  <aestes@apple.com>
70
71         [Apple Pay] Move WebPaymentCoordinatorProxy from Source/WebKit/UIProcess to Source/WebKit/Shared
72         https://bugs.webkit.org/show_bug.cgi?id=195080
73         <rdar://problem/48421558>
74
75         Reviewed by Antti Koivisto.
76
77         * CMakeLists.txt:
78         * DerivedSources-input.xcfilelist:
79         * DerivedSources.make:
80         * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp: Renamed from Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp.
81         * Shared/ApplePay/WebPaymentCoordinatorProxy.h: Renamed from Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.h.
82         * Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in: Renamed from Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in.
83         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h: Renamed from Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h.
84         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: Renamed from Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm.
85         * Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm: Renamed from Source/WebKit/UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm.
86         * Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm: Renamed from Source/WebKit/UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm.
87         * Shared/mac/WebHitTestResultData.mm:
88         * SourcesCocoa.txt:
89         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h:
90         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
91         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
92         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
93         * WebKit.xcodeproj/project.pbxproj:
94
95 2019-03-04  Jer Noble  <jer.noble@apple.com>
96
97         [iOS] Fullscreen "stay in page" option breaks video playback
98         https://bugs.webkit.org/show_bug.cgi?id=195277
99         <rdar://problem/48537317>
100
101         Reviewed by Eric Carlson.
102
103         Make sure we resume media playback when the user chooses "stay in page" from the deceptive
104         website warning dialog.
105
106         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
107         (-[WKFullScreenViewController _showPhishingAlert]):
108
109 2019-03-04  Michael Catanzaro  <mcatanzaro@igalia.com>
110
111         [WPE] Enable web process sandbox
112         https://bugs.webkit.org/show_bug.cgi?id=195169
113
114         Reviewed by Daniel Bates.
115
116         * PlatformWPE.cmake:
117         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
118         (WebKit::bubblewrapSpawn):
119         * UIProcess/glib/WebProcessPoolGLib.cpp:
120         (WebKit::WebProcessPool::platformInitialize):
121
122 2019-03-04  Adrian Perez de Castro  <aperez@igalia.com>
123
124         [GTK][WPE] Wrong license header in WebKit{,WebExtension}Autocleanups.h
125         https://bugs.webkit.org/show_bug.cgi?id=195245
126
127         Reviewed by Carlos Garcia Campos.
128
129         Changed license headers to contain the LGPL, which is the correct one for the GTK
130         and WPE ports. The change was agreed by the contributors to the files involved.
131
132         * UIProcess/API/gtk/WebKitAutocleanups.h:
133         * UIProcess/API/wpe/WebKitAutocleanups.h:
134         * WebProcess/InjectedBundle/API/gtk/WebKitWebExtensionAutocleanups.h:
135         * WebProcess/InjectedBundle/API/wpe/WebKitWebExtensionAutocleanups.h:
136
137 2019-03-04  Commit Queue  <commit-queue@webkit.org>
138
139         Unreviewed, rolling out r242045.
140         https://bugs.webkit.org/show_bug.cgi?id=195273
141
142         WE not ready to enable PSON yet (Requested by KaL on #webkit).
143
144         Reverted changeset:
145
146         "[GTK] Enable PSON"
147         https://bugs.webkit.org/show_bug.cgi?id=194979
148         https://trac.webkit.org/changeset/242045
149
150 2019-03-04  Carlos Garcia Campos  <cgarcia@igalia.com>
151
152         [CoordinatedGraphics] Unify DrawingArea classes
153         https://bugs.webkit.org/show_bug.cgi?id=195167
154
155         Reviewed by Žan Doberšek.
156
157         Add DrawingAreaProxyCoordinatedGraphics and DrawingAreaCoordinatedGraphics.
158
159         * PlatformGTK.cmake:
160         * PlatformWPE.cmake:
161         * PlatformWin.cmake:
162         * Shared/DrawingAreaInfo.h:
163         * SourcesGTK.txt:
164         * SourcesWPE.txt:
165         * UIProcess/API/gtk/PageClientImpl.cpp:
166         (WebKit::PageClientImpl::createDrawingAreaProxy):
167         (WebKit::PageClientImpl::viewSize):
168         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
169         (webkitWebViewBaseRealize):
170         (webkitWebViewBaseUnrealize):
171         (webkitWebViewBaseDraw):
172         (webkitWebViewBaseSizeAllocate):
173         (webkitWebViewBaseDidRelaunchWebProcess):
174         (webkitWebViewBasePageClosed):
175         * UIProcess/API/wpe/PageClientImpl.cpp:
176         (WebKit::PageClientImpl::createDrawingAreaProxy):
177         * UIProcess/AcceleratedDrawingAreaProxy.cpp: Removed.
178         * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp: Added.
179         (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingAreaProxyCoordinatedGraphics):
180         (WebKit::DrawingAreaProxyCoordinatedGraphics::~DrawingAreaProxyCoordinatedGraphics):
181         (WebKit::DrawingAreaProxyCoordinatedGraphics::paint):
182         (WebKit::DrawingAreaProxyCoordinatedGraphics::sizeDidChange):
183         (WebKit::DrawingAreaProxyCoordinatedGraphics::deviceScaleFactorDidChange):
184         (WebKit::DrawingAreaProxyCoordinatedGraphics::waitForBackingStoreUpdateOnNextPaint):
185         (WebKit::DrawingAreaProxyCoordinatedGraphics::setBackingStoreIsDiscardable):
186         (WebKit::DrawingAreaProxyCoordinatedGraphics::update):
187         (WebKit::DrawingAreaProxyCoordinatedGraphics::didUpdateBackingStoreState):
188         (WebKit::DrawingAreaProxyCoordinatedGraphics::enterAcceleratedCompositingMode):
189         (WebKit::DrawingAreaProxyCoordinatedGraphics::exitAcceleratedCompositingMode):
190         (WebKit::DrawingAreaProxyCoordinatedGraphics::updateAcceleratedCompositingMode):
191         (WebKit::DrawingAreaProxyCoordinatedGraphics::incorporateUpdate):
192         (WebKit::DrawingAreaProxyCoordinatedGraphics::alwaysUseCompositing const):
193         (WebKit::DrawingAreaProxyCoordinatedGraphics::backingStoreStateDidChange):
194         (WebKit::DrawingAreaProxyCoordinatedGraphics::sendUpdateBackingStoreState):
195         (WebKit::DrawingAreaProxyCoordinatedGraphics::waitForAndDispatchDidUpdateBackingStoreState):
196         (WebKit::DrawingAreaProxyCoordinatedGraphics::discardBackingStoreSoon):
197         (WebKit::DrawingAreaProxyCoordinatedGraphics::discardBackingStore):
198         (WebKit::DrawingAreaProxyCoordinatedGraphics::setNativeSurfaceHandleForCompositing):
199         (WebKit::DrawingAreaProxyCoordinatedGraphics::destroyNativeSurfaceHandleForCompositing):
200         (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::DrawingMonitor):
201         (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::~DrawingMonitor):
202         (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::webViewDrawCallback):
203         (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::start):
204         (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::stop):
205         (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::didDraw):
206         (WebKit::DrawingAreaProxyCoordinatedGraphics::dispatchAfterEnsuringDrawing):
207         * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h: Renamed from Source/WebKit/UIProcess/AcceleratedDrawingAreaProxy.h.
208         * UIProcess/DrawingAreaProxyImpl.cpp: Removed.
209         * UIProcess/DrawingAreaProxyImpl.h: Removed.
210         * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
211         (WebKit::AcceleratedBackingStoreX11::update):
212         * UIProcess/win/PageClientImpl.cpp:
213         (WebKit::PageClientImpl::createDrawingAreaProxy):
214         * UIProcess/win/WebView.cpp:
215         (WebKit::WebView::paint):
216         * WebProcess/WebPage/AcceleratedDrawingArea.cpp: Removed.
217         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp: Added.
218         (WebKit::DrawingAreaCoordinatedGraphics::DrawingAreaCoordinatedGraphics):
219         (WebKit::DrawingAreaCoordinatedGraphics::~DrawingAreaCoordinatedGraphics):
220         (WebKit::DrawingAreaCoordinatedGraphics::setNeedsDisplay):
221         (WebKit::DrawingAreaCoordinatedGraphics::setNeedsDisplayInRect):
222         (WebKit::DrawingAreaCoordinatedGraphics::scroll):
223         (WebKit::DrawingAreaCoordinatedGraphics::forceRepaint):
224         (WebKit::DrawingAreaCoordinatedGraphics::forceRepaintAsync):
225         (WebKit::DrawingAreaCoordinatedGraphics::setLayerTreeStateIsFrozen):
226         (WebKit::DrawingAreaCoordinatedGraphics::updatePreferences):
227         (WebKit::DrawingAreaCoordinatedGraphics::mainFrameContentSizeChanged):
228         (WebKit::DrawingAreaCoordinatedGraphics::deviceOrPageScaleFactorChanged):
229         (WebKit::DrawingAreaCoordinatedGraphics::didChangeViewportAttributes):
230         (WebKit::DrawingAreaCoordinatedGraphics::graphicsLayerFactory):
231         (WebKit::DrawingAreaCoordinatedGraphics::setRootCompositingLayer):
232         (WebKit::DrawingAreaCoordinatedGraphics::scheduleCompositingLayerFlush):
233         (WebKit::DrawingAreaCoordinatedGraphics::layerHostDidFlushLayers):
234         (WebKit::DrawingAreaCoordinatedGraphics::createDisplayRefreshMonitor):
235         (WebKit::DrawingAreaCoordinatedGraphics::setNativeSurfaceHandleForCompositing):
236         (WebKit::DrawingAreaCoordinatedGraphics::destroyNativeSurfaceHandleForCompositing):
237         (WebKit::DrawingAreaCoordinatedGraphics::activityStateDidChange):
238         (WebKit::DrawingAreaCoordinatedGraphics::attachViewOverlayGraphicsLayer):
239         (WebKit::DrawingAreaCoordinatedGraphics::updateBackingStoreState):
240         (WebKit::DrawingAreaCoordinatedGraphics::didUpdate):
241         (WebKit::DrawingAreaCoordinatedGraphics::sendDidUpdateBackingStoreState):
242         (WebKit::DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingModeSoon):
243         (WebKit::DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingModeNow):
244         (WebKit::DrawingAreaCoordinatedGraphics::discardPreviousLayerTreeHost):
245         (WebKit::DrawingAreaCoordinatedGraphics::suspendPainting):
246         (WebKit::DrawingAreaCoordinatedGraphics::resumePainting):
247         (WebKit::DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode):
248         (WebKit::DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingMode):
249         (WebKit::DrawingAreaCoordinatedGraphics::scheduleDisplay):
250         (WebKit::DrawingAreaCoordinatedGraphics::displayTimerFired):
251         (WebKit::DrawingAreaCoordinatedGraphics::display):
252         (WebKit::shouldPaintBoundsRect):
253         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h: Renamed from Source/WebKit/WebProcess/WebPage/AcceleratedDrawingArea.h.
254         * WebProcess/WebPage/DrawingArea.cpp:
255         (WebKit::DrawingArea::create):
256         * WebProcess/WebPage/DrawingArea.h:
257         (WebKit::DrawingArea::layerFlushThrottlingIsActive const):
258         * WebProcess/WebPage/DrawingAreaImpl.cpp: Removed.
259         * WebProcess/WebPage/DrawingAreaImpl.h: Removed.
260
261 2019-03-03  Zalan Bujtas  <zalan@apple.com>
262
263         [ContentChangeObserver] Content observation should be limited to the current document.
264         https://bugs.webkit.org/show_bug.cgi?id=195256
265         <rdar://problem/48544402>
266
267         Reviewed by Simon Fraser.
268
269         * WebProcess/WebPage/WebPage.h:
270         * WebProcess/WebPage/ios/WebPageIOS.mm:
271         (WebKit::WebPage::handleSyntheticClick):
272         (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
273         (WebKit::WebPage::completeSyntheticClick):
274         (WebKit::WebPage::handleTap):
275         (WebKit::WebPage::handleTwoFingerTapAtPoint):
276         (WebKit::WebPage::commitPotentialTap):
277
278 2019-03-03  Tim Horton  <timothy_horton@apple.com>
279
280         Rid the world of WK_API_ENABLED
281         https://bugs.webkit.org/show_bug.cgi?id=195263
282
283         Reviewed by Dan Bernstein.
284
285         List of changed files elided because it's useless.
286
287 2019-03-03  Jiewen Tan  <jiewen_tan@apple.com>
288
289         Add a WebViewDidMoveToWindowObserver for WKWebView
290         https://bugs.webkit.org/show_bug.cgi?id=195223
291         <rdar://problem/48520161>
292
293         Reviewed by Darin Adler.
294
295         The load optimizer would only allow itself to optimize loads whenever the web view
296         who owns the page is (visible && focused), otherwises it will wait until the web view
297         becomes (visible && focused). Therefore, we need a way to notify the load optimizer
298         changes of statuses.
299
300         * UIProcess/API/Cocoa/WKWebView.mm:
301         (-[WKWebView didMoveToWindow]):
302         * UIProcess/Cocoa/WebViewImpl.mm:
303         (WebKit::WebViewImpl::viewDidMoveToWindow):
304         * UIProcess/WebPageProxy.cpp:
305         (WebKit::WebPageProxy::addWebViewDidMoveToWindowObserver):
306         (WebKit::WebPageProxy::removeWebViewDidMoveToWindowObserver):
307         (WebKit::WebPageProxy::webViewDidMoveToWindow):
308         * UIProcess/WebPageProxy.h:
309         * UIProcess/WebViewDidMoveToWindowObserver.h: Added.
310         * WebKit.xcodeproj/project.pbxproj:
311
312 2019-03-03  Andy Estes  <aestes@apple.com>
313
314         [Apple Pay] Untangle WebPageProxy and WebPaymentCoordinatorProxy
315         https://bugs.webkit.org/show_bug.cgi?id=195219
316         <rdar://problem/48518082>
317
318         Reviewed by Darin Adler.
319
320         Rather than having WebPaymentCoordinatorProxy know about WebPageProxy, give
321         WebPaymentCoordinatorProxy a client interface that WebPageProxy conforms to.
322
323         In a follow-on patch, WebPaymentCoordinatorProxy will have a non-WebPageProxy client.
324
325         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
326         (WebKit::WebPaymentCoordinatorProxy::WebPaymentCoordinatorProxy): Replaced use of
327         m_webPageProxy with m_client.
328         (WebKit::WebPaymentCoordinatorProxy::~WebPaymentCoordinatorProxy): Ditto.
329         (WebKit::WebPaymentCoordinatorProxy::messageSenderConnection const): Implemented
330         IPC::MessageSender via m_client.
331         (WebKit::WebPaymentCoordinatorProxy::messageSenderDestinationID const): Ditto.
332         (WebKit::WebPaymentCoordinatorProxy::canMakePaymentsWithActiveCard): Replaced use of
333         m_webPageProxy with m_client.
334         (WebKit::WebPaymentCoordinatorProxy::openPaymentSetup): Ditto.
335         (WebKit::WebPaymentCoordinatorProxy::didCancelPaymentSession): Called our own
336         MessageSender::send rather than going through m_webPageProxy.
337         (WebKit::WebPaymentCoordinatorProxy::validateMerchant): Ditto.
338         (WebKit::WebPaymentCoordinatorProxy::didAuthorizePayment): Ditto.
339         (WebKit::WebPaymentCoordinatorProxy::didSelectShippingMethod): Ditto.
340         (WebKit::WebPaymentCoordinatorProxy::didSelectShippingContact): Ditto.
341         (WebKit::WebPaymentCoordinatorProxy::didSelectPaymentMethod): Ditto.
342         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: Defined the Client abstract class and
343         changed m_webPageProxy to m_client.
344         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h:
345         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
346         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard): Replaced use of
347         m_webPageProxy with m_client.
348         (WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest): Renamed from toPKPaymentRequest.
349         (WebKit::toPKPaymentRequest): Renamed to WebPaymentCoordinatorProxy::platformPaymentRequest.
350         * UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
351         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): Replaced use of m_webPageProxy
352         with m_client.
353         * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
354         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): Ditto.
355         * UIProcess/AuxiliaryProcessProxy.h:
356         (WebKit::AuxiliaryProcessProxy::messageReceiverMap): Added.
357         * UIProcess/WebPageProxy.cpp:
358         (WebKit::WebPageProxy::paymentCoordinatorConnection): Implemented WebPaymentCoordinatorProxy::Client.
359         (WebKit::WebPageProxy::paymentCoordinatorMessageReceiver): Ditto.
360         (WebKit::WebPageProxy::paymentCoordinatorSourceApplicationBundleIdentifier): Ditto.
361         (WebKit::WebPageProxy::paymentCoordinatorSourceApplicationSecondaryIdentifier): Ditto.
362         (WebKit::WebPageProxy::paymentCoordinatorDestinationID): Ditto.
363         * UIProcess/WebPageProxy.h: Made WebPageProxy derive from WebPaymentCoordinatorProxy::Client.
364         * UIProcess/ios/WebPageProxyIOS.mm:
365         (WebKit::WebPageProxy::paymentCoordinatorPresentingViewController): Implemented WebPaymentCoordinatorProxy::Client.
366         (WebKit::WebPageProxy::paymentCoordinatorCTDataConnectionServiceType): Ditto.
367         * UIProcess/mac/WebPageProxyMac.mm:
368         (WebKit::WebPageProxy::paymentCoordinatorPresentingWindow): Ditto.
369         * WebKit.xcodeproj/project.pbxproj:
370
371 2019-03-03  Tim Horton  <timothy_horton@apple.com>
372
373         Remove some more unused 32-bit code
374         https://bugs.webkit.org/show_bug.cgi?id=195255
375
376         Reviewed by Darin Adler.
377
378         * Platform/Module.cpp:
379         (WebKit::Module::Module):
380         * Platform/Module.h:
381         * Platform/cf/ModuleCF.cpp:
382         (WebKit::Module::unload):
383         (WebKit::Module::bundleResourceMap): Deleted.
384         * PluginProcess/mac/PluginProcessMac.mm:
385         (WebKit::initializeShim):
386         (WebKit::PluginProcess::platformInitializeProcess):
387         (WebKit::shouldCallRealDebugger): Deleted.
388         (WebKit::isWindowActive): Deleted.
389         (WebKit::getCurrentEventButtonState): Deleted.
390         (WebKit::carbonWindowShown): Deleted.
391         (WebKit::carbonWindowHidden): Deleted.
392         (WebKit::openCFURLRef): Deleted.
393         (WebKit::isMallocTinyMemoryTag): Deleted.
394         (WebKit::shouldMapMemoryExecutable): Deleted.
395         * PluginProcess/mac/PluginProcessShim.h:
396         * PluginProcess/mac/PluginProcessShim.mm:
397         (WebKit::shimDebugger): Deleted.
398         (WebKit::shimGetCurrentEventButtonState): Deleted.
399         (WebKit::shimIsWindowActive): Deleted.
400         (WebKit::shimModalDialog): Deleted.
401         (WebKit::shimAlert): Deleted.
402         (WebKit::shimShowWindow): Deleted.
403         (WebKit::shimHideWindow): Deleted.
404         (WebKit::shimLSOpenCFURLRef): Deleted.
405         (WebKit::shimMachVMMap): Deleted.
406         * Shared/API/Cocoa/WKFoundation.h:
407         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
408         (WebKit::XPCServiceMain):
409         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
410         (WebKit::NetscapePluginModule::tryLoad):
411         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
412         (WebKit::getPluginArchitecture):
413         (WebKit::NetscapePluginModule::determineQuirks):
414         * Shared/Plugins/PluginQuirks.h:
415         * Shared/cf/ArgumentCodersCF.cpp:
416         (IPC::sizeForNumberType):
417         * Shared/mac/WebEventFactory.mm:
418         (WebKit::mouseButtonForEvent):
419         (WebKit::globalPointForEvent):
420         (WebKit::pointForEvent):
421         (WebKit::WebEventFactory::createWebMouseEvent):
422         * UIProcess/API/C/mac/WKPagePrivateMac.h:
423         * UIProcess/API/C/mac/WKPagePrivateMac.mm:
424         (WKPageLoadFileReturningNavigation):
425         * UIProcess/Cocoa/WebViewImpl.mm:
426         (WebKit::WebViewImpl::pressureChangeWithEvent):
427         * UIProcess/Gamepad/cocoa/UIGamepadProviderCocoa.mm:
428         (WebKit::UIGamepadProvider::platformSetDefaultGamepadProvider):
429         * UIProcess/mac/ServicesController.mm:
430         (WebKit::ServicesController::ServicesController):
431         * UIProcess/mac/WebContextMenuProxyMac.mm:
432         (WebKit::WebContextMenuProxyMac::setupServicesMenu):
433         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
434         (WebKit::NPN_GetValue):
435         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
436         (WebKit::NetscapePlugin::NetscapePlugin):
437         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
438         (WebKit::NetscapePlugin::isWindowActive const): Deleted.
439         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
440         (WebKit::NetscapePlugin::setDrawingModel):
441         (WebKit::NetscapePlugin::setEventModel):
442         (WebKit::NetscapePlugin::platformPostInitialize):
443         (WebKit::NetscapePlugin::platformDestroy):
444         (WebKit::NetscapePlugin::platformGeometryDidChange):
445         (WebKit::NetscapePlugin::platformPaint):
446         (WebKit::NetscapePlugin::platformHandleMouseEvent):
447         (WebKit::NetscapePlugin::platformHandleWheelEvent):
448         (WebKit::NetscapePlugin::platformHandleMouseEnterEvent):
449         (WebKit::NetscapePlugin::platformHandleMouseLeaveEvent):
450         (WebKit::NetscapePlugin::platformHandleKeyboardEvent):
451         (WebKit::NetscapePlugin::platformSetFocus):
452         (WebKit::NetscapePlugin::windowFocusChanged):
453         (WebKit::NetscapePlugin::windowAndViewFramesChanged):
454         (WebKit::NetscapePlugin::sendComplexTextInput):
455         (): Deleted.
456         (WebKit::windowMap): Deleted.
457         (WebKit::NetscapePlugin::netscapePluginFromWindow): Deleted.
458         (WebKit::NetscapePlugin::windowRef const): Deleted.
459         (WebKit::NetscapePlugin::updateFakeWindowBounds): Deleted.
460         (WebKit::NetscapePlugin::buttonState): Deleted.
461         (WebKit::initializeEventRecord): Deleted.
462         (WebKit::anyMouseButtonIsDown): Deleted.
463         (WebKit::rightMouseButtonIsDown): Deleted.
464         (WebKit::modifiersForEvent): Deleted.
465         (WebKit::convertStringToKeyCodes): Deleted.
466         (WebKit::scriptCodeFromCurrentKeyboardInputSource): Deleted.
467         (WebKit::NetscapePlugin::nullEventTimerFired): Deleted.
468
469 2019-03-02  Zalan Bujtas  <zalan@apple.com>
470
471         [ContentChangeObserver] Introduce ContentChangeObserver::MouseMovedScope
472         https://bugs.webkit.org/show_bug.cgi?id=195252
473         <rdar://problem/48539446>
474
475         Reviewed by Simon Fraser.
476
477         * WebProcess/WebPage/ios/WebPageIOS.mm:
478         (WebKit::WebPage::handleSyntheticClick):
479
480 2019-03-02  Tim Horton  <timothy_horton@apple.com>
481
482         Move EditingRange <-> Range methods to EditingRange instead of WebPage
483         https://bugs.webkit.org/show_bug.cgi?id=195201
484
485         Reviewed by Sam Weinig.
486
487         * Shared/EditingRange.h:
488         * Shared/EditingRange.cpp:
489         Also, modernize the coders.
490
491         * Sources.txt:
492         * WebKit.xcodeproj/project.pbxproj:
493         * WebProcess/WebPage/WebPage.cpp:
494         (WebKit::WebPage::insertTextAsync):
495         (WebKit::WebPage::getMarkedRangeAsync):
496         (WebKit::WebPage::getSelectedRangeAsync):
497         (WebKit::WebPage::characterIndexForPointAsync):
498         (WebKit::WebPage::firstRectForCharacterRangeAsync):
499         (WebKit::WebPage::setCompositionAsync):
500         (WebKit::WebPage::rangeFromEditingRange): Deleted.
501         * WebProcess/WebPage/mac/WebPageMac.mm:
502         (WebKit::WebPage::insertDictatedTextAsync):
503         (WebKit::WebPage::attributedSubstringForCharacterRangeAsync):
504
505 2019-03-02  Wenson Hsieh  <wenson_hsieh@apple.com>
506
507         [iOS] Programmatic paste access should be granted when copying and pasting within the same origin
508         https://bugs.webkit.org/show_bug.cgi?id=195053
509         <rdar://problem/48134710>
510
511         Reviewed by Ryosuke Niwa.
512
513         Add support for automatically granting programmatic pasteboard access when the pasteboard identifier of the
514         document requesting programmatic paste matches the identifier in the custom pasteboard data blob in the
515         UIPasteboard. To do this, we send the pasteboard identifier of the document requesting the DOM paste to the UI
516         process, and check this against the pasteboard identifiers for each item on the platform pasteboard. If all
517         items in the platform pasteboard match the given pasteboard identifier (since we don't support writing multiple
518         pasteboard items via bindings, this should only be a single item), we skip showing the paste callout and
519         immediately invoke the programmatic paste handler.
520
521         * Scripts/webkit/messages.py:
522         * UIProcess/API/gtk/PageClientImpl.cpp:
523         (WebKit::PageClientImpl::requestDOMPasteAccess):
524         * UIProcess/API/gtk/PageClientImpl.h:
525         * UIProcess/API/wpe/PageClientImpl.cpp:
526         (WebKit::PageClientImpl::requestDOMPasteAccess):
527         * UIProcess/API/wpe/PageClientImpl.h:
528         * UIProcess/PageClient.h:
529         * UIProcess/WebPageProxy.cpp:
530         (WebKit::WebPageProxy::requestDOMPasteAccess):
531         * UIProcess/WebPageProxy.h:
532         * UIProcess/WebPageProxy.messages.in:
533
534         Add plumbing to deliver the pasteboard identifier to the client when requesting DOM paste.
535
536         * UIProcess/ios/PageClientImplIOS.h:
537         * UIProcess/ios/PageClientImplIOS.mm:
538         (WebKit::PageClientImpl::requestDOMPasteAccess):
539         * UIProcess/ios/WKContentViewInteraction.h:
540         * UIProcess/ios/WKContentViewInteraction.mm:
541         (-[WKContentView cleanupInteraction]):
542         (-[WKContentView resignFirstResponderForWebView]):
543         (-[WKContentView _webTouchEventsRecognized:]):
544         (-[WKContentView _willHideMenu:]):
545         (-[WKContentView pasteForWebView:]):
546         (-[WKContentView _handleDOMPasteRequestWithResult:]):
547         (-[WKContentView _willPerformAction:sender:]):
548         (-[WKContentView _didPerformAction:sender:]):
549         (-[WKContentView handleKeyWebEvent:withCompletionHandler:]):
550         (allPasteboardItemOriginsMatchOrigin):
551         (-[WKContentView _requestDOMPasteAccessWithElementRect:originIdentifier:completionHandler:]):
552         (-[WKContentView _requestDOMPasteAccessWithElementRect:completionHandler:]): Deleted.
553
554         Bail early in the case where all items' pasteboard identifiers (read via custom pasteboard data) match. When
555         this happens, we only grant access for the current paste command, rather than granting access for the user
556         gesture token.
557
558         * UIProcess/mac/PageClientImplMac.h:
559         * UIProcess/win/PageClientImpl.cpp:
560         (WebKit::PageClientImpl::requestDOMPasteAccess):
561         * UIProcess/win/PageClientImpl.h:
562         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
563         (WebKit::WebEditorClient::requestDOMPasteAccess):
564         * WebProcess/WebCoreSupport/WebEditorClient.h:
565         * WebProcess/WebPage/WebPage.cpp:
566         (WebKit::WebPage::requestDOMPasteAccess):
567         * WebProcess/WebPage/WebPage.h:
568
569 2019-02-27  Darin Adler  <darin@apple.com>
570
571         Fixed makeString(float) to do shortest-form serialization without first converting to double
572         https://bugs.webkit.org/show_bug.cgi?id=195142
573
574         Reviewed by Daniel Bates.
575
576         * UIProcess/PerActivityStateCPUUsageSampler.cpp: Removed unneeded include of DecimalNumber.h.
577
578 2019-03-02  Adrian Perez de Castro  <aperez@igalia.com>
579
580         [WPE] Public API headers are missing autocleanup definitions
581         https://bugs.webkit.org/show_bug.cgi?id=195211
582
583         Reviewed by Philippe Normand.
584
585         * PlatformWPE.cmake: List new API headers as installable.
586         * UIProcess/API/wpe/WebKitAutocleanups.h: Added. This is a copy of the header from the GTK
587         port, adapted to fit the WPE port.
588         * UIProcess/API/wpe/webkit.h: Add inclusion of WebKitAutocleanups.h
589         * WebProcess/InjectedBundle/API/wpe/WebKitWebExtensionAutocleanups.h: Added. Also adapted
590         from the equivalent header of the GTK port.
591         * WebProcess/InjectedBundle/API/wpe/webkit-web-extension.h: Add inclusion of
592         WebKitWebExtensionAutocleanups.h
593
594 2019-03-02  Michael Catanzaro  <mcatanzaro@igalia.com>
595
596         Remove unused WebPageProxy::m_navigationID
597         https://bugs.webkit.org/show_bug.cgi?id=195209
598
599         Reviewed by Darin Adler.
600
601         WebPageProxy::m_navigationID is never assigned to and is only used once by mistake in a
602         debug LOG(). It must be a refactoring mistake.
603
604         * UIProcess/WebPageProxy.cpp:
605         (WebKit::WebPageProxy::didCommitLoadForFrame):
606         * UIProcess/WebPageProxy.h:
607
608 2019-03-01  Darin Adler  <darin@apple.com>
609
610         Finish removing String::format
611         https://bugs.webkit.org/show_bug.cgi?id=194893
612
613         Reviewed by Daniel Bates.
614
615         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
616         (WebKit::LocalAuthenticator::getAssertion): Use makeString, attempting to fix
617         a problem where we passed an NSData * to format with a "%s"."
618
619 2019-03-01  Chris Dumez  <cdumez@apple.com>
620
621         Unreviewed Windows build fix after r242302.
622
623         * UIProcess/WebProcessPool.cpp:
624         (WebKit::WebProcessPool::ensureNetworkProcess):
625
626 2019-03-01  Alex Christensen  <achristensen@webkit.org>
627
628         NetworkDataTask redirection should not keep alive its NetworkSession
629         https://bugs.webkit.org/show_bug.cgi?id=194927
630
631         Reviewed by Darin Adler.
632
633         This should fix rdar://problem/47580502
634
635         * NetworkProcess/NetworkDataTask.h:
636         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
637         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
638
639 2019-03-01  Alex Christensen  <achristensen@webkit.org>
640
641         Revert r241223, r241235, and r241287
642         https://bugs.webkit.org/show_bug.cgi?id=194427
643         <rdar://48045861>
644
645         This caused crashes, and feature design has evolved away from needing the daemon in this form.
646
647         * NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.mm:
648         (WebKit::DaemonMain):
649         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h:
650         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
651         (WebKit::XPCServiceEventHandler):
652         (WebKit::XPCServiceMain):
653         (WebKit::XPCEventHandler): Deleted.
654         (WebKit::XPCInitializationHandler): Deleted.
655         * UIProcess/API/APIProcessPoolConfiguration.h:
656         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
657         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
658         (-[_WKProcessPoolConfiguration usesNetworkingDaemon]): Deleted.
659         (-[_WKProcessPoolConfiguration setUsesNetworkingDaemon:]): Deleted.
660         * UIProcess/AuxiliaryProcessProxy.cpp:
661         (WebKit::AuxiliaryProcessProxy::getLaunchOptions):
662         * UIProcess/Launcher/ProcessLauncher.h:
663         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
664         (WebKit::serviceName):
665         (WebKit::ProcessLauncher::launchProcess):
666         * UIProcess/Network/NetworkProcessProxy.cpp:
667         (WebKit::NetworkProcessProxy::getLaunchOptions):
668         * UIProcess/WebProcessPool.cpp:
669         (WebKit::WebProcessPool::usesNetworkingDaemon const): Deleted.
670         * UIProcess/WebProcessPool.h:
671
672 2019-03-01  Alex Christensen  <achristensen@webkit.org>
673
674         Add setters on WKWebsiteDataStore for sourceApplicationBundleIdentifier and sourceApplicationSecondaryIdentifier
675         https://bugs.webkit.org/show_bug.cgi?id=195229
676         <rdar://problem/48520362>
677
678         Reviewed by Chris Dumez.
679
680         Just like _setBoundInterfaceIdentifier, we need a way to set these properties after instantiation of a WKWebsiteDataStore,
681         but we need to make sure we don't set it after the parameters have been copied to the NetworkProcess.
682
683         Functionality verified by manual testing.  See radar.
684         Added an API test that verifies the setter restrictions work as expected.
685
686         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
687         (-[WKWebsiteDataStore _sourceApplicationBundleIdentifier]):
688         (-[WKWebsiteDataStore _setSourceApplicationBundleIdentifier:]):
689         (-[WKWebsiteDataStore _sourceApplicationSecondaryIdentifier]):
690         (-[WKWebsiteDataStore _setSourceApplicationSecondaryIdentifier:]):
691         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
692         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
693         (WebKit::toPKPaymentRequest):
694         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
695         (WebKit::WebsiteDataStore::parameters):
696         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
697         (WebKit::WebsiteDataStore::WebsiteDataStore):
698         (WebKit::WebsiteDataStore::setSourceApplicationSecondaryIdentifier):
699         (WebKit::WebsiteDataStore::setSourceApplicationBundleIdentifier):
700         * UIProcess/WebsiteData/WebsiteDataStore.h:
701         (WebKit::WebsiteDataStore::sourceApplicationBundleIdentifier):
702         (WebKit::WebsiteDataStore::sourceApplicationSecondaryIdentifier):
703
704 2019-03-01  Antoine Quint  <graouts@apple.com>
705
706         [iOS] Turn mouse event simulation on by default
707         https://bugs.webkit.org/show_bug.cgi?id=195218
708         <rdar://problem/48516794>
709
710         Reviewed by Dean Jackson.
711
712         * Shared/WebPreferences.yaml:
713
714 2019-03-01  Ross Kirsling  <ross.kirsling@sony.com>
715
716         EnvironmentUtilities::stripValuesEndingWithString isn't thread-safe
717         https://bugs.webkit.org/show_bug.cgi?id=194612
718
719         Reviewed by Alex Christensen.
720
721         This API test really shouldn't be verifying that the actual environment was successfully modified.
722
723         At its core, stripValuesEndingWithString is really just split-filter-join. By replacing it with a pair of
724         simple functions -- one for string processing, one for environment processing -- the API test only needs to
725         worry about the former.
726
727         * Platform/unix/EnvironmentUtilities.cpp:
728         (WebKit::EnvironmentUtilities::stripEntriesEndingWith):
729         (WebKit::EnvironmentUtilities::removeValuesEndingWith):
730         (WebKit::EnvironmentUtilities::stripValuesEndingWithString): Deleted.
731         * Platform/unix/EnvironmentUtilities.h:
732         Replace old function with a pair of simpler ones.
733
734         * NetworkProcess/EntryPoint/Cocoa/XPCService/NetworkServiceEntryPoint.mm:
735         (NetworkServiceInitializer):
736         * PluginProcess/EntryPoint/Cocoa/XPCService/PluginServiceEntryPoint.mm:
737         (PluginServiceInitializer):
738         * WebProcess/EntryPoint/Cocoa/XPCService/WebContentServiceEntryPoint.mm:
739         (WebContentServiceInitializer):
740         Update function name.
741
742 2019-03-01  Don Olmstead  <don.olmstead@sony.com>
743
744         Unify WebsiteDataStore::defaultDataStoreConfiguration across ports
745         https://bugs.webkit.org/show_bug.cgi?id=194844
746
747         Reviewed by Youenn Fablet.
748
749         Move the Cocoa implementation into APIWebsiteDataStore.cpp as the source of truth and
750         append configuration for Glib's DeviceIdHashSalts storage directory. This also fixes
751         a crash in Windows when running a Service Worker.
752
753         * UIProcess/API/APIWebsiteDataStore.cpp:
754         (API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory):
755         (API::WebsiteDataStore::defaultDataStoreConfiguration):
756         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
757         (API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory): Deleted.
758         (API::WebsiteDataStore::defaultDataStoreConfiguration): Deleted.
759         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
760         (API::WebsiteDataStore::defaultDataStoreConfiguration): Deleted.
761         * UIProcess/API/win/APIWebsiteDataStoreWin.cpp:
762         (API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory): Deleted.
763         (API::WebsiteDataStore::defaultDataStoreConfiguration): Deleted.
764
765 2019-03-01  John Wilander  <wilander@apple.com>
766
767         Resource Load Statistics: Further restrict client-side cookie persistence after cross-site navigations with link decoration
768         https://bugs.webkit.org/show_bug.cgi?id=195196
769         <rdar://problem/48006419>
770
771         Reviewed by Brent Fulgham.
772
773         Trackers abuse link query parameters to transport user identifiers cross-site.
774         This patch detects such navigations and applies further restrictions to
775         client-site cookies on the destination page.
776
777         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
778         (WebKit::NetworkConnectionToWebProcess::clearPageSpecificDataForResourceLoadStatistics):
779         (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForAllFramesOnPage): Deleted.
780             Renamed NetworkConnectionToWebProcess::clearPageSpecificDataForResourceLoadStatistics().
781         * NetworkProcess/NetworkConnectionToWebProcess.h:
782         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
783         * NetworkProcess/NetworkProcess.cpp:
784         (WebKit::NetworkProcess::committedCrossSiteLoadWithLinkDecoration):
785             Reporting IPC message when a link decorated cross-site navigation happens.
786         (WebKit::NetworkProcess::resetCrossSiteLoadsWithLinkDecorationForTesting):
787         * NetworkProcess/NetworkProcess.h:
788         * NetworkProcess/NetworkProcess.messages.in:
789         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
790         (WKWebsiteDataStoreStatisticsResetToConsistentState):
791             Added clearing of the new state between test runs.
792         * UIProcess/Network/NetworkProcessProxy.cpp:
793         (WebKit::NetworkProcessProxy::resetCrossSiteLoadsWithLinkDecorationForTesting):
794             Test infrastructure.
795         * UIProcess/Network/NetworkProcessProxy.h:
796         * UIProcess/WebPageProxy.cpp:
797         (WebKit::isNonUniqueNavigationWithLinkDecoration):
798             Convenience function.
799         (WebKit::WebPageProxy::didCommitLoadForFrame):
800             This function now reports to the network process when a link decorated
801             cross-site navigation happens.
802         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
803         (WebKit::WebsiteDataStore::resetCrossSiteLoadsWithLinkDecorationForTesting):
804             Test infrastructure.
805         * UIProcess/WebsiteData/WebsiteDataStore.h:
806         * WebProcess/WebPage/WebPage.cpp:
807         (WebKit::WebPage::close):
808             Name change of function called.
809
810 2019-03-01  Tim Horton  <timothy_horton@apple.com>
811
812         Remove unused code in WebKitLegacy
813         https://bugs.webkit.org/show_bug.cgi?id=189614
814
815         Reviewed by Simon Fraser.
816
817         * mac/MigrateHeadersFromWebKitLegacy.make:
818
819 2019-03-01  Tim Horton  <timothy_horton@apple.com>
820
821         Modernize WebKit::AttributedString a little bit
822         https://bugs.webkit.org/show_bug.cgi?id=195200
823
824         Reviewed by Wenson Hsieh.
825
826         * Shared/mac/AttributedString.h:
827         (WebKit::AttributedString::AttributedString):
828         (WebKit::AttributedString::operator NSAttributedString * const):
829         * Shared/mac/AttributedString.mm:
830         (IPC::ArgumentCoder<WebKit::AttributedString>::encode):
831         (IPC::ArgumentCoder<WebKit::AttributedString>::decode):
832         (WebKit::AttributedString::encode const): Deleted.
833         (WebKit::AttributedString::decode): Deleted.
834         * UIProcess/Cocoa/WebViewImpl.mm:
835         (WebKit::WebViewImpl::attributedSubstringForProposedRange):
836         * WebProcess/WebPage/mac/WebPageMac.mm:
837         (WebKit::WebPage::attributedSubstringForCharacterRangeAsync):
838         Modern coders, and a constructor and cast operator to/from NSAttributedString.
839         Also adopt those in a few places just for fun.
840
841 2019-03-01  Youenn Fablet  <youenn@apple.com>
842
843         Serialize IndexedDB::ObjectStoreOverwriteMode as an enum
844         https://bugs.webkit.org/show_bug.cgi?id=195213
845
846         Reviewed by Alex Christensen.
847
848         Make use of enum trait to automatically check for correct enum value when receiving a putOrAdd message.
849
850         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
851         (WebKit::WebIDBConnectionToClient::putOrAdd):
852         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
853         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
854         * Scripts/webkit/messages.py:
855         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
856         (WebKit::WebIDBConnectionToServer::putOrAdd):
857
858 2019-03-01  Don Olmstead  <don.olmstead@sony.com>
859
860         [WinCairo] Enable service worker
861         https://bugs.webkit.org/show_bug.cgi?id=188318
862
863         Reviewed by Youenn Fablet.
864
865         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
866         (WebKit::WebSWContextManagerConnection::terminateProcess):
867         * WebProcess/Storage/WebSWContextManagerConnection.h:
868         * config.h:
869
870 2019-03-01  Chris Dumez  <cdumez@apple.com>
871
872         Flaky API Test TestWebKitAPI.ProcessSwap.LoadUnload
873         https://bugs.webkit.org/show_bug.cgi?id=195110
874
875         Reviewed by Ryosuke Niwa.
876
877         The test was attempting to disable PageCache via view preferences instead of using the
878         process pool configuration flag. This would fail to disable PageCache because the
879         usesPageCache preference would not prevent the creation of SuspendedPageProxy objects.
880         As a result, the firing on the unload event would get delayed until the SuspendedPageProxy
881         objects would get destroyed, which would lead to flakiness.
882
883         This patch updates WebPageProxy::suspendCurrentPageIfPossible() to not create suspended
884         pages proxies when the usesPageCache preference is set to false.
885
886         * UIProcess/WebPageProxy.cpp:
887         (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
888
889 2019-03-01  Carlos Garcia Campos  <cgarcia@igalia.com>
890
891         [ThreadedCompositor] Simply the compositing run loop worker thread
892         https://bugs.webkit.org/show_bug.cgi?id=195208
893
894         Reviewed by Don Olmstead.
895
896         We can remove the WorkQueuePool, since we never really supported more than one thread, and now that single
897         process model non longer exists it doesn't even make sense. We can simply use a RunLoop instead of a WorkQueue
898         so that the implementation is not specific to the generic WorkQueue implementation.
899
900         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
901         (WebKit::createRunLoop): Helper function to create the RunLoop in a worker thread before m_updateTimer is initialized.
902         (WebKit::CompositingRunLoop::CompositingRunLoop): Use createRunLoop().
903         (WebKit::CompositingRunLoop::~CompositingRunLoop): Stop the worker thread run loop in the next main run loop iteration.
904         (WebKit::CompositingRunLoop::performTask): Use m_runLoop.
905         (WebKit::CompositingRunLoop::performTaskSync): Ditto.
906         (WebKit::WorkQueuePool::singleton): Deleted.
907         (WebKit::WorkQueuePool::dispatch): Deleted.
908         (WebKit::WorkQueuePool::runLoop): Deleted.
909         (WebKit::WorkQueuePool::invalidate): Deleted.
910         (WebKit::WorkQueuePool::WorkQueuePool): Deleted.
911         (WebKit::WorkQueuePool::getOrCreateWorkQueueForContext): Deleted.
912         (): Deleted.
913         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
914
915 2019-03-01  Justin Fan  <justin_fan@apple.com>
916
917         [Web GPU] 32-bit builds broken by attempt to disable WebGPU on 32-bit
918         https://bugs.webkit.org/show_bug.cgi?id=195191
919
920         Rubber-stamped by Dean Jackson.
921
922         Dropping support for 32-bit entirely, so I'm intentionally leaving 32-bit broken.
923
924         * Configurations/FeatureDefines.xcconfig:
925
926 2019-02-28  Chris Dumez  <cdumez@apple.com>
927
928         HTTPSUpgradeList.db database should be opened in readonly mode
929         https://bugs.webkit.org/show_bug.cgi?id=195194
930         <rdar://problem/47103889>
931
932         Reviewed by Youenn Fablet.
933
934         HTTPSUpgradeList.db database should be opened in readonly mode since it is not meant to be
935         modified by WebKit. Opening it in ReadWrite mode causes sandbox violations.
936
937         * NetworkProcess/NetworkHTTPSUpgradeChecker.cpp:
938         (WebKit::NetworkHTTPSUpgradeChecker::NetworkHTTPSUpgradeChecker):
939
940 2019-02-28  David Quesada  <david_quesada@apple.com>
941
942         Expose APINavigationAction.shouldPerformDownload() on WKNavigationAction
943         https://bugs.webkit.org/show_bug.cgi?id=195121
944         rdar://problem/48450302
945
946         Reviewed by Alex Christensen.
947
948         * UIProcess/API/Cocoa/WKNavigationAction.mm:
949         (-[WKNavigationAction _shouldPerformDownload]):
950         * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
951
952 2019-02-28  Antoine Quint  <graouts@apple.com>
953
954         Disable Web Animations in Safari Technology Preview
955         https://bugs.webkit.org/show_bug.cgi?id=194748
956         <rdar://problem/48139481>
957
958         Reviewed by Dean Jackson.
959
960         The test runners already opt into that feature explicitly, so all that is needed is to turn
961         the default setting value to false.
962
963         * Shared/WebPreferences.yaml:
964
965 2019-02-28  Antoine Quint  <graouts@apple.com>
966
967         Enable the Pointer Events runtime flag by default
968         https://bugs.webkit.org/show_bug.cgi?id=195156
969
970         Reviewed by Dean Jackson.
971
972         * Shared/WebPreferences.yaml:
973
974 2019-02-28  Sihui Liu  <sihui_liu@apple.com>
975
976         Revert r232263: it caused processes to crash because process was suspended with locked file
977         https://bugs.webkit.org/show_bug.cgi?id=195122
978         <rdar://problem/48444599>
979
980         Reviewed by Geoffrey Garen.
981
982         * NetworkProcess/NetworkProcess.cpp:
983         (WebKit::NetworkProcess::NetworkProcess):
984         * NetworkProcess/NetworkProcess.h:
985         * Shared/WebSQLiteDatabaseTracker.cpp:
986         (WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker):
987         (WebKit::WebSQLiteDatabaseTracker::hysteresisUpdated):
988         * Shared/WebSQLiteDatabaseTracker.h:
989         * WebProcess/WebProcess.cpp:
990         (WebKit::m_webSQLiteDatabaseTracker):
991         (WebKit::m_nonVisibleProcessCleanupTimer): Deleted.
992         * WebProcess/WebProcess.h:
993
994 2019-02-28  Per Arne Vollan  <pvollan@apple.com>
995
996         [iOS] Move calls to [UIKeyboard isInHardwareKeyboardMode] to the UI process.
997         https://bugs.webkit.org/show_bug.cgi?id=193683
998         <rdar://problem/47634345>
999
1000         Reviewed by Brent Fulgham.
1001
1002         When a keyboard is attached/deattached or the application becomes foreground, send a message from
1003         the UI process to the WebContent process, notifying whether a keyboard is attached or not. Also,
1004         cache the value of [UIKeyboard isInHardwareKeyboardMode] in the UI process, since this call seems
1005         to be expensive.
1006
1007         * UIProcess/API/Cocoa/WKWebView.mm:
1008         (hardwareKeyboardAvailabilityChangedCallback):
1009         * UIProcess/WebPageProxy.h:
1010         * UIProcess/WebProcessProxy.h:
1011         (WebKit::WebProcessProxy::setKeyboardIsAttached):
1012         (WebKit::WebProcessProxy::keyboardIsAttached const):
1013         * UIProcess/ios/WKContentViewInteraction.mm:
1014         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
1015         * UIProcess/ios/WebPageProxyIOS.mm:
1016         (WebKit::WebPageProxy::applicationWillEnterForeground):
1017         (WebKit::WebPageProxy::hardwareKeyboardAvailabilityChanged):
1018         * WebProcess/WebPage/WebPage.h:
1019         * WebProcess/WebPage/WebPage.messages.in:
1020         * WebProcess/WebPage/ios/WebPageIOS.mm:
1021         (WebKit::WebPage::platformEditorState const):
1022         (WebKit::WebPage::hardwareKeyboardAvailabilityChanged):
1023
1024 2019-02-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1025
1026         [CoordinatedGraphics] Remove COORDINATED_GRAPHICS_THREADED option
1027         https://bugs.webkit.org/show_bug.cgi?id=195159
1028
1029         Reviewed by Don Olmstead.
1030
1031         Use COORDINATED_GRAPHICS instead.
1032
1033         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1034         (WebKit::CoordinatedGraphicsScene::onNewBufferAvailable):
1035         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
1036         * Shared/CoordinatedGraphics/SimpleViewportController.cpp:
1037         * Shared/CoordinatedGraphics/SimpleViewportController.h:
1038         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
1039         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
1040         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1041         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
1042         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
1043         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.h:
1044         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
1045         (WebKit::AcceleratedDrawingArea::mainFrameContentSizeChanged):
1046         (WebKit::AcceleratedDrawingArea::enterAcceleratedCompositingMode):
1047         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
1048         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h:
1049         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1050         (WebKit::DrawingAreaImpl::updatePreferences):
1051         * WebProcess/WebPage/WebPage.cpp:
1052         (WebKit::WebPage::sendViewportAttributesChanged):
1053         (WebKit::WebPage::viewportPropertiesDidChange):
1054         * WebProcess/gtk/WebProcessMainGtk.cpp:
1055
1056 2019-02-28  Sihui Liu  <sihui_liu@apple.com>
1057
1058         Stop using legacy IDB path by default when creating WebProcessPool from websiteDataStore
1059         https://bugs.webkit.org/show_bug.cgi?id=194958
1060
1061         Reviewed by Geoffrey Garen.
1062
1063         ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration should not use fixed IDB path.
1064
1065         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1066         (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
1067         * UIProcess/API/APIWebsiteDataStore.cpp:
1068         (API::WebsiteDataStore::createLegacy):
1069         (API::indexedDBDatabaseDirectory):
1070         * UIProcess/API/APIWebsiteDataStore.h:
1071         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1072         (-[WKWebsiteDataStore _indexedDBDatabaseDirectory]):
1073         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
1074         * UIProcess/WebProcessPool.cpp:
1075         (WebKit::legacyWebsiteDataStoreConfiguration):
1076
1077 2019-02-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1078
1079         [CoordinatedGraphics] Unify all LayerTreeHost classes
1080         https://bugs.webkit.org/show_bug.cgi?id=195094
1081
1082         Reviewed by Žan Doberšek.
1083
1084         There's no reason to have 3 classes, since currently LayerTreeHost is only used by coordinated graphics based
1085         ports.
1086
1087         * PlatformWin.cmake:
1088         * SourcesGTK.txt:
1089         * SourcesWPE.txt:
1090         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
1091         (WebKit::AcceleratedDrawingArea::enterAcceleratedCompositingMode):
1092         (WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModeNow):
1093         * WebProcess/WebPage/AcceleratedDrawingArea.h:
1094         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: Removed.
1095         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h: Removed.
1096         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp: Renamed from Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp.
1097         (WebKit::LayerTreeHost::LayerTreeHost):
1098         (WebKit::LayerTreeHost::~LayerTreeHost):
1099         (WebKit::LayerTreeHost::setLayerFlushSchedulingEnabled):
1100         (WebKit::LayerTreeHost::scheduleLayerFlush):
1101         (WebKit::LayerTreeHost::cancelPendingLayerFlush):
1102         (WebKit::LayerTreeHost::layerFlushTimerFired):
1103         (WebKit::LayerTreeHost::setRootCompositingLayer):
1104         (WebKit::LayerTreeHost::setViewOverlayRootLayer):
1105         (WebKit::LayerTreeHost::invalidate):
1106         (WebKit::LayerTreeHost::scrollNonCompositedContents):
1107         (WebKit::LayerTreeHost::forceRepaint):
1108         (WebKit::LayerTreeHost::forceRepaintAsync):
1109         (WebKit::LayerTreeHost::sizeDidChange):
1110         (WebKit::LayerTreeHost::pauseRendering):
1111         (WebKit::LayerTreeHost::resumeRendering):
1112         (WebKit::LayerTreeHost::graphicsLayerFactory):
1113         (WebKit::LayerTreeHost::contentsSizeChanged):
1114         (WebKit::LayerTreeHost::didChangeViewportAttributes):
1115         (WebKit::LayerTreeHost::didChangeViewport):
1116         (WebKit::LayerTreeHost::setIsDiscardable):
1117         (WebKit::LayerTreeHost::setNativeSurfaceHandleForCompositing):
1118         (WebKit::LayerTreeHost::deviceOrPageScaleFactorChanged):
1119         (WebKit::LayerTreeHost::createDisplayRefreshMonitor):
1120         (WebKit::LayerTreeHost::didFlushRootLayer):
1121         (WebKit::LayerTreeHost::commitSceneState):
1122         (WebKit::LayerTreeHost::frameComplete):
1123         (WebKit::LayerTreeHost::nativeSurfaceHandleForCompositing):
1124         (WebKit::LayerTreeHost::didDestroyGLContext):
1125         (WebKit::LayerTreeHost::willRenderFrame):
1126         (WebKit::LayerTreeHost::didRenderFrame):
1127         (WebKit::LayerTreeHost::requestDisplayRefreshMonitorUpdate):
1128         (WebKit::LayerTreeHost::handleDisplayRefreshMonitorUpdate):
1129         (WebKit::LayerTreeHost::renderNextFrame):
1130         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h: Renamed from Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h.
1131         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1132         (WebKit::DrawingAreaImpl::setNeedsDisplay):
1133         (WebKit::DrawingAreaImpl::setNeedsDisplayInRect):
1134         * WebProcess/WebPage/LayerTreeHost.cpp: Removed.
1135         * WebProcess/WebPage/LayerTreeHost.h: Removed.
1136         * WebPage/win/LayerTreeHost.h: Added.
1137
1138 2019-02-28  Justin Fan  <justin_fan@apple.com>
1139
1140         [Web GPU] Enable Web GPU only on 64-bit
1141         https://bugs.webkit.org/show_bug.cgi?id=195139
1142
1143         Because Metal is only supported on 64 bit apps.
1144
1145         Unreviewed build fix.
1146
1147         * Configurations/FeatureDefines.xcconfig:
1148
1149 2019-02-27  Simon Fraser  <simon.fraser@apple.com>
1150
1151         Roll out r242014; it caused crashes in compositing logging (webkit.org/b/195141)
1152
1153         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
1154         (WebKit::LocalAuthenticator::getAssertion):
1155
1156 2019-02-27  Michael Catanzaro  <mcatanzaro@igalia.com>
1157
1158         Unreviewed, fix -Wformat warning
1159
1160         * WebProcess/WebPage/WebPage.cpp:
1161         (WebKit::WebPage::didCompletePageTransition):
1162
1163 2019-02-27  Brent Fulgham  <bfulgham@apple.com>
1164
1165         REGRESSION: Crash beneath ResourceLoadObserver::logSubresourceLoading
1166         https://bugs.webkit.org/show_bug.cgi?id=195072
1167
1168         Reviewed by Ryosuke Niwa.
1169
1170         ResourceLoadObserver and WebProcess should exist as long as the web page (process) is running. However,
1171         the NetworkProcess connection can close for a variety of reasons. If the ResourceLoadObserver observes
1172         a load or user gesture in the WebProcess, we should attempt to reconnect to the NetworkProcess (if it
1173         was disconnected), just like we do for other message send cases.
1174
1175         This patch switches from using the m_networkProcessConnection member (which might be null) to use the
1176         'ensureNetworkProcessConnection' accessor which ensures we have a valid connection for message sends.
1177
1178         * WebProcess/WebProcess.cpp:
1179         (WebKit::WebProcess::initializeWebProcess):
1180
1181 2019-02-27  Chris Dumez  <cdumez@apple.com>
1182
1183         Flaky API Test: TestWebKitAPI.ProcessSwap.SessionStorage
1184         https://bugs.webkit.org/show_bug.cgi?id=194480
1185
1186         Reviewed by Brady Eidson.
1187
1188         The StorageManager would only start listening for IPC on a given connection when
1189         StorageManager::processWillOpenConnection() is called. This gets called from
1190         WebsiteDataStore::webProcessWillOpenConnection() which gets called from
1191         WebProcessLifetimeTracker::webPageEnteringWebProcess().
1192
1193         webPageEnteringWebProcess() was called in WebPageProxy::finishAttachingToWebProcess()
1194         after process-swapping. This means that IPC comming from the *provisional* process
1195         would not get processed and we would only start processing IPC on the provisional
1196         process's connection when it would get committed.
1197
1198         To address the issue, this patch teaches WebProcessLifetimeTracker that a page can
1199         now have several processes. We also make sure that webPageEnteringWebProcess() gets
1200         called for the provisional process as soon as we create the provisional page, instead
1201         of waiting for it to get committed.
1202
1203         * UIProcess/ProvisionalPageProxy.cpp:
1204         (WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
1205         (WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
1206         (WebKit::ProvisionalPageProxy::connectionWillOpen):
1207         * UIProcess/ProvisionalPageProxy.h:
1208         * UIProcess/WebPageProxy.cpp:
1209         (WebKit::WebPageProxy::finishAttachingToWebProcess):
1210         (WebKit::WebPageProxy::connectionWillOpen):
1211         (WebKit::WebPageProxy::webProcessWillShutDown):
1212         (WebKit::WebPageProxy::processDidTerminate):
1213         * UIProcess/WebPageProxy.h:
1214         (WebKit::WebPageProxy::webProcessLifetimeTracker):
1215         * UIProcess/WebProcessLifetimeObserver.cpp:
1216         (WebKit::WebProcessLifetimeObserver::addWebPage):
1217         (WebKit::WebProcessLifetimeObserver::removeWebPage):
1218         * UIProcess/WebProcessLifetimeObserver.h:
1219         * UIProcess/WebProcessLifetimeTracker.cpp:
1220         (WebKit::WebProcessLifetimeTracker::addObserver):
1221         (WebKit::WebProcessLifetimeTracker::webPageEnteringWebProcess):
1222         (WebKit::WebProcessLifetimeTracker::webPageLeavingWebProcess):
1223         (WebKit::WebProcessLifetimeTracker::pageWasInvalidated):
1224         (WebKit::WebProcessLifetimeTracker::processIsRunning):
1225         * UIProcess/WebProcessLifetimeTracker.h:
1226         * UIProcess/WebProcessProxy.cpp:
1227         (WebKit::WebProcessProxy::connectionWillOpen):
1228         * UIProcess/WebStorage/StorageManager.cpp:
1229         (WebKit::StorageManager::SessionStorageNamespace::allowedConnections const):
1230         (WebKit::StorageManager::SessionStorageNamespace::addAllowedConnection):
1231         (WebKit::StorageManager::SessionStorageNamespace::removeAllowedConnection):
1232         (WebKit::StorageManager::addAllowedSessionStorageNamespaceConnection):
1233         (WebKit::StorageManager::removeAllowedSessionStorageNamespaceConnection):
1234         (WebKit::StorageManager::processWillOpenConnection):
1235         (WebKit::StorageManager::processDidCloseConnection):
1236         (WebKit::StorageManager::createSessionStorageMap):
1237         (WebKit::StorageManager::SessionStorageNamespace::allowedConnection const): Deleted.
1238         (WebKit::StorageManager::SessionStorageNamespace::setAllowedConnection): Deleted.
1239         (WebKit::StorageManager::setAllowedSessionStorageNamespaceConnection): Deleted.
1240         * UIProcess/WebStorage/StorageManager.h:
1241         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1242         (WebKit::WebsiteDataStore::webPageWillOpenConnection):
1243         (WebKit::WebsiteDataStore::webPageDidCloseConnection):
1244
1245 2019-02-27  Wenson Hsieh  <wenson_hsieh@apple.com>
1246
1247         [iOS] Web pages shouldn't be able to present a keyboard after the web view resigns first responder
1248         https://bugs.webkit.org/show_bug.cgi?id=195118
1249         <rdar://problem/43411940>
1250
1251         Reviewed by Tim Horton.
1252
1253         It's currently possible for websites to redirect focus into an editable element on the page by programmatically
1254         requesting focus within the "blur" event handler. This is because our current heuristics:
1255
1256         (1) Allow programmatic focus to show the keyboard when an element is already focused; this is meant to handle
1257             the case where the page moves focus between different elements on the page.
1258         (2) And also allow programmatic focus to show the keyboard when changing activity state; this is meant to handle
1259             the case where a focused element should show the keyboard when first responder is restored on a web view
1260             (e.g. in the case where a modal view controller is dismissed, and the web view regains first responder once
1261             again).
1262
1263         In both of these scenarios, we actually only want the keyboard to appear if the web view itself is either
1264         becoming the first responder, or is already the first responder. Importantly, when blurring the focused element
1265         by calling -[WKWebViewe resignFirstResponder] (as is the case when dismissing the keyboard by tapping 'Done' or
1266         focusing other platform UI), we don't want to allow the page to show the keyboard due to element focus.
1267
1268         To fix this issue, we enforce that we're either becoming the first responder or already are the first responder
1269         before showing the keyboard due to activity state change or focused element change.
1270
1271         Test: fast/events/ios/do-not-show-keyboard-when-focusing-after-blur.html
1272
1273         * UIProcess/ios/WKContentViewInteraction.h:
1274         * UIProcess/ios/WKContentViewInteraction.mm:
1275         (-[WKContentView setupInteraction]):
1276         (-[WKContentView textInputTraits]):
1277
1278         Quick drive-by tweak: rename _isBlurringFocusedNode to _isBlurringFocusedElement, to match the rest of the
1279         terminology used in WebKit.
1280
1281         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
1282
1283         Make our heuristics for determining whether to show the keyboard a tiny bit easier to follow, by moving the
1284         logic into a lambda function and using early returns. See above for more details.
1285
1286         (-[WKContentView _elementDidBlur]):
1287         (-[WKContentView focusedFormControllerDidUpdateSuggestions:]):
1288
1289 2019-02-27  John Wilander  <wilander@apple.com>
1290
1291         Adopt WebCore::RegistrableDomain in WebCore::ResourceLoadStatistics and WebKit::NetworkProcessProxy
1292         https://bugs.webkit.org/show_bug.cgi?id=195071
1293         <rdar://problem/48417690>
1294
1295         Reviewed by Alex Christensen and Brent Fulgham.
1296
1297         This patch adopts WebCore::RegistrableDomain in WebKit::NetworkProcessProxy
1298         and makes the necessary infrastructure changes to support that.
1299
1300         The previous HashCountedSets in WebCore::ResourceLoadStatistics are now just
1301         HashSets since we never used the counts for anything. This change simplified
1302         the IPC::ArgumentCoder<ResourceLoadStatistics> encode and decode functions.
1303
1304         The patch also makes WebCore::RegistrableDomain's String constructor private.
1305         A new create function WebCore::RegistrableDomain::uncheckedCreateFromString()
1306         is introduced to better signal to users that creating a registrable domain
1307         object with a string may create an object that doesn't match a registrable
1308         domain in a valid HTTP-family URL.
1309
1310         Finally, this patch harmonizes parameter and variable naming, going from
1311         "origin" to "domain" and "mainFrame" to "topFrame."
1312
1313         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
1314         (WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords):
1315         (WebKit::ResourceLoadStatisticsMemoryStore::recursivelyGetAllDomainsThatHaveRedirectedToThisDomain const):
1316         (WebKit::ResourceLoadStatisticsMemoryStore::markAsPrevalentIfHasRedirectedToPrevalent):
1317         (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccess):
1318         (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccessInternal):
1319         (WebKit::ResourceLoadStatisticsMemoryStore::logFrameNavigation):
1320         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceLoading):
1321         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceRedirect):
1322         (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsSubresourceUnder const):
1323         (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsSubFrameUnder const):
1324         (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsRedirectingTo const):
1325         (WebKit::ResourceLoadStatisticsMemoryStore::setSubframeUnderTopFrameDomain):
1326         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUnderTopFrameDomain):
1327         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUniqueRedirectTo):
1328         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUniqueRedirectFrom):
1329         (WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectTo):
1330         (WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectFrom):
1331         (WebKit::ResourceLoadStatisticsMemoryStore::createEncoderFromData const):
1332         (WebKit::ResourceLoadStatisticsMemoryStore::hasUserGrantedStorageAccessThroughPrompt):
1333         (WebKit::ResourceLoadStatisticsMemoryStore::hasHadUnexpiredRecentUserInteraction const):
1334         (WebKit::ResourceLoadStatisticsMemoryStore::setSubframeUnderTopFrameOrigin): Deleted.
1335         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUnderTopFrameOrigin): Deleted.
1336         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
1337         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
1338         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessGranted):
1339         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameDomain):
1340         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameDomain):
1341         (WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
1342         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin): Deleted.
1343         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin): Deleted.
1344         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
1345         * NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp:
1346         (WebKit::sortedPrevalentResourceTelemetry):
1347         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1348         * NetworkProcess/NetworkProcess.cpp:
1349         (WebKit::NetworkProcess::setSubframeUnderTopFrameDomain):
1350         (WebKit::NetworkProcess::setSubresourceUnderTopFrameDomain):
1351         (WebKit::filterForRegistrableDomains):
1352         (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
1353         (WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
1354         (WebKit::NetworkProcess::setSubframeUnderTopFrameOrigin): Deleted.
1355         (WebKit::NetworkProcess::setSubresourceUnderTopFrameOrigin): Deleted.
1356         * NetworkProcess/NetworkProcess.h:
1357         * NetworkProcess/NetworkProcess.messages.in:
1358         * NetworkProcess/NetworkSession.cpp:
1359         (WebKit::NetworkSession::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
1360         * NetworkProcess/NetworkSession.h:
1361         * Platform/classifier/ResourceLoadStatisticsClassifier.cpp:
1362         (WebKit::ResourceLoadStatisticsClassifier::calculateResourcePrevalence):
1363         * Shared/WebCoreArgumentCoders.cpp:
1364         (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
1365         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
1366         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1367         (WKWebsiteDataStoreSetStatisticsSubframeUnderTopFrameOrigin):
1368         (WKWebsiteDataStoreSetStatisticsSubresourceUnderTopFrameOrigin):
1369         * UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm:
1370         (WebKit::ResourceLoadStatisticsMemoryStore::registerUserDefaultsIfNeeded):
1371         * UIProcess/Network/NetworkProcessProxy.cpp:
1372         (WebKit::NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor):
1373         (WebKit::NetworkProcessProxy::isPrevalentResource):
1374         (WebKit::NetworkProcessProxy::isVeryPrevalentResource):
1375         (WebKit::NetworkProcessProxy::setPrevalentResource):
1376         (WebKit::NetworkProcessProxy::setPrevalentResourceForDebugMode):
1377         (WebKit::NetworkProcessProxy::setVeryPrevalentResource):
1378         (WebKit::NetworkProcessProxy::setLastSeen):
1379         (WebKit::NetworkProcessProxy::clearPrevalentResource):
1380         (WebKit::NetworkProcessProxy::logUserInteraction):
1381         (WebKit::NetworkProcessProxy::hasHadUserInteraction):
1382         (WebKit::NetworkProcessProxy::clearUserInteraction):
1383         (WebKit::NetworkProcessProxy::setSubframeUnderTopFrameDomain):
1384         (WebKit::NetworkProcessProxy::isRegisteredAsRedirectingTo):
1385         (WebKit::NetworkProcessProxy::isRegisteredAsSubFrameUnder):
1386         (WebKit::NetworkProcessProxy::setSubresourceUnderTopFrameDomain):
1387         (WebKit::NetworkProcessProxy::isRegisteredAsSubresourceUnder):
1388         (WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectTo):
1389         (WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectFrom):
1390         (WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectTo):
1391         (WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectFrom):
1392         (WebKit::NetworkProcessProxy::isGrandfathered):
1393         (WebKit::NetworkProcessProxy::setGrandfathered):
1394         (WebKit::NetworkProcessProxy::hasStorageAccessForFrame):
1395         (WebKit::NetworkProcessProxy::hasStorageAccess):
1396         (WebKit::NetworkProcessProxy::requestStorageAccess):
1397         (WebKit::NetworkProcessProxy::requestStorageAccessConfirm):
1398         (WebKit::NetworkProcessProxy::grantStorageAccess):
1399         (WebKit::NetworkProcessProxy::setSubframeUnderTopFrameOrigin): Deleted.
1400         (WebKit::NetworkProcessProxy::setSubresourceUnderTopFrameOrigin): Deleted.
1401         * UIProcess/Network/NetworkProcessProxy.h:
1402         * UIProcess/Network/NetworkProcessProxy.messages.in:
1403         * UIProcess/WebPageProxy.cpp:
1404         (WebKit::WebPageProxy::requestStorageAccessConfirm):
1405         * UIProcess/WebPageProxy.h:
1406         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1407         (WebKit::WebsiteDataStore::isPrevalentResource):
1408         (WebKit::WebsiteDataStore::setPrevalentResource):
1409         (WebKit::WebsiteDataStore::setPrevalentResourceForDebugMode):
1410         (WebKit::WebsiteDataStore::isVeryPrevalentResource):
1411         (WebKit::WebsiteDataStore::setVeryPrevalentResource):
1412         (WebKit::WebsiteDataStore::setSubframeUnderTopFrameDomain):
1413         (WebKit::WebsiteDataStore::isRegisteredAsSubFrameUnder):
1414         (WebKit::WebsiteDataStore::setSubresourceUnderTopFrameDomain):
1415         (WebKit::WebsiteDataStore::isRegisteredAsSubresourceUnder):
1416         (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectTo):
1417         (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectFrom):
1418         (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectTo):
1419         (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectFrom):
1420         (WebKit::WebsiteDataStore::isRegisteredAsRedirectingTo):
1421         (WebKit::WebsiteDataStore::clearPrevalentResource):
1422         (WebKit::WebsiteDataStore::setLastSeen):
1423         (WebKit::WebsiteDataStore::hasStorageAccess):
1424         (WebKit::WebsiteDataStore::requestStorageAccess):
1425         (WebKit::WebsiteDataStore::grantStorageAccess):
1426         (WebKit::WebsiteDataStore::logUserInteraction):
1427         (WebKit::WebsiteDataStore::hasHadUserInteraction):
1428         (WebKit::WebsiteDataStore::clearUserInteraction):
1429         (WebKit::WebsiteDataStore::setGrandfathered):
1430         (WebKit::WebsiteDataStore::setSubframeUnderTopFrameOrigin): Deleted.
1431         (WebKit::WebsiteDataStore::setSubresourceUnderTopFrameOrigin): Deleted.
1432         * UIProcess/WebsiteData/WebsiteDataStore.h:
1433         * WebProcess/WebPage/WebPage.cpp:
1434         (WebKit::WebPage::hasStorageAccess):
1435         (WebKit::WebPage::requestStorageAccess):
1436
1437 2019-02-27  Keith Rollin  <krollin@apple.com>
1438
1439         Fix Xcode project UUIDs for TextCheckerCompletion.cpp and TextCheckerCompletion.h
1440         https://bugs.webkit.org/show_bug.cgi?id=195109
1441         <rdar://problem/48442272>
1442
1443         Reviewed by Alexey Proskuryakov.
1444
1445         In r144436, TextCheckerCompletion.cpp and TextCheckerCompletion.h were
1446         added to WebKit2.xcodeproj with invalid UUIDs (they included Q's and
1447         Z's in hexadecimal strings). While these UUIDs haven't caused any
1448         problems in practice over the last six years, they are indeed invalid,
1449         and were discovered via an Xcode-project processing tool that did not
1450         anticipate their format. Fix this by removing the files from the
1451         project and re-adding them.
1452
1453         * WebKit.xcodeproj/project.pbxproj:
1454
1455 2019-02-27  Youenn Fablet  <youenn@apple.com>
1456
1457         Remove UserMediaProcessManager processState map
1458         https://bugs.webkit.org/show_bug.cgi?id=195056
1459
1460         Reviewed by Eric Carlson.
1461
1462         Before the patch, the WebProcessProxy->ProcessState map was storing the list of manager proxies and process state.
1463         To improve on this model, this patch does the following:
1464         - Move the process state to WebProcessProxy.
1465         - Remove the map and replace it by a set of all manager proxies.
1466
1467         This simplifies the handling.
1468         On WebProcess side, instead of storing the sandbox extensions in each WebPage, we handle them in WebProcess directly.
1469         This mirrors what is being done in UIProcess and reduces the risk of inconsistencies between the two, the risk being that capture would fail.
1470
1471         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1472         (WebKit::UserMediaPermissionRequestManagerProxy::forEach):
1473         (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy):
1474         (WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):
1475         (WebKit::UserMediaPermissionRequestManagerProxy::captureStateChanged):
1476         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
1477         * UIProcess/UserMediaProcessManager.cpp:
1478         (WebKit::UserMediaProcessManager::muteCaptureMediaStreamsExceptIn):
1479         (WebKit::UserMediaProcessManager::willCreateMediaStream):
1480         (WebKit::UserMediaProcessManager::endedCaptureSession):
1481         (WebKit::UserMediaProcessManager::setCaptureEnabled):
1482         (WebKit::UserMediaProcessManager::captureDevicesChanged):
1483         (WebKit::ProcessState::ProcessState): Deleted.
1484         (WebKit::ProcessState::hasVideoExtension const): Deleted.
1485         (WebKit::ProcessState::grantVideoExtension): Deleted.
1486         (WebKit::ProcessState::revokeVideoExtension): Deleted.
1487         (WebKit::ProcessState::hasAudioExtension const): Deleted.
1488         (WebKit::ProcessState::grantAudioExtension): Deleted.
1489         (WebKit::ProcessState::revokeAudioExtension): Deleted.
1490         (WebKit::stateMap): Deleted.
1491         (WebKit::processState): Deleted.
1492         (WebKit::ProcessState::addRequestManager): Deleted.
1493         (WebKit::ProcessState::removeRequestManager): Deleted.
1494         (WebKit::UserMediaProcessManager::addUserMediaPermissionRequestManagerProxy): Deleted.
1495         (WebKit::UserMediaProcessManager::removeUserMediaPermissionRequestManagerProxy): Deleted.
1496         (WebKit::UserMediaProcessManager::startedCaptureSession): Deleted.
1497         * UIProcess/UserMediaProcessManager.h:
1498         * UIProcess/WebProcessProxy.h:
1499         (WebKit::WebProcessProxy::mediaCaptureSandboxExtensions const):
1500         (WebKit::WebProcessProxy::hasVideoCaptureExtension const):
1501         (WebKit::WebProcessProxy::grantVideoCaptureExtension):
1502         (WebKit::WebProcessProxy::revokeVideoCaptureExtension):
1503         (WebKit::WebProcessProxy::hasAudioCaptureExtension const):
1504         (WebKit::WebProcessProxy::grantAudioCaptureExtension):
1505         (WebKit::WebProcessProxy::revokeAudioCaptureExtension):
1506         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
1507         (WebKit::UserMediaPermissionRequestManager::~UserMediaPermissionRequestManager): Deleted.
1508         (WebKit::UserMediaPermissionRequestManager::clear): Deleted.
1509         (WebKit::UserMediaPermissionRequestManager::grantUserMediaDeviceSandboxExtensions): Deleted.
1510         (WebKit::UserMediaPermissionRequestManager::revokeUserMediaDeviceSandboxExtensions): Deleted.
1511         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
1512         * WebProcess/WebPage/WebPage.cpp:
1513         (WebKit::WebPage::close):
1514         (WebKit::WebPage::grantUserMediaDeviceSandboxExtensions): Deleted.
1515         (WebKit::WebPage::revokeUserMediaDeviceSandboxExtensions): Deleted.
1516         * WebProcess/WebPage/WebPage.h:
1517         * WebProcess/WebPage/WebPage.messages.in:
1518         * WebProcess/WebProcess.cpp:
1519         (WebKit::WebProcess::grantUserMediaDeviceSandboxExtensions):
1520         (WebKit::WebProcess::revokeUserMediaDeviceSandboxExtensions):
1521         * WebProcess/WebProcess.h:
1522         * WebProcess/WebProcess.messages.in:
1523
1524 2019-02-27  Per Arne Vollan  <pvollan@apple.com>
1525
1526         [macOS] Disable permissive call logging in sandbox
1527         https://bugs.webkit.org/show_bug.cgi?id=194061
1528         <rdar://problem/47686253>
1529
1530         Reviewed by Brent Fulgham.
1531
1532         Strict call filtering should be reenabled.
1533
1534         * WebProcess/com.apple.WebProcess.sb.in:
1535
1536 2019-02-27  Chris Dumez  <cdumez@apple.com>
1537
1538         [HTTPSUpgrade] Use open source database until the feature is ready
1539         https://bugs.webkit.org/show_bug.cgi?id=195069
1540         <rdar://problem/47838224>
1541
1542         Reviewed by Geoffrey Garen.
1543
1544         * DerivedSources-input.xcfilelist:
1545         * DerivedSources.make:
1546
1547 2019-02-27  Antoine Quint  <graouts@apple.com>
1548
1549         Support Pointer Events on macOS
1550         https://bugs.webkit.org/show_bug.cgi?id=195008
1551         <rdar://problem/47454419>
1552
1553         Reviewed by Dean Jackson.
1554
1555         * Configurations/FeatureDefines.xcconfig:
1556
1557 2019-02-27  Sihui Liu  <sihui_liu@apple.com>
1558
1559         Network Process is put to suspended when holding locked IndexedDB files
1560         https://bugs.webkit.org/show_bug.cgi?id=195024
1561         <rdar://problem/45194169>
1562
1563         Reviewed by Geoffrey Garen.
1564
1565         * NetworkProcess/NetworkProcess.cpp:
1566         (WebKit::NetworkProcess::idbServer):
1567         (WebKit::NetworkProcess::notifyHoldingLockedFiles):
1568         * NetworkProcess/NetworkProcess.h:
1569         * UIProcess/Network/NetworkProcessProxy.cpp:
1570         (WebKit::NetworkProcessProxy::didClose):
1571         (WebKit::NetworkProcessProxy::setIsIDBDatabaseHoldingLockedFiles):
1572         * UIProcess/Network/NetworkProcessProxy.h:
1573         * UIProcess/Network/NetworkProcessProxy.messages.in:
1574
1575 2019-02-26  Simon Fraser  <simon.fraser@apple.com>
1576
1577         Have a single notion of scroll position in the scrolling tree and derive layoutViewport from it
1578         https://bugs.webkit.org/show_bug.cgi?id=194973
1579
1580         Reviewed by Antti Koivisto.
1581
1582         This patch cleans up how the scrolling tree responds to scrolls.
1583
1584         First, ScrollingTreeScrollingNode::m_currentScrollPosition is "truth" for scrolling thread/
1585         UI process scroll position.
1586
1587         On macOS where handleWheelEvent on the scrolling thread changes scroll position, the
1588         bottleneck is ScrollingTreeScrollingNode::scrollTo() which sets the new scroll position,
1589         update the visual viewport (for frame scrolls) updates the scrolledContentsLayer position,
1590         updates related layers on this node (counter-scrolling layers etc), and then tells the
1591         scrolling tree, which recurses through descendant nodes so they can adjust their layer
1592         positions.
1593
1594         On iOS, the bottleneck is ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling(),
1595         which does the above other than setting scrolledContentsLayer (since we're reacting to
1596         layer state changes, not producing them).
1597
1598         updateLayersAfterAncestorChange() is renamed to relatedNodeScrollPositionDidChange(), and
1599         ScrollingTree does the tree walk so classes don't have to implement
1600         updateLayersAfterAncestorChange() just to talk children. The ScrollingTree tree walk knows
1601         how to get the correct layoutViewport and to stop at frame boundaries (layer updates never
1602         need to cross frame boundaries).
1603
1604         We preserve 'cumulativeDelta'; it's necessary for things like fixed inside overflow:scroll,
1605         since the fixed state was computed with the "layout" scroll position, so we have to account
1606         for the scroll delta since the last committed position. It's possible we could improve this
1607         in future.
1608
1609         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
1610         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
1611         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
1612         (WebKit::RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling):
1613         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
1614         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
1615         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
1616         (WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll):
1617         * UIProcess/RemoteLayerTree/RemoteScrollingTree.h:
1618         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
1619         (WebKit::RemoteScrollingCoordinatorProxy::currentLayoutViewport const):
1620         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h:
1621         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
1622         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateAfterChildren):
1623         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::repositionScrollingLayers):
1624         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::repositionRelatedLayers):
1625         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::scrollPosition const): Deleted.
1626         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollPosition): Deleted.
1627         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollLayerPosition): Deleted.
1628         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateChildNodesAfterScroll): Deleted.
1629         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterDelegatedScroll): Deleted.
1630         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterViewportChange): Deleted.
1631         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterAncestorChange): Deleted.
1632         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
1633         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
1634         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::repositionScrollingLayers):
1635         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterAncestorChange): Deleted.
1636         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollPosition const): Deleted.
1637         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::setScrollLayerPosition): Deleted.
1638         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterDelegatedScroll): Deleted.
1639         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
1640         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
1641         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::ScrollingTreeScrollingNodeDelegateIOS):
1642         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::repositionScrollingLayers):
1643         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollViewDidScroll):
1644         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateLayersAfterAncestorChange): Deleted.
1645         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollPosition const): Deleted.
1646         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::setScrollLayerPosition): Deleted.
1647         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll): Deleted.
1648         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollViewDidScroll const): Deleted.
1649         * UIProcess/RemoteLayerTree/mac/ScrollerPairMac.mm:
1650         (WebKit::ScrollerPairMac::updateValues):
1651         (WebKit::ScrollerPairMac::valuesForOrientation):
1652         * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp:
1653         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::repositionRelatedLayers):
1654         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::setScrollLayerPosition): Deleted.
1655         * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.h:
1656         * UIProcess/ios/WKContentView.mm:
1657         (-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
1658
1659 2019-02-27  Alex Christensen  <achristensen@webkit.org>
1660
1661         Silence log after r242122
1662         https://bugs.webkit.org/show_bug.cgi?id=195074
1663
1664         * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
1665         (WebKit::LocalStorageDatabaseTracker::databasePath const):
1666         m_localStorageDirectory can now be null for ephemeral sessions.
1667         This is not a failure to create a directory and needs no log.
1668         This fixes the WKWebView.InitializingWebViewWithEphemeralStorageDoesNotLog API test.
1669
1670 2019-02-27  Timothy Hatcher  <timothy@apple.com>
1671
1672         REGRESSION: WebKit content crash in Base System (because NSAppearance is NULL).
1673         https://bugs.webkit.org/show_bug.cgi?id=195086
1674         rdar://problem/48419124
1675
1676         Reviewed by Tim Horton.
1677
1678         * UIProcess/RemoteLayerTree/mac/ScrollerMac.mm:
1679         (-[WKScrollerImpDelegate effectiveAppearanceForScrollerImp:]): Always return a valid NSAppearance.
1680
1681 2019-02-26  Chris Dumez  <cdumez@apple.com>
1682
1683         [PSON] Add mechanism to clear suspended pages while bypassing the WebProcess cache
1684         https://bugs.webkit.org/show_bug.cgi?id=195089
1685
1686         Reviewed by Geoffrey Garen.
1687
1688         Add a convenient mechanism to clear suspended pages while bypassing the WebProcess
1689         cache since we need to do this on memory pressure and when clearing website data.
1690
1691         * UIProcess/WebPageProxy.cpp:
1692         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
1693         * UIProcess/WebProcessCache.cpp:
1694         (WebKit::WebProcessCache::addProcessIfPossible):
1695         (WebKit::WebProcessCache::addProcess):
1696         (WebKit::WebProcessCache::takeProcess):
1697         (WebKit::WebProcessCache::CachedProcess::~CachedProcess):
1698         * UIProcess/WebProcessCache.h:
1699         (WebKit::WebProcessCache::setIsDisabled): Deleted.
1700         * UIProcess/WebProcessPool.cpp:
1701         (WebKit::WebProcessPool::handleMemoryPressureWarning):
1702         (WebKit::WebProcessPool::hasSuspendedPageFor const):
1703         (WebKit::WebProcessPool::clearSuspendedPages):
1704         * UIProcess/WebProcessPool.h:
1705         * UIProcess/WebProcessProxy.cpp:
1706         (WebKit::WebProcessProxy::maybeShutDown):
1707         (WebKit::WebProcessProxy::canTerminateAuxiliaryProcess):
1708         * UIProcess/WebProcessProxy.h:
1709         (WebKit::WebProcessProxy::suspendedPageCount const):
1710         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1711         (WebKit::WebsiteDataStore::removeData):
1712
1713 2019-02-26  Alex Christensen  <achristensen@webkit.org>
1714
1715         Move ephemeral local storage from WebProcess to UIProcess
1716         https://bugs.webkit.org/show_bug.cgi?id=195074
1717         <rdar://problem/47937975>
1718
1719         Reviewed by Geoff Garen.
1720
1721         Before PSON, a page could navigate to another domain that navigates back and still have its local storage.
1722         Since PSON makes it unreliable to retain the state in the WebProcess, move it to the process with the rest of the local storage.
1723         If it's ephemeral, we obviously can't use the SQLite on-disk storage implementation, so use the same WebCore::StorageMap we used to in the WebProcess.
1724
1725         * UIProcess/WebStorage/StorageManager.cpp:
1726         (WebKit::StorageManager::LocalStorageNamespace::LocalStorageNamespace):
1727         (WebKit::StorageManager::StorageManager):
1728         (WebKit::StorageManager::createLocalStorageMap):
1729         (WebKit::StorageManager::createTransientLocalStorageMap):
1730         (WebKit::StorageManager::createSessionStorageMap):
1731         (WebKit::StorageManager::destroyStorageMap):
1732         (WebKit::StorageManager::getValues):
1733         (WebKit::StorageManager::setItem):
1734         (WebKit::StorageManager::removeItem):
1735         (WebKit::StorageManager::clear):
1736         * UIProcess/WebStorage/StorageManager.h:
1737         * UIProcess/WebStorage/StorageManager.messages.in:
1738         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1739         (WebKit::WebsiteDataStore::WebsiteDataStore):
1740         * WebProcess/WebStorage/StorageAreaMap.cpp:
1741         (WebKit::StorageAreaMap::StorageAreaMap):
1742         (WebKit::StorageAreaMap::setItem):
1743         (WebKit::StorageAreaMap::removeItem):
1744         (WebKit::StorageAreaMap::clear):
1745         (WebKit::StorageAreaMap::loadValuesIfNeeded):
1746         * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
1747         (WebKit::StorageNamespaceImpl::createEphemeralLocalStorageNamespace):
1748         (WebKit::StorageNamespaceImpl::storageArea):
1749         (WebKit::StorageNamespaceImpl::copy):
1750         (): Deleted.
1751         (WebKit::StorageNamespaceImpl::ephemeralLocalStorageArea): Deleted.
1752         * WebProcess/WebStorage/StorageNamespaceImpl.h:
1753
1754 2019-02-20  Jer Noble  <jer.noble@apple.com>
1755
1756         [Cocoa] Media elements will restart network buffering just before suspending
1757         https://bugs.webkit.org/show_bug.cgi?id=193691
1758
1759         Reviewed by Eric Carlson.
1760
1761         When the WebProcess receives a notification that the process is about to become
1762         suspended, it tells the MemoryPressureHandler to release all critical memory. This
1763         has the side effect of causing AVFoundation-backed media elements to dump their
1764         in-memory caches and start downloading media data again. Instead, media elements
1765         should all stop buffering media data during suspension. Add new testing SPI to
1766         simulate suspension and resume messages.
1767
1768         * UIProcess/API/Cocoa/WKWebView.mm:
1769         (-[WKWebView _processWillSuspendImminentlyForTesting]):
1770         (-[WKWebView _processDidResumeForTesting]):
1771         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1772         * UIProcess/WebProcessProxy.h:
1773         * UIProcess/ios/WKInkPickerView.mm:
1774         * WebProcess/WebPage/WebPage.cpp:
1775         (WebKit::WebPage::suspendAllMediaBuffering):
1776         (WebKit::WebPage::resumeAllMediaBuffering):
1777         * WebProcess/WebPage/WebPage.h:
1778         * WebProcess/WebProcess.cpp:
1779         (WebKit::WebProcess::actualPrepareToSuspend):
1780         (WebKit::WebProcess::cancelPrepareToSuspend):
1781         (WebKit::WebProcess::processDidResume):
1782         (WebKit::WebProcess::suspendAllMediaBuffering):
1783         (WebKit::WebProcess::resumeAllMediaBuffering):
1784         * WebProcess/WebProcess.h:
1785
1786 2019-02-26  Youenn Fablet  <youenn@apple.com>
1787
1788         Move service worker response validation from the service worker client to the service worker itself
1789         https://bugs.webkit.org/show_bug.cgi?id=194716
1790
1791         Reviewed by Geoffrey Garen.
1792
1793         Removed response validation as it is now done in service worker side.
1794
1795         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
1796         (WebKit::ServiceWorkerClientFetch::didReceiveRedirectResponse):
1797         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
1798
1799 2019-02-26  Zalan Bujtas  <zalan@apple.com>
1800
1801         [ContentChangeObserver] clearContentChangeObservers should be internal to ContentChangeObserver class
1802         https://bugs.webkit.org/show_bug.cgi?id=195066
1803         <rdar://problem/48411682>
1804
1805         Reviewed by Tim Horton.
1806
1807         * WebProcess/WebCoreSupport/WebChromeClient.h:
1808         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
1809         (WebKit::WebChromeClient::clearContentChangeObservers): Deleted.
1810
1811 2019-02-26  Per Arne Vollan  <pvollan@apple.com>
1812
1813         [iOS] Sandbox should allow mach lookups related to media capturing
1814         https://bugs.webkit.org/show_bug.cgi?id=194951
1815
1816         Reviewed by Eric Carlson.
1817
1818         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1819
1820 2019-02-26  Brent Fulgham  <bfulgham@apple.com>
1821
1822         Update NetworkSession to use Session Cleanup when available
1823         https://bugs.webkit.org/show_bug.cgi?id=195019
1824         <rdar://problem/45149868>
1825
1826         Reviewed by Alex Christensen.
1827
1828         If the build environment supports Session Cleanup, initialize it.
1829
1830         No test changes since this doesn't do anything on the test systems at present.
1831
1832         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1833         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1834
1835 2019-02-26  Chris Dumez  <cdumez@apple.com>
1836
1837         [iOS] Regression(PSON) Scroll position is no longer restored when navigating back to reddit.com
1838         https://bugs.webkit.org/show_bug.cgi?id=195054
1839         <rdar://problem/48330549>
1840
1841         Reviewed by Geoff Garen.
1842
1843         We attempt to restore the scroll position twice, on first layout and then on load completion.
1844         Before PSON, the scroll position would fail to get restored on first layout but would succeed
1845         on load completion because the view is tall enough by then. With PSON however, we would
1846         fail to restore the scroll position on load completion because the view would not be tall
1847         enough yet by this point. The reason is that the dynamic resources would not be in the memory cache
1848         and would then get reloaded abd finish loading *after* the load event.
1849
1850         To address the issue, we now make sure to not purge the memory cache on process suspension on
1851         iOS if there is currently a SuspendedPageProxy in the UIProcess for this process.
1852
1853         * UIProcess/SuspendedPageProxy.cpp:
1854         (WebKit::SuspendedPageProxy::SuspendedPageProxy):
1855         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
1856         * UIProcess/WebProcessProxy.cpp:
1857         (WebKit::WebProcessProxy::incrementSuspendedPageCount):
1858         (WebKit::WebProcessProxy::decrementSuspendedPageCount):
1859         * UIProcess/WebProcessProxy.h:
1860         * WebProcess/WebProcess.cpp:
1861         (WebKit::WebProcess::initializeWebProcess):
1862         (WebKit::WebProcess::setHasSuspendedPageProxy):
1863         * WebProcess/WebProcess.h:
1864         * WebProcess/WebProcess.messages.in:
1865
1866 2019-02-26  Ryosuke Niwa  <rniwa@webkit.org>
1867
1868         [iOS] REGRESSION(r238490?): Safari sometimes shows blank page until a cross site navigation or re-opening the tab
1869         https://bugs.webkit.org/show_bug.cgi?id=195037
1870         <rdar://problem/48154508>
1871
1872         Reviewed by Antti Koivisto.
1873
1874         Restore the pre-r238490 behavior of WebPage::didCompletePageTransition clearing LayerTreeFreezeReason::ProcessSuspended
1875         as this has been an issue when I was able to reproduce the issue locally.
1876
1877         Also added release logging to help diagnose the issue in the future.
1878
1879         * WebProcess/WebPage/WebPage.cpp:
1880         (WebKit::WebPage::freezeLayerTree):
1881         (WebKit::WebPage::unfreezeLayerTree):
1882         (WebKit::WebPage::didCompletePageTransition):
1883         * WebProcess/WebProcess.cpp:
1884         (WebKit::WebProcess::freezeAllLayerTrees):
1885         (WebKit::WebProcess::unfreezeAllLayerTrees):
1886
1887 2019-02-26  Youenn Fablet  <youenn@apple.com>
1888
1889         Create WebPageProxy::m_userMediaPermissionRequestManager only when needed
1890         https://bugs.webkit.org/show_bug.cgi?id=195051
1891
1892         Reviewed by Eric Carlson.
1893
1894         Before the patch, WebPageProxy::m_userMediaPermissionRequestManager was created
1895         in some methods to reset its state when main document is changing, view is becoming visible...
1896         This code is unnecessary if the page did not create it already using JS APIs such as getUserMedia/enumerateDevices/ondevicechange.
1897         This patch skips processing in the other cases if WebPageProxy::m_userMediaPermissionRequestManager is null.
1898
1899         * UIProcess/WebPageProxy.cpp:
1900         (WebKit::WebPageProxy::close): No need to nullify it since it will be done in resetState shortly after.
1901         (WebKit::WebPageProxy::didChangeMainDocument):
1902         (WebKit::WebPageProxy::viewIsBecomingVisible):
1903         (WebKit::WebPageProxy::clearUserMediaState):
1904         (WebKit::WebPageProxy::updatePlayingMediaDidChange): m_userMediaPermissionRequestManager should not be null here
1905         since there is or was some capturing done for the page.
1906
1907 2019-02-26  Zalan Bujtas  <zalan@apple.com>
1908
1909         [ContentChangeObserver] Simplify content observation API by removing explicit DOMTimer observation.
1910         https://bugs.webkit.org/show_bug.cgi?id=195023
1911         <rdar://problem/48381885>
1912
1913         Reviewed by Tim Horton.
1914
1915         * WebProcess/WebPage/ios/WebPageIOS.mm:
1916         (WebKit::WebPage::handleSyntheticClick):
1917
1918 2019-02-26  Takashi Komori  <Takashi.Komori@sony.com>
1919
1920         [Curl] Load HTTP body of 401 response when AuthenticationChange is cancelled.
1921         https://bugs.webkit.org/show_bug.cgi?id=191652
1922
1923         Reviewed by Alex Christensen.
1924
1925         Test: http/tests/security/401-logout/401-logout.php
1926
1927         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
1928         (WebKit::NetworkDataTaskCurl::tryHttpAuthentication):
1929         (WebKit::NetworkDataTaskCurl::tryProxyAuthentication):
1930         * NetworkProcess/curl/NetworkDataTaskCurl.h:
1931
1932 2019-02-26  Youenn Fablet  <youenn@apple.com>
1933
1934         WebPageProxy should nullify m_userMediaPermissionRequestManager after resetting the media state
1935         https://bugs.webkit.org/show_bug.cgi?id=195028
1936         <rdar://problem/48243733>
1937
1938         Reviewed by Eric Carlson.
1939
1940         Covered by API test.
1941
1942         * UIProcess/WebPageProxy.cpp:
1943         (WebKit::WebPageProxy::resetState):
1944
1945 2019-02-26  Philippe Normand <pnormand@igalia.com> and Carlos Garcia Campos  <cgarcia@igalia.com>
1946
1947         [WPE] Add API for webview background color configuration
1948         https://bugs.webkit.org/show_bug.cgi?id=192305
1949
1950         Reviewed by Michael Catanzaro.
1951
1952         In the case of WPE we need to send the background color to the web process to be used as the background color of
1953         the page. This patch adapts the GTK+ implementation to do the same, since it's a lot simpler. The patch also
1954         removes the SetDrawsBackground message in favor of the new SetBackgroundColor message that receives an optional
1955         color.
1956
1957         * PlatformWPE.cmake: Add new WPE API for WebKitColor boxed type.
1958         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1959         (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext): Remove background rendering and opacity handling.
1960         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
1961         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1962         (WebKit::ThreadedCompositor::renderLayerTree): Remove drawsBakground and always clear the context with
1963         transparent color.
1964         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
1965         * Shared/WebPageCreationParameters.cpp:
1966         (WebKit::WebPageCreationParameters::encode const): Replace drawsBackground with backgroundColor.
1967         (WebKit::WebPageCreationParameters::decode): Ditto.
1968         * Shared/WebPageCreationParameters.h:
1969         * SourcesWPE.txt:
1970         * UIProcess/API/glib/WebKitWebView.cpp:
1971         * UIProcess/API/gtk/WebKitWebViewGtk.cpp:
1972         (webkit_web_view_set_background_color):
1973         (webkit_web_view_get_background_color):
1974         * UIProcess/API/wpe/WebKitColor.cpp: Added.
1975         (webkit_color_copy):
1976         (webkit_color_free):
1977         (webkitColorToWebCoreColor):
1978         (webkitColorFillFromWebCoreColor):
1979         (webkit_color_parse):
1980         * UIProcess/API/wpe/WebKitColor.h: Added.
1981         * UIProcess/API/wpe/WebKitColorPrivate.h: Added.
1982         * UIProcess/API/wpe/WebKitWebView.h: Implement webkit_web_view_set_background_color API.
1983         * UIProcess/API/wpe/WebKitWebViewWPE.cpp: Ditto.
1984         (webkit_web_view_set_background_color):
1985         (webkit_web_view_get_background_color):
1986         * UIProcess/API/wpe/docs/wpe-0.1-sections.txt: Add new symbols.
1987         * UIProcess/WebPageProxy.cpp:
1988         (WebKit::WebPageProxy::setDrawsBackground): Set a transparent background color when false is passed.
1989         (WebKit::WebPageProxy::setBackgroundColor): Send background color to the WebProcess.
1990         (WebKit::WebPageProxy::creationParameters): Replace drawsBackground with backgroundColor.
1991         * UIProcess/WebPageProxy.h:
1992         (WebKit::WebPageProxy::drawsBackground const):
1993         (WebKit::WebPageProxy::backgroundColor const):
1994         * UIProcess/cairo/BackingStoreCairo.cpp:
1995         (WebKit::BackingStore::incorporateUpdate): Remove GTK+ code to handle background color.
1996         * UIProcess/gtk/AcceleratedBackingStore.cpp:
1997         * UIProcess/gtk/AcceleratedBackingStore.h: Make paint() pure virtual and remove the implementation.
1998         * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
1999         (WebKit::AcceleratedBackingStoreWayland::paint): Dot not call AcceleratedBackingStore::paint() now that is pure virtual.
2000         * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
2001         (WebKit::AcceleratedBackingStoreX11::paint): Ditto.
2002         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2003         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): Use background color as provided by the
2004         UIProcess when creating the FrameView.
2005         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
2006         * WebProcess/WebPage/AcceleratedDrawingArea.h:
2007         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
2008         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
2009         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
2010         (WebKit::ThreadedCoordinatedLayerTreeHost::setIsDiscardable):
2011         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
2012         * WebProcess/WebPage/DrawingArea.h:
2013         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2014         (WebKit::DrawingAreaImpl::display): Remove special case for transparent background.
2015         * WebProcess/WebPage/LayerTreeHost.h:
2016         * WebProcess/WebPage/WebPage.cpp:
2017         (WebKit::WebPage::setBackgroundColor): New API for background color configuration. Proxies to FrameView and DrawingArea.
2018         * WebProcess/WebPage/WebPage.h:
2019         (WebKit::WebPage::backgroundColor const): Read-only access to the current background color.
2020         * WebProcess/WebPage/WebPage.messages.in: Replace SetDrawsBackground message with SetBackgroundColor.
2021
2022 2019-02-25  Yongjun Zhang  <yongjun_zhang@apple.com>
2023
2024         scalableNativeWebpageParameters() is not preserved on new page navigation.
2025         https://bugs.webkit.org/show_bug.cgi?id=194892
2026         <rdar://problem/47538280>
2027
2028         If a page's current default viewport configuration is scalableNativeWebpageParameters due to
2029         the fact that m_canIgnoreScalingConstraints is true, loading a new page should preserve this
2030         configuration until we derive the right values from viewport meta-tag.
2031
2032         Reviewed by Wenson Hsieh.
2033
2034         * WebProcess/WebPage/ios/WebPageIOS.mm:
2035         (WebKit::WebPage::resetViewportDefaultConfiguration): Use nativeWebpageParameters() instance method to
2036             get the appropriate default configuration.
2037
2038 2019-02-25  Wenson Hsieh  <wenson_hsieh@apple.com>
2039
2040         [iOS] Adjust initial scale zooming heuristics when changing view scale
2041         https://bugs.webkit.org/show_bug.cgi?id=194995
2042
2043         Reviewed by Tim Horton.
2044
2045         Currently, we only zoom to the new initial scale iff we're exactly at initial scale before changing the view
2046         scale. This was done so that if a user zoomed in really far and then increased the view scale, we wouldn't end
2047         up zooming out as a result. However, this leads to confusing behavior in the case where the user has manually
2048         changed the zoom scale to something close to (but not exactly) initial scale, and then attempts to zoom in
2049         further using view scale. In this case, we'll end up keeping page scale the same, so it looks like nothing is
2050         happening.
2051
2052         To fix this, we tweak our heuristics for determining whether to jump to initial scale; if the view scale is
2053         increasing and the new initial scale is greater than the current scale, zoom to initial scale. Likewise, if the
2054         view scale is decreasing and the new initial scale is less than the current scale, zoom to initial scale.
2055
2056         Test: fast/viewport/ios/initial-scale-after-changing-view-scale.html
2057
2058         * WebProcess/WebPage/ios/WebPageIOS.mm:
2059         (WebKit::WebPage::setViewportConfigurationViewLayoutSize):
2060
2061 2019-02-25  John Wilander  <wilander@apple.com>
2062
2063         Introduce and adopt new class RegistrableDomain for eTLD+1
2064         https://bugs.webkit.org/show_bug.cgi?id=194791
2065         <rdar://problem/48179240>
2066
2067         Reviewed by Alex Christensen, Fujii Hironori, and Brent Fulgham.
2068
2069         A new API test was added. Plenty of existing layout tests under
2070         http/tests/resourceLoadStatistics/ and http/tests/storageAccess/ test the code.
2071
2072         This patch introduces and adopts a new class called WebCore::RegistrableDomain
2073         which represents a domain's eTLD+1 (effective top level domain plus one) and is
2074         the basis for the term "site," as in same-site. Other popular names include
2075         high-level domain, primary domain, and top privately controlled/owned domain.
2076         Effective top level domains are enumerated on the Public Suffix List
2077         (https://publicsuffix.org).
2078
2079         This class just uses the full domain for when the Public Suffix List cannot help
2080         finding the registrable domain and for WebKit ports that haven't enabled
2081         PUBLIC_SUFFIX_LIST. It also uses the string "nullOrigin" as a representation
2082         for the null or unique origin (this matches how these origins were handled
2083         before).
2084
2085         The implementation is a wrapper around a String and the functions and class
2086         members that now make use of this new class used to handle regular String
2087         objects which didn't help much in terms of type safety or guarantees that the
2088         string had already been converted to an eTLD+1.
2089
2090         We've at least two bad bugs in the Storage Access API because of confusion
2091         between a URL's eTLD+1 and its host. The usage of WebCore::RegistrableDomain
2092         will prohibit such bugs in the future.
2093
2094         Partitioning in WebKit also uses eTLD+1 to a large extent. I plan to adopt
2095         WebCore::RegistrableDomain for partitioning in a later patch.
2096
2097         This patch also enhances parameter naming by:
2098         - Removing parts that refer to "primary" as in primaryDomain.
2099         - Replacing references to "TopPrivatelyControlledDomain" with "RegistrableDomain."
2100         - Replacing references to "TopPrivatelyOwnedDomain" with "RegistrableDomain."
2101         - Using the term "domain" consistently instead of e.g. "host."
2102
2103         A follow-up patch will continue backwards in call chains to create
2104         WebCore::RegistrableDomain objects as early as possible instead of using strings.
2105         I did not do that work here in the interest of patch size.
2106
2107         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
2108         (WebKit::domainsToString):
2109         (WebKit::pruneResources):
2110         (WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords):
2111         (WebKit::ResourceLoadStatisticsMemoryStore::recursivelyGetAllDomainsThatHaveRedirectedToThisDomain const):
2112         (WebKit::ResourceLoadStatisticsMemoryStore::markAsPrevalentIfHasRedirectedToPrevalent):
2113         (WebKit::ResourceLoadStatisticsMemoryStore::isPrevalentDueToDebugMode):
2114         (WebKit::ResourceLoadStatisticsMemoryStore::hasStorageAccess):
2115         (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccess):
2116         (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccessUnderOpener):
2117         (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccess):
2118         (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccessInternal):
2119         (WebKit::ResourceLoadStatisticsMemoryStore::grandfatherExistingWebsiteData):
2120         (WebKit::ResourceLoadStatisticsMemoryStore::ensurePrevalentResourcesForDebugMode):
2121         (WebKit::ResourceLoadStatisticsMemoryStore::setPrevalentResourceForDebugMode):
2122         (WebKit::ResourceLoadStatisticsMemoryStore::logFrameNavigation):
2123         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceLoading):
2124         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceRedirect):
2125         (WebKit::ResourceLoadStatisticsMemoryStore::logUserInteraction):
2126         (WebKit::ResourceLoadStatisticsMemoryStore::clearUserInteraction):
2127         (WebKit::ResourceLoadStatisticsMemoryStore::hasHadUserInteraction):
2128         (WebKit::ResourceLoadStatisticsMemoryStore::setPrevalentResource):
2129         (WebKit::ResourceLoadStatisticsMemoryStore::isPrevalentResource const):
2130         (WebKit::ResourceLoadStatisticsMemoryStore::isVeryPrevalentResource const):
2131         (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsSubresourceUnder const):
2132         (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsSubFrameUnder const):
2133         (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsRedirectingTo const):
2134         (WebKit::ResourceLoadStatisticsMemoryStore::clearPrevalentResource):
2135         (WebKit::ResourceLoadStatisticsMemoryStore::setGrandfathered):
2136         (WebKit::ResourceLoadStatisticsMemoryStore::isGrandfathered const):
2137         (WebKit::ResourceLoadStatisticsMemoryStore::setSubframeUnderTopFrameOrigin):
2138         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUnderTopFrameOrigin):
2139         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUniqueRedirectTo):
2140         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUniqueRedirectFrom):
2141         (WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectTo):
2142         (WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectFrom):
2143         (WebKit::ResourceLoadStatisticsMemoryStore::ensureResourceStatisticsForRegistrableDomain):
2144         (WebKit::ResourceLoadStatisticsMemoryStore::mergeStatistics):
2145         (WebKit::ResourceLoadStatisticsMemoryStore::hasUserGrantedStorageAccessThroughPrompt):
2146         (WebKit::debugLogDomainsInBatches):
2147         (WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlocking):
2148         (WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlockingForDomains):
2149         (WebKit::ResourceLoadStatisticsMemoryStore::clearBlockingStateForDomains):
2150         (WebKit::ResourceLoadStatisticsMemoryStore::registrableDomainsToRemoveWebsiteDataFor):
2151         (WebKit::ResourceLoadStatisticsMemoryStore::pruneStatisticsIfNeeded):
2152         (WebKit::ResourceLoadStatisticsMemoryStore::setLastSeen):
2153         (WebKit::ResourceLoadStatisticsMemoryStore::setVeryPrevalentResource):
2154         (WebKit::ResourceLoadStatisticsMemoryStore::ensureResourceStatisticsForPrimaryDomain): Deleted.
2155         (WebKit::ResourceLoadStatisticsMemoryStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor): Deleted.
2156         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
2157         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
2158         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResourceForDebugMode):
2159         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
2160         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccessForFrame):
2161         (WebKit::WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler):
2162         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessGranted):
2163         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
2164         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
2165         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
2166         (WebKit::WebResourceLoadStatisticsStore::callGrantStorageAccessHandler):
2167         (WebKit::WebResourceLoadStatisticsStore::logFrameNavigation):
2168         (WebKit::WebResourceLoadStatisticsStore::logWebSocketLoading):
2169         (WebKit::WebResourceLoadStatisticsStore::logSubresourceLoading):
2170         (WebKit::WebResourceLoadStatisticsStore::logSubresourceRedirect):
2171         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
2172         (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
2173         (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
2174         (WebKit::WebResourceLoadStatisticsStore::setLastSeen):
2175         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
2176         (WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource):
2177         (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource):
2178         (WebKit::WebResourceLoadStatisticsStore::isVeryPrevalentResource):
2179         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubresourceUnder):
2180         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder):
2181         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo):
2182         (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
2183         (WebKit::WebResourceLoadStatisticsStore::setGrandfathered):
2184         (WebKit::WebResourceLoadStatisticsStore::isGrandfathered):
2185         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
2186         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
2187         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
2188         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom):
2189         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo):
2190         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom):
2191         (WebKit::WebResourceLoadStatisticsStore::scheduleCookieBlockingUpdateForDomains):
2192         (WebKit::WebResourceLoadStatisticsStore::scheduleClearBlockingStateForDomains):
2193         (WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToBlockCookiesForHandler):
2194         (WebKit::WebResourceLoadStatisticsStore::removePrevalentDomains):
2195         (WebKit::WebResourceLoadStatisticsStore::callRemoveDomainsHandler):
2196         (WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
2197         (WebKit::WebResourceLoadStatisticsStore::registrableDomainsWithWebsiteData):
2198         (WebKit::isolatedPrimaryDomain): Deleted.
2199         (WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): Deleted.
2200         (WebKit::WebResourceLoadStatisticsStore::topPrivatelyControlledDomainsWithWebsiteData): Deleted.
2201         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
2202         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2203         (WebKit::NetworkConnectionToWebProcess::logUserInteraction):
2204         (WebKit::NetworkConnectionToWebProcess::logWebSocketLoading):
2205         (WebKit::NetworkConnectionToWebProcess::logSubresourceLoading):
2206         (WebKit::NetworkConnectionToWebProcess::logSubresourceRedirect):
2207         (WebKit::NetworkConnectionToWebProcess::hasStorageAccess):
2208         (WebKit::NetworkConnectionToWebProcess::requestStorageAccess):
2209         * NetworkProcess/NetworkConnectionToWebProcess.h:
2210         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2211         * NetworkProcess/NetworkProcess.cpp:
2212         (WebKit::NetworkProcess::updatePrevalentDomainsToBlockCookiesFor):
2213         (WebKit::NetworkProcess::isGrandfathered):
2214         (WebKit::NetworkProcess::isPrevalentResource):
2215         (WebKit::NetworkProcess::isVeryPrevalentResource):
2216         (WebKit::NetworkProcess::setGrandfathered):
2217         (WebKit::NetworkProcess::setPrevalentResource):
2218         (WebKit::NetworkProcess::setPrevalentResourceForDebugMode):
2219         (WebKit::NetworkProcess::setVeryPrevalentResource):
2220         (WebKit::NetworkProcess::clearPrevalentResource):
2221         (WebKit::NetworkProcess::setSubframeUnderTopFrameOrigin):
2222         (WebKit::NetworkProcess::isRegisteredAsRedirectingTo):
2223         (WebKit::NetworkProcess::isRegisteredAsSubFrameUnder):
2224         (WebKit::NetworkProcess::setSubresourceUnderTopFrameOrigin):
2225         (WebKit::NetworkProcess::setSubresourceUniqueRedirectTo):
2226         (WebKit::NetworkProcess::setSubresourceUniqueRedirectFrom):
2227         (WebKit::NetworkProcess::isRegisteredAsSubresourceUnder):
2228         (WebKit::NetworkProcess::setTopFrameUniqueRedirectTo):
2229         (WebKit::NetworkProcess::setTopFrameUniqueRedirectFrom):
2230         (WebKit::NetworkProcess::setLastSeen):
2231         (WebKit::NetworkProcess::hasStorageAccessForFrame):
2232         (WebKit::NetworkProcess::hasStorageAccess):
2233         (WebKit::NetworkProcess::requestStorageAccess):
2234         (WebKit::NetworkProcess::requestStorageAccessGranted):
2235         (WebKit::NetworkProcess::grantStorageAccess):
2236         (WebKit::NetworkProcess::logFrameNavigation):
2237         (WebKit::NetworkProcess::logUserInteraction):
2238         (WebKit::NetworkProcess::hadUserInteraction):
2239         (WebKit::NetworkProcess::clearUserInteraction):
2240         (WebKit::NetworkProcess::removePrevalentDomains):
2241         (WebKit::filterForRegistrableDomains):
2242         (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
2243         (WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
2244         (WebKit::filterForTopLevelDomains): Deleted.
2245         (WebKit::NetworkProcess::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): Deleted.
2246         (WebKit::NetworkProcess::topPrivatelyControlledDomainsWithWebsiteData): Deleted.
2247         * NetworkProcess/NetworkProcess.h:
2248         * NetworkProcess/NetworkProcess.messages.in:
2249         * NetworkProcess/NetworkResourceLoader.cpp:
2250         (WebKit::logCookieInformationInternal):
2251         * NetworkProcess/NetworkSession.cpp:
2252         (WebKit::NetworkSession::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
2253         (WebKit::NetworkSession::registrableDomainsWithWebsiteData):
2254         (WebKit::NetworkSession::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): Deleted.
2255         (WebKit::NetworkSession::topPrivatelyControlledDomainsWithWebsiteData): Deleted.
2256         * NetworkProcess/NetworkSession.h:
2257         * Shared/WebCoreArgumentCoders.cpp:
2258         (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
2259         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
2260         * UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm:
2261         (WebKit::ResourceLoadStatisticsMemoryStore::registerUserDefaultsIfNeeded):
2262         * UIProcess/Network/NetworkProcessProxy.cpp:
2263         (WebKit::NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor):
2264         (WebKit::NetworkProcessProxy::isPrevalentResource):
2265         (WebKit::NetworkProcessProxy::isVeryPrevalentResource):
2266         (WebKit::NetworkProcessProxy::setPrevalentResource):
2267         (WebKit::NetworkProcessProxy::setPrevalentResourceForDebugMode):
2268         (WebKit::NetworkProcessProxy::setVeryPrevalentResource):
2269         (WebKit::NetworkProcessProxy::setLastSeen):
2270         (WebKit::NetworkProcessProxy::clearPrevalentResource):
2271         (WebKit::NetworkProcessProxy::logUserInteraction):
2272         (WebKit::NetworkProcessProxy::hasHadUserInteraction):
2273         (WebKit::NetworkProcessProxy::clearUserInteraction):
2274         (WebKit::NetworkProcessProxy::setSubframeUnderTopFrameOrigin):
2275         (WebKit::NetworkProcessProxy::isRegisteredAsRedirectingTo):
2276         (WebKit::NetworkProcessProxy::isRegisteredAsSubFrameUnder):
2277         (WebKit::NetworkProcessProxy::setSubresourceUnderTopFrameOrigin):
2278         (WebKit::NetworkProcessProxy::isRegisteredAsSubresourceUnder):
2279         (WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectTo):
2280         (WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectFrom):
2281         (WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectTo):
2282         (WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectFrom):
2283         (WebKit::NetworkProcessProxy::isGrandfathered):
2284         (WebKit::NetworkProcessProxy::setGrandfathered):
2285         (WebKit::NetworkProcessProxy::hasStorageAccessForFrame):
2286         (WebKit::NetworkProcessProxy::hasStorageAccess):
2287         (WebKit::NetworkProcessProxy::requestStorageAccess):
2288         (WebKit::NetworkProcessProxy::grantStorageAccess):
2289         (WebKit::NetworkProcessProxy::notifyWebsiteDataDeletionForRegistrableDomainsFinished):
2290         (WebKit::NetworkProcessProxy::notifyWebsiteDataScanForRegistrableDomainsFinished):
2291         (WebKit::NetworkProcessProxy::notifyWebsiteDataDeletionForTopPrivatelyOwnedDomainsFinished): Deleted.
2292         (WebKit::NetworkProcessProxy::notifyWebsiteDataScanForTopPrivatelyControlledDomainsFinished): Deleted.
2293         * UIProcess/Network/NetworkProcessProxy.h:
2294         * UIProcess/Network/NetworkProcessProxy.messages.in:
2295         * UIProcess/WebPageProxy.cpp:
2296         (WebKit::WebPageProxy::logFrameNavigation):
2297         (WebKit::WebPageProxy::requestStorageAccessConfirm):
2298         * UIProcess/WebProcessProxy.cpp:
2299         (WebKit::WebProcessProxy::notifyPageStatisticsAndDataRecordsProcessed):
2300         (WebKit::WebProcessProxy::notifyWebsiteDataScanForRegistrableDomainsFinished):
2301         (WebKit::WebProcessProxy::notifyWebsiteDataDeletionForRegistrableDomainsFinished):
2302         (WebKit::WebProcessProxy::notifyWebsiteDataScanForTopPrivatelyControlledDomainsFinished): Deleted.
2303         (WebKit::WebProcessProxy::notifyWebsiteDataDeletionForTopPrivatelyOwnedDomainsFinished): Deleted.
2304         * UIProcess/WebProcessProxy.h:
2305         * UIProcess/WebResourceLoadStatisticsStore.messages.in:
2306         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2307         (WebKit::WebsiteDataStore::isPrevalentResource):
2308         (WebKit::WebsiteDataStore::setPrevalentResource):
2309         (WebKit::WebsiteDataStore::setPrevalentResourceForDebugMode):
2310         (WebKit::WebsiteDataStore::isVeryPrevalentResource):
2311         (WebKit::WebsiteDataStore::setVeryPrevalentResource):
2312         (WebKit::WebsiteDataStore::setSubframeUnderTopFrameOrigin):
2313         (WebKit::WebsiteDataStore::isRegisteredAsSubFrameUnder):
2314         (WebKit::WebsiteDataStore::setSubresourceUnderTopFrameOrigin):
2315         (WebKit::WebsiteDataStore::isRegisteredAsSubresourceUnder):
2316         (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectTo):
2317         (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectFrom):
2318         (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectTo):
2319         (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectFrom):
2320         (WebKit::WebsiteDataStore::isRegisteredAsRedirectingTo):
2321         (WebKit::WebsiteDataStore::clearPrevalentResource):
2322         (WebKit::WebsiteDataStore::setLastSeen):
2323         (WebKit::WebsiteDataStore::hasStorageAccess):
2324         (WebKit::WebsiteDataStore::requestStorageAccess):
2325         (WebKit::WebsiteDataStore::grantStorageAccess):
2326         (WebKit::WebsiteDataStore::logUserInteraction):
2327         (WebKit::WebsiteDataStore::hasHadUserInteraction):
2328         (WebKit::WebsiteDataStore::clearUserInteraction):
2329         (WebKit::WebsiteDataStore::setGrandfathered):
2330         (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains): Deleted.
2331         * UIProcess/WebsiteData/WebsiteDataStore.h:
2332         * WebProcess/WebPage/WebPage.cpp:
2333         (WebKit::WebPage::hasStorageAccess):
2334         (WebKit::WebPage::requestStorageAccess):
2335         * WebProcess/WebProcess.cpp:
2336         (WebKit::m_nonVisibleProcessCleanupTimer):
2337         (WebKit::WebProcess::initializeWebProcess):
2338
2339 2019-02-25  Adrian Perez de Castro  <aperez@igalia.com>
2340
2341         [WPE] Bump WPEBackend-fdo requirement to API version 1.0
2342         https://bugs.webkit.org/show_bug.cgi?id=195001
2343
2344         Reviewed by Carlos Garcia Campos.
2345
2346         API version 1.0 always includes the functionality previously guarded with
2347         WPE_BACKEND_CHECK_VERSION(): remove the guards and always use the new functions
2348         unconditionally.
2349
2350         * UIProcess/API/wpe/WPEView.cpp:
2351         (WKWPE::View::View): Remove usage of WPE_BACKEND_CHECK_VERSION().
2352         (WKWPE::m_backend): Ditto.
2353         * UIProcess/API/wpe/qt/WPEQtViewBackend.cpp:
2354         (WPEQtViewBackend::WPEQtViewBackend): Use libWPEBackend-fdo-1.0 as
2355         library name, remove call to wpe_fdo_initialize_for_egl_display().
2356         (WPEQtViewBackend::create): Call wpe_fdo_initialize_for_egl_display()
2357         here, to bail out early in case initialization fails.
2358         * UIProcess/glib/WebProcessPoolGLib.cpp:
2359         (WebKit::WebProcessPool::platformInitializeWebProcess): Remove usage of
2360         WPE_BACKEND_CHECK_VERSION().
2361
2362 2019-02-25  Per Arne Vollan  <pvollan@apple.com>
2363
2364         A prewarmed Web process should have a process assertion.
2365         https://bugs.webkit.org/show_bug.cgi?id=195006
2366
2367         Reviewed by Geoffrey Garen.
2368
2369         To make sure the prewarm message is handled in the Web process before the process is suspended,
2370         the process should have a process assertion. This can be fixed by sending the prewarm message
2371         inside WebProcessPool::initializeNewWebProcess, since all message sent inside this method are
2372         guaranteed to be handled before the WebContent process is suspended.
2373
2374         This patch is based on Chris Dumez' idea and obervation of the issue.
2375
2376         * UIProcess/WebProcessPool.cpp:
2377         (WebKit::WebProcessPool::createNewWebProcess):
2378         (WebKit::WebProcessPool::initializeNewWebProcess):
2379         * UIProcess/WebProcessPool.h:
2380
2381 2019-02-25  Michael Catanzaro  <mcatanzaro@igalia.com>
2382
2383         [GTK] Enable PSON
2384         https://bugs.webkit.org/show_bug.cgi?id=194979
2385
2386         Reviewed by Žan Doberšek.
2387
2388         It is expected that this may introduce unexpected regressions, so it's appropriate to do
2389         this at the start of a new release cycle.
2390
2391         * Shared/WebPreferencesDefaultValues.h:
2392
2393 2019-02-25  Michael Catanzaro  <mcatanzaro@igalia.com>
2394
2395         [WPE][GTK] Clean up handling of WEBKIT_FORCE_COMPLEX_TEXT
2396         https://bugs.webkit.org/show_bug.cgi?id=194614
2397
2398         Reviewed by Carlos Garcia Campos.
2399
2400         This environment variable is now enabled for WPE, not just for GTK.
2401
2402         It is now possible to use this environment variable to enable complex text, not just to
2403         disable it.
2404
2405         WebProcessPool::setAlwaysUsesComplexTextCodePath is fixed to be respected even when this
2406         environment variable is set, although WPE and GTK will never do so.
2407
2408         * UIProcess/glib/WebProcessPoolGLib.cpp:
2409         (WebKit::WebProcessPool::platformInitialize):
2410         (WebKit::WebProcessPool::platformInitializeWebProcess):
2411
2412 2019-02-24  Zalan Bujtas  <zalan@apple.com>
2413
2414         Introduce ContentChangeObserver class
2415         https://bugs.webkit.org/show_bug.cgi?id=194977
2416         <rdar://problem/48338115>
2417
2418         Reviewed by Simon Fraser.
2419
2420         * WebProcess/WebPage/ios/WebPageIOS.mm:
2421         (WebKit::WebPage::handleSyntheticClick):
2422         (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
2423
2424 2019-02-24  Simon Fraser  <simon.fraser@apple.com>
2425
2426         Migrate from "fixedPositionRect" to "layoutViewport" in the scrolling tree
2427         https://bugs.webkit.org/show_bug.cgi?id=194984
2428
2429         Reviewed by Sam Weinig.
2430
2431         Rename "fixedPositionRect" to "layoutViewport" in scrolling tree code.
2432
2433         Remove ScrollingTree::fixedPositionRect() which was only used on iOS, to fetch the
2434         current layout viewport rect. Instead, set the layout viewport on the root
2435         node in ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling().
2436         
2437         Add a WK2 Scrolling log channel.
2438
2439         * Platform/Logging.h:
2440         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
2441         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
2442         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
2443         (WebKit::RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling):
2444         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
2445         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
2446         (WebKit::RemoteScrollingTree::fixedPositionRect): Deleted.
2447         * UIProcess/RemoteLayerTree/RemoteScrollingTree.h:
2448         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
2449         (WebKit::RemoteScrollingCoordinatorProxy::currentLayoutViewport const):
2450         (WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect const): Deleted.
2451         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h:
2452         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
2453         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateChildNodesAfterScroll):
2454         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterViewportChange):
2455         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterAncestorChange):
2456         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
2457         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
2458         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterAncestorChange):
2459         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
2460         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
2461         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateLayersAfterAncestorChange):
2462         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll):
2463         * UIProcess/ios/WKContentView.mm:
2464         (-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
2465
2466 2019-02-20  Darin Adler  <darin@apple.com>
2467
2468         Finish removing String::format
2469         https://bugs.webkit.org/show_bug.cgi?id=194893
2470
2471         Reviewed by Daniel Bates.
2472
2473         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
2474         (WebKit::LocalAuthenticator::getAssertion): Use makeString, attempting to fix
2475         a problem where we passed an NSData * to format with a "%s"."
2476
2477 2019-02-24  Michael Catanzaro  <mcatanzaro@igalia.com>
2478
2479         [WPE] Install MemoryPressureHandler in UIProcess
2480         https://bugs.webkit.org/show_bug.cgi?id=194617
2481
2482         Reviewed by Žan Doberšek.
2483
2484         Currently only GTK and Cocoa ports run MemoryPressureHandler in the UI process. WPE should
2485         too.
2486
2487         We need @no-unify to avoid changing the unified source bundles under API/, which are
2488         notoriously fragile. (WebMemoryPressureHandler.cpp sorts just above API/.)
2489
2490         * SourcesWPE.txt:
2491         * UIProcess/WebMemoryPressureHandler.cpp:
2492         (WebKit::installMemoryPressureHandler):
2493         * UIProcess/glib/WebProcessPoolGLib.cpp:
2494         (WebKit::WebProcessPool::platformInitialize):
2495
2496 2019-02-23  Chris Dumez  <cdumez@apple.com>
2497
2498         Give DrawingAreas their own identifiers
2499         https://bugs.webkit.org/show_bug.cgi?id=194969
2500         <rdar://problem/48154508>
2501
2502         Unreviewed, fix API test debug assertion failures after r241988.
2503         We do not support sending an ObjectIdentifier that is 0 via IPC so update WebPageProxy::CreateNewPage
2504         IPC to return an Optional<WebPageCreationParameters> instead of a WebPageCreationParameters. It returns
2505         nullopt when there this no UIClient or the client did not create the page, instead of returning a
2506         default-initialized WebPageCreationParameters.
2507
2508         * UIProcess/WebPageProxy.cpp:
2509         (WebKit::WebPageProxy::createNewPage):
2510         * UIProcess/WebPageProxy.messages.in:
2511         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2512         (WebKit::WebChromeClient::createWindow):
2513
2514 2019-02-23  Simon Fraser  <simon.fraser@apple.com>
2515
2516         Remove remnants of iOS WK1 scrolling tree code
2517         https://bugs.webkit.org/show_bug.cgi?id=194980
2518
2519         Reviewed by Sam Weinig.
2520
2521         Remove ScrollingTreeIOS and ScrollingCoordinatorIOS which were never instantiated.
2522
2523         Merge ScrollingTreeFrameScrollingNodeIOS into ScrollingTreeFrameScrollingNodeRemoteIOS,
2524         removing code which never applies to iOS WK2 (e.g. the synchronous scrolling code path).
2525
2526         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
2527         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h:
2528         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
2529         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::ScrollingTreeFrameScrollingNodeRemoteIOS):
2530         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateBeforeChildren):
2531         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateAfterChildren):
2532         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::minimumScrollPosition const):
2533         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::maximumScrollPosition const):
2534         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::scrollPosition const):
2535         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollPosition):
2536         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollLayerPosition):
2537         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateChildNodesAfterScroll):
2538         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterDelegatedScroll):
2539         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterViewportChange):
2540         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterAncestorChange):
2541         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
2542
2543 2019-02-23  Keith Miller  <keith_miller@apple.com>
2544
2545         Add new mac target numbers
2546         https://bugs.webkit.org/show_bug.cgi?id=194955
2547
2548         Reviewed by Tim Horton.
2549
2550         * Configurations/Base.xcconfig:
2551         * Configurations/DebugRelease.xcconfig:
2552
2553 2019-02-22  Chris Dumez  <cdumez@apple.com>
2554
2555         Give DrawingAreas their own identifiers
2556         https://bugs.webkit.org/show_bug.cgi?id=194969
2557         <rdar://problem/48154508>
2558
2559         Reviewed by Geoffrey Garen.
2560
2561         Give DrawingAreas their own identifiers instead of using the pageID. It will make the IPC more robust now that a
2562         WebPageProxy can have several drawing areas with PSON.
2563
2564         * Shared/DrawingAreaInfo.h:
2565         * Shared/WebPageCreationParameters.cpp:
2566         (WebKit::WebPageCreationParameters::encode const):
2567         (WebKit::WebPageCreationParameters::decode):
2568         * Shared/WebPageCreationParameters.h:
2569         * UIProcess/AcceleratedDrawingAreaProxy.cpp:
2570         (WebKit::AcceleratedDrawingAreaProxy::sendUpdateBackingStoreState):
2571         (WebKit::AcceleratedDrawingAreaProxy::waitForAndDispatchDidUpdateBackingStoreState):
2572         (WebKit::AcceleratedDrawingAreaProxy::setNativeSurfaceHandleForCompositing):
2573         (WebKit::AcceleratedDrawingAreaProxy::destroyNativeSurfaceHandleForCompositing):
2574         * UIProcess/DrawingAreaProxy.cpp:
2575         (WebKit::DrawingAreaProxy::DrawingAreaProxy):
2576         (WebKit::DrawingAreaProxy::~DrawingAreaProxy):
2577         (WebKit::DrawingAreaProxy::messageSenderConnection const):
2578         (WebKit::DrawingAreaProxy::sendMessage):
2579         (WebKit::DrawingAreaProxy::viewExposedRectChangedTimerFired):
2580         * UIProcess/DrawingAreaProxy.h:
2581         (WebKit::DrawingAreaProxy::identifier const):
2582         (WebKit::DrawingAreaProxy::process const):
2583         * UIProcess/DrawingAreaProxyImpl.cpp:
2584         (WebKit::DrawingAreaProxyImpl::update):
2585         * UIProcess/ProvisionalPageProxy.cpp:
2586         (WebKit::ProvisionalPageProxy::initializeWebPage):
2587         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
2588         (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
2589         (WebKit::RemoteLayerTreeDrawingAreaProxy::~RemoteLayerTreeDrawingAreaProxy):
2590         (WebKit::RemoteLayerTreeDrawingAreaProxy::deviceScaleFactorDidChange):
2591         (WebKit::RemoteLayerTreeDrawingAreaProxy::sendUpdateGeometry):
2592         (WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidStart):
2593         (WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidEnd):
2594         (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
2595         (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateActivityState):
2596         (WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing):
2597         * UIProcess/WebPageProxy.cpp:
2598         (WebKit::WebPageProxy::initializeWebPage):
2599         (WebKit::WebPageProxy::createNewPage):
2600         (WebKit::WebPageProxy::creationParameters):
2601         * UIProcess/WebPageProxy.h:
2602         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
2603         (WebKit::TiledCoreAnimationDrawingAreaProxy::deviceScaleFactorDidChange):
2604         (WebKit::TiledCoreAnimationDrawingAreaProxy::colorSpaceDidChange):
2605         (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState):
2606         (WebKit::TiledCoreAnimationDrawingAreaProxy::sendUpdateGeometry):
2607         (WebKit::TiledCoreAnimationDrawingAreaProxy::adjustTransientZoom):
2608         (WebKit::TiledCoreAnimationDrawingAreaProxy::commitTransientZoom):
2609         (WebKit::TiledCoreAnimationDrawingAreaProxy::dispatchAfterEnsuringDrawing):
2610         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
2611         (WebKit::AcceleratedDrawingArea::AcceleratedDrawingArea):
2612         (WebKit::AcceleratedDrawingArea::layerHostDidFlushLayers):
2613         (WebKit::AcceleratedDrawingArea::sendDidUpdateBackingStoreState):
2614         * WebProcess/WebPage/DrawingArea.cpp:
2615         (WebKit::DrawingArea::DrawingArea):
2616         (WebKit::DrawingArea::removeMessageReceiverIfNeeded):
2617         * WebProcess/WebPage/DrawingArea.h:
2618         (WebKit::DrawingArea::identifier const):
2619         (WebKit::DrawingArea::send):
2620         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2621         (WebKit::DrawingAreaImpl::sendDidUpdateBackingStoreState):
2622         (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode):
2623         (WebKit::DrawingAreaImpl::display):
2624         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
2625         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
2626         (WebKit::RemoteLayerTreeDrawingArea::updateGeometry):
2627         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
2628         * WebProcess/WebPage/WebPage.cpp:
2629         (WebKit::WebPage::reinitializeWebPage):
2630         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2631         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
2632         (WebKit::TiledCoreAnimationDrawingArea::sendEnterAcceleratedCompositingModeIfNeeded):
2633         (WebKit::TiledCoreAnimationDrawingArea::updateIntrinsicContentSizeIfNeeded):
2634         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
2635         (WebKit::TiledCoreAnimationDrawingArea::updateGeometry):
2636         (WebKit::TiledCoreAnimationDrawingArea::setLayerHostingMode):
2637
2638 2019-02-22  Andy Estes  <aestes@apple.com>
2639
2640         [Cocoa] Do not suppress deprecation warnings when calling sandbox_extension_issue_file
2641         https://bugs.webkit.org/show_bug.cgi?id=194971
2642         <rdar://problem/35786264>
2643
2644         Reviewed by Tim Horton.
2645
2646         sandbox_extension_issue_file is not actually deprecated.
2647
2648         * Shared/mac/SandboxExtensionMac.mm:
2649         (WebKit::SandboxExtensionImpl::sandboxExtensionForType):
2650
2651 2019-02-22  Wenson Hsieh  <wenson_hsieh@apple.com>
2652
2653         [iOS] Callout menu overlaps in-page controls when editing a comment in github.com's issue tracker
2654         https://bugs.webkit.org/show_bug.cgi?id=194873
2655         <rdar://problem/46701974>
2656
2657         Reviewed by Tim Horton.
2658
2659         On the topic of supporting web-based rich text editors on iOS, one problematic area has always been handling
2660         conflicts between platform UI (i.e., the system callout menu) and in-page text editing controls. This issue
2661         comes up in websites that don't use the "hidden contenteditable" approach to rich text editing, but also show
2662         additional controls in a toolbar or contextual menu above the selection. In these cases, what often happens is
2663         that system controls overlap controls in the page.
2664
2665         Luckily, the iOS callout menu (i.e. the private UICalloutBar) is capable of presenting with a list of "evasion
2666         rects" to avoid; if the callout bar would normally intersect with one of these rects, then a different
2667         orientation that does not intersect with one of these rects is chosen instead. Currently, the only rect added
2668         here by UIKit when presenting the callout menu is the bounding rect of the on-screen keyboard, but after
2669         <rdar://problem/48128337>, we now have a generalized mechanism for offering additional evasion rects before
2670         UIKit presents the callout menu.
2671
2672         This patch adopts the mechanism introduced in <rdar://problem/48128337>, and introduces a heuristic for
2673         determining the approximate location of controls in the page which might overlap the callout menu. This
2674         heuristic works by hit-testing for clickable (but non-editable) nodes above the bounds of the selection, which
2675         are additionally not hit-tested by advancing outwards from any of the other edges of the selection bounds.
2676         Additionally, any hit-tested nodes whose bounding rects are very large (relative to the content view size) are
2677         ignored (this deals with scenarios where the body or a large container element has a click handler). We then add
2678         the bounding rects of each of the nodes that fit this criteria to the list of rects for UIKit to avoid when
2679         presenting the system callout menu.
2680
2681         The result is that WebKit will, by default, avoid overlapping anything that looks like controls in the page when
2682         showing a callout menu in editable content. In practice, this fixes overlapping controls on most websites that
2683         roll their own context menu or toolbar in their rich text editor.
2684
2685         Test: editing/selection/ios/avoid-showing-callout-menu-over-controls.html
2686
2687         * Platform/spi/ios/UIKitSPI.h:
2688         * UIProcess/WebPageProxy.h:
2689         * UIProcess/ios/WKContentViewInteraction.mm:
2690         (-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]):
2691         (-[WKContentView requestRectsToEvadeForSelectionCommandsWithCompletionHandler:]):
2692         (-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):
2693
2694         Drive-by: handle null completion handler arguments more gracefully, by raising an NSException and bailing before
2695         attempting to invoke a nil block.
2696
2697         * UIProcess/ios/WebPageProxyIOS.mm:
2698         (WebKit::WebPageProxy::requestEvasionRectsAboveSelection):
2699
2700         See above for more detail.
2701
2702         * WebProcess/WebPage/WebPage.h:
2703         * WebProcess/WebPage/WebPage.messages.in:
2704         * WebProcess/WebPage/ios/WebPageIOS.mm:
2705         (WebKit::WebPage::requestEvasionRectsAboveSelection):
2706
2707 2019-02-22  Simon Fraser  <simon.fraser@apple.com>
2708
2709         Unreviewed build fix: need a WebCore:: namespace on ScrollingEventResult.
2710
2711         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
2712
2713 2019-02-22  Chris Dumez  <cdumez@apple.com>
2714
2715         Regression(PSON) Unable to preview password-protected documents on iCloud.com
2716         https://bugs.webkit.org/show_bug.cgi?id=194954
2717         <rdar://problem/48127957>
2718
2719         Reviewed by Alex Christensen.
2720
2721         Make sure the ProvisionalPageProxy forwards to the WebPageProxy the QuickLook-related
2722         IPC on iOS.
2723
2724         * UIProcess/ProvisionalPageProxy.cpp:
2725         (WebKit::ProvisionalPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame):
2726         (WebKit::ProvisionalPageProxy::didReceiveMessage):
2727         * UIProcess/ProvisionalPageProxy.h:
2728         * UIProcess/WebPageProxy.h:
2729         * UIProcess/ios/WebPageProxyIOS.mm:
2730         (WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame):
2731         (WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrameShared):
2732
2733 2019-02-22  Per Arne Vollan  <pvollan@apple.com>
2734
2735         [iOS] Sandbox should allow mach lookups related to media capturing
2736         https://bugs.webkit.org/show_bug.cgi?id=194951
2737         <rdar://problem/48013875>
2738
2739         Reviewed by Brent Fulgham.
2740
2741         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2742
2743 2019-02-22  Alexander Mikhaylenko  <exalm7659@gmail.com>
2744
2745         [GTK] Navigation gesture improvements
2746         https://bugs.webkit.org/show_bug.cgi?id=194943
2747
2748         Reviewed by Michael Catanzaro.
2749
2750         Cancel the gesture if progress is less than 0.5 and velocity is not high enough.
2751
2752         Allow to continue the gesture during animation. Introduce finished state to be used
2753         when showing snapshot after the animation ends.
2754
2755         Fix duration calculation, also slow it down so that the initial velocity matches
2756         what it was during the gesture.
2757
2758         * UIProcess/ViewGestureController.h: Add shouldCancel() and State::Finishing to SwipeProgressTracker.
2759         * UIProcess/gtk/ViewGestureControllerGtk.cpp:
2760         (WebKit::ViewGestureController::SwipeProgressTracker::handleEvent):
2761         Fix velocity calculation, allow scrolling during State::Animating.
2762         (WebKit::ViewGestureController::SwipeProgressTracker::shouldCancel): Added.
2763         (WebKit::ViewGestureController::SwipeProgressTracker::startAnimation): Use shouldCancel() and fix duration calculation.
2764         (WebKit::ViewGestureController::SwipeProgressTracker::endAnimation): Set state to State::Finishing when the animation ends.
2765
2766 2019-02-22  Chris Dumez  <cdumez@apple.com>
2767
2768         REGRESSION(PSON) Scroll position is sometimes not restored on history navigation
2769         https://bugs.webkit.org/show_bug.cgi?id=194924
2770         <rdar://problem/48216125>
2771
2772         Reviewed by Geoffrey Garen.
2773
2774         When process-swapping, we would create a new WebPage in the new process, which would
2775         call restoreSessionInternal() to restore the HistoryItems based on the UIProcess's
2776         backforward list. The issue is that this session restoring would send HistoryItem
2777         updates back to the UIProcess. Without PSON, this would be unnecessary but harmless.
2778         With PSON though, this may end up overwriting values set by the previous process,
2779         such as the scroll position.
2780
2781         Address the issue by temporarily disabling the HistoryItem update notifications to
2782         the UIProcess while restoring a session.
2783
2784         * UIProcess/API/Cocoa/WKBackForwardListItem.mm:
2785         (-[WKBackForwardListItem _scrollPosition]):
2786         * UIProcess/API/Cocoa/WKBackForwardListItemPrivate.h:
2787         * WebProcess/WebPage/WebPage.cpp:
2788         (WebKit::WebPage::restoreSessionInternal):
2789
2790 2019-02-21  Adrian Perez de Castro  <aperez@igalia.com>
2791
2792         [WPE][GTK] No API documentation generated for WebKitUserContentFilterStore
2793         https://bugs.webkit.org/show_bug.cgi?id=194908
2794
2795         Reviewed by Carlos Garcia Campos.
2796
2797         * UIProcess/API/gtk/docs/webkit2gtk-4.0.types: Add entry for webkit_user_content_filter_store_get_type().
2798         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add entry for WebKitUserContentFilterStore.
2799         * UIProcess/API/wpe/docs/wpe-docs.sgml: Ditto.
2800
2801 2019-02-21  Carlos Garcia Campos  <cgarcia@igalia.com>
2802
2803         wpewebkit-2.23.90 Failing to build on Fedora
2804         https://bugs.webkit.org/show_bug.cgi?id=194922
2805
2806         Unreviewed. Fix path to WebKitUserContentFilterStore.h in WPE_API_INSTALLED_HEADERS.
2807
2808         * PlatformWPE.cmake:
2809
2810 2019-02-21  Simon Fraser  <simon.fraser@apple.com>
2811
2812         Hardcode Visual Viewports on everywhere except iOS WK1
2813         https://bugs.webkit.org/show_bug.cgi?id=194928
2814
2815         Reviewed by Zalan Bujtas.
2816
2817         Remove the WK1 and WK2 preferences and MiniBrowser menu item for "visual viewports",
2818         change the default value of the Setting to 'true', and hardcode WebView on iOS to
2819         set it to false. The setting has shipped for several years and there's no need to turn
2820         it off now.
2821
2822         Similarly, disable the "Visual Viewport API" on iOS WK1, since it makes no sense if
2823         Visual Viewports are not enabled.
2824         
2825         Remove the "visualViewportEnabled" flag and unused code paths from scrolling tree code
2826         that only runs in WK2
2827
2828         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
2829         (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
2830         (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
2831         * Shared/WebPreferences.yaml:
2832         * UIProcess/API/Cocoa/WKPreferences.mm:
2833         (-[WKPreferences _visualViewportEnabled]): Deleted.
2834         (-[WKPreferences _setVisualViewportEnabled:]): Deleted.
2835         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2836         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
2837         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
2838         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
2839         (WebKit::RemoteScrollingCoordinatorProxy::visualViewportEnabled const): Deleted.
2840         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
2841         (WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect const):
2842         * UIProcess/WebPageProxy.h:
2843         * UIProcess/ios/WKContentView.mm:
2844         (-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
2845         * UIProcess/ios/WebPageProxyIOS.mm:
2846         (WebKit::WebPageProxy::computeCustomFixedPositionRect const):
2847         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
2848         (WebKit::WebAutomationSessionProxy::computeElementLayout):
2849         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2850         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2851         * WebProcess/WebPage/ios/WebPageIOS.mm:
2852         (WebKit::WebPage::getFocusedElementInformation):
2853         (WebKit::WebPage::dynamicViewportSizeUpdate):
2854         (WebKit::WebPage::updateVisibleContentRects):
2855
2856 2019-02-21  Carlos Garcia Campos  <cgarcia@igalia.com>
2857
2858         [GTK] Epiphany searching for plugins even if plugins are disabled
2859         https://bugs.webkit.org/show_bug.cgi?id=194352
2860
2861         Reviewed by Michael Catanzaro.
2862
2863         Check pluginsEnabled setting before trying to get plugins from UI process.
2864
2865         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
2866         (WebKit::WebPluginInfoProvider::populatePluginCache):
2867
2868 2019-02-21  Darin Adler  <darin@apple.com>
2869
2870         Some refinements for Node and Document
2871         https://bugs.webkit.org/show_bug.cgi?id=194764
2872
2873         Reviewed by Ryosuke Niwa.
2874
2875         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp:
2876         (webkit_dom_document_get_override_style): Changed to return nullptr directly instead of
2877         calling a bunch of WebCore code first. No real value in checking arguments or doing any work.
2878
2879         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2880         (WebKit::WebFrameLoaderClient::shouldAlwaysUsePluginDocument const): Deleted.
2881         No need to override the function inherited from the base class, nor to keep track of the
2882         unnecessary task of implementing this some day.
2883         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: Updated for the above.
2884
2885 2019-02-21  Ryosuke Niwa  <rniwa@webkit.org>
2886
2887         Discard cached processes when clearing website data store
2888         https://bugs.webkit.org/show_bug.cgi?id=194894
2889
2890         Reviewed by Chris Dumez.
2891
2892         Clear the process cache when clearing the website data store so that there is no way to infer
2893         which site the user had visited by observing for which sites WebContent processes had been cached.
2894
2895         There is one sublty in WebsiteDataStore::removeData that we have to delay the clearing of
2896         the web process cache until the next run loop because SuspendedPageProxy::~SuspendedPageProxy
2897         invokes WebProcessProxy::maybeShutDown in the next run loop. We also have to disable the process
2898         cache during this time as it would otherwise trigger the responsiveness check of WebContent process
2899         can take arbitrarily long time.
2900
2901         * UIProcess/API/Cocoa/WKProcessPool.mm:
2902         (-[WKProcessPool _processCacheCapacity]): Added for testing.
2903         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2904         * UIProcess/WebProcessCache.cpp:
2905         (WebKit::WebProcessCache::addProcess): Avoid adding web processes to the cache while the suspended
2906         pages are being cleared.
2907         * UIProcess/WebProcessCache.h:
2908         (WebKit::WebProcessCache::disabled const): Added.
2909         (WebKit::WebProcessCache::setDisabled): Added.
2910         * UIProcess/WebProcessPool.cpp:
2911         (WebKit::WebProcessPool::handleMemoryPressureWarning):
2912         (WebKit::WebProcessPool::clearSuspendedPages): Added.
2913         * UIProcess/WebProcessPool.h:
2914         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2915         (WebKit::WebsiteDataStore::removeData):
2916
2917 2019-02-21  Alex Christensen  <achristensen@webkit.org>
2918
2919         Clicking "Go Back" on a safe browsing warning before a WKWebView has loaded any page should request to close the WKWebView
2920         https://bugs.webkit.org/show_bug.cgi?id=194914
2921         <rdar://problem/47586889>
2922
2923         Reviewed by Geoffrey Garen.
2924
2925         * UIProcess/API/APIUIClient.h:
2926         (API::UIClient::didShowSafeBrowsingWarning):
2927         (API::UIClient::didClickGoBackFromSafeBrowsingWarning): Deleted.
2928         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2929         * UIProcess/Cocoa/UIDelegate.h:
2930         * UIProcess/Cocoa/UIDelegate.mm:
2931         (WebKit::UIDelegate::setDelegate):
2932         (WebKit::UIDelegate::UIClient::didClickGoBackFromSafeBrowsingWarning): Deleted.
2933         * UIProcess/WebPageProxy.cpp:
2934         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2935
2936 2019-02-21  Tim Horton  <timothy_horton@apple.com>
2937
2938         Turn a high-value UI-side-compositing assertion into a release assert
2939         https://bugs.webkit.org/show_bug.cgi?id=194887
2940
2941         Reviewed by Simon Fraser.
2942
2943         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
2944         (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
2945         There is absolutely no situation in which this assert should fire
2946         if WebKit is behaving correctly, and it will basically always result
2947         in a UI process crash (or at least confusion), so make it a release assert.
2948         This would have saved us a lot of stress in bug 194845.
2949
2950 2019-02-21  Don Olmstead  <don.olmstead@sony.com>
2951
2952         [MSVC] Fix compilation errors with lambdas in ResourceLoadStatistics
2953         https://bugs.webkit.org/show_bug.cgi?id=194913
2954
2955         Reviewed by Brent Fulgham.
2956
2957         MSVC has problems with the scoping of `this` within a nested lambda. To work around the
2958         behavior the enclosing lambda's wrapping of `this` is used within the nested lambda.
2959
2960         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
2961         (WebKit::ResourceLoadStatisticsMemoryStore::processStatisticsAndDataRecords):
2962         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
2963         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessGranted):
2964
2965 2019-02-21  Chris Dumez  <cdumez@apple.com>
2966
2967         Fix API test crashes after r241855.
2968
2969         Reviewed by Ryosuke Niwa.
2970
2971         * UIProcess/WebProcessCache.cpp:
2972         (WebKit::WebProcessCache::addProcessIfPossible):
2973
2974 2019-02-21  Alex Christensen  <achristensen@webkit.org>
2975
2976         API::HTTPCookieStore should expose setCookies()
2977         https://bugs.webkit.org/show_bug.cgi?id=194861
2978
2979         Reviewed by Brent Fulgham.
2980
2981         Pass a Vector<Cookie> instead of just one cookie at a time.
2982         This will add the ability to set multiple cookies without an IPC roundtrip per cookie.
2983
2984         * NetworkProcess/Cookies/WebCookieManager.cpp:
2985         (WebKit::WebCookieManager::setCookie):
2986         * NetworkProcess/Cookies/WebCookieManager.h:
2987         * NetworkProcess/Cookies/WebCookieManager.messages.in:
2988         * UIProcess/API/APIHTTPCookieStore.cpp:
2989         (API::HTTPCookieStore::setCookies):
2990         (API::HTTPCookieStore::setCookie): Deleted.
2991         * UIProcess/API/APIHTTPCookieStore.h:
2992         * UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
2993         (-[WKHTTPCookieStore setCookie:completionHandler:]):
2994         * UIProcess/WebCookieManagerProxy.cpp:
2995         (WebKit::WebCookieManagerProxy::setCookies):
2996         (WebKit::WebCookieManagerProxy::setCookie): Deleted.
2997         * UIProcess/WebCookieManagerProxy.h:
2998
2999 2019-02-21  Antoine Quint  <graouts@apple.com>
3000
3001         Move UIWebTouchEventsGestureRecognizer.activeTouchesByIdentifier to SPI
3002         https://bugs.webkit.org/show_bug.cgi?id=194531
3003         <rdar://problem/47714562>
3004
3005         Reviewed by Tim Horton.
3006
3007         Follow-up commit to ensure this SPI is only called on newer versions of iOS.
3008
3009         * UIProcess/ios/WKContentViewInteraction.mm:
3010         (-[WKContentView cancelPointersForGestureRecognizer:]):
3011
3012 2019-02-21  Tim Horton  <timothy_horton@apple.com>
3013
3014         Crash under RemoteLayerTreePropertyApplier::applyProperties when reattaching to old process
3015         https://bugs.webkit.org/show_bug.cgi?id=194845
3016         <rdar://problem/47944579>
3017
3018         Reviewed by Antti Koivisto.
3019
3020         New test: ProcessSwap.PageOverlayLayerPersistence
3021
3022         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
3023         (WebKit::RemoteLayerTreeTransaction::LayerProperties::notePropertiesChanged):
3024         Keep track of all properties that have ever changed on a layer, so we
3025         can re-send them if a layer moves between contexts.
3026
3027         * WebProcess/WebPage/DrawingArea.cpp:
3028         (WebKit::DrawingArea::~DrawingArea):
3029         (WebKit::DrawingArea::removeMessageReceiverIfNeeded):
3030         * WebProcess/WebPage/DrawingArea.h:
3031         (WebKit::DrawingArea::layerHostDidFlushLayers):
3032         Make it possible to tear down DrawingArea's MessageReceiver before it is destroyed,
3033         so that we can keep two DrawingAreas alive in a single process for a short time.
3034
3035         (WebKit::DrawingArea::adoptLayersFromDrawingArea):
3036         Add adoptLayersFromDrawingArea; see below for its only useful implementation.
3037
3038         * WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.cpp:
3039         (WebKit::GraphicsLayerCARemote::GraphicsLayerCARemote):
3040         (WebKit::GraphicsLayerCARemote::~GraphicsLayerCARemote):
3041         (WebKit::GraphicsLayerCARemote::createPlatformCALayer):
3042         (WebKit::GraphicsLayerCARemote::createPlatformCALayerForEmbeddedView):
3043         (WebKit::GraphicsLayerCARemote::moveToContext):
3044         * WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.h:
3045         Make it possible to move a GraphicsLayerCARemote between RemoteLayerTreeContexts.
3046
3047         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
3048         (WebKit::PlatformCALayerRemote::create):
3049         (WebKit::PlatformCALayerRemote::createForEmbeddedView):
3050         (WebKit::PlatformCALayerRemote::~PlatformCALayerRemote):
3051         (WebKit::PlatformCALayerRemote::moveToContext):
3052         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:
3053         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm:
3054         (WebKit::PlatformCALayerRemoteCustom::create):
3055         (WebKit::PlatformCALayerRemoteCustom::clone const):
3056         Make it possible to move a PlatformCALayerRemote between RemoteLayerTreeContexts.
3057
3058         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h:
3059         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
3060         (WebKit::RemoteLayerTreeContext::~RemoteLayerTreeContext):
3061         (WebKit::RemoteLayerTreeContext::adoptLayersFromContext):
3062         (WebKit::RemoteLayerTreeContext::layerDidEnterContext):
3063         (WebKit::RemoteLayerTreeContext::layerWillLeaveContext):
3064         (WebKit::RemoteLayerTreeContext::graphicsLayerDidEnterContext):
3065         (WebKit::RemoteLayerTreeContext::graphicsLayerWillLeaveContext):
3066         (WebKit::RemoteLayerTreeContext::layerWasCreated): Deleted.
3067         (WebKit::RemoteLayerTreeContext::layerWillBeDestroyed): Deleted.
3068         Keep track of all GraphicsLayerCARemote instances in the context, like we
3069         do for PlatformCALayerRemote, so that we can update their context backpointers if needed.
3070
3071         Also make it possible to move all outstanding layers to a new context.
3072
3073         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
3074         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
3075         (WebKit::RemoteLayerTreeDrawingArea::adoptLayersFromDrawingArea):
3076         * WebProcess/WebPage/WebPage.cpp:
3077         (WebKit::WebPage::reinitializeWebPage):
3078         When doing a DrawingArea swap, transition all layers from the old context
3079         to the new one. In order to do this, we temporarily keep both DrawingAreas
3080         alive, but make use of the new mechanism to remove the old one's MessageReceiver
3081         before installing the new one, so that destroying the old one later doesn't
3082         remove it (avoiding re-introducing bug 189481).
3083
3084 2019-02-21  Chris Dumez  <cdumez@apple.com>
3085
3086         Unreviewed API test fix after r241855.
3087
3088         * UIProcess/WebProcessProxy.cpp:
3089         (WebKit::WebProcessProxy::~WebProcessProxy):
3090
3091 2019-02-21  Antoine Quint  <graouts@apple.com>
3092
3093         Move UIWebTouchEventsGestureRecognizer.activeTouchesByIdentifier to SPI
3094         https://bugs.webkit.org/show_bug.cgi?id=194531
3095         <rdar://problem/47714562>
3096
3097         Reviewed by Dean Jackson.
3098
3099         * Platform/spi/ios/UIKitSPI.h:
3100         * UIProcess/ios/WKContentViewInteraction.mm:
3101         (-[WKContentView cancelPointersForGestureRecognizer:]): We update the referenced Radar since we need to keep the call
3102         to respondsToSelector until the SPI has shipped for OpenSource builds to work.
3103
3104 2019-02-20  Antti Koivisto  <antti@apple.com>
3105
3106         Make programmatic frame scrolling work on iOS
3107         https://bugs.webkit.org/show_bug.cgi?id=194886
3108
3109         Reviewed by Simon Fraser.
3110
3111         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
3112         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):
3113
3114         Don't move based on the layout scroll position. This just overrides the user scroll position.
3115         Remove ScrolledContentsLayer checks, we only need to deal with the ScrollContainerLayer here.
3116
3117         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::setScrollLayerPosition):
3118
3119         Scroll the UIScrollView correctly. This is called as a result of setting the RequestedScrollPosition property.
3120         Remove scroll origin code, it doesn't look correct (and is untested).
3121
3122 2019-02-20  Chris Dumez  <cdumez@apple.com>
3123
3124         [PSON] Make sure hung processes are not kept alive by suspended pages or process caching
3125         https://bugs.webkit.org/show_bug.cgi?id=194881
3126         <rdar://problem/48249014>
3127
3128         Reviewed by Geoffrey Garen.
3129
3130         After we construct a SuspendedPageProxy and before we send the IPC to the WebProcess to
3131         ask it to suspend, start a 10 seconds timer. If the process does not answer the request
3132         to suspend before the timer fires, we destroy the SuspendedPageProxy so that we do not
3133         keep a hung process around.
3134
3135         For the WebProcessCache, we now call WebProcessProxy::isResponsive() on the process
3136         before adding it to the cache. Internally, this relies on an IPC handshake with the
3137         WebProcess. If the process is not responsive, we do not add it to the cache and we
3138         shut it down. If it is responsive then we proceed normally with adding it to the
3139         cache.
3140
3141         * UIProcess/SuspendedPageProxy.cpp:
3142         (WebKit::SuspendedPageProxy::SuspendedPageProxy):
3143         (WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
3144         (WebKit::SuspendedPageProxy::suspensionTimedOut):
3145         * UIProcess/SuspendedPageProxy.h:
3146         * UIProcess/WebProcessCache.cpp:
3147         (WebKit::WebProcessCache::addProcessIfPossible):
3148         (WebKit::WebProcessCache::addProcess):
3149         * UIProcess/WebProcessCache.h:
3150         * UIProcess/WebProcessProxy.cpp:
3151         (WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
3152         (WebKit::WebProcessProxy::maybeShutDown):
3153         (WebKit::WebProcessProxy::isResponsive):
3154         * UIProcess/WebProcessProxy.h:
3155
3156 2019-02-20  Chris Dumez  <cdumez@apple.com>
3157
3158         Unreviewed build fix after r241823.
3159
3160         * UIProcess/SuspendedPageProxy.h:
3161
3162 2019-02-20  Alex Christensen  <achristensen@webkit.org>
3163
3164         Unreviewed, rolling out r241838.
3165
3166         Broke API tests
3167
3168         Reverted changeset:
3169
3170         "Resolve WebsiteDataStore/HTTPCookieStore ref cycle"
3171         https://bugs.webkit.org/show_bug.cgi?id=194868
3172         https://trac.webkit.org/changeset/241838
3173
3174 2019-02-20  Wenson Hsieh  <wenson_hsieh@apple.com>
3175
3176         REGRESSION: [ iOS ] Layout Test editing/input/ios/rtl-keyboard-input-on-focus.html is a Timeout
3177         https://bugs.webkit.org/show_bug.cgi?id=194601
3178         <rdar://problem/48080316>
3179
3180         Reviewed by Tim Horton.
3181
3182         Following r241311, if a web view becomes first responder and is then moved offscreen (or obscured, hidden, or in
3183         the case of WebKitTestRunner, its UIWindow loses its status as keyWindow), we end up holding on to the input
3184         view update deferral token indefinitely, waiting for the current focused element to be blurred or refocused.
3185
3186         This also manifests other user-facing bugs, the most common of which is the keyboard occasionally remaining
3187         onscreen after typing a URL in the unified field in MobileSafari and hitting Return, in the case where there is
3188         no autofocused element on the page.
3189
3190         To fix this, when becoming the first responder, additionally install a callback to detect when the page is
3191         finished handling the activity state change, and invalidate the input deferral token then. This retains the
3192         behavior where calling -becomeFirstResponder on the web view while a different view is focused will keep the
3193         keyboard stable, since the focused element message from the web process should be dispatched when handling the
3194         activity state change within the web process.
3195
3196         Of course, the web process may not be responsive at all while the web view is still in the view hierarchy, in
3197         which case we may still end up deferring input view updates indefinitely. In this case, we maintain a separate
3198         watchdog timer with a short delay, after which we unconditionally invalidate the token.
3199
3200         * UIProcess/WebPageProxy.cpp:
3201         (WebKit::WebPageProxy::installActivityStateChangeCompletionHandler):
3202
3203         Move the implementation of installActivityStateChangeCompletionHandler into cross-platform code.
3204
3205         * UIProcess/WebPageProxy.h:
3206         * UIProcess/ios/WKContentView.mm:
3207         * UIProcess/ios/WKContentViewInteraction.mm:
3208         (-[WKContentView cleanupInteraction]):
3209         (-[WKContentView _cancelPreviousResetInputViewDeferralRequest]):
3210         (-[WKContentView _scheduleResetInputViewDeferralAfterBecomingFirstResponder]):
3211         (-[WKContentView _resetInputViewDeferral]):
3212         (-[WKContentView becomeFirstResponderForWebView]):
3213         (-[WKContentView resignFirstResponderForWebView]):
3214         (-[WKContentView _commitPotentialTapFailed]):
3215         (-[WKContentView _didNotHandleTapAsClick:]):
3216         (-[WKContentView _didCompleteSyntheticClick]):
3217
3218         Funnel all existing calls that reset _inputViewDeferralToken to nullptr, such that they go through a helper
3219         method instead that also cancels any scheduled requests to clear the token.
3220
3221         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
3222         (WebKit::RemoteLayerTreeDrawingArea::activityStateDidChange):
3223
3224         Respond to all pending callbacks after handling the activity state change.
3225
3226 2019-02-20  Chris Dumez  <cdumez@apple.com>
3227
3228         Regression(PSON) "Reload without content extensions" does not work when the main resource is blocked
3229         https://bugs.webkit.org/show_bug.cgi?id=194872
3230         <rdar://problem/47924500>
3231
3232         Reviewed by Alex Christensen.
3233
3234         [WKWebView _reloadWithoutContentBlockers] relies on a ReloadOption flag that is passed to WebCore
3235         instead of using WebsitePolicies.contentBlockersEnabled flag. If the reload causes a process swap
3236         due to PSON, then the new process does not know about this ReloadOption and fails to honor it.
3237
3238         Since the modern way to do this is WebsitePolicies, and since WebsitePolicies are properly
3239         propagated cross-process in case of process swap, this patch updates _reloadWithoutContentBlockers
3240         to set a flag on the Navigation which we use to later set the WebsitePolicies.contentBlockersEnabled
3241         flag in WebPageProxy::receivedNavigationPolicyDecision().
3242
3243         * UIProcess/API/APINavigation.h:
3244         (API::Navigation::setUserContentExtensionsEnabled):
3245         (API::Navigation::userContentExtensionsEnabled const):
3246         * UIProcess/WebPageProxy.cpp:
3247         (WebKit::WebPageProxy::reload):
3248         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
3249
3250 2019-02-20  Truitt Savell  <tsavell@apple.com>
3251
3252         Unreviewed, rolling out r241817.
3253
3254         Caused 4 API failures
3255
3256         Reverted changeset:
3257
3258         "[GTK] Epiphany searching for plugins even if plugins are
3259         disabled"
3260         https://bugs.webkit.org/show_bug.cgi?id=194352
3261         https://trac.webkit.org/changeset/241817
3262
3263 2019-02-20  Andy Estes  <aestes@apple.com>
3264
3265         [Xcode] Add SDKVariant.xcconfig to various Xcode projects
3266         https://bugs.webkit.org/show_bug.cgi?id=194869
3267
3268         Rubber-stamped by Jer Noble.
3269
3270         * WebKit.xcodeproj/project.pbxproj:
3271
3272 2019-02-20  Alex Christensen  <achristensen@webkit.org>
3273
3274         Resolve WebsiteDataStore/HTTPCookieStore ref cycle
3275         https://bugs.webkit.org/show_bug.cgi?id=194868
3276
3277         Reviewed by Geoffrey Garen.
3278
3279         * UIProcess/API/APIHTTPCookieStore.cpp:
3280         (API::HTTPCookieStore::HTTPCookieStore):
3281         (API::HTTPCookieStore::cookies):
3282         (API::HTTPCookieStore::setCookie):
3283         (API::HTTPCookieStore::deleteCookie):
3284         (API::HTTPCookieStore::registerObserver):
3285         (API::HTTPCookieStore::unregisterObserver):
3286         (API::HTTPCookieStore::cookieManagerDestroyed):
3287         (API::HTTPCookieStore::registerForNewProcessPoolNotifications):
3288         (API::HTTPCookieStore::ref const):
3289         (API::HTTPCookieStore::deref const):
3290         * UIProcess/API/APIHTTPCookieStore.h:
3291
3292 2019-02-20  Per Arne Vollan  <pvollan@apple.com>
3293
3294         [iOS] Open sandbox for specific call.
3295         https://bugs.webkit.org/show_bug.cgi?id=194860
3296         <rdar://problem/48166729>
3297
3298         Reviewed by Brent Fulgham.
3299
3300         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
3301
3302 2019-02-20  Alex Christensen  <achristensen@webkit.org>
3303
3304         Move API::HTTPCookieStore ownership from API::WebsiteDataStore to WebKit::WebsiteDataStore
3305         https://bugs.webkit.org/show_bug.cgi?id=194842
3306
3307         Reviewed by Geoff Garen.
3308
3309         We need a way to get from WebKit::WebsiteDataStore to API::HTTPCookieStore.  It can't be done before this.
3310         This made an existing reference cycle easier to see, and we should fix it in a followup patch.
3311
3312         * UIProcess/API/APIWebsiteDataStore.cpp:
3313         (API::WebsiteDataStore::httpCookieStore):
3314         * UIProcess/API/APIWebsiteDataStore.h:
3315         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3316         (WebKit::WebsiteDataStore::cookieStore):
3317         * UIProcess/WebsiteData/WebsiteDataStore.h:
3318
3319 2019-02-20  Chris Dumez  <cdumez@apple.com>
3320
3321         Regression(PSON) Crash under WebKit::WebPageProxy::decidePolicyForNavigationActionSync
3322         https://bugs.webkit.org/show_bug.cgi?id=194857
3323         <rdar://problem/47759323>
3324
3325         Reviewed by Alex Christensen.
3326
3327         The ProvisionalPageProxy was blindly forwarding the DecidePolicyForNavigationActionSync
3328         synchronous IPC to the WebPageProxy, without passing it the process the IPC came from.
3329         As a result, WebPageProxy::decidePolicyForNavigationActionSync() would try to look up
3330         a WebFrameProxy using the provided frameID from the wrong process and we would end up
3331         hitting a RELEASE_ASSERT().
3332
3333         * UIProcess/ProvisionalPageProxy.cpp:
3334         (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionSync):
3335         (WebKit::ProvisionalPageProxy::didReceiveSyncMessage):
3336         * UIProcess/ProvisionalPageProxy.h:
3337         * UIProcess/WebPageProxy.cpp:
3338         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
3339         (WebKit::WebPageProxy::decidePolicyForNavigationActionSyncShared):
3340         * UIProcess/WebPageProxy.h:
3341
3342 2019-02-20  Don Olmstead  <don.olmstead@sony.com>
3343
3344         [MSVC] Fix compilation errors with lambdas in Service Workers
3345         https://bugs.webkit.org/show_bug.cgi?id=194841
3346
3347         Reviewed by Alex Christensen.
3348
3349         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
3350         (WebKit::ServiceWorkerClientFetch::didReceiveRedirectResponse):
3351
3352 2019-02-20  Carlos Garcia Campos  <cgarcia@igalia.com>
3353
3354         [GTK] Epiphany searching for plugins even if plugins are disabled
3355         https://bugs.webkit.org/show_bug.cgi?id=194352
3356
3357         Reviewed by Michael Catanzaro.
3358
3359         Check pluginsEnabled setting before trying to get plugins from UI process.
3360
3361         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
3362         (WebKit::WebPluginInfoProvider::populatePluginCache):
3363
3364 2019-02-20  Carlos Garcia Campos  <cgarcia@igalia.com>
3365
3366         [WPE] Send client host fd and library name as web process creation parameters
3367         https://bugs.webkit.org/show_bug.cgi?id=194494
3368
3369         Reviewed by Žan Doberšek.