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