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