-[WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:] doesn't...
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2019-05-02  Per Arne Vollan  <pvollan@apple.com>
2
3         -[WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:] doesn't delete _WKWebsiteDataTypeCredentials
4         https://bugs.webkit.org/show_bug.cgi?id=197510
5         <rdar://problem/50372338>
6
7         Reviewed by Alex Christensen.
8
9         When asked to delete persistent credentials for a set of origins, send a message to the network process with the
10         list of origins. The network process will then delete all persistent credentials from these origins from
11         NSURLCredentialStorage.
12
13         * NetworkProcess/NetworkProcess.cpp:
14         (WebKit::NetworkProcess::removeCredentialsWithOrigins):
15         * NetworkProcess/NetworkProcess.h:
16         * NetworkProcess/NetworkProcess.messages.in:
17         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
18         (WebKit::NetworkProcess::removeCredentialsWithOrigins):
19         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
20         (WebKit::WebsiteDataStore::removeData):
21
22 2019-05-02  Don Olmstead  <don.olmstead@sony.com>
23
24         [CMake] Refactor WEBKIT_MAKE_FORWARDING_HEADERS into WEBKIT_COPY_FILES
25         https://bugs.webkit.org/show_bug.cgi?id=197174
26
27         Reviewed by Alex Christensen.
28
29         Replace WEBKIT_MAKE_FORWARDING_HEADERS with WEBKIT_COPY_FILES and make dependencies
30         for framework headers explicit.
31
32         * CMakeLists.txt:
33         * PlatformWin.cmake:
34
35 2019-05-02  Per Arne Vollan  <pvollan@apple.com>
36
37         [macOS] Fix syscall sandbox violation
38         https://bugs.webkit.org/show_bug.cgi?id=197517
39         <rdar://problem/49945031>
40
41         Reviewed by Brent Fulgham.
42
43         A syscall needs to be added to the sandbox on macOS.
44
45         * WebProcess/com.apple.WebProcess.sb.in:
46
47 2019-05-02  Alex Christensen  <achristensen@webkit.org>
48
49         Safe browsing warning should update colors when a user switches between light and dark appearance
50         https://bugs.webkit.org/show_bug.cgi?id=197443
51         <rdar://problem/49883917>
52
53         Reviewed by Tim Horton.
54
55         We draw the WKSafeBrowsingExclamationPoint ourselves, so we need to call setNeedsDisplay when viewDidChangeEffectiveAppearance is called.
56         Instead of setting NSView.layer.backgroundColor we need to make an NSView subclass I call WKSafeBrowsingBox and we need to set its layer's
57         backgroundColor in updateLayer, otherwise the CGColor isn't updated from the NSColor.
58
59         * UIProcess/Cocoa/WKSafeBrowsingWarning.h:
60         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
61         (colorForItem):
62         (-[WKSafeBrowsingExclamationPoint viewDidChangeEffectiveAppearance]):
63         (-[WKSafeBrowsingBox setSafeBrowsingBackgroundColor:]):
64         (-[WKSafeBrowsingBox updateLayer]):
65         (-[WKSafeBrowsingWarning initWithFrame:safeBrowsingWarning:completionHandler:]):
66         (-[WKSafeBrowsingWarning addContent]):
67         (-[WKSafeBrowsingWarning showDetailsClicked]):
68         (setBackground): Deleted.
69
70 2019-05-02  Frederic Wang  <fwang@igalia.com>
71
72         [GTK][WPE] Disable "thin", "thick", "medium" values of mfrac@linethickness at runtime
73         https://bugs.webkit.org/show_bug.cgi?id=196142
74
75         This patch introduces some experimental runtime flag to let users
76         disable MathML features that are removed from MathML Core [1]. For now,
77         these features are only disabled on GTK and WPE ports.
78
79         [1] https://mathml-refresh.github.io/mathml-core/
80
81         Reviewed by Rob Buis.
82
83         * Shared/WebPreferences.yaml:
84         * Shared/WebPreferencesDefaultValues.h:
85
86 2019-05-01  Wenson Hsieh  <wenson_hsieh@apple.com>
87
88         Add the ability to import WebKitAdditions snippets in WebKit.apinotes
89         https://bugs.webkit.org/show_bug.cgi?id=197487
90         <rdar://problem/50389085>
91
92         Reviewed by Tim Horton.
93
94         * Shared/API/Cocoa/WebKit.apinotes: Import a new WebKitAdditions file.
95
96         * WebKit.xcodeproj/project.pbxproj: Check all files in Headers/ and PrivateHeaders/ that need replacement, not
97         simply anything ending with ".h".
98
99         * mac/replace-webkit-additions-includes.py:
100         (main): Teach the replacement script to handle files in Headers/ or PrivateHeaders/ that don't end in ".h".
101
102 2019-05-01  Alex Christensen  <achristensen@webkit.org>
103
104         Protect against null crash in fetchDiskCacheEntries
105         https://bugs.webkit.org/show_bug.cgi?id=197399
106         <rdar://problem/47759337>
107
108         Reviewed by Antti Koivisto.
109
110         If the call to Entry::decodeStorageRecord returns nullptr in Storage::traverse, do not call the traverseHandler, which expects
111         that when it is called with nullptr that is the end of the traversal.
112
113         * NetworkProcess/cache/NetworkCache.cpp:
114         (WebKit::NetworkCache::Cache::traverse):
115
116 2019-05-01  Wenson Hsieh  <wenson_hsieh@apple.com>
117
118         [iOS] Add a version of viewport shrink-to-fit heuristics that preserves page layout
119         https://bugs.webkit.org/show_bug.cgi?id=197342
120         <rdar://problem/50063091>
121
122         Reviewed by Tim Horton.
123
124         This patch introduces a new shrink-to-fit heuristic that attempts to lay out the contents of the page at a
125         larger width in order to shrink content to fit the viewport. This is similar to existing shrink-to-fit behaviors
126         used for viewport sizing in multitasking mode, except that it not only scales the view, but additionally expands
127         the layout size, such that the overall layout of the page is preserved. In fact, the reason we ended up
128         reverting the existing flavor of shrink-to-fit in all cases except for multitasking was that page layout was not
129         preserved, which caused elements that poke out of the viewport to make the rest of the page look out of
130         proportion — see <rdar://problem/23818102> and related radars.
131
132         Covered by 5 new layout tests, and by adjusting a couple of existing layout tests. See comments below for more
133         details.
134
135         * Platform/Logging.h:
136
137         Add a new ViewportSizing logging channel. This will only log on pages that overflow the viewport and shrink to
138         fit as a result.
139
140         * Shared/WebPreferences.yaml:
141
142         Turn IgnoreViewportScalingConstraints off by default. This preference currently controls whether we allow
143         shrink-to-fit behaviors, and is only used by Safari when it is in multitasking mode. The value of this
144         preference is currenly *on* by default, and is turned off almost immediately during every page load after the
145         first visible content rect update, wherein visibleContentRectUpdateInfo.allowShrinkToFit() is false.
146
147         However, this sometimes causes a brief jitter during page load; to fix this, make the default value for
148         IgnoreViewportScalingConstraints false, and change the logic in WebPage::updateVisibleContentRects to
149         setCanIgnoreScalingConstraints to true if either the IgnoreViewportScalingConstraints preference (not only
150         affected by an internal debug switch) is true, or WKWebView SPI is used to enable the behavior.
151
152         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
153         (WebKit::WebFrameLoaderClient::dispatchDidFinishDocumentLoad):
154         (WebKit::WebFrameLoaderClient::dispatchDidFinishLoad):
155
156         Add a new hook for WebFrameLoaderClient to call into WebPage when document load finishes. Also, tweak
157         dispatchDidFinishLoad to take a WebFrame& instead of a WebFrame* in a drive-by fix (the frame is assumed to be
158         non-null anyways).
159
160         * WebProcess/WebPage/WebPage.cpp:
161         (WebKit::WebPage::didCommitLoad):
162         (WebKit::WebPage::didFinishDocumentLoad):
163         (WebKit::WebPage::didFinishLoad):
164
165         When finishing document load or finishing the overall load, kick off the shrink-to-fit timer; when committing a
166         load, cancel the timer.
167
168         * WebProcess/WebPage/WebPage.h:
169         * WebProcess/WebPage/ios/WebPageIOS.mm:
170         (WebKit::WebPage::setViewportConfigurationViewLayoutSize):
171
172         Don't allow the minimum effective device width from the client to stomp over any minimum effective device width
173         set as a result of the new shrink-to-fit heuristic; on some pages that load quickly, this can result in a race
174         where the minimum effective device width (i.e. a value that lower-bounds the minimum layout width) is first set
175         by the shrink-to-fit heuristic, and then set to an incorrect value by the client.
176
177         In the near future, web view SPI used to set the minimum effective device width should actually be removed
178         altogether, since the new shrink-to-fit heuristic supersedes any need for the client to fiddle with the minimum
179         effective device width.
180
181         (WebKit::WebPage::dynamicViewportSizeUpdate):
182
183         When performing a dynamic viewport size update, additionally re-run the shrink-to-fit heuristic. This allows
184         the minimum layout size of the viewport to be updated, if necessary. An example of where this matters is when a
185         web page is *below* a tablet/desktop layout breakpoint in portrait device orientation, but then exceeds this
186         layout breakpoint in landscape orientation. In this scenario, rotating the device should swap between these two
187         page layouts.
188
189         (WebKit::WebPage::resetViewportDefaultConfiguration):
190         (WebKit::WebPage::scheduleShrinkToFitContent):
191         (WebKit::WebPage::shrinkToFitContentTimerFired):
192         (WebKit::WebPage::immediatelyShrinkToFitContent):
193
194         Leverage the existing capability for a viewport to have a "minimum effective device width" to grant the viewport
195         a larger layout size than it would normally have, and then scale down to fit within the bounds of the view. One
196         challenge with this overall approach is that laying out at a larger width may cause the page to lay out even
197         wider in response, which may actually worsen horizontal scrolling. To mitigate this, we only attempt to lay out
198         at the current content width once; if laying out at this width reduced the amount of horizontal scrolling by any
199         amount, then proceed with this layout width; otherwise, revert to the previous layout width.
200
201         (WebKit::WebPage::shouldIgnoreMetaViewport const):
202
203         Pull some common logic out into a readonly getter.
204
205         (WebKit::WebPage::updateVisibleContentRects):
206
207         See the comment below WebPreferences.yaml, above.
208
209 2019-05-01  Dean Jackson  <dino@apple.com>
210
211         Link Previews that use WKImagePreviewViewController are not always scaled correctly
212         https://bugs.webkit.org/show_bug.cgi?id=197450
213         <rdar://problem/50357695>
214
215         Reviewed by Wenson Hsieh.
216
217         Tell the UIImageView that we create in WKImagePreviewViewController to use
218         a filling scaling method.
219
220         * UIProcess/WKImagePreviewViewController.mm:
221         (-[WKImagePreviewViewController initWithCGImage:defaultActions:elementInfo:]):
222
223 2019-05-01  Darin Adler  <darin@apple.com>
224
225         WebKit has too much of its own UTF-8 code and should rely more on ICU's UTF-8 support
226         https://bugs.webkit.org/show_bug.cgi?id=195535
227
228         Reviewed by Alexey Proskuryakov.
229
230         * Shared/API/APIString.h: Removed uneeded includes and also switched to #pragma once.
231
232         * Shared/API/c/WKString.cpp: Moved include of UTF8Conversion.h here.
233         (WKStringGetUTF8CStringImpl): Updated for changes to return values.
234
235 2019-05-01  Shawn Roberts  <sroberts@apple.com>
236
237         Unreviewed, rolling out r244821.
238
239         Causing
240
241         Reverted changeset:
242
243         "WebKit has too much of its own UTF-8 code and should rely
244         more on ICU's UTF-8 support"
245         https://bugs.webkit.org/show_bug.cgi?id=195535
246         https://trac.webkit.org/changeset/244821
247
248 2019-05-01  Youenn Fablet  <youenn@apple.com>
249
250         Kept alive loaders should use the redirected request in case of redirections
251         https://bugs.webkit.org/show_bug.cgi?id=197337
252
253         Reviewed by Alex Christensen.
254
255         Instead of using the request, the redirected request should be used in case of redirection.
256
257         * NetworkProcess/NetworkResourceLoader.cpp:
258         (WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
259         (WebKit::NetworkResourceLoader::continueWillSendRedirectedRequest):
260
261 2019-04-29  Darin Adler  <darin@apple.com>
262
263         WebKit has too much of its own UTF-8 code and should rely more on ICU's UTF-8 support
264         https://bugs.webkit.org/show_bug.cgi?id=195535
265
266         Reviewed by Alexey Proskuryakov.
267
268         * Shared/API/APIString.h: Removed uneeded includes and also switched to #pragma once.
269
270         * Shared/API/c/WKString.cpp: Moved include of UTF8Conversion.h here.
271         (WKStringGetUTF8CStringImpl): Updated for changes to return values.
272
273 2019-04-30  Chris Dumez  <cdumez@apple.com>
274
275         Regression(PSON) URL scheme handlers can no longer respond asynchronously
276         https://bugs.webkit.org/show_bug.cgi?id=197426
277         <rdar://problem/50256169>
278
279         Reviewed by Brady Eidson.
280
281         The issue was that when committing the provisional process, we would call WebPageProxy::processDidTerminate()
282         which would call WebPageProxy::stopAllURLSchemeTasks(). This would terminate all URL scheme tasks associated
283         with the page, including the one associated with the provisisional page / process.
284
285         To address the issue, pass m_process to stopAllURLSchemeTasks() in processDidTerminate() and only stop the
286         tasks associated with the m_process (which is the process we're about to swap away from).
287
288         * UIProcess/WebPageProxy.cpp:
289         (WebKit::WebPageProxy::processDidTerminate):
290         (WebKit::WebPageProxy::stopAllURLSchemeTasks):
291         * UIProcess/WebPageProxy.h:
292         * UIProcess/WebURLSchemeHandler.cpp:
293         (WebKit::WebURLSchemeHandler::processForTaskIdentifier):
294         (WebKit::WebURLSchemeHandler::stopAllTasksForPage):
295         * UIProcess/WebURLSchemeHandler.h:
296         * UIProcess/WebURLSchemeTask.h:
297         (WebKit::WebURLSchemeTask::process const):
298
299 2019-04-30  John Wilander  <wilander@apple.com>
300
301         Add logging of Ad Click Attribution errors and events to a dedicated channel
302         https://bugs.webkit.org/show_bug.cgi?id=197332
303         <rdar://problem/49918800>
304
305         Reviewed by Youenn Fablet.
306
307         This patch adds an experimental Ad Click Attribution debug mode which
308         logs information. Most changes are just log output in the various
309         functions in WebKit::AdClickAttributionManager.
310
311         The constructor to WebKit::AdClickAttributionManager now takes a
312         PAL::SessionID so that the log functions can make sure they don't
313         output anything in ephemeral sessions.
314
315         WebProcessPool::platformInitializeNetworkProcess() now picks up the
316         debug mode setting from the incoming
317         WebKit::NetworkProcessCreationParameters object.
318
319         NetworkResourceLoader::handleAdClickAttributionConversion() was
320         moved to AdClickAttributionManager::handleConversion() to keep all
321         the logging in one file.
322
323         * NetworkProcess/AdClickAttributionManager.cpp:
324         (WebKit::AdClickAttributionManager::storeUnconverted):
325         (WebKit::AdClickAttributionManager::handleConversion):
326         (WebKit::AdClickAttributionManager::convert):
327         (WebKit::AdClickAttributionManager::fireConversionRequest):
328         (WebKit::AdClickAttributionManager::firePendingConversionRequests):
329         (WebKit::AdClickAttributionManager::clearExpired):
330         (WebKit::AdClickAttributionManager::debugModeEnabled const):
331         * NetworkProcess/AdClickAttributionManager.h:
332         (WebKit::AdClickAttributionManager::AdClickAttributionManager):
333         (WebKit::AdClickAttributionManager::m_sessionID):
334         * NetworkProcess/NetworkProcess.cpp:
335         (WebKit::NetworkProcess::initializeNetworkProcess):
336         * NetworkProcess/NetworkProcessCreationParameters.cpp:
337         (WebKit::NetworkProcessCreationParameters::encode const):
338         (WebKit::NetworkProcessCreationParameters::decode):
339         * NetworkProcess/NetworkProcessCreationParameters.h:
340         * NetworkProcess/NetworkResourceLoader.cpp:
341         (WebKit::NetworkResourceLoader::continueWillSendRedirectedRequest):
342         (WebKit::NetworkResourceLoader::handleAdClickAttributionConversion): Deleted.
343         * NetworkProcess/NetworkSession.cpp:
344         (WebKit::NetworkSession::NetworkSession):
345         (WebKit::NetworkSession::handleAdClickAttributionConversion):
346         (WebKit::NetworkSession::convertAdClickAttribution): Deleted.
347         * NetworkProcess/NetworkSession.h:
348         * Platform/Logging.h:
349         * Shared/WebPreferences.yaml:
350         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
351         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
352
353 2019-04-30  Devin Rousso  <drousso@apple.com>
354
355         Crash when running test wpt/tests/element_click/bubbling.py::test_element_disappears_during_click
356         https://bugs.webkit.org/show_bug.cgi?id=197361
357         <rdar://problem/49861407>
358
359         Reviewed by Brian Burg.
360
361         Don't assume that all elements have client rects (e.g. `getClientRects`). If the container
362         element isn't visible, then the child won't be either.
363
364         * UIProcess/Automation/SimulatedInputDispatcher.cpp:
365         (WebKit::SimulatedInputDispatcher::resolveLocation):
366         (WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
367         * UIProcess/Automation/WebAutomationSession.cpp:
368         (WebKit::WebAutomationSession::viewportInViewCenterPointOfElement):
369
370 2019-04-30  Chris Dumez  <cdumez@apple.com>
371
372         Unreviewed, rolling out r244802.
373
374         Caused an API test failure
375
376         Reverted changeset:
377
378         "Regression(PSON) URL scheme handlers can no longer respond
379         asynchronously"
380         https://bugs.webkit.org/show_bug.cgi?id=197426
381         https://trac.webkit.org/changeset/244802
382
383 2019-04-30  Chris Dumez  <cdumez@apple.com>
384
385         Regression(PSON) URL scheme handlers can no longer respond asynchronously
386         https://bugs.webkit.org/show_bug.cgi?id=197426
387         <rdar://problem/50256169>
388
389         Reviewed by Brady Eidson.
390
391         The issue was that when committing the provisional process, we would call WebPageProxy::processDidTerminate()
392         which would call WebPageProxy::stopAllURLSchemeTasks(). This would terminate all URL scheme tasks associated
393         with the page, including the one associated with the provisisional page / process.
394
395         To address the issue, pass m_process to stopAllURLSchemeTasks() in processDidTerminate() and only stop the
396         tasks associated with the m_process (which is the process we're about to swap away from).
397
398         * UIProcess/WebPageProxy.cpp:
399         (WebKit::WebPageProxy::processDidTerminate):
400         (WebKit::WebPageProxy::stopAllURLSchemeTasks):
401         * UIProcess/WebPageProxy.h:
402         * UIProcess/WebURLSchemeHandler.cpp:
403         (WebKit::WebURLSchemeHandler::processForTaskIdentifier):
404         (WebKit::WebURLSchemeHandler::stopAllTasksForPage):
405         * UIProcess/WebURLSchemeHandler.h:
406         * UIProcess/WebURLSchemeTask.h:
407         (WebKit::WebURLSchemeTask::process const):
408
409 2019-04-30  Chris Dumez  <cdumez@apple.com>
410
411         Only use a related page's process if that page has not been closed yet
412         https://bugs.webkit.org/show_bug.cgi?id=197393
413         <rdar://problem/50302423>
414
415         Reviewed by Tim Horton.
416
417         We should not attempt to use a related page's process if that related page has already been closed.
418         Once closed, a page's process is invalid and trying to launch a new process for the closed page
419         leads to crashes such as the one in the radar.
420
421         * UIProcess/WebPageProxy.cpp:
422         (WebKit::WebPageProxy::launchProcess):
423         * UIProcess/WebProcessPool.cpp:
424         (WebKit::WebProcessPool::createWebPage):
425
426 2019-04-30  Tim Horton  <timothy_horton@apple.com>
427
428         Long-standing rare crash under -[WKWebView _web_immediateActionAnimationControllerForHitTestResultInternal...]
429         https://bugs.webkit.org/show_bug.cgi?id=197404
430         <rdar://problem/24589331>
431
432         Reviewed by Wenson Hsieh.
433
434         * UIProcess/mac/WKImmediateActionController.mm:
435         (-[WKImmediateActionController _updateImmediateActionItem]):
436         (-[WKImmediateActionController menuItem:previewItemAtPoint:]):
437         (-[WKImmediateActionController menuItem:itemFrameForPoint:]):
438         (-[WKImmediateActionController _animationControllerForDataDetectedLink]):
439         Add some null checks; _webHitTestResult can be null if we (somehow) get
440         an immediate action gesture without having previously gotten a
441         mouseDidMoveOverElement from the Web Content process. Cover all our bases.
442
443 2019-04-30  Per Arne Vollan  <pvollan@apple.com>
444
445         [iOS] Fix crash caused by sandbox violation
446         https://bugs.webkit.org/show_bug.cgi?id=197416
447         <rdar://problem/50266257>
448
449         Reviewed by Brent Fulgham.
450
451         Add syscall to the iOS sandbox.
452
453         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
454
455 2019-04-30  Zalan Bujtas  <zalan@apple.com>
456
457         [iOS] Double-tapping a post to like doesn't work on Instagram.com (needs 'dblclick' event)
458         https://bugs.webkit.org/show_bug.cgi?id=197347
459         <rdar://problem/49393423>
460
461         Reviewed by Wenson Hsieh.
462
463         This patch adds support for dispatching dblclick event as the result of the double tap gesture.
464
465         1. The new double tap gesture recognizer always fires regardless of what type of action the other, existing double gesture recognizers (double-tap to zoom) trigger.
466         2. The dblclick event is dispatched on the node with registered dblclick event handler unless the node prohibits double tap gesture (touch-action != auto).
467
468         * UIProcess/WebPageProxy.h:
469         * UIProcess/ios/WKContentViewInteraction.h:
470         * UIProcess/ios/WKContentViewInteraction.mm:
471         (-[WKContentView setupInteraction]):
472         (-[WKContentView cleanupInteraction]):
473         (-[WKContentView _removeDefaultGestureRecognizers]):
474         (-[WKContentView _addDefaultGestureRecognizers]):
475         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
476         (-[WKContentView gestureRecognizerShouldBegin:]):
477         (-[WKContentView _doubleTapRecognizedForDoubleClick:]):
478         * UIProcess/ios/WebPageProxyIOS.mm:
479         (WebKit::WebPageProxy::handleDoubleTapForDoubleClickAtPoint):
480         * WebProcess/WebPage/WebPage.h:
481         * WebProcess/WebPage/WebPage.messages.in:
482         * WebProcess/WebPage/ios/WebPageIOS.mm:
483         (WebKit::WebPage::handleDoubleTapForDoubleClickAtPoint):
484
485 2019-04-30  Antti Koivisto  <antti@apple.com>
486
487         Tighten type of ScrollingTree:rootNode() to ScrollingTreeFrameScrollingNode
488         https://bugs.webkit.org/show_bug.cgi?id=197414
489
490         Reviewed by Frédéric Wang.
491
492         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
493
494 2019-04-30  Carlos Garcia Campos  <cgarcia@igalia.com>
495
496         REGRESSION(r244750): [GTK][WPE] Network process is crashing in all layout tests
497         https://bugs.webkit.org/show_bug.cgi?id=197406
498
499         Reviewed by Žan Doberšek.
500
501         Do not trasnfer ownership of cachePath to traverseDirectory() lambda, since it's passed also as first argument
502         and it can be passed as a reference.
503
504         * NetworkProcess/cache/NetworkCacheStorage.cpp:
505         (WebKit::NetworkCache::Storage::deleteOldVersions):
506
507 2019-04-29  Truitt Savell  <tsavell@apple.com>
508
509         Unreviewed, rolling out r244755.
510
511         Casued several test failures on iOS
512
513         Reverted changeset:
514
515         "Double-tapping a post to like doesn't work on Instagram.com
516         (needs 'dblclick' event)"
517         https://bugs.webkit.org/show_bug.cgi?id=197347
518         https://trac.webkit.org/changeset/244755
519
520 2019-04-29  Chris Dumez  <cdumez@apple.com>
521
522         [iOS] The UIProcess may get killed for trying to stay runnable in the background for more than 30 seconds
523         https://bugs.webkit.org/show_bug.cgi?id=197385
524         <rdar://problem/50001505>
525
526         Reviewed by Geoffrey Garen.
527
528         If the UIProcess holds a background assertion for itself for 30 seconds, the assertion's invalidation handler
529         will get called and it is our responsibility to release this assertion or the UIProcess will get killed by the
530         system. The logic in ProcessAssertion would normally do that but it would also happily try and re-take another
531         background process assertion shortly after the previous one expired (and before the UIProcess got suspended).
532         When doing so, the new background assertion would expire right away and we would get killed without its
533         invalidation handler getting called.
534
535         To address the issue, the logic in ProcessAssertion will now prevent taking a new background assertion after
536         one expires and until the application becomes foreground again.
537
538         * UIProcess/ios/ProcessAssertionIOS.mm:
539         (-[WKProcessAssertionBackgroundTaskManager init]):
540         (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):
541
542 2019-04-29  Alex Christensen  <achristensen@webkit.org>
543
544         <rdar://problem/50299396> Fix internal High Sierra build
545         https://bugs.webkit.org/show_bug.cgi?id=197388
546
547         * Configurations/Base.xcconfig:
548
549 2019-04-29  Zalan Bujtas  <zalan@apple.com>
550
551         [iOS] Double-tapping a post to like doesn't work on Instagram.com (needs 'dblclick' event)
552         https://bugs.webkit.org/show_bug.cgi?id=197347
553         <rdar://problem/49393423>
554
555         Reviewed by Wenson Hsieh.
556
557         This patch adds support for dispatching dblclick event as the result of the double tap gesture.
558
559         1. The new double tap gesture recognizer always fires regardless of what type of action the other, existing double gesture recognizers (double-tap to zoom) trigger.
560         2. The dblclick event is dispatched on the node with registered dblclick event handler unless the node prohibits double tap gesture (touch-action != auto).
561
562         * UIProcess/WebPageProxy.h:
563         * UIProcess/ios/WKContentViewInteraction.h:
564         * UIProcess/ios/WKContentViewInteraction.mm:
565         (-[WKContentView setupInteraction]):
566         (-[WKContentView cleanupInteraction]):
567         (-[WKContentView _removeDefaultGestureRecognizers]):
568         (-[WKContentView _addDefaultGestureRecognizers]):
569         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
570         (-[WKContentView gestureRecognizerShouldBegin:]):
571         (-[WKContentView _doubleTapRecognizedForDoubleClick:]):
572         * UIProcess/ios/WebPageProxyIOS.mm:
573         (WebKit::WebPageProxy::handleDoubleTapForDoubleClickAtPoint):
574         * WebProcess/WebPage/WebPage.h:
575         * WebProcess/WebPage/WebPage.messages.in:
576         * WebProcess/WebPage/ios/WebPageIOS.mm:
577         (WebKit::WebPage::handleDoubleTapForDoubleClickAtPoint):
578
579 2019-04-29  Tim Horton  <timothy_horton@apple.com>
580
581         REGRESSION (r244142): Fandango accounts tab crashes under Color()
582         https://bugs.webkit.org/show_bug.cgi?id=197380
583         <rdar://problem/50186175>
584
585         Reviewed by Megan Gardner.
586
587         * UIProcess/API/Cocoa/WKWebView.mm:
588         (baseScrollViewBackgroundColor):
589         We now call -_updateScrollViewBackground from -setBackgroundColor:.
590         -setBackgroundColor: can be called from -[UIView initWithCoder:]; if it
591         is, WKWebView's _page is not yet initialized, so we crash. Return an invalid color.
592         Then, the caller falls back to WKContentView's backgroundColor. But WKContentView
593         isn't initialized yet either. So add a further fallback.
594
595 2019-04-29  Dean Jackson  <dino@apple.com>
596
597         Add InteractionIsHappening to SuppressSelectionAssistantReason
598         https://bugs.webkit.org/show_bug.cgi?id=197375
599         <rdar://problem/50304986>
600
601         Reviewed by Megan Gardner.
602
603         Add a new reason for suppressing the selection assistant, to
604         be used in a follow-up patch.
605
606         * UIProcess/ios/WKContentViewInteraction.h: Add InteractionIsHappening.
607
608 2019-04-29  Alex Christensen  <achristensen@webkit.org>
609
610         Storage::deleteOldVersions does not need to retain Storage
611         https://bugs.webkit.org/show_bug.cgi?id=197336
612         <rdar://problem/48679972>
613
614         Reviewed by Darin Adler.
615
616         * NetworkProcess/cache/NetworkCacheStorage.cpp:
617         (WebKit::NetworkCache::Storage::deleteOldVersions):
618         Something is wrong with the lifetime of Storage, but we only need a String, not the whole Storage.
619
620 2019-04-29  Brent Fulgham  <bfulgham@apple.com>
621
622         [Cocoa] Move common sandbox files from Shared/mac to Shared/Cocoa
623         https://bugs.webkit.org/show_bug.cgi?id=197376
624         <rdar://problem/50305272>
625
626         Reviewed by Dean Jackson.
627
628         The Apple sandboxing logic currently lives in the inappropriate 'Shared/mac' directory. This is
629         confusing because the code is used by all Apple ports, not just macOS.
630
631         This patch just moves the relevant files from 'Shared/mac' to 'Shared/Cocoa' to avoid this confusion.
632
633         * Shared/Cocoa/SandboxExtensionCocoa.mm: Renamed from Source/WebKit/Shared/mac/SandboxExtensionMac.mm.
634         * Shared/Cocoa/SandboxInitialiationParametersCocoa.mm: Renamed from Source/WebKit/Shared/mac/SandboxInitialiationParametersMac.mm.
635         * Shared/Cocoa/SandboxUtilities.h: Renamed from Source/WebKit/Shared/mac/SandboxUtilities.h.
636         * Shared/Cocoa/SandboxUtilities.mm: Renamed from Source/WebKit/Shared/mac/SandboxUtilities.mm.
637         * SourcesCocoa.txt:
638         * WebKit.xcodeproj/project.pbxproj:
639
640 2019-04-29  Alexander Mikhaylenko  <exalm7659@gmail.com>
641
642         [GTK] Back/forward gesture snapshot always times out
643         https://bugs.webkit.org/show_bug.cgi?id=197233
644
645         Reviewed by Michael Catanzaro.
646
647         Delaying web process launch caused a regression where we create ViewGestureController when the
648         web process doesn't yet exist. The controller immediately tries to connect to it and fails,
649         and because of that never receives DidHitRenderTreeSizeThreshold() message, so navigation
650         snapshot always stays until timeout after performing the gesture.
651
652         To prevent this, create the controller in webkitWebViewBaseDidRelaunchWebProcess() instead of
653         webkitWebViewBaseCreateWebPage(). Additionally, since settings are now created earlier than
654         ViewGestureController, store the value of whether swipe gesture is enabled in WebKitWebViewBase
655         and immediately apply it when creating the controller.
656
657         Since there is now a point where controller is null, make webkitWebViewBaseViewGestureController()
658         return null and add null checks everywhere.
659
660         * UIProcess/API/glib/WebKitWebView.cpp:
661         (enableBackForwardNavigationGesturesChanged):
662         Move the logic into webkitWebViewBaseSetEnableBackForwardNavigationGesture().
663         * UIProcess/API/gtk/PageClientImpl.cpp:
664         (WebKit::PageClientImpl::wheelEventWasNotHandledByWebCore): Add a null check.
665         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
666         (webkitWebViewBaseDraw): Ditto.
667         (webkitWebViewBaseScrollEvent): Ditto.
668         (webkitWebViewBaseSetEnableBackForwardNavigationGesture): Added. In addition to what was in
669         WebKitWebViewBase::enableBackForwardNavigationGesturesChanged(), store the value in a field
670         for the case ViewGestureController doesn't exist yet.
671         (webkitWebViewBaseViewGestureController): Return a pointer instead of reference.
672         (webkitWebViewBaseCreateWebPage): Stop creating ViewGestureController.
673         (webkitWebViewBaseDidRelaunchWebProcess): Move creating ViewGestureController here. Also
674         immediately call setSwipeGestureEnabled() with the stored value.
675         (webkitWebViewBaseDidStartProvisionalLoadForMainFrame): Add a null check.
676         (webkitWebViewBaseDidFirstVisuallyNonEmptyLayoutForMainFrame):Ditto.
677         (webkitWebViewBaseDidFinishLoadForMainFrame): Ditto.
678         (webkitWebViewBaseDidFailLoadForMainFrame): Ditto.
679         (webkitWebViewBaseDidSameDocumentNavigationForMainFrame): Ditto.
680         (webkitWebViewBaseDidRestoreScrollPosition): Ditto.
681         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
682
683 2019-04-29  Chris Dumez  <cdumez@apple.com>
684
685         User-facing strings should use curly quotes instead of straight
686         https://bugs.webkit.org/show_bug.cgi?id=197370
687
688         Reviewed by Geoffrey Garen.
689
690         Update localizable alert text that was recently added to use curly quotes instead of
691         straight ones, as per our guidelines.
692
693         * UIProcess/Cocoa/WKOrientationAccessAlert.mm:
694         (WebKit::presentOrientationAccessAlert):
695         * UIProcess/Cocoa/WKStorageAccessAlert.mm:
696         (WebKit::presentStorageAccessAlert):
697
698 2019-04-29  Alex Christensen  <achristensen@webkit.org>
699
700         Build fix.
701
702         * UIProcess/ios/WKActionSheet.mm:
703         (-[WKActionSheet updateSheetPosition]):
704
705 2019-04-29  Commit Queue  <commit-queue@webkit.org>
706
707         Unreviewed, rolling out r244648.
708         https://bugs.webkit.org/show_bug.cgi?id=197363
709
710          Lots of tests  are crashing (Requested by KaL on #webkit).
711
712         Reverted changeset:
713
714         "[GTK] Back/forward gesture snapshot always times out"
715         https://bugs.webkit.org/show_bug.cgi?id=197233
716         https://trac.webkit.org/changeset/244648
717
718 2019-04-29  Michael Catanzaro  <mcatanzaro@igalia.com>
719
720         [WPE][GTK] window-object-cleared documentation should reference webkit_frame_get_js_context_for_script_world()
721         https://bugs.webkit.org/show_bug.cgi?id=197357
722
723         Reviewed by Carlos Garcia Campos.
724
725         We should recommend using the non-deprecated replacement for
726         webkit_frame_get_javascript_context_for_script_world().
727
728         * WebProcess/InjectedBundle/API/glib/WebKitScriptWorld.cpp:
729
730 2019-04-27  Chris Dumez  <cdumez@apple.com>
731
732         Improve safety of MachMessage class
733         https://bugs.webkit.org/show_bug.cgi?id=197323
734         <rdar://problem/44291920>
735
736         Reviewed by Darin Adler.
737
738         Improve safety of MachMessage class and clean things up a bit.
739
740         * Platform/IPC/mac/ConnectionMac.mm:
741         (IPC::Connection::sendOutgoingMessage):
742         - Pass MessageReceiverName / MessageName when constructing the MachMessage rather
743           than setting them afterwards since they never change for a given MachMessage.
744         - Set header->msgh_id to the right value right away instead of setting it first
745           to inlineBodyMessageID and then later fixing it to be outOfLineBodyMessageID
746           when the body is out of line.
747         - When messageBodyIsOOL was true, we would call getDescriptorAndSkip() which
748           would advance the pointer by sizeof(mach_msg_port_descriptor_t), even though
749           the descriptor type is mach_msg_ool_descriptor_t. This would not matter in
750           the end because we would not use the messageData pointer after this but
751           still.
752
753         * Platform/IPC/mac/MachMessage.cpp:
754         (IPC::MachMessage::create):
755         Use fastZeroedMalloc() instead of fastMalloc() for safety, given that this class
756         has a mach_msg_header_t flexible array member. This is what is recommended by the
757         mach documentation. It is much safer because it otherwize relies on the user
758         (Connection::sendOutgoingMessage()) to initialize ALL the message members
759         correctly. I suspect this was the cause of <rdar://problem/44291920> because
760         Connection::sendOutgoingMessage() would fail to initialize header->msgh_voucher_port
761         and the MachMessage destructor would then call mach_msg_destroy(header()), which
762         would mach_msg_destroy_port(header->msgh_voucher_port).
763
764         (IPC::MachMessage::MachMessage):
765         Pass MessageReceiverName / MessageName when constructing the MachMessage rather
766         than setting them afterwards since they never change for a given MachMessage.
767
768         (IPC::MachMessage::messageSize):
769         Drop if checks for portDescriptorCount and memoryDescriptorCount since the logic
770         will do the right thing even if they are 0.
771
772         * Platform/IPC/mac/MachMessage.h:
773         (IPC::MachMessage::header):
774         (IPC::MachMessage::messageReceiverName const):
775         (IPC::MachMessage::messageName const):
776
777 2019-04-26  Wenson Hsieh  <wenson_hsieh@apple.com>
778
779         Rename m_LayerTreeFreezeReasons to m_layerTreeFreezeReasons
780         https://bugs.webkit.org/show_bug.cgi?id=197343
781
782         Reviewed by Antti Koivisto.
783
784         No change in behavior.
785
786         * WebProcess/WebPage/WebPage.cpp:
787         (WebKit::WebPage::freezeLayerTree):
788         (WebKit::WebPage::unfreezeLayerTree):
789         (WebKit::WebPage::updateDrawingAreaLayerTreeFreezeState):
790         * WebProcess/WebPage/WebPage.h:
791
792 2019-04-26  Keith Rollin  <krollin@apple.com>
793
794         Enable new build rule for post-processing headers when using XCBuild
795         https://bugs.webkit.org/show_bug.cgi?id=197340
796         <rdar://problem/50226685>
797
798         Reviewed by Brent Fulgham.
799
800         In Bug 197116, we conditionally disabled the old method for
801         post-processing header files when we are using the new XCBuild build
802         system. This check-in conditionally enables the new post-processing
803         facility. Note that the old system is disabled and the new system
804         enabled only when the USE_NEW_BUILD_SYSTEM environment variable is set
805         to YES.
806
807         * Configurations/WebKit.xcconfig:
808
809 2019-04-26  Jessie Berlin  <jberlin@webkit.org>
810
811         Add new mac target numbers
812         https://bugs.webkit.org/show_bug.cgi?id=197313
813
814         Reviewed by Alex Christensen.
815
816         * Configurations/Version.xcconfig:
817         * Configurations/WebKitTargetConditionals.xcconfig:
818
819 2019-04-26  Youenn Fablet  <youenn@apple.com>
820
821         Use kDNSServiceFlagsKnownUnique to speed up mdns name registration for ICE candidates
822         https://bugs.webkit.org/show_bug.cgi?id=197328
823
824         Reviewed by Eric Carlson.
825
826         This allows skipping the probing step of MDNS name registration.
827         We can do that as registered names are random UUIDs.
828
829         * NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
830         (WebKit::NetworkMDNSRegister::registerMDNSName):
831
832 2019-04-26  Chris Dumez  <cdumez@apple.com>
833
834         [iOS] Our process assertion should not allow idle sleep
835         https://bugs.webkit.org/show_bug.cgi?id=197317
836         <rdar://problem/50137740>
837
838         Reviewed by Geoffrey Garen.
839
840         Our process assertion should not allow idle sleep. This is bad for power because the device
841         may switch between sleep and awake state frequently, as it get woken up by network packages.
842
843         * UIProcess/ios/ProcessAssertionIOS.mm:
844
845 2019-04-26  Eric Carlson  <eric.carlson@apple.com>
846
847         Create AVFoundationSoftLink.{h,mm} to reduce duplicate code
848         https://bugs.webkit.org/show_bug.cgi?id=197171
849         <rdar://problem/47454979>
850
851         Reviewed by Youenn Fablet.
852
853         * Shared/ios/WebIconUtilities.mm:
854         (WebKit::iconForVideoFile):
855         * Shared/mac/WebCoreArgumentCodersMac.mm:
856         (IPC::ArgumentCoder<WebCore::MediaPlaybackTargetContext>::encodePlatformData):
857         (IPC::ArgumentCoder<WebCore::MediaPlaybackTargetContext>::decodePlatformData):
858         * UIProcess/Cocoa/UIDelegate.mm:
859         (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
860         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm:
861         (WebKit::PlatformCALayerRemoteCustom::clone const):
862
863 2019-04-26  Commit Queue  <commit-queue@webkit.org>
864
865         Unreviewed, rolling out r244683.
866         https://bugs.webkit.org/show_bug.cgi?id=197320
867
868         Causing crash on iOS Simulator and EWS failures (Requested by
869         sroberts on #webkit).
870
871         Reverted changeset:
872
873         "[iOS] Add internal setting to force -webkit-text-size-adjust
874         to "auto""
875         https://bugs.webkit.org/show_bug.cgi?id=197275
876         https://trac.webkit.org/changeset/244683
877
878 2019-04-26  Youenn Fablet  <youenn@apple.com>
879
880         Use normal loading path for ping loads
881         https://bugs.webkit.org/show_bug.cgi?id=196807
882
883         Reviewed by Alex Christensen.
884
885         In case a NetworkResourceLoader has the keepAlive option we do the following:
886         - Always use NetworkLoadChecker as we might need it to do checks after the Web context is gone.
887         - In case of aborting a KeepAlive loader, remove it from NetworkConnectionToWebProcess map
888         and add it to a kept-alive NetworkSession load set. The loader is only kept alive if it
889         has not yet received a response. Mark the loader as kept-alive.
890         - In case loader is kept-alive, cancel the load as soon as a response is gathered.
891
892         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
893         (WebKit::NetworkConnectionToWebProcess::transferKeptAliveLoad):
894         * NetworkProcess/NetworkConnectionToWebProcess.h:
895         * NetworkProcess/NetworkProcess.cpp:
896         (WebKit::NetworkProcess::addKeptAliveLoad):
897         (WebKit::NetworkProcess::removeKeptAliveLoad):
898         * NetworkProcess/NetworkProcess.h:
899         * NetworkProcess/NetworkResourceLoadMap.cpp:
900         (WebKit::NetworkResourceLoadMap::remove):
901         (WebKit::NetworkResourceLoadMap::take):
902         * NetworkProcess/NetworkResourceLoadMap.h:
903         * NetworkProcess/NetworkResourceLoader.cpp:
904         (WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
905         (WebKit::NetworkResourceLoader::cleanup):
906         (WebKit::NetworkResourceLoader::abort):
907         (WebKit::NetworkResourceLoader::didReceiveResponse):
908         (WebKit::NetworkResourceLoader::continueWillSendRedirectedRequest):
909         * NetworkProcess/NetworkResourceLoader.h:
910         * WebProcess/Network/WebLoaderStrategy.cpp:
911         (WebKit::maximumBufferingTime):
912         (WebKit::WebLoaderStrategy::usePingLoad const):
913         * WebProcess/Network/WebLoaderStrategy.h:
914
915 2019-04-26  Alex Christensen  <achristensen@webkit.org>
916
917         Fix internal High Sierra build after r244653
918         https://bugs.webkit.org/show_bug.cgi?id=197131
919
920         * DerivedSources.make:
921         -std=gnu++17 didn't exist yet.  -std=gnu++1z did.
922
923 2019-04-26  Alex Christensen  <achristensen@webkit.org>
924
925         Fix an internal High Sierra build after r244653
926        ​https://bugs.webkit.org/show_bug.cgi?id=197131
927
928         * DerivedSources.make:
929         Apparently we can't use gnu++17 when preprocessing Platform.h in the makefile.
930
931 2019-04-26  Sihui Liu  <sihui_liu@apple.com>
932
933         Stop IDB transactions to release locked database files when network process is ready to suspend
934         https://bugs.webkit.org/show_bug.cgi?id=196372
935         <rdar://problem/48930116>
936
937         Reviewed by Brady Eidson.
938
939         * NetworkProcess/NetworkProcess.cpp:
940         (WebKit::NetworkProcess::processWillSuspendImminently):
941         (WebKit::NetworkProcess::prepareToSuspend):
942         (WebKit::NetworkProcess::resume):
943
944 2019-04-25  Myles C. Maxfield  <mmaxfield@apple.com>
945
946         [iOS] Add internal setting to force -webkit-text-size-adjust to "auto"
947         https://bugs.webkit.org/show_bug.cgi?id=197275
948         <rdar://problem/50211019>
949
950         Reviewed by Simon Fraser.
951
952         * Shared/WebPreferences.yaml:
953         * UIProcess/WebPreferences.h:
954
955 2019-04-25  Myles C. Maxfield  <mmaxfield@apple.com>
956
957         [iOS] Implement idempotent mode for text autosizing
958         https://bugs.webkit.org/show_bug.cgi?id=197250
959         <rdar://problem/50211034>
960
961         Reviewed by Jon Lee.
962
963         Push the initial scale down into the page.
964
965         * WebProcess/WebPage/ios/WebPageIOS.mm:
966         (WebKit::WebPage::dynamicViewportSizeUpdate):
967         (WebKit::WebPage::viewportConfigurationChanged):
968
969 2019-04-25  Alex Christensen  <achristensen@webkit.org>
970
971         Make NetworkCache blobs safe for mmap instead of not using blobs
972         https://bugs.webkit.org/show_bug.cgi?id=197264
973         <rdar://problem/49564348>
974
975         Reviewed by Antti Koivisto.
976
977         This does what r244597 did for WKContentRuleLists but for the NetworkCache's blobs.
978         Those are the two cases where we were calling mmap and seeing crashes in apps with
979         default file protection of NSFileProtectionComplete.
980
981         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
982         (WebKit::NetworkCache::BlobStorage::add):
983         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
984         (WebKit::NetworkCache::isSafeToUseMemoryMapForPath): Deleted.
985         * NetworkProcess/cache/NetworkCacheFileSystem.h:
986         * NetworkProcess/cache/NetworkCacheFileSystemCocoa.mm:
987         (WebKit::NetworkCache::isSafeToUseMemoryMapForPath):
988         * NetworkProcess/cache/NetworkCacheStorage.cpp:
989         (WebKit::NetworkCache::Storage::Storage):
990         (WebKit::NetworkCache::Storage::synchronize):
991         (WebKit::NetworkCache::Storage::mayContainBlob const):
992         (WebKit::NetworkCache::Storage::shouldStoreBodyAsBlob):
993         (WebKit::NetworkCache::estimateRecordsSize): Deleted.
994         * NetworkProcess/cache/NetworkCacheStorage.h:
995
996 2019-04-25  Simon Fraser  <simon.fraser@apple.com>
997
998         REGRESSION (r234330): 3 legacy-animation-engine/compositing tests are flaky failures
999         https://bugs.webkit.org/show_bug.cgi?id=188357
1000         <rdar://problem/42986633>
1001
1002         Reviewed by Dean Jackson.
1003         
1004         DumpRenderTree had no code that set page.setCompositingPolicyOverride() to Normal, so some
1005         tests would fall into low memory mode and have different behavior.
1006         
1007         Fix by moving the code that calls setCompositingPolicyOverride(Normal) from the WK2 layer
1008         to Internals, so it's shared by DRT and WTR.
1009         
1010         We no longer need the WK2 C SPI glue.
1011
1012         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1013         (WKBundlePageSetEventThrottlingBehaviorOverride):
1014         (WKBundlePageSetCompositingPolicyOverride): Deleted.
1015         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
1016
1017 2019-04-25  Chris Dumez  <cdumez@apple.com>
1018
1019         Trying to load a main resource outside the sandbox should not crash the WebContent process
1020         https://bugs.webkit.org/show_bug.cgi?id=197299
1021         <rdar://problem/49808042>
1022
1023         Reviewed by Geoffrey Garen.
1024
1025         Trying to load a main resource outside the sandbox should not crash the WebContent process. We should
1026         simply ignore the load and log an error message.
1027
1028         * UIProcess/WebPageProxy.cpp:
1029         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1030
1031 2019-04-25  Timothy Hatcher  <timothy@apple.com>
1032
1033         Only send a synthetic mouse out event if synthetic mouse move events were sent.
1034         https://bugs.webkit.org/show_bug.cgi?id=197295
1035         rdar://problem/49040233
1036
1037         Reviewed by Zalan Bujtas.
1038
1039         * WebProcess/WebPage/ios/WebPageIOS.mm:
1040         (WebKit::WebPage::completeSyntheticClick):
1041
1042 2019-04-25  Timothy Hatcher  <timothy@apple.com>
1043
1044         Disable date and time inputs on iOSMac.
1045         https://bugs.webkit.org/show_bug.cgi?id=197287
1046         rdar://problem/46794376
1047
1048         Reviewed by Wenson Hsieh.
1049
1050         * Configurations/FeatureDefines.xcconfig:
1051
1052 2019-04-25  Brady Eidson  <beidson@apple.com>
1053
1054         REGRESSION (243388): WebProcess::shouldFreezeOnSuspension() decision is flipped
1055         <rdar://problem/49755494> and https://bugs.webkit.org/show_bug.cgi?id=197284
1056
1057         Reviewed by Chris Dumez.
1058
1059         * WebProcess/cocoa/WebProcessCocoa.mm:
1060         (WebKit::WebProcess::shouldFreezeOnSuspension const): If any non-suspended pages are in the process it should
1061           be eligible. Only if all pages are suspended should it be jetsam-able.
1062
1063 2019-04-25  Alex Christensen  <achristensen@webkit.org>
1064
1065         Start using C++17
1066         https://bugs.webkit.org/show_bug.cgi?id=197131
1067
1068         Reviewed by Darin Adler.
1069
1070         * Configurations/Base.xcconfig:
1071         * DerivedSources.make:
1072
1073 2019-04-25  Alexander Mikhaylenko  <exalm7659@gmail.com>
1074
1075         [GTK] Back/Forward gesture interferes with scrolling
1076         https://bugs.webkit.org/show_bug.cgi?id=197168
1077
1078         Reviewed by Michael Catanzaro.
1079
1080         When the gesture is released with 0 velocity close to an edge of the webview,
1081         the finishing animation is way too long, and in some cases it can look like the
1082         gesture is already over, when it's still animating. By scrolling vertically while
1083         that happens, it's possible to reset animation over and over again.
1084
1085         To reduce the duration in this case, instead of using maximum possible duration
1086         (400ms), introduce a base velocity and use it for calculating the duration if
1087         the actual velocity, relative to the end point, is equal to or less than 0.
1088
1089         * UIProcess/gtk/ViewGestureControllerGtk.cpp:
1090         (WebKit::ViewGestureController::SwipeProgressTracker::startAnimation):
1091
1092 2019-04-25  Alexander Mikhaylenko  <exalm7659@gmail.com>
1093
1094         [GTK] Back/forward gesture snapshot always times out
1095         https://bugs.webkit.org/show_bug.cgi?id=197233
1096
1097         Reviewed by Michael Catanzaro.
1098
1099         Delaying web process launch caused a regression where we create ViewGestureController when the
1100         web process doesn't yet exist. The controller immediately tries to connect to it and fails,
1101         and because of that never receives DidHitRenderTreeSizeThreshold() message, so navigation
1102         snapshot always stays until timeout after performing the gesture.
1103
1104         To prevent this, create the controller in webkitWebViewBaseDidRelaunchWebProcess() instead of
1105         webkitWebViewBaseCreateWebPage(). Additionally, since settings are now created earlier than
1106         ViewGestureController, store the value of whether swipe gesture is enabled in WebKitWebViewBase
1107         and immediately apply it when creating the controller.
1108
1109         * UIProcess/API/glib/WebKitWebView.cpp:
1110         (enableBackForwardNavigationGesturesChanged):
1111         Move the logic into webkitWebViewBaseSetEnableBackForwardNavigationGesture().
1112         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1113         (webkitWebViewBaseSetEnableBackForwardNavigationGesture): Added. In addition to what was in
1114         WebKitWebViewBase::enableBackForwardNavigationGesturesChanged(), store the value in a field
1115         for the case ViewGestureController doesn't exist yet.
1116         (webkitWebViewBaseCreateWebPage): Stop creating ViewGestureController.
1117         (webkitWebViewBaseDidRelaunchWebProcess): Move creating ViewGestureController here. Also
1118         immediately call setSwipeGestureEnabled() with the stored value.
1119         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
1120
1121 2019-04-25  Youenn Fablet  <youenn@apple.com>
1122
1123         [Mac iOS WK2] Layout Test http/wpt/cache-storage/cache-quota-after-restart.any.html is a flaky failure
1124         https://bugs.webkit.org/show_bug.cgi?id=197040
1125         <rdar://problem/49997641>
1126
1127         Reviewed by Antti Koivisto.
1128
1129         Delay write operations in case synchronize is ongoing.
1130         This is restricted to AvoidRandomness mode which is always used by CacheAPI
1131         and is also used by network cache for layout tests.
1132
1133         Tested by cache-quota-after-restart.any.html no longer exhibiting write disk errors.
1134
1135         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1136         (WebKit::NetworkCache::Storage::synchronize):
1137         (WebKit::NetworkCache::Storage::store):
1138
1139 2019-04-25  Commit Queue  <commit-queue@webkit.org>
1140
1141         Unreviewed, rolling out r244627.
1142         https://bugs.webkit.org/show_bug.cgi?id=197282
1143
1144         Causing internal build failures (Requested by ShawnRoberts on
1145         #webkit).
1146
1147         Reverted changeset:
1148
1149         "Create AVFoundationSoftLink.{h,mm} to reduce duplicate code"
1150         https://bugs.webkit.org/show_bug.cgi?id=197171
1151         https://trac.webkit.org/changeset/244627
1152
1153 2019-04-24  Carlos Garcia Campos  <cgarcia@igalia.com>
1154
1155         [GTK] Hardcoded text color in input fields
1156         https://bugs.webkit.org/show_bug.cgi?id=126907
1157
1158         Reviewed by Michael Catanzaro.
1159
1160         Implement PageClient::effectiveAppearanceIsDark() for GTK port.
1161
1162         * UIProcess/API/gtk/PageClientImpl.cpp:
1163         (WebKit::PageClientImpl::effectiveAppearanceIsDark const): Check if gtk-application-prefer-dark-theme setting is
1164         enabled, or the theme name contains the -dark suffix or the GTK_THEME environment variable contains the :dark suffix.
1165         * UIProcess/API/gtk/PageClientImpl.h:
1166         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1167         (themeChanged): Notify the WebPageProxy that the theme has changed.
1168         (webkitWebViewBaseSetToplevelOnScreenWindow): Connect to notify::gtk-application-prefer-dark-theme and notify::gtk-theme-name.
1169         * WebProcess/WebPage/WebPage.cpp:
1170         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
1171         (WebKit::WebPage::setUseDarkAppearance): Set gtk-application-prefer-dark-theme setting accordingly.
1172
1173 2019-04-24  Zalan Bujtas  <zalan@apple.com>
1174
1175         Regression (r244291): Broken API Test AutoLayoutRenderingProgressRelativeOrdering
1176         https://bugs.webkit.org/show_bug.cgi?id=196948
1177         <rdar://problem/49927131>
1178
1179         Reviewed by Tim Horton.
1180
1181         Move intrinsicContentSizeDidChange out of DrawingArea. Intrinsic content size is a layout concept and
1182         after r244291 there's no reason to have it in DrawingArea.
1183
1184         * UIProcess/DrawingAreaProxy.h:
1185         (WebKit::DrawingAreaProxy::didUpdateGeometry):
1186         (WebKit::DrawingAreaProxy::intrinsicContentSizeDidChange): Deleted.
1187         * UIProcess/DrawingAreaProxy.messages.in:
1188         * UIProcess/WebPageProxy.cpp:
1189         (WebKit::WebPageProxy::didChangeIntrinsicContentSize):
1190         (WebKit::WebPageProxy::setViewLayoutSize):
1191         * UIProcess/WebPageProxy.h:
1192         * UIProcess/WebPageProxy.messages.in:
1193         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
1194         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
1195         (WebKit::TiledCoreAnimationDrawingAreaProxy::intrinsicContentSizeDidChange): Deleted.
1196         * UIProcess/mac/WebPageProxyMac.mm:
1197         (WebKit::WebPageProxy::intrinsicContentSizeDidChange): Deleted.
1198         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1199         (WebKit::WebChromeClient::intrinsicContentsSizeChanged const):
1200         * WebProcess/WebCoreSupport/WebChromeClient.h:
1201         * WebProcess/WebPage/WebPage.cpp:
1202         (WebKit::WebPage::updateIntrinsicContentSizeIfNeeded):
1203         (WebKit::WebPage::dispatchDidReachLayoutMilestone):
1204         * WebProcess/WebPage/WebPage.h:
1205         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
1206         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1207         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
1208         (WebKit::TiledCoreAnimationDrawingArea::updateIntrinsicContentSizeIfNeeded): Deleted.
1209
1210 2019-04-24  Commit Queue  <commit-queue@webkit.org>
1211
1212         Unreviewed, rolling out r244228.
1213         https://bugs.webkit.org/show_bug.cgi?id=197262
1214
1215         Causes compat issues (Requested by smfr on #webkit).
1216
1217         Reverted changeset:
1218
1219         "Unreviewed test gardening for Windows."
1220         https://trac.webkit.org/changeset/244228
1221
1222 2019-04-24  Eric Carlson  <eric.carlson@apple.com>
1223
1224         Create AVFoundationSoftLink.{h,mm} to reduce duplicate code
1225         https://bugs.webkit.org/show_bug.cgi?id=197171
1226         <rdar://problem/47454979>
1227
1228         Reviewed by Youenn Fablet.
1229
1230         * Shared/ios/WebIconUtilities.mm:
1231         (WebKit::iconForVideoFile):
1232         * Shared/mac/WebCoreArgumentCodersMac.mm:
1233         (IPC::ArgumentCoder<WebCore::MediaPlaybackTargetContext>::encodePlatformData):
1234         (IPC::ArgumentCoder<WebCore::MediaPlaybackTargetContext>::decodePlatformData):
1235         * UIProcess/Cocoa/UIDelegate.mm:
1236         (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
1237         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm:
1238         (WebKit::PlatformCALayerRemoteCustom::clone const):
1239
1240 2019-04-24  Per Arne Vollan  <pvollan@apple.com>
1241
1242         [macOS] Fix syscall sandbox violation
1243         https://bugs.webkit.org/show_bug.cgi?id=197247
1244         <rdar://problem/50026580>
1245
1246         Reviewed by Brent Fulgham.
1247
1248         A missing syscall in the sandbox of the WebContent process is causing a crash.
1249
1250         * WebProcess/com.apple.WebProcess.sb.in:
1251
1252 2019-04-24  John Wilander  <wilander@apple.com>
1253
1254         Age out unconverted Ad Click Attributions after one week.
1255         https://bugs.webkit.org/show_bug.cgi?id=197238
1256         <rdar://problem/50177349>
1257
1258         Reviewed by Chris Dumez.
1259
1260         AdClickAttributionManager::storeUnconverted() and
1261         AdClickAttributionManager::convert() now start by calling the new
1262         AdClickAttributionManager::clearExpired() function to remove any
1263         expired, unconverted attributions before continuing.
1264
1265         The rest of the patch is infrastructure to allow tests to expire
1266         all unconverted attributions early.
1267
1268         * NetworkProcess/AdClickAttributionManager.cpp:
1269         (WebKit::AdClickAttributionManager::storeUnconverted):
1270         (WebKit::AdClickAttributionManager::convert):
1271         (WebKit::AdClickAttributionManager::clearExpired):
1272         (WebKit::AdClickAttributionManager::markAllUnconvertedAsExpiredForTesting):
1273         * NetworkProcess/AdClickAttributionManager.h:
1274         * NetworkProcess/NetworkProcess.cpp:
1275         (WebKit::NetworkProcess::markAdClickAttributionsAsExpiredForTesting):
1276         * NetworkProcess/NetworkProcess.h:
1277         * NetworkProcess/NetworkProcess.messages.in:
1278         * NetworkProcess/NetworkSession.cpp:
1279         (WebKit::NetworkSession::markAdClickAttributionsAsExpiredForTesting):
1280         * NetworkProcess/NetworkSession.h:
1281         * UIProcess/API/C/WKPage.cpp:
1282         (WKPageSetAdClickAttributionConversionURLForTesting):
1283         (WKPageMarkAdClickAttributionsAsExpiredForTesting):
1284         * UIProcess/API/C/WKPagePrivate.h:
1285         * UIProcess/WebPageProxy.cpp:
1286         (WebKit::WebPageProxy::markAdClickAttributionsAsExpiredForTesting):
1287         * UIProcess/WebPageProxy.h:
1288
1289 2019-04-24  Wenson Hsieh  <wenson_hsieh@apple.com>
1290
1291         Plumb the navigation's request when determining recommended compatibility mode
1292         https://bugs.webkit.org/show_bug.cgi?id=197225
1293         <rdar://problem/48389965>
1294
1295         Reviewed by Alex Christensen.
1296
1297         Adds a new argument to effectiveCompatibilityModeAfterAdjustingPolicies.
1298
1299         * UIProcess/WebPageProxy.cpp:
1300         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1301         (WebKit::WebPageProxy::effectiveCompatibilityModeAfterAdjustingPolicies):
1302         * UIProcess/WebPageProxy.h:
1303
1304 2019-04-24  Tim Horton  <timothy_horton@apple.com>
1305
1306         Clean up WKActionSheetAssistant's use of LaunchServices
1307         https://bugs.webkit.org/show_bug.cgi?id=194645
1308         <rdar://problem/47707952>
1309
1310         Reviewed by Andy Estes.
1311
1312         * UIProcess/ios/WKActionSheetAssistant.mm:
1313         (applicationHasAppLinkEntitlements):
1314         (-[WKActionSheetAssistant _appendAppLinkOpenActionsForURL:actions:elementInfo:]):
1315         (-[WKActionSheetAssistant _appendOpenActionsForURL:actions:elementInfo:]):
1316         (appLinkForURL): Deleted.
1317         Make this function much more early-returny and flat.
1318         Adopt LS sync SPI instead of using a semaphore ourselves.
1319         Adopt modern open SPI.
1320
1321 2019-04-24  Simon Fraser  <simon.fraser@apple.com>
1322
1323         Make it possible to control the renderTreeAsText output by setting options on testRunner
1324         https://bugs.webkit.org/show_bug.cgi?id=197133
1325
1326         Reviewed by Sam Weinig.
1327
1328         Add testRunner.setRenderTreeDumpOptions() and expose the subset of RenderAsTextFlag flags
1329         that make sense in testing (those that don't dump unstable data like addresses), and plumb
1330         these flags through the various framework layers.
1331
1332         Convert RenderAsTextBehavior to an OptionSet<RenderAsTextFlag>.
1333
1334         Fix code generation in WebKitTestRunner to generate bindings for IDL const values,
1335         and hand-code DumpRenderTree bindings.
1336
1337         Some cleanup of the TestRunners, using member initializers.
1338
1339         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1340         (WKBundlePageCopyRenderTreeExternalRepresentation):
1341         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
1342         * WebProcess/WebPage/WebPage.cpp:
1343         (WebKit::toRenderAsTextFlags):
1344         (WebKit::WebPage::renderTreeExternalRepresentation const):
1345         (WebKit::WebPage::renderTreeExternalRepresentationForPrinting const):
1346         * WebProcess/WebPage/WebPage.h:
1347
1348 2019-04-24  Alex Christensen  <achristensen@webkit.org>
1349
1350         WKContentRuleLists should have a maximum FileProtection of CompleteUnlessOpen
1351         https://bugs.webkit.org/show_bug.cgi?id=197078
1352         <rdar://problem/49564348>
1353
1354         Reviewed by Geoff Garen.
1355
1356         r242735 was a fix for crashes when using mmap'd memory in apps with default FileProtection of NSFileProtectionComplete.
1357         It is more memory efficient and just as secure to reduce the FileProtection of these files to NSFileProtectionCompleteUnlessOpen.
1358
1359         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
1360         (WebKit::NetworkCache::isSafeToUseMemoryMapForPath):
1361         (WebKit::NetworkCache::makeSafeToUseMemoryMapForPath):
1362         (WebKit::NetworkCache::pathRegisteredAsUnsafeToMemoryMapForTesting): Deleted.
1363         (WebKit::NetworkCache::registerPathAsUnsafeToMemoryMapForTesting): Deleted.
1364         * NetworkProcess/cache/NetworkCacheFileSystem.h:
1365         * NetworkProcess/cache/NetworkCacheFileSystemCocoa.mm: Added.
1366         (WebKit::NetworkCache::isSafeToUseMemoryMapForPath):
1367         (WebKit::NetworkCache::makeSafeToUseMemoryMapForPath):
1368         * Shared/WebCompiledContentRuleList.cpp:
1369         (WebKit::WebCompiledContentRuleList::conditionsApplyOnlyToDomain const):
1370         (WebKit::WebCompiledContentRuleList::filtersWithoutConditionsBytecode const):
1371         (WebKit::WebCompiledContentRuleList::filtersWithConditionsBytecode const):
1372         (WebKit::WebCompiledContentRuleList::topURLFiltersBytecode const):
1373         (WebKit::WebCompiledContentRuleList::actions const):
1374         (WebKit::WebCompiledContentRuleList::usesCopiedMemory const): Deleted.
1375         * Shared/WebCompiledContentRuleList.h:
1376         * Shared/WebCompiledContentRuleListData.cpp:
1377         (WebKit::WebCompiledContentRuleListData::encode const):
1378         (WebKit::WebCompiledContentRuleListData::decode):
1379         (WebKit::WebCompiledContentRuleListData::size const): Deleted.
1380         (WebKit::WebCompiledContentRuleListData::dataPointer const): Deleted.
1381         * Shared/WebCompiledContentRuleListData.h:
1382         (WebKit::WebCompiledContentRuleListData::WebCompiledContentRuleListData):
1383         * SourcesCocoa.txt:
1384         * UIProcess/API/APIContentRuleList.cpp:
1385         (API::ContentRuleList::usesCopiedMemory const): Deleted.
1386         * UIProcess/API/APIContentRuleList.h:
1387         * UIProcess/API/APIContentRuleListStore.cpp:
1388         (API::openAndMapOrCopyContentRuleList):
1389         (API::compiledToFile):
1390         (API::createExtension):
1391         (API::ContentRuleListStore::getContentRuleListSource):
1392         (API::ContentRuleListStore::readContentsOfFile): Deleted.
1393         (API::MappedOrCopiedData::dataPointer const): Deleted.
1394         * UIProcess/API/APIContentRuleListStore.h:
1395         * UIProcess/API/Cocoa/APIContentRuleListStoreCocoa.mm:
1396         (API::ContentRuleListStore::readContentsOfFile): Deleted.
1397         * UIProcess/API/Cocoa/WKContentRuleListStore.mm:
1398         (+[WKContentRuleListStore _registerPathAsUnsafeToMemoryMapForTesting:]): Deleted.
1399         * UIProcess/API/Cocoa/WKContentRuleListStorePrivate.h:
1400         * UIProcess/API/Cocoa/_WKUserContentFilter.mm:
1401         (-[_WKUserContentFilter usesCopiedMemory]): Deleted.
1402         * UIProcess/API/Cocoa/_WKUserContentFilterPrivate.h:
1403         * WebKit.xcodeproj/project.pbxproj:
1404
1405 2019-04-24  David Kilzer  <ddkilzer@apple.com>
1406
1407         Fix build due to missing SPI declaration of kAXSFullKeyboardAccessEnabledNotification
1408
1409         * UIProcess/Cocoa/WKFullKeyboardAccessWatcher.mm: Import
1410         AccessibilitySupportSPI.h.
1411
1412 2019-04-24  Chris Dumez  <cdumez@apple.com>
1413
1414         URL set by document.open() is communicated with the WebPageProxy but not the WebFrameProxy
1415         https://bugs.webkit.org/show_bug.cgi?id=197214
1416         <rdar://problem/49237544>
1417
1418         Reviewed by Alex Christensen.
1419
1420         URL set by document.open() is communicated with the WebPageProxy (since r244361) but not the
1421         WebFrameProxy. This patch fixes this.
1422
1423         * UIProcess/API/Cocoa/WKWebView.mm:
1424         (-[WKWebView _mainFrameURL]):
1425         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1426         * UIProcess/FrameLoadState.cpp:
1427         (WebKit::FrameLoadState::didExplicitOpen):
1428         * UIProcess/FrameLoadState.h:
1429         * UIProcess/WebFrameProxy.cpp:
1430         (WebKit::WebFrameProxy::didExplicitOpen):
1431         * UIProcess/WebFrameProxy.h:
1432         * UIProcess/WebPageProxy.cpp:
1433         (WebKit::WebPageProxy::didExplicitOpenForFrame):
1434
1435 2019-04-24  Chris Dumez  <cdumez@apple.com>
1436
1437         X-Frame-Options header should be ignored when frame-ancestors CSP directive is present
1438         https://bugs.webkit.org/show_bug.cgi?id=197226
1439         <rdar://problem/50155649>
1440
1441         Reviewed by Alex Christensen.
1442
1443         * NetworkProcess/NetworkResourceLoader.cpp:
1444         (WebKit::NetworkResourceLoader::shouldInterruptLoadForCSPFrameAncestorsOrXFrameOptions):
1445
1446 2019-04-24  Dean Jackson  <dino@apple.com>
1447
1448         Rename _highlightLongPressCanClick and only add gesture recognizer when necessary
1449         https://bugs.webkit.org/show_bug.cgi?id=197231
1450         <rdar://problem/50164234>
1451
1452         Reviewed by Antoine Quint.
1453
1454         Rename _highlightLongPressCanClick to _longPressCanClick since it will be
1455         used in other places.
1456
1457         Only attach the _highlightLongPressGestureRecognizer when we're not
1458         using long presses for preview. This might revert in the future, if we
1459         can set up an appropriate gesture resolution between the two.
1460
1461         * UIProcess/ios/WKContentViewInteraction.h:
1462         * UIProcess/ios/WKContentViewInteraction.mm:
1463         (-[WKContentView setupInteraction]):
1464         (-[WKContentView _webTouchEvent:preventsNativeGestures:]):
1465         (-[WKContentView _highlightLongPressRecognized:]):
1466         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
1467         (-[WKContentView _presentedViewControllerForPreviewItemController:]):
1468         (-[WKContentView _previewItemControllerDidCancelPreview:]):
1469
1470 2019-04-24  chris fleizach  <cfleizach@apple.com>
1471
1472         AX: Remove deprecated Accessibility Object Model events
1473         https://bugs.webkit.org/show_bug.cgi?id=197073
1474         <rdar://problem/50027819>
1475
1476         Reviewed by Ryosuke Niwa.
1477
1478         * Platform/spi/ios/AccessibilitySupportSPI.h:
1479         * UIProcess/API/Cocoa/WKWebView.mm:
1480         (-[WKWebView _initializeWithConfiguration:]):
1481         (-[WKWebView dealloc]):
1482         (accessibilityEventsEnabledChangedCallback): Deleted.
1483         (-[WKWebView _updateAccessibilityEventsEnabled]): Deleted.
1484         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1485         * UIProcess/Cocoa/WKFullKeyboardAccessWatcher.mm:
1486         * UIProcess/WebPageProxy.cpp:
1487         (WebKit::WebPageProxy::updateAccessibilityEventsEnabled): Deleted.
1488         * UIProcess/WebPageProxy.h:
1489         * WebProcess/WebPage/WebPage.cpp:
1490         (WebKit::WebPage::updateAccessibilityEventsEnabled): Deleted.
1491         * WebProcess/WebPage/WebPage.h:
1492         * WebProcess/WebPage/WebPage.messages.in:
1493
1494 2019-04-23  John Wilander  <wilander@apple.com>
1495
1496         Move Ad Click Attribution from internal feature to experimental feature
1497         https://bugs.webkit.org/show_bug.cgi?id=197218
1498         <rdar://problem/47651691>
1499
1500         Reviewed by Brent Fulgham.
1501
1502         * Shared/WebPreferences.yaml:
1503
1504 2019-04-23  Keith Rollin  <krollin@apple.com>
1505
1506         Add Xcode version check for Header post-processing scripts
1507         https://bugs.webkit.org/show_bug.cgi?id=197116
1508         <rdar://problem/50058968>
1509
1510         Reviewed by Brent Fulgham.
1511
1512         There are several places in our Xcode projects that post-process
1513         header files after they've been exported. Because of XCBuild, we're
1514         moving to a model where the post-processing is performed at the same
1515         time the header files are exported, rather than as a distinct
1516         post-processing step. This patch disables the distinct step when the
1517         inline processing is available.
1518
1519         In practice, this means prefixing appropriate post-processing Custom
1520         Build phases with:
1521
1522         if [ "${XCODE_VERSION_MAJOR}" -ge "1100" -a "${USE_NEW_BUILD_SYSTEM}" = "YES" ]; then
1523             # In this configuration, post-processing is performed at the same time as copying in the postprocess-header-rule script, so there's no need for this separate step.
1524             exit 0
1525         fi
1526
1527         * WebKit.xcodeproj/project.pbxproj:
1528
1529 2019-04-23  John Wilander  <wilander@apple.com>
1530
1531         Remove Ad Click Attribution data when removing website data
1532         https://bugs.webkit.org/show_bug.cgi?id=197215
1533         <rdar://problem/47668988>
1534
1535         Reviewed by Chris Dumez.
1536
1537         This patch adds a new WebsiteDataType called AdClickAttributions and flags
1538         it as owned by the network process.
1539
1540         The new website data type is added to the Cocoa API layer for
1541         website data records management.
1542
1543         When either of the two WebsiteDataStore::removeData() functions calls
1544         NetworkProcess::deleteWebsiteData() or
1545         NetworkProcess::deleteWebsiteDataForOrigins() over IPC, the network
1546         process now calls into AdClickAttributionManager::clear() and
1547         AdClickAttributionManager::clearForRegistrableDomain() respectively,
1548         if the website datatypes include WebsiteDataType::AdClickAttributions.
1549
1550         The patch removes a couple of completion handlers in NetworkSession function
1551         calls are because those are not asynchronous.
1552
1553         * NetworkProcess/AdClickAttributionManager.cpp:
1554         (WebKit::AdClickAttributionManager::clear):
1555         (WebKit::AdClickAttributionManager::clearForRegistrableDomain):
1556         (WebKit::AdClickAttributionManager::toString const):
1557         * NetworkProcess/AdClickAttributionManager.h:
1558         * NetworkProcess/NetworkProcess.cpp:
1559         (WebKit::NetworkProcess::deleteWebsiteData):
1560         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
1561         (WebKit::NetworkProcess::clearAdClickAttribution):
1562         * NetworkProcess/NetworkSession.cpp:
1563         (WebKit::NetworkSession::clearAdClickAttribution):
1564         (WebKit::NetworkSession::clearAdClickAttributionForRegistrableDomain):
1565         * NetworkProcess/NetworkSession.h:
1566         * Shared/WebsiteData/WebsiteData.cpp:
1567         (WebKit::WebsiteData::ownerProcess):
1568         * Shared/WebsiteData/WebsiteDataType.h:
1569         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1570         (WKWebsiteDataStoreClearAdClickAttributionsThroughWebsiteDataRemoval):
1571         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
1572         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
1573         (dataTypesToString):
1574         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
1575         (WebKit::toWebsiteDataType):
1576         (WebKit::toWKWebsiteDataTypes):
1577         * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h:
1578         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1579         (+[WKWebsiteDataStore _allWebsiteDataTypesIncludingPrivate]):
1580
1581 2019-04-23  Tim Horton  <timothy_horton@apple.com>
1582
1583         Return annotated text checking strings via UIWKDocumentContext
1584         https://bugs.webkit.org/show_bug.cgi?id=197177
1585         <rdar://problem/49064839>
1586
1587         Reviewed by Ryosuke Niwa.
1588
1589         * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.h:
1590         * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.mm:
1591         (WebKit::TextCheckingControllerProxy::annotatedSubstringBetweenPositions):
1592         * WebProcess/WebPage/ios/WebPageIOS.mm:
1593         (WebKit::WebPage::requestDocumentEditingContext):
1594         Respect the UIWKDocumentRequestAnnotation flag, returning an attributed
1595         string containing the platform text checking annotations.
1596
1597 2019-04-23  Commit Queue  <commit-queue@webkit.org>
1598
1599         Unreviewed, rolling out r244556.
1600         https://bugs.webkit.org/show_bug.cgi?id=197212
1601
1602         Causing build failures on multiple builders (Requested by
1603         ShawnRoberts on #webkit).
1604
1605         Reverted changeset:
1606
1607         "Create AVFoundationSoftLink.{h,mm} to reduce duplicate code"
1608         https://bugs.webkit.org/show_bug.cgi?id=197171
1609         https://trac.webkit.org/changeset/244556
1610
1611 2019-04-23  Remy Demarest  <rdemarest@apple.com>
1612
1613         Build fix after r244545.
1614
1615         Reviewed by Tim Horton.
1616
1617         * Platform/spi/mac/AppKitSPI.h:
1618         The SPI was an IPI in High Sierra.
1619
1620 2019-04-23  Per Arne Vollan  <pvollan@apple.com>
1621
1622         [iOS] Input field on ddg.gg is auto focused when url is entered with the software keyboard
1623         https://bugs.webkit.org/show_bug.cgi?id=196740
1624
1625         Reviewed by Megan Gardner.
1626
1627         When an url for a page with an autofocused input field  is entered with the software keyboard,
1628         the input field is auto selected, and the software keyboard reappears. This does not happen
1629         when picking the url from favorites. After using the software keyboard to enter the url, the
1630         activity state is being changed to focused. The method '_elementDidFocus' checks whether the
1631         activity state changed, and allows the software keyboard to be shown in this case. To avoid
1632         showing the software keyboard in this case, send the changing activity state bitfield to the
1633         UI process, and check if the focus flag is the only flag set.
1634   
1635         * UIProcess/ios/WKContentViewInteraction.mm:
1636         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
1637
1638 2019-04-23  Guy Lewin  <guy@lewin.co.il>
1639
1640         Multiple File Input Icon Set Regardless of File List
1641         https://bugs.webkit.org/show_bug.cgi?id=195537
1642
1643         Reviewed by Alexey Proskuryakov.
1644
1645         Add WKOpenPanelResultListenerChooseMediaFiles() to choose files with
1646         icon and display string on iOS file open panels
1647
1648         * UIProcess/API/C/WKOpenPanelResultListener.cpp:
1649         (WKOpenPanelResultListenerChooseMediaFiles):
1650         * UIProcess/API/C/WKOpenPanelResultListener.h:
1651
1652 2019-04-23  Eric Carlson  <eric.carlson@apple.com>
1653
1654         Create AVFoundationSoftLink.{h,mm} to reduce duplicate code
1655         https://bugs.webkit.org/show_bug.cgi?id=197171
1656         <rdar://problem/47454979>
1657
1658         Reviewed by Youenn Fablet.
1659
1660         * Shared/ios/WebIconUtilities.mm:
1661         (WebKit::iconForVideoFile):
1662         * Shared/mac/WebCoreArgumentCodersMac.mm:
1663         (IPC::ArgumentCoder<WebCore::MediaPlaybackTargetContext>::encodePlatformData):
1664         (IPC::ArgumentCoder<WebCore::MediaPlaybackTargetContext>::decodePlatformData):
1665         * UIProcess/Cocoa/UIDelegate.mm:
1666         (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
1667         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm:
1668         (WebKit::PlatformCALayerRemoteCustom::clone const):
1669
1670 2019-04-22  Dean Jackson  <dino@apple.com>
1671
1672         Use additional members and protocols from WebKitAdditions in WKContentViewInteraction
1673         https://bugs.webkit.org/show_bug.cgi?id=197184
1674         <rdar://problem/50113848>
1675
1676         Reviewed by Wenson Hsieh.
1677
1678         WebKitAdditions defines some macros to include additional members
1679         and protocols for WKContentViewInteraction.
1680
1681         It also defines some new functions. Provide empty version
1682         of those functions when WebKitAdditions is not available.
1683
1684         * UIProcess/ios/WKContentViewInteraction.h:
1685         * UIProcess/ios/WKContentViewInteraction.mm:
1686         (-[WKContentView _registerPreview]):
1687         (-[WKContentView _unregisterPreview]):
1688
1689 2019-04-23  Tim Horton  <timothy_horton@apple.com>
1690
1691         Action sheet shares a stringified URL instead of a URL object
1692         https://bugs.webkit.org/show_bug.cgi?id=197185
1693         <rdar://problem/49962249>
1694
1695         Reviewed by Darin Adler.
1696
1697         * UIProcess/Cocoa/WKShareSheet.h:
1698         * UIProcess/Cocoa/WKShareSheet.mm:
1699         (-[WKShareSheet presentWithParameters:inRect:completionHandler:]):
1700         (-[WKShareSheet presentWithParameters:completionHandler:]): Deleted.
1701         * UIProcess/Cocoa/WebViewImpl.mm:
1702         (WebKit::WebViewImpl::showShareSheet):
1703         * UIProcess/ios/PageClientImplIOS.mm:
1704         (WebKit::PageClientImpl::showShareSheet):
1705         Make it possible to optionally provide WKShareSheet with
1706         a rect to present relative to.
1707
1708         * UIProcess/ios/WKContentViewInteraction.h:
1709         * UIProcess/ios/WKContentViewInteraction.mm:
1710         (-[WKContentView _showShareSheet:inRect:completionHandler:]):
1711         (-[WKContentView actionSheetAssistant:shareElementWithURL:rect:]):
1712         (-[WKContentView _showShareSheet:completionHandler:]): Deleted.
1713         Instead of stringifying the URL and using the text selection assistant's
1714         share method, hand WKShareSheet a proper URL.
1715
1716 2019-04-23  Ryosuke Niwa  <rniwa@webkit.org>
1717
1718         [iOS] element.focus() sometimes fails to reveal the focused element when it becomes editable dynamically
1719         https://bugs.webkit.org/show_bug.cgi?id=197188
1720
1721         Reviewed by Wenson Hsieh.
1722
1723         Commit the scroll tree update before revealing the keyboard via editor state update.
1724
1725         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
1726         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
1727
1728 2019-04-23  Remy Demarest  <rdemarest@apple.com>
1729
1730         Fix layout issues occuring when entering full screen mode.
1731         https://bugs.webkit.org/show_bug.cgi?id=197086
1732         <rdar://problem/47733671>.
1733
1734         Reviewed by Darin Adler.
1735
1736         This issue is the result of changing the style mask of the window after entering
1737         full screen mode. Safari adds an invisible toolbar to display the URL of the page
1738         which ends up breaking the layout. Having that window use a style that includes a
1739         titlebar fixes the bug.
1740
1741         * Platform/spi/mac/AppKitSPI.h:
1742         Declare an SPI to be used in WKFullScreenWindowController.
1743
1744         * UIProcess/Cocoa/WebViewImpl.mm:
1745         (WebKit::WebViewImpl::fullScreenWindow): Make the full screen window show a titlebar
1746         and make the content view underlap the titlebar to match the current behavior.
1747         Remove NSWindowStyleMaskBorderless which has no effects since it is equal to zero.
1748
1749         * UIProcess/mac/WKFullScreenWindowController.mm:
1750         (-[WKFullScreenWindowController initWithWindow:webView:page:]): Hide the titlebar
1751         before beginning the animation to full screen.
1752         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): Show the title
1753         bar when in full screen instead of a blank bar.
1754         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): Hide the title
1755         bar to restore the initial setting.
1756
1757 2019-04-23  John Wilander  <wilander@apple.com>
1758
1759         Ad Click Attribution redirects to well-known location should not trigger a conversion if they are blocked by content blockers
1760         https://bugs.webkit.org/show_bug.cgi?id=197183
1761         <rdar://problem/47763188>
1762
1763         Reviewed by Alex Christensen.
1764
1765         Ad Click Attribution conversions are picked up in the redirect handler
1766         in WebKit::NetworkResourceLoader. Content blocking typically happens in
1767         the continued redirect request handling in the web content process and
1768         a blocked request comes back empty.
1769
1770         We need to call the WebKit::NetworkLoadChecker in the network process
1771         for these specific redirects, just like we do for Ping.
1772
1773         The change makes use of the existing function
1774         NetworkLoadChecker::enableContentExtensionsCheck() for this purpose.
1775
1776         In essence, this change makes it possible to block all conversions made
1777         to a "/.well-known/ad-click-attribution/" URL.
1778
1779         * NetworkProcess/NetworkResourceLoader.cpp:
1780         (WebKit::NetworkResourceLoader::handleAdClickAttributionConversion):
1781             New convenience function.
1782         (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
1783             Now calls NetworkLoadChecker::enableContentExtensionsCheck() if
1784             an Ad Click Attribution conversion was found in the redirect URL.
1785         (WebKit::NetworkResourceLoader::continueWillSendRedirectedRequest):
1786             If the request was not blocked, it will store any found conversion here.
1787         * NetworkProcess/NetworkResourceLoader.h:
1788
1789 2019-04-23  Don Olmstead  <don.olmstead@sony.com>
1790
1791         [CMake][Win] Use target oriented design for WebKit
1792         https://bugs.webkit.org/show_bug.cgi?id=197173
1793
1794         Reviewed by Alex Christensen.
1795
1796         Enumerate public framework headers for WinCairo's WebKit implementation and copy them.
1797         Migrate to use WebKit_DERIVED_SOURCES_DIR.
1798
1799         * CMakeLists.txt:
1800         * PlatformGTK.cmake:
1801         * PlatformWPE.cmake:
1802         * PlatformWin.cmake:
1803
1804 2019-04-23  Chris Dumez  <cdumez@apple.com>
1805
1806         [Process-Swap-On-Navigation] WebKit hangs when going back to a form submission's page due to Process-Swap-On-Navigation on iOS 12.2 and higher
1807         https://bugs.webkit.org/show_bug.cgi?id=197097
1808         <rdar://problem/50048318>
1809
1810         Reviewed by Alex Christensen.
1811
1812         The issue is that when doing a history navigation with form data, we try to resubmit the form.
1813         We initially use the ReturnCacheDataDontLoad cache policy without prompting the user to get
1814         cached data. If this fails, we sent a DidFailProvisionalLoadForFrame IPC to the UIProcess but
1815         the WebContent process actually retries the load with ReturnCacheDataElseLoad cache policy.
1816         This new load triggers a new decidePolicyForNavigationAction.
1817
1818         This would cause trouble with process-swapping because we normally destroy the
1819         ProvisionalPageProxy as soon as we receive a DidFailProvisionalLoadForFrame IPC from the
1820         provisional process. As a result, the provisional process would not be able to retry.
1821
1822         To address the issue, we add pass a flag with the DidFailProvisionalLoadForFrame IPC to
1823         if the load will continue or not. When this flag is set, the UIProcess does not destroy
1824         the provisional page.
1825
1826         * Scripts/webkit/messages.py:
1827         Minor IPC message handler build fix.
1828
1829         * UIProcess/API/Cocoa/WKURLSchemeTask.mm:
1830         (-[WKURLSchemeTaskImpl _onlyIfCached]):
1831         * UIProcess/API/Cocoa/WKURLSchemeTaskPrivate.h:
1832         Add new _onlyIfCached SPI to WKURLSchemeTaskPrivate to allow for API testing.
1833
1834         * UIProcess/ProvisionalPageProxy.cpp:
1835         (WebKit::ProvisionalPageProxy::cancel):
1836         Pass WillContinueLoading flag.
1837
1838         (WebKit::ProvisionalPageProxy::validateInput):
1839         Consider IPC with a navigationID of 0 as valid. When the navigation is triggered by the
1840         WebContent process, it sends us a DecidePolicyForNavigationActionAsync IPC with a navigationID
1841         of 0, until the UIProcess can generate a valid identifier.
1842
1843         (WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame):
1844
1845         (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionAsync):
1846         When the WebPageProxy has generated a navigationID for the new WebContent process-initiated
1847         navigation, update m_navigationID so that follow-up IPC is considered valid.
1848
1849         * UIProcess/ProvisionalPageProxy.h:
1850         * UIProcess/WebPageProxy.cpp:
1851         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
1852         (WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared):
1853         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared):
1854         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1855         * UIProcess/WebPageProxy.h:
1856         * UIProcess/WebPageProxy.messages.in:
1857         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1858         (WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad):
1859         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1860
1861 2019-04-22  Zalan Bujtas  <zalan@apple.com>
1862
1863         [ContentChangeObserver] Some dropdown menus may close without user gesture on americanexpress.com
1864         https://bugs.webkit.org/show_bug.cgi?id=197175
1865         <rdar://problem/49613013>
1866
1867         Reviewed by Simon Fraser.
1868
1869         Do not generate additional synthetic mouse events (e.g. mouseout in this case) when the content handles the click event. This helps cases when the synthetic mouseout ended up dismissing the dropdown menus.
1870         However it won't regress cases like youtube.com, where sending mouseout is required to have the control bar dismissed on play. 
1871
1872         * WebProcess/WebPage/ios/WebPageIOS.mm:
1873         (WebKit::WebPage::completeSyntheticClick):
1874
1875 2019-04-22  Alex Christensen  <achristensen@webkit.org>
1876
1877         Deprecate WKContextCreateWithInjectedBundlePath
1878         https://bugs.webkit.org/show_bug.cgi?id=197169
1879
1880         Reviewed by Youenn Fablet.
1881
1882         * UIProcess/API/C/WKContext.h:
1883
1884 2019-04-22  Alex Christensen  <achristensen@webkit.org>
1885
1886         REGRESSION(r230681) Do not use stored credentials if WKBundlePageResourceLoadClient.shouldUseCredentialStorage returns false
1887         https://bugs.webkit.org/show_bug.cgi?id=197093
1888         <rdar://problem/49708268>
1889
1890         Reviewed by Chris Dumez.
1891
1892         Only get the StoredCredentialsPolicy from the NetworkLoadChecker if we haven't already been told not to use credentials.
1893         Also add some test infrastructure for clearing persistent credentials added by the test.
1894
1895         * NetworkProcess/NetworkProcess.cpp:
1896         (WebKit::NetworkProcess::removeCredential):
1897         * NetworkProcess/NetworkProcess.h:
1898         * NetworkProcess/NetworkProcess.messages.in:
1899         * NetworkProcess/NetworkResourceLoader.cpp:
1900         (WebKit::NetworkResourceLoader::startNetworkLoad):
1901         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1902         (WebKit::NetworkProcess::removeCredential):
1903         * UIProcess/API/Cocoa/WKProcessPool.mm:
1904         (-[WKProcessPool _removeCredential:forProtectionSpace:completionHandler:]):
1905         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1906         * UIProcess/WebProcessPool.cpp:
1907         (WebKit::WebProcessPool::removeCredential):
1908         * UIProcess/WebProcessPool.h:
1909
1910 2019-04-22  Chris Dumez  <cdumez@apple.com>
1911
1912         Delayed WebProcessLaunch may break the _relatedWebView SPI
1913         https://bugs.webkit.org/show_bug.cgi?id=197160
1914
1915         Reviewed by Alex Christensen.
1916
1917         Delayed WebProcessLaunch may break the _relatedWebView SPI. The breakage would happen if the client
1918         would relate a WebView to another which has not launched its initial process yet.
1919
1920         To address the issue, when we need a running process for a WebView which has a related view, we need
1921         to make sure the related view has a running process and use that process. Previously, we would share
1922         the "dummy" process instead.
1923
1924         * UIProcess/WebPageProxy.cpp:
1925         (WebKit::WebPageProxy::launchProcess):
1926         (WebKit::WebPageProxy::ensureRunningProcess):
1927         * UIProcess/WebPageProxy.h:
1928         * UIProcess/WebProcessPool.cpp:
1929         (WebKit::WebProcessPool::createWebPage):
1930
1931 2019-04-22  David Quesada  <david_quesada@apple.com>
1932
1933         Remove linked-on-or-after check for download attribute handling
1934         https://bugs.webkit.org/show_bug.cgi?id=197176
1935         rdar://problem/48459714
1936
1937         Reviewed by Alex Christensen.
1938
1939         There are no apps linked prior to this SDK version that are using the _WKDownload SPI,
1940         so it doesn't make sense to preserve the old behavior of forcing download-attribute
1941         links to start downloads.
1942
1943         * UIProcess/Cocoa/VersionChecks.h:
1944         * UIProcess/WebPageProxy.cpp:
1945         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
1946
1947 2019-04-22  Chris Dumez  <cdumez@apple.com>
1948
1949         Unreviewed, rolling out r244502.
1950
1951         Caused crashes on the bots
1952
1953         Reverted changeset:
1954
1955         "Delayed WebProcessLaunch may break the _relatedWebView SPI"
1956         https://bugs.webkit.org/show_bug.cgi?id=197160
1957         https://trac.webkit.org/changeset/244502
1958
1959 2019-04-22  Ryan Haddad  <ryanhaddad@apple.com>
1960
1961         Unreviewed, rolling out r244437.
1962
1963         Still breaks internal tests.
1964
1965         Reverted changeset:
1966
1967         "InjectedBundle parameters often need initialization function
1968         called before unarchiving"
1969         https://bugs.webkit.org/show_bug.cgi?id=189709
1970         https://trac.webkit.org/changeset/244437
1971
1972 2019-04-22  Chris Dumez  <cdumez@apple.com>
1973
1974         Delayed WebProcessLaunch may break the _relatedWebView SPI
1975         https://bugs.webkit.org/show_bug.cgi?id=197160
1976
1977         Reviewed by Alex Christensen.
1978
1979         Delayed WebProcessLaunch may break the _relatedWebView SPI. The breakage would happen if the client
1980         would relate a WebView to another which has not launched its initial process yet.
1981
1982         To address the issue, when we need a running process for a WebView which has a related view, we need
1983         to make sure the related view has a running process and use that process. Previously, we would share
1984         the "dummy" process instead.
1985
1986         * UIProcess/WebPageProxy.cpp:
1987         (WebKit::WebPageProxy::launchProcess):
1988         (WebKit::WebPageProxy::ensureRunningProcess):
1989         * UIProcess/WebPageProxy.h:
1990         * UIProcess/WebProcessPool.cpp:
1991         (WebKit::WebProcessPool::createWebPage):
1992
1993 2019-04-22  Ludovico de Nittis  <ludovico.denittis@collabora.com>
1994
1995         [GTK] fix gtk_style_context_set_background deprecation
1996         https://bugs.webkit.org/show_bug.cgi?id=196912
1997
1998         Reviewed by Carlos Garcia Campos.
1999
2000         Since gtk 3.18 gtk_style_context_set_background has been deprecated.
2001         Backgrounds are not rendered in the UI process, so it can be
2002         simply removed.
2003
2004         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2005         (webkitWebViewBaseRealize):
2006
2007 2019-04-21  Wenson Hsieh  <wenson_hsieh@apple.com>
2008
2009         Defer EditorState updates until the next layer tree flush in a few additional circumstances
2010         https://bugs.webkit.org/show_bug.cgi?id=197145
2011         <rdar://problem/50078170>
2012
2013         Reviewed by Darin Adler.
2014
2015         Gets rid of sendPartialEditorStateAndSchedulePostLayoutUpdate(), in favor of always scheduling a full editor
2016         state update after the next compositing flush.
2017
2018         * WebProcess/WebPage/WebPage.cpp:
2019         (WebKit::WebPage::updateEditorStateAfterLayoutIfEditabilityChanged):
2020         (WebKit::WebPage::setNeedsFontAttributes):
2021         (WebKit::WebPage::didChangeOverflowScrollPosition):
2022         (WebKit::WebPage::didChangeSelection):
2023         (WebKit::WebPage::didChangeSelectionOrOverflowScrollPosition):
2024         (WebKit::WebPage::sendPartialEditorStateAndSchedulePostLayoutUpdate): Deleted.
2025         * WebProcess/WebPage/WebPage.h:
2026         * WebProcess/WebPage/ios/WebPageIOS.mm:
2027         (WebKit::WebPage::platformEditorState const):
2028         (WebKit::WebPage::updateVisibleContentRects):
2029
2030 2019-04-21  Chris Dumez  <cdumez@apple.com>
2031
2032         Regression(r243767) WebFrame::m_navigationIsContinuingInAnotherProcess flag is never reset
2033         https://bugs.webkit.org/show_bug.cgi?id=197144
2034
2035         Reviewed by Darin Adler.
2036
2037         WebFrame::m_navigationIsContinuingInAnotherProcess flag is never reset since it was introduced in
2038         r243767. This leads to leaking Navigation objects in the UIProcess when reusing a previously
2039         suspended process because such process will no longer send the DidDestroyNavigation IPC.
2040
2041         It turns out that resetting the flags causes API tests such as ProcessSwap.QuickBackForwardNavigationWithPSON
2042         to ASSERT. This is because when the UIProcess quickly navigate back and forth without waiting for policy
2043         decisions, we may end up getting the policy decision for a particular navigation *after* we've sent the
2044         DidDestroyNavigation.
2045
2046         As a result, this patch reverts r243767 and fixes in the assertion in http/tests/adClickAttribution/store-ad-click-attribution.html
2047         another way. We initially assumed that the logic in WebPageProxy::didDestroyNavigation() was failing to
2048         ignore the DidDestroyNavigation from the previous process after a swap due to a race, maybe because it was
2049         sometimes received too late and m_provisionalPage was already cleared. However, this would not make sense
2050         since the test is crashing consistently and the page would no longer be able to receive IPC from the
2051         previous process *after* we've committed the provisional process/page.
2052
2053         The real issue was that the DidDestroyNavigation IPC was received *before* we could construct the
2054         provisional page, which is why the logic in WebPageProxy::didDestroyNavigation() was failing to ignore
2055         the bad IPC. In WebPageProxy::receivedNavigationPolicyDecision(), we were calling receivedPolicyDecision()
2056         (which would send the DidReceivePolicyDecision to the previous WebProcess) and then continueNavigationInNewProcess()
2057         in order to construct the provisional page. I personally did not expect we could receive IPC between the
2058         calls to receivedNavigationPolicyDecision() and receivedPolicyDecision(), since we are not yielding and since
2059         the DidReceivePolicyDecision IPC is asynchronous. However, this is exactly what was happening in the context
2060         of this test. The reason is that the DidReceivePolicyDecision IPC was getting wrapped in a synchronous message
2061         and sent as synchronous message due to the Connection::m_inDispatchMessageMarkedToUseFullySynchronousModeForTesting
2062         flag which seems to get set in the test due to some EventSender IPC. I believe this is because the test uses
2063         EventSender to do a click on a link which triggers the navigation.
2064
2065         To address the issue, I now call receivedNavigationPolicyDecision() *after* continueNavigationInNewProcess()
2066         to make sure that we always start the provisional load in the new process before we tell the previous process
2067         to stop loading. This way, there is no way we get IPC from the previous process about the current navigation
2068         before we have a provisional page.
2069
2070         * UIProcess/WebPageProxy.cpp:
2071         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
2072         (WebKit::WebPageProxy::didDestroyNavigation):
2073         * WebProcess/WebPage/WebFrame.cpp:
2074         (WebKit::WebFrame::didReceivePolicyDecision):
2075         (WebKit::WebFrame::documentLoaderDetached):
2076         * WebProcess/WebPage/WebFrame.h:
2077
2078 2019-04-20  Chris Dumez  <cdumez@apple.com>
2079
2080         Unreviewed, fix iOS build with recent SDKs.
2081
2082         * UIProcess/API/Cocoa/WKWebView.mm:
2083         (deviceOrientation):
2084         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
2085         (-[WKFullScreenViewController initWithWebView:]):
2086         (-[WKFullScreenViewController viewWillTransitionToSize:withTransitionCoordinator:]):
2087         (-[WKFullScreenViewController _statusBarFrameDidChange:]):
2088
2089 2019-04-19  John Wilander  <wilander@apple.com>
2090
2091         Disable Ad Click Attribution in ephemeral sessions and make sure conversion requests use an ephemeral, stateless session
2092         https://bugs.webkit.org/show_bug.cgi?id=197108
2093         <rdar://problem/49918702>
2094
2095         Reviewed by Alex Christensen.
2096
2097         This patch introduces a new NSURLSession in WebKit::NetworkSessionCocoa called
2098         m_ephemeralStatelessCookielessSession. As its name implies, it's ephemeral, 
2099         stateless, and has a NSHTTPCookieAcceptPolicyNever cookie policy.
2100
2101         The new session can be invoked with the new enum value of
2102         WebCore::StoredCredentialsPolicy called EphemeralStatelessCookieless.
2103
2104         WebKit::AdClickAttributionManager::fireConversionRequest() makes use of
2105         the new session for its conversion requests.
2106
2107         This patch also makes sure that Ad Click Attributions cannot be stored in
2108         ephemeral sessions and already stored attributions cannot be converted in
2109         ephemeral sessions.
2110
2111         * NetworkProcess/AdClickAttributionManager.cpp:
2112         (WebKit::AdClickAttributionManager::fireConversionRequest):
2113         (WebKit::AdClickAttributionManager::toString const):
2114         * NetworkProcess/NetworkLoadChecker.h:
2115         * NetworkProcess/NetworkProcess.h:
2116         * NetworkProcess/NetworkProcess.messages.in:
2117         * NetworkProcess/NetworkResourceLoader.cpp:
2118         (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
2119         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2120         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
2121             Calls NetworkSessionCocoa::initializeEphemeralStatelessCookielessSession() lazily.
2122         (WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa):
2123         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
2124         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
2125         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2126         (WebKit::NetworkSessionCocoa::initializeEphemeralStatelessCookielessSession):
2127         (WebKit::NetworkSessionCocoa::invalidateAndCancel):
2128         * Shared/WebCoreArgumentCoders.h:
2129
2130 2019-04-19  Daniel Bates  <dabates@apple.com>
2131
2132         Use RetainPtr and rename +autocorrectionRectsWithRects:lastRect: to +autocorrectionRectsWithFirstCGRect:lastCGRect:
2133         https://bugs.webkit.org/show_bug.cgi?id=197122
2134
2135         Reviewed by Wenson Hsieh.
2136
2137         * UIProcess/ios/WKContentViewInteraction.mm:
2138         (-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]): Renamed; formerly named +autocorrectionRectsWithRects:lastRect:.
2139         While I am here use else-branch to initialize firstRect and lastRect just to make the code closer to the optimal
2140         assembly. Also use Vector::{isEmpty, first, last}() instead of using the index operator overload and size() for
2141         emptiness checks. The code is more readable at the cost being ever so slightly slower (due to the overflow checks
2142         in first() and last()), but this code is likely not hot enough for it to matter.
2143         (-[WKContentView applyAutocorrection:toString:withCompletionHandler:]): Update for renaming.
2144         (+[WKAutocorrectionRects autocorrectionRectsWithFirstCGRect:lastCGRect:]): Ditto.
2145         (+[WKAutocorrectionRects autocorrectionRectsWithRects:lastRect:]): Deleted.
2146
2147 2019-04-19  Daniel Bates  <dabates@apple.com>
2148
2149         -[WKAutocorrectionContext emptyAutocorrectionContext:] generates invalid empty context
2150         https://bugs.webkit.org/show_bug.cgi?id=197119
2151
2152         Reviewed by Wenson Hsieh.
2153
2154         Use the existing EditingRange type to represent the location and length of the marked text
2155         range for an autocorrection instead of managing integers. This type avoid the need to handle
2156         the special case for an empty range represented as NSMakeRange(NSNotFound, 0). Currently
2157         WKAutocorrectionContext incorrectly represents the empty range as NSMakeRange(WTF::notFound, 0).
2158
2159         While I am here, simplify the existing WebAutocorrectionContext encoder/decoder code and rename
2160         +[WKAutocorrectionContext autocorrectionContextWithContext:] to +autocorrectionContextWithWebContext
2161         to better reflect the expected source of the conversion: a Web-type.
2162
2163         * Shared/ios/WebAutocorrectionContext.h:
2164         (WebKit::WebAutocorrectionContext::encode const): Reformat while I am here to make this logic easy
2165         to amend without losing SVN history.
2166         (WebKit::WebAutocorrectionContext::decode): Simplify the code while I am here.
2167         * UIProcess/ios/WKContentViewInteraction.mm:
2168         (-[WKContentView _handleAutocorrectionContext:]): Update for renaming.
2169         (+[WKAutocorrectionContext emptyAutocorrectionContext]): Update for renaming.
2170         (+[WKAutocorrectionContext autocorrectionContextWithWebContext:]): Renamed; formerly named autocorrectionContextWithContext.
2171         (+[WKAutocorrectionContext autocorrectionContextWithContext:]): Deleted.
2172         * WebProcess/WebPage/ios/WebPageIOS.mm:
2173         (WebKit::WebPage::autocorrectionContext): Update to make use of EditingRange. Also instantiate
2174         the struct and return it, initializing its fields individually instead of using the constructor to
2175         make this code less error prone. It's easy to introduce an error with the constructor notation when
2176         amending the the struct because so many of the arguments are of the same data type. Individually
2177         initializing the struct fields makes it less likely for an ordering mistake to be introduced.
2178
2179 2019-04-19  Dean Jackson  <dino@apple.com>
2180
2181         Add more _WKElementActionTypes and provide API to create with custom types
2182         https://bugs.webkit.org/show_bug.cgi?id=197117
2183         <rdar://problem/50059548>
2184
2185         Reviewed by Tim Horton.
2186
2187         We were missing a few obvious types that are well-known
2188         browser actions, and/or should be visible in share sheets.
2189         Also, clean up the API for constructing new types.
2190
2191         * UIProcess/API/Cocoa/_WKElementAction.h: Add new types for opening
2192         in new tabs, windows and downloading.
2193         * UIProcess/API/Cocoa/_WKElementAction.mm:
2194         (+[_WKElementAction elementActionWithType:title:actionHandler:]): New constructor
2195         with type, title and action.
2196         (+[_WKElementAction elementActionWithType:]): Call new method.
2197
2198 2019-04-18  Daniel Bates  <dabates@apple.com>
2199
2200         Use existing KeyEventCodesIOS constants instead of duplicating them
2201         https://bugs.webkit.org/show_bug.cgi?id=197081
2202
2203         Rubber-stamped by Wenson Hsieh.
2204
2205         * UIProcess/ios/WKContentViewInteraction.mm:
2206         (-[WKContentView _interpretKeyEvent:isCharEvent:]): While I am here, remove the case for the space key
2207         as it is identical to the default switch case.
2208
2209 2019-04-19  Keith Rollin  <krollin@apple.com>
2210
2211         Add postprocess-header-rule scripts
2212         https://bugs.webkit.org/show_bug.cgi?id=197072
2213         <rdar://problem/50027299>
2214
2215         Reviewed by Brent Fulgham.
2216
2217         Several projects have post-processing build phases where exported
2218         headers are tweaked after they've been copied. This post-processing is
2219         performed via scripts called postprocess-headers.sh. For reasons
2220         related to XCBuild, we are now transitioning to a build process where
2221         the post-processing is performed at the same time as the
2222         exporting/copying. To support this process, add similar scripts named
2223         postprocess-header-rule, which are geared towards processing a single
2224         file at a time rather than all exported files at once. Also add a
2225         build rule that makes use of these scripts. These scripts and build
2226         rules are not used at the moment; they will come into use in an
2227         imminent patch.
2228
2229         Note that I've named these postprocess-header-rule rather than
2230         postprocess-header-rule.sh. Scripts in Tools/Scripts do not have
2231         suffixes indicating how the tool is implemented. Scripts in
2232         per-project Scripts folders appear to be mixed regarding the use of
2233         suffixes. I'm opting here to follow the Tools/Scripts convention, with
2234         the expectation that over time we completely standardize on that.
2235
2236         * Scripts/postprocess-header-rule: Added.
2237         * WebKit.xcodeproj/project.pbxproj:
2238
2239 2019-04-19  Brady Eidson  <beidson@apple.com>
2240
2241         Deprecate WebKit2 plug-in support.
2242         <rdar://problem/43812306> and https://bugs.webkit.org/show_bug.cgi?id=197080
2243
2244         Reviewed by Andy Estes.
2245
2246         * UIProcess/API/Cocoa/WKPreferences.h:
2247         * UIProcess/API/Cocoa/WKPreferences.mm:
2248         (-[WKPreferences encodeWithCoder:]):
2249         (-[WKPreferences initWithCoder:]):
2250         (-[WKPreferences javaEnabled]):
2251         (-[WKPreferences setJavaEnabled:]):
2252         (-[WKPreferences plugInsEnabled]):
2253         (-[WKPreferences setPlugInsEnabled:]):
2254
2255 2019-04-19  Chris Dumez  <cdumez@apple.com>
2256
2257         Minor PSON release logging improvements
2258         https://bugs.webkit.org/show_bug.cgi?id=197104
2259
2260         Reviewed by Darin Adler.
2261
2262         * UIProcess/SuspendedPageProxy.cpp:
2263         (WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
2264         * UIProcess/WebPageProxy.cpp:
2265         (WebKit::WebPageProxy::continueNavigationInNewProcess):
2266
2267 2019-04-19  Tim Horton  <timothy_horton@apple.com>
2268
2269         YouTube and Twitter embeds don't load in News
2270         https://bugs.webkit.org/show_bug.cgi?id=197111
2271         <rdar://problem/50010081>
2272
2273         Reviewed by Timothy Hatcher.
2274
2275         * WebProcess/com.apple.WebProcess.sb.in:
2276         Adjust this sandbox exception to include both platforms.
2277
2278 2019-04-19  Wenson Hsieh  <wenson_hsieh@apple.com>
2279
2280         [iOS] Add quirks to disable autocorrection and autocapitalization in hidden editable areas on some websites
2281         https://bugs.webkit.org/show_bug.cgi?id=197102
2282         <rdar://problem/49864669>
2283
2284         Reviewed by Ryosuke Niwa.
2285
2286         If the quirk for disabling autocorrection and autocapitalization in hidden editable areas is active, then check
2287         whether the focused element is hidden, and turn off autocorrection and autocapitalization if needed.
2288
2289         * WebProcess/WebPage/ios/WebPageIOS.mm:
2290         (WebKit::WebPage::getFocusedElementInformation):
2291
2292 2019-04-19  Commit Queue  <commit-queue@webkit.org>
2293
2294         Unreviewed, rolling out r244447.
2295         https://bugs.webkit.org/show_bug.cgi?id=197103
2296
2297         Caused build failures with Internal and Opensource builders
2298         (Requested by ShawnRoberts on #webkit).
2299
2300         Reverted changeset:
2301
2302         "Deprecate WebKit2 plug-in support."
2303         https://bugs.webkit.org/show_bug.cgi?id=197080
2304         https://trac.webkit.org/changeset/244447
2305
2306 2019-04-18  Brady Eidson  <beidson@apple.com>
2307
2308         Deprecate WebKit2 plug-in support.
2309         <rdar://problem/43812306> and https://bugs.webkit.org/show_bug.cgi?id=197080
2310
2311         Reviewed by Andy Estes.
2312
2313         * UIProcess/API/Cocoa/WKPreferences.h:
2314         * UIProcess/API/Cocoa/WKPreferences.mm:
2315         (-[WKPreferences encodeWithCoder:]):
2316         (-[WKPreferences initWithCoder:]):
2317         (-[WKPreferences javaEnabled]):
2318         (-[WKPreferences setJavaEnabled:]):
2319         (-[WKPreferences plugInsEnabled]):
2320         (-[WKPreferences setPlugInsEnabled:]):
2321
2322 2019-04-18  Commit Queue  <commit-queue@webkit.org>
2323
2324         Unreviewed, rolling out r244434.
2325         https://bugs.webkit.org/show_bug.cgi?id=197089
2326
2327         caused 1 API test failure (Requested by zalan on #webkit).
2328
2329         Reverted changeset:
2330
2331         "Regression (r244291): Broken API Test
2332         AutoLayoutRenderingProgressRelativeOrdering"
2333         https://bugs.webkit.org/show_bug.cgi?id=196948
2334         https://trac.webkit.org/changeset/244434
2335
2336 2019-04-18  Wenson Hsieh  <wenson_hsieh@apple.com>
2337
2338         Add new compatibility mode API on WKNavigation
2339         https://bugs.webkit.org/show_bug.cgi?id=197069
2340         <rdar://problem/50025800>
2341
2342         Reviewed by Tim Horton.
2343
2344         Adds a new property on WKNavigation.
2345
2346         * Shared/WebCompatibilityMode.h:
2347
2348         Drive-by fix: make this enum class 8 bits wide.
2349
2350         * UIProcess/API/APINavigation.h:
2351         (API::Navigation::setEffectiveCompatibilityMode):
2352         (API::Navigation::effectiveCompatibilityMode const):
2353
2354         Add a new member variable to API::Navigation.
2355
2356         * UIProcess/API/Cocoa/WKNavigation.h:
2357         * UIProcess/API/Cocoa/WKNavigation.mm:
2358         * UIProcess/API/Cocoa/WKWebpagePreferences.mm:
2359         * UIProcess/API/Cocoa/WKWebpagePreferencesInternal.h:
2360
2361         Add various hooks into WebKitAdditions.
2362
2363         * UIProcess/WebPageProxy.cpp:
2364         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2365
2366         Set API::Navigation's effective compatibility mode.
2367
2368         (WebKit::WebPageProxy::effectiveCompatibilityModeAfterAdjustingPolicies):
2369
2370         Renamed and refactored this method to return the effective compatibility mode, chosen while adjusting website
2371         policies.
2372
2373         (WebKit::WebPageProxy::adjustPoliciesForCompatibilityMode): Deleted.
2374         * UIProcess/WebPageProxy.h:
2375
2376 2019-04-18  Don Olmstead  <don.olmstead@sony.com>
2377
2378         [CMake] Make WebCore headers copies
2379         https://bugs.webkit.org/show_bug.cgi?id=182512
2380         <rdar://problem/37510435>
2381
2382         Reviewed by Alex Christensen.
2383
2384         WebCore now uses WebCore_PRIVATE_INCLUDE_DIRECTORIES for all ports. This revealed
2385         problems with WebKit's usage of WebCore headers. All include directories directly
2386         referencing the WebCore source tree we're removed from the CMake files. Any includes
2387         of WebCore headers using "*.h" were modified to <WebCore/*.h>
2388
2389         Removed generation of forwarding headers for WebCore using the perl script.
2390
2391         * CMakeLists.txt:
2392         * NetworkProcess/curl/NetworkDataTaskCurl.h:
2393         * PlatformWPE.cmake:
2394         * PlatformWin.cmake:
2395         * Scripts/generate-forwarding-headers.pl:
2396         * UIProcess/API/glib/WebKitUserContentFilterStore.cpp:
2397         * UIProcess/API/wpe/WebKitColorPrivate.h:
2398         * UIProcess/WebsiteData/win/WebsiteDataStoreWin.cpp:
2399         * UIProcess/win/PageClientImpl.cpp:
2400
2401 2019-04-18  Chris Dumez  <cdumez@apple.com>
2402
2403         [iOS] Improve detection of when web views go to background / foreground
2404         https://bugs.webkit.org/show_bug.cgi?id=197035
2405         <rdar://problem/45281182>
2406
2407         Reviewed by Tim Horton.
2408
2409         Improve detection of when web views go to background / foreground on iOS.
2410
2411         * UIProcess/ApplicationStateTracker.mm:
2412         (WebKit::ApplicationStateTracker::ApplicationStateTracker): Deleted.
2413         (WebKit::ApplicationStateTracker::~ApplicationStateTracker): Deleted.
2414         (WebKit::ApplicationStateTracker::applicationDidEnterBackground): Deleted.
2415         (WebKit::ApplicationStateTracker::applicationDidFinishSnapshottingAfterEnteringBackground): Deleted.
2416         (WebKit::ApplicationStateTracker::applicationWillEnterForeground): Deleted.
2417
2418 2019-04-18  Jer Noble  <jer.noble@apple.com>
2419
2420         Refactoring: Pull all fullscreen code out of Document and into its own helper class
2421         https://bugs.webkit.org/show_bug.cgi?id=197017
2422
2423         Reviewed by Eric Carlson.
2424
2425         * WebProcess/FullScreen/WebFullScreenManager.cpp:
2426         (WebKit::WebFullScreenManager::willEnterFullScreen):
2427         (WebKit::WebFullScreenManager::didEnterFullScreen):
2428         (WebKit::WebFullScreenManager::willExitFullScreen):
2429         (WebKit::WebFullScreenManager::didExitFullScreen):
2430         (WebKit::WebFullScreenManager::setAnimatingFullScreen):
2431         (WebKit::WebFullScreenManager::requestExitFullScreen):
2432         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp:
2433         (webkit_dom_document_webkit_cancel_fullscreen):
2434         (webkit_dom_document_webkit_exit_fullscreen):
2435         (webkit_dom_document_get_webkit_is_fullscreen):
2436         (webkit_dom_document_get_webkit_fullscreen_keyboard_input_allowed):
2437         (webkit_dom_document_get_webkit_current_fullscreen_element):
2438         (webkit_dom_document_get_webkit_fullscreen_element):
2439         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2440         (WebKit::WebChromeClient::createWindow):
2441
2442 2019-04-18  Megan Gardner  <megan_gardner@apple.com>
2443
2444         Update UIKit when a cut causes a selection change
2445         https://bugs.webkit.org/show_bug.cgi?id=197047
2446         <rdar://problem/36311563>
2447
2448         Reviewed by Wenson Hsieh.
2449
2450         We need to let UIKit know when a cut causes a selection change (always),
2451         so that is can appropriately update the button on the keyboard bar.
2452
2453         * UIProcess/ios/WKContentViewInteraction.mm:
2454         (-[WKContentView cutForWebView:]):
2455
2456 2019-04-18  Brent Fulgham  <bfulgham@apple.com>
2457
2458         InjectedBundle parameters often need initialization function called before unarchiving
2459         https://bugs.webkit.org/show_bug.cgi?id=189709
2460         <rdar://problem/44573653>
2461
2462         Reviewed by Ryosuke Niwa.
2463
2464         Handle the case where the InjectedBundle parameters do not successfully decode because they contain
2465         an unexpected class from the embedding program. If this happens, try decoding the bundle parameters
2466         after the bundle initialiation function runs, which gives the embedding program the opportunity to
2467         register additional classes that are safe for serialization.
2468
2469         Extend WKWebProcessPlugIn with a method that returns the names of any custom classes that need
2470         to be serialized by the InjectedBundle.
2471         
2472         Create a new 'decodeBundleParameters' method that contains the logic that used to live in 'initialize'.
2473         Revise 'initialize' to call this new method.
2474
2475         * WebProcess/InjectedBundle/InjectedBundle.h:
2476         * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
2477         (WebKit::InjectedBundle::initialize): Use the new method.
2478         (WebKit::InjectedBundle::decodeBundleParameters): Added.
2479         (WebKit::InjectedBundle::setBundleParameters): Use 'decodeObjectOfClasses' with the more complete
2480         'classesForCoder' method to unarchive the passed bundle parameters, rather than the
2481         NSDictionary-specific method, since InjectedBundles often encode other types of objects, and the
2482         NSDictionary object may itself hold other kinds of objects.
2483         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h:
2484         (WebKit::WKWebProcessPlugIn::additionalClassesForParameterCoder): Added.
2485
2486 2019-04-18  Zalan Bujtas  <zalan@apple.com>
2487
2488         Regression (r244291): Broken API Test AutoLayoutRenderingProgressRelativeOrdering
2489         https://bugs.webkit.org/show_bug.cgi?id=196948
2490         <rdar://problem/49927131>
2491
2492         Reviewed by Tim Horton.
2493
2494         Move intrinsicContentSizeDidChange out of DrawingArea. Intrinsic content size is a layout concept and
2495         after r244291 there's no reason to have it in DrawingArea.
2496
2497         * UIProcess/DrawingAreaProxy.h:
2498         (WebKit::DrawingAreaProxy::didUpdateGeometry):
2499         (WebKit::DrawingAreaProxy::intrinsicContentSizeDidChange): Deleted.
2500         * UIProcess/DrawingAreaProxy.messages.in:
2501         * UIProcess/WebPageProxy.cpp:
2502         (WebKit::WebPageProxy::didChangeIntrinsicContentSize):
2503         (WebKit::WebPageProxy::setViewLayoutSize):
2504         * UIProcess/WebPageProxy.h:
2505         * UIProcess/WebPageProxy.messages.in:
2506         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
2507         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
2508         (WebKit::TiledCoreAnimationDrawingAreaProxy::intrinsicContentSizeDidChange): Deleted.
2509         * UIProcess/mac/WebPageProxyMac.mm:
2510         (WebKit::WebPageProxy::intrinsicContentSizeDidChange): Deleted.
2511         * WebProcess/WebPage/WebPage.cpp:
2512         (WebKit::WebPage::updateIntrinsicContentSizeIfNeeded):
2513         (WebKit::WebPage::dispatchDidReachLayoutMilestone):
2514         * WebProcess/WebPage/WebPage.h:
2515         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
2516         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2517         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
2518         (WebKit::TiledCoreAnimationDrawingArea::updateIntrinsicContentSizeIfNeeded): Deleted.
2519
2520 2019-04-18  Ryan Haddad  <ryanhaddad@apple.com>
2521
2522         Unreviewed, rolling out r244299.
2523
2524         Breaks internal tests.
2525
2526         Reverted changeset:
2527
2528         "InjectedBundle parameters often need initialization function
2529         called before unarchiving"
2530         https://bugs.webkit.org/show_bug.cgi?id=189709
2531         https://trac.webkit.org/changeset/244299
2532
2533 2019-04-18  Shawn Roberts  <sroberts@apple.com>
2534
2535         Unreviewed manual rollout of r244248 and r244409
2536         Causing assertion failures on Mac WK2 Debug builds
2537         https://bugs.webkit.org/show_bug.cgi?id=195623
2538
2539         * NetworkProcess/NetworkProcess.cpp:
2540         (WebKit::NetworkProcess::lowMemoryHandler):
2541         * NetworkProcess/NetworkProcess.h:
2542         (WebKit::NetworkProcess::prefetchCache): Deleted.
2543         * NetworkProcess/NetworkResourceLoader.cpp:
2544         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
2545         (WebKit::NetworkResourceLoader::didReceiveResponse):
2546         (WebKit::NetworkResourceLoader::didReceiveBuffer):
2547         (WebKit::NetworkResourceLoader::tryStoreAsCacheEntry):
2548         (WebKit::NetworkResourceLoader::isCrossOriginPrefetch const): Deleted.
2549         * NetworkProcess/NetworkResourceLoader.h:
2550         * NetworkProcess/cache/PrefetchCache.cpp: Removed.
2551         * NetworkProcess/cache/PrefetchCache.h: Removed.
2552         * Shared/WebPreferences.yaml:
2553         * Sources.txt:
2554         * WebKit.xcodeproj/project.pbxproj:
2555
2556 2019-04-18  Devin Rousso  <drousso@apple.com>
2557
2558         Web Inspector: Canvas: enable WebGL2 for inspector page
2559         https://bugs.webkit.org/show_bug.cgi?id=196932
2560         <rdar://problem/49916213>
2561
2562         Reviewed by Timothy Hatcher.
2563
2564         * WebProcess/WebPage/WebInspectorUI.cpp:
2565         (WebKit::WebInspectorUI::WebInspectorUI):
2566
2567 2019-04-17  Devin Rousso  <drousso@apple.com>
2568
2569         Web Inspector: InspectorFrontendHost::inspectionLevel returns wrong value for inspector3
2570         https://bugs.webkit.org/show_bug.cgi?id=197044
2571
2572         Reviewed by Joseph Pecoraro.
2573
2574         * UIProcess/WebInspectorUtilities.h:
2575         * UIProcess/WebInspectorUtilities.cpp:
2576         (WebKit::trackInspectorPage):
2577         (WebKit::untrackInspectorPage):
2578         Determine the level of the inspector page by looking to see if the page being inspected is
2579         in the inspector page map. If so, we must be inspecting an inspector page and should use
2580         that inspector page's inspection level as the value to increment.
2581
2582         * UIProcess/WebInspectorProxy.cpp:
2583         (WebKit::WebInspectorProxy::createFrontendPage):
2584         * UIProcess/RemoteWebInspectorProxy.cpp:
2585         (WebKit::RemoteWebInspectorProxy::createFrontendPageAndWindow):
2586
2587 2019-04-17  Tim Horton  <timothy_horton@apple.com>
2588
2589         Adopt different scroll view flashing SPI
2590         https://bugs.webkit.org/show_bug.cgi?id=197043
2591         <rdar://problem/49996476>
2592
2593         Reviewed by Wenson Hsieh.
2594
2595         * Platform/spi/ios/UIKitSPI.h:
2596         * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
2597         (-[WKKeyboardScrollViewAnimator scrollToContentOffset:animated:]):
2598
2599 2019-04-17  Tim Horton  <timothy_horton@apple.com>
2600
2601         REGRESSION (r241988): Switching tabs is slow
2602         https://bugs.webkit.org/show_bug.cgi?id=197037
2603         <rdar://problem/49951473>
2604
2605         Reviewed by Simon Fraser.
2606
2607         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
2608         (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState):
2609         r241988 changed to wait for a WebPageProxy message to a given DrawingArea ID,
2610         but WebPageProxy messages are identified by their WebPageProxy ID.
2611         Revert that one change. The rest of the patch looks OK.
2612
2613 2019-04-17  Rob Buis  <rbuis@igalia.com>
2614
2615         Link prefetch not useful for top-level navigation
2616         https://bugs.webkit.org/show_bug.cgi?id=195623
2617
2618         Reviewed by Alex Christensen.
2619
2620         Fix macOS and iOS Debug WK2 bots ASSERTS after r367404, by simply
2621         not sending the DidReceiveResponse message.
2622
2623         * NetworkProcess/NetworkResourceLoader.cpp:
2624         (WebKit::NetworkResourceLoader::didReceiveResponse):
2625
2626 2019-04-17  Truitt Savell  <tsavell@apple.com>
2627
2628         Unreviewed, rolling out r244400.
2629
2630         Caused testing to exit early with assertionon Debug WK2
2631
2632         Reverted changeset:
2633
2634         "UI↔Web deadlock when printing with a JavaScript alert
2635         visible"
2636         https://bugs.webkit.org/show_bug.cgi?id=196839
2637         https://trac.webkit.org/changeset/244400
2638
2639 2019-04-17  Brady Eidson  <beidson@apple.com>
2640
2641         Link clicks in PDFs shouldn't send referrer headers.
2642         <rdar://problem/21142581> and https://bugs.webkit.org/show_bug.cgi?id=196980
2643
2644         Reviewed by Tim Horton.
2645
2646         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2647         (WebKit::PDFPlugin::clickedLink):
2648         * WebProcess/WebPage/WebPage.cpp:
2649         (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick):
2650
2651 2019-04-17  Andy Estes  <aestes@apple.com>
2652
2653         [iOS] Support multiple file selection in UIDocumentPickerViewController
2654         https://bugs.webkit.org/show_bug.cgi?id=197014
2655         <rdar://problem/49963514>
2656
2657         Reviewed by Tim Horton.
2658
2659         * UIProcess/ios/forms/WKFileUploadPanel.mm:
2660         (-[WKFileUploadPanel _showDocumentPickerMenu]):
2661         Allowed multiple file selection in our UIDocumentPickerViewController when
2662         _allowMultipleFiles is YES.
2663
2664         (displayStringForDocumentsAtURLs):
2665         (-[WKFileUploadPanel documentPicker:didPickDocumentsAtURLs:]):
2666         Changed to support multiple file selection. When more than one file is selected, use
2667         WebCore::multipleFileUploadText() as the display string.
2668
2669 2019-04-17  Alex Christensen  <achristensen@webkit.org>
2670
2671         Make WebCompiledContentRuleListData non-default-constructible, move its nonserialized member to API::ContentRuleList
2672         https://bugs.webkit.org/show_bug.cgi?id=197033
2673
2674         Reviewed by Tim Horton.
2675
2676         This is just cleanup that makes the code nicer without changing behavior.
2677
2678         * Shared/WebCompiledContentRuleListData.cpp:
2679         (WebKit::WebCompiledContentRuleListData::encode const):
2680         (WebKit::WebCompiledContentRuleListData::decode):
2681         * Shared/WebCompiledContentRuleListData.h:
2682         (WebKit::WebCompiledContentRuleListData::WebCompiledContentRuleListData):
2683         * UIProcess/API/APIContentRuleList.h:
2684         * UIProcess/API/APIContentRuleListStore.cpp:
2685         (API::createExtension):
2686
2687 2019-04-17  John Wilander  <wilander@apple.com>
2688
2689         Add prioritization of ad click conversions and cleaning of sent ad click conversions
2690         https://bugs.webkit.org/show_bug.cgi?id=196934
2691         <rdar://problem/49917773>
2692
2693         Reviewed by Chris Dumez.
2694
2695         In this description, by "pair" I mean { AdClickAttribution::Source, AdClickAttribution::Destination }.
2696
2697         This patch adds handling of prioritization of conversions according to these rules:
2698         - If we have a matching unconverted attribution, convert it. This consumes the conversion.
2699         - If we have no previously converted attribution for this pair, just store.
2700         - If we have a previously converted attribution for this pair, replace it if the new one has higher priority.
2701         - If we had no matching unconverted attribution but do have a previously converted attribution for this
2702         pair, re-convert the previously converted attribution to make sure the highest priority gets set.
2703
2704         This handling is in part done by dividing the previous m_adClickAttributionMap into 
2705         m_unconvertedAdClickAttributionMap and m_convertedAdClickAttributionMap, which now use a std::pair
2706         as key instead of a nested HashMap.
2707
2708         This patch also changes AdClickAttributionManager::firePendingConversionRequests() so that it now
2709         removes attributions which have been sent out.
2710
2711         Finally, AdClickAttributionManager::clear() no longer clears m_conversionBaseURLForTesting and
2712         m_isRunningTest since doing so caused test flakiness. It is now up to the test case that sets these
2713         members to also clear them when done.
2714
2715         * NetworkProcess/AdClickAttributionManager.cpp:
2716         (WebKit::AdClickAttributionManager::storeUnconverted):
2717         (WebKit::AdClickAttributionManager::convert):
2718         (WebKit::AdClickAttributionManager::firePendingConversionRequests):
2719         (WebKit::AdClickAttributionManager::clear):
2720         (WebKit::AdClickAttributionManager::toString const):
2721         (WebKit::AdClickAttributionManager::setConversionURLForTesting):
2722         (WebKit::AdClickAttributionManager::ensureDestinationMapForSource): Deleted.
2723         (WebKit::AdClickAttributionManager::store): Deleted.
2724         * NetworkProcess/AdClickAttributionManager.h:
2725         (WebKit::AdClickAttributionManager::AdClickAttributionManager):
2726         (WebKit::AdClickAttributionManager::setConversionURLForTesting): Deleted.
2727         * NetworkProcess/NetworkSession.cpp:
2728         (WebKit::NetworkSession::storeAdClickAttribution):
2729
2730 2019-04-17  Tim Horton  <timothy_horton@apple.com>
2731
2732         UI↔Web deadlock when printing with a JavaScript alert visible
2733         https://bugs.webkit.org/show_bug.cgi?id=196839
2734         <rdar://problem/49157642>
2735
2736         Reviewed by Andy Estes.
2737
2738         * Platform/IPC/Connection.cpp:
2739         (IPC::Connection::dispatchWorkQueueMessageReceiverMessage):
2740         (IPC::Connection::sendSyncReply):
2741         (IPC::Connection::dispatchSyncMessage):
2742         * Platform/IPC/Connection.h:
2743         (IPC::Connection::hasOutstandingOutgoingSynchronousReplies const):
2744         Keep track of whether we owe the other side of the connection any
2745         delayed sync replies.
2746
2747         * UIProcess/API/Cocoa/WKWebView.mm:
2748         (-[WKWebView _webViewPrintFormatter]):
2749         Most actions one can take with a _WKWebViewPrintFormatter involve
2750         synchronously messaging the Web Content process with an infinite timeout.
2751         Doing so while the Web Content process is awaiting a reply to a deferred-reply
2752         synchronous message (like, say, an alert()) results in an app-destroying deadlock.
2753         Instead of that, return a nil _WKWebViewPrintFormatter, indicating to the client
2754         that we can't print right now.
2755
2756         * UIProcess/ios/WKContentView.mm:
2757         (-[WKContentView _wk_pageCountForPrintFormatter:]):
2758         (-[WKContentView _wk_printedDocument]):
2759         The above isn't sufficient, though, because a sync message could arrive and
2760         be handled between creation and use of the _WKWebViewPrintFormatter.
2761         So, we also bail with a zero page count and null CGPDFDocument immediately
2762         before we would send a sync message to the Web Content process. Clients
2763         handle this less gracefully (e.g. showing a zero page PDF), but it is
2764         very rare compared to the above case.
2765
2766 2019-04-17  Zalan Bujtas  <zalan@apple.com>
2767
2768         [ContentChangeObserver] Use aria role as a hint whether a tap should result in a synthetic click
2769         https://bugs.webkit.org/show_bug.cgi?id=196988
2770         <rdar://problem/49955328>
2771
2772         Reviewed by Simon Fraser.
2773
2774         Tapping on elements with cretain aria role attributes should trigger synthetic click the same way it does on form control elements. 
2775
2776         * WebProcess/WebPage/ios/WebPageIOS.mm:
2777         (WebKit::isAriaRoleForImmediateClick):
2778         (WebKit::nodeAlwaysRequiresClick):
2779         (WebKit::WebPage::handleSyntheticClick):
2780
2781 2019-04-17  Alex Christensen  <achristensen@webkit.org>
2782
2783         WKRetainPtr's adoption constructor should be private
2784         https://bugs.webkit.org/show_bug.cgi?id=197019
2785
2786         Reviewed by Tim Horton.
2787
2788         RefPtr and RetainPtr have already done this.  It makes us use nicer syntax.
2789
2790         * UIProcess/API/C/WKContext.cpp:
2791         (WKContextSetDownloadClient):
2792         * UIProcess/API/cpp/WKRetainPtr.h:
2793         (WebKit::WKRetainPtr::WKRetainPtr):
2794         (WebKit::adoptWK):
2795
2796 2019-04-17  Alex Christensen  <achristensen@webkit.org>
2797
2798         Fix crash during teardown of PingLoad
2799         https://bugs.webkit.org/show_bug.cgi?id=197024
2800         <rdar://problem/49973077>
2801
2802         Reviewed by Jer Noble.
2803
2804         * NetworkProcess/PingLoad.cpp:
2805         (WebKit::PingLoad::initialize):
2806         Early return if weakThis is null.
2807
2808 2019-04-17  Wenson Hsieh  <wenson_hsieh@apple.com>
2809
2810         REGRESSION (r243926): [iOS] Release assertion when computing editor state during an overflow scroll triggered by layout
2811         https://bugs.webkit.org/show_bug.cgi?id=197012
2812         <rdar://problem/49908848>
2813
2814         Reviewed by Simon Fraser.
2815
2816         We hit the release assertion due to the following sequence of events:
2817         - Dispatch a queued event (in this case, a scroll event)
2818         - Invoke the scroll event listener, which modifies layout in some way
2819         - This scrolls an overflow scrollable container under the scope of layout
2820         - Overflow scrolling then calls didChangeSelection and triggers an editor state update, which updates layout
2821
2822         In the case where the selection is in the main frame, we bail early due to the check for recursive layout (i.e.
2823         frameView->layoutContext().isInRenderTreeLayout()). However, in the case where the selection is inside a
2824         subframe, we end up skipping past this check, since the subframe's FrameView isn't currently laying out, and so
2825         we end up hitting the release assertion underneath the early return.
2826
2827         To fix this, simply defer editor state updates due to overflow scrolling until the next remote layer tree commit
2828         instead of computing and sending the information immediately. While this only defers editor state updates during
2829         overflow scrolling, <rdar://problem/47258878> tracks making editor state updates deferred in the general case.
2830
2831         Test: editing/selection/overflow-scroll-while-selecting-text.html
2832
2833         * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
2834         (WebKit::WebEditorClient::overflowScrollPositionChanged):
2835         * WebProcess/WebPage/WebPage.cpp:
2836         (WebKit::WebPage::didChangeOverflowScrollPosition):
2837         (WebKit::WebPage::didChangeSelection):
2838         (WebKit::WebPage::didChangeSelectionOrOverflowScrollPosition):
2839         * WebProcess/WebPage/WebPage.h:
2840
2841 2019-04-17  Chris Dumez  <cdumez@apple.com>
2842
2843         Remember device orientation permission for the duration of the browsing session
2844         https://bugs.webkit.org/show_bug.cgi?id=196992
2845         <rdar://problem/49946067>
2846
2847         Reviewed by Alex Christensen.
2848
2849         Implement caching of device orientation permission decisions on the WebDeviceOrientationAndMotionAccessController,
2850         which is owned by the WebsiteDataStore. This way, if we already prompted the user of a given origin, we will
2851         remember the previous decision for the duration of the session and not prompt again.
2852
2853         * Shared/WebsitePoliciesData.cpp:
2854         (WebKit::WebsitePoliciesData::encode const):
2855         (WebKit::WebsitePoliciesData::decode):
2856         * Shared/WebsitePoliciesData.h:
2857         * UIProcess/API/APIWebsitePolicies.cpp:
2858         (API::WebsitePolicies::copy const):
2859         (API::WebsitePolicies::data):
2860         * UIProcess/API/APIWebsitePolicies.h:
2861         * UIProcess/API/Cocoa/WKWebpagePreferences.mm:
2862         (toDeviceOrientationOrMotionPermissionState):
2863         (-[WKWebpagePreferences _setDeviceOrientationAndMotionAccessPolicy:]):
2864         (toWKWebsiteDeviceOrientationAndMotionAccessPolicy):
2865         (-[WKWebpagePreferences _deviceOrientationAndMotionAccessPolicy]):
2866         * UIProcess/WebPageProxy.cpp:
2867         (WebKit::WebPageProxy::shouldAllowDeviceOrientationAndMotionAccess):
2868         * UIProcess/WebPageProxy.h:
2869         * UIProcess/WebPageProxy.messages.in:
2870         * UIProcess/WebsiteData/WebDeviceOrientationAndMotionAccessController.cpp: Added.
2871         (WebKit::WebDeviceOrientationAndMotionAccessController::shouldAllowDeviceOrientationAndMotionAccess):
2872         (WebKit::WebDeviceOrientationAndMotionAccessController::deviceOrientationPermission const):
2873         * UIProcess/WebsiteData/WebDeviceOrientationAndMotionAccessController.h: Copied from Source/WebCore/dom/DeviceOrientationAndMotionAccessController.h.
2874         * UIProcess/WebsiteData/WebsiteDataStore.h:
2875         (WebKit::WebsiteDataStore::deviceOrientationAndMotionAccessController):
2876         * WebKit.xcodeproj/project.pbxproj:
2877         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2878         (WebKit::WebChromeClient::shouldAllowDeviceOrientationAndMotionAccess):
2879         * WebProcess/WebCoreSupport/WebChromeClient.h:
2880         * WebProcess/WebPage/WebPage.cpp:
2881         (WebKit::WebPage::shouldAllowDeviceOrientationAndMotionAccess):
2882         * WebProcess/WebPage/WebPage.h:
2883
2884 2019-04-16  Andy Estes  <aestes@apple.com>
2885
2886         [iOSMac] Use UIDocumentPickerViewController for picking files
2887         https://bugs.webkit.org/show_bug.cgi?id=196999
2888         <rdar://problem/49961414>
2889
2890         Reviewed by Tim Horton.
2891
2892         * UIProcess/ios/forms/WKFileUploadPanel.mm:
2893         (-[WKFileUploadPanel _showDocumentPickerMenu]):
2894         Changed to present a UIDocumentPickerViewController on iOSMac.
2895
2896         (-[WKFileUploadPanel documentPicker:didPickDocumentsAtURLs:]):
2897         (-[WKFileUploadPanel documentPicker:didPickDocumentAtURL:]):
2898         Replaced a deprecated delegate method implementation.
2899
2900 2019-04-16  Wenson Hsieh  <wenson_hsieh@apple.com>
2901
2902         [iOS] [WebKit2] Add support for honoring -[UIMenuItem dontDismiss]
2903         https://bugs.webkit.org/show_bug.cgi?id=196919
2904         <rdar://problem/41630459>
2905
2906         Reviewed by Tim Horton.
2907
2908         Adds modern WebKit support for -dontDismiss by implementing a couple of new platform hooks. Covered by a new
2909         layout test: editing/selection/ios/selection-after-changing-text-with-callout-menu.html.
2910
2911         * Platform/spi/ios/UIKitSPI.h:
2912
2913         Declare the private -dontDismiss property of UIMenuItem.
2914
2915         * UIProcess/API/Cocoa/WKWebView.mm:
2916         (-[WKWebView willFinishIgnoringCalloutBarFadeAfterPerformingAction]):
2917
2918         Additionally teach the web view (not just the content view) to respond to the hook. This matters in the case
2919         where the WebKit client (most notably, Mail) overrides WKWebView methods to define custom actions in the menu
2920         controller. This scenario is exercised by the new layout test.
2921
2922         * UIProcess/ios/WKContentViewInteraction.h:
2923         * UIProcess/ios/WKContentViewInteraction.mm:
2924         (-[WKContentView willFinishIgnoringCalloutBarFadeAfterPerformingAction]):
2925
2926         If an action was performed where callout bar fading was ignored, then in WebKit, don't allow selection changes
2927         to fade the callout bar until after the next remote layer tree commit.
2928
2929         (-[WKContentView _updateChangedSelection:]):
2930
2931         Stop suppressing selection updates when showing B/I/U controls, now that we can properly honor the -dontDismiss
2932         property. This was originally introduced in <rdar://problem/15199925>, presumably to ensure that B/I/U buttons
2933         (which have -dontDismiss set to YES) don't trigger selection change and end up dismissing themselves; however,
2934         if triggering B/I/U actually changes the selection rects, this also means that the selection rects on-screen
2935         would be stale after triggering these actions. This effect is most noticeable when bolding text.
2936
2937         (-[WKContentView shouldAllowHidingSelectionCommands]):
2938
2939 2019-04-16  Ross Kirsling  <ross.kirsling@sony.com>
2940
2941         Unreviewed non-unified build fix after r244307.
2942
2943         * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h:
2944
2945 2019-04-16  Megan Gardner  <megan_gardner@apple.com>
2946
2947         Allow sharing from imageSheet on an image document
2948         https://bugs.webkit.org/show_bug.cgi?id=196891
2949         <rdar://problem/25377386>
2950
2951         Reviewed by Tim Horton.
2952
2953         Allow sharing from an image sheet generated from an image document
2954         by storing the image URL and using it as a fallback for the URL.
2955         Store it as an image on WKElementAction to not accidentally trigger
2956         any actions that should actually be associated with pure URLs.
2957
2958         * UIProcess/API/Cocoa/_WKActivatedElementInfo.h:
2959         * UIProcess/API/Cocoa/_WKActivatedElementInfo.mm:
2960         (-[_WKActivatedElementInfo _initWithInteractionInformationAtPosition:]):
2961         (-[_WKActivatedElementInfo _initWithType:URL:imageURL:location:title:ID:rect:image:]):
2962         (-[_WKActivatedElementInfo _initWithType:URL:imageURL:location:title:ID:rect:image:userInfo:]):
2963         (-[_WKActivatedElementInfo imageURL]):
2964         (-[_WKActivatedElementInfo _initWithType:URL:location:title:ID:rect:image:]): Deleted.
2965         (-[_WKActivatedElementInfo _initWithType:URL:location:title:ID:rect:image:userInfo:]): Deleted.
2966         * UIProcess/API/Cocoa/_WKActivatedElementInfoInternal.h:
2967         * UIProcess/API/Cocoa/_WKElementAction.mm:
2968         (+[_WKElementAction _elementActionWithType:customTitle:assistant:]):
2969         * UIProcess/ios/WKActionSheetAssistant.mm:
2970         (-[WKActionSheetAssistant showImageSheet]):
2971         (-[WKActionSheetAssistant defaultActionsForImageSheet:]):
2972         (-[WKActionSheetAssistant showLinkSheet]):
2973         * UIProcess/ios/WKContentViewInteraction.mm:
2974         (-[WKContentView _showAttachmentSheet]):
2975         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
2976         (-[WKContentView _presentedViewControllerForPreviewItemController:]):
2977
2978 2019-04-16  Wenson Hsieh  <wenson_hsieh@apple.com>
2979
2980         [Cocoa] Add a way for Apple-internal clients to opt into recommended compatibility mode
2981         https://bugs.webkit.org/show_bug.cgi?id=196977
2982         <rdar://problem/49871194>
2983
2984         Reviewed by Tim Horton.
2985
2986         Add a helper method to query whether the navigation client should bypass policy safeguards when determining the
2987         recommended compatibility mode. We bypass policy safeguards in Cocoa platforms if the navigation delegate
2988         implements the new navigation delegate API.
2989
2990         * UIProcess/API/APINavigationClient.h:
2991         (API::NavigationClient::shouldBypassCompatibilityModeSafeguards const):
2992         * UIProcess/Cocoa/NavigationState.h:
2993         * UIProcess/Cocoa/NavigationState.mm:
2994         (WebKit::NavigationState::NavigationClient::shouldBypassCompatibilityModeSafeguards const):
2995
2996 2019-04-16  Per Arne Vollan  <pvollan@apple.com>
2997
2998         -[WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:] never returns _WKWebsiteDataTypeCredentials
2999         https://bugs.webkit.org/show_bug.cgi?id=196991
3000         <rdar://problem/45507423>
3001
3002         Reviewed by Brent Fulgham.
3003
3004         The credentials are stored in the Network process. To enable fetching credentials from the Network process,
3005         a proper process access type needs to be set for the credential Website data type.
3006
3007         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3008         (WebKit::computeNetworkProcessAccessTypeForDataFetch):
3009
3010 2019-04-16  Alex Christensen  <achristensen@webkit.org>
3011
3012         REGRESSION(r244162) Clearing website data from ephemeral WKWebsiteDataStore should finish instead of asserting or hanging
3013         https://bugs.webkit.org/show_bug.cgi?id=196995
3014
3015         Reviewed by Brady Eidson.
3016
3017         Always call CompletionHandlers.  Otherwise things hang or assert.
3018         I added an API test that asserts without this change so we don't regress this again.
3019
3020         * NetworkProcess/cache/CacheStorageEngine.cpp:
3021         (WebKit::CacheStorage::Engine::clearAllCaches):
3022         (WebKit::CacheStorage::Engine::clearCachesForOrigin):
3023
3024 2019-04-16  Chris Dumez  <cdumez@apple.com>
3025
3026         URL set by document.open() is not communicated to the UIProcess
3027         https://bugs.webkit.org/show_bug.cgi?id=196941
3028         <rdar://problem/49237544>
3029
3030         Reviewed by Geoff Garen.
3031
3032         Whenever the UIProcess is notified of an explicit document.open() call, update the
3033         PageLoadState to make sure the URL is up-to-date. Also make sure the page / process
3034         knows it committed a load (i.e. It is no longer showing the initially empty document).
3035
3036         * UIProcess/PageLoadState.cpp:
3037         (WebKit::PageLoadState::didExplicitOpen):
3038         * UIProcess/PageLoadState.h:
3039         * UIProcess/WebPageProxy.cpp:
3040         (WebKit::WebPageProxy::didExplicitOpenForFrame):
3041         * UIProcess/WebPageProxy.h:
3042         * UIProcess/WebPageProxy.messages.in:
3043         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3044         (WebKit::WebFrameLoaderClient::dispatchDidExplicitOpen):
3045         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
3046
3047 2019-04-16  Chris Dumez  <cdumez@apple.com>
3048
3049         Show prompt for device orientation access if the client does not implement the corresponding API delegate
3050         https://bugs.webkit.org/show_bug.cgi?id=196971
3051         <rdar://problem/49945840>
3052
3053         Reviewed by Alex Christensen.
3054
3055         Show prompt for device orientation access if the client does not implement the corresponding
3056         API delegate, instead of rejecting access by default.
3057
3058         * UIProcess/Cocoa/UIDelegate.mm:
3059         (WebKit::UIDelegate::UIClient::shouldAllowDeviceOrientationAndMotionAccess):
3060         * UIProcess/Cocoa/WKOrientationAccessAlert.h: Added.
3061         * UIProcess/Cocoa/WKOrientationAccessAlert.mm: Added.
3062         (WebKit::presentOrientationAccessAlert):
3063         * WebKit.xcodeproj/project.pbxproj:
3064
3065 2019-04-16  Zalan Bujtas  <zalan@apple.com>
3066
3067         REGRESSION(r243557)[ContentChangeObserver] Need to double tap text formatting elements in MS Word web app
3068         https://bugs.webkit.org/show_bug.cgi?id=196975
3069         <rdar://problem/49489849>
3070
3071         Reviewed by Simon Fraser.
3072
3073         This patch ensures that we always proceed with synthetic click on form elements.
3074
3075         Covered by existing tests.
3076
3077         * WebProcess/WebPage/ios/WebPageIOS.mm:
3078         (WebKit::WebPage::handleSyntheticClick):
3079
3080 2019-04-16  Timothy Hatcher  <timothy@apple.com>
3081
3082         FrameView base background color always starts white.
3083         https://bugs.webkit.org/show_bug.cgi?id=196976
3084
3085         Reviewed by Beth Dakin.
3086
3087         * WebProcess/WebPage/WebPage.cpp:
3088         (WebKit::WebPage::WebPage): Set m_backgroundColor before calling
3089         WebFrame::createWithCoreMainFrame so the call to create the FrameView
3090         for the empty page in transitionToCommittedForNewPage() gets
3091         the correct color from WebPage.
3092
3093 2019-04-16  Ryan Haddad  <ryanhaddad@apple.com>
3094
3095         Unreviewed, fix the build with recent SDKs.
3096
3097         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
3098         (WebKit::WKWebViewState::store):
3099
3100 2019-04-16  Commit Queue  <commit-queue@webkit.org>
3101
3102         Unreviewed, rolling out r244321.
3103         https://bugs.webkit.org/show_bug.cgi?id=196968
3104
3105         Causing all WK2 Debug builds to exit early after Assertion
3106         failures. (Requested by ShawnRoberts on #webkit).
3107
3108         Reverted changeset:
3109
3110         "URL set by document.open() is not communicated to the
3111         UIProcess"
3112         https://bugs.webkit.org/show_bug.cgi?id=196941
3113         https://trac.webkit.org/changeset/244321
3114
3115 2019-04-15  Joseph Pecoraro  <pecoraro@apple.com>
3116
3117         Web Inspector: CRASH when reopening tab with docked inspector on crashed page
3118         https://bugs.webkit.org/show_bug.cgi?id=196954
3119         <rdar://problem/48716433>
3120
3121         Reviewed by Ryosuke Niwa.
3122
3123         * UIProcess/mac/WebInspectorProxyMac.mm:
3124         (WebKit::WebInspectorProxy::inspectedViewFrameDidChange):
3125
3126 2019-04-15  Chris Dumez  <cdumez@apple.com>
3127
3128         URL set by document.open() is not communicated to the UIProcess
3129         https://bugs.webkit.org/show_bug.cgi?id=196941
3130         <rdar://problem/49237544>
3131
3132         Reviewed by Geoffrey Garen.
3133
3134         Whenever the UIProcess is notified of an explicit document.open() call, update the
3135         PageLoadState to make sure the URL is up-to-date. Also make sure the page / process
3136         knows it committed a load (i.e. It is no longer showing the initially empty document).
3137
3138         * UIProcess/PageLoadState.cpp:
3139         (WebKit::PageLoadState::didExplicitOpen):
3140         * UIProcess/PageLoadState.h:
3141         * UIProcess/WebPageProxy.cpp:
3142         (WebKit::WebPageProxy::didExplicitOpenForFrame):
3143         * UIProcess/WebPageProxy.h:
3144         * UIProcess/WebPageProxy.messages.in:
3145         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3146         (WebKit::WebFrameLoaderClient::dispatchDidExplicitOpen):
3147         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
3148
3149 2019-04-15  Alex Christensen  <achristensen@webkit.org>
3150
3151         Stop using hyphenationFactor
3152         https://bugs.webkit.org/show_bug.cgi?id=196949
3153         <rdar://problem/49779594>
3154
3155         Reviewed by Geoffrey Garen.
3156
3157         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
3158         (-[WKSafeBrowsingTextView initWithAttributedString:forWarning:]):
3159         I added this use of hyphenationFactor in r241124 but the other changes in that revision make the use of hyphenationFactor redundant.
3160         There is a reason to remove it in the radar.
3161
3162 2019-04-15  Alex Christensen  <achristensen@webkit.org>
3163
3164         Forward declare WKWebView in _WKDiagnosticLoggingDelegate.h
3165
3166         * UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h:
3167         This fixes builds where _WKDiagnosticLoggingDelegate.h is the only WebKit header included, such as my work on rdar://problem/35175989
3168
3169 2019-04-15  Jer Noble  <jer.noble@apple.com>
3170
3171         Add a DiagnosticLogging method taking an arbitrary dictionary of values.
3172         https://bugs.webkit.org/show_bug.cgi?id=196773
3173
3174         Reviewed by Alex Christensen.
3175
3176         In addition to adding the new logging delegate method (and piping everything into it), 
3177         add a new APIObject class to represent a signed integer.
3178
3179         * Shared/API/APINumber.h:
3180         * Shared/API/APIObject.h:
3181         * Shared/Cocoa/APIObject.mm:
3182         (API::Object::newObject):
3183         * Shared/Cocoa/WKNSNumber.mm:
3184         (-[WKNSNumber dealloc]):
3185         (-[WKNSNumber objCType]):
3186         (-[WKNSNumber getValue:]):
3187         (-[WKNSNumber longLongValue]):
3188         (-[WKNSNumber _apiObject]):
3189         * Shared/UserData.cpp:
3190         (WebKit::UserData::encode):
3191         (WebKit::UserData::decode):
3192         * UIProcess/API/APIDiagnosticLoggingClient.h:
3193         * UIProcess/API/C/WKPageDiagnosticLoggingClient.h:
3194         * UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h:
3195         * UIProcess/Cocoa/DiagnosticLoggingClient.h:
3196         * UIProcess/Cocoa/DiagnosticLoggingClient.mm:
3197         (WebKit::DiagnosticLoggingClient::logDiagnosticMessageWithValueDictionary):
3198         * UIProcess/ProvisionalPageProxy.cpp:
3199         (WebKit::ProvisionalPageProxy::didReceiveMessage):
3200         * UIProcess/WebPageDiagnosticLoggingClient.cpp:
3201         (WebKit::WebPageDiagnosticLoggingClient::logDiagnosticMessageWithValueDictionary):
3202         * UIProcess/WebPageDiagnosticLoggingClient.h:
3203         * UIProcess/WebPageProxy.cpp:
3204         (WebKit::WebPageProxy::logDiagnosticMessageWithValueDictionary):
3205         * UIProcess/WebPageProxy.h:
3206         * UIProcess/WebPageProxy.messages.in:
3207         * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp:
3208         (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithValueDictionary):
3209         * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h:
3210
3211 2019-04-15  Dean Jackson  <dino@apple.com>
3212
3213         Provide option to not create a longpress gesture recognizer
3214         https://bugs.webkit.org/show_bug.cgi?id=196937
3215         <rdar://problem/49918278>
3216
3217         Build fix for iOS platforms that don't have link preview.
3218
3219         * UIProcess/ios/WKContentViewInteraction.mm:
3220         (-[WKContentView setupInteraction]):
3221
3222 2019-04-15  Brent Fulgham  <bfulgham@apple.com>
3223
3224         InjectedBundle parameters often need initialization function called before unarchiving
3225         https://bugs.webkit.org/show_bug.cgi?id=189709
3226         <rdar://problem/44573653>
3227
3228         Reviewed by Ryosuke Niwa.
3229
3230         Handle the case where the InjectedBundle parameters do not successfully decode because they contain
3231         an unexpected class from the embedding program. If this happens, try decoding the bundle parameters
3232         after the bundle initialiation function runs, which gives the embedding program the opportunity to
3233         register additional classes that are safe for serialization.
3234
3235         Extend WKWebProcessPlugIn with a method that returns the names of any custom classes that need
3236         to be serialized by the InjectedBundle.
3237         
3238         Create a new 'decodeBundleParameters' method that contains the logic that used to live in 'initialize'.
3239         Revise 'initialize' to call this new method.
3240
3241         * WebProcess/InjectedBundle/InjectedBundle.h:
3242         * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
3243         (WebKit::InjectedBundle::initialize): Use the new method.
3244         (WebKit::InjectedBundle::decodeBundleParameters): Added.
3245         (WebKit::InjectedBundle::setBundleParameters): Use 'decodeObjectOfClasses' with the more complete
3246         'classesForCoder' method to unarchive the passed bundle parameters, rather than the
3247         NSDictionary-specific method, since InjectedBundles often encode other types of objects, and the
3248         NSDictionary object may itself hold other kinds of objects.
3249         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h:
3250         (WebKit::WKWebProcessPlugIn::additionalClassesForParameterCoder): Added.
3251
3252 2019-04-15  Dean Jackson  <dino@apple.com>
3253
3254         Provide option to not create a longpress gesture recognizer
3255         https://bugs.webkit.org/show_bug.cgi?id=196937
3256         <rdar://problem/49918278>
3257
3258         Reviewed by Antoine Quint.
3259
3260         A WebKitAdditions file has changed name to WKContentViewInteractionWKInteraction.mm.
3261
3262         Add a property to toggle if we should add a long press gesture
3263         recognizer.
3264
3265         * UIProcess/ios/WKContentViewInteraction.h:
3266         * UIProcess/ios/WKContentViewInteraction.mm:
3267         (-[WKContentView setupInteraction]):
3268         (shouldUsePreviewForLongPress):
3269         (-[WKContentView shouldUsePreviewForLongPress]):
3270
3271 2019-04-15  Don Olmstead  <don.olmstead@sony.com>
3272
3273         [CMake] WebCore derived sources should only be referenced inside WebCore
3274         https://bugs.webkit.org/show_bug.cgi?id=196904
3275
3276         Reviewed by Konstantin Tokarev.
3277
3278         Remove reference to DERIVED_SOURCES_WEBCORE_DIR in PlatformMac.cmake.
3279
3280         * PlatformMac.cmake:
3281
3282 2019-04-15  Zalan Bujtas  <zalan@apple.com>
3283
3284         DrawingArea should only capture painting related milestones
3285         https://bugs.webkit.org/show_bug.cgi?id=196926
3286         <rdar://problem/48003845>
3287
3288         Reviewed by Tim Horton.
3289
3290         While dispatching layout milestones (mixture of layout and painting items), the associated drawing areas should only capture the painting related milestones.
3291         These captured milestones get dispatched later in the commit handler to ensure that they are not forwarded prematurely.
3292         However the truly layout related milestones (e.g. DidFirstVisuallyNonEmptyLayout) should be dispatched right away with no delay.
3293
3294         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
3295         (WebKit::RemoteLayerTreeTransaction::newlyReachedPaintingMilestones const):
3296         (WebKit::RemoteLayerTreeTransaction::setNewlyReachedPaintingMilestones):
3297         (WebKit::RemoteLayerTreeTransaction::newlyReachedLayoutMilestones const): Deleted.
3298         (WebKit::RemoteLayerTreeTransaction::setNewlyReachedLayoutMilestones): Deleted.
3299         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
3300         (WebKit::RemoteLayerTreeTransaction::encode const):
3301         (WebKit::RemoteLayerTreeTransaction::decode):
3302         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
3303         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
3304         * WebProcess/WebPage/DrawingArea.h:
3305         (WebKit::DrawingArea::addMilestonesToDispatch):
3306         (WebKit::DrawingArea::dispatchDidReachLayoutMilestone): Deleted.
3307         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
3308         (WebKit::RemoteLayerTreeDrawingArea::addMilestonesToDispatch):
3309         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
3310         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
3311         (WebKit::RemoteLayerTreeDrawingArea::dispatchDidReachLayoutMilestone): Deleted.
3312         * WebProcess/WebPage/WebPage.cpp:
3313         (WebKit::WebPage::dispatchDidReachLayoutMilestone):
3314         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
3315         (WebKit::TiledCoreAnimationDrawingArea::addMilestonesToDispatch):
3316         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3317         (WebKit::TiledCoreAnimationDrawingArea::sendPendingNewlyReachedPaintingMilestones):
3318         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
3319         (WebKit::TiledCoreAnimationDrawingArea::sendPendingNewlyReachedLayoutMilestones): Deleted.
3320         (WebKit::TiledCoreAnimationDrawingArea::dispatchDidReachLayoutMilestone): Deleted.
3321
3322 2019-04-15  John Wilander  <wilander@apple.com>
3323
3324         Send delayed Ad Click Attribution conversion requests to the click source
3325         https://bugs.webkit.org/show_bug.cgi?id=196838
3326         <rdar://problem/47650157>
3327
3328         Reviewed by Chris Dumez and Youenn Fablet.
3329
3330         This patch schedules a conversion request with appropriate data going to the
3331         click source as a result of an ad click conversion.
3332
3333         WebKit::AdClickAttributionManager makes use of existing WebKit::PingLoad
3334         infrastructure to make the request. This will probably be reworked into a
3335         dedicated load class further on.
3336
3337         New test infrastructure allows for an override of both the conversion URL
3338         and the 24-48 hour timer.
3339
3340         * NetworkProcess/AdClickAttributionManager.cpp: Added.
3341         (WebKit::AdClickAttributionManager::ensureDestinationMapForSource):
3342         (WebKit::AdClickAttributionManager::store):
3343         (WebKit::AdClickAttributionManager::startTimer):
3344             Convenience function to support test override.
3345         (WebKit::AdClickAttributionManager::convert):
3346             This function now sets the timer.
3347         (WebKit::AdClickAttributionManager::fireConversionRequest):
3348             Fire an individual request.
3349         (WebKit::AdClickAttributionManager::firePendingConversionRequests):
3350             This is the timer function that iterates over all pending attributions.
3351         (WebKit::AdClickAttributionManager::clear):
3352             Now clears the two new test settings members.
3353         (WebKit::AdClickAttributionManager::toString const):
3354         * NetworkProcess/AdClickAttributionManager.h: Renamed from Source/WebKit/NetworkProcess/NetworkAdClickAttribution.h.
3355         (WebKit::AdClickAttributionManager::AdClickAttributionManager):
3356         (WebKit::AdClickAttributionManager::setPingLoadFunction):
3357         (WebKit::AdClickAttributionManager::setOverrideTimerForTesting):
3358         (WebKit::AdClickAttributionManager::setConversionURLForTesting):
3359         * NetworkProcess/NetworkAdClickAttribution.cpp: Renamed from Source/WebKit/NetworkProcess/NetworkAdClickAttribution.cpp.
3360         * NetworkProcess/NetworkProcess.cpp:
3361         (WebKit::NetworkProcess::storeAdClickAttribution):
3362         (WebKit::NetworkProcess::dumpAdClickAttribution):
3363         (WebKit::NetworkProcess::clearAdClickAttribution):
3364         (WebKit::NetworkProcess::setAdClickAttributionOverrideTimerForTesting):
3365         (WebKit::NetworkProcess::setAdClickAttributionConversionURLForTesting):
3366         * NetworkProcess/NetworkProcess.h:
3367         * NetworkProcess/NetworkProcess.messages.in:
3368         * NetworkProcess/NetworkSession.cpp:
3369         (WebKit::NetworkSession::NetworkSession):
3370         (WebKit::NetworkSession::setAdClickAttributionOverrideTimerForTesting):
3371         (WebKit::NetworkSession::setAdClickAttributionConversionURLForTesting):
3372         * NetworkProcess/NetworkSession.h:
3373         * NetworkProcess/PingLoad.cpp:
3374         (WebKit::PingLoad::PingLoad):
3375         (WebKit::m_blobFiles):
3376         (WebKit::PingLoad::initialize):
3377             The PingLoad constructor is now split in two to allow for construction
3378             without a WebKit::NetworkConnectionToWebProcess object. The body of
3379             the constructor was moved into the new initialize() function which is
3380             shared between constructors.
3381         * NetworkProcess/PingLoad.h:
3382         * Sources.txt:
3383             Removed NetworkProcess/NetworkAdClickAttribution.cpp and added
3384             NetworkProcess/NetworkAdClickAttribution.cpp.
3385         * UIProcess/API/C/WKPage.cpp:
3386         (WKPageSetAdClickAttributionOverrideTimerForTesting):
3387         (WKPageSetAdClickAttributionConversionURLForTesting):
3388         * UIProcess/API/C/WKPagePrivate.h:
3389         * UIProcess/Network/NetworkProcessProxy.cpp:
3390         (WebKit::NetworkProcessProxy::dumpAdClickAttribution): Deleted.
3391         (WebKit::NetworkProcessProxy::clearAdClickAttribution): Deleted.
3392         * UIProcess/Network/NetworkProcessProxy.h:
3393         * UIProcess/WebPageProxy.cpp:
3394         (WebKit::WebPageProxy::dumpAdClickAttribution):
3395         (WebKit::WebPageProxy::clearAdClickAttribution):
3396         (WebKit::WebPageProxy::setAdClickAttributionOverrideTimerForTesting):
3397         (WebKit::WebPageProxy::setAdClickAttributionConversionURLForTesting):
3398         * UIProcess/WebPageProxy.h:
3399         * UIProcess/WebProcessPool.cpp:
3400         (WebKit::WebProcessPool::dumpAdClickAttribution): Deleted.
3401         (WebKit::WebProcessPool::clearAdClickAttribution): Deleted.
3402         * UIProcess/WebProcessPool.h:
3403         * WebKit.xcodeproj/project.pbxproj:
3404
3405 2019-04-15  Devin Rousso  <drousso@apple.com>
3406
3407         WebDriver: Set Cookie endpoint does not correctly set subdomain cookies
3408         https://bugs.webkit.org/show_bug.cgi?id=196872
3409         <rdar://problem/49233240>
3410
3411         Reviewed by Joseph Pecoraro.
3412
3413         * UIProcess/Automation/WebAutomationSession.cpp:
3414         (WebKit::WebAutomationSession::addSingleCookie):
3415         Rather than try to "force" the cookie to be set on the current active URL, use the cookie
3416         itself to figure out which domain it should be set on.
3417
3418 2019-04-15  Philippe Normand  <pnormand@igalia.com>
3419
3420         [GTK][WPE] Add enable-media websetting
3421         https://bugs.webkit.org/show_bug.cgi?id=196863
3422
3423         Reviewed by Michael Catanzaro.
3424
3425         It can be useful for headless browsers, for instance. The setting is enabled by default.
3426
3427         * Shared/WebPreferences.yaml:
3428         * UIProcess/API/glib/WebKitSettings.cpp:
3429         (webKitSettingsSetProperty):
3430         (webKitSettingsGetProperty):
3431         (webkit_settings_class_init):
3432         (webkit_settings_get_enable_media):
3433         (webkit_settings_set_enable_media):
3434         * UIProcess/API/gtk/WebKitSettings.h:
3435         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
3436         * UIProcess/API/wpe/WebKitSettings.h:
3437         * UIProcess/API/wpe/docs/wpe-1.0-sections.txt:
3438
3439 2019-04-14  Rob Buis  <rbuis@igalia.com>
3440
3441         Link prefetch not useful for top-level navigation
3442         https://bugs.webkit.org/show_bug.cgi?id=195623