3d07b001d95e159379c89afb1d2609a7bf78cd67
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-04-12  Megan Gardner  <megan_gardner@apple.com>
2
3         Remove block selection code
4         https://bugs.webkit.org/show_bug.cgi?id=184470
5
6         Reviewed by Timothy Hatcher.
7         
8         Remove block selection code that isn't run and is currently not even used.
9         Had to put this back in for a bug in the mid-year release, but we're past that
10         so it's time for this to go away.
11
12         * Platform/spi/ios/UIKitSPI.h:
13         * UIProcess/PageClient.h:
14         * UIProcess/WebPageProxy.h:
15         * UIProcess/WebPageProxy.messages.in:
16         * UIProcess/ios/PageClientImplIOS.h:
17         * UIProcess/ios/PageClientImplIOS.mm:
18         (WebKit::PageClientImpl::stopAssistingNode):
19         (WebKit::PageClientImpl::didUpdateBlockSelectionWithTouch): Deleted.
20         * UIProcess/ios/WKContentViewInteraction.h:
21         * UIProcess/ios/WKContentViewInteraction.mm:
22         (toSelectionHandlePosition): Deleted.
23         (-[WKContentView _didUpdateBlockSelectionWithTouch:withFlags:growThreshold:shrinkThreshold:]): Deleted.
24         (-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:]): Deleted.
25         (-[WKContentView changeBlockSelectionWithTouchAt:withSelectionTouch:forHandle:]): Deleted.
26         * UIProcess/ios/WebPageProxyIOS.mm:
27         (WebKit::WebPageProxy::saveImageToLibrary):
28         (WebKit::WebPageProxy::updateBlockSelectionWithTouch): Deleted.
29         (WebKit::WebPageProxy::didUpdateBlockSelectionWithTouch): Deleted.
30         * WebProcess/WebPage/WebPage.h:
31         * WebProcess/WebPage/WebPage.messages.in:
32         * WebProcess/WebPage/ios/WebPageIOS.mm:
33         (WebKit::rangeAtWordBoundaryForPosition):
34         (WebKit::distanceBetweenRectsForPosition): Deleted.
35         (WebKit::rectsEssentiallyTheSame): Deleted.
36         (WebKit::unionDOMRanges): Deleted.
37         (WebKit::computeEdgeCenter): Deleted.
38         (WebKit::WebPage::expandedRangeFromHandle): Deleted.
39         (WebKit::WebPage::contractedRangeFromHandle): Deleted.
40         (WebKit::WebPage::computeExpandAndShrinkThresholdsForHandle): Deleted.
41         (WebKit::WebPage::rangeForBlockAtPoint): Deleted.
42         (WebKit::shouldExpand): Deleted.
43         (WebKit::WebPage::changeBlockSelection): Deleted.
44         (WebKit::WebPage::updateBlockSelectionWithTouch): Deleted.
45         
46 2018-04-12  Megan Gardner  <megan_gardner@apple.com>
47
48         Don't have selections get stuck in editable elements
49         https://bugs.webkit.org/show_bug.cgi?id=184483
50
51         Reviewed by Timothy Hatcher.
52         
53         When selecting in editable elements, if the keyboard does not come up, which is not required,
54         then the selections are stuck in that element. If you try and select something in web content,
55         it will only select in the editable element. By clearing the assisted node when clearing a selection,
56         it no longer sticks. Also, textSelectionAssistant should not be used as if we are currently editing. 
57         Change it to the function we created for that purpose in a pervious patch.
58
59         * UIProcess/ios/WKContentViewInteraction.mm:
60         (-[WKContentView clearSelection]):
61         (-[WKContentView _isInteractingWithAssistedNode]):
62
63 2018-04-12  Michael Catanzaro  <mcatanzaro@igalia.com>
64
65         [WPE] Move libWPEWebInspectorResources.so to pkglibdir
66         https://bugs.webkit.org/show_bug.cgi?id=184379
67
68         Reviewed by Žan Doberšek.
69
70         This is important to allow parallel installation.
71
72         * PlatformWPE.cmake:
73
74 2018-04-12  Michael Catanzaro  <mcatanzaro@igalia.com>
75
76         [WPE] Improve include hierarchy
77         https://bugs.webkit.org/show_bug.cgi?id=184376
78
79         Reviewed by Žan Doberšek.
80
81         Install our headers under /usr/include/wpe-webkit-0.1/wpe instead of
82         /usr/include/wpe-0.1/WPE/wpe. Too much WPE, not enough WebKit!
83
84         * PlatformWPE.cmake:
85         * wpe/wpe-webkit.pc.in:
86
87 2018-04-11  Andy Estes  <aestes@apple.com>
88
89         [iOS] Add a mechanism for holding Wi-Fi assertions
90         https://bugs.webkit.org/show_bug.cgi?id=184520
91         <rdar://problem/39025726>
92
93         Reviewed by Sam Weinig.
94
95         Add plumbing for holding a Wi-Fi assertion on iOS as long as there are active
96         network data tasks. This functionality is turned off by default right now.
97
98         * Configurations/Network-iOS.entitlements:
99         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
100         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
101         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
102         * NetworkProcess/cocoa/WiFiAssertionHolder.cpp: Added.
103         (WebKit::ensureWiFiManagerClient): Create a global WiFiManagerClient when needed.
104         (WebKit::WiFiAssertionHolder::WiFiAssertionHolder): If this is the first active
105         Wi-Fi assertion holder, set the client's type to kWiFiClientTypeBackground.
106         (WebKit::WiFiAssertionHolder::~WiFiAssertionHolder): If the last active Wi-Fi
107         assertion holder is being destroyed, set the client's type back to
108         kWiFiClientTypeNormal.
109         * NetworkProcess/cocoa/WiFiAssertionHolder.h: Added.
110         * Platform/Logging.h: Added a logging channel for Wi-Fi assertions.
111         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
112         * WebKit.xcodeproj/project.pbxproj:
113
114 2018-04-12  Carlos Garcia Campos  <cgarcia@igalia.com>
115
116         [GTK] Switch to use always complex text code path
117         https://bugs.webkit.org/show_bug.cgi?id=183285
118
119         Reviewed by Michael Catanzaro.
120
121         Now that we have branched for 2.20, it's a good time to try using complex text path always. We can simply force
122         it for GTK+ port and see how it works for the whole release cycle and if we don't notice any issues or
123         performance regressions we release 2.22 with complex text path forced. A debug env variable is added to switch
124         back to auto without having to recompile. After 2.22 is released we can make a final decision and remove the env
125         variable.
126
127         * UIProcess/gtk/WebProcessPoolGtk.cpp:
128         (WebKit::WebProcessPool::platformInitializeWebProcess): Force complex text code path unless
129         WEBKIT_FORCE_COMPLEX_TEXT is present and set to 0.
130
131 2018-04-11  Zan Dobersek  <zdobersek@igalia.com>
132
133         [WPE] Make WebKitWebViewBackend object mandatory for webkit_web_view_new*() constructors
134         https://bugs.webkit.org/show_bug.cgi?id=184513
135
136         Reviewed by Michael Catanzaro.
137
138         webkit_web_view_new*() constructors should always expect a non-null
139         WebKitWebViewBackend object, forcing the user to specify how the
140         wpe_view_backend object is managed for the WebKitWebView that's being
141         created.
142
143         webkitWebViewBackendCreateDefault() and the default
144         _WebKitWebViewBackend() constructor are removed. WPE-specific
145         webkit_web_view_new*() entrypoints are updated to bail if the passed-in
146         WebKitWebViewBackend object is null. Documentation is updated
147         accordingly.
148
149         * UIProcess/API/glib/WebKitWebView.cpp:
150         (webkitWebViewConstructed):
151         * UIProcess/API/wpe/WebKitWebViewBackend.cpp:
152         (webkitWebViewBackendCreateDefault): Deleted.
153         * UIProcess/API/wpe/WebKitWebViewBackendPrivate.h:
154         * UIProcess/API/wpe/WebKitWebViewWPE.cpp:
155         (webkit_web_view_new):
156         (webkit_web_view_new_with_context):
157         (webkit_web_view_new_with_related_view):
158         (webkit_web_view_new_with_settings):
159         (webkit_web_view_new_with_user_content_manager):
160
161 2018-04-11  Fujii Hironori  <Hironori.Fujii@sony.com>
162
163         [curl][WebKit] Implement NetworkDataTaskCurl
164         https://bugs.webkit.org/show_bug.cgi?id=184488
165
166         Reviewed by Alex Christensen.
167
168         * NetworkProcess/NetworkDataTask.cpp:
169         (WebKit::NetworkDataTask::create):
170         * NetworkProcess/curl/NetworkDataTaskCurl.cpp: Added.
171         (WebKit::NetworkDataTaskCurl::NetworkDataTaskCurl):
172         (WebKit::NetworkDataTaskCurl::~NetworkDataTaskCurl):
173         (WebKit::NetworkDataTaskCurl::resume):
174         (WebKit::NetworkDataTaskCurl::suspend):
175         (WebKit::NetworkDataTaskCurl::cancel):
176         (WebKit::NetworkDataTaskCurl::invalidateAndCancel):
177         (WebKit::NetworkDataTaskCurl::state const):
178         (WebKit::NetworkDataTaskCurl::createCurlRequest):
179         (WebKit::NetworkDataTaskCurl::curlDidSendData):
180         (WebKit::NetworkDataTaskCurl::curlDidReceiveResponse):
181         (WebKit::NetworkDataTaskCurl::curlDidReceiveBuffer):
182         (WebKit::NetworkDataTaskCurl::curlDidComplete):
183         (WebKit::NetworkDataTaskCurl::curlDidFailWithError):
184         (WebKit::NetworkDataTaskCurl::shouldRedirectAsGET):
185         (WebKit::NetworkDataTaskCurl::willPerformHTTPRedirection):
186         (WebKit::NetworkDataTaskCurl::tryHttpAuthentication):
187         (WebKit::NetworkDataTaskCurl::restartWithCredential):
188         (WebKit::NetworkDataTaskCurl::appendCookieHeader):
189         (WebKit::NetworkDataTaskCurl::handleCookieHeaders):
190         * NetworkProcess/curl/NetworkDataTaskCurl.h: Added.
191         * PlatformWin.cmake:
192
193 2018-04-11  Wenson Hsieh  <wenson_hsieh@apple.com>
194
195         [Extra zoom mode] Support pushing input view controllers onto the navigation stack
196         https://bugs.webkit.org/show_bug.cgi?id=184397
197         <rdar://problem/39265294>
198
199         Reviewed by Timothy Hatcher.
200
201         Currently, all input view controllers in extra zoom mode are presented modally. However, the latest iteration of
202         the HI specification depicts most of these view controllers (with the exception of time pickers) being presented
203         and dismissed via navigation stack. Since WebKit's iOS API surface doesn't force clients to embed WKWebViews
204         within a view controller with a corresponding UINavigationController, we cannot always guarantee that UI
205         presented when focusing form controls in a web view will be pushed onto the navigation stack; as such, the
206         approach taken in this patch will automatically allow WKWebView clients that already embed WKWebViews within a
207         UINavigationController to hook into this behavior, with modal presentation as a fallback.
208
209         At a high level, this patch makes the following tweaks to implement this behavior:
210
211         1. Store the currently presented view controller using a single member variable
212            (_presentedFullScreenInputViewController) instead of having one for each type. This makes bookkeepping around
213            which view controller to present or dismiss much more straightforward.
214
215         2. Replace WKFocusedFormControlViewController with just WKFocusedFormControlView. This addresses problems with
216            pushing an input view controller onto the navigation stack after presenting the focused form control view
217            controller modally. Now, we'll only need to present or push one view controller on the navigation stack.
218
219         3. Remove -handleWheelEvent: forwarding to date and time pickers. Pushing date picker view controllers onto the
220            navigation stack rather than presenting them modally means that we end up in a state where neither the
221            WKContentView nor WKTimePickerViewController are first responder, which renders time pickers unusable.
222            Instead, have the WKTimePickerViewController actually become first responder when presenting.
223
224         4. Lastly, and most importantly: change -presentViewControllerForCurrentAssistedNode and
225            -dismissAllInputViewControllers to try and push onto a navigation stack if possible, and fall back to modal
226            presentation.
227
228         * UIProcess/ios/WKContentViewInteraction.h:
229
230         Remove the separate member variables for each type of input view controller, and instead have one to keep track
231         of the current (and only) presented input view controller.
232
233         * UIProcess/ios/WKContentViewInteraction.mm:
234         (-[WKContentView _willStartScrollingOrZooming]):
235         (-[WKContentView _didEndScrollingOrZooming]):
236         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
237         (-[WKContentView _stopAssistingNode]):
238
239         Boilerplate renaming of _focusedFormControlViewController => _focusedFormControlView.
240
241         (-[WKContentView reloadContextViewForPresentedListViewController]):
242
243         Adjust for consolidation of the different input view controller member variables to a single member (see changes
244         in WKContentViewInteraction.h).
245
246         (-[WKContentView addFocusedFormControlOverlay]):
247         (-[WKContentView removeFocusedFormControlOverlay]):
248         (-[WKContentView presentViewControllerForCurrentAssistedNode]):
249         (-[WKContentView dismissAllInputViewControllers:]):
250
251         Add an `animated` argument. In the case where a different view controller was presented after presenting the
252         input view controller, this allows us to dismiss the other view controller with animation, and directly reveal
253         the web view or focus overlay underneath.
254
255         (-[WKContentView focusedFormControlViewDidSubmit:]):
256         (-[WKContentView focusedFormControlViewDidCancel:]):
257         (-[WKContentView focusedFormControlViewDidBeginEditing:]):
258         (-[WKContentView rectForFocusedFormControlView:]):
259         (-[WKContentView nextRectForFocusedFormControlView:]):
260         (-[WKContentView previousRectForFocusedFormControlView:]):
261         (-[WKContentView scrollViewForFocusedFormControlView:]):
262         (-[WKContentView actionNameForFocusedFormControlView:]):
263         (-[WKContentView focusedFormControlViewDidRequestNextNode:]):
264         (-[WKContentView focusedFormControlViewDidRequestPreviousNode:]):
265         (-[WKContentView hasNextNodeForFocusedFormControlView:]):
266         (-[WKContentView hasPreviousNodeForFocusedFormControlView:]):
267         (-[WKContentView focusedFormControllerDidUpdateSuggestions:]):
268
269         Boilerplate renaming of focus overlay delegate methods.
270
271         (-[WKContentView _wheelChangedWithEvent:]):
272
273         Remove event forwarding hacks for date and time inputs, now that they directly become first responder.
274
275         (-[WKContentView presentFocusedFormControlViewController:]): Deleted.
276         (-[WKContentView dismissFocusedFormControlViewController:]): Deleted.
277
278         Renamed to -addFocusedFormControlOverlay and -removeFocusedFormControlOverlay.
279
280         (-[WKContentView dismissAllInputViewControllers]): Deleted.
281         (-[WKContentView focusedFormControlControllerDidSubmit:]): Deleted.
282         (-[WKContentView focusedFormControlControllerDidCancel:]): Deleted.
283         (-[WKContentView focusedFormControlControllerDidBeginEditing:]): Deleted.
284         (-[WKContentView rectForFocusedFormControlController:inCoordinateSpace:]): Deleted.
285         (-[WKContentView nextRectForFocusedFormControlController:inCoordinateSpace:]): Deleted.
286         (-[WKContentView previousRectForFocusedFormControlController:inCoordinateSpace:]): Deleted.
287         (-[WKContentView scrollViewForFocusedFormControlController:]): Deleted.
288         (-[WKContentView actionNameForFocusedFormControlController:]): Deleted.
289         (-[WKContentView focusedFormControlControllerDidRequestNextNode:]): Deleted.
290         (-[WKContentView focusedFormControlControllerDidRequestPreviousNode:]): Deleted.
291         (-[WKContentView hasNextNodeForFocusedFormControlController:]): Deleted.
292         (-[WKContentView hasPreviousNodeForFocusedFormControlController:]): Deleted.
293         * UIProcess/ios/forms/WKFocusedFormControlViewController.h: Removed.
294         * UIProcess/ios/forms/WKFocusedFormControlViewController.mm: Removed.
295
296         Completely remove WKFocusedFormControlViewController; instead, just directly place the focused form overlay in
297         the WKWebView's hierarchy. In the case where we have a navigation stack to push to, we can no longer modally
298         present the focused form overlay as a separate view controller using the UINavigationController, and then
299         immediately push the input view controller on top of the navigation stack, since the navigation stack isn't
300         updated until after the animation of the focused form overlay presentation is complete. Rather than hack around
301         this limitation by dispatch_after-ing after presenting the overlay's view controller, we should just make the
302         overlay a view. This also fixes the case where a client embedding a WKWebView that is smaller than the bounds of
303         the screen will no longer see the entire screen dim when focusing an input, but instead, just the web content.
304
305         * WebKit.xcodeproj/project.pbxproj:
306
307 2018-04-11  Youenn Fablet  <youenn@apple.com>
308
309         Pass FetchOptions and SecurityOrigin as load parameters from WebProcess to NetworkProcess
310         https://bugs.webkit.org/show_bug.cgi?id=184374
311
312         Reviewed by Chris Dumez.
313
314         Pass full FetchOptions parameters as part of NetworkResourceLoadParameters.
315         This will allow handling redirection mode as well as credentials in case of cross origin redirections.
316         In case of SameOrigin credentials and there is a redirection from same-origin to cross-origin,
317         we will be able to stop using credentials without going to WebProcess.
318
319         To handle properly cross-origin checks, we have to be able to use SecurityOrigin as in WebProcess.
320         We make WebProcess sends Origin Access White list information to NetworkProcess.
321         This allows supporting the white list when doing loading in NetworkProcess.
322         This only works consistently if all WebProcesses share the same whitelist.
323
324         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
325         (WebKit::NetworkConnectionToWebProcess::loadPing):
326         (WebKit::NetworkConnectionToWebProcess::addOriginAccessWhitelistEntry):
327         (WebKit::NetworkConnectionToWebProcess::removeOriginAccessWhitelistEntry):
328         (WebKit::NetworkConnectionToWebProcess::resetOriginAccessWhitelists):
329         * NetworkProcess/NetworkConnectionToWebProcess.h:
330         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
331         * NetworkProcess/NetworkLoadChecker.cpp:
332         (WebKit::NetworkLoadChecker::NetworkLoadChecker):
333         (WebKit::NetworkLoadChecker::checkRedirection):
334         (WebKit::NetworkLoadChecker::continueCheckingRequest):
335         (WebKit::NetworkLoadChecker::checkCORSRequest):
336         (WebKit::NetworkLoadChecker::checkCORSRedirectedRequest):
337         (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
338         (WebKit::NetworkLoadChecker::doesNotNeedCORSCheck const):
339         * NetworkProcess/NetworkLoadChecker.h:
340         (WebKit::NetworkLoadChecker::create):
341         * NetworkProcess/NetworkResourceLoadParameters.cpp:
342         (WebKit::NetworkResourceLoadParameters::encode const):
343         (WebKit::NetworkResourceLoadParameters::decode):
344         * NetworkProcess/NetworkResourceLoadParameters.h:
345         * NetworkProcess/PingLoad.cpp:
346         (WebKit::PingLoad::PingLoad):
347         (WebKit::PingLoad::willPerformHTTPRedirection):
348         * NetworkProcess/PingLoad.h:
349         * WebProcess/InjectedBundle/InjectedBundle.cpp:
350         (WebKit::InjectedBundle::addOriginAccessWhitelistEntry):
351         (WebKit::InjectedBundle::removeOriginAccessWhitelistEntry):
352         (WebKit::InjectedBundle::resetOriginAccessWhitelists):
353         * WebProcess/Network/WebLoaderStrategy.cpp:
354         (WebKit::WebLoaderStrategy::startPingLoad):
355
356 2018-04-11  Michael Catanzaro  <mcatanzaro@igalia.com>
357
358         [GTK] WaylandCompositorDisplay leaks its wl_display
359         https://bugs.webkit.org/show_bug.cgi?id=184406
360
361         Reviewed by Carlos Garcia Campos.
362
363         Since we allocate our own wl_display here, need to chain up to the parent constructor
364         passing NativeDisplayOwned::Yes, or it won't ever be released. Move the initialize call to
365         the create function to ensure it's called after the constructor completes.
366
367         * WebProcess/gtk/WaylandCompositorDisplay.cpp:
368         (WebKit::WaylandCompositorDisplay::create): Fix a log message (drive-by).
369         (WebKit::WaylandCompositorDisplay::WaylandCompositorDisplay):
370
371 2018-04-11  Youenn Fablet  <youenn@apple.com>
372
373         Use more r-values in NetworkResourceLoader
374         https://bugs.webkit.org/show_bug.cgi?id=184478
375
376         Reviewed by Chris Dumez.
377
378         Pass load parameters as r-values to remove some unneeded copies.
379         Ditto for ResourceRequest inside NetworkResourceLoader.
380
381         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
382         (WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad):
383         (WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
384         * NetworkProcess/NetworkConnectionToWebProcess.h:
385         * NetworkProcess/NetworkResourceLoader.cpp:
386         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
387         (WebKit::NetworkResourceLoader::start):
388         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
389         (WebKit::NetworkResourceLoader::startNetworkLoad):
390         (WebKit::NetworkResourceLoader::continueWillSendRequest):
391         (WebKit::NetworkResourceLoader::validateCacheEntry):
392         * NetworkProcess/NetworkResourceLoader.h:
393
394 2018-04-11  Wenson Hsieh  <wenson_hsieh@apple.com>
395
396         [Extra zoom mode] Missing label when focusing a <select> with a title attribute but no associated <label>
397         https://bugs.webkit.org/show_bug.cgi?id=184352
398         <rdar://problem/39237683>
399
400         Reviewed by Andy Estes.
401
402         Currently, AssistedNodeInformation only sends the `title` of input elements to the UI process. This means that
403         any information requested in the UI process that is dependent on the `title` of the focused element is broken
404         in the case of select elements. An existing example of this is the title of the table view controller used to
405         present select menus on iPad.
406
407         To fix this, we simply send the `title` of the focused element across, as long as the focused element is an
408         HTMLElement. This ensures that there's label text when focusing unlabeled select elements with titles in extra
409         zoom mode, and also fixes a currenly broken codepath where we show the title of the select in the presented view
410         controller's title.
411
412         Test: fast/forms/ios/ipad/select-with-title.html
413
414         * UIProcess/API/Cocoa/WKWebView.mm:
415         (-[WKWebView selectFormPopoverTitle]):
416         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
417
418         Add new testing SPI to fetch the title of the UITableViewController presented for the currently focused select
419         element.
420
421         * UIProcess/ios/WKContentViewInteraction.h:
422         * UIProcess/ios/WKContentViewInteraction.mm:
423         (-[WKContentView selectFormPopoverTitle]):
424         * UIProcess/ios/forms/WKFormSelectControl.h:
425         * UIProcess/ios/forms/WKFormSelectControl.mm:
426         (-[WKFormSelectControl selectFormPopoverTitle]):
427         * UIProcess/ios/forms/WKFormSelectPopover.h:
428         * UIProcess/ios/forms/WKFormSelectPopover.mm:
429         (-[WKSelectPopover initWithView:hasGroups:]):
430         (-[WKSelectPopover tableViewController]):
431         * WebProcess/WebPage/ios/WebPageIOS.mm:
432
433         Always send the title across if the focused node is an HTMLElement.
434
435         (WebKit::WebPage::getAssistedNodeInformation):
436
437 2018-04-11  Ryan Haddad  <ryanhaddad@apple.com>
438
439         Unreviewed, rolling out r230508.
440
441         Breaks internal builds.
442
443         Reverted changeset:
444
445         "Remove block selection code"
446         https://bugs.webkit.org/show_bug.cgi?id=184470
447         https://trac.webkit.org/changeset/230508
448
449 2018-04-11  Antoine Quint  <graouts@apple.com>
450
451         [Web Animations] Turn Web Animations on by default
452         https://bugs.webkit.org/show_bug.cgi?id=184491
453
454         Reviewed by Simon Fraser.
455
456         * Shared/WebPreferences.yaml:
457
458 2018-04-10  Brent Fulgham  <bfulgham@apple.com>
459
460         Unreviewed test fix after r230468
461
462         Roll out an assertion added in r230468 that should not be present
463         until https://bugs.webkit.org/show_bug.cgi?id=184451 is landed.
464
465         * Shared/mac/HangDetectionDisablerMac.mm:
466         (WebKit::setClientsMayIgnoreEvents):
467
468 2018-04-10  Brent Fulgham  <bfulgham@apple.com>
469
470         Unreviewed follow-up to r230468.
471
472         Switch some RELEASE_ASSERTs in hot codepaths to normal DEBUG asserts.
473
474         * UIProcess/mac/PageClientImplMac.mm:
475         (WebKit::PageClientImpl::isViewWindowActive):
476         (WebKit::PageClientImpl::setCursor):
477
478 2018-04-10  Fujii Hironori  <Hironori.Fujii@sony.com>
479
480         [Win] Add UserAgentWin.cpp
481         https://bugs.webkit.org/show_bug.cgi?id=184438
482
483         Reviewed by Michael Catanzaro.
484
485         * WebProcess/WebPage/win/WebPageWin.cpp:
486         (WebKit::WebPage::platformUserAgent const):
487         Use WebCore::standardUserAgentForURL.
488
489 2018-04-10  Megan Gardner  <megan_gardner@apple.com>
490
491         Remove block selection code
492         https://bugs.webkit.org/show_bug.cgi?id=184470
493
494         Reviewed by Timothy Hatcher.
495         
496         Remove block selection code that isn't run and is currently not even used.
497         Had to put this back in for a bug in the mid-year release, but we're past that
498         so it's time for this to go away.
499
500         * Platform/spi/ios/UIKitSPI.h:
501         * UIProcess/PageClient.h:
502         * UIProcess/WebPageProxy.h:
503         * UIProcess/WebPageProxy.messages.in:
504         * UIProcess/ios/PageClientImplIOS.h:
505         * UIProcess/ios/PageClientImplIOS.mm:
506         (WebKit::PageClientImpl::stopAssistingNode):
507         (WebKit::PageClientImpl::didUpdateBlockSelectionWithTouch): Deleted.
508         * UIProcess/ios/WKContentViewInteraction.h:
509         * UIProcess/ios/WKContentViewInteraction.mm:
510         (toSelectionHandlePosition): Deleted.
511         (-[WKContentView _didUpdateBlockSelectionWithTouch:withFlags:growThreshold:shrinkThreshold:]): Deleted.
512         (-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:]): Deleted.
513         (-[WKContentView changeBlockSelectionWithTouchAt:withSelectionTouch:forHandle:]): Deleted.
514         * UIProcess/ios/WebPageProxyIOS.mm:
515         (WebKit::WebPageProxy::saveImageToLibrary):
516         (WebKit::WebPageProxy::updateBlockSelectionWithTouch): Deleted.
517         (WebKit::WebPageProxy::didUpdateBlockSelectionWithTouch): Deleted.
518         * WebProcess/WebPage/WebPage.h:
519         * WebProcess/WebPage/WebPage.messages.in:
520         * WebProcess/WebPage/ios/WebPageIOS.mm:
521         (WebKit::rangeAtWordBoundaryForPosition):
522         (WebKit::distanceBetweenRectsForPosition): Deleted.
523         (WebKit::rectsEssentiallyTheSame): Deleted.
524         (WebKit::unionDOMRanges): Deleted.
525         (WebKit::computeEdgeCenter): Deleted.
526         (WebKit::WebPage::expandedRangeFromHandle): Deleted.
527         (WebKit::WebPage::contractedRangeFromHandle): Deleted.
528         (WebKit::WebPage::computeExpandAndShrinkThresholdsForHandle): Deleted.
529         (WebKit::WebPage::rangeForBlockAtPoint): Deleted.
530         (WebKit::shouldExpand): Deleted.
531         (WebKit::WebPage::changeBlockSelection): Deleted.
532         (WebKit::WebPage::updateBlockSelectionWithTouch): Deleted.
533
534 2018-04-10  Wenson Hsieh  <wenson_hsieh@apple.com>
535
536         [Extra zoom mode] Add a mechanism to zoom to fixed scales when double tapping in extra zoom mode
537         https://bugs.webkit.org/show_bug.cgi?id=184435
538         <rdar://problem/38726260>
539
540         Reviewed by Dean Jackson.
541
542         Adds support for an alternate codepath when computing a zoom rect when double tapping that doesn't take the hit-
543         tested node into account, and instead cycles the zoom scale between 2 fixed values (in addition to the initial
544         scale). In the next patch, these fixed scales will be determined by computing zoom scales needed to make most of
545         the text on the page legible (i.e. the first text legibility zoom scale), and another to make all of the text on
546         the page legible, with the exception of outliers (this is the second text legibility zoom scale).
547
548         See comments below for more detail.
549
550         * UIProcess/Cocoa/ViewGestureController.h:
551         * UIProcess/Cocoa/ViewGestureController.messages.in:
552         * UIProcess/ios/SmartMagnificationController.h:
553         * UIProcess/ios/SmartMagnificationController.messages.in:
554         * UIProcess/ios/SmartMagnificationController.mm:
555         (WebKit::SmartMagnificationController::didCollectGeometryForSmartMagnificationGesture):
556         * UIProcess/mac/ViewGestureControllerMac.mm:
557         (WebKit::ViewGestureController::didCollectGeometryForSmartMagnificationGesture):
558         * WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
559         (WebKit::ViewGestureGeometryCollector::dispatchDidCollectGeometryForSmartMagnificationGesture):
560
561         Rename the boolean `isReplacedElement` argument to `fitEntireRect` instead. The UI process only uses this on iOS
562         to determine whether or not to fit the entire element rect to the viewport and add padding. This patch renames
563         this variable because we are not zooming to a replaced element in the case where text legibility on the page
564         (rather than element geometry) is being used to figure out the zoom scale, but we still want to fit the entire
565         target rect to the viewport.
566
567         (WebKit::ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture):
568
569         If text legiblity zoom scaling is preferred, then compute first and second-level text legibility zoom scales to
570         zoom to upon double tap (where the second zoom scale is greater than the first). To choose a target zoom
571         scale, choose the lowest target zoom scale that is at least a small amount less than the current scale. If
572         neither of the two scales fulfill this description, then zoom back out to the initial scale. This has the effect
573         of consistently cycling between all three zoom scales as the user double taps.
574
575         (WebKit::ViewGestureGeometryCollector::computeTextLegibilityScales):
576
577         Introduce a new helper method that computes and caches target scales to zoom to when double tapping to zoom. If
578         a cached pair of target scales is already present, it skips this computation and immediately returns it.
579
580         (WebKit::ViewGestureGeometryCollector::computeZoomInformationForNode):
581         (WebKit::ViewGestureGeometryCollector::computeMinimumAndMaximumViewportScales const):
582
583         Factor out logic to compute min and max zoom scales into a separate helper, and call it from both
584         computeZoomInformationForNode and computeTextLegibilityScales.
585
586         (WebKit::ViewGestureGeometryCollector::mainFrameDidLayout):
587
588         Invalidate cached text legibility scales when layout is triggered.
589
590         * WebProcess/WebPage/ViewGestureGeometryCollector.h:
591         * WebProcess/WebPage/WebPage.cpp:
592         (WebKit::WebPage::mainFrameDidLayout):
593         * WebProcess/WebPage/WebPage.h:
594         (WebKit::WebPage::viewportConfiguration const):
595
596         Expose WebPage's ViewportConfiguration as a const reference.
597
598         * WebProcess/WebPage/ios/WebPageIOS.mm:
599         (WebKit::WebPage::platformPrefersTextLegibilityBasedZoomScaling const):
600
601         Adds a platform hook for opting into text-legibility-based zoom scaling instead of regular hit-testing-based
602         zoom scaling heuristics.
603
604 2018-04-10  Wenson Hsieh  <wenson_hsieh@apple.com>
605
606         Fix availability annotations for _WKAttachment SPI
607         https://bugs.webkit.org/show_bug.cgi?id=184473
608         <rdar://problem/39319732>
609
610         Reviewed by Dan Bernstein.
611
612         _WKAttachmentInfo is available in WK_MAC_TBA and WK_IOS_TBA, but the SPI method -[_WKAttachment requestInfo:]
613         is currently available in macOS 10.13.4 and iOS 11.3. Instead, the availability of this SPI should match the
614         availability of the SPI object it depends on.
615
616         * UIProcess/API/Cocoa/_WKAttachment.h:
617
618 2018-04-10  Chris Dumez  <cdumez@apple.com>
619
620         Avoid constructing a service worker RegistrationStore for private sessions
621         https://bugs.webkit.org/show_bug.cgi?id=184463
622         <rdar://problem/36613948>
623
624         Reviewed by Youenn Fablet.
625
626         Avoid constructing a service worker RegistrationStore for private sessions since there
627         is no need for persistence and the registrationDatabaseDirectory is the empty string in
628         such cases.
629
630         * StorageProcess/StorageProcess.cpp:
631         (WebKit::StorageProcess::initializeWebsiteDataStore):
632
633 2018-04-10  Andy Estes  <aestes@apple.com>
634
635         [iOS] Navigate to URL and page number annotations in WKPDFView
636         https://bugs.webkit.org/show_bug.cgi?id=184410
637
638         Reviewed by Timothy Hatcher.
639
640         Implemented navigation to URL and page number (same-document) link annotations in PDFs.
641
642         * UIProcess/ios/WKPDFView.mm:
643         (-[WKPDFView _scrollToURLFragment:]):
644         (-[WKPDFView web_didSameDocumentNavigation:]):
645         (-[WKPDFView pdfHostViewController:updatePageCount:]):
646         (-[WKPDFView pdfHostViewController:goToURL:]):
647         (-[WKPDFView pdfHostViewController:goToPageIndex:withViewFrustum:]):
648
649 2018-04-10  Andy Estes  <aestes@apple.com>
650
651         [iOS] WKPDFView should conform to _WKWebViewPrintProvider
652         https://bugs.webkit.org/show_bug.cgi?id=184471
653
654         Reviewed by Dan Bernstein.
655
656         * UIProcess/API/Cocoa/WKWebView.mm:
657         (-[WKWebView _printProvider]):
658
659         The print provider will always be either _contentView or _customContentView, but
660         might not be _currentContentView.
661
662         * UIProcess/ios/WKPDFView.mm:
663         (-[WKPDFView _wk_pageCountForPrintFormatter:]):
664
665         Asked _hostViewController for the page count, clamped to 1 if
666         -[_WKWebViewPrintFormatter snapshotFirstPage] is YES.
667
668         (-[WKPDFView _wk_printedDocument]):
669
670         Created a CGPDFDocumentRef from _data and returned it.
671
672 2018-04-10  Youenn Fablet  <youenn@apple.com>
673
674         Beacon redirect responses should be CORS validated
675         https://bugs.webkit.org/show_bug.cgi?id=184378
676
677         Reviewed by Chris Dumez.
678
679         Add CORS checks to any redirection response if mode is CORS.
680         Update response tainting and redirected accordingly.
681
682         * NetworkProcess/NetworkLoadChecker.cpp:
683         (WebKit::NetworkLoadChecker::checkRedirection):
684         (WebKit::NetworkLoadChecker::validateResponse):
685         * NetworkProcess/NetworkLoadChecker.h:
686         * NetworkProcess/PingLoad.cpp:
687         (WebKit::PingLoad::willPerformHTTPRedirection):
688
689 2018-04-10  Sihui Liu  <sihui_liu@apple.com>
690
691         Loading of multipart response was cancelled because of content policy set in WebFrameLoaderClient::dispatchDecidePolicyForResponse
692         https://bugs.webkit.org/show_bug.cgi?id=184268
693         <rdar://problem/39144446>
694
695         Reviewed by Chris Dumez.
696
697         Webpage for multipart stream responses failed to refresh because content policy was set to 
698         be ignore when provisonalDocumentLoader was null and navigation ID could not be retrieved. 
699         As loading should not stop in this case, we set navigation ID 0 and still ask for content 
700         policy.
701
702         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
703         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
704
705 2018-04-10  Andy Estes  <aestes@apple.com>
706
707         [iOS] Use PDFKit to render PDFs in WKWebView
708         https://bugs.webkit.org/show_bug.cgi?id=184387
709
710         Reviewed by Beth Dakin.
711
712         Adopted PDFHostViewController for rendering PDFs in WKWebView.
713
714         This patch implements rendering the PDF document and page number indicator. Link
715         navigation, find-in-page, and printing will be implemented in follow-up patches.
716
717         WKLegacyPDFView is still the default PDF view.
718
719         * Configurations/WebKit.xcconfig:
720
721         Linked WebKit with PDFKit on iOS.
722
723         * UIProcess/API/Cocoa/WKWebView.mm:
724         (-[WKWebView _currentContentView]):
725         (-[WKWebView viewForZoomingInScrollView:]):
726
727         When WKPDFView loads a PDF document, it replaces itself with a view vended by
728         PDFHostViewController as the WKScrollView's content view. Abstracted WKWebView's
729         concept of the "current content view" to be either the WKContentView or a view of
730         the custom content view's choosing (-web_contentView).
731
732         (-[WKWebView scrollViewWillBeginZooming:withView:]):
733         (-[WKWebView scrollViewDidZoom:]):
734         (-[WKWebView scrollViewDidEndZooming:withView:atScale:]):
735
736         Forwarded these calls to _customContentView if it responds to the equivalent
737         WKWebViewContentProvider selectors.
738
739         * UIProcess/Cocoa/WKWebViewContentProvider.h:
740
741         Defined new protocol selectors.
742
743         * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
744         (-[WKWebViewContentProviderRegistry init]):
745         * UIProcess/ios/WKLegacyPDFView.h:
746         * UIProcess/ios/WKLegacyPDFView.mm:
747
748         Changed ENABLE(WKPDFVIEW) to ENABLE(WKLEGACYPDFVIEW).
749
750         (-[WKLegacyPDFView web_contentView]):
751
752         Added. Returns self as the content view.
753
754         * UIProcess/ios/WKPDFView.h: Added.
755         * UIProcess/ios/WKPDFView.mm: Added.
756         (-[WKPDFView dealloc]):
757
758         Removed the host view and page number indicator from their superviews.
759
760         (-[WKPDFView gestureRecognizerShouldBegin:]):
761
762         Forwarded to _hostViewController.
763
764         (-[WKPDFView web_initWithFrame:webView:]):
765
766         Set ours and the scroll view's background color to UIColor.grayColor to match
767         WKLegacyPDFView.
768
769         (-[WKPDFView web_setContentProviderData:suggestedFilename:]):
770
771         Created a PDFHostViewController and set its root view as the scroll view's content
772         view after removing the WKPDFView itself. This allows WKPDFView to act as a
773         placeholder content view until the PDF is loaded. Added the host view controller's
774         page number indicator to the fixed overlay view. Finally, loaded the PDF document
775         by calling -[PDFHostViewController setDocumentData:withScrollView:].
776
777         (-[WKPDFView _offsetForPageNumberIndicator]):
778
779         Computed an offset for the page number indicator like WKLegacyPDFView did, taking
780         into account the overlaid accessory views inset, computed unobscured safe area
781         inset, and computed obscured inset.
782
783         (-[WKPDFView _movePageNumberIndicatorToPoint:animated:]):
784
785         Moved the page number indicator using the margin and animation duration from
786         WKLegacyPDFView.
787
788         (-[WKPDFView _updateLayoutAnimated:]):
789
790         Added a convenience method to update the PDF view layout and position the page
791         number indicator.
792
793         (-[WKPDFView web_setMinimumSize:]):
794
795         Updated our own frame in case we are still the placeholder content view.
796         Called -_updateLayoutAnimated:.
797
798         (-[WKPDFView web_setOverlaidAccessoryViewsInset:]):
799
800         Stored the inset and called -_updateLayoutAnimated:.
801
802         (-[WKPDFView web_computedContentInsetDidChange]):
803
804         Called -_updateLayoutAnimated:.
805
806         (-[WKPDFView web_setFixedOverlayView:]):
807
808         Stored the fixed overlay view.
809
810         (-[WKPDFView web_didSameDocumentNavigation:]):
811         (-[WKPDFView web_countStringMatches:options:maxCount:]):
812         (-[WKPDFView web_findString:options:maxCount:]):
813         (-[WKPDFView web_hideFindUI]):
814
815         Added FIXMEs.
816
817         (-[WKPDFView web_contentView]):
818
819         If there is a host view controller, return its root view. Otherwise, return self.
820
821         (-[WKPDFView web_scrollViewDidScroll:]):
822         (-[WKPDFView web_scrollViewWillBeginZooming:withView:]):
823         (-[WKPDFView web_scrollViewDidEndZooming:withView:atScale:]):
824         (-[WKPDFView web_scrollViewDidZoom:]):
825
826         Called -[PDFHostViewController updatePDFViewLayout].
827
828         (-[WKPDFView web_dataRepresentation]):
829
830         Returned _data.
831
832         (-[WKPDFView web_suggestedFilename]):
833
834         Returned _suggestedFilename.
835
836         (-[WKPDFView web_isBackground]):
837
838         Returned self.isBackground.
839
840         * UIProcess/ios/WKSystemPreviewView.mm:
841         (-[WKSystemPreviewView web_contentView]):
842
843         Added. Returns self as the content view.
844
845         * WebKit.xcodeproj/project.pbxproj:
846
847 2018-04-10  Miguel Gomez  <magomez@igalia.com>
848
849         [GTK][WPE] Race condition when destroying webprocesses
850         https://bugs.webkit.org/show_bug.cgi?id=184445
851
852         Reviewed by Carlos Garcia Campos.
853
854         Ensure that the WebProcess is properly closing its pages when it's exiting because
855         the UIProcess has invalidated the IPC connection.
856
857         * WebProcess/WebProcess.cpp:
858         (WebKit::WebProcess::didClose):
859
860 2018-04-09  Wenson Hsieh  <wenson_hsieh@apple.com>
861
862         Add missing availability macros after r230462
863         https://bugs.webkit.org/show_bug.cgi?id=184426
864
865         Reviewed by Timothy Hatcher.
866
867         Annotate new SPI added in r230462 with the appropriate availability macros.
868
869         * UIProcess/API/Cocoa/WKViewPrivate.h:
870         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
871
872 2018-04-09  Brent Fulgham  <bfulgham@apple.com>
873
874         Add ProcessPrivilege assertions to places that access NSApp
875         https://bugs.webkit.org/show_bug.cgi?id=184322
876         <rdar://problem/39194560>
877
878         Reviewed by Per Arne Vollan.
879
880         Add ProcessPrivilege assertions to places where we interact with NSApp so
881         that we can prevent accidentally using them in the WebContent process.
882
883         * Shared/mac/ChildProcessMac.mm:
884         (WebKit::ChildProcess::stopNSAppRunLoop):
885         * Shared/mac/HangDetectionDisablerMac.mm:
886         (WebKit::setClientsMayIgnoreEvents):
887         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
888         (WebKit::WebProcessPool::platformInitializeWebProcess):
889         * UIProcess/Cocoa/WebViewImpl.mm:
890         (WebKit::WebViewImpl::WebViewImpl):
891         (WebKit::WebViewImpl::becomeFirstResponder):
892         (WebKit::WebViewImpl::pluginFocusOrWindowFocusChanged):
893         (WebKit::WebViewImpl::validateUserInterfaceItem):
894         (WebKit::WebViewImpl::startSpeaking):
895         (WebKit::WebViewImpl::stopSpeaking):
896         (WebKit::applicationFlagsForDrag):
897         (WebKit::WebViewImpl::doneWithKeyEvent):
898         * UIProcess/Gamepad/mac/UIGamepadProviderMac.mm:
899         (WebKit::UIGamepadProvider::platformWebPageProxyForGamepadInput):
900         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
901         (WebKit::PluginProcessProxy::enterFullscreen):
902         (WebKit::PluginProcessProxy::beginModal):
903         (WebKit::PluginProcessProxy::endModal):
904         * UIProcess/mac/DisplayLink.cpp:
905         (WebKit::DisplayLink::DisplayLink):
906         (WebKit::DisplayLink::~DisplayLink):
907         * UIProcess/mac/PageClientImplMac.mm:
908         (WebKit::PageClientImpl::isViewWindowActive):
909         (WebKit::PageClientImpl::setCursor):
910         * UIProcess/mac/WebPageProxyMac.mm:
911         (WebKit::WebPageProxy::getIsSpeaking):
912         (WebKit::WebPageProxy::speak):
913         (WebKit::WebPageProxy::stopSpeaking):
914         (WebKit::WebPageProxy::startDisplayLink):
915         * UIProcess/mac/WebPopupMenuProxyMac.mm:
916         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
917
918 2018-04-09  John Wilander  <wilander@apple.com>
919
920         Refactor Ignore HSTS code
921         https://bugs.webkit.org/show_bug.cgi?id=184433
922         <rdar://problem/39298238>
923
924         Reviewed by Darin Adler.
925
926         This patch refactors our ignore HSTS code. The convenience functions are moved
927         out of CFNetwork SPI in PAL, and into where they are used. It also switches
928         from performSelector: calls to straight function calls, after checking that
929         there is a responder.
930
931         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
932         (schemeWasUpgradedDueToDynamicHSTS):
933         (setIgnoreHSTS):
934         (ignoreHSTS):
935             Add convenience functions here since they were moved out of
936             CFNetworkSPI.h.
937
938 2018-04-09  Michael Catanzaro  <mcatanzaro@igalia.com>
939
940         Rename UNUSED to BUNUSED
941         https://bugs.webkit.org/show_bug.cgi?id=184093
942
943         Reviewed by Yusuke Suzuki.
944
945         * UIProcess/API/Cocoa/WKWebView.mm:
946         (-[WKWebView _getApplicationManifestWithCompletionHandler:]):
947
948 2018-04-09  Timothy Hatcher  <timothy@apple.com>
949
950         Add support for setting a background color on WKWebView and WKView
951         https://bugs.webkit.org/show_bug.cgi?id=184426
952
953         Reviewed by Wenson Hsieh.
954
955         * UIProcess/API/Cocoa/WKViewPrivate.h: Added _backgroundColor property.
956         * UIProcess/API/Cocoa/WKWebView.mm:
957         (-[WKWebView _backgroundColor]): Added. Call through to WebViewImpl.
958         (-[WKWebView _setBackgroundColor:]): Added. Call through to WebViewImpl.
959         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Added _backgroundColor property.
960         * UIProcess/API/mac/WKView.mm:
961         (-[WKView _backgroundColor]): Added. Call through to WebViewImpl.
962         (-[WKView _setBackgroundColor:]): Added. Call through to WebViewImpl.
963         * UIProcess/Cocoa/WebViewImpl.h:
964         * UIProcess/Cocoa/WebViewImpl.mm:
965         (WebKit::WebViewImpl::setBackgroundColor): Added.
966         (WebKit::WebViewImpl::backgroundColor const): Added.
967         (WebKit::WebViewImpl::updateLayer): Use m_backgroundColor when set.
968
969 2018-04-09  Yousuke Kimoto <yousuke.kimoto@sony.com> and Fujii Hironori  <Hironori.Fujii@sony.com>
970
971         [WinCairo] Add WebKit Shared/win event files for wincairo webkit
972         https://bugs.webkit.org/show_bug.cgi?id=183043
973
974         Reviewed by Brent Fulgham.
975
976         * Shared/NativeWebKeyboardEvent.h:
977         (WebKit::NativeWebKeyboardEvent::nativeEvent const):
978         * Shared/NativeWebMouseEvent.h:
979         (WebKit::NativeWebMouseEvent::nativeEvent const):
980         * Shared/NativeWebTouchEvent.h:
981         * Shared/NativeWebWheelEvent.h:
982         (WebKit::NativeWebWheelEvent::nativeEvent const):
983         * Shared/win/NativeWebKeyboardEventWin.cpp: Copied from Source/WebKit/Shared/NativeWebMouseEvent.h.
984         (WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent):
985         * Shared/win/NativeWebMouseEventWin.cpp: Copied from Source/WebKit/Shared/NativeWebMouseEvent.h.
986         (WebKit::NativeWebMouseEvent::NativeWebMouseEvent):
987         * Shared/win/NativeWebTouchEventWin.cpp: Copied from Source/WebKit/Shared/NativeWebTouchEvent.h.
988         (WebKit::NativeWebTouchEvent::NativeWebTouchEvent):
989         * Shared/win/NativeWebWheelEventWin.cpp: Copied from Source/WebKit/Shared/NativeWebMouseEvent.h.
990         (WebKit::NativeWebWheelEvent::NativeWebWheelEvent):
991         * Shared/win/WebEventFactory.cpp: Added.
992         (WebKit::relativeCursorPosition):
993         (WebKit::point):
994         (WebKit::horizontalScrollChars):
995         (WebKit::verticalScrollLines):
996         (WebKit::clickCount):
997         (WebKit::IsKeyInDownState):
998         (WebKit::modifiersForEvent):
999         (WebKit::modifiersForCurrentKeyState):
1000         (WebKit::keyboardEventTypeForEvent):
1001         (WebKit::isSystemKeyEvent):
1002         (WebKit::isKeypadEvent):
1003         (WebKit::textFromEvent):
1004         (WebKit::unmodifiedTextFromEvent):
1005         (WebKit::keyIdentifierFromEvent):
1006         (WebKit::WebEventFactory::createWebMouseEvent):
1007         (WebKit::WebEventFactory::createWebWheelEvent):
1008         (WebKit::WebEventFactory::createWebKeyboardEvent):
1009         (WebKit::WebEventFactory::createWebTouchEvent):
1010         * Shared/win/WebEventFactory.h: Copied from Source/WebKit/Shared/NativeWebMouseEvent.h.
1011         (WebKit::createNativeEvent):
1012
1013 2018-04-09  Brent Fulgham  <bfulgham@apple.com>
1014
1015         WebCore::EventHandler::targetPositionInWindowForSelectionAutoscroll is directly accessing NSScreen
1016         https://bugs.webkit.org/show_bug.cgi?id=184344
1017         <rdar://problem/39224969>
1018
1019         Reviewed by Per Arne Vollan.
1020
1021         The implementation of targetPositionInWindowForSelectionAutoscroll uses the display ID to get the
1022         screen boundaries of the current display. This causes a bunch of interaction with NSScreen that
1023         we do not want to allow in the WebContent process.
1024
1025         Instead, we should just use the cached screen information the WebContent process already possesses.
1026
1027         This patch makes the following changes:
1028         1. We now retrieve the screen rect of the page's display from the cache, rather than interacting with
1029            the WindowServer directly.
1030         2. Add a new 'toUserSpaceForPrimaryScreen' so we don't have to deal with a nil NSWindow when computing
1031            the user space version of the coordinates. A nil Window just means we want to get coordinates in
1032            terms of the primary display.
1033         3. Keep track of the primary display so we can refer to it later.
1034         4. Modify the IPC messages to include the primary display's ID so we can easily access it later.
1035         5. Modify the PlatformScreen methods to actually use the primary display when appropriate, rather
1036            than whichever screen happened to hash to the lowest value.
1037
1038         Reviewed by Per Arne Vollan.
1039
1040         * UIProcess/WebProcessPool.cpp:
1041         (WebKit::displayReconfigurationCallBack): Update for new getScreenProperties implementation.
1042         (WebKit::WebProcessPool::initializeNewWebProcess): Ditto.
1043         * WebProcess/WebProcess.cpp:
1044         (WebKit::WebProcess::setScreenProperties): Ditto.
1045         * WebProcess/WebProcess.h:
1046         * WebProcess/WebProcess.messages.in: Ditto.
1047
1048 2018-04-09  Michael Catanzaro  <mcatanzaro@igalia.com>
1049
1050         [WPE] Add API version to library soname and pkg-config files
1051         https://bugs.webkit.org/show_bug.cgi?id=180608
1052
1053         Reviewed by Žan Doberšek.
1054
1055         * PlatformWPE.cmake:
1056         * wpe/wpe-webkit.pc.in:
1057
1058 2018-04-09  Jer Noble  <jer.noble@apple.com>
1059
1060         Fix the selection assistant selectionView build
1061         https://bugs.webkit.org/show_bug.cgi?id=184423
1062         <rdar://problem/39288235>
1063
1064         Reviewed by Wenson Hsieh.
1065
1066         * Platform/spi/ios/UIKitSPI.h:
1067         * UIProcess/ios/WKContentView.mm:
1068         (-[WKContentView _didExitStableState]):
1069         * UIProcess/ios/WKContentViewInteraction.mm:
1070         (-[WKContentView _updateChangedSelection:]):
1071
1072 2018-04-09  Megan Gardner  <megan_gardner@apple.com>
1073
1074         Switch to UIWKTextInteractionAssistant for non-editable text
1075         https://bugs.webkit.org/show_bug.cgi?id=182834
1076
1077         Switch to only using one assistant for text selection.
1078
1079         Reviewed by Timothy Hatcher and Andy Estes.
1080
1081         * UIProcess/ios/WKContentViewInteraction.mm:
1082         (-[WKContentView useSelectionAssistantWithGranularity:]):
1083
1084 2018-04-09  Michael Catanzaro  <mcatanzaro@igalia.com>
1085
1086         Unreviewed, move 'using namespace' back to the right place after r230429
1087
1088         * Shared/glib/ProcessExecutablePathGLib.cpp:
1089
1090 2018-04-09  Michael Catanzaro  <mcatanzaro@igalia.com>
1091
1092         Unreviewed, rolling out r230390.
1093
1094         Broke accelerated compositing
1095
1096         Reverted changeset:
1097
1098         "[GTK] WaylandCompositorDisplay leaks its wl_display"
1099         https://bugs.webkit.org/show_bug.cgi?id=184406
1100         https://trac.webkit.org/changeset/230390
1101
1102 2018-04-09  Wenson Hsieh  <wenson_hsieh@apple.com>
1103
1104         [Extra zoom mode] Disable fast clicking by default in extra zoom mode
1105         https://bugs.webkit.org/show_bug.cgi?id=184411
1106         <rdar://problem/38726867>
1107
1108         Reviewed by Andy Estes.
1109
1110         As it turns out, existing fast-clicking heuristics don't work so well in extra zoom mode. Even at device-width,
1111         since the page is scaled to fit within the viewport, having single taps take precedence over double taps leads
1112         to a confusing experience when trying to double tap to zoom further on content that contains links and other
1113         click targets. Revert to legacy behavior here by disabling these heuristics.
1114
1115         * UIProcess/API/Cocoa/WKWebView.mm:
1116         (-[WKWebView _initializeWithConfiguration:]):
1117
1118 2018-04-06  Wenson Hsieh  <wenson_hsieh@apple.com>
1119
1120         [Extra zoom mode] Add an SPI hook for clients to opt in to focus overlay UI
1121         https://bugs.webkit.org/show_bug.cgi?id=184370
1122         <rdar://problem/39250494>
1123
1124         Reviewed by Timothy Hatcher and Andy Estes.
1125
1126         Add a new SPI hook for internal clients to opt in to showing the focused form control overlay. By default, the
1127         overlay is not shown.
1128
1129         * UIProcess/API/Cocoa/_WKInputDelegate.h:
1130
1131 2018-04-09  Michael Catanzaro  <mcatanzaro@igalia.com>
1132
1133         [WPE] Use GNU install directories
1134         https://bugs.webkit.org/show_bug.cgi?id=184377
1135
1136         Reviewed by Carlos Garcia Campos.
1137
1138         Merge ProcessExecutablePathGtk and ProcessExecutablePathWPE into ProcessExecutablePathGLib.
1139         WPE will now load its secondary processes from PKGLIBEXECDIR, like WebKitGTK+.
1140
1141         * PlatformWPE.cmake:
1142         * Shared/glib/ProcessExecutablePathGLib.cpp: Renamed from Source/WebKit/Shared/gtk/ProcessExecutablePathGtk.cpp.
1143         (WebKit::getExecutablePath):
1144         (WebKit::findWebKitProcess):
1145         (WebKit::executablePathOfWebProcess):
1146         (WebKit::executablePathOfPluginProcess):
1147         (WebKit::executablePathOfNetworkProcess):
1148         (WebKit::executablePathOfStorageProcess):
1149         * Shared/wpe/ProcessExecutablePathWPE.cpp: Removed.
1150         * SourcesGTK.txt:
1151         * SourcesWPE.txt:
1152
1153 2018-04-09  Michael Catanzaro  <mcatanzaro@igalia.com>
1154
1155         [GTK] WaylandCompositorDisplay leaks its wl_display
1156         https://bugs.webkit.org/show_bug.cgi?id=184406
1157
1158         Reviewed by Carlos Garcia Campos.
1159
1160         * WebProcess/gtk/WaylandCompositorDisplay.cpp:
1161         (WebKit::WaylandCompositorDisplay::create): Fix a log message (drive-by).
1162         (WebKit::WaylandCompositorDisplay::WaylandCompositorDisplay): Fix the leak.
1163
1164 2018-04-08  Zan Dobersek  <zdobersek@igalia.com>
1165
1166         Non-Cocoa ports use default directory for ServiceWorker data during testing
1167         https://bugs.webkit.org/show_bug.cgi?id=183784
1168
1169         Reviewed by Youenn Fablet.
1170
1171         Add API to WKWebsiteDataStore that enables setting and retrieving the
1172         service worker registration directory for a given data store object.
1173         This enables setting the temporary directory for testing purposes in
1174         WebKitTestRunner.
1175
1176         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1177         (WKWebsiteDataStoreCopyServiceWorkerRegistrationDirectory):
1178         (WKWebsiteDataStoreSetServiceWorkerRegistrationDirectory):
1179         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
1180
1181 2018-04-08  Fujii Hironori  <Hironori.Fujii@sony.com>
1182
1183         [CMake] WebKit should link to WebCore as a PRIVATE library if WebCore is a static library
1184         https://bugs.webkit.org/show_bug.cgi?id=184127
1185
1186         Reviewed by Konstantin Tokarev.
1187
1188         * CMakeLists.txt: Link with WebCore as private,
1189         WebCoreHeaderInterface as public to WebKit if WebCore is a static
1190         library.
1191         * CMakeLists.txt:
1192         * PlatformGTK.cmake: Added PRIVATE keyword for WebKit_LIBRARIES.
1193         * PlatformWPE.cmake: Ditto.
1194         * PlatformWin.cmake: Ditto.
1195
1196 2018-04-08  Andy Estes  <aestes@apple.com>
1197
1198         [iOS] WKContentView and WKLegacyPDFView should share application state tracking logic
1199         https://bugs.webkit.org/show_bug.cgi?id=184402
1200
1201         Reviewed by Dan Bernstein.
1202
1203         WKContentView and WKLegacyPDFView have nearly identical logic for tracking
1204         application foreground state. Let's share it so we can more easily create new
1205         content views with proper application state tracking.
1206
1207         * UIProcess/ios/WKApplicationStateTrackingView.h: Added.
1208         * UIProcess/ios/WKApplicationStateTrackingView.mm: Added.
1209         (-[WKApplicationStateTrackingView initWithFrame:webView:]):
1210         (-[WKApplicationStateTrackingView willMoveToWindow:]):
1211         (-[WKApplicationStateTrackingView didMoveToWindow]):
1212         (-[WKApplicationStateTrackingView _applicationDidEnterBackground]):
1213         (-[WKApplicationStateTrackingView _applicationDidCreateWindowContext]):
1214         (-[WKApplicationStateTrackingView _applicationDidFinishSnapshottingAfterEnteringBackground]):
1215         (-[WKApplicationStateTrackingView _applicationWillEnterForeground]):
1216         (-[WKApplicationStateTrackingView isBackground]):
1217
1218         Moved common logic from WKContentView and WKLegacyPDFView into
1219         WKApplicationStateTrackingView.
1220
1221         * UIProcess/ios/WKContentView.h:
1222         * UIProcess/ios/WKContentView.mm:
1223         (-[WKContentView initWithFrame:processPool:configuration:webView:]):
1224         (-[WKContentView willMoveToWindow:]):
1225         (-[WKContentView _applicationDidCreateWindowContext]):
1226         (-[WKContentView didMoveToWindow]): Deleted.
1227         (-[WKContentView isBackground]): Deleted.
1228         (-[WKContentView _applicationDidEnterBackground]): Deleted.
1229         (-[WKContentView _applicationDidFinishSnapshottingAfterEnteringBackground]): Deleted.
1230         (-[WKContentView _applicationWillEnterForeground]): Deleted.
1231
1232         Made WKContentView a subclass of WKApplicationStateTrackingView.
1233
1234         * UIProcess/ios/WKLegacyPDFView.h:
1235         * UIProcess/ios/WKLegacyPDFView.mm:
1236         (-[WKLegacyPDFView web_initWithFrame:webView:]):
1237         (-[WKLegacyPDFView web_isBackground]):
1238         (-[WKLegacyPDFView _applicationWillEnterForeground]):
1239         (-[WKLegacyPDFView willMoveToWindow:]): Deleted.
1240         (-[WKLegacyPDFView didMoveToWindow]): Deleted.
1241         (-[WKLegacyPDFView _applicationDidEnterBackground]): Deleted.
1242         (-[WKLegacyPDFView _applicationDidCreateWindowContext]): Deleted.
1243         (-[WKLegacyPDFView _applicationDidFinishSnapshottingAfterEnteringBackground]): Deleted.
1244
1245         Made WKLegacyPDFView a subclass of WKApplicationStateTrackingView.
1246
1247         * WebKit.xcodeproj/project.pbxproj:
1248
1249 2018-04-08  Dan Bernstein  <mitz@apple.com>
1250
1251         [Cocoa] Keep library validation disabled for WebContent.Development
1252         https://bugs.webkit.org/show_bug.cgi?id=184393
1253
1254         Reviewed by Anders Carlsson.
1255
1256         * Configurations/WebContent.Development.entitlements: Added. Includes the
1257           com.apple.security.cs.disable-library-validation entitlement set to true.
1258         * Configurations/WebContentService.Development.xcconfig: Set CODE_SIGN_ENTITLEMENTS to the
1259           above.
1260         * WebKit.xcodeproj/project.pbxproj: Added reference to new file.
1261
1262 2018-04-06  Brian Burg  <bburg@apple.com>
1263
1264         REGRESSION(r228371): WebAutomationSession::deleteAllCookies doesn't delete some cookies
1265         https://bugs.webkit.org/show_bug.cgi?id=184334
1266         <rdar://problem/39212863>
1267
1268         Reviewed by Timothy Hatcher.
1269
1270         When WebDriver adds a cookie for 'localhost', it actually uses the domain '.localhost' per RFC.
1271         When deleting cookies, we first fetch all cookies matching the document's hostname, and
1272         then delete them one by one. However, this code path does not add the dot prefix. This causes
1273         no cookies to match the requested domain, and thus none of them are deleted.
1274
1275         * UIProcess/Automation/WebAutomationSession.cpp:
1276         (WebKit::domainByAddingDotPrefixIfNeeded): Extract this helper method.
1277         (WebKit::WebAutomationSession::addSingleCookie): Use helper method.
1278         (WebKit::WebAutomationSession::deleteAllCookies): Add a dot prefix when
1279         requesting to delete all cookies for a hostname.
1280
1281 2018-04-06  Youenn Fablet  <youenn@apple.com>
1282
1283         Response headers should be filtered when sent from NetworkProcess to WebProcess
1284         https://bugs.webkit.org/show_bug.cgi?id=184310
1285
1286         Reviewed by Ryosuke Niwa.
1287
1288         Pass destination parameter to NetworkResourceLoader.
1289         Use new sanitization routine to filter response headers as needed:
1290         - Cross-origin routines are filtered by removing any non CORS allowed headers.
1291         - Same-origin responses are filtered by removing non used headers, except when filtering would be visible by JS (XHR, fetch).
1292         In all cases, Set-Cookie/Set-Cookie2 headers are filtered out.
1293
1294         * NetworkProcess/NetworkResourceLoadParameters.cpp:
1295         (WebKit::NetworkResourceLoadParameters::encode const):
1296         (WebKit::NetworkResourceLoadParameters::decode):
1297         * NetworkProcess/NetworkResourceLoadParameters.h:
1298         * NetworkProcess/NetworkResourceLoader.cpp:
1299         (WebKit::NetworkResourceLoader::didReceiveResponse):
1300         (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
1301         (WebKit::NetworkResourceLoader::sanitizeResponseIfPossible):
1302         (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
1303         (WebKit::NetworkResourceLoader::dispatchWillSendRequestForCacheEntry):
1304         * NetworkProcess/NetworkResourceLoader.h:
1305         * WebProcess/Network/WebLoaderStrategy.cpp:
1306         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
1307         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1308         (WebKit::WebSWContextManagerConnection::updatePreferencesStore):
1309
1310 2018-04-05  Ryosuke Niwa  <rniwa@webkit.org>
1311
1312         Make all sync IPCs during ScriptDisallowedScope set DoNotProcessIncomingMessagesWhenWaitingForSyncReply
1313         https://bugs.webkit.org/show_bug.cgi?id=182449
1314         <rdar://problem/39222541>
1315
1316         Reviewed by Chris Dumez.
1317
1318         Release assert that a sync IPC inside ScriptDisallowedScope sets DoNotProcessIncomingMessagesWhenWaitingForSyncReply
1319         to avoid executing arbitrary scripts as a result of processing incoming sync IPCs.
1320
1321         * Platform/IPC/Connection.h:
1322         (IPC::Connection::sendSync): Added the release assertion.
1323
1324 2018-04-05  Youenn Fablet  <youenn@apple.com>
1325
1326         REGRESSION (r230223): LayoutTest http/tests/contentextensions/css-display-none-overflows-rule-data-1.html is crashing
1327         https://bugs.webkit.org/show_bug.cgi?id=184306
1328
1329         Reviewed by Ryosuke Niwa.
1330
1331         * NetworkProcess/NetworkContentRuleListManager.cpp:
1332         (WebKit::NetworkContentRuleListManager::addContentRuleLists):
1333
1334 2018-04-05  Brent Fulgham  <bfulgham@apple.com>
1335
1336         WebContent process is calling CGDisplayUsesInvertedPolarity
1337         https://bugs.webkit.org/show_bug.cgi?id=184337
1338         <rdar://problem/39215702>
1339
1340         Reviewed by Zalan Bujtas.
1341
1342         The PlatformScreenMac code is still calling display-related routines directly, specifically
1343         CGDisplayUsesInvertedPolarity and CGDisplayUsesForceToGray. These should be brokered from
1344         the UIProcess.
1345         
1346         There's also no reason to avoid the brokering behavior on current WebKit builds. Remove
1347         the compile guards so all macOS builds use this behavior.
1348         
1349         Finally, add some ProcessPrivilege assertions to guard against accidentally calling these
1350         routines in the future.
1351
1352         * UIProcess/WebProcessPool.cpp:
1353         (WebKit::WebProcessPool::initializeNewWebProcess): Activate screen brokering code for all builds.
1354         * WebProcess/WebProcess.cpp: Ditto.
1355         * WebProcess/WebProcess.h: Ditto.
1356         * WebProcess/WebProcess.messages.in: Ditto.
1357
1358 2018-04-05  Brady Eidson  <beidson@apple.com>
1359
1360         Process Swap on Navigation causes many webpages to hang due to attempted process swap for iframe navigations.
1361         <rdar://problem/39162236> and https://bugs.webkit.org/show_bug.cgi?id=184318
1362
1363         Reviewed by Andy Estes.
1364
1365         * UIProcess/WebPageProxy.cpp:
1366         (WebKit::WebPageProxy::receivedPolicyDecision): Don't consider a swap if the navigation is not in the main frame.
1367
1368 2018-04-05  Ryosuke Niwa  <rniwa@webkit.org>
1369
1370         WebContent process sometimes hangs in WebProcess::ensureNetworkProcessConnection
1371         https://bugs.webkit.org/show_bug.cgi?id=184326
1372
1373         Reviewed by Chris Dumez.
1374
1375         The hang was caused by UI process never sending the reply back to GetNetworkProcessConnection
1376         due to m_pendingOutgoingMachMessage being set and the event handler for DISPATCH_MACH_SEND_POSSIBLE
1377         never getting called. This is because the event handler registration happens asynchronously,
1378         and may not have completed by the time we send the first IPC to the web content process
1379         in which case it can timeout and we may never get the callback.
1380
1381         Fixed the hang by waiting for the event handler registration to be completed using
1382         dispatch_source_set_registration_handler. To do this, this patch adds a new boolean instance variable,
1383         m_isInitializingSendSource, to Connection which is set to true between the time mach port is created
1384         and until the event handler registration has been completed. platformCanSendOutgoingMessages returns
1385         false while m_isInitializingSendSource is set to prevent the attempt to send messages like we do when
1386         m_pendingOutgoingMachMessage is set to true.
1387
1388         * Platform/IPC/Connection.h:
1389         (IPC::Connection::m_isInitializingSendSource): Added.
1390         * Platform/IPC/mac/ConnectionMac.mm:
1391         (IPC::Connection::platformInvalidate): Set m_isInitializingSendSource to false.
1392         (IPC::Connection::sendMessage): Assert that m_isInitializingSendSource is false.
1393         (IPC::Connection::platformCanSendOutgoingMessages const): Return false if m_isInitializingSendSource
1394         is set to true.
1395         (IPC::Connection::sendOutgoingMessage): Assert that m_isInitializingSendSource is false.
1396         (IPC::Connection::initializeSendSource): Set m_isInitializingSendSource to true temporarily until
1397         dispatch_source_set_registration_handler's callback is called. Resume and send any pending outgoing
1398         messages.
1399         (IPC::Connection::resumeSendSource): Extracted from initializeSendSource.
1400
1401 2018-04-05  Youenn Fablet  <youenn@apple.com>
1402
1403         WebRTC data channel only applications require capture permissions for direct connections
1404         https://bugs.webkit.org/show_bug.cgi?id=174500
1405         <rdar://problem/34134281>
1406
1407         Unreviewed.
1408         Changed the code to suppress: "error: unused variable 'error' [-Werror,-Wunused-variable]"
1409         Added some logging to this error case as a side bonus.
1410
1411         * NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
1412         (WebKit::NetworkMDNSRegister::registerMDNSName):
1413
1414 2018-04-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1415
1416         REGRESSION(r229831): Test WebKit2.ProvisionalURLAfterWillSendRequestCallback times out since r229831
1417         https://bugs.webkit.org/show_bug.cgi?id=184293
1418
1419         Reviewed by Alex Christensen.
1420
1421         The problem is that after willSendRequest callback changes the request, the load is cancelled while
1422         transitioning to committed state. This happens because the load is not waiting for the response policy check, so
1423         it continues and when transitioning to committed, FrameLoader::closeURL() invalidates the current policy check
1424         that causes a load failure. The new request returned by the API doesn't have any requester, so it's no longer
1425         considered a main resource load. In the network process the resource load task doesn't wait for the response
1426         policy and continues the load, sending the data to the web process. Once the first data is received, the load
1427         transitions to commit, but the response policy check is still ongoing. This can only happen when using the C API
1428         (I don't know about the Cocoa API), but not with the GLib API because it doesn't allow to create a new request,
1429         only to modify the passed in one. With the C API we loss other internal things of the request like the priority,
1430         but I guess the most important one is the requester.
1431
1432         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1433         (WebKit::WebFrameLoaderClient::dispatchWillSendRequest):
1434
1435 2018-04-04  Ryan Haddad  <ryanhaddad@apple.com>
1436
1437         Unreviewed, rolling out r230283.
1438
1439         Caused webkitpy test failures.
1440
1441         Reverted changeset:
1442
1443         "Use CompletionHandlers for DelayedReplies"
1444         https://bugs.webkit.org/show_bug.cgi?id=182269
1445         https://trac.webkit.org/changeset/230283
1446
1447 2018-04-04  Youenn Fablet  <youenn@apple.com>
1448
1449         webrtc/video-update-often.html is flakily crashing on iOS simulator Debug
1450         https://bugs.webkit.org/show_bug.cgi?id=184022
1451
1452         Reviewed by Jer Noble.
1453
1454         Remove client context once the new context identifier is set.
1455         Covered by test no longer crashing locally.
1456
1457         * WebProcess/cocoa/PlaybackSessionManager.mm:
1458         (WebKit::PlaybackSessionManager::setUpPlaybackControlsManager):
1459
1460 2018-04-04  Youenn Fablet  <youenn@apple.com>
1461
1462         WebRTC data channel only applications require capture permissions for direct connections
1463         https://bugs.webkit.org/show_bug.cgi?id=174500
1464         <rdar://problem/34134281>
1465
1466         Reviewed by Eric Carlson.
1467
1468         Add support for MDNS registration and resolution by NetworkProcess.
1469         WebProcess gives instruction to do the actual registrations/resolutions.
1470
1471         * CMakeLists.txt:
1472         * DerivedSources.make:
1473         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1474         (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
1475         (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
1476         * NetworkProcess/NetworkConnectionToWebProcess.h:
1477         (WebKit::NetworkConnectionToWebProcess::mdnsRegister):
1478         * NetworkProcess/webrtc/NetworkMDNSRegister.cpp: Added.
1479         (WebKit::NetworkMDNSRegister::NetworkMDNSRegister):
1480         (WebKit::NetworkMDNSRegister::~NetworkMDNSRegister):
1481         (WebKit::NetworkMDNSRegister::unregisterMDNSNames):
1482         (WebKit::PendingRegistrationRequest::PendingRegistrationRequest):
1483         (WebKit::registerMDNSNameCallback):
1484         (WebKit::NetworkMDNSRegister::registerMDNSName):
1485         (WebKit::PendingResolutionRequest::PendingResolutionRequest):
1486         (WebKit::PendingResolutionRequest::~PendingResolutionRequest):
1487         (WebKit::PendingResolutionRequest::timeout):
1488         (WebKit::resolveMDNSNameCallback):
1489         (WebKit::NetworkMDNSRegister::resolveMDNSName):
1490         * NetworkProcess/webrtc/NetworkMDNSRegister.h: Added.
1491         * NetworkProcess/webrtc/NetworkMDNSRegister.messages.in: Added.
1492         * Shared/WebPreferences.yaml:
1493         * UIProcess/API/C/WKPreferences.cpp:
1494         (WKPreferencesSetWebRTCMDNSICECandidatesEnabled):
1495         (WKPreferencesGetWebRTCMDNSICECandidatesEnabled):
1496         * UIProcess/API/C/WKPreferencesRef.h:
1497         * WebKit.xcodeproj/project.pbxproj:
1498         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1499         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1500         * WebProcess/Network/NetworkProcessConnection.cpp:
1501         (WebKit::NetworkProcessConnection::didReceiveMessage):
1502         * WebProcess/Network/webrtc/LibWebRTCNetwork.h:
1503         (WebKit::LibWebRTCNetwork::mdnsRegister):
1504         * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
1505         (WebKit::LibWebRTCProvider::unregisterMDNSNames):
1506         (WebKit::LibWebRTCProvider::registerMDNSName):
1507         (WebKit::LibWebRTCProvider::resolveMDNSName):
1508         * WebProcess/Network/webrtc/LibWebRTCProvider.h:
1509         * WebProcess/Network/webrtc/WebMDNSRegister.cpp: Added.
1510         (WebKit::WebMDNSRegister::finishedRegisteringMDNSName):
1511         (WebKit::WebMDNSRegister::finishedResolvingMDNSName):
1512         (WebKit::WebMDNSRegister::unregisterMDNSNames):
1513         (WebKit::WebMDNSRegister::registerMDNSName):
1514         (WebKit::WebMDNSRegister::resolveMDNSName):
1515         * WebProcess/Network/webrtc/WebMDNSRegister.h: Added.
1516         * WebProcess/Network/webrtc/WebMDNSRegister.messages.in: Added.
1517
1518 2018-04-04  Alex Christensen  <achristensen@webkit.org>
1519
1520         Use CompletionHandlers for DelayedReplies
1521         https://bugs.webkit.org/show_bug.cgi?id=182269
1522
1523         Reviewed by Youenn Fablet.
1524
1525         DelayedReplies should be a noncopyable, non-refcountable type.  They should be
1526         called once and only once.  This is what CompletionHandlers are for.
1527
1528         No change in behavior.  Just cleaner code.
1529
1530         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1531         (WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
1532         * NetworkProcess/NetworkConnectionToWebProcess.h:
1533         * NetworkProcess/NetworkResourceLoader.cpp:
1534         (WebKit::NetworkResourceLoader::SynchronousLoadData::SynchronousLoadData):
1535         (WebKit::sendReplyToSynchronousRequest):
1536         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
1537         * NetworkProcess/NetworkResourceLoader.h:
1538         * Platform/IPC/Connection.h:
1539         * Platform/IPC/HandleMessage.h:
1540         (IPC::callMemberFunctionImpl):
1541         (IPC::callMemberFunction):
1542         (IPC::handleMessageDelayed):
1543         * PluginProcess/PluginControllerProxy.cpp:
1544         (WebKit::PluginControllerProxy::setInitializationReply):
1545         (WebKit::PluginControllerProxy::takeInitializationReply):
1546         * PluginProcess/PluginControllerProxy.h:
1547         * PluginProcess/WebProcessConnection.cpp:
1548         (WebKit::WebProcessConnection::destroyPlugin):
1549         (WebKit::WebProcessConnection::createPlugin):
1550         (WebKit::WebProcessConnection::createPluginAsynchronously):
1551         * PluginProcess/WebProcessConnection.h:
1552         * Scripts/webkit/messages.py:
1553         (message_to_struct_declaration):
1554         (generate_message_handler):
1555         * UIProcess/Network/NetworkProcessProxy.cpp:
1556         (WebKit::NetworkProcessProxy::getNetworkProcessConnection):
1557         (WebKit::NetworkProcessProxy::networkProcessCrashed):
1558         (WebKit::NetworkProcessProxy::networkProcessFailedToLaunch):
1559         (WebKit::NetworkProcessProxy::didCreateNetworkConnectionToWebProcess):
1560         * UIProcess/Network/NetworkProcessProxy.h:
1561         * UIProcess/Plugins/PluginProcessManager.cpp:
1562         (WebKit::PluginProcessManager::getPluginProcessConnection):
1563         * UIProcess/Plugins/PluginProcessManager.h:
1564         * UIProcess/Plugins/PluginProcessProxy.cpp:
1565         (WebKit::PluginProcessProxy::getPluginProcessConnection):
1566         (WebKit::PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch):
1567         (WebKit::PluginProcessProxy::didCreateWebProcessConnection):
1568         * UIProcess/Plugins/PluginProcessProxy.h:
1569         * UIProcess/Storage/StorageProcessProxy.cpp:
1570         (WebKit::StorageProcessProxy::getStorageProcessConnection):
1571         (WebKit::StorageProcessProxy::didClose):
1572         (WebKit::StorageProcessProxy::didCreateStorageToWebProcessConnection):
1573         * UIProcess/Storage/StorageProcessProxy.h:
1574         * UIProcess/WebPageProxy.cpp:
1575         (WebKit::ExceededDatabaseQuotaRecords::createRecord):
1576         (WebKit::WebPageProxy::createNewPage):
1577         (WebKit::WebPageProxy::runJavaScriptAlert):
1578         (WebKit::WebPageProxy::runJavaScriptConfirm):
1579         (WebKit::WebPageProxy::runJavaScriptPrompt):
1580         (WebKit::WebPageProxy::webGLPolicyForURL):
1581         (WebKit::WebPageProxy::resolveWebGLPolicyForURL):
1582         (WebKit::WebPageProxy::getToolbarsAreVisible):
1583         (WebKit::WebPageProxy::getMenuBarIsVisible):
1584         (WebKit::WebPageProxy::getStatusBarIsVisible):
1585         (WebKit::WebPageProxy::getWindowFrame):
1586         (WebKit::WebPageProxy::screenToRootView):
1587         (WebKit::WebPageProxy::rootViewToScreen):
1588         (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel):
1589         (WebKit::WebPageProxy::exceededDatabaseQuota):
1590         (WebKit::WebPageProxy::reachedApplicationCacheOriginQuota):
1591         * UIProcess/WebPageProxy.h:
1592         * UIProcess/WebProcessPool.cpp:
1593         (WebKit::WebProcessPool::networkProcessCrashed):
1594         (WebKit::WebProcessPool::getNetworkProcessConnection):
1595         (WebKit::WebProcessPool::getStorageProcessConnection):
1596         * UIProcess/WebProcessPool.h:
1597         * UIProcess/WebProcessProxy.cpp:
1598         (WebKit::WebProcessProxy::getPluginProcessConnection):
1599         (WebKit::WebProcessProxy::getNetworkProcessConnection):
1600         (WebKit::WebProcessProxy::getStorageProcessConnection):
1601         * UIProcess/WebProcessProxy.h:
1602         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1603         (WebKit::WebSWContextManagerConnection::syncTerminateWorker):
1604         * WebProcess/Storage/WebSWContextManagerConnection.h:
1605         * WebProcess/WebPage/WebPage.h:
1606         * WebProcess/WebPage/ios/WebPageIOS.mm:
1607         (WebKit::WebPage::computePagesForPrintingAndDrawToPDF):
1608
1609 2018-04-04  Alex Christensen  <achristensen@webkit.org>
1610
1611         Remove legacyCustomProtocolManager from NetworkSessionCreationParameters
1612         https://bugs.webkit.org/show_bug.cgi?id=182178
1613
1614         Reviewed by Youenn Fablet.
1615
1616         Now that we only make NetworkSessions in the NetworkProcess, we don't need to pass this parameter around.
1617
1618         * NetworkProcess/NetworkProcess.cpp:
1619         (WebKit::NetworkProcess::initializeNetworkProcess):
1620         * NetworkProcess/NetworkSessionCreationParameters.h:
1621         (WebKit::NetworkSessionCreationParameters::decode):
1622         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1623         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1624         * NetworkProcess/mac/RemoteNetworkingContext.mm:
1625         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
1626         * Shared/WebsiteDataStoreParameters.cpp:
1627         (WebKit::WebsiteDataStoreParameters::privateSessionParameters):
1628         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
1629         (WebKit::WebsiteDataStore::parameters):
1630
1631 2018-04-04  Alex Christensen  <achristensen@webkit.org>
1632
1633         Move PingHandle to WebKitLegacy
1634         https://bugs.webkit.org/show_bug.cgi?id=184145
1635
1636         Reviewed by Youenn Fablet.
1637
1638         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1639
1640 2018-04-04  Brent Fulgham  <bfulgham@apple.com>
1641
1642         Failures from mach port reference handling should be fatal
1643         https://bugs.webkit.org/show_bug.cgi?id=184202
1644         <rdar://problem/37771114>
1645
1646         Reviewed by Anders Carlsson.
1647
1648         Update for new location of MachSendRight.h. Switch to
1649         #pragma once in a few places.
1650
1651         * Platform/IPC/mac/ConnectionMac.mm:
1652         (IPC::Connection::platformInvalidate): Adopt new 'safe mach_port_t deallocation' function.
1653         (IPC::Connection::initializeSendSource): Ditto.
1654         (IPC::Connection::receiveSourceEventHandler): Ditto.
1655         * Platform/SharedMemory.h:
1656         * Platform/cocoa/SharedMemoryCocoa.cpp:
1657         (WebKit::SharedMemory::Handle::clear): Ditto.
1658         (WebKit::makeMemoryEntry): Ditto.
1659         (WebKit::SharedMemory::createSendRight const): Ditto.
1660         * Platform/mac/LayerHostingContext.h:
1661         * Platform/mac/LayerHostingContext.mm:
1662         * PluginProcess/PluginControllerProxy.h:
1663         * PluginProcess/PluginProcess.h:
1664         (WebKit::PluginProcess::compositingRenderServerPort const):
1665         * Scripts/messages.py:
1666         (headers_for_type): Update for new location of MachSendRight.
1667         * Shared/Plugins/PluginProcessCreationParameters.h:
1668         * Shared/RemoteLayerTree/RemoteLayerBackingStore.h:
1669         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
1670         (WebKit::RemoteLayerBackingStore::encode const):
1671         * Shared/WebCoreArgumentCoders.h:
1672         * Shared/WebProcessCreationParameters.h:
1673         * Shared/mac/WebCoreArgumentCodersMac.mm:
1674         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
1675         * UIProcess/DrawingAreaProxy.cpp:
1676         * UIProcess/DrawingAreaProxy.h:
1677         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1678         (WebKit::ProcessLauncher::launchProcess): Ditto. Remove uneeded mach_port_dealloc called after
1679         xpc_dictionary_set_mach_send. While '..._set_mach_send' retains the send right, it gets automatically
1680         released when the message is handled. We only want to manually deallocate the send right if
1681         the message failed to send.
1682         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
1683         * UIProcess/WebPageProxy.cpp:
1684         * UIProcess/WebPageProxy.h:
1685         * UIProcess/WebPageProxy.messages.in:
1686         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
1687         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
1688         * UIProcess/mac/WKViewLayoutStrategy.mm:
1689         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
1690         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
1691         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
1692         * WebProcess/Plugins/PluginController.h:
1693         * WebProcess/Plugins/PluginView.h:
1694         * WebProcess/WebPage/DrawingArea.h:
1695         (WebKit::DrawingArea::addFence):
1696         (WebKit::DrawingArea::updateGeometry):
1697         * WebProcess/WebPage/DrawingArea.messages.in:
1698         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
1699         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
1700         (WebKit::RemoteLayerTreeDrawingArea::updateGeometry):
1701         * WebProcess/WebPage/WebPage.cpp:
1702         (WebKit::WebPage::setTopContentInsetFenced):
1703         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
1704         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1705         (WebKit::TiledCoreAnimationDrawingArea::updateGeometry):
1706         * WebProcess/WebProcess.h:
1707         (WebKit::WebProcess::compositingRenderServerPort const):
1708         * WebProcess/cocoa/VideoFullscreenManager.mm:
1709         (WebKit::VideoFullscreenManager::setVideoLayerFrameFenced):
1710
1711 2018-04-04  Beth Dakin  <bdakin@apple.com>
1712
1713         Fix the print formatter build
1714         https://bugs.webkit.org/show_bug.cgi?id=184289
1715         -and corresponding-
1716         rdar://problem/39164641
1717
1718         Reviewed by Dan Bernstein.
1719
1720         * UIProcess/API/Cocoa/WKWebView.mm:
1721         (-[WKWebView _webViewPrintFormatter]):
1722         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1723         * UIProcess/_WKWebViewPrintFormatter.h:
1724         * UIProcess/_WKWebViewPrintFormatter.mm:
1725         * UIProcess/_WKWebViewPrintFormatterInternal.h:
1726         * UIProcess/ios/WKContentView.mm:
1727         * UIProcess/ios/WKPDFView.mm:
1728
1729 2018-04-04  Andy Estes  <aestes@apple.com>
1730
1731         [iOS] Rename WKPDFView to WKLegacyPDFView
1732         https://bugs.webkit.org/show_bug.cgi?id=184286
1733
1734         Rubber-stamped by Wenson Hsieh.
1735
1736         A series of upcoming patches will implement a new WKPDFView based on PDFKit.
1737
1738         * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
1739         (-[WKWebViewContentProviderRegistry init]):
1740         * UIProcess/ios/WKLegacyPDFView.h: Renamed from Source/WebKit/UIProcess/ios/WKPDFView.h.
1741         * UIProcess/ios/WKLegacyPDFView.mm: Renamed from Source/WebKit/UIProcess/ios/WKPDFView.mm.
1742         (-[WKLegacyPDFView _computeMatchesForString:options:maxCount:completionHandler:]):
1743         * WebKit.xcodeproj/project.pbxproj:
1744
1745 2018-04-04  Yousuke Kimoto  <yousuke.kimoto@sony.com> and Fujii Hironori  <Hironori.Fujii@sony.com>
1746
1747         [WinCairo] Add WebKit Shared/win files for wincairo webkit
1748         https://bugs.webkit.org/show_bug.cgi?id=183044
1749
1750         Reviewed by Alex Christensen.
1751
1752         * Shared/win/ChildProcessMainWin.cpp: Added.
1753
1754 2018-04-04  Wenson Hsieh  <wenson_hsieh@apple.com>
1755
1756         [Extra zoom mode] Remove effective font size constraints when determining focus zoom scale
1757         https://bugs.webkit.org/show_bug.cgi?id=184287
1758         <rdar://problem/39063886>
1759
1760         Reviewed by Timothy Hatcher.
1761
1762         As it turns out, form controls on some important websites can be very wide, with a small font size, which
1763         renders the approach taken in <https://trac.webkit.org/r230171> moot, since we'll just end up zooming to a scale
1764         that is too large anyways. To mitigate this for now, remove the minimum font scaling threshold while we think of
1765         more clever ways to account for this scenario.
1766
1767         * UIProcess/API/Cocoa/WKWebView.mm:
1768         (-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
1769
1770 2018-04-04  Fujii Hironori  <Hironori.Fujii@sony.com>
1771
1772         [Win] WebFrameLoaderClient: 'getpid': identifier not found
1773         https://bugs.webkit.org/show_bug.cgi?id=184291
1774
1775         Reviewed by Konstantin Tokarev.
1776
1777         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1778         (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad):
1779         Use WTF::getCurrentProcessID() instead of getpid().
1780         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Ditto.
1781
1782 2018-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1783
1784         ASSERTION FAILED: !m_mainFrame->coreFrame()->loader().frameHasLoaded() || !m_pendingNavigationID when reloading page while a page is loading
1785         https://bugs.webkit.org/show_bug.cgi?id=153210
1786
1787         Reviewed by Alex Christensen.
1788
1789         The assert happens when WebPage::reload() is called twice and the first time the reload is ignored by
1790         FrameLoader because the document URL is empty. In that case the pending navigation is not reset, because
1791         FrameLoader::reload() returns before creating the document loader.
1792
1793         * WebProcess/WebPage/WebPage.cpp:
1794         (WebKit::WebPage::reload): Check if the pending navigation has been reset after calling FrameLoader::reload()
1795         and reset it otherwise.
1796
1797 2018-04-03  Youenn Fablet  <youenn@apple.com>
1798
1799         Make NetworkProcess get ContentBlocker information from UIProcess
1800         https://bugs.webkit.org/show_bug.cgi?id=184205
1801         <rdar://problem/39146551>
1802
1803         Unreviewed.
1804         Updated decode/encode methods to not hit null identifier assertion.
1805
1806         * Shared/WebPageCreationParameters.cpp:
1807         (WebKit::WebPageCreationParameters::encode const):
1808         (WebKit::WebPageCreationParameters::decode):
1809         * Shared/WebPageGroupData.cpp:
1810         (WebKit::WebPageGroupData::encode const):
1811         (WebKit::WebPageGroupData::decode):
1812
1813 2018-04-03  Andy Estes  <aestes@apple.com>
1814
1815         [iOS] WKWebView shouldn't know about WKPDFView
1816         https://bugs.webkit.org/show_bug.cgi?id=184283
1817
1818         Reviewed by Timothy Hatcher.
1819
1820         WKWebView shouldn't be checking if _customContentView is a particular kind of
1821         class (e.g., WKPDFView). Instead, it should interact with the _customContentView
1822         using the WKWebViewContentProvider protocol.
1823
1824         Reimplement -_isBackground, -_isDisplayingPDF, -_dataForDisplayedPDF, and
1825         -_suggestedFilenameForDisplayedPDF using new WKWebViewContentProvider protocol
1826         methods that WKPDFView implements.
1827
1828         * UIProcess/API/Cocoa/WKWebView.mm:
1829         (-[WKWebView _isBackground]):
1830         (-[WKWebView _isDisplayingPDF]):
1831         (-[WKWebView _dataForDisplayedPDF]):
1832         (-[WKWebView _suggestedFilenameForDisplayedPDF]):
1833         * UIProcess/Cocoa/WKWebViewContentProvider.h:
1834         * UIProcess/ios/WKPDFView.h:
1835         * UIProcess/ios/WKPDFView.mm:
1836         (-[WKPDFView web_dataRepresentation]):
1837         (-[WKPDFView web_suggestedFilename]):
1838         (-[WKPDFView web_isBackground]):
1839         (-[WKPDFView suggestedFilename]): Deleted.
1840         (-[WKPDFView pdfDocument]): Deleted.
1841         (-[WKPDFView isBackground]): Deleted.
1842
1843 2018-04-03  Brent Fulgham  <bfulgham@apple.com>
1844
1845         Guard against keychain/certificate access outside the network process
1846         https://bugs.webkit.org/show_bug.cgi?id=184214
1847         <rdar://problem/38734795>
1848
1849         Reviewed by Youenn Fablet.
1850
1851         Use the ProcessPrivilege assertions to guard against accessing the Keychain from
1852         a non-Networking process.
1853
1854         * Shared/cf/ArgumentCodersCF.cpp:
1855         (IPC::encode): Assert if we access the keychain from a proces other than the Network or UI process.
1856         (IPC::decode): Ditto.
1857
1858 2018-04-03  Youenn Fablet  <youenn@apple.com>
1859
1860         NetworkResourceLoader does not need to expose all redirect response headers
1861         https://bugs.webkit.org/show_bug.cgi?id=184114
1862         <rdar://problem/39010557>
1863
1864         Reviewed by Ryosuke Niwa.
1865
1866         WebProcess instructs NetworkProcess whether to sanitize response headers based on a runtime flag.
1867         We sanitize redirection response headers in case this is not related to a navigation load.
1868         Navigation loads may currently require the full response for content blockers.
1869
1870         * NetworkProcess/NetworkResourceLoadParameters.cpp:
1871         (WebKit::NetworkResourceLoadParameters::encode const):
1872         (WebKit::NetworkResourceLoadParameters::decode):
1873         * NetworkProcess/NetworkResourceLoadParameters.h:
1874         * NetworkProcess/NetworkResourceLoader.cpp:
1875         (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
1876         (WebKit::NetworkResourceLoader::sanitizeRedirectResponseIfPossible):
1877         (WebKit::NetworkResourceLoader::dispatchWillSendRequestForCacheEntry):
1878         * NetworkProcess/NetworkResourceLoader.h:
1879         * Shared/WebPreferences.yaml:
1880         * UIProcess/API/C/WKPreferences.cpp:
1881         (WKPreferencesSetRestrictedHTTPResponseAccess):
1882         (WKPreferencesGetRestrictedHTTPResponseAccess):
1883         * UIProcess/API/C/WKPreferencesRef.h:
1884         * WebProcess/Network/WebLoaderStrategy.cpp:
1885         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
1886         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
1887         (WebKit::WebLoaderStrategy::startPingLoad):
1888         (WebKit::WebLoaderStrategy::preconnectTo):
1889
1890 2018-04-03  Youenn Fablet  <youenn@apple.com>
1891
1892         Make NetworkProcess get ContentBlocker information from UIProcess
1893         https://bugs.webkit.org/show_bug.cgi?id=184205
1894
1895         Reviewed by Alex Christensen.
1896
1897         Make NetworkProcess get content blockers from UIProcess directly.
1898         Before that patch, WebProcess sent content blockers to NetworkProcess for each PingLoad.
1899         Instead, WebProcess sends the content blocker identifier for each PingLoad and NetworkProcess fetches the content blocker once.
1900
1901         This is both more efficient than passing them for each PingLoad and safer in the sense
1902         that a compromised WebProcess will not be able to bypass any of these.
1903         In the future, NetworkProcess should get the content blocker identifier directly from the WebPageID attached to the request.
1904
1905         Covered by existing beacon+content blocker tests.
1906
1907         Did some refactoring to add a typed content blocker identifier.
1908         Once NetworkProcess fetches a given content blocker, the content blocker will send any modification to NetworkProcess.
1909         Introduced NetworkContentRuleListManager to handle the content blockers in NetworkProcess.
1910
1911         * CMakeLists.txt:
1912         * DerivedSources.make:
1913         * NetworkProcess/NetworkLoadChecker.cpp:
1914         (WebKit::NetworkLoadChecker::checkRequest):
1915         (WebKit::NetworkLoadChecker::continueCheckingRequest):
1916         (WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad):
1917         * NetworkProcess/NetworkLoadChecker.h:
1918         (WebKit::NetworkLoadChecker::setContentExtensionController):
1919         * NetworkProcess/NetworkProcess.cpp:
1920         (WebKit::NetworkProcess::didReceiveMessage):
1921         * NetworkProcess/NetworkProcess.h:
1922         (WebKit::NetworkProcess::networkUserContentController):
1923         * NetworkProcess/NetworkResourceLoadParameters.cpp:
1924         (WebKit::NetworkResourceLoadParameters::encode const):
1925         (WebKit::NetworkResourceLoadParameters::decode):
1926         * NetworkProcess/NetworkResourceLoadParameters.h:
1927         * NetworkProcess/NetworkContentRuleListManager.cpp: Added.
1928         (WebKit::NetworkContentRuleListManager::contentExtensionsBackend):
1929         (WebKit::NetworkContentRuleListManager::addContentRuleLists):
1930         (WebKit::NetworkContentRuleListManager::removeContentRuleList):
1931         (WebKit::NetworkContentRuleListManager::removeAllContentRuleLists):
1932         (WebKit::NetworkContentRuleListManager::remove):
1933         * NetworkProcess/NetworkContentRuleListManager.h: Added.
1934         * NetworkProcess/NetworkContentRuleListManager.messages.in: Added.
1935         * NetworkProcess/PingLoad.cpp:
1936         * Scripts/webkit/messages.py:
1937         * Shared/UserContentControllerIdentifier.h: Added.
1938         * Shared/WebPageCreationParameters.cpp:
1939         (WebKit::WebPageCreationParameters::decode):
1940         * Shared/WebPageCreationParameters.h:
1941         * Shared/WebPageGroupData.cpp:
1942         (WebKit::WebPageGroupData::decode):
1943         * Shared/WebPageGroupData.h:
1944         * UIProcess/Network/NetworkProcessProxy.cpp:
1945         (WebKit::NetworkProcessProxy::~NetworkProcessProxy):
1946         (WebKit::NetworkProcessProxy::contentExtensionRules):
1947         (WebKit::NetworkProcessProxy::didDestroyWebUserContentControllerProxy):
1948         * UIProcess/Network/NetworkProcessProxy.h:
1949         * UIProcess/Network/NetworkProcessProxy.messages.in:
1950         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
1951         (WebKit::WebUserContentControllerProxy::get):
1952         (WebKit::WebUserContentControllerProxy::WebUserContentControllerProxy):
1953         (WebKit::WebUserContentControllerProxy::~WebUserContentControllerProxy):
1954         (WebKit::WebUserContentControllerProxy::addProcess):
1955         (WebKit::WebUserContentControllerProxy::removeProcess):
1956         (WebKit::WebUserContentControllerProxy::addUserContentWorldUse):
1957         (WebKit::WebUserContentControllerProxy::removeUserContentWorldUses):
1958         (WebKit::WebUserContentControllerProxy::addUserScript):
1959         (WebKit::WebUserContentControllerProxy::removeUserScript):
1960         (WebKit::WebUserContentControllerProxy::removeAllUserScripts):
1961         (WebKit::WebUserContentControllerProxy::addUserStyleSheet):
1962         (WebKit::WebUserContentControllerProxy::removeUserStyleSheet):
1963         (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets):
1964         (WebKit::WebUserContentControllerProxy::addUserScriptMessageHandler):
1965         (WebKit::WebUserContentControllerProxy::removeUserMessageHandlerForName):
1966         (WebKit::WebUserContentControllerProxy::removeAllUserMessageHandlers):
1967         (WebKit::WebUserContentControllerProxy::addContentRuleList):
1968         (WebKit::WebUserContentControllerProxy::removeContentRuleList):
1969         (WebKit::WebUserContentControllerProxy::removeAllContentRuleLists):
1970         * UIProcess/UserContent/WebUserContentControllerProxy.h:
1971         (WebKit::WebUserContentControllerProxy::create):
1972         (WebKit::WebUserContentControllerProxy::addNetworkProcess):
1973         (WebKit::WebUserContentControllerProxy::removeNetworkProcess):
1974         (WebKit::WebUserContentControllerProxy::contentExtensionRules):
1975         (WebKit::WebUserContentControllerProxy::identifier const):
1976         * WebKit.xcodeproj/project.pbxproj:
1977         * WebProcess/Network/WebLoaderStrategy.cpp:
1978         (WebKit::WebLoaderStrategy::startPingLoad):
1979         * WebProcess/UserContent/WebUserContentController.cpp:
1980         (WebKit::WebUserContentController::getOrCreate):
1981         (WebKit::WebUserContentController::WebUserContentController):
1982         (WebKit::WebUserContentController::~WebUserContentController):
1983         * WebProcess/UserContent/WebUserContentController.h:
1984         * WebProcess/WebPage/WebPage.h:
1985         (WebKit::WebPage::userContentControllerIdentifier const):
1986
1987 2018-04-03  Andy Estes  <aestes@apple.com>
1988
1989         [Mac] Prioritize file promises over filenames during drag and drop
1990         https://bugs.webkit.org/show_bug.cgi?id=184237
1991         <rdar://problem/38278076>
1992
1993         Reviewed by Wenson Hsieh.
1994
1995         * UIProcess/Cocoa/WebViewImpl.mm:
1996         (WebKit::WebViewImpl::performDragOperation):
1997
1998 2018-04-03  Brady Eidson  <beidson@apple.com>
1999
2000         Make SessionStorage work with process swapping.
2001         https://bugs.webkit.org/show_bug.cgi?id=184270
2002
2003         Reviewed by Andy Estes.
2004
2005         Due to a minor process accounting error, WebPageProxys weren't always being reconnected with their
2006         WebsiteDataStore's StorageManager when doing process swaps.
2007
2008         Fix that error, and SessionStorage "just works."
2009
2010         * UIProcess/WebPageProxy.cpp:
2011         (WebKit::WebPageProxy::webProcessWillShutDown):
2012         (WebKit::WebPageProxy::processDidTerminate): For NavigationSwap termination, make sure to tell the 
2013           process lifetime tracker that this page was removed.
2014
2015         * UIProcess/WebProcessLifetimeObserver.h:
2016         (WebKit::WebProcessLifetimeObserver::webPageWasInvalidated): Renamed from "webPageWasRemoved"
2017         (WebKit::WebProcessLifetimeObserver::webPageWasRemoved): Deleted.
2018
2019         * UIProcess/WebProcessLifetimeTracker.cpp:
2020         (WebKit::WebProcessLifetimeTracker::webPageLeavingWebProcess): Renamed from "webProcessWillShutDown"
2021         (WebKit::WebProcessLifetimeTracker::pageWasInvalidated):
2022         (WebKit::WebProcessLifetimeTracker::webProcessWillShutDown): Deleted.
2023         * UIProcess/WebProcessLifetimeTracker.h:
2024
2025         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2026         (WebKit::WebsiteDataStore::webPageWasInvalidated):
2027         (WebKit::WebsiteDataStore::webPageWasRemoved): Deleted.
2028         * UIProcess/WebsiteData/WebsiteDataStore.h:
2029
2030 2018-04-03  Commit Queue  <commit-queue@webkit.org>
2031
2032         Unreviewed, rolling out r230210.
2033         https://bugs.webkit.org/show_bug.cgi?id=184277
2034
2035         it is breaking internal bots (Requested by youenn on #webkit).
2036
2037         Reverted changeset:
2038
2039         "Make NetworkProcess get ContentBlocker information from
2040         UIProcess"
2041         https://bugs.webkit.org/show_bug.cgi?id=184205
2042         https://trac.webkit.org/changeset/230210
2043
2044 2018-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>
2045
2046         [Extra zoom mode] Update time picker to use platform view controller
2047         https://bugs.webkit.org/show_bug.cgi?id=184252
2048         <rdar://problem/38804795>
2049
2050         Reviewed by Andy Estes.
2051
2052         Adjust for some small WKTimePickerViewController changes, and remove some files that we no longer need.
2053
2054         * UIProcess/ios/WKContentViewInteraction.mm:
2055         (-[WKContentView presentViewControllerForCurrentAssistedNode]):
2056         (-[WKContentView textInputController:didCommitText:]): Deleted.
2057         (-[WKContentView textInputController:didCommitText:withSuggestion:]): Deleted.
2058         (-[WKContentView textInputControllerDidRequestDismissal:]): Deleted.
2059         * UIProcess/ios/forms/WKTextFormControlViewController.h: Removed.
2060         * UIProcess/ios/forms/WKTextFormControlViewController.mm: Removed.
2061         * UIProcess/ios/forms/WKTextSuggestionButton.h: Removed.
2062         * UIProcess/ios/forms/WKTextSuggestionButton.mm: Removed.
2063         * WebKit.xcodeproj/project.pbxproj:
2064
2065 2018-04-03  Ross Kirsling  <ross.kirsling@sony.com>
2066
2067         Xcode prepends line comments from WTF/Compiler.h to *.sb files
2068         https://bugs.webkit.org/show_bug.cgi?id=184166
2069
2070         Reviewed by Brent Fulgham.
2071
2072         * DerivedSources.make:
2073         Strip ;-comments from *.sb.in files before preprocessing so we can stop treating Platform.h/Compiler.h as C89.
2074
2075 2018-04-03  Chris Dumez  <cdumez@apple.com>
2076
2077         Drop MainFrame class
2078         https://bugs.webkit.org/show_bug.cgi?id=184191
2079
2080         Reviewed by Darin Adler.
2081
2082         Drop MainFrame class and move contents into Page / Frame since there is a 1:1
2083         relationship between the Page and the MainFrame.
2084
2085         This is ground work for introducing LocalFrame / RemoteFrame concepts.
2086
2087         * Shared/WebRenderLayer.cpp:
2088         * Shared/WebRenderObject.cpp:
2089         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
2090         (WebKit::WebPaymentCoordinator::paymentCoordinator):
2091         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
2092         * WebProcess/FullScreen/WebFullScreenManager.cpp:
2093         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2094         (WKBundlePageInstallPageOverlay):
2095         (WKBundlePageUninstallPageOverlay):
2096         (WKBundlePageInstallPageOverlayWithAnimation):
2097         (WKBundlePageUninstallPageOverlayWithAnimation):
2098         * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
2099         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2100         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2101         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2102         * WebProcess/Plugins/PluginView.cpp:
2103         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
2104         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2105         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
2106         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2107         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
2108         (WebKit::WebInspectorClient::~WebInspectorClient):
2109         (WebKit::WebInspectorClient::highlight):
2110         (WebKit::WebInspectorClient::hideHighlight):
2111         (WebKit::WebInspectorClient::showPaintRect):
2112         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2113         * WebProcess/WebCoreSupport/WebProgressTrackerClient.cpp:
2114         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
2115         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
2116         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
2117         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
2118         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
2119         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
2120         * WebProcess/WebPage/FindController.cpp:
2121         (WebKit::FindController::updateFindUIAfterPageScroll):
2122         (WebKit::FindController::hideFindUI):
2123         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
2124         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
2125         (WebKit::RemoteLayerTreeDrawingArea::updatePreferences):
2126         * WebProcess/WebPage/WKAccessibilityWebPageObjectIOS.mm:
2127         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
2128         * WebProcess/WebPage/WebFrame.cpp:
2129         * WebProcess/WebPage/WebInspector.cpp:
2130         * WebProcess/WebPage/WebInspectorFrontendAPIDispatcher.cpp:
2131         * WebProcess/WebPage/WebPage.cpp:
2132         (WebKit::WebPage::mainFrame const):
2133         (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
2134         (WebKit::WebPage::plugInIntersectsSearchRect):
2135         * WebProcess/WebPage/WebPage.h:
2136         * WebProcess/WebPage/atk/WebPageAccessibilityObjectAtk.cpp:
2137         * WebProcess/WebPage/ios/FindControllerIOS.mm:
2138         * WebProcess/WebPage/ios/WebPageIOS.mm:
2139         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2140         (WebKit::TiledCoreAnimationDrawingArea::updatePreferences):
2141         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
2142         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
2143         (-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]):
2144         (-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
2145         * WebProcess/WebPage/mac/WebPageMac.mm:
2146         (WebKit::WebPage::performImmediateActionHitTestAtLocation):
2147         (WebKit::WebPage::dataDetectorsDidPresentUI):
2148         (WebKit::WebPage::dataDetectorsDidChangeUI):
2149         (WebKit::WebPage::dataDetectorsDidHideUI):
2150         * WebProcess/WebProcess.cpp:
2151         * WebProcess/WebStorage/StorageAreaMap.cpp:
2152
2153 2018-04-03  Youenn Fablet  <youenn@apple.com>
2154
2155         Make NetworkProcess get ContentBlocker information from UIProcess
2156         https://bugs.webkit.org/show_bug.cgi?id=184205
2157
2158         Reviewed by Alex Christensen.
2159
2160         Make NetworkProcess get content blockers from UIProcess directly.
2161         Before that patch, WebProcess sent content blockers to NetworkProcess for each PingLoad.
2162         Instead, WebProcess sends the content blocker identifier for each PingLoad and NetworkProcess fetches the content blocker once.
2163
2164         This is both more efficient than passing them for each PingLoad and safer in the sense
2165         that a compromised WebProcess will not be able to bypass any of these.
2166         In the future, NetworkProcess should get the content blocker identifier directly from the WebPageID attached to the request.
2167
2168         Covered by existing beacon+content blocker tests.
2169
2170         Did some refactoring to add a typed content blocker identifier.
2171         Once NetworkProcess fetches a given content blocker, the content blocker will send any modification to NetworkProcess.
2172         Introduced NetworkContentRuleListManager to handle the content blockers in NetworkProcess.
2173
2174         * CMakeLists.txt:
2175         * DerivedSources.make:
2176         * NetworkProcess/NetworkLoadChecker.cpp:
2177         (WebKit::NetworkLoadChecker::checkRequest):
2178         (WebKit::NetworkLoadChecker::continueCheckingRequest):
2179         (WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad):
2180         * NetworkProcess/NetworkLoadChecker.h:
2181         (WebKit::NetworkLoadChecker::setContentExtensionController):
2182         * NetworkProcess/NetworkProcess.cpp:
2183         (WebKit::NetworkProcess::didReceiveMessage):
2184         * NetworkProcess/NetworkProcess.h:
2185         (WebKit::NetworkProcess::networkUserContentController):
2186         * NetworkProcess/NetworkResourceLoadParameters.cpp:
2187         (WebKit::NetworkResourceLoadParameters::encode const):
2188         (WebKit::NetworkResourceLoadParameters::decode):
2189         * NetworkProcess/NetworkResourceLoadParameters.h:
2190         * NetworkProcess/NetworkContentRuleListManager.cpp: Added.
2191         (WebKit::NetworkContentRuleListManager::contentExtensionsBackend):
2192         (WebKit::NetworkContentRuleListManager::addContentRuleLists):
2193         (WebKit::NetworkContentRuleListManager::removeContentRuleList):
2194         (WebKit::NetworkContentRuleListManager::removeAllContentRuleLists):
2195         (WebKit::NetworkContentRuleListManager::remove):
2196         * NetworkProcess/NetworkContentRuleListManager.h: Added.
2197         * NetworkProcess/NetworkContentRuleListManager.messages.in: Added.
2198         * NetworkProcess/PingLoad.cpp:
2199         * Scripts/webkit/messages.py:
2200         * Shared/UserContentControllerIdentifier.h: Added.
2201         * Shared/WebPageCreationParameters.cpp:
2202         (WebKit::WebPageCreationParameters::decode):
2203         * Shared/WebPageCreationParameters.h:
2204         * Shared/WebPageGroupData.cpp:
2205         (WebKit::WebPageGroupData::decode):
2206         * Shared/WebPageGroupData.h:
2207         * UIProcess/Network/NetworkProcessProxy.cpp:
2208         (WebKit::NetworkProcessProxy::~NetworkProcessProxy):
2209         (WebKit::NetworkProcessProxy::contentExtensionRules):
2210         (WebKit::NetworkProcessProxy::didDestroyWebUserContentControllerProxy):
2211         * UIProcess/Network/NetworkProcessProxy.h:
2212         * UIProcess/Network/NetworkProcessProxy.messages.in:
2213         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
2214         (WebKit::WebUserContentControllerProxy::get):
2215         (WebKit::WebUserContentControllerProxy::WebUserContentControllerProxy):
2216         (WebKit::WebUserContentControllerProxy::~WebUserContentControllerProxy):
2217         (WebKit::WebUserContentControllerProxy::addProcess):
2218         (WebKit::WebUserContentControllerProxy::removeProcess):
2219         (WebKit::WebUserContentControllerProxy::addUserContentWorldUse):
2220         (WebKit::WebUserContentControllerProxy::removeUserContentWorldUses):
2221         (WebKit::WebUserContentControllerProxy::addUserScript):
2222         (WebKit::WebUserContentControllerProxy::removeUserScript):
2223         (WebKit::WebUserContentControllerProxy::removeAllUserScripts):
2224         (WebKit::WebUserContentControllerProxy::addUserStyleSheet):
2225         (WebKit::WebUserContentControllerProxy::removeUserStyleSheet):
2226         (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets):
2227         (WebKit::WebUserContentControllerProxy::addUserScriptMessageHandler):
2228         (WebKit::WebUserContentControllerProxy::removeUserMessageHandlerForName):
2229         (WebKit::WebUserContentControllerProxy::removeAllUserMessageHandlers):
2230         (WebKit::WebUserContentControllerProxy::addContentRuleList):
2231         (WebKit::WebUserContentControllerProxy::removeContentRuleList):
2232         (WebKit::WebUserContentControllerProxy::removeAllContentRuleLists):
2233         * UIProcess/UserContent/WebUserContentControllerProxy.h:
2234         (WebKit::WebUserContentControllerProxy::create):
2235         (WebKit::WebUserContentControllerProxy::addNetworkProcess):
2236         (WebKit::WebUserContentControllerProxy::removeNetworkProcess):
2237         (WebKit::WebUserContentControllerProxy::contentExtensionRules):
2238         (WebKit::WebUserContentControllerProxy::identifier const):
2239         * WebKit.xcodeproj/project.pbxproj:
2240         * WebProcess/Network/WebLoaderStrategy.cpp:
2241         (WebKit::WebLoaderStrategy::startPingLoad):
2242         * WebProcess/UserContent/WebUserContentController.cpp:
2243         (WebKit::WebUserContentController::getOrCreate):
2244         (WebKit::WebUserContentController::WebUserContentController):
2245         (WebKit::WebUserContentController::~WebUserContentController):
2246         * WebProcess/UserContent/WebUserContentController.h:
2247         * WebProcess/WebPage/WebPage.h:
2248         (WebKit::WebPage::userContentControllerIdentifier const):
2249
2250 2018-04-02  Beth Dakin  <bdakin@apple.com>
2251
2252         Fix the managed configurations build
2253         https://bugs.webkit.org/show_bug.cgi?id=184253
2254         -and corresponding-
2255         rdar://problem/39078586
2256
2257         Reviewed by Dan Bernstein.
2258
2259         * UIProcess/ios/WKContentViewInteraction.mm:
2260         (-[WKContentView canPerformActionForWebView:withSender:]):
2261         (-[WKContentView _defineForWebView:]):
2262
2263 2018-04-02  Carlos Garcia Campos  <cgarcia@igalia.com>
2264
2265         [Enchant] Clean up TextCheckerEnchant
2266         https://bugs.webkit.org/show_bug.cgi?id=184233
2267
2268         Reviewed by Michael Catanzaro.
2269
2270         Use TextCheckerEnchant as a singleton now, instead of implementing the singleton here.
2271
2272         * UIProcess/gtk/TextCheckerGtk.cpp:
2273         (WebKit::TextChecker::checkSpellingOfString):
2274         (WebKit::TextChecker::getGuessesForWord):
2275         (WebKit::TextChecker::learnWord):
2276         (WebKit::TextChecker::ignoreWord):
2277         (WebKit::TextChecker::setSpellCheckingLanguages):
2278         (WebKit::TextChecker::loadedSpellCheckingLanguages):
2279         (WebKit::enchantTextChecker): Deleted.
2280
2281 2018-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
2282
2283         [GTK] NetworkProcess from WebKitGtk+ 2.19.9x SIGSEVs in NetworkStorageSession (secret search callback)
2284         https://bugs.webkit.org/show_bug.cgi?id=183346
2285
2286         Reviewed by Michael Catanzaro.
2287
2288         Pass the request cancellable to NetworkStorageSession::getCredentialFromPersistentStorage().
2289
2290         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
2291         (WebKit::NetworkDataTaskSoup::authenticate):
2292
2293 2018-04-02  Brady Eidson  <beidson@apple.com>
2294
2295         Process swapping on navigation needs to handle server redirects.
2296         <rdar://problem/38690465> and https://bugs.webkit.org/show_bug.cgi?id=184142
2297
2298         Reviewed by Alex Christensen.
2299
2300         The same rules we apply to process swapping for basic navigations need to apply
2301         to server redirects as well.
2302
2303         There's three interesting cases we need to support that are covered by new API tests:
2304         1 - The initial load in a WKWebView redirects cross-origin.
2305         2 - A WKWebView is showing content from a.com, we start a load to b.com, and that redirects to c.com
2306         3 - A WKWebView is showing content from a.com, we start a load to a.com, that that redirects to b.com.
2307
2308         Supporting all 3 of these brought their own little challenges.
2309
2310         By teaching Navigation objects more about redirects I was able to support all 3 cases.
2311
2312         * UIProcess/API/APINavigation.cpp:
2313         (API::Navigation::Navigation):
2314         (API::Navigation::setCurrentRequest):
2315         (API::Navigation::appendRedirectionURL):
2316         (API::Navigation::loggingString const):
2317         (API::Navigation::loggingURL const): Deleted.
2318         * UIProcess/API/APINavigation.h:
2319         (API::Navigation::originalRequest const):
2320         (API::Navigation::currentRequest const):
2321         (API::Navigation::currentRequestProcessIdentifier const):
2322         (API::Navigation::setCurrentRequestIsRedirect):
2323         (API::Navigation::currentRequestIsRedirect const):
2324         (API::Navigation::request const): Deleted.
2325
2326         * UIProcess/API/Cocoa/WKNavigation.mm:
2327         (-[WKNavigation _request]):
2328
2329         * UIProcess/WebPageProxy.cpp:
2330         (WebKit::WebPageProxy::receivedPolicyDecision):
2331         (WebKit::WebPageProxy::continueNavigationInNewProcess): If this continued navigation is currently in a server
2332           redirect, save off a lambda to synthesize a "did receive server redirect" callback once the new WebProcess is running.
2333         (WebKit::WebPageProxy::didCreateMainFrame):
2334         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame): Possibly ignore this notification if it is really a
2335           cross-origin redirect that is just starting back up in a new WebProcess.
2336         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
2337         (WebKit::WebPageProxy::didCommitLoadForFrame):
2338         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2339         (WebKit::WebPageProxy::resetStateAfterProcessExited): Do not clear pageLoadState if the process is exitting for
2340           a navigation swap, as we will need to pick up where we left off when the load continues in a new WebProcess.
2341         * UIProcess/WebPageProxy.h:
2342         * UIProcess/WebPageProxy.messages.in:
2343
2344         * UIProcess/WebProcessPool.cpp:
2345         (WebKit::WebProcessPool::processForNavigation): If a process has never committed any provisional load, it can always
2346           be used to continue a navigation.
2347         * UIProcess/WebProcessPool.h:
2348
2349         * UIProcess/WebProcessProxy.h:
2350         (WebKit::WebProcessProxy::didCommitProvisionalLoad):
2351         (WebKit::WebProcessProxy::hasCommittedAnyProvisionalLoads const):
2352
2353         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2354         (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad):
2355         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2356
2357 2018-04-02  Eric Carlson  <eric.carlson@apple.com>
2358
2359         [Extra zoom mode] Replace video with a placeholder image during fullscreen transition
2360         https://bugs.webkit.org/show_bug.cgi?id=184188
2361         <rdar://problem/38940307>
2362
2363         Reviewed by Youenn Fablet.
2364
2365         * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
2366         * UIProcess/Cocoa/VideoFullscreenManagerProxy.messages.in:
2367         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
2368         (WebKit::VideoFullscreenModelContext::willExitFullscreen):
2369         (WebKit::VideoFullscreenManagerProxy::preparedToExitFullscreen):
2370         (WebKit::VideoFullscreenManagerProxy::willExitFullscreen):
2371         * WebProcess/cocoa/VideoFullscreenManager.h:
2372         * WebProcess/cocoa/VideoFullscreenManager.messages.in:
2373         * WebProcess/cocoa/VideoFullscreenManager.mm:
2374         (WebKit::VideoFullscreenManager::willExitFullscreen):
2375
2376 2018-04-02  Brian Burg  <bburg@apple.com>
2377
2378         [Cocoa] Fix some internal builds that consume WebDriver atoms
2379         https://bugs.webkit.org/show_bug.cgi?id=184197
2380
2381         Reviewed by Dan Bernstein.
2382
2383         * WebKit.xcodeproj/project.pbxproj:
2384         Use a Run Script phase to copy WebDriver atoms to WebKit.framework
2385         private headers during the installhdrs phase.
2386
2387 2018-04-02  Ryan Haddad  <ryanhaddad@apple.com>
2388
2389         Unreviewed, rolling out r230174.
2390
2391         Caused LayoutTests to exit early with assertion failures.
2392
2393         Reverted changeset:
2394
2395         "Process swapping on navigation needs to handle server
2396         redirects."
2397         https://bugs.webkit.org/show_bug.cgi?id=184142
2398         https://trac.webkit.org/changeset/230174
2399
2400 2018-04-02  Wenson Hsieh  <wenson_hsieh@apple.com>
2401
2402         [Extra zoom mode] Update date picker UI to latest specifications
2403         https://bugs.webkit.org/show_bug.cgi?id=184234
2404         <rdar://problem/38804760>
2405
2406         Reviewed by Timothy Hatcher.
2407
2408         Rename WKTextFormControlListViewControllerDelegate to WKTextInputListViewControllerDelegate and adjust for the
2409         new initializer of WKDatePickerViewController.
2410
2411         * UIProcess/ios/WKContentViewInteraction.mm:
2412         (-[WKContentView presentViewControllerForCurrentAssistedNode]):
2413
2414 2018-04-02  Brady Eidson  <beidson@apple.com>
2415
2416         Process swapping on navigation needs to handle server redirects.
2417         <rdar://problem/38690465> and https://bugs.webkit.org/show_bug.cgi?id=184142
2418
2419         Reviewed by Alex Christensen.
2420
2421         The same rules we apply to process swapping for basic navigations need to apply
2422         to server redirects as well.
2423
2424         There's three interesting cases we need to support that are covered by new API tests:
2425         1 - The initial load in a WKWebView redirects cross-origin.
2426         2 - A WKWebView is showing content from a.com, we start a load to b.com, and that redirects to c.com
2427         3 - A WKWebView is showing content from a.com, we start a load to a.com, that that redirects to b.com.
2428
2429         Supporting all 3 of these brought their own little challenges.
2430
2431         By teaching Navigation objects more about redirects I was able to support all 3 cases.
2432
2433         * UIProcess/API/APINavigation.cpp:
2434         (API::Navigation::Navigation):
2435         (API::Navigation::setCurrentRequest):
2436         (API::Navigation::appendRedirectionURL):
2437         (API::Navigation::loggingString const):
2438         (API::Navigation::loggingURL const): Deleted.
2439         * UIProcess/API/APINavigation.h:
2440         (API::Navigation::originalRequest const):
2441         (API::Navigation::currentRequest const):
2442         (API::Navigation::currentRequestProcessIdentifier const):
2443         (API::Navigation::setCurrentRequestIsRedirect):
2444         (API::Navigation::currentRequestIsRedirect const):
2445         (API::Navigation::request const): Deleted.
2446
2447         * UIProcess/API/Cocoa/WKNavigation.mm:
2448         (-[WKNavigation _request]):
2449
2450         * UIProcess/WebPageProxy.cpp:
2451         (WebKit::WebPageProxy::receivedPolicyDecision):
2452         (WebKit::WebPageProxy::continueNavigationInNewProcess): If this continued navigation is currently in a server
2453           redirect, save off a lambda to synthesize a "did receive server redirect" callback once the new WebProcess is running.
2454         (WebKit::WebPageProxy::didCreateMainFrame):
2455         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame): Possibly ignore this notification if it is really a
2456           cross-origin redirect that is just starting back up in a new WebProcess.
2457         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
2458         (WebKit::WebPageProxy::didCommitLoadForFrame):
2459         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2460         (WebKit::WebPageProxy::resetStateAfterProcessExited): Do not clear pageLoadState if the process is exitting for
2461           a navigation swap, as we will need to pick up where we left off when the load continues in a new WebProcess.
2462         * UIProcess/WebPageProxy.h:
2463         * UIProcess/WebPageProxy.messages.in:
2464
2465         * UIProcess/WebProcessPool.cpp:
2466         (WebKit::WebProcessPool::processForNavigation): If a process has never committed any provisional load, it can always
2467           be used to continue a navigation.
2468         * UIProcess/WebProcessPool.h:
2469
2470         * UIProcess/WebProcessProxy.h:
2471         (WebKit::WebProcessProxy::didCommitProvisionalLoad):
2472         (WebKit::WebProcessProxy::hasCommittedAnyProvisionalLoads const):
2473
2474         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2475         (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad):
2476         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2477
2478 2018-04-02  Wenson Hsieh  <wenson_hsieh@apple.com>
2479
2480         [Extra zoom mode] Zoom level is sometimes excessive when zooming to focused form controls
2481         https://bugs.webkit.org/show_bug.cgi?id=184222
2482         <rdar://problem/39063886>
2483
2484         Reviewed by Timothy Hatcher.
2485
2486         Upon interactively focusing an element, we zoom and scroll to reveal that element. The heuristics introduced in
2487         <https://trac.webkit.org/r168744> work by computing a target scale, and then a point to zoom to given that
2488         scale. Currently, this scale is dependent on the computed font size of the form control, such that the form
2489         control would be scaled to have an effective font size of 16.
2490
2491         However, in extra zoom mode, applying these same heuristics (ironically) results in excessive zoom levels, since
2492         scaling the font up to 16 would cause most form controls to zoom so far in that we lose context of surrounding
2493         elements such as labels and other form controls; the fact that the element is highlighted by the focused form
2494         control overlay makes this even more confusing, since part of the focus overlay highlight rect often ends up
2495         outside the viewport.
2496
2497         To fix this, we make a couple of tweaks to focus rect zooming in extra zoom mode. (1) Instead of computing
2498         target zoom level based on font size, try to zoom such that the focused element rect fills up most of the
2499         viewport (similar to double-tap zooming). This ensures that the focused form control overlay's highlight rect
2500         makes sense in most cases, with few exceptions (e.g. the element frame is larger than the viewport). (2)
2501         Introduce a minimum legible font size of 11, and compute the minimium scale needed such that the form control
2502         font would appear to be at least this legible font size. Then, clamp the target scale chosen by (1) to this
2503         minimum scale.
2504
2505         One additional consideration for (1) is that naively scaling to fit the element rect to the viewport (with some
2506         fixed margins) would cause the viewport scale to always change when moving focus between form controls of
2507         different dimensions, even if the current scale is more or less appropriate for all the focusable elements. To
2508         address this, instead of computing a single target zoom scale for an element rect, compute a range of possible
2509         target zoom scales (where the minimum and maximum values depend on the margin we add around the element rect).
2510         If the current scale already falls within this target scale range, then we won't bother adjusting the scale at
2511         all (unless the font size is too small — see (2)). If the current scale falls outside the target scale range, we
2512         then make the minimal adjustment needed to ensure that the element rect fits well within the viewport without
2513         being too small.
2514
2515         * UIProcess/API/Cocoa/WKWebView.mm:
2516         (-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
2517
2518         Move some logic around so that the target scale is computed after computing the visible size. Also renames some
2519         constants local to this function (WKWebViewStandardFontSize, kMinimumHeightToShowContentAboveKeyboard,
2520         UIWebFormAnimationDuration, CaretOffsetFromWindowEdge) such that they now share a consistent naming style.
2521
2522 2018-04-02  Jer Noble  <jer.noble@apple.com>
2523
2524         Enable Legacy EME for all WebKit & WebKitLegacy clients
2525         https://bugs.webkit.org/show_bug.cgi?id=184018
2526         <rdar://problem/34887387>
2527
2528         Reviewed by Eric Carlson.
2529
2530         * Shared/WebPreferences.yaml:
2531         * Shared/WebPreferencesDefaultValues.h:
2532
2533 2018-04-02  Jer Noble  <jer.noble@apple.com>
2534
2535         REGRESSION (229680): Fullscreen video does not work (youtube, netflix)
2536         https://bugs.webkit.org/show_bug.cgi?id=184235
2537
2538         Reviewed by Eric Carlson.
2539
2540         Enable the Fullscreen API by default.
2541
2542         * Shared/WebPreferences.yaml:
2543         * Shared/WebPreferencesDefaultValues.h:
2544
2545 2018-04-02  Fujii Hironori  <Hironori.Fujii@sony.com>
2546
2547         [Win] MSVC can't compile WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent
2548         https://bugs.webkit.org/show_bug.cgi?id=184120
2549
2550         Reviewed by Alex Christensen.
2551
2552         It seems that MSVC can't compile the code using `this` in a
2553         generalized lambda capture in another lambda.
2554
2555         In this case, there is no need to copy `protectedThis` for the
2556         inner lambda. Move `protectedThis` of the outer lambda to the
2557         inner as well as `callback`.
2558
2559         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2560         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
2561         Moved `protectedThis` from the outer lambda to the inner.
2562
2563 2018-04-02  Dan Bernstein  <mitz@apple.com>
2564
2565         Build fix after r230121
2566
2567         * Configurations/WebKit.xcconfig: Disabled framework header postprocessing when building for
2568           iOS 11.*
2569         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: Reverted r230159.
2570
2571 2018-04-02  Dan Bernstein  <mitz@apple.com>
2572
2573         Fixed the build when BOOL is not bool.
2574         <rdar://problem/39094484>
2575
2576         Reviewed by Jer Noble.
2577
2578         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
2579         (-[WKFullScreenViewController videoControlsManagerDidChange]): Removed the write-only ivar
2580           _hasControlsManager, the assignment to which was causing the compiler error.
2581
2582 2018-04-02  Ryan Haddad  <ryanhaddad@apple.com>
2583
2584         Unreviewed build fix.
2585
2586         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: Update availability annotation.
2587
2588 2018-04-02  Michael Catanzaro  <mcatanzaro@igalia.com>
2589
2590         [GTK] DragAndDropHandler.cpp should include GUniquePtrGtk.h
2591         https://bugs.webkit.org/show_bug.cgi?id=184119
2592
2593         Reviewed by Daniel Bates.
2594
2595         * UIProcess/gtk/DragAndDropHandler.cpp:
2596
2597 2018-04-02  Frederic Wang  <fwang@igalia.com>
2598
2599         Fix warnings for unused lambda captures in Source/WebKit
2600         https://bugs.webkit.org/show_bug.cgi?id=173555
2601
2602         Reviewed by Konstantin Tokarev.
2603
2604         When release logs are disabled, several lambda captures are unused, causing compilation
2605         failures with -Wunused-lambda-capture. This patch marks the corresponding variables as unused
2606         in order to fix these warnings.
2607
2608         Based on initial patch by: Konstantin Tokarev  <annulen@yandex.ru>
2609
2610         * NetworkProcess/NetworkResourceLoader.cpp:
2611         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
2612         * UIProcess/Network/NetworkProcessProxy.cpp:
2613         (WebKit::NetworkProcessProxy::fetchWebsiteData):
2614         (WebKit::NetworkProcessProxy::deleteWebsiteData):
2615         (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
2616         * UIProcess/WebProcessProxy.cpp:
2617         (WebKit::WebProcessProxy::fetchWebsiteData):
2618         (WebKit::WebProcessProxy::deleteWebsiteData):
2619         (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins):
2620         * UIProcess/ios/WKContentViewInteraction.mm:
2621         (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
2622
2623 2018-04-02  Alejandro G. Castro  <alex@igalia.com>
2624
2625         [GTK] Make libwebrtc backend buildable for GTK  port
2626         https://bugs.webkit.org/show_bug.cgi?id=178860
2627
2628         Reviewed by Youenn Fablet.
2629
2630         * CMakeLists.txt: Add RTC network classes to the compilation and
2631         the libwebrtc includes.
2632         * PlatformGTK.cmake: Add the libwebrtc directory.
2633         * SourcesGTK.txt: Add RTC files to the compilation.
2634
2635 2018-03-30  Chris Dumez  <cdumez@apple.com>
2636
2637         REGRESSION (r229828): Facebook login popup is blank
2638         https://bugs.webkit.org/show_bug.cgi?id=184206
2639         <rdar://problem/39057006>
2640
2641         Reviewed by Wenson Hsieh.
2642
2643         Add assertion to make sure we never try to do a policy check to
2644         a resource response while a policy check for a navigation is
2645         pending. This assertion was being hit by several of our redirection
2646         tests without my fix.
2647
2648         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2649         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
2650
2651 2018-03-30  Ryan Haddad  <ryanhaddad@apple.com>
2652
2653         Unreviewed, rolling out r230125.
2654
2655         Build fix broke more builds.
2656
2657         Reverted changeset:
2658
2659         "Unreviewed build fix, remove unused lambda capture."
2660         https://trac.webkit.org/changeset/230125
2661
2662 2018-03-30  Ryan Haddad  <ryanhaddad@apple.com>
2663
2664         Unreviewed build fix, remove unused lambda capture.
2665
2666         * NetworkProcess/NetworkResourceLoader.cpp:
2667         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
2668
2669 2018-03-30  Wenson Hsieh  <wenson_hsieh@apple.com>
2670
2671         [Extra zoom mode] Adopt list view controller UI for numeric input types
2672         https://bugs.webkit.org/show_bug.cgi?id=184184
2673         <rdar://problem/37238916>
2674
2675         Reviewed by Timothy Hatcher.
2676
2677         Remove existing logic for presenting a number pad view controller, since number pads will now be handled as a
2678         special case of general text form controls in extra zoom mode.
2679
2680         * UIProcess/ios/WKContentViewInteraction.h:
2681         * UIProcess/ios/WKContentViewInteraction.mm:
2682         (-[WKContentView presentViewControllerForCurrentAssistedNode]):
2683         (-[WKContentView dismissAllInputViewControllers]):
2684         (-[WKContentView _wheelChangedWithEvent:]):
2685
2686 2018-03-30  Dan Bernstein  <mitz@apple.com>
2687
2688         Update availability annotations to match the macOS 10.13.4 and iOS 11.3 GM SDKs
2689         https://bugs.webkit.org/show_bug.cgi?id=184173
2690
2691         Reviewed by Alex Christensen.
2692
2693         Changed WK_MAC_TBA and WK_IOS_TBA to 10.13.4 and 11.3, respectively, in all declarations that
2694         appear in the GM SDKs.
2695
2696         * Shared/API/Cocoa/_WKNSWindowExtras.h:
2697         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
2698         * UIProcess/API/Cocoa/WKOpenPanelParameters.h:
2699         * UIProcess/API/Cocoa/WKOpenPanelParametersPrivate.h:
2700         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2701         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2702         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2703         * UIProcess/API/Cocoa/WKViewPrivate.h:
2704         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2705         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2706         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
2707         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
2708         * UIProcess/API/Cocoa/_WKApplicationManifest.h:
2709         * UIProcess/API/Cocoa/_WKAttachment.h:
2710         * UIProcess/API/Cocoa/_WKAutomationSession.h:
2711         * UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.h:
2712         * UIProcess/API/Cocoa/_WKDownload.h:
2713         * UIProcess/API/Cocoa/_WKDownloadDelegate.h:
2714         * UIProcess/API/Cocoa/_WKFocusedElementInfo.h:
2715         * UIProcess/API/Cocoa/_WKFullscreenDelegate.h:
2716         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
2717         * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.h:
2718         * UIProcess/API/Cocoa/_WKVisitedLinkStore.h:
2719         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
2720         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
2721         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandlePrivate.h:
2722         * WebProcess/InjectedBundle/API/mac/WKDOMDocument.h:
2723
2724 2018-03-30  Youenn Fablet  <youenn@apple.com>
2725
2726         NetworkLoadChecker should upgrade redirects if needed
2727         https://bugs.webkit.org/show_bug.cgi?id=184098
2728
2729         Reviewed by Chris Dumez.
2730
2731         In case of redirections, upgrade URL according CSP.
2732
2733         * NetworkProcess/NetworkLoadChecker.cpp:
2734         (WebKit::NetworkLoadChecker::checkRequest):
2735         (WebKit::NetworkLoadChecker::contentSecurityPolicy const):
2736
2737 2018-03-30  JF Bastien  <jfbastien@apple.com>
2738
2739         Update messages.py codegen for String, fix tests
2740         https://bugs.webkit.org/show_bug.cgi?id=184179
2741         <rdar://problem/39041352>
2742
2743         Reviewed by Mark Lam.
2744
2745         I updated some of the code in
2746         https://trac.webkit.org/changeset/230097 and auto-magically used a
2747         script to update copyright headers... and that broke the tests
2748         which checked for a particular date. Update all of the headers.
2749
2750         Part of this change updates the code generated by messages.py
2751
2752         * Scripts/webkit/LegacyMessageReceiver-expected.cpp:
2753         * Scripts/webkit/MessageReceiver-expected.cpp:
2754         * Scripts/webkit/MessageReceiverSuperclass-expected.cpp:
2755         * Scripts/webkit/MessagesSuperclass-expected.h:
2756         * Scripts/webkit/messages.py:
2757         * Scripts/webkit/messages_unittest.py:
2758         (GeneratedFileContentsTest.assertGeneratedFileContentsEqual):
2759         generate a better error message
2760
2761 2018-03-29  JF Bastien  <jfbastien@apple.com>
2762
2763         Use Forward.h instead of forward-declaring WTF::String
2764         https://bugs.webkit.org/show_bug.cgi?id=184172
2765         <rdar://problem/39026146>
2766
2767         Reviewed by Yusuke Suzuki.
2768
2769         As part of #184164 I'm changing WTF::String, and the forward
2770         declarations are just wrong because I'm making it templated. We
2771         should use Forward.h anyways, so do that instead.
2772
2773         * Scripts/webkit/LegacyMessages-expected.h:
2774         * Scripts/webkit/Messages-expected.h:
2775         * Scripts/webkit/MessagesSuperclass-expected.h:
2776         * UIProcess/WebOpenPanelResultListenerProxy.h:
2777
2778 2018-03-29  Brian Burg  <bburg@apple.com>
2779
2780         Web Automation: clipToViewport is ignored for element screenshots
2781         https://bugs.webkit.org/show_bug.cgi?id=184158
2782         <rdar://problem/39014307>
2783
2784         Reviewed by Timothy Hatcher.
2785
2786         In §19.2 Take Element Screenshot, step 5.2 says that we should clip
2787         the element screenshot rect with the visible viewport rect. We don't
2788         do that right now even though we pass over clipToViewport.
2789
2790         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
2791         (WebKit::snapshotRectForScreenshot):
2792         Clip the rect to viewport if needed.
2793
2794         (WebKit::WebAutomationSessionProxy::takeScreenshot):
2795         This scrollIntoView is misplaced; by this point we have already done
2796         the math to figure out the screenshot rect. Move it before computing the rect.
2797
2798 2018-03-29  Brent Fulgham  <bfulgham@apple.com>
2799
2800         REGRESSION(r230035): ASSERT(MACH_PORT_VALID(m_sendPort)) hit in IPC::Connection::initializeSendSource()
2801         https://bugs.webkit.org/show_bug.cgi?id=184122
2802         <rdar://problem/39003606>
2803
2804         Reviewed by Chris Dumez.
2805
2806         One of the new assertions added in r230035 begin firing while running tests locally. This was happening
2807         because the WebInspector was attempting to open a new connection to a web process that had already
2808         terminated its mach port connection (a dead port).
2809         
2810         We should avoid opening new connections when the port we were given is already dead.
2811
2812         * Platform/IPC/Connection.h:
2813         (IPC::Connection::identifierIsValid): Added.
2814         * Platform/IPC/mac/ConnectionMac.mm:
2815         (IPC::Connection::platformInitialize): Do not perform initialization on a dead (or null) port.
2816         (IPC::Connection::open): Add some assertions that ports are in a valid state.
2817         (IPC::Connection::sendOutgoingMessage): Assert that the send port is not dead.
2818         (IPC::Connection::receiveSourceEventHandler): Assert that the receive port is valid.
2819         * UIProcess/ChildProcessProxy.cpp:
2820         (WebKit::ChildProcessProxy::didFinishLaunching): Treat a dead port as a signal that the
2821         child process failed to launch.
2822         * UIProcess/Network/NetworkProcessProxy.cpp:
2823         (WebKit::NetworkProcessProxy::didFinishLaunching): Ditto.
2824         * UIProcess/Plugins/PluginProcessProxy.cpp:
2825         (WebKit::PluginProcessProxy::didFinishLaunching): Ditto.
2826         * UIProcess/Storage/StorageProcessProxy.cpp:
2827         (WebKit::StorageProcessProxy::didFinishLaunching): Ditto.
2828         * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
2829         (WebKit::PluginProcessConnectionManager::getPluginProcessConnection): Ditto.
2830         * WebProcess/WebPage/WebInspectorUI.cpp:
2831         (WebKit::WebInspectorUI::establishConnection): Ditto.
2832         * WebProcess/WebProcess.cpp:
2833         (WebKit::WebProcess::ensureNetworkProcessConnection): Ditto.
2834         (WebKit::WebProcess::ensureWebToStorageProcessConnection): Ditto.
2835
2836 2018-03-29  Youenn Fablet  <youenn@apple.com>
2837
2838         Synchronize SecurityOrigin related scheme registries with NetworkProcess
2839         https://bugs.webkit.org/show_bug.cgi?id=184140
2840
2841         Reviewed by Chris Dumez.
2842
2843         Add syncing of scheme registries that are used by SecurityOrigin and ContentSecurityPolicy
2844         so that we can properly use them in NetworkProcess as we do in WebProcess.
2845         The registries that are not synced are:
2846         - URLSchemeAsEmptyDocument
2847         - URLSchemeDomainRelaxationForbidden
2848         - URLSchemeAsCachePartitioned
2849         - URLSchemeAsCanDisplayOnlyIfCanRequest
2850
2851         * NetworkProcess/NetworkProcess.cpp:
2852         (WebKit::NetworkProcess::initializeNetworkProcess):
2853         (WebKit::NetworkProcess::registerURLSchemeAsSecure const):
2854         (WebKit::NetworkProcess::registerURLSchemeAsBypassingContentSecurityPolicy const):
2855         (WebKit::NetworkProcess::registerURLSchemeAsLocal const):
2856         (WebKit::NetworkProcess::registerURLSchemeAsNoAccess const):
2857         (WebKit::NetworkProcess::registerURLSchemeAsDisplayIsolated const):
2858         (WebKit::NetworkProcess::registerURLSchemeAsCORSEnabled const):
2859         (WebKit::NetworkProcess::registerURLSchemeAsCanDisplayOnlyIfCanRequest const):
2860         * NetworkProcess/NetworkProcess.h:
2861         * NetworkProcess/NetworkProcess.messages.in:
2862         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2863         (WebKit::NetworkProcessCreationParameters::encode const):
2864         (WebKit::NetworkProcessCreationParameters::decode):
2865         * NetworkProcess/NetworkProcessCreationParameters.h:
2866         * UIProcess/WebProcessPool.cpp:
2867         (WebKit::WebProcessPool::ensureNetworkProcess):
2868         (WebKit::WebProcessPool::registerURLSchemeAsSecure):
2869         (WebKit::WebProcessPool::registerURLSchemeAsBypassingContentSecurityPolicy):
2870         (WebKit::WebProcessPool::registerURLSchemeAsLocal):
2871         (WebKit::WebProcessPool::registerURLSchemeAsNoAccess):
2872         (WebKit::WebProcessPool::registerURLSchemeAsDisplayIsolated):
2873         (WebKit::WebProcessPool::registerURLSchemeAsCORSEnabled):
2874         (WebKit::WebProcessPool::registerURLSchemeAsCanDisplayOnlyIfCanRequest):
2875
2876 2018-03-29  Brent Fulgham  <bfulgham@apple.com>
2877
2878         REGRESSION(r229480): ERROR: Unhandled web process message 'WebCookieManager:SetHTTPCookieAcceptPolicy'
2879         https://bugs.webkit.org/show_bug.cgi?id=184124
2880         <rdar://problem/38998971>
2881
2882         Reviewed by Chris Dumez.
2883
2884         Cookie accept policy messages were still being sent to the WebContent process after
2885         I removed cookie access in r229480. The WebContent process no longer recognizes these
2886         messages, and generates logging to that effect.
2887         
2888         This patch stops sending these unnecessary messages to the WebContent process. Only the
2889         Network process needs to receive this information.
2890
2891         * UIProcess/WebCookieManagerProxy.cpp:
2892         (WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy):
2893
2894 2018-03-29  Carlos Eduardo Ramalho  <cadubentzen@gmail.com>
2895
2896         [WPE] Floating point exception in WebEventFactory::createWebWheelEvent
2897         https://bugs.webkit.org/show_bug.cgi?id=184037
2898
2899         Reviewed by Žan Doberšek.
2900
2901         * Shared/wpe/WebEventFactory.cpp:
2902         (WebKit::WebEventFactory::createWebWheelEvent): Use std::copysign() to avoid division by 0.
2903
2904 2018-03-28  Zalan Bujtas  <zalan@apple.com>
2905
2906         Make it possible to override the screen size
2907         https://bugs.webkit.org/show_bug.cgi?id=184111
2908         <rdar://problem/38972181>
2909
2910         Reviewed by Tim Horton.
2911
2912         * Shared/WebPageCreationParameters.cpp:
2913         (WebKit::WebPageCreationParameters::encode const):
2914         (WebKit::WebPageCreationParameters::decode):
2915         * Shared/WebPageCreationParameters.h:
2916         * UIProcess/WebPageProxy.cpp:
2917         (WebKit::WebPageProxy::creationParameters):
2918         * UIProcess/WebPageProxy.h:
2919         * UIProcess/ios/WebPageProxyIOS.mm:
2920         (WebKit::WebPageProxy::overrideScreenSize):
2921         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2922         (WebKit::WebChromeClient::overrideScreenSize const):
2923         * WebProcess/WebCoreSupport/WebChromeClient.h:
2924         * WebProcess/WebPage/WebPage.cpp:
2925         * WebProcess/WebPage/WebPage.h:
2926         * WebProcess/WebPage/ios/WebPageIOS.mm:
2927         (WebKit::WebPage::overrideScreenSize const):
2928
2929 2018-03-28  Chris Dumez  <cdumez@apple.com>
2930
2931         Do process swap when opening a cross-origin URL via window.open(url, '_blank', 'noopener')
2932         https://bugs.webkit.org/show_bug.cgi?id=183962
2933         <rdar://problem/38817833>
2934
2935         Reviewed by Brady Eidson.
2936
2937         Swap WebProcess on for the initial navigation in a new Window that was opened
2938         via window.open(), when the new URL is cross-origin compared to the opener's
2939         origin. For now, we only swap process if 'noopener' property is set when calling
2940         window.open(). This is because we do not support the remote DOMWindows yet.
2941
2942         * Shared/NavigationActionData.cpp:
2943         (WebKit::NavigationActionData::encode const):
2944         (WebKit::NavigationActionData::decode):
2945         * Shared/NavigationActionData.h:
2946         * UIProcess/API/APINavigation.h:
2947         (API::Navigation::setIsCrossOriginWindowOpenNavigation):
2948         (API::Navigation::isCrossOriginWindowOpenNavigation const):
2949         (API::Navigation::setOpener):
2950         (API::Navigation::opener const):
2951         * UIProcess/WebPageProxy.cpp:
2952         (WebKit::WebPageProxy::receivedPolicyDecision):
2953         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2954         * UIProcess/WebProcessPool.cpp:
2955         (WebKit::WebProcessPool::processForNavigation):
2956         * UIProcess/WebProcessPool.h:
2957         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2958         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2959
2960 2018-03-28  Per Arne Vollan  <pvollan@apple.com>
2961
2962         Adopt WEBPROCESS_WINDOWSERVER_BLOCKING compiler guard in WebProcess.
2963         https://bugs.webkit.org/show_bug.cgi?id=183959
2964         <rdar://problem/38965719>
2965
2966         Reviewed by Brent Fulgham.
2967
2968         Use the compile guard to guard the call to CGSSetDenyWindowServerConnections.
2969
2970         * WebProcess/WebProcess.cpp:
2971         (WebKit::WebProcess::initializeProcess):
2972
2973 2018-03-28  Brent Fulgham  <bfulgham@apple.com>
2974
2975         Unreviewed build fix after r230045.
2976
2977         * UIProcess/Launcher/mac/ProcessLauncherMac.mm: Add missing include (breaks iOS).
2978
2979 2018-03-28  Brent Fulgham  <bfulgham@apple.com>
2980
2981         Protect against invalid mach ports returned by mach_port_request_notification
2982         https://bugs.webkit.org/show_bug.cgi?id=184106
2983         <rdar://problem/37865316>
2984
2985         Reviewed by Chris Dumez.
2986
2987         * Platform/IPC/Connection.h:
2988         (IPC::Connection::Identifier::Identifier): Use default initializer syntax.
2989         * Platform/IPC/mac/ConnectionMac.mm:
2990         (IPC::Connection::open): Drive-by-fix: Include formatted mach error message in logging.
2991         (IPC::Connection::receiveSourceEventHandler): Check return value from 'mach_port_request_notification'
2992         and clean up if it experienced an error.
2993         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2994         (WebKit::ProcessLauncher::launchProcess): Ditto.
2995
2996 2018-03-28  Dean Jackson  <dino@apple.com>
2997
2998         WKWebViewContentProvider shouldn't be a UIScrollViewDelegate
2999         https://bugs.webkit.org/show_bug.cgi?id=184107
3000         <rdar://problem/38967492>
3001
3002         Reviewed by Tim Horton.
3003
3004         There is no need for this class to be a UIScrollViewDelegate. Instead
3005         the protocol should have an optional method that is effectively
3006         scrollViewDidScroll.
3007
3008         * UIProcess/API/Cocoa/WKWebView.mm:
3009         (-[WKWebView scrollViewDidScroll:]): Call web_scrollViewDidScroll
3010         if it exists.
3011         * UIProcess/Cocoa/WKWebViewContentProvider.h: Remove UIScrollViewDelegate
3012         and add an optional web_scrollViewDidScroll.
3013         * UIProcess/ios/WKPDFView.mm:
3014         (-[WKPDFView web_scrollViewDidScroll:]): Renamed from scrollViewDidScroll.
3015         (-[WKPDFView scrollViewDidScroll:]): Deleted.
3016         * UIProcess/ios/WKSystemPreviewView.mm:
3017         (-[WKSystemPreviewView scrollViewDidScroll:]): Deleted.
3018
3019 2018-03-28  Wenson Hsieh  <wenson_hsieh@apple.com>
3020
3021         [Extra zoom mode] Make boosted text autosizing values switchable at runtime
3022         https://bugs.webkit.org/show_bug.cgi?id=184092
3023         <rdar://problem/38939917>
3024
3025         Reviewed by Tim Horton.
3026
3027         Add a private web view preference to switch between normal and boosted text autosizing mode. By default, we use
3028         normal text autosizing values.
3029
3030         * Shared/WebPreferences.yaml:
3031         * UIProcess/API/Cocoa/WKPreferences.mm:
3032         (-[WKPreferences _setShouldEnableTextAutosizingBoost:]):
3033         (-[WKPreferences _shouldEnableTextAutosizingBoost]):
3034         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
3035
3036 2018-03-28  Brent Fulgham  <bfulgham@apple.com>
3037
3038         Avoid uninitialized mach ports
3039         https://bugs.webkit.org/show_bug.cgi?id=184090
3040         <rdar://problem/37261129>
3041
3042         Reviewed by Chris Dumez.
3043
3044         It is possible for mach_port_allocate to return an error, but we rarely check its return value. The value
3045         of the argument passed to mach_port_allocate is not guaranteed to be valid when it returns an error, so
3046         there is a potential for us to try to use invalid ports.
3047
3048         We should always check return values, and ensure that the mach port variables we seek to initialize are
3049         kept in a valid state.
3050
3051         Reviewed by Chris Dumez.
3052
3053         * NetworkProcess/NetworkProcess.cpp:
3054         (WebKit::NetworkProcess::createNetworkConnectionToWebProcess): Initialize new port to a safe default and
3055         check the return state of the allocation function.
3056         * Platform/IPC/Connection.h:
3057         * Platform/IPC/mac/ConnectionMac.mm:
3058         (IPC::Connection::open): Ditto.
3059         (IPC::Connection::initializeSendSource): Ditto.
3060         (IPC::readFromMachPort): Ditto.
3061         (IPC::Connection::receiveSourceEventHandler): Ditto.
3062         * Platform/SharedMemory.h:
3063         * Platform/cocoa/SharedMemoryCocoa.cpp:
3064         (WebKit::makeMemoryEntry): Ditto.
3065         * Platform/mac/MachUtilities.cpp:
3066         (setMachPortQueueLength): Ditto.
3067         (setMachExceptionPort): Ditto.
3068         * PluginProcess/PluginProcess.cpp:
3069         (WebKit::PluginProcess::createWebProcessConnection): Ditto.
3070         * StorageProcess/StorageProcess.cpp:
3071         (WebKit::StorageProcess::createStorageToWebProcessConnection): Ditto.
3072         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
3073         (WebKit::ProcessLauncher::launchProcess): Ditto.
3074         * WebProcess/WebPage/WebInspector.cpp:
3075         (WebKit::WebInspector::openFrontendConnection): Ditto.
3076
3077 2018-03-28  Michael Catanzaro  <mcatanzaro@igalia.com>
3078
3079         Fails to build webkitgtk+ after git-svn-id: http://svn.webkit.org/repository/webkit/trunk@229877 268f45cc-cd09-0410-ab3c-d52691b4dbfc
3080         https://bugs.webkit.org/show_bug.cgi?id=184081
3081
3082         Unreviewed, switch to use UNUSED_PARAM()
3083
3084         * UIProcess/WebPageProxy.cpp:
3085         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
3086
3087 2018-03-28  Tim Horton  <timothy_horton@apple.com>
3088
3089         Make use of HAVE(CORE_ANIMATION_RENDER_SERVER) in more places
3090         https://bugs.webkit.org/show_bug.cgi?id=184072
3091         <rdar://problem/38946530>
3092
3093         Reviewed by Dan Bernstein.
3094
3095         * Platform/mac/LayerHostingContext.mm:
3096         (WebKit::LayerHostingContext::createForExternalHostingProcess):
3097         * UIProcess/mac/ViewSnapshotStore.h:
3098         * UIProcess/mac/ViewSnapshotStore.mm:
3099         (WebKit::ViewSnapshot::clearImage):
3100
3101 2018-03-28  Wenson Hsieh  <wenson_hsieh@apple.com>
3102
3103         Revert an unnecessary workaround when zooming focused form controls
3104         https://bugs.webkit.org/show_bug.cgi?id=184067
3105         <rdar://problem/38805254>
3106
3107         Reviewed by Tim Horton.
3108
3109         Reverts an unintended change introduced in r227984.
3110
3111         * UIProcess/ios/WKContentViewInteraction.mm:
3112         (-[WKContentView _displayFormNodeInputView]):
3113
3114 2018-03-28  Miguel Gomez  <magomez@igalia.com>
3115
3116         [GTK][WPE] Remove UpdateAtlas
3117         https://bugs.webkit.org/show_bug.cgi?id=184042
3118
3119         Reviewed by Žan Doberšek.
3120
3121         Remove all the code related to UpdateAtlas handling.
3122
3123         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
3124         (WebKit::CoordinatedGraphicsScene::updateTilesIfNeeded):
3125         (WebKit::CoordinatedGraphicsScene::commitSceneState):
3126         (WebKit::CoordinatedGraphicsScene::purgeGLResources):
3127         (WebKit::CoordinatedGraphicsScene::syncUpdateAtlases): Deleted.
3128         (WebKit::CoordinatedGraphicsScene::createUpdateAtlas): Deleted.
3129         (WebKit::CoordinatedGraphicsScene::removeUpdateAtlas): Deleted.
3130         (WebKit::CoordinatedGraphicsScene::releaseUpdateAtlases): Deleted.
3131         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
3132         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
3133         (WebKit::ThreadedCompositor::renderLayerTree):
3134         (WebKit::ThreadedCompositor::releaseUpdateAtlases): Deleted.
3135         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
3136         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3137         (WebKit::WebChromeClient::delegatedScrollRequested):
3138         (WebKit::WebChromeClient::resetUpdateAtlasForTesting): Deleted.
3139         * WebProcess/WebCoreSupport/WebChromeClient.h:
3140         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
3141         (WebKit::AcceleratedDrawingArea::resetUpdateAtlasForTesting): Deleted.
3142         * WebProcess/WebPage/AcceleratedDrawingArea.h:
3143         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
3144         (WebKit::CompositingCoordinator::CompositingCoordinator):
3145         (WebKit::CompositingCoordinator::flushPendingLayerChanges):
3146         (WebKit::CompositingCoordinator::clearPendingStateChanges):
3147         (WebKit::CompositingCoordinator::renderNextFrame):
3148         (WebKit::CompositingCoordinator::purgeBackingStores):
3149         (WebKit::CompositingCoordinator::createUpdateAtlas): Deleted.
3150         (WebKit::CompositingCoordinator::removeUpdateAtlas): Deleted.
3151         (WebKit::CompositingCoordinator::getCoordinatedBuffer): Deleted.
3152         (): Deleted.
3153         (WebKit::CompositingCoordinator::scheduleReleaseInactiveAtlases): Deleted.
3154         (WebKit::CompositingCoordinator::releaseInactiveAtlasesTimerFired): Deleted.
3155         (WebKit::CompositingCoordinator::releaseAtlases): Deleted.
3156         (WebKit::CompositingCoordinator::clearUpdateAtlases): Deleted.
3157         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
3158         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
3159         (WebKit::CoordinatedLayerTreeHost::clearUpdateAtlases): Deleted.
3160         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
3161         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
3162         (WebKit::ThreadedCoordinatedLayerTreeHost::releaseUpdateAtlases): Deleted.
3163         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
3164         * WebProcess/WebPage/DrawingArea.h:
3165         * WebProcess/WebPage/LayerTreeHost.h:
3166         (WebKit::LayerTreeHost::setIsDiscardable):
3167
3168 2018-03-28  Carlos Garcia Campos  <cgarcia@igalia.com>
3169
3170         REGRESSION(r229998): WebDriver: MiniBrowser is crashing in a lot of tests after r229998
3171         https://bugs.webkit.org/show_bug.cgi?id=184075
3172
3173         Reviewed by Žan Doberšek.
3174
3175         This is because we are using a value after it has been moved.
3176
3177         * UIProcess/Automation/WebAutomationSession.cpp:
3178         (WebKit::WebAutomationSession::setWindowFrameOfBrowsingContext): Save a reference to page in a local variable
3179         before using it when it's also going to be moved in the lambda capture.
3180
3181 2018-03-27  Michael Catanzaro  <mcatanzaro@igalia.com>
3182
3183         Unreviewed, fix typo in variable name
3184
3185         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3186         (webkitWebViewBaseCrossingNotifyEvent):
3187
3188 2018-03-27  Per Arne Vollan  <pvollan@apple.com>
3189
3190         The layout test fast/canvas/webgl/read-pixels-test.html is timing out.
3191         https://bugs.webkit.org/show_bug.cgi?id=183923
3192         <rdar://problem/38756869>
3193
3194         Reviewed by Brent Fulgham.
3195
3196         Send OpenGL display mask to the WebContent process when the display ID is changing.
3197
3198         * UIProcess/WebPageProxy.cpp:
3199         (WebKit::WebPageProxy::windowScreenDidChange):
3200         * WebProcess/WebPage/WebPage.h:
3201         * WebProcess/WebPage/WebPage.messages.in:
3202         * WebProcess/WebPage/mac/WebPageMac.mm:
3203         (WebKit::WebPage::openGLDisplayMaskChanged):
3204
3205 2018-03-27  Youenn Fablet  <youenn@apple.com>
3206
3207         Move request checking out of PingLoad for future reuse in NetworkLoad
3208         https://bugs.webkit.org/show_bug.cgi?id=183865
3209
3210         Reviewed by Chris Dumez.
3211
3212         Introduce NetworkLoadChecker as a way to validate requests before sending them in the network process.
3213         Validation encompasses: CORS checks, CSP and Content Extensions on both main request and redirected requests if any.
3214
3215         Make PingLoad use NetworkLoadChecker. Future patch should make NetworkLoad to use it as well whenever needed.
3216
3217         Make NetworkCORSPreflightChecker takes a CompletionHandler instead of a Function.
3218         Ensure this callback is called even if preflight is not completed by returning a Canceled error.
3219
3220         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
3221         (WebKit::NetworkCORSPreflightChecker::~NetworkCORSPreflightChecker):
3222         (WebKit::NetworkCORSPreflightChecker::returnResult):
3223         (WebKit::NetworkCORSPreflightChecker::willPerformHTTPRedirection):
3224         (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
3225         (WebKit::NetworkCORSPreflightChecker::didCompleteWithError):
3226         * NetworkProcess/NetworkCORSPreflightChecker.h:
3227         * NetworkProcess/NetworkLoadChecker.cpp: Added.
3228         (WebKit::NetworkLoadChecker::NetworkLoadChecker):
3229         (WebKit::NetworkLoadChecker::check):
3230         (WebKit::NetworkLoadChecker::checkRedirection):
3231         (WebKit::NetworkLoadChecker::returnError):
3232         (WebKit::NetworkLoadChecker::checkRequest):
3233         (WebKit::NetworkLoadChecker::checkCORSRequest):
3234         (WebKit::NetworkLoadChecker::checkCORSRedirectedRequest):
3235         (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
3236         (WebKit::NetworkLoadChecker::doesNotNeedCORSCheck const):
3237         (WebKit::NetworkLoadChecker::contentSecurityPolicy const):
3238         (WebKit::NetworkLoadChecker::contentExtensionsBackend):
3239         (WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad):
3240         * NetworkProcess/NetworkLoadChecker.h: Added.
3241         (WebKit::NetworkLoadChecker::setCSPResponseHeaders):
3242         (WebKit::NetworkLoadChecker::setContentExtensionRuleLists):
3243         (WebKit::NetworkLoadChecker::url const):
3244         (WebKit::NetworkLoadChecker::storedCredentialsPolicy const):
3245         (WebKit::NetworkLoadChecker::isChecking const):
3246         (WebKit::NetworkLoadChecker::isRedirected const):
3247         * NetworkProcess/PingLoad.cpp:
3248         (WebKit::PingLoad::PingLoad):
3249         (WebKit::PingLoad::~PingLoad):
3250         (WebKit::PingLoad::willPerformHTTPRedirection):
3251         (WebKit::PingLoad::didReceiveChallenge):
3252         (WebKit::PingLoad::wasBlocked):
3253         (WebKit::PingLoad::cannotShowURL):
3254         (WebKit::PingLoad::timeoutTimerFired):
3255         (WebKit::PingLoad::currentURL const):
3256         * NetworkProcess/PingLoad.h:
3257         * WebKit.xcodeproj/project.pbxproj:
3258
3259 2018-03-27  Jiewen Tan  <jiewen_tan@apple.com>
3260
3261         [WebAuthN] Implement authenticatorGetAssertion
3262         https://bugs.webkit.org/show_bug.cgi?id=183881
3263         <rdar://problem/37258628>
3264
3265         Reviewed by Brent Fulgham.
3266
3267         * Shared/WebPreferences.yaml:
3268         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.cpp:
3269         (WebKit::WebCredentialsMessengerProxy::makeCredential):
3270         (WebKit::WebCredentialsMessengerProxy::getAssertion):
3271         (WebKit::WebCredentialsMessengerProxy::getAssertionReply):
3272         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.h:
3273         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.messages.in:
3274         * WebProcess/CredentialManagement/WebCredentialsMessenger.cpp:
3275         (WebKit::WebCredentialsMessenger::getAssertion):
3276         (WebKit::WebCredentialsMessenger::getAssertionReply):
3277         * WebProcess/CredentialManagement/WebCredentialsMessenger.messages.in:
3278
3279 2018-03-27  Chris Dumez  <cdumez@apple.com>
3280
3281         Avoid constructing SecurityOrigin objects from non-main threads
3282         https://bugs.webkit.org/show_bug.cgi?id=184024
3283
3284         Reviewed by Youenn Fablet.
3285
3286         Avoid constructing SecurityOrigin objects from non-main threads as much as possible.
3287
3288         * WebProcess/Storage/WebSWClientConnection.cpp:
3289         (WebKit::WebSWClientConnection::mayHaveServiceWorkerRegisteredForOrigin const):
3290         (WebKit::WebSWClientConnection::matchRegistration):
3291         (WebKit::WebSWClientConnection::getRegistrations):
3292         * WebProcess/Storage/WebSWClientConnection.h:
3293         * WebProcess/Storage/WebSWOriginTable.cpp:
3294         (WebKit::WebSWOriginTable::contains const):
3295         * WebProcess/Storage/WebSWOriginTable.h:
3296
3297 2018-03-27  Chris Dumez  <cdumez@apple.com>
3298
3299         Move online state detection from the WebProcess to the NetworkProcess
3300         https://bugs.webkit.org/show_bug.cgi?id=183989
3301         <rdar://problem/37093299>
3302
3303         Reviewed by Youenn Fablet.
3304
3305         Move online state detection from the WebProcess to the NetworkProcess. This avoid executing the same (expensive) code in
3306         EACH web process whenever a network interface's state changes. Now, the Network Process monitors network interfaces
3307         and determines the online state whenever an interface's state changes. If the onLine state changes, it notifies all
3308         its connected WebProcesses via IPC.
3309
3310         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3311         (WebKit::NetworkConnectionToWebProcess::setOnLineState):
3312         * NetworkProcess/NetworkConnectionToWebProcess.h:
3313         * NetworkProcess/NetworkProcess.cpp:
3314         (WebKit::NetworkProcess::NetworkProcess):
3315         (WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
3316         * WebProcess/Network/NetworkProcessConnection.cpp:
3317         (WebKit::NetworkProcessConnection::setOnLineState):
3318         * WebProcess/Network/NetworkProcessConnection.h:
3319         * WebProcess/Network/NetworkProcessConnection.messages.in:
3320         * WebProcess/Network/WebLoaderStrategy.cpp:
3321         (WebKit::WebLoaderStrategy::isOnLine const):
3322         (WebKit::WebLoaderStrategy::addOnlineStateChangeListener):
3323         (WebKit::WebLoaderStrategy::setOnLineState):
3324         * WebProcess/Network/WebLoaderStrategy.h:
3325
3326 2018-03-27  Wenson Hsieh  <wenson_hsieh@apple.com>
3327
3328         [Extra zoom mode] Add support for new focused form control overlay behaviors
3329         https://bugs.webkit.org/show_bug.cgi?id=184043
3330         <rdar://problem/38758727>
3331
3332         Reviewed by Tim Horton.
3333
3334         See below for more details.
3335
3336         * UIProcess/ios/WKContentViewInteraction.mm:
3337         (-[WKContentView _willStartScrollingOrZooming]):
3338         (-[WKContentView _didEndScrollingOrZooming]):
3339
3340         Suppress focused form control navigation while the scroll view is undergoing a scroll or zoom animation (e.g.,
3341         when moving from one focused form control to another).
3342
3343         (-[WKContentView textInputController:didCommitText:withSuggestion:]):
3344
3345         When dismissing an input view controller, allow focused form control navigation only after updating assisted
3346         node information to ensure that focus rects aren't stale as the user begins to navigate between forms.
3347
3348         (-[WKContentView rectForFocusedFormControlController:inCoordinateSpace:]):
3349         (-[WKContentView nextRectForFocusedFormControlController:inCoordinateSpace:]):
3350         (-[WKContentView previousRectForFocusedFormControlController:inCoordinateSpace:]):
3351         (-[WKContentView scrollViewForFocusedFormControlController:]):
3352         (-[WKContentView highlightedRectForFocusedFormControlController:inCoordinateSpace:]): Deleted.
3353
3354         Implement some new focused form overlay delegate hooks to vend the scroll view, as well as the rects of next and
3355         previous focusable form controls.
3356
3357 2018-03-27  Brent Fulgham  <bfulgham@apple.com>
3358
3359         Further refine cookie read/write logging
3360         https://bugs.webkit.org/show_bug.cgi?id=184044
3361         <rdar://problem/38915610>
3362
3363         Reviewed by Chris Dumez.
3364
3365         Cookie logging was passing the partition, rather than the first party, when logging, which
3366         prevented logging in cases where partitioning or blocking was active. This patch corrects
3367         these calls so that logging is generated in these cases, too.
3368
3369         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3370         (WebKit::NetworkConnectionToWebProcess::cookiesForDOM): Call log routines if needed.
3371         (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM): Ditto.
3372         * NetworkProcess/NetworkResourceLoader.cpp:
3373         (WebKit::escapeIDForJSON): Make available to use in multiple functions.
3374         (WebKit::NetworkResourceLoader::logCookieInformation const): Revise to use shared
3375         convenience functions.
3376         (WebKit::logBlockedCookieInformation): Added.
3377         (WebKit::logCookieInformationInternal): Added.
3378         (WebKit::NetworkResourceLoader::logCookieInformation): Revise to use shared
3379         convenience functions.
3380         * NetworkProcess/NetworkResourceLoader.h:
3381
3382 2018-03-27  Brian Burg  <bburg@apple.com>
3383
3384         Web Automation: support enter/exit fullscreen and hide/restore window operations
3385         https://bugs.webkit.org/show_bug.cgi?id=182837
3386         <rdar://problem/37580732>
3387
3388         Reviewed by Tim Horton.
3389
3390         The W3C specification is more explicit about when to exit fullscreen and
3391         restore the window for a browsing context. So, WebKit needs to have support
3392         for performing these operations on behalf of a driver.
3393
3394         Based on prototyping, it is sufficient to use a JavaScript atom to enter
3395         fullscreen mode. This is included in the patch as EnterFullscreen.js and
3396         can be used to implement the §10.7.5 Fullscreen Window command.
3397
3398         Other window operations cannot be peformed from JavaScript, so we need to
3399         delegate these operations to the session client (i.e., Safari).
3400         This patch adds session client callouts for restoring, minimizing, and
3401         switching to a browsing context.
3402
3403         Exiting fullscreen happens implicitly (per specification) when setting a
3404         window frame without an actual frame, or when switching/restoring/minimizing a window.
3405         If needed, a driver can call Set Window Rect in this way to unfullscreen a context.
3406         Similarly, a driver can restore a minimized window using Set Window Rect.
3407
3408         * UIProcess/API/APIAutomationSessionClient.h:
3409         (API::AutomationSessionClient::requestHideWindowOfPage):
3410         (API::AutomationSessionClient::requestRestoreWindowOfPage):
3411         (API::AutomationSessionClient::requestSwitchToPage):
3412         Add new API client methods.
3413
3414         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
3415         Add new Cocoa API delegate methods.
3416
3417         * UIProcess/Automation/Automation.json:
3418         Make the switch to browsing context command asynchronous, since this functionality
3419         is not always synchronous, and we prefer to use completion handlers in the delegates.
3420
3421         Add new protocol method for hiding the window of a browsing context.
3422         This is expected to minimize/miniaturize a window for desktop window managers.
3423
3424         * UIProcess/Automation/WebAutomationSession.h:
3425         * UIProcess/Automation/WebAutomationSession.cpp:
3426         (WebKit::WebAutomationSession::switchToBrowsingContext):
3427         Make this function asynchronous. Call out to the session client.
3428
3429         (WebKit::WebAutomationSession::setWindowFrameOfBrowsingContext):
3430         Follow the steps in the specification to restore window and exit fullscreen.
3431
3432         (WebKit::WebAutomationSession::hideWindowOfBrowsingContext):
3433         Exit fullscreen and call out to the session client.
3434
3435         (WebKit::WebAutomationSession::exitFullscreenWindowForPage):
3436         This is a little strange. Because there is no async API for exiting fullscreen
3437         from C++ code, we hook into willEnterFullScreen and didExitFullScreen and send
3438         out the response if the page exited fullscreen after we requested it to do so.
3439         Because the W3C specification mandates that drivers only process one command at
3440         a time, there will only ever be one callback installed by this method at a time.
3441
3442         (WebKit::WebAutomationSession::restoreWindowForPage):
3443         (WebKit::WebAutomationSession::hideWindowForPage):
3444         Call out to the session client.
3445
3446         (WebKit::WebAutomationSession::didEnterFullScreenForPage):
3447         (WebKit::WebAutomationSession::didExitFullScreenForPage):
3448         Add methods to be called by instrumentation hooks in WebFullScreenManagerProxy.
3449
3450         * UIProcess/Automation/atoms/EnterFullscreen.js: Added.
3451         (enterFullscreen):
3452
3453         * UIProcess/Cocoa/AutomationSessionClient.h:
3454         * UIProcess/Cocoa/AutomationSessionClient.mm:
3455         (WebKit::AutomationSessionClient::AutomationSessionClient):
3456         (WebKit::AutomationSessionClient::requestSwitchToPage):
3457         (WebKit::AutomationSessionClient::requestHideWindowOfPage):
3458         (WebKit::AutomationSessionClient::requestRestoreWindowOfPage):
3459         (WebKit::AutomationSessionClient::isShowingJavaScriptDialogOnPage):
3460         Add boilerplate to convert C++ API client to Objective-C delegate methods.
3461
3462         * UIProcess/WebFullScreenManagerProxy.cpp:
3463         (WebKit::WebFullScreenManagerProxy::didEnterFullScreen):
3464         (WebKit::WebFullScreenManagerProxy::didExitFullScreen):
3465         Notify the automation session if the page is under automation and
3466         enters or exits fullscreen.
3467
3468         * WebKit.xcodeproj/project.pbxproj:
3469         Add EnterFullscreen.js to the list of WebDriver atoms. These are copied
3470         as WebKit2 private headers and used by driver implementations.
3471
3472 2018-03-27  Eric Carlson  <eric.carlson@apple.com>
3473
3474         Make AVFoundationEnabled preference available on iOS
3475         https://bugs.webkit.org/show_bug.cgi?id=183876
3476         <rdar://problem/38726459>
3477
3478         Reviewed by Youenn Fablet.
3479
3480         * Shared/WebPreferences.yaml: Set AVFoundationEnabled with DEFAULT_AVFOUNDATION_ENABLED.
3481         * Shared/WebPreferencesDefaultValues.h:
3482
3483         * UIProcess/API/Cocoa/WKPreferences.mm:
3484         (-[WKPreferences _setAVFoundationEnabled:]): Enable for iOS.
3485         (-[WKPreferences _avFoundationEnabled]): Ditto.
3486         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
3487
3488 2018-03-26  Tim Horton  <timothy_horton@apple.com>
3489
3490         Adopt WK_ALTERNATE_FRAMEWORKS_DIR in WebKit
3491         https://bugs.webkit.org/show_bug.cgi?id=184030
3492         <rdar://problem/38895281>
3493
3494         Reviewed by Dan Bernstein.
3495
3496         * Configurations/Base.xcconfig:
3497         * Configurations/BaseTarget.xcconfig:
3498         * Configurations/WebKit.xcconfig:
3499
3500 2018-03-26  Tim Horton  <timothy_horton@apple.com>
3501
3502         Add and adopt HAVE(CORE_ANIMATION_RENDER_SERVER)
3503         https://bugs.webkit.org/show_bug.cgi?id=184026
3504         <rdar://problem/38883321>
3505
3506         Reviewed by Sam Weinig.
3507
3508         * UIProcess/API/Cocoa/WKWebView.mm:
3509         (-[WKWebView _takeViewSnapshot]):
3510         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
3511
3512 2018-03-26  Wenson Hsieh  <wenson_hsieh@apple.com>
3513
3514         [Extra zoom mode] Refactor input view controller presentation and dismissal helpers
3515         https://bugs.webkit.org/show_bug.cgi?id=184020
3516         Work towards <rdar://problem/38758727>
3517
3518         Reviewed by Tim Horton.
3519
3520         We currently have separate presentation and dismissal helpers for each type of view controller corresponding to
3521         a focused element type. This is excessive, considering that all of these helpers are only invoked from one place
3522         (either -presentViewControllerForCurrentAssistedNode or -dismissAllInputViewControllers), with the exception of
3523         the focused form control overlay.
3524
3525         This refactoring allows us to then adjust the timing of first responder restoration logic, such that the focused
3526         form control view controller can receive forwarded events from the web view. See below for more detail.
3527
3528         * UIProcess/ios/WKContentViewInteraction.mm:
3529         (-[WKContentView presentFocusedFormControlViewController:]):
3530         (-[WKContentView dismissFocusedFormControlViewController:]):
3531
3532         Remove logic to restore the web view as first responder.
3533
3534         (-[WKContentView presentViewControllerForCurrentAssistedNode]):
3535         (-[WKContentView dismissAllInputViewControllers]):
3536
3537         Restore first responder after dismissing a view controller that was presented when focusing a form control, only
3538         if the web view was first responder before presentation.
3539
3540         (-[WKContentView presentDatePickerViewController:]): Deleted.
3541         (-[WKContentView dismissDatePickerViewController:]): Deleted.
3542         (-[WKContentView presentTimePickerViewController:]): Deleted.
3543         (-[WKContentView dismissTimePickerViewController:]): Deleted.
3544         (-[WKContentView presentSelectMenuViewController:]): Deleted.
3545         (-[WKContentView dismissSelectMenuViewController:]): Deleted.
3546         (-[WKContentView dismissNumberPadViewController:]): Deleted.
3547         (-[WKContentView presentNumberPadViewController:]): Deleted.
3548         (-[WKContentView presentTextInputViewController:]): Deleted.
3549         (-[WKContentView dismissTextInputViewController:]): Deleted.
3550
3551 2018-03-06  Brian Burg  <bburg@apple.com>
3552
3553         Web Automation: provide a way to ask clients for a new tab or window
3554         https://bugs.webkit.org/show_bug.cgi?id=183381
3555         <rdar://problem/38167301>
3556
3557         Reviewed by Timothy Hatcher.
3558
3559         Add support for specifying browsing context options when requesting
3560         a new browsing context from the automation session client/delegate.
3561         This is currently just used for specifying tab vs window, but could
3562         also be used for things like toggling certain browser chrome or features.
3563
3564         There is no guarantee that the client has a notion of tabs vs windows,
3565         so this option is purely advisory and should not cause the command to
3566         fail if it cannot be honored.
3567
3568         This behavior caused by specifying this option is client-specific, so no
3569         new tests are included in WebKit for this change.
3570
3571         * UIProcess/API/APIAutomationSessionClient.h:
3572         (API::AutomationSessionClient::didRequestNewPageWithOptions):
3573         (API::AutomationSessionClient::didRequestNewWindow): Deleted.
3574         Add options parameter.
3575
3576         * UIProcess/API/glib/WebKitAutomationSession.cpp:
3577         Adjust to new signature. More work is needed to plumb this information
3578         to the public API for GTK/WPE and support it in WebKitGTK driver.
3579
3580         * UIProcess/Automation/Automation.json: Add new optional parameter.
3581
3582         * UIProcess/Automation/WebAutomationSession.h:
3583         * UIProcess/Automation/WebAutomationSession.cpp:
3584         (WebKit::WebAutomationSession::createBrowsingContext):
3585         Convert the protocol option to an API option.
3586
3587         * UIProcess/Cocoa/AutomationSessionClient.h:
3588         * UIProcess/Cocoa/AutomationSessionClient.mm:
3589         (WebKit::AutomationSessionClient::AutomationSessionClient):
3590         (WebKit::toAPI):
3591         (WebKit::AutomationSessionClient::didRequestNewPageWithOptions):
3592         (WebKit::AutomationSessionClient::didRequestNewWindow): Deleted.
3593         Convert the internal option to a Cocoa SPI option and pass it along.
3594
3595         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
3596         Adjust delegate methods to include options. Clients need to adopt the new signature(s).
3597
3598 2018-03-26  Wenson Hsieh  <wenson_hsieh@apple.com>
3599
3600         [Extra zoom mode] Add plumbing for next and previous focusable element rects
3601         https://bugs.webkit.org/show_bug.cgi?id=184016
3602         Work towards <rdar://problem/38758727>
3603
3604         Reviewed by Tim Horton.
3605
3606         When building up AssistedNodeInformation, we currently compute the element rect of the current focused element,
3607         as well as flags indicating whether or not there are next or previous focusable elements. For
3608         <rdar://problem/38758727>, we additionally send the rects of the next or previous focusable elements as well.
3609
3610         * Shared/AssistedNodeInformation.cpp:
3611         (WebKit::AssistedNodeInformation::encode const):
3612         (WebKit::AssistedNodeInformation::decode):
3613
3614         IPC support for nextNodeRect and previousNodeRect.
3615
3616         * Shared/AssistedNodeInformation.h:
3617         * WebProcess/WebPage/ios/WebPageIOS.mm:
3618         (WebKit::elementRectInRootViewCoordinates):
3619
3620         Add a helper to compute an element's rect in root view coordinates. We use this to compute the rects of the
3621         current focused element as well as those of the next and previous elements, if any.
3622
3623         (WebKit::WebPage::getAssistedNodeInformation):
3624         (WebKit::hasAssistableElement): Deleted.
3625
3626         Since we need the next or previous focusable element to get its rect, we don't need this helper anymore.
3627
3628 2018-03-26  Chris Dumez  <cdumez@apple.com>
3629
3630         Use SecurityOriginData more consistently in Service Worker code
3631         https://bugs.webkit.org/show_bug.cgi?id=183969
3632
3633         Reviewed by Darin Adler.
3634
3635         Use SecurityOriginData more consistently in Service Worker code to avoid constructing
3636         SecurityOrigin objects unnecessarily.
3637
3638         * NetworkProcess/NetworkResourceLoadParameters.cpp:
3639         (WebKit::NetworkResourceLoadParameters::encode const):
3640         * Shared/API/c/WKSecurityOriginRef.cpp:
3641         (WKSecurityOriginCopyDatabaseIdentifier):
3642         * StorageProcess/ServiceWorker/WebSWOriginStore.cpp:
3643         (WebKit::WebSWOriginStore::addToStore):
3644         (WebKit::WebSWOriginStore::removeFromStore):
3645         * StorageProcess/ServiceWorker/WebSWOriginStore.h:
3646         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3647         (WebKit::WebSWServerConnection::scheduleJobInServer):
3648         (WebKit::WebSWServerConnection::registerServiceWorkerClient):
3649         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
3650         (WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
3651         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
3652         * StorageProcess/StorageProcess.cpp:
3653         (WebKit::StorageProcess::connectionToContextProcessWasClosed):
3654         (WebKit::StorageProcess::needsServerToContextConnectionForOrigin const):
3655         (WebKit::StorageProcess::createStorageToWebProcessConnection):
3656         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
3657         (WebKit::StorageProcess::serverToContextConnectionForOrigin):
3658         (WebKit::StorageProcess::createServerToContextConnection):
3659         (WebKit::StorageProcess::swContextConnectionMayNoLongerBeNeeded):
3660         * StorageProcess/StorageProcess.h:
3661         * UIProcess/API/APIFrameInfo.cpp:
3662         (API::FrameInfo::create):
3663         * UIProcess/API/C/WKApplicationCacheManager.cpp:
3664         (WKApplicationCacheManagerDeleteEntriesForOrigin):
3665         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
3666         (WKKeyValueStorageManagerDeleteEntriesForOrigin):
3667         * UIProcess/API/C/WKResourceCacheManager.cpp:
3668         (WKResourceCacheManagerClearCacheForOrigin):
3669         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
3670         (WKWebsiteDataStoreRemoveFetchCacheForOrigin):
3671         (WKWebsiteDataStoreGetFetchCacheSizeForOrigin):
3672         * UIProcess/ServiceWorkerProcessProxy.cpp:
3673         (WebKit::ServiceWorkerProcessProxy::create):
3674         (WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
3675         (WebKit::ServiceWorkerProcessProxy::getLaunchOptions):
3676         * UIProcess/ServiceWorkerProcessProxy.h:
3677         * UIProcess/Storage/StorageProcessProxy.cpp:
3678         (WebKit::StorageProcessProxy::getStorageProcessConnection):
3679         * UIProcess/WebProcessPool.cpp:
3680         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
3681         (WebKit::WebProcessPool::disconnectProcess):
3682         (WebKit::WebProcessPool::updateProcessAssertions):
3683         * UIProcess/WebProcessPool.h:
3684         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3685         (WebKit::WebsiteDataStore::fetchDataAndApply):
3686         * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
3687         (WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation):
3688         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
3689         (WKBundlePageCopyOriginsWithApplicationCache):
3690         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
3691         (WebKit::UserMediaPermissionRequestManager::sendUserMediaRequest):
3692         (WebKit::UserMediaPermissionRequestManager::enumerateMediaDevices):
3693         * WebProcess/Storage/WebSWClientConnection.cpp:
3694         (WebKit::WebSWClientConnection::registerServiceWorkerClient):
3695         (WebKit::WebSWClientConnection::matchRegistration):
3696         (WebKit::WebSWClientConnection::whenRegistrationReady):
3697         (WebKit::WebSWClientConnection::getRegistrations):
3698         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3699         (WebKit::WebChromeClient::exceededDatabaseQuota):
3700         (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
3701         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3702         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
3703         * WebProcess/WebProcess.cpp:
3704         (WebKit::WebProcess::fetchWebsiteData):
3705         * WebProcess/WebStorage/StorageAreaImpl.cpp:
3706         (WebKit::StorageAreaImpl::securityOrigin const):
3707         * WebProcess/WebStorage/StorageAreaImpl.h:
3708         * WebProcess/WebStorage/StorageAreaMap.cpp:
3709         (WebKit::StorageAreaMap::StorageAreaMap):
3710         (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
3711         (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
3712         * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
3713         (WebKit::StorageNamespaceImpl::didDestroyStorageAreaMap):
3714
3715 2018-03-26  Brent Fulgham  <bfulgham@apple.com>
3716
3717         Warn against cookie access in the WebContent process using ProcessPrivilege assertions
3718         https://bugs.webkit.org/show_bug.cgi?id=183911
3719         <rdar://problem/38762306>
3720
3721         Reviewed by Youenn Fablet.
3722
3723         Add a set of ProcessPrivilege assertions to enforce the rule that the WebContent process
3724         should never call Cookie API directly. That should only happen in the Networking or
3725         UIProcess. 
3726
3727         * NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
3728         (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
3729         (WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy):
3730         * NetworkProcess/NetworkProcess.cpp:
3731         (WebKit::NetworkProcess::initializeNetworkProcess):
3732         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3733         (WebKit::NetworkDataTaskCocoa::applyCookieBlockingPolicy):
3734         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3735         (WebKit::NetworkProcess::setSharedHTTPCookieStorage):
3736         (WebKit::NetworkProcess::syncAllCookies):
3737         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3738         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
3739         * NetworkProcess/mac/RemoteNetworkingContext.mm:
3740         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
3741         * PluginProcess/PluginProcess.cpp:
3742         (WebKit::PluginProcess::initializeProcess):
3743         * Shared/cf/CookieStorageUtilsCF.mm:
3744         (WebKit::cookieStorageFromIdentifyingData):
3745         (WebKit::identifyingDataFromCookieStorage):
3746         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3747         (WebKit::WebProcessPool::platformInitializeWebProcess):
3748         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
3749         (WebKit::privateBrowsingSession):
3750         * UIProcess/WebProcessPool.cpp:
3751         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
3752         (WebKit::WebsiteDataStore::parameters):
3753         * UIProcess/mac/WebCookieManagerProxyMac.mm:
3754         (WebKit::WebCookieManagerProxy::persistHTTPCookieAcceptPolicy):
3755         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3756         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
3757         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3758         (WebKit::WebFrameLoaderClient::createNetworkingContext):
3759         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
3760         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
3761         (WebKit::WebFrameNetworkingContext::storageSession const):
3762         * WebProcess/WebProcess.cpp:
3763         (WebKit::WebProcess::initializeProcess):
3764
3765 2018-03-26  Alex Christensen  <achristensen@webkit.org>
3766
3767         Merge ResourceHandleClient::willCacheResponseAsync with ResourceHandleClient::willCacheResponse
3768         https://bugs.webkit.org/show_bug.cgi?id=183965
3769
3770         Reviewed by Chris Dumez.
3771
3772         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3773         (WebKit::WebFrameLoaderClient::willCacheResponse const):
3774         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
3775
3776 2018-03-25  Carlos Garcia Campos  <cgarcia@igalia.com>
3777
3778         [GTK][WPE] Add API to convert between DOM and JSCValue
3779         https://bugs.webkit.org/show_bug.cgi?id=183448
3780
3781         Reviewed by Michael Catanzaro.
3782
3783         Add methods to get a JSCValue for a WebKitDOMObject and to create a WebKitDOMNode from a JSCValue. Deprecate
3784         most of the GTK+ DOM bindings API and move the non-deprecated parts to glib dir to be exposed by WPE too.
3785
3786         * PlatformGTK.cmake:
3787         * PlatformWPE.cmake:
3788         * SourcesGTK.txt:
3789         * SourcesWPE.txt:
3790         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
3791         * WebProcess/InjectedBundle/API/glib/DOM/DOMObjectCache.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/DOMObjectCache.cpp.
3792         * WebProcess/InjectedBundle/API/glib/DOM/DOMObjectCache.h: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/DOMObjectCache.h.
3793         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMDocument.cpp: Added.
3794         (WebKit::kit):
3795         (WebKit::core):
3796         (WebKit::wrapDocument):
3797         (webkit_dom_document_class_init):
3798         (webkit_dom_document_init):
3799         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMDocumentPrivate.h: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentPrivate.h.
3800         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMElement.cpp: Added.
3801         (WebKit::kit):
3802         (WebKit::core):
3803         (WebKit::wrapElement):
3804         (webkit_dom_element_class_init):
3805         (webkit_dom_element_init):
3806         (webkit_dom_element_html_input_element_is_user_edited):
3807         (webkit_dom_element_html_input_element_get_auto_filled):
3808         (webkit_dom_element_html_input_element_set_auto_filled):
3809         (webkit_dom_element_html_input_element_set_editing_value):
3810         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMElementPrivate.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementPrivate.h.
3811         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMNode.cpp: Added.
3812         (_WebKitDOMNodePrivate::~_WebKitDOMNodePrivate):
3813         (WebKit::kit):
3814         (WebKit::core):
3815         (WebKit::wrapNode):
3816         (webkitDOMNodeConstructor):
3817         (webkitDOMNodeFinalize):
3818         (webkit_dom_node_init):
3819         (webkit_dom_node_class_init):
3820         (webkitDOMNodeSetCoreObject):
3821         (webkitDOMNodeGetCoreObject):
3822         (webkit_dom_node_for_js_value):
3823         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMNodePrivate.h: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodePrivate.h.
3824         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMObject.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMObject.cpp.
3825         (webkitDOMObjectSetProperty):
3826         (webkit_dom_object_class_init):
3827         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMPrivate.cpp: Added.
3828         (WebKit::wrap):
3829         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMPrivate.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/DOMObjectCache.h.
3830         * WebProcess/InjectedBundle/API/glib/WebKitFrame.cpp:
3831         (webkit_frame_get_js_value_for_dom_object):
3832         (webkit_frame_get_js_value_for_dom_object_in_script_world):
3833         * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
3834         (webkit_web_page_class_init):
3835         (webkitWebPageCreate):
3836         (webkit_web_page_get_dom_document):
3837         * WebProcess/InjectedBundle/API/gtk/DOM/GObjectEventListener.cpp:
3838         (WebKit::GObjectEventListener::handleEvent):
3839         * WebProcess/InjectedBundle/API/gtk/DOM/GObjectNodeFilterCondition.cpp:
3840         * WebProcess/InjectedBundle/API/gtk/DOM/GObjectXPathNSResolver.cpp:
3841         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.cpp:
3842         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.h:
3843         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlob.cpp:
3844         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlob.h:
3845         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.cpp:
3846         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.h:
3847         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.cpp:
3848         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.h:
3849         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.cpp:
3850         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.h:
3851         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.cpp:
3852         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.h:
3853         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.cpp:
3854         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.h:
3855         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.cpp:
3856         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.h:
3857         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp:
3858         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.h:
3859         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.cpp:
3860         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.h:
3861         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp:
3862         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.h:
3863         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.cpp:
3864         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.h:
3865         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.cpp:
3866         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.h:
3867         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.cpp:
3868         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.h:
3869         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.cpp:
3870         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.h:
3871         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
3872         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.h:
3873         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp:
3874         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.h:
3875         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp:
3876         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.h:
3877         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp.
3878         (webkitDOMDocumentDOMEventTargetInit):
3879         (webkitDOMDocumentInstallProperties):
3880         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.cpp:
3881         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.h:
3882         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.h:
3883         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementGtk.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp.
3884         (webkitDOMElementDOMEventTargetInit):
3885         (webkitDOMElementInstallProperties):
3886         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.cpp:
3887         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.h:
3888         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEventTarget.cpp:
3889         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEventTarget.h:
3890         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.cpp:
3891         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.h:
3892         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.cpp:
3893         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.h:
3894         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.cpp:
3895         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.h:
3896         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.cpp:
3897         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.h:
3898         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.cpp:
3899         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.h:
3900         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.cpp:
3901         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.h:
3902         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.cpp:
3903         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.h:
3904         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.cpp:
3905         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.h:
3906         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.cpp:
3907         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.h:
3908         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.cpp:
3909         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.h:
3910         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.cpp:
3911         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.h:
3912         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.cpp:
3913         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.h:
3914         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.cpp:
3915         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.h:
3916         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.cpp:
3917         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.h:
3918         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.cpp:
3919         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.h:
3920         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp:
3921         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.h:
3922         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.cpp:
3923         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.h:
3924         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.cpp:
3925         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.h:
3926         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.cpp:
3927         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.h:
3928         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.cpp:
3929         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.h:
3930         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.cpp:
3931         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.h:
3932         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.cpp:
3933         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.h:
3934         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.cpp:
3935         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.h:
3936         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.cpp:
3937         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.h:
3938         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.cpp:
3939         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.h:
3940         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.cpp:
3941         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.h:
3942         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.cpp:
3943         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.h:
3944         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.cpp:
3945         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.h:
3946         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
3947         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.h:
3948         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.cpp:
3949         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.h:
3950         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.cpp:
3951         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.h:
3952         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.cpp:
3953         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.h:
3954         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.cpp:
3955         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.h:
3956         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.cpp:
3957         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.h:
3958         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.cpp:
3959         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.h:
3960         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.cpp:
3961         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.h:
3962         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.cpp:
3963         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.h:
3964         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.cpp:
3965         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.h:
3966         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.cpp:
3967         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.h:
3968         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.cpp:
3969         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.h:
3970         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.cpp:
3971         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.h:
3972         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.cpp:
3973         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.h:
3974         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollection.cpp:
3975         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollection.h:
3976         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.cpp:
3977         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.h:
3978         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.cpp:
3979         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.h:
3980         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.cpp:
3981         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.h:
3982         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPrivate.cpp: