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