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