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