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