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