[Extra zoom mode] Add support for new focused form control overlay behaviors
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-03-27  Wenson Hsieh  <wenson_hsieh@apple.com>
2
3         [Extra zoom mode] Add support for new focused form control overlay behaviors
4         https://bugs.webkit.org/show_bug.cgi?id=184043
5         <rdar://problem/38758727>
6
7         Reviewed by Tim Horton.
8
9         See below for more details.
10
11         * UIProcess/ios/WKContentViewInteraction.mm:
12         (-[WKContentView _willStartScrollingOrZooming]):
13         (-[WKContentView _didEndScrollingOrZooming]):
14
15         Suppress focused form control navigation while the scroll view is undergoing a scroll or zoom animation (e.g.,
16         when moving from one focused form control to another).
17
18         (-[WKContentView textInputController:didCommitText:withSuggestion:]):
19
20         When dismissing an input view controller, allow focused form control navigation only after updating assisted
21         node information to ensure that focus rects aren't stale as the user begins to navigate between forms.
22
23         (-[WKContentView rectForFocusedFormControlController:inCoordinateSpace:]):
24         (-[WKContentView nextRectForFocusedFormControlController:inCoordinateSpace:]):
25         (-[WKContentView previousRectForFocusedFormControlController:inCoordinateSpace:]):
26         (-[WKContentView scrollViewForFocusedFormControlController:]):
27         (-[WKContentView highlightedRectForFocusedFormControlController:inCoordinateSpace:]): Deleted.
28
29         Implement some new focused form overlay delegate hooks to vend the scroll view, as well as the rects of next and
30         previous focusable form controls.
31
32 2018-03-27  Brent Fulgham  <bfulgham@apple.com>
33
34         Further refine cookie read/write logging
35         https://bugs.webkit.org/show_bug.cgi?id=184044
36         <rdar://problem/38915610>
37
38         Reviewed by Chris Dumez.
39
40         Cookie logging was passing the partition, rather than the first party, when logging, which
41         prevented logging in cases where partitioning or blocking was active. This patch corrects
42         these calls so that logging is generated in these cases, too.
43
44         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
45         (WebKit::NetworkConnectionToWebProcess::cookiesForDOM): Call log routines if needed.
46         (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM): Ditto.
47         * NetworkProcess/NetworkResourceLoader.cpp:
48         (WebKit::escapeIDForJSON): Make available to use in multiple functions.
49         (WebKit::NetworkResourceLoader::logCookieInformation const): Revise to use shared
50         convenience functions.
51         (WebKit::logBlockedCookieInformation): Added.
52         (WebKit::logCookieInformationInternal): Added.
53         (WebKit::NetworkResourceLoader::logCookieInformation): Revise to use shared
54         convenience functions.
55         * NetworkProcess/NetworkResourceLoader.h:
56
57 2018-03-27  Brian Burg  <bburg@apple.com>
58
59         Web Automation: support enter/exit fullscreen and hide/restore window operations
60         https://bugs.webkit.org/show_bug.cgi?id=182837
61         <rdar://problem/37580732>
62
63         Reviewed by Tim Horton.
64
65         The W3C specification is more explicit about when to exit fullscreen and
66         restore the window for a browsing context. So, WebKit needs to have support
67         for performing these operations on behalf of a driver.
68
69         Based on prototyping, it is sufficient to use a JavaScript atom to enter
70         fullscreen mode. This is included in the patch as EnterFullscreen.js and
71         can be used to implement the §10.7.5 Fullscreen Window command.
72
73         Other window operations cannot be peformed from JavaScript, so we need to
74         delegate these operations to the session client (i.e., Safari).
75         This patch adds session client callouts for restoring, minimizing, and
76         switching to a browsing context.
77
78         Exiting fullscreen happens implicitly (per specification) when setting a
79         window frame without an actual frame, or when switching/restoring/minimizing a window.
80         If needed, a driver can call Set Window Rect in this way to unfullscreen a context.
81         Similarly, a driver can restore a minimized window using Set Window Rect.
82
83         * UIProcess/API/APIAutomationSessionClient.h:
84         (API::AutomationSessionClient::requestHideWindowOfPage):
85         (API::AutomationSessionClient::requestRestoreWindowOfPage):
86         (API::AutomationSessionClient::requestSwitchToPage):
87         Add new API client methods.
88
89         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
90         Add new Cocoa API delegate methods.
91
92         * UIProcess/Automation/Automation.json:
93         Make the switch to browsing context command asynchronous, since this functionality
94         is not always synchronous, and we prefer to use completion handlers in the delegates.
95
96         Add new protocol method for hiding the window of a browsing context.
97         This is expected to minimize/miniaturize a window for desktop window managers.
98
99         * UIProcess/Automation/WebAutomationSession.h:
100         * UIProcess/Automation/WebAutomationSession.cpp:
101         (WebKit::WebAutomationSession::switchToBrowsingContext):
102         Make this function asynchronous. Call out to the session client.
103
104         (WebKit::WebAutomationSession::setWindowFrameOfBrowsingContext):
105         Follow the steps in the specification to restore window and exit fullscreen.
106
107         (WebKit::WebAutomationSession::hideWindowOfBrowsingContext):
108         Exit fullscreen and call out to the session client.
109
110         (WebKit::WebAutomationSession::exitFullscreenWindowForPage):
111         This is a little strange. Because there is no async API for exiting fullscreen
112         from C++ code, we hook into willEnterFullScreen and didExitFullScreen and send
113         out the response if the page exited fullscreen after we requested it to do so.
114         Because the W3C specification mandates that drivers only process one command at
115         a time, there will only ever be one callback installed by this method at a time.
116
117         (WebKit::WebAutomationSession::restoreWindowForPage):
118         (WebKit::WebAutomationSession::hideWindowForPage):
119         Call out to the session client.
120
121         (WebKit::WebAutomationSession::didEnterFullScreenForPage):
122         (WebKit::WebAutomationSession::didExitFullScreenForPage):
123         Add methods to be called by instrumentation hooks in WebFullScreenManagerProxy.
124
125         * UIProcess/Automation/atoms/EnterFullscreen.js: Added.
126         (enterFullscreen):
127
128         * UIProcess/Cocoa/AutomationSessionClient.h:
129         * UIProcess/Cocoa/AutomationSessionClient.mm:
130         (WebKit::AutomationSessionClient::AutomationSessionClient):
131         (WebKit::AutomationSessionClient::requestSwitchToPage):
132         (WebKit::AutomationSessionClient::requestHideWindowOfPage):
133         (WebKit::AutomationSessionClient::requestRestoreWindowOfPage):
134         (WebKit::AutomationSessionClient::isShowingJavaScriptDialogOnPage):
135         Add boilerplate to convert C++ API client to Objective-C delegate methods.
136
137         * UIProcess/WebFullScreenManagerProxy.cpp:
138         (WebKit::WebFullScreenManagerProxy::didEnterFullScreen):
139         (WebKit::WebFullScreenManagerProxy::didExitFullScreen):
140         Notify the automation session if the page is under automation and
141         enters or exits fullscreen.
142
143         * WebKit.xcodeproj/project.pbxproj:
144         Add EnterFullscreen.js to the list of WebDriver atoms. These are copied
145         as WebKit2 private headers and used by driver implementations.
146
147 2018-03-27  Eric Carlson  <eric.carlson@apple.com>
148
149         Make AVFoundationEnabled preference available on iOS
150         https://bugs.webkit.org/show_bug.cgi?id=183876
151         <rdar://problem/38726459>
152
153         Reviewed by Youenn Fablet.
154
155         * Shared/WebPreferences.yaml: Set AVFoundationEnabled with DEFAULT_AVFOUNDATION_ENABLED.
156         * Shared/WebPreferencesDefaultValues.h:
157
158         * UIProcess/API/Cocoa/WKPreferences.mm:
159         (-[WKPreferences _setAVFoundationEnabled:]): Enable for iOS.
160         (-[WKPreferences _avFoundationEnabled]): Ditto.
161         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
162
163 2018-03-26  Tim Horton  <timothy_horton@apple.com>
164
165         Adopt WK_ALTERNATE_FRAMEWORKS_DIR in WebKit
166         https://bugs.webkit.org/show_bug.cgi?id=184030
167         <rdar://problem/38895281>
168
169         Reviewed by Dan Bernstein.
170
171         * Configurations/Base.xcconfig:
172         * Configurations/BaseTarget.xcconfig:
173         * Configurations/WebKit.xcconfig:
174
175 2018-03-26  Tim Horton  <timothy_horton@apple.com>
176
177         Add and adopt HAVE(CORE_ANIMATION_RENDER_SERVER)
178         https://bugs.webkit.org/show_bug.cgi?id=184026
179         <rdar://problem/38883321>
180
181         Reviewed by Sam Weinig.
182
183         * UIProcess/API/Cocoa/WKWebView.mm:
184         (-[WKWebView _takeViewSnapshot]):
185         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
186
187 2018-03-26  Wenson Hsieh  <wenson_hsieh@apple.com>
188
189         [Extra zoom mode] Refactor input view controller presentation and dismissal helpers
190         https://bugs.webkit.org/show_bug.cgi?id=184020
191         Work towards <rdar://problem/38758727>
192
193         Reviewed by Tim Horton.
194
195         We currently have separate presentation and dismissal helpers for each type of view controller corresponding to
196         a focused element type. This is excessive, considering that all of these helpers are only invoked from one place
197         (either -presentViewControllerForCurrentAssistedNode or -dismissAllInputViewControllers), with the exception of
198         the focused form control overlay.
199
200         This refactoring allows us to then adjust the timing of first responder restoration logic, such that the focused
201         form control view controller can receive forwarded events from the web view. See below for more detail.
202
203         * UIProcess/ios/WKContentViewInteraction.mm:
204         (-[WKContentView presentFocusedFormControlViewController:]):
205         (-[WKContentView dismissFocusedFormControlViewController:]):
206
207         Remove logic to restore the web view as first responder.
208
209         (-[WKContentView presentViewControllerForCurrentAssistedNode]):
210         (-[WKContentView dismissAllInputViewControllers]):
211
212         Restore first responder after dismissing a view controller that was presented when focusing a form control, only
213         if the web view was first responder before presentation.
214
215         (-[WKContentView presentDatePickerViewController:]): Deleted.
216         (-[WKContentView dismissDatePickerViewController:]): Deleted.
217         (-[WKContentView presentTimePickerViewController:]): Deleted.
218         (-[WKContentView dismissTimePickerViewController:]): Deleted.
219         (-[WKContentView presentSelectMenuViewController:]): Deleted.
220         (-[WKContentView dismissSelectMenuViewController:]): Deleted.
221         (-[WKContentView dismissNumberPadViewController:]): Deleted.
222         (-[WKContentView presentNumberPadViewController:]): Deleted.
223         (-[WKContentView presentTextInputViewController:]): Deleted.
224         (-[WKContentView dismissTextInputViewController:]): Deleted.
225
226 2018-03-06  Brian Burg  <bburg@apple.com>
227
228         Web Automation: provide a way to ask clients for a new tab or window
229         https://bugs.webkit.org/show_bug.cgi?id=183381
230         <rdar://problem/38167301>
231
232         Reviewed by Timothy Hatcher.
233
234         Add support for specifying browsing context options when requesting
235         a new browsing context from the automation session client/delegate.
236         This is currently just used for specifying tab vs window, but could
237         also be used for things like toggling certain browser chrome or features.
238
239         There is no guarantee that the client has a notion of tabs vs windows,
240         so this option is purely advisory and should not cause the command to
241         fail if it cannot be honored.
242
243         This behavior caused by specifying this option is client-specific, so no
244         new tests are included in WebKit for this change.
245
246         * UIProcess/API/APIAutomationSessionClient.h:
247         (API::AutomationSessionClient::didRequestNewPageWithOptions):
248         (API::AutomationSessionClient::didRequestNewWindow): Deleted.
249         Add options parameter.
250
251         * UIProcess/API/glib/WebKitAutomationSession.cpp:
252         Adjust to new signature. More work is needed to plumb this information
253         to the public API for GTK/WPE and support it in WebKitGTK driver.
254
255         * UIProcess/Automation/Automation.json: Add new optional parameter.
256
257         * UIProcess/Automation/WebAutomationSession.h:
258         * UIProcess/Automation/WebAutomationSession.cpp:
259         (WebKit::WebAutomationSession::createBrowsingContext):
260         Convert the protocol option to an API option.
261
262         * UIProcess/Cocoa/AutomationSessionClient.h:
263         * UIProcess/Cocoa/AutomationSessionClient.mm:
264         (WebKit::AutomationSessionClient::AutomationSessionClient):
265         (WebKit::toAPI):
266         (WebKit::AutomationSessionClient::didRequestNewPageWithOptions):
267         (WebKit::AutomationSessionClient::didRequestNewWindow): Deleted.
268         Convert the internal option to a Cocoa SPI option and pass it along.
269
270         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
271         Adjust delegate methods to include options. Clients need to adopt the new signature(s).
272
273 2018-03-26  Wenson Hsieh  <wenson_hsieh@apple.com>
274
275         [Extra zoom mode] Add plumbing for next and previous focusable element rects
276         https://bugs.webkit.org/show_bug.cgi?id=184016
277         Work towards <rdar://problem/38758727>
278
279         Reviewed by Tim Horton.
280
281         When building up AssistedNodeInformation, we currently compute the element rect of the current focused element,
282         as well as flags indicating whether or not there are next or previous focusable elements. For
283         <rdar://problem/38758727>, we additionally send the rects of the next or previous focusable elements as well.
284
285         * Shared/AssistedNodeInformation.cpp:
286         (WebKit::AssistedNodeInformation::encode const):
287         (WebKit::AssistedNodeInformation::decode):
288
289         IPC support for nextNodeRect and previousNodeRect.
290
291         * Shared/AssistedNodeInformation.h:
292         * WebProcess/WebPage/ios/WebPageIOS.mm:
293         (WebKit::elementRectInRootViewCoordinates):
294
295         Add a helper to compute an element's rect in root view coordinates. We use this to compute the rects of the
296         current focused element as well as those of the next and previous elements, if any.
297
298         (WebKit::WebPage::getAssistedNodeInformation):
299         (WebKit::hasAssistableElement): Deleted.
300
301         Since we need the next or previous focusable element to get its rect, we don't need this helper anymore.
302
303 2018-03-26  Chris Dumez  <cdumez@apple.com>
304
305         Use SecurityOriginData more consistently in Service Worker code
306         https://bugs.webkit.org/show_bug.cgi?id=183969
307
308         Reviewed by Darin Adler.
309
310         Use SecurityOriginData more consistently in Service Worker code to avoid constructing
311         SecurityOrigin objects unnecessarily.
312
313         * NetworkProcess/NetworkResourceLoadParameters.cpp:
314         (WebKit::NetworkResourceLoadParameters::encode const):
315         * Shared/API/c/WKSecurityOriginRef.cpp:
316         (WKSecurityOriginCopyDatabaseIdentifier):
317         * StorageProcess/ServiceWorker/WebSWOriginStore.cpp:
318         (WebKit::WebSWOriginStore::addToStore):
319         (WebKit::WebSWOriginStore::removeFromStore):
320         * StorageProcess/ServiceWorker/WebSWOriginStore.h:
321         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
322         (WebKit::WebSWServerConnection::scheduleJobInServer):
323         (WebKit::WebSWServerConnection::registerServiceWorkerClient):
324         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
325         (WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
326         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
327         * StorageProcess/StorageProcess.cpp:
328         (WebKit::StorageProcess::connectionToContextProcessWasClosed):
329         (WebKit::StorageProcess::needsServerToContextConnectionForOrigin const):
330         (WebKit::StorageProcess::createStorageToWebProcessConnection):
331         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
332         (WebKit::StorageProcess::serverToContextConnectionForOrigin):
333         (WebKit::StorageProcess::createServerToContextConnection):
334         (WebKit::StorageProcess::swContextConnectionMayNoLongerBeNeeded):
335         * StorageProcess/StorageProcess.h:
336         * UIProcess/API/APIFrameInfo.cpp:
337         (API::FrameInfo::create):
338         * UIProcess/API/C/WKApplicationCacheManager.cpp:
339         (WKApplicationCacheManagerDeleteEntriesForOrigin):
340         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
341         (WKKeyValueStorageManagerDeleteEntriesForOrigin):
342         * UIProcess/API/C/WKResourceCacheManager.cpp:
343         (WKResourceCacheManagerClearCacheForOrigin):
344         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
345         (WKWebsiteDataStoreRemoveFetchCacheForOrigin):
346         (WKWebsiteDataStoreGetFetchCacheSizeForOrigin):
347         * UIProcess/ServiceWorkerProcessProxy.cpp:
348         (WebKit::ServiceWorkerProcessProxy::create):
349         (WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
350         (WebKit::ServiceWorkerProcessProxy::getLaunchOptions):
351         * UIProcess/ServiceWorkerProcessProxy.h:
352         * UIProcess/Storage/StorageProcessProxy.cpp:
353         (WebKit::StorageProcessProxy::getStorageProcessConnection):
354         * UIProcess/WebProcessPool.cpp:
355         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
356         (WebKit::WebProcessPool::disconnectProcess):
357         (WebKit::WebProcessPool::updateProcessAssertions):
358         * UIProcess/WebProcessPool.h:
359         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
360         (WebKit::WebsiteDataStore::fetchDataAndApply):
361         * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
362         (WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation):
363         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
364         (WKBundlePageCopyOriginsWithApplicationCache):
365         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
366         (WebKit::UserMediaPermissionRequestManager::sendUserMediaRequest):
367         (WebKit::UserMediaPermissionRequestManager::enumerateMediaDevices):
368         * WebProcess/Storage/WebSWClientConnection.cpp:
369         (WebKit::WebSWClientConnection::registerServiceWorkerClient):
370         (WebKit::WebSWClientConnection::matchRegistration):
371         (WebKit::WebSWClientConnection::whenRegistrationReady):
372         (WebKit::WebSWClientConnection::getRegistrations):
373         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
374         (WebKit::WebChromeClient::exceededDatabaseQuota):
375         (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
376         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
377         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
378         * WebProcess/WebProcess.cpp:
379         (WebKit::WebProcess::fetchWebsiteData):
380         * WebProcess/WebStorage/StorageAreaImpl.cpp:
381         (WebKit::StorageAreaImpl::securityOrigin const):
382         * WebProcess/WebStorage/StorageAreaImpl.h:
383         * WebProcess/WebStorage/StorageAreaMap.cpp:
384         (WebKit::StorageAreaMap::StorageAreaMap):
385         (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
386         (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
387         * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
388         (WebKit::StorageNamespaceImpl::didDestroyStorageAreaMap):
389
390 2018-03-26  Brent Fulgham  <bfulgham@apple.com>
391
392         Warn against cookie access in the WebContent process using ProcessPrivilege assertions
393         https://bugs.webkit.org/show_bug.cgi?id=183911
394         <rdar://problem/38762306>
395
396         Reviewed by Youenn Fablet.
397
398         Add a set of ProcessPrivilege assertions to enforce the rule that the WebContent process
399         should never call Cookie API directly. That should only happen in the Networking or
400         UIProcess. 
401
402         * NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
403         (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
404         (WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy):
405         * NetworkProcess/NetworkProcess.cpp:
406         (WebKit::NetworkProcess::initializeNetworkProcess):
407         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
408         (WebKit::NetworkDataTaskCocoa::applyCookieBlockingPolicy):
409         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
410         (WebKit::NetworkProcess::setSharedHTTPCookieStorage):
411         (WebKit::NetworkProcess::syncAllCookies):
412         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
413         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
414         * NetworkProcess/mac/RemoteNetworkingContext.mm:
415         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
416         * PluginProcess/PluginProcess.cpp:
417         (WebKit::PluginProcess::initializeProcess):
418         * Shared/cf/CookieStorageUtilsCF.mm:
419         (WebKit::cookieStorageFromIdentifyingData):
420         (WebKit::identifyingDataFromCookieStorage):
421         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
422         (WebKit::WebProcessPool::platformInitializeWebProcess):
423         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
424         (WebKit::privateBrowsingSession):
425         * UIProcess/WebProcessPool.cpp:
426         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
427         (WebKit::WebsiteDataStore::parameters):
428         * UIProcess/mac/WebCookieManagerProxyMac.mm:
429         (WebKit::WebCookieManagerProxy::persistHTTPCookieAcceptPolicy):
430         * WebProcess/InjectedBundle/InjectedBundle.cpp:
431         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
432         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
433         (WebKit::WebFrameLoaderClient::createNetworkingContext):
434         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
435         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
436         (WebKit::WebFrameNetworkingContext::storageSession const):
437         * WebProcess/WebProcess.cpp:
438         (WebKit::WebProcess::initializeProcess):
439
440 2018-03-26  Alex Christensen  <achristensen@webkit.org>
441
442         Merge ResourceHandleClient::willCacheResponseAsync with ResourceHandleClient::willCacheResponse
443         https://bugs.webkit.org/show_bug.cgi?id=183965
444
445         Reviewed by Chris Dumez.
446
447         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
448         (WebKit::WebFrameLoaderClient::willCacheResponse const):
449         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
450
451 2018-03-25  Carlos Garcia Campos  <cgarcia@igalia.com>
452
453         [GTK][WPE] Add API to convert between DOM and JSCValue
454         https://bugs.webkit.org/show_bug.cgi?id=183448
455
456         Reviewed by Michael Catanzaro.
457
458         Add methods to get a JSCValue for a WebKitDOMObject and to create a WebKitDOMNode from a JSCValue. Deprecate
459         most of the GTK+ DOM bindings API and move the non-deprecated parts to glib dir to be exposed by WPE too.
460
461         * PlatformGTK.cmake:
462         * PlatformWPE.cmake:
463         * SourcesGTK.txt:
464         * SourcesWPE.txt:
465         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
466         * WebProcess/InjectedBundle/API/glib/DOM/DOMObjectCache.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/DOMObjectCache.cpp.
467         * WebProcess/InjectedBundle/API/glib/DOM/DOMObjectCache.h: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/DOMObjectCache.h.
468         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMDocument.cpp: Added.
469         (WebKit::kit):
470         (WebKit::core):
471         (WebKit::wrapDocument):
472         (webkit_dom_document_class_init):
473         (webkit_dom_document_init):
474         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMDocumentPrivate.h: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentPrivate.h.
475         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMElement.cpp: Added.
476         (WebKit::kit):
477         (WebKit::core):
478         (WebKit::wrapElement):
479         (webkit_dom_element_class_init):
480         (webkit_dom_element_init):
481         (webkit_dom_element_html_input_element_is_user_edited):
482         (webkit_dom_element_html_input_element_get_auto_filled):
483         (webkit_dom_element_html_input_element_set_auto_filled):
484         (webkit_dom_element_html_input_element_set_editing_value):
485         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMElementPrivate.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementPrivate.h.
486         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMNode.cpp: Added.
487         (_WebKitDOMNodePrivate::~_WebKitDOMNodePrivate):
488         (WebKit::kit):
489         (WebKit::core):
490         (WebKit::wrapNode):
491         (webkitDOMNodeConstructor):
492         (webkitDOMNodeFinalize):
493         (webkit_dom_node_init):
494         (webkit_dom_node_class_init):
495         (webkitDOMNodeSetCoreObject):
496         (webkitDOMNodeGetCoreObject):
497         (webkit_dom_node_for_js_value):
498         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMNodePrivate.h: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodePrivate.h.
499         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMObject.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMObject.cpp.
500         (webkitDOMObjectSetProperty):
501         (webkit_dom_object_class_init):
502         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMPrivate.cpp: Added.
503         (WebKit::wrap):
504         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMPrivate.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/DOMObjectCache.h.
505         * WebProcess/InjectedBundle/API/glib/WebKitFrame.cpp:
506         (webkit_frame_get_js_value_for_dom_object):
507         (webkit_frame_get_js_value_for_dom_object_in_script_world):
508         * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
509         (webkit_web_page_class_init):
510         (webkitWebPageCreate):
511         (webkit_web_page_get_dom_document):
512         * WebProcess/InjectedBundle/API/gtk/DOM/GObjectEventListener.cpp:
513         (WebKit::GObjectEventListener::handleEvent):
514         * WebProcess/InjectedBundle/API/gtk/DOM/GObjectNodeFilterCondition.cpp:
515         * WebProcess/InjectedBundle/API/gtk/DOM/GObjectXPathNSResolver.cpp:
516         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.cpp:
517         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.h:
518         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlob.cpp:
519         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlob.h:
520         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.cpp:
521         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.h:
522         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.cpp:
523         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.h:
524         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.cpp:
525         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.h:
526         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.cpp:
527         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.h:
528         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.cpp:
529         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.h:
530         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.cpp:
531         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.h:
532         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp:
533         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.h:
534         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.cpp:
535         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.h:
536         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp:
537         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.h:
538         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.cpp:
539         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.h:
540         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.cpp:
541         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.h:
542         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.cpp:
543         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.h:
544         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.cpp:
545         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.h:
546         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
547         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.h:
548         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp:
549         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.h:
550         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp:
551         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.h:
552         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp.
553         (webkitDOMDocumentDOMEventTargetInit):
554         (webkitDOMDocumentInstallProperties):
555         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.cpp:
556         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.h:
557         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.h:
558         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementGtk.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp.
559         (webkitDOMElementDOMEventTargetInit):
560         (webkitDOMElementInstallProperties):
561         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.cpp:
562         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.h:
563         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEventTarget.cpp:
564         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEventTarget.h:
565         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.cpp:
566         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.h:
567         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.cpp:
568         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.h:
569         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.cpp:
570         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.h:
571         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.cpp:
572         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.h:
573         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.cpp:
574         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.h:
575         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.cpp:
576         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.h:
577         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.cpp:
578         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.h:
579         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.cpp:
580         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.h:
581         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.cpp:
582         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.h:
583         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.cpp:
584         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.h:
585         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.cpp:
586         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.h:
587         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.cpp:
588         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.h:
589         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.cpp:
590         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.h:
591         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.cpp:
592         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.h:
593         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.cpp:
594         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.h:
595         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp:
596         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.h:
597         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.cpp:
598         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.h:
599         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.cpp:
600         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.h:
601         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.cpp:
602         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.h:
603         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.cpp:
604         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.h:
605         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.cpp:
606         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.h:
607         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.cpp:
608         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.h:
609         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.cpp:
610         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.h:
611         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.cpp:
612         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.h:
613         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.cpp:
614         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.h:
615         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.cpp:
616         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.h:
617         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.cpp:
618         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.h:
619         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.cpp:
620         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.h:
621         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
622         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.h:
623         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.cpp:
624         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.h:
625         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.cpp:
626         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.h:
627         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.cpp:
628         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.h:
629         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.cpp:
630         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.h:
631         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.cpp:
632         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.h:
633         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.cpp:
634         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.h:
635         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.cpp:
636         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.h:
637         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.cpp:
638         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.h:
639         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.cpp:
640         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.h:
641         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.cpp:
642         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.h:
643         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.cpp:
644         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.h:
645         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.cpp:
646         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.h:
647         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.cpp:
648         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.h:
649         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollection.cpp:
650         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollection.h:
651         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.cpp:
652         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.h:
653         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.cpp:
654         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.h:
655         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.cpp:
656         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.h:
657         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPrivate.cpp:
658         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.cpp:
659         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.h:
660         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.cpp:
661         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.h:
662         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
663         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.h:
664         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.cpp:
665         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.h:
666         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.cpp:
667         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.h:
668         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.cpp:
669         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.h:
670         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.cpp:
671         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.h:
672         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.cpp:
673         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.h:
674         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.cpp:
675         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.h:
676         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.cpp:
677         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.h:
678         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.cpp:
679         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.h:
680         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.cpp:
681         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.h:
682         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.cpp:
683         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.h:
684         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEvent.cpp:
685         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEvent.h:
686         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.cpp:
687         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.h:
688         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEvent.cpp:
689         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEvent.h:
690         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.cpp:
691         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.h:
692         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.h:
693         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeFilter.cpp:
694         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeFilter.h:
695         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeGtk.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.cpp.
696         (webkitDOMNodeDOMEventTargetInit):
697         (webkitDOMNodeInstallProperties):
698         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIterator.cpp:
699         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIterator.h:
700         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeList.cpp:
701         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeList.h:
702         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMObject.h:
703         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivateGtk.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivate.cpp.
704         (WebKit::wrapNodeGtk):
705         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivateGtk.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivate.h.
706         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.cpp:
707         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.h:
708         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.cpp:
709         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.h:
710         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheet.cpp:
711         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheet.h:
712         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetList.cpp:
713         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetList.h:
714         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp:
715         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.h:
716         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalker.cpp:
717         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalker.h:
718         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEvent.cpp:
719         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEvent.h:
720         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.cpp:
721         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.h:
722         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpression.cpp:
723         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpression.h:
724         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathNSResolver.cpp:
725         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathNSResolver.h:
726         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.cpp:
727         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.h:
728         * WebProcess/InjectedBundle/API/gtk/DOM/docs/webkitdomgtk-4.0-sections.txt:
729         * WebProcess/InjectedBundle/API/gtk/WebKitFrame.h:
730         * WebProcess/InjectedBundle/API/wpe/DOM/WebKitDOMDefines.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentPrivate.h.
731         * WebProcess/InjectedBundle/API/wpe/DOM/WebKitDOMDocument.h: Added.
732         * WebProcess/InjectedBundle/API/wpe/DOM/WebKitDOMElement.h: Added.
733         * WebProcess/InjectedBundle/API/wpe/DOM/WebKitDOMNode.h: Added.
734         * WebProcess/InjectedBundle/API/wpe/DOM/WebKitDOMObject.h: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMObject.h.
735         * WebProcess/InjectedBundle/API/wpe/DOM/webkitdom.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodePrivate.h.
736         * WebProcess/InjectedBundle/API/wpe/WebKitFrame.h:
737         * WebProcess/InjectedBundle/API/wpe/WebKitWebHitTestResult.h: Added.
738         * WebProcess/InjectedBundle/API/wpe/WebKitWebPage.h:
739         * WebProcess/InjectedBundle/API/wpe/WebKitWebProcessEnumTypes.cpp.template: Added.
740         * WebProcess/InjectedBundle/API/wpe/WebKitWebProcessEnumTypes.h.template: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMObjectPrivate.h.
741         * WebProcess/InjectedBundle/API/wpe/webkit-web-extension.h:
742
743 2018-03-26  Zan Dobersek  <zdobersek@igalia.com>
744
745         [CoordGraphics] Clean up CoordinatedGraphicsScene construct-time initializations
746         https://bugs.webkit.org/show_bug.cgi?id=184002
747
748         Reviewed by Carlos Garcia Campos.
749
750         Move the CoordinatedGraphicsScene constant-expression initializations
751         from constructor to the point of declaration.
752
753         Default the CoordinatedGraphicsScene destructor.
754
755         The m_scrollPosition member variable is unused in this class, while the
756         similarly-named m_renderedContentsScrollPosition tracks scroll position
757         of the scene. Remove the latter and use m_scrollPosition in its place.
758
759         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
760         (WebKit::CoordinatedGraphicsScene::CoordinatedGraphicsScene):
761         (WebKit::CoordinatedGraphicsScene::adjustPositionForFixedLayers):
762         (WebKit::CoordinatedGraphicsScene::commitSceneState):
763         (WebKit::CoordinatedGraphicsScene::~CoordinatedGraphicsScene): Deleted.
764         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
765
766 2018-03-25  Michael Catanzaro  <mcatanzaro@igalia.com>
767
768         [GTK] WebKitWebProcessEnumTypes.h missing from webkit-web-extension.h
769         https://bugs.webkit.org/show_bug.cgi?id=183998
770
771         Reviewed by Carlos Garcia Campos.
772
773         * WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h:
774
775 2018-03-25  Carlos Garcia Campos  <cgarcia@igalia.com>
776
777         [GTK] Unresolved type warnings when generating gir
778         https://bugs.webkit.org/show_bug.cgi?id=183926
779
780         Reviewed by Michael Catanzaro.
781
782         Skip deprecated functions using JSC C API from introspection.
783
784         * UIProcess/API/glib/WebKitJavascriptResult.cpp:
785         * UIProcess/API/glib/WebKitWebView.cpp:
786         * WebProcess/InjectedBundle/API/glib/WebKitFrame.cpp:
787
788 2018-03-25  Commit Queue  <commit-queue@webkit.org>
789
790         Unreviewed, rolling out r229954.
791         https://bugs.webkit.org/show_bug.cgi?id=184000
792
793         Caused many layout tests to crash on Apple High Sierra,
794         Sierra, iOS Simulator and GTK Linux Debug test bots (Requested
795         by dydz on #webkit).
796
797         Reverted changeset:
798
799         "Use SecurityOriginData more consistently in Service Worker
800         code"
801         https://bugs.webkit.org/show_bug.cgi?id=183969
802         https://trac.webkit.org/changeset/229954
803
804 2018-03-23  Brian Burg  <bburg@apple.com>
805
806         Web Automation: remove unnecessary member variable WebAutomationSession
807         https://bugs.webkit.org/show_bug.cgi?id=183971
808
809         Reviewed by Timothy Hatcher.
810
811         The concept of the "active" browsing context is something in the WebDriver
812         specification, but we were a bit too literal when first implementing this.
813         There's no actual need for this on the browser side since most commands
814         require implicitly switching to the target window passed in with the
815         Automation command. The driver, however, still needs to track the current
816         browsing context and current top-level browsing context.
817
818         For returning whether a browsing context is active,  we can just look at
819         the page's activity state to know whether the page is active or not. For
820         a normal browser, only one page is going to be visible and focused at a time.
821
822         * UIProcess/Automation/WebAutomationSession.h:
823         * UIProcess/Automation/WebAutomationSession.cpp:
824         (WebKit::WebAutomationSession::buildBrowsingContextForPage):
825         Consult the page's activity state to determine whether it's active.
826
827         (WebKit::WebAutomationSession::createBrowsingContext):
828         (WebKit::WebAutomationSession::closeBrowsingContext):
829         (WebKit::WebAutomationSession::switchToBrowsingContext):
830         (WebKit::WebAutomationSession::handleRunOpenPanel):
831         Stop reading and writing the current browsing context handle.
832
833         * UIProcess/WebPageProxy.h:
834         (WebKit::WebPageProxy::isViewFocused const):
835         (WebKit::WebPageProxy::isViewWindowActive const):
836         Add new accessor.
837
838 2018-03-25  Tim Horton  <timothy_horton@apple.com>
839
840         Add and adopt ENABLE(AIRPLAY_PICKER)
841         https://bugs.webkit.org/show_bug.cgi?id=183992
842
843         Reviewed by Daniel Bates.
844
845         * UIProcess/ios/WKContentViewInteraction.h:
846         * UIProcess/ios/WKContentViewInteraction.mm:
847         (-[WKContentView _showPlaybackTargetPicker:fromRect:]):
848         * UIProcess/ios/forms/WKAirPlayRoutePicker.h:
849         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
850
851 2018-03-25  Tim Horton  <timothy_horton@apple.com>
852
853         Move WKAnimationDelegate to its own header
854         https://bugs.webkit.org/show_bug.cgi?id=183976
855         <rdar://problem/38822299>
856
857         Reviewed by Dan Bernstein.
858
859         * Shared/RemoteLayerTree/WKAnimationDelegate.h: Added.
860         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
861         * WebKit.xcodeproj/project.pbxproj:
862         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
863         RemoteLayerTreeHost uses a forward declaration of WKAnimationDelegate,
864         so we're just getting lucky that an -invalidate method exists on
865         some other object. Instead, move WKAnimationDelegate to its own
866         header, and include it in the places we use it.
867
868 2018-03-24  Tim Horton  <timothy_horton@apple.com>
869
870         Adopt WK_PLATFORM_NAME in WebKit
871         https://bugs.webkit.org/show_bug.cgi?id=183978
872
873         Reviewed by Dan Bernstein.
874
875         * Configurations/WebKit.xcconfig:
876         * WebKit.xcodeproj/project.pbxproj:
877         * mac/MigrateHeadersFromWebKitLegacy.make:
878         * mac/postprocess-framework-headers.sh:
879
880 2018-03-24  Tim Horton  <timothy_horton@apple.com>
881
882         Ignore sandbox_init_with_parameters deprecation warnings
883         https://bugs.webkit.org/show_bug.cgi?id=183979
884
885         Reviewed by Dan Bernstein.
886
887         * Shared/ios/ChildProcessIOS.mm:
888         (WebKit::ChildProcess::initializeSandbox):
889
890 2018-03-24  Chris Dumez  <cdumez@apple.com>
891
892         Use SecurityOriginData more consistently in Service Worker code
893         https://bugs.webkit.org/show_bug.cgi?id=183969
894
895         Reviewed by Darin Adler.
896
897         Use SecurityOriginData more consistently in Service Worker code to avoid constructing
898         SecurityOrigin objects unnecessarily.
899
900         * NetworkProcess/NetworkResourceLoadParameters.cpp:
901         (WebKit::NetworkResourceLoadParameters::encode const):
902         * Shared/API/c/WKSecurityOriginRef.cpp:
903         (WKSecurityOriginCopyDatabaseIdentifier):
904         * StorageProcess/ServiceWorker/WebSWOriginStore.cpp:
905         (WebKit::WebSWOriginStore::addToStore):
906         (WebKit::WebSWOriginStore::removeFromStore):
907         * StorageProcess/ServiceWorker/WebSWOriginStore.h:
908         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
909         (WebKit::WebSWServerConnection::scheduleJobInServer):
910         (WebKit::WebSWServerConnection::registerServiceWorkerClient):
911         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
912         (WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
913         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
914         * StorageProcess/StorageProcess.cpp:
915         (WebKit::StorageProcess::connectionToContextProcessWasClosed):
916         (WebKit::StorageProcess::needsServerToContextConnectionForOrigin const):
917         (WebKit::StorageProcess::createStorageToWebProcessConnection):
918         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
919         (WebKit::StorageProcess::serverToContextConnectionForOrigin):
920         (WebKit::StorageProcess::createServerToContextConnection):
921         (WebKit::StorageProcess::swContextConnectionMayNoLongerBeNeeded):
922         * StorageProcess/StorageProcess.h:
923         * UIProcess/API/APIFrameInfo.cpp:
924         (API::FrameInfo::create):
925         * UIProcess/API/C/WKApplicationCacheManager.cpp:
926         (WKApplicationCacheManagerDeleteEntriesForOrigin):
927         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
928         (WKKeyValueStorageManagerDeleteEntriesForOrigin):
929         * UIProcess/API/C/WKResourceCacheManager.cpp:
930         (WKResourceCacheManagerClearCacheForOrigin):
931         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
932         (WKWebsiteDataStoreRemoveFetchCacheForOrigin):
933         (WKWebsiteDataStoreGetFetchCacheSizeForOrigin):
934         * UIProcess/ServiceWorkerProcessProxy.cpp:
935         (WebKit::ServiceWorkerProcessProxy::create):
936         (WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
937         (WebKit::ServiceWorkerProcessProxy::getLaunchOptions):
938         * UIProcess/ServiceWorkerProcessProxy.h:
939         * UIProcess/Storage/StorageProcessProxy.cpp:
940         (WebKit::StorageProcessProxy::getStorageProcessConnection):
941         * UIProcess/WebProcessPool.cpp:
942         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
943         (WebKit::WebProcessPool::disconnectProcess):
944         (WebKit::WebProcessPool::updateProcessAssertions):
945         * UIProcess/WebProcessPool.h:
946         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
947         (WebKit::WebsiteDataStore::fetchDataAndApply):
948         * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
949         (WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation):
950         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
951         (WKBundlePageCopyOriginsWithApplicationCache):
952         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
953         (WebKit::UserMediaPermissionRequestManager::sendUserMediaRequest):
954         (WebKit::UserMediaPermissionRequestManager::enumerateMediaDevices):
955         * WebProcess/Storage/WebSWClientConnection.cpp:
956         (WebKit::WebSWClientConnection::registerServiceWorkerClient):
957         (WebKit::WebSWClientConnection::matchRegistration):
958         (WebKit::WebSWClientConnection::whenRegistrationReady):
959         (WebKit::WebSWClientConnection::getRegistrations):
960         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
961         (WebKit::WebChromeClient::exceededDatabaseQuota):
962         (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
963         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
964         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
965         * WebProcess/WebProcess.cpp:
966         (WebKit::WebProcess::fetchWebsiteData):
967         * WebProcess/WebStorage/StorageAreaImpl.cpp:
968         (WebKit::StorageAreaImpl::securityOrigin const):
969         * WebProcess/WebStorage/StorageAreaImpl.h:
970         * WebProcess/WebStorage/StorageAreaMap.cpp:
971         (WebKit::StorageAreaMap::StorageAreaMap):
972         (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
973         (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
974         * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
975         (WebKit::StorageNamespaceImpl::didDestroyStorageAreaMap):
976
977 2018-03-24  Tim Horton  <timothy_horton@apple.com>
978
979         Fix the !ENABLE(MEDIA_STREAM) build
980         https://bugs.webkit.org/show_bug.cgi?id=183977
981
982         Reviewed by Wenson Hsieh.
983
984         * UIProcess/Cocoa/UIDelegate.mm:
985         (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
986         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
987         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
988         * WebProcess/cocoa/UserMediaCaptureManager.messages.in:
989
990 2018-03-24  Tim Horton  <timothy_horton@apple.com>
991
992         WKFileUploadPanel shouldn't depend on WebKitLegacy
993         https://bugs.webkit.org/show_bug.cgi?id=183981
994
995         Reviewed by Wenson Hsieh.
996
997         * UIProcess/ios/forms/WKFileUploadPanel.mm:
998         (-[WKFileUploadPanel _uploadItemForImageData:imageName:successBlock:failureBlock:]):
999         Just use the underlying WebCore function instead of the
1000         unnecessary NSFileManager category method.
1001
1002 2018-03-23  Tim Horton  <timothy_horton@apple.com>
1003
1004         Fix the build with no pasteboard
1005         https://bugs.webkit.org/show_bug.cgi?id=183973
1006
1007         Reviewed by Dan Bernstein.
1008
1009         * Configurations/FeatureDefines.xcconfig:
1010
1011 2018-03-23  Megan Gardner  <megan_gardner@apple.com>
1012
1013         Enable unified text selection in select cases for gradual testing
1014         https://bugs.webkit.org/show_bug.cgi?id=183967
1015         <rdar://problem/38815328>
1016
1017         Reviewed by Tim Horton.
1018         
1019         Enable in select places for a more gradual switch, as this is a big change and we want to make sure
1020         it works before switching completely.
1021
1022         * UIProcess/ios/WKContentViewInteraction.mm:
1023         (-[WKContentView useSelectionAssistantWithGranularity:]):
1024
1025 2018-03-23  John Wilander  <wilander@apple.com>
1026
1027         Resource Load Statistics: Pick up ITP debug mode flag from defaults
1028         https://bugs.webkit.org/show_bug.cgi?id=183956
1029         <rdar://problem/38559574>
1030
1031         Reviewed by Brent Fulgham.
1032
1033         * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
1034         (WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):
1035
1036 2018-03-23  Wenson Hsieh  <wenson_hsieh@apple.com>
1037
1038         [Extra zoom mode] Adopt list view controller UI for select menus
1039         https://bugs.webkit.org/show_bug.cgi?id=183944
1040         <rdar://problem/38799062>
1041
1042         Reviewed by Tim Horton.
1043
1044         Move UIProcess/WKSelectMenuListViewController.* to UIProcess/ios/forms, where it was intended to go.
1045
1046         * UIProcess/ios/forms/WKSelectMenuListViewController.h: Renamed from Source/WebKit/UIProcess/WKSelectMenuListViewController.h.
1047         * UIProcess/ios/forms/WKSelectMenuListViewController.mm: Renamed from Source/WebKit/UIProcess/WKSelectMenuListViewController.mm.
1048         * WebKit.xcodeproj/project.pbxproj:
1049
1050 2018-03-23  Chris Dumez  <cdumez@apple.com>
1051
1052         Promptly terminate service worker processes when they are no longer needed
1053         https://bugs.webkit.org/show_bug.cgi?id=183873
1054         <rdar://problem/38676995>
1055
1056         Reviewed by Youenn Fablet.
1057
1058         The StorageProcess now keeps track of service worker clients for each security
1059         origin. When there is no longer any clients for a given security origin, the
1060         StorageProcess asks the service worker process for the given origin to terminate
1061         and severs its connection to it.
1062
1063         * Shared/Storage/StorageProcessCreationParameters.h:
1064         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
1065         (WebKit::WebSWServerToContextConnection::connectionMayNoLongerBeNeeded):
1066         (WebKit::WebSWServerToContextConnection::terminate):
1067         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
1068         * StorageProcess/StorageProcess.cpp:
1069         (WebKit::StorageProcess::connectionToContextProcessWasClosed):
1070         (WebKit::StorageProcess::needsServerToContextConnectionForOrigin const):
1071         (WebKit::StorageProcess::initializeWebsiteDataStore):
1072         (WebKit::StorageProcess::swServerForSession):
1073         (WebKit::StorageProcess::swContextConnectionMayNoLongerBeNeeded):
1074         (WebKit::StorageProcess::disableServiceWorkerProcessTerminationDelay):
1075         * StorageProcess/StorageProcess.h:
1076         * StorageProcess/StorageProcess.messages.in:
1077         * UIProcess/API/Cocoa/WKProcessPool.mm:
1078         (-[WKProcessPool _disableServiceWorkerProcessTerminationDelay]):
1079         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1080         * UIProcess/WebProcessPool.cpp:
1081         (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
1082         (WebKit::WebProcessPool::disableServiceWorkerProcessTerminationDelay):
1083         * UIProcess/WebProcessPool.h:
1084         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1085         (WebKit::WebSWContextManagerConnection::terminateProcess):
1086         * WebProcess/Storage/WebSWContextManagerConnection.h:
1087         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
1088
1089 2018-03-23  Brady Eidson  <beidson@apple.com>
1090
1091         Go to back/forward list items after a process-swapped navigation.
1092         <rdar://problem/38690544> and https://bugs.webkit.org/show_bug.cgi?id=183920
1093
1094         Reviewed by Andy Estes.
1095
1096         This takes the initial work of "process swap a normal navigation" and extends it to
1097         process swapping for back/forward item navigations.
1098
1099         * Scripts/webkit/messages.py:
1100
1101         Make sure state objects are serialized to the UI Process back/forward list items, as otherwise
1102         they will be lost in process-swap scenarios:
1103         * Shared/SessionState.cpp:
1104         (WebKit::PageState::encode const):
1105         (WebKit::PageState::decode):
1106         * Shared/SessionState.h:
1107
1108         Make a new variant of APINavigation specifically for back/forward list items.
1109         * UIProcess/API/APINavigation.cpp:
1110         (API::Navigation::Navigation):
1111         (API::Navigation::loggingURL const):
1112         * UIProcess/API/APINavigation.h:
1113         (API::Navigation::create):
1114         (API::Navigation::backForwardListItem):
1115         (API::Navigation::backForwardFrameLoadType const):
1116
1117         * UIProcess/API/C/WKPage.cpp:
1118         (WKPageGoToBackForwardListItem):
1119
1120         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
1121         (-[WKBrowsingContextController goToBackForwardListItem:]):
1122
1123         * UIProcess/API/Cocoa/WKWebView.mm:
1124         (-[WKWebView goToBackForwardListItem:]):
1125
1126         * UIProcess/WebNavigationState.cpp:
1127         (WebKit::WebNavigationState::createLoadRequestNavigation):
1128         (WebKit::WebNavigationState::createBackForwardNavigation):
1129         * UIProcess/WebNavigationState.h:
1130
1131         * UIProcess/WebPageProxy.cpp:
1132         (WebKit::WebPageProxy::reattachToWebProcessForReload):
1133         (WebKit::WebPageProxy::reattachToWebProcessWithItem):
1134         (WebKit::WebPageProxy::goForward):
1135         (WebKit::WebPageProxy::goBack):
1136         (WebKit::WebPageProxy::goToBackForwardItem):
1137         (WebKit::WebPageProxy::receivedPolicyDecision):
1138         (WebKit::WebPageProxy::continueNavigationInNewProcess): Handle back/forward navigations differently than others.
1139         (WebKit::WebPageProxy::restoreFromSessionState):
1140         * UIProcess/WebPageProxy.h:
1141
1142         * UIProcess/WebProcessProxy.cpp:
1143         (WebKit::WebProcessProxy::addOrUpdateBackForwardItem): Renamed from "addBackForwardItem" for clarity
1144         (WebKit::WebProcessProxy::addBackForwardItem): Deleted.
1145         * UIProcess/WebProcessProxy.h:
1146         * UIProcess/WebProcessProxy.messages.in:
1147
1148         * UIProcess/ios/ViewGestureControllerIOS.mm:
1149         (WebKit::ViewGestureController::endSwipeGesture):
1150
1151         * UIProcess/mac/ViewGestureControllerMac.mm:
1152         (WebKit::ViewGestureController::endSwipeGesture):
1153
1154         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
1155         (WebKit::toPageState):
1156         (WebKit::toHistoryItem):
1157
1158         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
1159         (WebKit::updateBackForwardItem):
1160
1161         * WebProcess/WebPage/WebPage.cpp:
1162         (WebKit::WebPage::goToBackForwardItem): Combined "goBack" and "goForward" with this method,
1163           passing the appropriate FrameLoadType around as needed to remember the specific type.
1164         (WebKit::WebPage::goForward): Deleted.
1165         (WebKit::WebPage::goBack): Deleted.
1166         * WebProcess/WebPage/WebPage.h:
1167         * WebProcess/WebPage/WebPage.messages.in:
1168
1169 2018-03-23  Megan Gardner  <megan_gardner@apple.com>
1170
1171         Don't use the presence of a textSelectionAssistant as a proxy for if we are in content editable.
1172         https://bugs.webkit.org/show_bug.cgi?id=183804
1173
1174         Reviewed by Tim Horton.
1175
1176         We need to stop using the presence of a textSelectionAssistant as a proxy for if we are selecting in a content editable
1177         or not. As we are planning on switching to only using a textSelectionAssistant for selection, these checks need to 
1178         be more direct in checking what we actually need to know i.e. are we selecting in a content editable.
1179
1180         * Platform/spi/ios/UIKitSPI.h:
1181         * UIProcess/ios/WKContentViewInteraction.mm:
1182         (hasAssistedNode):
1183         (-[WKContentView inputView]):
1184         (-[WKContentView _selectionClipRect]):
1185         (-[WKContentView gestureRecognizer:canBePreventedByGestureRecognizer:]):
1186         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
1187         (-[WKContentView gestureRecognizerShouldBegin:]):
1188         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
1189         (-[WKContentView webSelectionRects]):
1190         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
1191         (-[WKContentView _autofillContext]):
1192
1193 2018-03-23  Youenn Fablet  <youenn@apple.com>
1194
1195         WebProcessPool should not ask to register all clients for each service worker process creation
1196         https://bugs.webkit.org/show_bug.cgi?id=183941
1197
1198         Reviewed by Chris Dumez.
1199
1200         Call registerServiceWorkerClients when there is no service worker process.
1201         Update service worker clients to register all of them no matter the session ID.
1202
1203         * UIProcess/WebProcessPool.cpp:
1204         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
1205         * WebProcess/WebProcess.cpp:
1206         (WebKit::WebProcess::registerServiceWorkerClients):
1207         * WebProcess/WebProcess.h:
1208         * WebProcess/WebProcess.messages.in:
1209
1210 2018-03-23  Wenson Hsieh  <wenson_hsieh@apple.com>
1211
1212         [Extra zoom mode] Adopt list view controller UI for select menus
1213         https://bugs.webkit.org/show_bug.cgi?id=183944
1214         <rdar://problem/38799062>
1215
1216         Reviewed by Andy Estes.
1217
1218         Rename WKSelectMenuViewController to WKSelectMenuListViewController, and also rename the relevant
1219         WebKitAdditions harness files. See corresponding changes for more details.
1220
1221         * UIProcess/WKSelectMenuListViewController.h: Renamed from Source/WebKit/UIProcess/ios/forms/WKSelectMenuViewController.h.
1222         * UIProcess/WKSelectMenuListViewController.mm: Renamed from Source/WebKit/UIProcess/ios/forms/WKSelectMenuViewController.mm.
1223         * UIProcess/ios/WKContentViewInteraction.h:
1224         * UIProcess/ios/WKContentViewInteraction.mm:
1225         (-[WKContentView presentSelectMenuViewController:]):
1226         (-[WKContentView dismissSelectMenuViewController:]):
1227         (-[WKContentView selectMenu:didSelectItemAtIndex:]):
1228         (-[WKContentView numberOfItemsInSelectMenu:]):
1229         (-[WKContentView selectMenu:displayTextForItemAtIndex:]):
1230         (-[WKContentView selectMenu:didCheckItemAtIndex:checked:]):
1231         (-[WKContentView selectMenuUsesMultipleSelection:]):
1232         (-[WKContentView selectMenu:hasSelectedOptionAtIndex:]):
1233         (-[WKContentView _wheelChangedWithEvent:]):
1234
1235         Overriding wheel events and re-dispatching them is no longer needed after r229437, so we can just remove special
1236         handling for select menus here.
1237
1238         (-[WKContentView didCancelSelectionInSelectMenu:]): Deleted.
1239         (-[WKContentView selectMenuSupportsMultipleSelection:]): Deleted.
1240         (-[WKContentView selectMenu:hasCheckedOptionAtIndex:]): Deleted.
1241         (-[WKContentView startingIndexForSelectMenu:]): Deleted.
1242
1243         The starting index for a select menu is no longer relevant when using list view controllers for input, so we can
1244         just remove this delegate hook altogether.
1245
1246         * WebKit.xcodeproj/project.pbxproj:
1247
1248 2018-03-23  Youenn Fablet  <youenn@apple.com>
1249
1250         CacheStorage::Caches should clear m_caches when clearing its representation even though it is not yet initialized
1251         https://bugs.webkit.org/show_bug.cgi?id=183945
1252
1253         Reviewed by Chris Dumez.
1254
1255         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
1256         (WebKit::CacheStorage::Caches::clearMemoryRepresentation):
1257         In case we clear Caches in the middle of the initialization, m_caches might not be empty
1258         but m_isInitialized is not yet set to true since we are computing the Caches size.
1259         Update the assertion and clear m_caches in that case.
1260
1261 2018-03-23  David Kilzer  <ddkilzer@apple.com>
1262
1263         Stop using dispatch_set_target_queue()
1264         <https://webkit.org/b/183908>
1265         <rdar://problem/33553533>
1266
1267         Reviewed by Daniel Bates.
1268
1269         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
1270         (WebKit::NetworkCache::IOChannel::IOChannel): Remove the call to
1271         dispatch_set_target_queue() since this is handled in the
1272         dispatch_io_create() call above.
1273
1274 2018-03-23  Youenn Fablet  <youenn@apple.com>
1275
1276         CacheStorage::Engine should not ref itself when hopping to a background thread
1277         https://bugs.webkit.org/show_bug.cgi?id=183925
1278         <rdar://problem/38580483>
1279
1280         Reviewed by Chris Dumez.
1281
1282         Add support for weak pointers to CacheStorage Engine.
1283         Use weak pointer when hopping to background threads.
1284         Store callbacks in CacheStorage::Engine maps to keep them being destroyed in the main thread only.
1285         Made some callbacks CompletionHandler as a bonus.
1286
1287         Made sure to use just one Engine for all private sessions.
1288
1289         * NetworkProcess/cache/CacheStorageEngine.cpp:
1290         (WebKit::CacheStorage::Engine::~Engine):
1291         (WebKit::CacheStorage::Engine::from):
1292         (WebKit::CacheStorage::Engine::initialize):
1293         (WebKit::CacheStorage::Engine::writeFile):
1294         (WebKit::CacheStorage::Engine::readFile):
1295         * NetworkProcess/cache/CacheStorageEngine.h:
1296         (WebKit::CacheStorage::Engine::weakPtrFactory):
1297
1298 2018-03-23  Ryan Haddad  <ryanhaddad@apple.com>
1299
1300         Unreviewed build fix.
1301
1302         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1303
1304 2018-03-23  Miguel Gomez  <magomez@igalia.com>
1305
1306         [GTK][WPE] Avoid software color conversion inside BitmapTextureGL
1307         https://bugs.webkit.org/show_bug.cgi?id=183892
1308
1309         Remove the UpdateContentsFlag parameter when calling BitmapTexture::updateContents().
1310
1311         Reviewed by Žan Doberšek.
1312
1313         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
1314         (WebKit::CoordinatedBackingStoreTile::swapBuffers):
1315
1316 2018-03-23  Michael Catanzaro  <mcatanzaro@igalia.com>
1317
1318         [WPE][GTK] Fix -Wswitch warnings after r229778
1319         https://bugs.webkit.org/show_bug.cgi?id=183927
1320
1321         Reviewed by Carlos Garcia Campos.
1322
1323         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1324         (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse): Log a warning if Suspend is
1325         received as a PolicyAction
1326         * UIProcess/API/glib/WebKitNavigationClient.cpp: Ignore the ProcessSwap termination reason,
1327         which should be invisible to WebKit clients
1328
1329 2018-03-22  Chris Dumez  <cdumez@apple.com>
1330
1331         Include security origin in the service worker process name
1332         https://bugs.webkit.org/show_bug.cgi?id=183913
1333
1334         Reviewed by Youenn Fablet.
1335
1336         Include security origin in the service worker process name to facilitate debugging. This way, we
1337         can differentiate which service worker process is used for which origin in activity monitor.
1338
1339         * Shared/ChildProcess.h:
1340         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
1341         (WebKit::XPCServiceInitializerDelegate::getExtraInitializationData):
1342         * UIProcess/ServiceWorkerProcessProxy.cpp:
1343         (WebKit::ServiceWorkerProcessProxy::getLaunchOptions):
1344         * WebProcess/cocoa/WebProcessCocoa.mm:
1345         (WebKit::WebProcess::initializeProcessName):
1346
1347 2018-03-22  Michael Catanzaro  <mcatanzaro@igalia.com>
1348
1349         Unreviewed, silence unused variable warning
1350
1351         * UIProcess/WebPageProxy.cpp:
1352         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1353
1354 2018-03-22  Dan Bernstein  <mitz@apple.com>
1355
1356         WKWebView doesn’t expose its spellCheckerDocumentTag
1357         https://bugs.webkit.org/show_bug.cgi?id=183797
1358         <rdar://problem/38678089>
1359
1360         Reviewed by Tim Horton.
1361
1362         * UIProcess/API/Cocoa/WKWebView.mm:
1363         (-[WKWebView _spellCheckerDocumentTag]): Added this getter which calls through to the WebViewImpl.
1364         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared _spellCheckerDocumentTag property.
1365
1366 2018-03-22  Chris Dumez  <cdumez@apple.com>
1367
1368         Use the same SWServer for all ephemeral sessions
1369         https://bugs.webkit.org/show_bug.cgi?id=183921
1370         <rdar://problem/36873075>
1371
1372         Reviewed by Youenn Fablet.
1373
1374         Use the same SWServer for all ephemeral sessions. SWServers never go away and we create
1375         one per sessionID. When browsing doing private browsing in Safari (and other fetching
1376         favorite icons), the sessionID is ephemeral and keeps changing. This means that we kept
1377         constructing new SWServers that would never go away. Each SWServer has a thread so we
1378         would eventually hit the thread limit for the storage process.
1379
1380         * StorageProcess/StorageProcess.cpp:
1381         (WebKit::StorageProcess::swServerForSession):
1382
1383 2018-03-22  Michael Catanzaro  <mcatanzaro@igalia.com>
1384
1385         Unreviewed, fix format string warnings in service worker code
1386
1387         On Linux x86_64, uint64_t is unsigned long, not unsigned long long.
1388
1389         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1390         (WebKit::WebSWServerConnection::startFetch):
1391         (WebKit::WebSWServerConnection::didFinishFetch):
1392         (WebKit::WebSWServerConnection::didFailFetch):
1393         (WebKit::WebSWServerConnection::didNotHandleFetch):
1394
1395 2018-03-22  Daniel Bates  <dabates@apple.com>
1396
1397         Expose SchemeRegistry::registerAsCanDisplayOnlyIfCanRequest() as WebKit SPI
1398         https://bugs.webkit.org/show_bug.cgi?id=183907
1399         <rdar://problem/38759127>
1400
1401         Reviewed by Alex Christensen.
1402
1403         Adds both modern Objective-C SPI and C SPI to allow an embedding client to register a scheme
1404         whose content should be displayed/loaded if and only if it can be requested. Disregarding an
1405         app that enables universal access, by using this SPI WebKit will refuse to display cross-origin
1406         content for the registered schemes.
1407
1408         We need to add C SPI for embedding clients that have not transitioned to the modern Objective-
1409         C API/SPI.
1410
1411         * Shared/WebProcessCreationParameters.cpp:
1412         (WebKit::WebProcessCreationParameters::encode const):
1413         (WebKit::WebProcessCreationParameters::decode):
1414         * Shared/WebProcessCreationParameters.h:
1415         * UIProcess/API/C/WKContext.cpp:
1416         (WKContextRegisterURLSchemeAsCanDisplayOnlyIfCanRequest):
1417         * UIProcess/API/C/WKContextPrivate.h:
1418         * UIProcess/API/Cocoa/WKProcessPool.mm:
1419         (-[WKProcessPool _registerURLSchemeAsCanDisplayOnlyIfCanRequest:]):
1420         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1421         * UIProcess/WebProcessPool.cpp:
1422         (WebKit::WebProcessPool::initializeNewWebProcess):
1423         (WebKit::WebProcessPool::registerURLSchemeAsCanDisplayOnlyIfCanRequest):
1424         * UIProcess/WebProcessPool.h:
1425         * WebProcess/WebProcess.cpp:
1426         (WebKit::WebProcess::initializeWebProcess):
1427         (WebKit::WebProcess::registerURLSchemeAsCanDisplayOnlyIfCanRequest const):
1428         * WebProcess/WebProcess.h:
1429         * WebProcess/WebProcess.messages.in:
1430
1431 2018-03-22  Tim Horton  <timothy_horton@apple.com>
1432
1433         Improve readability of WebCore's OTHER_LDFLAGS
1434         https://bugs.webkit.org/show_bug.cgi?id=183909
1435         <rdar://problem/38760992>
1436
1437         Reviewed by Dan Bernstein.
1438
1439         * Configurations/Base.xcconfig:
1440         * Configurations/FeatureDefines.xcconfig:
1441
1442 2018-03-22  Zan Dobersek  <zdobersek@igalia.com>
1443
1444         [TexMap] Make TextureMapperContextAttributes thread-specific
1445         https://bugs.webkit.org/show_bug.cgi?id=183895
1446
1447         Reviewed by Carlos Garcia Campos.
1448
1449         CoordinatedGraphicsScene, as an implementor of the
1450         TextureMapperPlatformLayerProxy::Compositor interface, doesn't have to
1451         implement the texmapGL() method anymore.
1452
1453         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1454         (WebKit::CoordinatedGraphicsScene::onNewBufferAvailable):
1455         (WebKit::CoordinatedGraphicsScene::texmapGL): Deleted.
1456         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
1457
1458 2018-03-21  Frederic Wang  <fwang@igalia.com>
1459
1460         Unreviewed, update comment added in r229801.
1461
1462         * WebProcess/WebPage/ios/FindControllerIOS.mm:
1463         (WebKit::FindController::didFindString): Remove "On Mobile" and mention bug 183889.
1464
1465 2018-03-21  Chris Dumez  <cdumez@apple.com>
1466
1467         Regression(r229831): ProcessSwap.Basic API test is crashing
1468         https://bugs.webkit.org/show_bug.cgi?id=183884
1469
1470         Reviewed by Brady Eidson.
1471
1472         This code should only be called for navigation policy decisions.
1473         It used to work without this check because of an early return, which
1474         was dropped in r229831.
1475
1476         * UIProcess/WebPageProxy.cpp:
1477         (WebKit::WebPageProxy::receivedPolicyDecision):
1478
1479 2018-03-21  Wenson Hsieh  <wenson_hsieh@apple.com>
1480
1481         [Extra zoom mode] Add new SPI hooks for clients to vend an input session context view
1482         https://bugs.webkit.org/show_bug.cgi?id=183866
1483         <rdar://problem/38692256>
1484
1485         Reviewed by Tim Horton.
1486
1487         Add new SPI hooks to _WKInputDelegate allowing internal clients to provide a view that gives additional context
1488         when editing form controls, on top of the default label or placeholder text displayed by WebKit. The height
1489         delegate is invoked first, giving the client an opportunity to lay out the context view to fit the given size;
1490         the actual view is then queried.
1491
1492         If the view changes, clients may tell WebKit to reload the context view via SPI on WKFormInputSession; this call
1493         to reload is plumbed through to the currently presented list view controller (at the moment, this is only the
1494         text input list view controller).
1495
1496         * UIProcess/API/Cocoa/_WKFormInputSession.h:
1497         * UIProcess/API/Cocoa/_WKInputDelegate.h:
1498
1499         Add the new SPI hooks, described above.
1500
1501         * UIProcess/ios/WKContentViewInteraction.h:
1502         * UIProcess/ios/WKContentViewInteraction.mm:
1503         (-[WKFormInputSession reloadFocusedElementContextView]):
1504
1505         Plumb the context view reload hook through WKContentView to WKTextInputListViewController.
1506
1507         (-[WKContentView setupInteraction]):
1508         (-[WKContentView _stopAssistingNode]):
1509         (-[WKContentView reloadContextViewForPresentedListViewController]):
1510         (-[WKContentView focusedFormControllerDidUpdateSuggestions:]):
1511
1512         Slight tweak to only reload text suggestions if we are not blurring the focused element. Without this extra
1513         condition, the list view controller's inner table view would get reloaded when the form input session's text
1514         suggestions are set to nil when the list view controller is dismissed, causing a visible stutter in the
1515         dismissal animation of view controller.
1516
1517 2018-03-21  Chris Dumez  <cdumez@apple.com>
1518
1519         WebKitTestRunner crashed in com.apple.WebKit: WebKit::WebProcessPool::terminateServiceWorkerProcesses
1520         https://bugs.webkit.org/show_bug.cgi?id=183875
1521
1522         Reviewed by Brent Fulgham.
1523
1524         Protect |this| while we're iterating over m_serviceWorkerProcesses and terminating
1525         each service worker process. It is possible for the WebProcess pool to get destroyed
1526         as a result of terminating a service worker process.
1527
1528         This change is covered by layout tests that are currently crashing on the ASAN bots.
1529
1530         * UIProcess/WebProcessPool.cpp:
1531         (WebKit::WebProcessPool::terminateServiceWorkerProcesses):
1532
1533 2018-03-21  Eric Carlson  <eric.carlson@apple.com>
1534
1535         Fix typo in inactive media stream timeout default value
1536         https://bugs.webkit.org/show_bug.cgi?id=183872
1537         <rdar://problem/38723903>
1538
1539         Reviewed by Jer Noble.
1540
1541         * Shared/WebPreferences.yaml: Fix typo.
1542         * Shared/WebPreferencesDefaultValues.h: Ditto.
1543
1544 2018-03-21  Chris Dumez  <cdumez@apple.com>
1545
1546         Make policy decisions asynchronous
1547         https://bugs.webkit.org/show_bug.cgi?id=180568
1548         <rdar://problem/37131297>
1549
1550         Reviewed by Alex Christensen.
1551
1552         Get rid of synchronous IPC and synchronous code paths for policy delegates.
1553         Policy decisions are now all made asynchronously and rely on asynchronous
1554         IPC.
1555
1556         This code change is based on work by Alex Christensen.
1557
1558         * UIProcess/WebPageProxy.cpp:
1559         (WebKit::WebPageProxy::receivedPolicyDecision):
1560         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1561         (WebKit::WebPageProxy::decidePolicyForResponse):
1562         * UIProcess/WebPageProxy.h:
1563         * UIProcess/WebPageProxy.messages.in:
1564         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1565         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
1566         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1567
1568 2018-03-21  Chris Dumez  <cdumez@apple.com>
1569
1570         ScrollViewInsetTests.RestoreInitialContentOffsetAfterCrash API test is failing with async delegates
1571         https://bugs.webkit.org/show_bug.cgi?id=183787
1572
1573         Reviewed by Wenson Hsieh.
1574
1575         Without asynchronous policy delegates, when the client requests a navigation, we would:
1576         1. Do a synchronous navigation policy check
1577         2. If the client allows the navigation, start the provisional load
1578
1579         Starting the provisional load would freeze the layer tree until first meaningful
1580         layout via WebFrameLoaderClient::provisionalLoadStarted() -> WebPage::didStartPageTransition().
1581
1582         When constructing a WebView and then requesting a load right away. This would make sure
1583         we do not commit a layer tree for the initial about:blank page because the layer tree
1584         would be frozen until we have something meaningful to show for the following load.
1585
1586         However, with asynchronous policy delegates, we are able to do a layer tree commit
1587         during the asynchronous navigation policy check because the layer tree is not frozen
1588         yet (provisional load has not started) and the process is not stuck on synchronous
1589         IPC. When constructing a WebView and then requesting a load right away, this would
1590         allow a layer tree commit for about:blank to happen before we've even started the
1591         load. This would cause some API tests to fail on iOS.
1592
1593         To address the issue, we try and maintain pre-existing behavior by freezing the
1594         layer tree during navigation policy decision.
1595
1596         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1597         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1598         (WebKit::WebFrameLoaderClient::didDecidePolicyForNavigationAction):
1599         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1600         * WebProcess/WebPage/WebPage.cpp:
1601         (WebKit::WebPage::didStartNavigationPolicyCheck):
1602         (WebKit::WebPage::didCompleteNavigationPolicyCheck):
1603         * WebProcess/WebPage/WebPage.h:
1604
1605 2018-03-21  Brent Fulgham  <bfulgham@apple.com>
1606
1607         Allow the WebContent process to read ViewBridge preferences
1608         https://bugs.webkit.org/show_bug.cgi?id=183862
1609         <rdar://problem/38459456>
1610
1611         Reviewed by Eric Carlson.
1612
1613         * WebProcess/com.apple.WebProcess.sb.in:
1614
1615 2018-03-21  Frederic Wang  <fwang@igalia.com>
1616
1617         [iOS] Text highlighted by the Find UI overlaps with NBC news header on google.com
1618         https://bugs.webkit.org/show_bug.cgi?id=183658
1619
1620         Reviewed by Tim Horton.
1621
1622         On Mobile, many sites have overlay headers or footers that may overlap with the highlighted
1623         text inside a scrollable overflow node. To workaround that issue, this commit changes the
1624         behavior so that the text is revealed at the center of the overflow node.
1625
1626         * WebProcess/WebPage/ios/FindControllerIOS.mm:
1627         (WebKit::FindController::didFindString): Use alignCenterAlways instead of alignToEdgeIfNeeded.
1628
1629 2018-03-21  Carlos Garcia Campos  <cgarcia@igalia.com>
1630
1631         [GTK][WPE] JSC bindings not introspectable
1632         https://bugs.webkit.org/show_bug.cgi?id=136989
1633
1634         Reviewed by Michael Catanzaro.
1635
1636         Deprecate the functions that are not introspectable due to JSC C API in GTK+ port and remove them in WPE
1637         port. Add alternative functions using the new JSC GLib API. We no longer need to keep a global context attached
1638         to every view. We can simply create a temporary global context on demand and release it after 1 second. This
1639         also allows us to remove WebPageProxy::javascriptGlobalContext() and all the related code.
1640
1641         * PlatformGTK.cmake:
1642         * PlatformWPE.cmake:
1643         * UIProcess/API/glib/WebKitJavascriptResult.cpp:
1644         (_WebKitJavascriptResult::_WebKitJavascriptResult):
1645         (webkitJavascriptResultCreate):
1646         (webkit_javascript_result_get_global_context):
1647         (webkit_javascript_result_get_value):
1648         (webkit_javascript_result_get_js_value):
1649         * UIProcess/API/glib/WebKitJavascriptResultPrivate.h:
1650         (SharedJavascriptContext::singleton):
1651         (SharedJavascriptContext::SharedJavascriptContext):
1652         (SharedJavascriptContext::getOrCreateContext):
1653         (SharedJavascriptContext::releaseContext):
1654         * UIProcess/API/glib/WebKitUserContentManager.cpp:
1655         * UIProcess/API/glib/WebKitWebView.cpp:
1656         (webkit_web_view_get_javascript_global_context):
1657         (webkitWebViewRunJavaScriptCallback):
1658         * UIProcess/API/gtk/PageClientImpl.cpp:
1659         * UIProcess/API/gtk/PageClientImpl.h:
1660         * UIProcess/API/gtk/WebKitJavascriptResult.h:
1661         * UIProcess/API/gtk/WebKitWebView.h:
1662         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
1663         * UIProcess/API/wpe/APIViewClient.h:
1664         (API::ViewClient::handleDownloadRequest):
1665         * UIProcess/API/wpe/PageClientImpl.cpp:
1666         * UIProcess/API/wpe/PageClientImpl.h:
1667         * UIProcess/API/wpe/WPEView.cpp:
1668         * UIProcess/API/wpe/WPEView.h:
1669         * UIProcess/API/wpe/WebKitJavascriptResult.h:
1670         * UIProcess/API/wpe/WebKitWebView.h:
1671         * UIProcess/PageClient.h:
1672         * UIProcess/WebPageProxy.h:
1673         * UIProcess/gtk/WebPageProxyGtk.cpp:
1674         * UIProcess/wpe/WebPageProxyWPE.cpp:
1675         * WebProcess/InjectedBundle/API/glib/WebKitFrame.cpp:
1676         (webkit_frame_get_js_context):
1677         (webkit_frame_get_js_context_for_script_world):
1678         * WebProcess/InjectedBundle/API/gtk/WebKitFrame.h:
1679         * WebProcess/InjectedBundle/API/wpe/WebKitFrame.h:
1680
1681 2018-03-21  Carlos Garcia Campos  <cgarcia@igalia.com>
1682
1683         [GTK][WPE] Initial implementation of JavaScriptCore glib bindings
1684         https://bugs.webkit.org/show_bug.cgi?id=164061
1685
1686         Reviewed by Michael Catanzaro.
1687
1688         Set decorator and deprecation_guard options in API docs config files, since they are no longer common to all
1689         libraries.
1690
1691         * PlatformGTK.cmake:
1692
1693 2018-03-21  Zan Dobersek  <zdobersek@igalia.com>
1694
1695         [CoordGraphics] Simplify CoordinatedGraphicsScene activation
1696         https://bugs.webkit.org/show_bug.cgi?id=183772
1697
1698         Reviewed by Carlos Garcia Campos.
1699
1700         Simplify CoordinatedGraphicsScene::setActive() into a simple setter of
1701         the m_isActive member variable. We don't have to call renderNextFrame()
1702         anymore as that was only necessary to unblock CoordinatedLayerTreeHost,
1703         but that can be avoided if m_isWaitingForRenderer in that class is
1704         initialized to false.
1705
1706         CoordinatedGraphicsSceneClient::renderNextFrame() virtual method and its
1707         ThreadedCompositor implementation are removed. renderNextFrame() in the
1708         CoordinatedGraphicsScene class can also be removed, along with the
1709         unused dispatchOnMainThread() and dispatchOnClientRunLoop() methods and
1710         the associated m_clientRunLoop member variable.
1711
1712         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1713         (WebKit::CoordinatedGraphicsScene::CoordinatedGraphicsScene):
1714         (WebKit::CoordinatedGraphicsScene::dispatchOnMainThread): Deleted.
1715         (WebKit::CoordinatedGraphicsScene::dispatchOnClientRunLoop): Deleted.
1716         (WebKit::CoordinatedGraphicsScene::renderNextFrame): Deleted.
1717         (WebKit::CoordinatedGraphicsScene::setActive): Deleted.
1718         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
1719         (WebKit::CoordinatedGraphicsSceneClient::~CoordinatedGraphicsSceneClient):
1720         (WebKit::CoordinatedGraphicsScene::setActive):
1721         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1722         (WebKit::m_displayRefreshMonitor):
1723         (WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing):
1724         (WebKit::ThreadedCompositor::renderNextFrame): Deleted.
1725         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
1726         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
1727
1728 2018-03-21  Zan Dobersek  <zdobersek@igalia.com>
1729
1730         [TexMap] Have TextureMapperLayer::applyAnimationsRecursively() return running animation status
1731         https://bugs.webkit.org/show_bug.cgi?id=183771
1732
1733         Reviewed by Carlos Garcia Campos.
1734
1735         In CoordinatedGraphicsScene::paintToCurrentGLContext(), retrieve
1736         information about any running animation in the scene via the
1737         TextureMapperLayer::applyAnimationsRecursively() call. Use that boolean
1738         value at the end up the method, instead of again traversing the
1739         TextureMapperLayer tree to determine whether any running animations are
1740         present.
1741
1742         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1743         (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
1744
1745 2018-03-20  Tim Horton  <timothy_horton@apple.com>
1746
1747         Enable the minimal simulator feature flag when appropriate
1748         https://bugs.webkit.org/show_bug.cgi?id=183807
1749
1750         Reviewed by Dan Bernstein.
1751
1752         * Configurations/FeatureDefines.xcconfig:
1753
1754 2018-03-19  Ryosuke Niwa  <rniwa@webkit.org>
1755
1756         Expose content attributes on _WKLinkIconParameters
1757         https://bugs.webkit.org/show_bug.cgi?id=183768
1758
1759         Reviewed by Alex Christensen.
1760
1761         Added _WKLinkIconParameters.attributes to expose content attributes of a link element
1762         which defined a favicon, touch icon, or pre-compressed touch icon.
1763
1764         * UIProcess/API/Cocoa/_WKLinkIconParameters.h:
1765         (_WKLinkIconParameters.attributes): Added.
1766         * UIProcess/API/Cocoa/_WKLinkIconParameters.mm:
1767         (_WKLinkIconParameters._attributes): Added.
1768         (-[_WKLinkIconParameters _initWithLinkIcon:]): Convert the hash map from WebCore to a NSDictionary.
1769         (-[_WKLinkIconParameters attributes]): Added.
1770
1771 2018-03-20  Wenson Hsieh  <wenson_hsieh@apple.com>
1772
1773         Add AssistedNodeInformation plumbing for form control placeholder text and label text
1774         https://bugs.webkit.org/show_bug.cgi?id=183802
1775         <rdar://problem/38686273>
1776
1777         Reviewed by Tim Horton.
1778
1779         Surfaces some additional information about the currently focused element to the input delegate in the UI process.
1780         See comments below for more details.
1781
1782         Test: WebKit.FocusedElementInfo
1783
1784         * Shared/AssistedNodeInformation.cpp:
1785         (WebKit::AssistedNodeInformation::encode const):
1786         (WebKit::AssistedNodeInformation::decode):
1787         * Shared/AssistedNodeInformation.h:
1788
1789         Add `placeholder` and `label` to AssistedNodeInformation, which capture the value of the placeholder attribute
1790         and the text of the first associated label element for the focused form control. Also add boilerplate encoder/
1791         decoder support for these members.
1792
1793         * UIProcess/API/Cocoa/_WKFocusedElementInfo.h:
1794
1795         Augment _WKFocusedElementInfo to include placeholder and label.
1796
1797         * UIProcess/ios/WKContentViewInteraction.mm:
1798         (-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:userObject:]):
1799         (-[WKFocusedElementInfo label]):
1800         (-[WKFocusedElementInfo placeholder]):
1801         * WebProcess/WebPage/ios/WebPageIOS.mm:
1802         (WebKit::WebPage::getAssistedNodeInformation):
1803
1804         For input elements and textareas, set the placeholder to the value of the placeholder attribute. For all
1805         elements with associated labels, grab the inner text of the first label that is not empty, ignoring all labels
1806         that are `display: none` (i.e. not being rendered).
1807
1808 2018-03-20  Brady Eidson  <beidson@apple.com>
1809
1810         First piece of process swapping on navigation.
1811         https://bugs.webkit.org/show_bug.cgi?id=183665
1812
1813         Reviewed by Andy Estes.
1814
1815         This patch adds the first pieces of the following feature:
1816         "When a navigation originating inside a WKWebView goes to a different origin,
1817          swap to a new WebProcess for that navigation"
1818
1819         There are significant bugs to be resolved and significant optimizations to be made.
1820         Which is why the feature is disabled by default.
1821
1822         Besides the core logic implementing the feature, this patch does a lot of related 
1823         work such as:
1824         - Removing some now-invalid ASSERTs
1825         - Adding some ASSERTs
1826         - Update various switch states to handle the new "Suspend" policy and "NavigationSwap"
1827           process termination reason
1828
1829         * NetworkProcess/NetworkDataTaskBlob.cpp:
1830         (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse):
1831
1832         * NetworkProcess/capture/NetworkDataTaskReplay.cpp:
1833         (WebKit::NetworkCapture::NetworkDataTaskReplay::didReceiveResponse):
1834
1835         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1836         (toNSURLSessionResponseDisposition):
1837
1838         * Platform/Logging.h:
1839
1840         * Shared/LoadParameters.cpp:
1841         (WebKit::LoadParameters::encode const):
1842         (WebKit::LoadParameters::decode):
1843         * Shared/LoadParameters.h:
1844
1845         * Shared/ProcessTerminationReason.h: Add "NavigationSwap" as a process termination reason.
1846
1847         * UIProcess/API/APINavigation.h:
1848
1849         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1850         (API::ProcessPoolConfiguration::copy):
1851
1852         * UIProcess/API/C/WKAPICast.h:
1853         (WebKit::toAPI):
1854
1855         * UIProcess/Cocoa/NavigationState.mm:
1856         (WebKit::wkProcessTerminationReason):
1857
1858         * UIProcess/WebFramePolicyListenerProxy.cpp:
1859         (WebKit::WebFramePolicyListenerProxy::WebFramePolicyListenerProxy):
1860         * UIProcess/WebFramePolicyListenerProxy.h:
1861         (WebKit::WebFramePolicyListenerProxy::create):
1862         (WebKit::WebFramePolicyListenerProxy::policyListenerType const):
1863
1864         * UIProcess/WebFrameProxy.cpp:
1865         (WebKit::WebFrameProxy::setUpPolicyListenerProxy):
1866         (WebKit::WebFrameProxy::activePolicyListenerProxy):
1867         * UIProcess/WebFrameProxy.h:
1868
1869         * UIProcess/WebNavigationState.cpp:
1870         (WebKit::WebNavigationState::navigation):
1871         (WebKit::WebNavigationState::takeNavigation):
1872
1873         * UIProcess/WebPageProxy.cpp:
1874         (WebKit::WebPageProxy::reattachToWebProcess):
1875         (WebKit::WebPageProxy::attachToProcessForNavigation): Pretend that the existing process 
1876           terminated using the new "NavigationSwap" reason, then manually start the next load.
1877         (WebKit::WebPageProxy::loadRequest):
1878         (WebKit::WebPageProxy::loadRequestWithNavigation):
1879         (WebKit::WebPageProxy::receivedPolicyDecision):
1880         (WebKit::WebPageProxy::continueNavigationInNewProcess):
1881         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1882         (WebKit::WebPageProxy::decidePolicyForResponse):
1883         (WebKit::WebPageProxy::processDidTerminate):
1884         (WebKit::WebPageProxy::resetState):
1885         (WebKit::WebPageProxy::resetStateAfterProcessExited):
1886         * UIProcess/WebPageProxy.h:
1887
1888         * UIProcess/WebProcessPool.cpp:
1889         (WebKit::WebProcessPool::processForNavigation): Determine which process should be used
1890           for a proposed navigation, creating a new one if necessary.
1891         * UIProcess/WebProcessPool.h:
1892
1893         * UIProcess/WebStorage/StorageManager.cpp:
1894         (WebKit::StorageManager::SessionStorageNamespace::setAllowedConnection):
1895
1896         * WebProcess/WebPage/WebPage.cpp:
1897         (WebKit::WebPage::loadRequest):
1898
1899 2018-03-20  Youenn Fablet  <youenn@apple.com>
1900
1901         ServiceWorkerClientFetch::didReceiveData should check for m_encodedDataLength
1902         https://bugs.webkit.org/show_bug.cgi?id=183668
1903
1904         Reviewed by Chris Dumez.
1905
1906         Crash happens when releasing a RefPtr<SharedBuffer> buffer that is null.
1907         It happens because ServiceWorkerClientFetch can call m_loader->didReceiveBuffer at two different places.
1908         Either when receiving an IPC call or as part of completion handler for the response validation check.
1909         At each call site, we release the buffer to pass it to the loader and we set m_encodedLength to zero.
1910         The fix is to add the m_encodedLength check like done in the case of response validation check completion handler.
1911
1912         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
1913         (WebKit::ServiceWorkerClientFetch::didReceiveData):
1914
1915 2018-03-20  Jeff Miller  <jeffm@apple.com>
1916
1917         Expose aggressiveTileRetentionEnabled in WKPreferences SPI to match C SPI
1918         https://bugs.webkit.org/show_bug.cgi?id=183790
1919
1920         Reviewed by Alex Christensen.
1921         
1922         Expose this property on macOS only.
1923
1924         * UIProcess/API/Cocoa/WKPreferences.mm:
1925         (-[WKPreferences _setAggressiveTileRetentionEnabled:]):
1926         (-[WKPreferences _aggressiveTileRetentionEnabled]):
1927         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1928
1929 2018-03-20  Tim Horton  <timothy_horton@apple.com>
1930
1931         Add and adopt WK_PLATFORM_NAME and adjust default feature defines
1932         https://bugs.webkit.org/show_bug.cgi?id=183758
1933         <rdar://problem/38017644>
1934
1935         Reviewed by Dan Bernstein.
1936
1937         * Configurations/FeatureDefines.xcconfig:
1938
1939 2018-03-20  Chris Dumez  <cdumez@apple.com>
1940
1941         Unreviewed, rolling out r229726 and r229763.
1942
1943         Caused some API test failures on iOS
1944
1945         Reverted changesets:
1946
1947         "Make policy decisions asynchronous"
1948         https://bugs.webkit.org/show_bug.cgi?id=180568
1949         https://trac.webkit.org/changeset/229726
1950
1951         "Rebaseline three webarchive tests for WK2 after r229726."
1952         https://bugs.webkit.org/show_bug.cgi?id=180568
1953         https://trac.webkit.org/changeset/229763
1954
1955 2018-03-20  Brent Fulgham  <bfulgham@apple.com>
1956
1957         [iOS] Grant IOKit preference access for the Home button
1958         https://bugs.webkit.org/show_bug.cgi?id=183754
1959         <rdar://problem/38179704>
1960
1961         Reviewed by Eric Carlson.
1962
1963         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1964
1965 2018-03-20  Wenson Hsieh  <wenson_hsieh@apple.com>
1966
1967         [Extra zoom mode] Adopt updated input view controller machinery for text input
1968         https://bugs.webkit.org/show_bug.cgi?id=183765
1969         <rdar://problem/36926269>
1970
1971         Reviewed by Tim Horton.
1972
1973         Adopt new classes for extra zoomed text inputs. Massage WKTextInputViewController into WKTextInputListView-
1974         Controller and introduce WKFormControlListViewController, the eventual replacement for the base class
1975         WKTextFormControlViewController that will act as the base class of all list-view-controller-based input UI in
1976         extra zoom mode.
1977
1978         * UIProcess/ios/WKContentViewInteraction.h:
1979         * UIProcess/ios/WKContentViewInteraction.mm:
1980         (-[WKContentView presentTextInputViewController:]):
1981         (-[WKContentView dismissTextInputViewController:]):
1982         (-[WKContentView focusedFormControllerDidUpdateSuggestions:]):
1983         (-[WKContentView _wheelChangedWithEvent:]):
1984         * UIProcess/ios/forms/WKFormControlListViewController.h: Copied from Source/WebKit/UIProcess/ios/forms/WKTextInputViewController.h.
1985         * UIProcess/ios/forms/WKFormControlListViewController.mm: Renamed from Source/WebKit/UIProcess/ios/forms/WKTextInputViewController.mm.
1986         * UIProcess/ios/forms/WKTextInputListViewController.h: Copied from Source/WebKit/UIProcess/ios/forms/WKTextInputViewController.h.
1987         * UIProcess/ios/forms/WKTextInputListViewController.mm: Renamed from Source/WebKit/UIProcess/ios/forms/WKTextInputViewController.h.
1988         * WebKit.xcodeproj/project.pbxproj:
1989
1990 2018-03-19  Megan Gardner  <megan_gardner@apple.com>
1991
1992         Clear style colors when setting default appearance
1993         https://bugs.webkit.org/show_bug.cgi?id=183759
1994
1995         Reviewed by Tim Horton.
1996
1997         Colors are cached and need to be cleared and recalculated.
1998
1999         * WebProcess/WebPage/WebPage.cpp:
2000         (WebKit::WebPage::setDefaultAppearance):
2001
2002 2018-03-19  Chris Dumez  <cdumez@apple.com>
2003
2004         WKWebView.ClearAppCache is a flaky API test failure on High Sierra.
2005         https://bugs.webkit.org/show_bug.cgi?id=181546
2006         <rdar://problem/36444327>
2007
2008         Reviewed by Ryosuke Niwa.
2009
2010         in LocalStorageDatabaseTracker::deleteDatabasesModifiedSince(), add origin
2011         to originIdentifiersToDelete if we cannot determine the last modification
2012         time of the database file. This likely means the database file does not
2013         exist. However, we still needs to make sure the origin gets removed from
2014         the origins database and there may be *.wal / *.shm variants of the database
2015         that are still on disk and need to be deleted.
2016
2017         * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
2018         (WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince):
2019
2020 2018-03-19  Chris Dumez  <cdumez@apple.com>
2021
2022         Have one service worker process per security origin
2023         https://bugs.webkit.org/show_bug.cgi?id=183600
2024         <rdar://problem/35280128>
2025
2026         Reviewed by Brady Eidson.
2027
2028         Split service workers from different origins into their own processes
2029         for security reasons.
2030
2031         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2032         (WebKit::WebSWServerConnection::startFetch):
2033         (WebKit::WebSWServerConnection::postMessageToServiceWorker):
2034         (WebKit::WebSWServerConnection::scheduleJobInServer):
2035         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
2036         (WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
2037         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
2038         * StorageProcess/StorageProcess.cpp:
2039         (WebKit::StorageProcess::connectionToContextProcessFromIPCConnection):
2040         (WebKit::StorageProcess::didClose):
2041         (WebKit::StorageProcess::connectionToContextProcessWasClosed):
2042         (WebKit::StorageProcess::needsServerToContextConnectionForOrigin const):
2043         (WebKit::StorageProcess::didReceiveMessage):
2044         (WebKit::StorageProcess::createStorageToWebProcessConnection):
2045         (WebKit::StorageProcess::serverToContextConnectionForOrigin):
2046         (WebKit::StorageProcess::createServerToContextConnection):
2047         * StorageProcess/StorageProcess.h:
2048         * StorageProcess/StorageProcess.messages.in:
2049         * StorageProcess/StorageToWebProcessConnection.cpp:
2050         (WebKit::StorageToWebProcessConnection::didReceiveMessage):
2051         (WebKit::StorageToWebProcessConnection::didClose):
2052         * StorageProcess/StorageToWebProcessConnection.h:
2053         * UIProcess/API/C/WKContext.cpp:
2054         (WKContextTerminateServiceWorkerProcess):
2055         * UIProcess/API/Cocoa/WKProcessPool.mm:
2056         (-[WKProcessPool _terminateServiceWorkerProcesses]):
2057         (-[WKProcessPool _webPageContentProcessCount]):
2058         (-[WKProcessPool _serviceWorkerProcessCount]):
2059         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2060         * UIProcess/Network/NetworkProcessProxy.cpp:
2061         (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
2062         (WebKit::NetworkProcessProxy::canAuthenticateAgainstProtectionSpace):
2063         * UIProcess/ServiceWorkerProcessProxy.cpp:
2064         (WebKit::ServiceWorkerProcessProxy::create):
2065         (WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
2066         * UIProcess/ServiceWorkerProcessProxy.h:
2067         (isType):
2068         * UIProcess/Storage/StorageProcessProxy.cpp:
2069         (WebKit::StorageProcessProxy::getStorageProcessConnection):
2070         (WebKit::StorageProcessProxy::didFinishLaunching):
2071         (WebKit::StorageProcessProxy::establishWorkerContextConnectionToStorageProcess):
2072         (WebKit::StorageProcessProxy::establishWorkerContextConnectionToStorageProcessForExplicitSession):
2073         * UIProcess/Storage/StorageProcessProxy.h:
2074         * UIProcess/Storage/StorageProcessProxy.messages.in:
2075         * UIProcess/WebProcessPool.cpp:
2076         (WebKit::WebProcessPool::getStorageProcessConnection):
2077         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
2078         (WebKit::WebProcessPool::createNewWebProcess):
2079         (WebKit::WebProcessPool::disconnectProcess):
2080         (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
2081         (WebKit::WebProcessPool::createWebPage):
2082         (WebKit::WebProcessPool::updateServiceWorkerUserAgent):
2083         (WebKit::WebProcessPool::mayHaveRegisteredServiceWorkers):
2084         (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
2085         (WebKit::WebProcessPool::terminateServiceWorkerProcesses):
2086         (WebKit::WebProcessPool::updateProcessAssertions):
2087         (WebKit::WebProcessPool::serviceWorkerProcessProxyFromPageID const):
2088         * UIProcess/WebProcessPool.h:
2089         * UIProcess/WebProcessProxy.cpp:
2090         (WebKit::WebProcessProxy::getStorageProcessConnection):
2091
2092 2018-03-19  Jiewen Tan  <jiewen_tan@apple.com>
2093
2094         Unreviewed, another quick fix for r229699
2095
2096         Restricts ENABLE_WEB_AUTHN to only macOS and iOS.
2097
2098         * Configurations/FeatureDefines.xcconfig:
2099
2100 2018-03-19  Chris Dumez  <cdumez@apple.com>
2101
2102         Make policy decisions asynchronous
2103         https://bugs.webkit.org/show_bug.cgi?id=180568
2104         <rdar://problem/37131297>
2105
2106         Reviewed by Alex Christensen.
2107
2108         Get rid of synchronous IPC and synchronous code paths for policy delegates.
2109         Policy decisions are now all made asynchronously and rely on asynchronous
2110         IPC.
2111
2112         This code change is based on work by Alex Christensen.
2113
2114         * UIProcess/WebPageProxy.cpp:
2115         (WebKit::WebPageProxy::receivedPolicyDecision):
2116         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2117         (WebKit::WebPageProxy::decidePolicyForResponse):
2118         * UIProcess/WebPageProxy.h:
2119         * UIProcess/WebPageProxy.messages.in:
2120         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2121         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
2122         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2123
2124 2018-03-19  Brian Burg  <bburg@apple.com>
2125
2126         Web Inspector: clean up WKWebView configuration code
2127         https://bugs.webkit.org/show_bug.cgi?id=183747
2128         <rdar://problem/38629343>
2129
2130         Reviewed by Timothy Hatcher.
2131
2132         * UIProcess/mac/WKInspectorViewController.mm:
2133         (-[WKInspectorViewController webView]): Always use system
2134         appearance for Inspector's web content.
2135
2136 2018-03-19  Eric Carlson  <eric.carlson@apple.com>
2137
2138         [Extra zoom mode] Require fullscreen for video playback
2139         https://bugs.webkit.org/show_bug.cgi?id=183742
2140         <rdar://problem/38235862>
2141
2142         Reviewed by Jer Noble.
2143
2144         * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
2145         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
2146         (-[WKVideoFullScreenViewController initWithAVPlayerViewController:]):
2147         (-[WKVideoFullScreenViewController viewDidLoad]):
2148         (-[WKVideoFullScreenViewController prefersStatusBarHidden]):
2149         (WebKit::VideoFullscreenModelContext::presentingViewController):
2150         (WebKit::VideoFullscreenModelContext::createVideoFullscreenViewController):
2151         * WebProcess/cocoa/VideoFullscreenManager.mm:
2152         (WebKit::VideoFullscreenManager::didEnterFullscreen):
2153
2154 2018-03-19  Daniel Bates  <dabates@apple.com>
2155
2156         test-webkitpy no longer runs WebKit2 tests
2157         https://bugs.webkit.org/show_bug.cgi?id=183724
2158
2159         Reviewed by Alexey Proskuryakov.
2160
2161         Fixes an issue where Python emits errors "global name reset_results is not defined" when
2162         running tests in messages_unittest.py using test-webkitpy.
2163
2164         Currently messages_unittest.py conditionally defines the global variable reset_results
2165         when run as the main program (i.e. __name__ == "__main__"). When messages_unittest.py is
2166         imported as a module as test-webkitpy does then it is not considered the main program
2167         ;=> the top-level script environment is not __main__ ;=> we do not define the global
2168         variable reset_results. Instead we should unconditionally define the global variable
2169         reset_results.
2170
2171         * Scripts/webkit/messages_unittest.py:
2172
2173 2018-03-19  Per Arne Vollan  <pvollan@apple.com>
2174
2175         When the WebContent process is blocked from accessing the WindowServer, the call CVDisplayLinkCreateWithCGDisplay will fail.
2176         https://bugs.webkit.org/show_bug.cgi?id=183604
2177         <rdar://problem/38305109>
2178
2179         Reviewed by Brent Fulgham.
2180
2181         * UIProcess/WebPageProxy.h:
2182         * UIProcess/WebPageProxy.messages.in:
2183         * UIProcess/mac/DisplayLink.cpp: Added.
2184         (WebKit::DisplayLink::DisplayLink):
2185         (WebKit::DisplayLink::~DisplayLink):
2186         (WebKit::DisplayLink::displayLinkCallback):
2187         * UIProcess/mac/DisplayLink.h: Added.
2188         * UIProcess/mac/WebPageProxyMac.mm:
2189         (WebKit::WebPageProxy::startDisplayRefreshMonitor):
2190         (WebKit::WebPageProxy::stopDisplayRefreshMonitor):
2191         * WebKit.xcodeproj/project.pbxproj:
2192         * WebProcess/WebPage/DrawingArea.cpp:
2193         (WebKit::DrawingArea::createDisplayRefreshMonitor):
2194         * WebProcess/WebPage/DrawingArea.h:
2195         * WebProcess/WebPage/DrawingArea.messages.in:
2196         * WebProcess/WebPage/mac/DrawingAreaMac.cpp: Added.
2197         (WebKit::DisplayRefreshMonitorMac::create):
2198         (WebKit::DisplayRefreshMonitorMac::DisplayRefreshMonitorMac):
2199         (WebKit::DisplayRefreshMonitorMac::~DisplayRefreshMonitorMac):
2200         (WebKit::DisplayRefreshMonitorMac::requestRefreshCallback):
2201         (WebKit::DisplayRefreshMonitorMac::displayLinkFired):
2202         (WebKit::DrawingArea::screenWasRefreshed):
2203         (WebKit::DrawingArea::createDisplayRefreshMonitor):
2204
2205 2018-03-17  Jiewen Tan  <jiewen_tan@apple.com>
2206
2207         [WebAuthN] Implement authenticatorMakeCredential
2208         https://bugs.webkit.org/show_bug.cgi?id=183527
2209         <rdar://problem/35275886>
2210
2211         Reviewed by Brent Fulgham.
2212
2213         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.cpp:
2214         (WebKit::WebCredentialsMessengerProxy::WebCredentialsMessengerProxy):
2215         (WebKit::WebCredentialsMessengerProxy::makeCredential):
2216         (WebKit::WebCredentialsMessengerProxy::getAssertion):
2217         (WebKit::WebCredentialsMessengerProxy::isUserVerifyingPlatformAuthenticatorAvailable):
2218         (WebKit::WebCredentialsMessengerProxy::exceptionReply):
2219         (WebKit::WebCredentialsMessengerProxy::makeCredentialReply):
2220         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.h:
2221         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.messages.in:
2222         * UIProcess/CredentialManagement/cocoa/WebCredentialsMessengerProxyCocoa.mm: Removed.
2223         * WebKit.xcodeproj/project.pbxproj:
2224         * WebProcess/CredentialManagement/WebCredentialsMessenger.cpp:
2225         (WebKit::WebCredentialsMessenger::makeCredential):
2226         (WebKit::WebCredentialsMessenger::makeCredentialReply):
2227         * WebProcess/CredentialManagement/WebCredentialsMessenger.h:
2228         * WebProcess/CredentialManagement/WebCredentialsMessenger.messages.in:
2229
2230 2018-03-17  Daniel Bates  <dabates@apple.com>
2231
2232         Tests fail in messages_unittest.py
2233         https://bugs.webkit.org/show_bug.cgi?id=183725
2234
2235         Partial revert of r222113. The messages generator machinery does not know when
2236         it is sufficient to emit an include for wtf/Forward.h as opposed to a concrete
2237         header.
2238
2239         * Scripts/webkit/LegacyMessages-expected.h:
2240         * Scripts/webkit/Messages-expected.h:
2241
2242 2018-03-16  Wenson Hsieh  <wenson_hsieh@apple.com>
2243
2244         Unreviewed, rolling out r229688.
2245
2246         There's a solution that doesn't require this SPI.
2247
2248         Reverted changeset:
2249
2250         "Add SPI to expose width and height anchors for WKWebView's
2251         content view"
2252         https://bugs.webkit.org/show_bug.cgi?id=183711
2253         https://trac.webkit.org/changeset/229688
2254
2255 2018-03-16  Wenson Hsieh  <wenson_hsieh@apple.com>
2256
2257         Add SPI to expose width and height anchors for WKWebView's content view
2258         https://bugs.webkit.org/show_bug.cgi?id=183711
2259         <rdar://problem/38562899>
2260
2261         Reviewed by Tim Horton.
2262
2263         Add _contentWidthAnchor and _contentHeightAnchor SPI to WKWebView for internal clients to be able to reason
2264         about the size of the content view on iOS using autolayout.
2265
2266         Test: WebKit.AutoLayoutPositionHeaderAndFooterViewsInScrollView.
2267
2268         * UIProcess/API/Cocoa/WKWebView.mm:
2269         (-[WKWebView _contentWidthAnchor]):
2270         (-[WKWebView _contentHeightAnchor]):
2271         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2272
2273 2018-03-16  Megan Gardner  <megan_gardner@apple.com>
2274
2275         Add _useSystemAppearance to WKView
2276         https://bugs.webkit.org/show_bug.cgi?id=183706
2277         <rdar://problem/38516584>
2278
2279         Reviewed by Tim Horton.
2280
2281         Plumb useSystemAppearance and other supporting functions to WKView
2282
2283         * UIProcess/API/Cocoa/WKViewPrivate.h:
2284         * UIProcess/API/Cocoa/WKWebView.mm:
2285         (-[WKWebView _initializeWithConfiguration:]):
2286         (-[WKWebView _useSystemAppearance]):
2287         (-[WKWebView _setUseSystemAppearance:]):
2288         (-[WKWebView effectiveAppearanceDidChange]):
2289         * UIProcess/API/mac/WKView.mm:
2290         (-[WKView effectiveAppearanceDidChange]):
2291         (-[WKView _setUseSystemAppearance:]):
2292         (-[WKView _useSystemAppearance]):
2293         (-[WKView _setDefaultAppearance:]):
2294         * UIProcess/Cocoa/WebViewImpl.h:
2295         * UIProcess/Cocoa/WebViewImpl.mm:
2296         (WebKit::WebViewImpl::setUseSystemAppearance):
2297         (WebKit::WebViewImpl::useSystemAppearance):
2298         (WebKit::WebViewImpl::setDefaultAppearance):
2299
2300 2018-03-16  Brent Fulgham  <bfulgham@apple.com>
2301
2302         Set a trap to catch an infrequent form-related nullptr crash
2303         https://bugs.webkit.org/show_bug.cgi?id=183704
2304         <rdar://problem/37579354>
2305
2306         Reviewed by Ryosuke Niwa.
2307
2308         Add a RELEASE_ASSERT to see if we ever encounter a nullptr WebCore frame.
2309
2310         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2311         (WebKit::WebFrameLoaderClient::dispatchWillSubmitForm):
2312
2313 2018-03-16  Jer Noble  <jer.noble@apple.com>
2314
2315         Make Fullscreen API an Experimental Feature
2316         https://bugs.webkit.org/show_bug.cgi?id=183662
2317
2318         Reviewed by Jon Lee.
2319
2320         Add the ability to have a conditional for whether an Experimental Feature is "visible", separate from
2321         whether the preference is available, for definining platform-specific Experimental Features.
2322
2323         * Scripts/GeneratePreferences.rb:
2324         * Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb:
2325         * Shared/WebPreferences.yaml:
2326
2327 2018-03-16  Megan Gardner  <megan_gardner@apple.com>
2328
2329         Ensure that style is updated when the effective appearance changes
2330         https://bugs.webkit.org/show_bug.cgi?id=183690
2331         <rdar://problem/38385900>
2332
2333         Reviewed by Tim Horton and Wenson Hsieh.
2334
2335         Respond to and respect the effective appearance changing.
2336
2337         * UIProcess/API/Cocoa/WKWebView.mm:
2338         (-[WKWebView effectiveAppearanceDidChange]):
2339         * WebProcess/WebPage/WebPage.cpp:
2340         (WebKit::WebPage::setDefaultAppearance):
2341
2342 2018-03-16  Chris Dumez  <cdumez@apple.com>
2343
2344         URLSchemeHandler.Basic API test fails with async policy delegates
2345         https://bugs.webkit.org/show_bug.cgi?id=183678
2346
2347         Reviewed by Alex Christensen.
2348
2349         The issue is that the client calls _didPerformRedirection / didReceiveResponse / didReceiveData / didFinish
2350         on the URLScheme task one after the one, synchronously. However, redirects and responses can be processed
2351         asynchronously. To address the issue, we now queue operations requested by the client if we're waiting
2352         for an async policy delegate.
2353
2354         * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp:
2355         (WebKit::WebURLSchemeTaskProxy::didPerformRedirection):
2356         (WebKit::WebURLSchemeTaskProxy::didReceiveResponse):
2357         (WebKit::WebURLSchemeTaskProxy::didReceiveData):
2358         (WebKit::WebURLSchemeTaskProxy::didComplete):
2359         (WebKit::WebURLSchemeTaskProxy::processNextPendingTask):
2360         * WebProcess/WebPage/WebURLSchemeTaskProxy.h:
2361         (WebKit::WebURLSchemeTaskProxy::queueTask):
2362
2363 2018-03-16  Claudio Saavedra  <csaavedra@igalia.com>
2364
2365         Suppress GCC warnings by using #include instead of #import
2366
2367         Unreviewed.
2368         * UIProcess/SystemPreviewController.cpp:
2369
2370 2018-03-15  Keith Rollin  <krollin@apple.com>
2371
2372         Telemetry for stalled webpage loads
2373         https://bugs.webkit.org/show_bug.cgi?id=183221
2374         <rdar://problem/36549013>
2375
2376         Reviewed by Chris Dumez.
2377
2378         Add telemetry for page loads, tracking the pages that succeed, fail,
2379         or are canceled. This information will be used to track the overall
2380         health of our page loading as time goes on.
2381
2382         * UIProcess/WebPageProxy.cpp:
2383         (WebKit::WebPageProxy::close):
2384         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
2385         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
2386         (WebKit::WebPageProxy::didFinishLoadForFrame):
2387         (WebKit::WebPageProxy::didFailLoadForFrame):
2388         (WebKit::WebPageProxy::reportPageLoadResult):
2389         * UIProcess/WebPageProxy.h:
2390         (WebKit::WebPageProxy::reportPageLoadResult):
2391
2392 2018-03-15  Wenson Hsieh  <wenson_hsieh@apple.com>
2393
2394         [iOS WK2] Hit-testing fails when specifying a large top content inset
2395         https://bugs.webkit.org/show_bug.cgi?id=183648
2396         <rdar://problem/38421894>
2397
2398         Reviewed by Tim Horton.
2399
2400         Currently, in the process of computing unobscured content rect in the UI process on iOS, we subtract away parts
2401         of the view that are obscured by insets (e.g. MobileSafari's chrome). The helper method -[WKWebView
2402         _computeContentInset] is intended to compute these obscuring insets around the view, but it takes scroll view
2403         insets into account. This means that if WKWebView's inner scroll view has content insets, we'll end up shrinking
2404         the unobscured content rect as if the insetted region obscures the viewport; this causes visible content on the
2405         page to be uninteractible, since WKWebView erroneously thinks it's obscured.
2406
2407         To address this, we rename _computeContentInset to _computeObscuredInset, and make it _not_ affected by the
2408         scroll view's content insets. From code inspection and testing, all but one of the former call sites of
2409         _computeContentInset really need the obscured inset instead (see below). The one exception, -[WKWebView
2410         _adjustedContentOffset:], takes a scroll position from the page and maps it to a content offset in the inner
2411         UIScrollView (see below for more details).
2412
2413         Tests:  ScrollViewInsetTests.InnerHeightWithLargeTopContentInset
2414                 ScrollViewInsetTests.InnerHeightWithLargeBottomContentInset
2415                 ScrollViewInsetTests.RestoreInitialContentOffsetAfterCrash
2416                 ScrollViewInsetTests.RestoreInitialContentOffsetAfterNavigation
2417
2418         * UIProcess/API/Cocoa/WKWebView.mm:
2419         (-[WKWebView _setHasCustomContentView:loadedMIMEType:]):
2420         (-[WKWebView _initialContentOffsetForScrollView]):
2421
2422         See -_contentOffsetAdjustedForObscuredInset: below.
2423
2424         (-[WKWebView _contentOffsetAdjustedForObscuredInset:]):
2425
2426         Formerly -_adjustedContentOffset:. -_contentOffsetAdjustedForObscuredInset: no longer takes scroll view content
2427         inset into account, and only cares about insets that obscure the view. This means that the scroll position
2428         (0, 0) in the document now maps to the content offset in the inner UIScrollView, such that the top of the page
2429         is aligned with the top of the viewport.
2430
2431         However, many call sites of -_adjustedContentOffset: were intended to compute the initial, top-left-most content
2432         offset in the scroll view to scroll to when resetting the web view (i.e., they pass in CGPointZero for the
2433         scroll position). An example of this is the scroll position to jump to after web content process termination, or
2434         the scroll position after main frame navigation. In these cases, we actually want to jump to the top of the
2435         scroll view, so we do want to use the version of the computed content insets that accounts for scroll view
2436         insets.
2437
2438         Since these cases are limited to finding the top-left-most scroll position, we pull this out into a separate
2439         helper method (-_initialContentOffsetForScrollView) and replace calls to
2440         `-[self _adjustedContentOffset:CGPointZero]` with this instead.
2441
2442         (-[WKWebView _computedObscuredInset]):
2443
2444         A version of -_computeContentInset that doesn't care about scroll view insets. Used whereever we need to account
2445         for obscured insets rather than the combination of content insets and unobscured insets (e.g.
2446         -_initialContentOffsetForScrollView).
2447
2448         (-[WKWebView _processDidExit]):
2449         (-[WKWebView _didCommitLayerTree:]):
2450         (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:nextValidLayerTreeTransactionID:]):
2451         (-[WKWebView _scrollToContentScrollPosition:scrollOrigin:]):
2452         (-[WKWebView scrollViewWillEndDragging:withVelocity:targetContentOffset:]):
2453         (-[WKWebView _updateVisibleContentRects]):
2454         (-[WKWebView _navigationGestureDidBegin]):
2455
2456         In all these places where we inset the view bounds to compute the unobscured region of the viewport, it doesn't
2457         make sense to additionally inset by the scroll view's content insets, since (1) the scroll view's content insets
2458         don't obscure the viewport, and (2) it's perfectly valid for the inner scroll view to have arbitrarily large
2459         content insets.
2460
2461         (-[WKWebView _adjustedContentOffset:]): Deleted.
2462
2463         Renamed to -_contentOffsetAdjustedForObscuredInset:.
2464
2465         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2466         * UIProcess/ios/WKPDFView.mm:
2467         (-[WKPDFView _offsetForPageNumberIndicator]):
2468
2469         Similar to -_scrollToFragment: (see below).
2470
2471         (-[WKPDFView _scrollToFragment:]):
2472
2473         This helper figures out which content offset to scroll to, given the y-origin of a page in a PDF document. If
2474         insets are added to the scroll view, we end up scrolling to the wrong content offset since we'll add the height
2475         of the top content inset (imagine that the top content inset is enormous — then we'll scroll an amount equal to
2476         the top content inset _past_ the point where the y-origin of the page is at the top of the viewport).
2477
2478 2018-03-15  Brent Fulgham  <bfulgham@apple.com>
2479
2480         [macOS] Correct sandbox violations during Flash playback under ToT WebKit
2481         https://bugs.webkit.org/show_bug.cgi?id=183672
2482         <rdar://problem/38510839>
2483
2484         Reviewed by Eric Carlson.
2485
2486         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
2487         * WebProcess/com.apple.WebProcess.sb.in:
2488
2489 2018-03-15  Brent Fulgham  <bfulgham@apple.com>
2490
2491         REGRESSION(r229484): Plugins often require CGS Connections to draw
2492         https://bugs.webkit.org/show_bug.cgi?id=183663
2493         <rdar://problem/38439218>
2494
2495         Reviewed by Per Arne Vollan.
2496
2497         Flash requires an active CGSConnection to work properly. Since we don't want the WebContent
2498         process to have on, create a new plugin process-specific layer host creation method that
2499         gives this access.
2500
2501         * Platform/mac/LayerHostingContext.h:
2502         * Platform/mac/LayerHostingContext.mm:
2503         (WebKit::LayerHostingContext::createForExternalPluginHostingProcess): Added.
2504         * PluginProcess/mac/PluginControllerProxyMac.mm:
2505         (WebKit::PluginControllerProxy::updateLayerHostingContext): Use the new creation
2506         method.
2507
2508 2018-03-15  Zan Dobersek  <zdobersek@igalia.com>
2509
2510         [TexMap] Remove TextureMapperLayer::texture()
2511         https://bugs.webkit.org/show_bug.cgi?id=183635
2512
2513         Reviewed by Michael Catanzaro.
2514
2515         Remove the CoordinatedBackingStore::texture() override since the virtual
2516         method is also being removed.
2517
2518         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
2519         (WebKit::CoordinatedBackingStore::texture const): Deleted.
2520         * Shared/CoordinatedGraphics/CoordinatedBackingStore.h:
2521
2522 2018-03-14  John Wilander  <wilander@apple.com>
2523
2524         Resource Load Statistics: Add clearing of storage access to WebResourceLoadStatisticsStore::clearInMemory()
2525         https://bugs.webkit.org/show_bug.cgi?id=183641
2526         <rdar://problem/38469497>
2527
2528         Reviewed by Brent Fulgham and Chris Dumez.
2529
2530         This change is to stabilize existing layout tests by removing
2531         all storage access entries on a call to 
2532         WebResourceLoadStatisticsStore::clearInMemory().
2533         See Ryan Haddad's comment in https://bugs.webkit.org/show_bug.cgi?id=183620.
2534
2535         Almost all of the code changes are piping to get this
2536         call from the WebResourceLoadStatisticsStore to
2537         WebCore::NetworkStorageSession where entries reside.
2538
2539         * NetworkProcess/NetworkProcess.cpp:
2540         (WebKit::NetworkProcess::removeAllStorageAccess):
2541         * NetworkProcess/NetworkProcess.h:
2542         * NetworkProcess/NetworkProcess.messages.in:
2543         * UIProcess/Network/NetworkProcessProxy.cpp:
2544         (WebKit::NetworkProcessProxy::removeAllStorageAccess):
2545         * UIProcess/Network/NetworkProcessProxy.h:
2546         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2547         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
2548         (WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess):
2549         (WebKit::WebResourceLoadStatisticsStore::clearInMemory):
2550             Now also clears all storage access entries in the network process.
2551         * UIProcess/WebResourceLoadStatisticsStore.h:
2552         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2553         (WebKit::WebsiteDataStore::removeAllStorageAccessHandler):
2554         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
2555         * UIProcess/WebsiteData/WebsiteDataStore.h:
2556
2557 2018-03-14  Ryan Haddad  <ryanhaddad@apple.com>
2558
2559         Unreviewed, rolling out r229613.
2560
2561         Caused API test failures
2562
2563         Reverted changeset:
2564
2565         "Make policy decisions asynchronous"
2566         https://bugs.webkit.org/show_bug.cgi?id=180568
2567         https://trac.webkit.org/changeset/229613
2568
2569 2018-03-14  Chris Dumez  <cdumez@apple.com>
2570
2571         Reduce use of SWServerToContextConnection::globalServerToContextConnection()
2572         https://bugs.webkit.org/show_bug.cgi?id=183626
2573
2574         Reviewed by Youenn Fablet.
2575
2576         Reduce use of SWServerToContextConnection::globalServerToContextConnection() as we are moving
2577         towards having multiple context connections.
2578
2579         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2580         (WebKit::WebSWServerConnection::startFetch):
2581         (WebKit::WebSWServerConnection::postMessageToServiceWorker):
2582
2583 2018-03-14  Chris Dumez  <cdumez@apple.com>
2584
2585         Make policy decisions asynchronous
2586         https://bugs.webkit.org/show_bug.cgi?id=180568
2587         <rdar://problem/37131297>
2588
2589         Reviewed by Alex Christensen.
2590
2591         Get rid of synchronous IPC and synchronous code paths for policy delegates.
2592         Policy decisions are now all made asynchronously and rely on asynchronous
2593         IPC.
2594
2595         This code change is based on work by Alex Christensen.
2596
2597         * UIProcess/WebPageProxy.cpp:
2598         (WebKit::WebPageProxy::receivedPolicyDecision):
2599         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2600         (WebKit::WebPageProxy::decidePolicyForResponse):
2601         * UIProcess/WebPageProxy.h:
2602         * UIProcess/WebPageProxy.messages.in:
2603         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2604         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
2605         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2606
2607 2018-03-14  Chris Dumez  <cdumez@apple.com>
2608
2609         Drop unnecessary StorageToWebProcessConnection::workerContextProcessConnectionCreated()
2610         https://bugs.webkit.org/show_bug.cgi?id=183624
2611
2612         Reviewed by Youenn Fablet.
2613
2614         Drop unnecessary StorageToWebProcessConnection::workerContextProcessConnectionCreated()
2615         since it was going through all SWServers. Calling workerContextProcessConnectionCreated()
2616         on every StorageToWebProcessConnection was thus doing redundant work.
2617
2618         * StorageProcess/StorageProcess.cpp:
2619         (WebKit::StorageProcess::createStorageToWebProcessConnection):
2620         * StorageProcess/StorageToWebProcessConnection.cpp:
2621         (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
2622         (WebKit::StorageToWebProcessConnection::workerContextProcessConnectionCreated): Deleted.
2623         * StorageProcess/StorageToWebProcessConnection.h:
2624
2625 2018-03-14  Tim Horton  <timothy_horton@apple.com>
2626
2627         Fix the build after r229567
2628
2629         * Configurations/FeatureDefines.xcconfig:
2630
2631 2018-03-13  John Wilander  <wilander@apple.com>
2632
2633         Resource Load Statistics: Immediately forward cookie access for domains with previous user interaction when there's an opener document
2634         https://bugs.webkit.org/show_bug.cgi?id=183620
2635         <rdar://problem/38431469>
2636
2637         Reviewed by Brent Fulgham.
2638
2639         It turns out the fix in https://bugs.webkit.org/show_bug.cgi?id=183577
2640         wasn't enough to address the compatibility issues with popups. Some of
2641         them just detect their unpartitioned cookies, auto-dismiss themselves,
2642         and expect their unpartitioned cookies to be available under the opener
2643         afterwards. We should grant them access if the popup's domain has had
2644         user interaction _previously_.
2645
2646         Note that we still need https://bugs.webkit.org/show_bug.cgi?id=183577
2647         because if the popup's domain has not received user interaction
2648         previously, we will not grant it storage access on just the window open.
2649
2650         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2651         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
2652         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccessUnderOpener): Deleted.
2653             Renamed WebResourceLoadStatisticsStore::grantStorageAccessUnderOpener()
2654             to WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener()
2655             since there is now a case where access will not be granted, i.e. when
2656             the popup domain has not had user interaction previously.
2657         * UIProcess/WebResourceLoadStatisticsStore.h:
2658         * UIProcess/WebResourceLoadStatisticsStore.messages.in:
2659              Similar renaming.
2660         * WebProcess/WebProcess.cpp:
2661         (WebProcess::WebProcess):
2662              Similar renaming.
2663
2664 2018-03-13  Jer Noble  <jer.noble@apple.com>
2665
2666         Add missing artwork for fullscreen mode.
2667         https://bugs.webkit.org/show_bug.cgi?id=183618
2668
2669         Reviewed by Jon Lee.
2670
2671         * Resources/ios/iOS.xcassets/Done.imageset/Contents.json: Added.
2672         * Resources/ios/iOS.xcassets/Done.imageset/Done.pdf: Added.
2673         * Resources/ios/iOS.xcassets/StartPictureInPictureButton.imageset/Contents.json: Added.
2674         * Resources/ios/iOS.xcassets/StartPictureInPictureButton.imageset/StartPictureInPictureButton@1x.png: Added.
2675         * Resources/ios/iOS.xcassets/StartPictureInPictureButton.imageset/StartPictureInPictureButton@2x.png: Added.
2676         * Resources/ios/iOS.xcassets/StartPictureInPictureButton.imageset/StartPictureInPictureButton@3x.png: Added.
2677         * Resources/ios/iOS.xcassets/StopPictureInPictureButton.imageset/Contents.json: Added.
2678         * Resources/ios/iOS.xcassets/StopPictureInPictureButton.imageset/StopPictureInPictureButton@1x.png: Added.
2679         * Resources/ios/iOS.xcassets/StopPictureInPictureButton.imageset/StopPictureInPictureButton@2x.png: Added.
2680         * Resources/ios/iOS.xcassets/StopPictureInPictureButton.imageset/StopPictureInPictureButton@3x.png: Added.
2681
2682 2018-03-13  Brian Burg  <bburg@apple.com>
2683
2684         [WK2] Web Inspector: NavigationAction for opening a link in a new tab should have a UserGestureIndicator
2685         https://bugs.webkit.org/show_bug.cgi?id=183612
2686         <rdar://problem/38388641>
2687
2688         Reviewed by Timothy Hatcher.
2689
2690         The current gesture token will be attached to the NavigationAction at construction time,
2691         so set up a UserGestureIndicator when creating the action and sending it out.
2692
2693         * WebProcess/WebPage/WebInspector.cpp:
2694         (WebKit::WebInspector::openInNewTab):
2695
2696 2018-03-13  Dean Jackson  <dino@apple.com>
2697
2698         WKSystemPreviewView needs to implement some of UIScrollViewDelegate
2699         https://bugs.webkit.org/show_bug.cgi?id=183607
2700         <rdar://problem/38427622>
2701
2702         Reviewed by Antoine Quint.
2703
2704         Add an empty implementation of scrollViewDidScroll.
2705
2706         * UIProcess/ios/WKSystemPreviewView.mm:
2707         (-[WKSystemPreviewView scrollViewDidScroll:]):
2708
2709 2018-03-13  Jiewen Tan  <jiewen_tan@apple.com>
2710
2711         Soft-link LocalAuthentication.Framework
2712         https://bugs.webkit.org/show_bug.cgi?id=183587
2713         <rdar://problem/38219763>
2714
2715         Reviewed by Brian Burg.
2716
2717         * UIProcess/CredentialManagement/cocoa/WebCredentialsMessengerProxyCocoa.mm:
2718         (WebKit::WebCredentialsMessengerProxy::platformIsUserVerifyingPlatformAuthenticatorAvailable):
2719         * WebKit.xcodeproj/project.pbxproj:
2720
2721 2018-03-12  Dean Jackson  <dino@apple.com>
2722
2723         Add a WKWebViewContentProvider for system previews
2724         https://bugs.webkit.org/show_bug.cgi?id=183582
2725         <rdar://problem/38393569>
2726
2727         Reviewed by Tim Horton.
2728
2729         Implement WKSystemPreviewView, which conforms to WKWebViewContentProvider, in
2730         order to view content as a "system preview". This effectively replaces the
2731         SystemPreviewController, which will be removed soon.
2732
2733         Some of the required methods of WKWebViewContentProvider are not necessary on
2734         this instance, so a follow-up patch will clean the protocol up a bit.
2735
2736         * UIProcess/Cocoa/NavigationState.mm: Don't trigger a SystemPreview when downloading.
2737         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):
2738
2739         * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
2740         (-[WKWebViewContentProviderRegistry init]): Register the WKSystemPreviewView for
2741         MIME types retrieved from WebKitAdditions.
2742
2743         * UIProcess/ios/WKSystemPreviewView.h: Added.
2744         * UIProcess/ios/WKSystemPreviewView.mm: Added.
2745
2746         (-[WKSystemPreviewView web_initWithFrame:webView:]):
2747         (-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]): This is the
2748         method that actually creates a QuickLook preview and provides the data.
2749         (-[WKSystemPreviewView web_setMinimumSize:]):
2750         (-[WKSystemPreviewView web_setOverlaidAccessoryViewsInset:]):
2751         (-[WKSystemPreviewView web_computedContentInsetDidChange]):
2752         (-[WKSystemPreviewView web_setFixedOverlayView:]):
2753         (-[WKSystemPreviewView web_didSameDocumentNavigation:]):
2754         (-[WKSystemPreviewView web_countStringMatches:options:maxCount:]):
2755         (-[WKSystemPreviewView web_findString:options:maxCount:]):
2756         (-[WKSystemPreviewView web_hideFindUI]):
2757
2758         (-[WKSystemPreviewView numberOfPreviewItemsInPreviewController:]): QuickLook delegates.
2759         (-[WKSystemPreviewView previewController:previewItemAtIndex:]):
2760         (-[WKSystemPreviewView provideDataForItem:]):
2761         (-[WKSystemPreviewView previewControllerWillDismiss:]):
2762
2763         * WebKit.xcodeproj/project.pbxproj: Add new files.
2764
2765 2018-03-12  John Wilander  <wilander@apple.com>
2766
2767         Resource Load Statistics: Immediately forward cookie access at user interaction when there's an opener document
2768         https://bugs.webkit.org/show_bug.cgi?id=183577
2769         <rdar://problem/38266987>
2770
2771         Reviewed by Brent Fulgham.
2772
2773         * NetworkProcess/NetworkProcess.cpp:
2774         (WebKit::NetworkProcess::hasStorageAccessForFrame):
2775             Now also checks for general page access.
2776         (WebKit::NetworkProcess::grantStorageAccess):
2777             Renamed from grantStorageAccessForFrame since the frameID now is optional.
2778         (WebKit::NetworkProcess::grantStorageAccessForFrame): Deleted.
2779             Renamed since the frameID now is optional.
2780         * NetworkProcess/NetworkProcess.h:
2781             Renaming since the frameID now is optional.
2782         * NetworkProcess/NetworkProcess.messages.in:
2783             Renaming since the frameID now is optional.
2784         * NetworkProcess/NetworkResourceLoader.cpp:
2785         (WebKit::NetworkResourceLoader::logCookieInformation):
2786             Consequence of function renaming.
2787         * UIProcess/Network/NetworkProcessProxy.cpp:
2788         (WebKit::NetworkProcessProxy::grantStorageAccess):
2789         (WebKit::NetworkProcessProxy::grantStorageAccessForFrame): Deleted.
2790             Renaming since the frameID now is optional.
2791         * UIProcess/Network/NetworkProcessProxy.h:
2792         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2793         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
2794             Renaming since the frameID now is optional.
2795         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
2796             Handler renaming since the frameID now is optional.
2797         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccessUnderOpener):
2798             New function for that grants cookie access under a whole page.
2799         * UIProcess/WebResourceLoadStatisticsStore.h:
2800             Member renaming since the frameID now is optional.
2801         * UIProcess/WebResourceLoadStatisticsStore.messages.in:
2802             New message received straight from WebCore::ResourceLoadObserver.
2803         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2804         (WebKit::WebsiteDataStore::grantStorageAccessHandler):
2805             Renamed and made frameID optional.
2806         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
2807             Consequence of renaming and making frameID optional.
2808         (WebKit::WebsiteDataStore::grantStorageAccessForFrameHandler): Deleted.
2809             Renamed and made frameID optional.
2810         * UIProcess/WebsiteData/WebsiteDataStore.h:
2811         * WebProcess/WebProcess.cpp:
2812         (WebProcess::WebProcess):
2813             Now calls setGrantStorageAccessUnderOpenerCallback() on the shared
2814             WebCore::ResourceLoadObserver.
2815
2816 2018-03-12  Tim Horton  <timothy_horton@apple.com>
2817
2818         Stop using SDK conditionals to control feature definitions
2819         https://bugs.webkit.org/show_bug.cgi?id=183430
2820         <rdar://problem/38251619>
2821
2822         Reviewed by Dan Bernstein.
2823
2824         * Configurations/FeatureDefines.xcconfig:
2825         * Configurations/WebKitTargetConditionals.xcconfig: Renamed.
2826
2827 2018-03-12  Yoav Weiss  <yoav@yoav.ws>
2828
2829         Runtime flag for link prefetch and remove link subresource.
2830         https://bugs.webkit.org/show_bug.cgi?id=183540
2831
2832         Reviewed by Chris Dumez.
2833
2834         Remove the LINK_PREFETCH build time flag.
2835
2836         * Configurations/FeatureDefines.xcconfig:
2837         * WebProcess/Network/WebLoaderStrategy.cpp:
2838         (WebKit::maximumBufferingTime):
2839
2840 2018-03-12  Chris Dumez  <cdumez@apple.com>
2841
2842         Load may get committed before receiving policy for the resource response
2843         https://bugs.webkit.org/show_bug.cgi?id=183579
2844         <rdar://problem/38268780>
2845
2846         Reviewed by Youenn Fablet.
2847
2848         r228852 updated WebResourceLoader::didReceiveResponse to only send the
2849         ContinueDidReceiveResponse IPC back to the Networkprocess *after* the
2850         policy decision for the resource response has been made. This is necessary
2851         now that policy decisions can be made asynchronously.
2852
2853         However, one of the 2 code paths in NetworkProcess side (code path when
2854         the resource is already in the HTTP disk cache) failed to wait for the
2855         ContinueDidReceiveResponse IPC before sending over the data to the WebProcess.
2856         As a result, the WebProcess could commit the load before even receiving the
2857         policy response from the client.        
2858
2859         * NetworkProcess/NetworkResourceLoader.cpp:
2860         (WebKit::NetworkResourceLoader::continueDidReceiveResponse):
2861         (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
2862         (WebKit::NetworkResourceLoader::continueProcessingCachedEntryAfterDidReceiveResponse):
2863         * NetworkProcess/NetworkResourceLoader.h:
2864         Make sure NetworkResourceLoader::didRetrieveCacheEntry() does not start sending the data
2865         until the network process gets the ContinueDidReceiveResponse IPC back from the WebProcess.
2866
2867         * WebProcess/Network/WebResourceLoader.cpp:
2868         (WebKit::WebResourceLoader::didReceiveResponse):
2869         (WebKit::WebResourceLoader::didReceiveData):
2870         * WebProcess/Network/WebResourceLoader.h:
2871         Add assertion to make sure didReceiveData() never gets called before didReceiveResponse's
2872         completion handler has been called. If this hits, then the load may get committed even
2873         though the client did not reply to the policy for the resource response yet.
2874
2875 2018-03-12  Ali Juma  <ajuma@chromium.org>
2876
2877         http/tests/workers/service/service-worker-download.https.html times out with async policy delegates
2878         https://bugs.webkit.org/show_bug.cgi?id=183479
2879
2880         Reviewed by Youenn Fablet.
2881
2882         Ensure that ServiceWorkerFetchClient::m_isCheckingResponse is set before code that depends on it
2883         executes. This bit was set by code that's posted to the runloop using 'callOnMainThread' in
2884         ServiceWorkerFetchClient::didReceiveResponse. But when didReceiveResponse is executing, tasks for
2885         handling didReceiveData, didFail, or didFinish may already have been posted to the runloop, and in
2886         that case would execute before m_isCheckingResponse gets set, and then incorrectly fail to 
2887         early-out. Fix this by directly setting m_isCheckingResponse in didReceiveResponse.
2888
2889         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
2890         (WebKit::ServiceWorkerClientFetch::start):
2891         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
2892
2893 2018-03-12  Wenson Hsieh  <wenson_hsieh@apple.com>
2894
2895         REGRESSION(r211643): Dismissing WKActionSheet should not also dismiss its presenting view controller
2896         https://bugs.webkit.org/show_bug.cgi?id=183549
2897         <rdar://problem/34960698>
2898
2899         Reviewed by Andy Estes.
2900
2901         Fixes the bug by dismissing the presented view controller (i.e. the action sheet or the view controller being
2902         presented during rotation) rather than the presenting view controller.
2903
2904         Test: ActionSheetTests.DismissingActionSheetShouldNotDismissPresentingViewController
2905
2906         * UIProcess/ios/WKActionSheet.mm:
2907         (-[WKActionSheet doneWithSheet:]):
2908
2909 2018-03-12  Javier Fernandez  <jfernandez@igalia.com>
2910
2911         Remove GridLayout runtime flag
2912         https://bugs.webkit.org/show_bug.cgi?id=183484
2913
2914         Reviewed by Myles C. Maxfield.
2915
2916         The Grid Layout feature has been enabled by default for almost a
2917         year, so I think it's time to remove the runtime flag and the
2918         codepath run when the feature is disabled.
2919
2920         * Shared/WebPreferences.yaml:
2921         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2922         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2923
2924 2018-03-11  Wenson Hsieh  <wenson_hsieh@apple.com>
2925
2926         Fix the internal iOS build after r229512
2927         https://bugs.webkit.org/show_bug.cgi?id=183550
2928
2929         Reviewed by Zalan Bujtas.
2930
2931         Fixes a typo in a header import, as well as a nullability error. `SecTrustEvaluate()` takes in a nonnull outparam,
2932         which was removed in r229512; this adds the outparam back, but does not consult its value when setting the
2933         `infoDictionary`.
2934
2935         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
2936         (-[WKFullScreenWindowController _EVOrganizationName]):
2937
2938 2018-03-10  Jer Noble  <jer.noble@apple.com>
2939
2940         Improvements to fullscreen; new UI and security features
2941         https://bugs.webkit.org/show_bug.cgi?id=183503
2942
2943         Reviewed by Dean Jackson.
2944
2945         Now that the iOS Fullscreen code has more than one major class, move it into an ios/
2946         directory.
2947
2948         Clean up the WKFullScreenWindowControllerIOS class to more clearly separate external
2949         facing API from purely internal functions.
2950
2951         Move the WKFullScreenViewController out into its own file. Add support for fullscreen
2952         top inset and fullscreen autohide duration CSS constants.
2953
2954         Add a heuristic to distinguish between media control related touches and ones that look
2955         more keyboard interactions.
2956
2957         Add a new UIStackView based control to hold the fullscreen controls.
2958
2959         * UIProcess/ios/WKFullScreenWindowControllerIOS.mm: Removed.
2960         * UIProcess/ios/fullscreen/FullscreenTouchSecheuristic.cpp: Added.
2961         (WebKit::FullscreenTouchSecheuristic::scoreOfNextTouch):
2962         (WebKit::FullscreenTouchSecheuristic::reset):
2963         (WebKit::FullscreenTouchSecheuristic::distanceScore):
2964         (WebKit::FullscreenTouchSecheuristic::attenuationFactor):
2965         * UIProcess/ios/fullscreen/FullscreenTouchSecheuristic.h: 
2966         (WebKit::FullscreenTouchSecheuristic::setRampUpSpeed):
2967         (WebKit::FullscreenTouchSecheuristic::setRampDownSpeed):
2968         (WebKit::FullscreenTouchSecheuristic::setXWeight):
2969         (WebKit::FullscreenTouchSecheuristic::setYWeight):
2970         (WebKit::FullscreenTouchSecheuristic::setSize):
2971         (WebKit::FullscreenTouchSecheuristic::setGamma):
2972         (WebKit::FullscreenTouchSecheuristic::setGammaCutoff):
2973         * UIProcess/ios/fullscreen/WKFullScreenViewController.h:
2974         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm: Added.
2975         (WKFullScreenViewControllerPlaybackSessionModelClient::setParent):
2976         (WKFullScreenViewControllerPlaybackSessionModelClient::setInterface):
2977         (-[_WKExtrinsicButton setExtrinsicContentSize:]):
2978         (-[_WKExtrinsicButton intrinsicContentSize]):
2979         (-[WKFullScreenViewController initWithWebView:]):
2980         (-[WKFullScreenViewController dealloc]):
2981         (-[WKFullScreenViewController showUI]):
2982         (-[WKFullScreenViewController hideUI]):
2983         (-[WKFullScreenViewController videoControlsManagerDidChange]):
2984         (-[WKFullScreenViewController setPrefersStatusBarHidden:]):
2985         (-[WKFullScreenViewController setPlaying:]):
2986         (-[WKFullScreenViewController setPictureInPictureActive:]):
2987         (-[WKFullScreenViewController loadView]):
2988         (-[WKFullScreenViewController viewWillAppear:]):
2989         (-[WKFullScreenViewController viewDidLayoutSubviews]):
2990         (-[WKFullScreenViewController viewWillTransitionToSize:withTransitionCoordinator:]):
2991         (-[WKFullScreenViewController preferredStatusBarStyle]):
2992         (-[WKFullScreenViewController prefersStatusBarHidden]):
2993         (-[WKFullScreenViewController gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
2994         (-[WKFullScreenViewController gestureRecognizer:shouldReceiveTouch:]):
2995         (-[WKFullScreenViewController _manager]):
2996         (-[WKFullScreenViewController _effectiveFullscreenInsetTop]):
2997         (-[WKFullScreenViewController _cancelAction:]):
2998         (-[WKFullScreenViewController _togglePiPAction:]):
2999         (-[WKFullScreenViewController _touchDetected:]):
3000         (-[WKFullScreenViewController _statusBarFrameDidChange:]):
3001         (-[WKFullScreenViewController _updateWebViewFullscreenInsets]):
3002         (-[WKFullScreenViewController _showPhishingAlert]):
3003         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.h: Copied from Source/WebKit/UIProcess/ios/WKFullScreenWindowControllerIOS.h.
3004         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm: Added.
3005         (WebKit::replaceViewWithView):
3006         (WebKit::WKWebViewState::applyTo):
3007         (WebKit::WKWebViewState::store):
3008         (-[WKFullscreenAnimationController transitionDuration:]):
3009         (-[WKFullscreenAnimationController configureInitialAndFinalStatesForTransition:]):
3010         (-[WKFullscreenAnimationController animateTransition:]):
3011         (-[WKFullscreenAnimationController animationEnded:]):
3012         (-[WKFullscreenAnimationController startInteractiveTransition:]):
3013         (-[WKFullscreenAnimationController updateWithPercent:]):
3014         (-[WKFullscreenAnimationController updateWithPercent:translation:anchor:]):
3015         (-[WKFullscreenAnimationController end:]):
3016         (-[WKFullScreenInteractiveTransition initWithAnimator:anchor:]):
3017         (-[WKFullScreenInteractiveTransition wantsInteractiveStart]):
3018         (-[WKFullScreenInteractiveTransition startInteractiveTransition:]):
3019         (-[WKFullScreenInteractiveTransition updateInteractiveTransition:withTranslation:]):
3020         (-[WKFullScreenInteractiveTransition cancelInteractiveTransition]):
3021         (-[WKFullScreenInteractiveTransition finishInteractiveTransition]):
3022         (-[WKFullScreenWindowController initWithWebView:]):
3023         (-[WKFullScreenWindowController dealloc]):
3024         (-[WKFullScreenWindowController isFullScreen]):
3025         (-[WKFullScreenWindowController webViewPlaceholder]):
3026         (-[WKFullScreenWindowController enterFullScreen]):
3027         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
3028         (-[WKFullScreenWindowController requestExitFullScreen]):
3029         (-[WKFullScreenWindowController exitFullScreen]):
3030         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
3031         (-[WKFullScreenWindowController _completedExitFullScreen]):
3032         (-[WKFullScreenWindowController close]):
3033         (-[WKFullScreenWindowController webViewDidRemoveFromSuperviewWhileInFullscreen]):
3034         (-[WKFullScreenWindowController videoControlsManagerDidChange]):
3035         (-[WKFullScreenWindowController gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
3036         (-[WKFullScreenWindowController animationControllerForPresentedController:presentingController:sourceController:]):
3037         (-[WKFullScreenWindowController animationControllerForDismissedController:]):
3038         (-[WKFullScreenWindowController interactionControllerForDismissal:]):
3039         (-[WKFullScreenWindowController _exitFullscreenImmediately]):
3040         (-[WKFullScreenWindowController _invalidateEVOrganizationName]):
3041         (-[WKFullScreenWindowController _isSecure]):
3042         (-[WKFullScreenWindowController _serverTrust]):
3043         (-[WKFullScreenWindowController _EVOrganizationName]):
3044         (-[WKFullScreenWindowController _updateLocationInfo]):
3045         (-[WKFullScreenWindowController _manager]):
3046         (-[WKFullScreenWindowController _startToDismissFullscreenChanged:]):
3047         (-[WKFullScreenWindowController _interactiveDismissChanged:]):
3048         * UIProcess/ios/fullscreen/WKFullscreenStackView.h: Renamed from Source/WebKit/UIProcess/ios/WKFullScreenWindowControllerIOS.h.
3049         * UIProcess/ios/fullscreen/WKFullscreenStackView.mm: Added.
3050         (+[WKFullscreenStackView baseEffects]):
3051         (+[WKFullscreenStackView configureView:forTintEffectWithColor:filterType:]):
3052         (+[WKFullscreenStackView configureView:withBackgroundFillOfColor:opacity:filter:]):
3053         (+[WKFullscreenStackView secondaryMaterialOverlayView]):
3054         (+[WKFullscreenStackView applyPrimaryGlyphTintToView:]):
3055         (+[WKFullscreenStackView applySecondaryGlyphTintToView:]):
3056         (-[WKFullscreenStackView initWithArrangedSubviews:axis:]):
3057         (-[WKFullscreenStackView setTargetViewForSecondaryMaterialOverlay:]):
3058         (-[WKFullscreenStackView contentView]):
3059         (-[WKFullscreenStackView _setArrangedSubviews:axis:]):
3060         (-[WKFullscreenStackView setBounds:]):
3061         (-[WKFullscreenStackView updateConstraints]):
3062         * WebKit.xcodeproj/project.pbxproj:
3063
3064 2018-03-10  Megan Gardner  <megan_gardner@apple.com>
3065
3066         Media query for default appearance
3067         https://bugs.webkit.org/show_bug.cgi?id=183539
3068         <rdar://problem/38326388>
3069
3070         Reviewed by Tim Horton.
3071
3072         Write a media query to evaluate appearance.
3073
3074         * Shared/WebPageCreationParameters.cpp:
3075         (WebKit::WebPageCreationParameters::encode const):
3076         (WebKit::WebPageCreationParameters::decode):
3077         * Shared/WebPageCreationParameters.h:
3078         * UIProcess/API/Cocoa/WKWebView.mm:
3079         (-[WKWebView _initializeWithConfiguration:]):
3080         (-[WKWebView _setUseSystemAppearance:]):
3081         * UIProcess/WebPageProxy.cpp:
3082         (WebKit::WebPageProxy::creationParameters):
3083         (WebKit::WebPageProxy::setDefaultAppearance):
3084         * UIProcess/WebPageProxy.h:
3085         (WebKit::WebPageProxy::defaultAppearance const):
3086         * WebProcess/WebPage/WebPage.cpp:
3087         (WebKit::m_credentialsMessenger):
3088         (WebKit::WebPage::setDefaultAppearance):
3089         * WebProcess/WebPage/WebPage.h:
3090         * WebProcess/WebPage/WebPage.messages.in:
3091
3092 2018-03-09  Jer Noble  <jer.noble@apple.com>
3093
3094         Unconditionalize more methods in VideoFullscreenInterface (and related classes)
3095         https://bugs.webkit.org/show_bug.cgi?id=183501
3096         <rdar://problem/38312038>
3097
3098         Unreviewed build fix; add correct pragmas to code referencing m_playbackSessionManager.
3099
3100         * UIProcess/WebPageProxy.cpp:
3101         (WebKit::WebPageProxy::hasActiveVideoForControlsManager const):
3102         (WebKit::WebPageProxy::requestControlledElementID const):
3103         (WebKit::WebPageProxy::isPlayingVideoInEnhancedFullscreen const):
3104
3105 2018-03-09  Brian Burg  <bburg@apple.com>
3106
3107         Web Inspector: there should only be one way for async backend commands to send failure
3108         https://bugs.webkit.org/show_bug.cgi?id=183524
3109
3110         Reviewed by Timothy Hatcher.
3111
3112         Remove useless ErrorString argument from async commands.
3113
3114         For Automation protocol, introduce sync and async macros for filling
3115         in and sending a failure response. Now that async commands don't have
3116         an ErrorString and sync commands don't have a callback, trying to send
3117         an error with the wrong macro is a compile-time error.
3118
3119         * UIProcess/Automation/WebAutomationSession.cpp:
3120         (WebKit::WebAutomationSession::getBrowsingContexts):
3121         (WebKit::WebAutomationSession::getBrowsingContext):
3122         (WebKit::WebAutomationSession::createBrowsingContext):
3123         (WebKit::WebAutomationSession::closeBrowsingContext):
3124         (WebKit::WebAutomationSession::switchToBrowsingContext):
3125         (WebKit::WebAutomationSession::setWindowFrameOfBrowsingContext):
3126         (WebKit::WebAutomationSession::waitForNavigationToComplete):
3127         (WebKit::WebAutomationSession::navigateBrowsingContext):
3128         (WebKit::WebAutomationSession::goBackInBrowsingContext):
3129         (WebKit::WebAutomationSession::goForwardInBrowsingContext):
3130         (WebKit::WebAutomationSession::reloadBrowsingContext):
3131         (WebKit::WebAutomationSession::evaluateJavaScriptFunction):
3132         (WebKit::WebAutomationSession::resolveChildFrameHandle):
3133         (WebKit::WebAutomationSession::resolveParentFrameHandle):
3134         (WebKit::WebAutomationSession::computeElementLayout):
3135         (WebKit::WebAutomationSession::selectOptionElement):
3136         (WebKit::WebAutomationSession::isShowingJavaScriptDialog):
3137         (WebKit::WebAutomationSession::dismissCurrentJavaScriptDialog):
3138         (WebKit::WebAutomationSession::acceptCurrentJavaScriptDialog):
3139         (WebKit::WebAutomationSession::messageOfCurrentJavaScriptDialog):
3140         (WebKit::WebAutomationSession::setUserInputForCurrentJavaScriptPrompt):
3141         (WebKit::WebAutomationSession::setFilesToSelectForFileUpload):
3142         (WebKit::WebAutomationSession::getAllCookies):
3143         (WebKit::WebAutomationSession::deleteSingleCookie):
3144         (WebKit::WebAutomationSession::addSingleCookie):
3145         (WebKit::WebAutomationSession::deleteAllCookies):
3146         (WebKit::WebAutomationSession::setSessionPermissions):
3147         (WebKit::WebAutomationSession::performMouseInteraction):
3148         (WebKit::WebAutomationSession::performKeyboardInteractions):
3149         (WebKit::WebAutomationSession::takeScreenshot):
3150         (WebKit::WebAutomationSession::didTakeScreenshot):
3151         * UIProcess/Automation/WebAutomationSession.h:
3152         * UIProcess/Automation/WebAutomationSessionMacros.h:
3153         * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
3154         (WebKit::WebAutomationSession::inspectBrowsingContext):
3155
3156 2018-03-09  Jer Noble  <jer.noble@apple.com>
3157
3158         Don't pass NULL to the result parameter of SecTrustEvaluate()
3159         https://bugs.webkit.org/show_bug.cgi?id=183495
3160         <rdar://problem/38185688>
3161
3162         Reviewed by Andy Estes.
3163
3164         * UIProcess/ios/WKFullScreenWindowControllerIOS.mm:
3165         (-[WKFullScreenWindowController _EVOrganizationName]):
3166
3167 2018-03-09  Dean Jackson  <dino@apple.com>
3168
3169         Allow NavigationState to intercept requests and send them to SystemPreviewController
3170         https://bugs.webkit.org/show_bug.cgi?id=183526
3171         <rdar://problem/37801140>
3172
3173         Reviewed by Tim Horton.
3174
3175         Implement a bit more of SystemPreviewController, such that it can be used
3176         from NavigationState to identify and handle content that can be previewed.
3177
3178         * UIProcess/Cocoa/NavigationState.mm:
3179         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):
3180             If we'd in a download response policy, then check if SystemPreviewController
3181             can show the content. We ignore the download, but pass the original URL onto
3182             the preview. Ultimately, we'd want to avoid the navigation
3183             but use the download destination URL for preview.
3184
3185         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
3186         (-[_WKPreviewControllerDataSource initWithURL:]):
3187             Move the URL to property, to help use a single datasource object for all previews.
3188         (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
3189         (-[_WKPreviewControllerDelegate initWithSystemPreviewController:]):
3190             Add a delegate object, so we can detect when the preview is dismissed and return
3191             to the previous page.
3192         (-[_WKPreviewControllerDelegate previewControllerWillDismiss:]):
3193         (WebKit::SystemPreviewController::showPreview):
3194             Use single instances of the QLPreviewController, its datasource and delegate.
3195
3196         * UIProcess/SystemPreviewController.cpp:
3197             Add a helper to navigate back.
3198         (WebKit::SystemPreviewController::SystemPreviewController):
3199         (WebKit::SystemPreviewController::sendPageBack):
3200         * UIProcess/SystemPreviewController.h:
3201
3202 2018-03-09  Jer Noble  <jer.noble@apple.com>
3203
3204         webkitfullscreenchange event not fired at the same time as :-webkit-full-screen pseudo selector changes; causes glitchiness
3205         https://bugs.webkit.org/show_bug.cgi?id=183383
3206         <rdar://problem/38197028>
3207
3208         Reviewed by Eric Carlson.
3209
3210         Follow-up patch: now that the 'fullscreenchange' event is being fired slightly earlier, the
3211         Fullscreen.TopContentInset tests triggers what appears to be an existing behavior: if you
3212         exit in the middle of an enter fullscreen animation, the exit never happens, because the
3213         NSWindow never starts the exit animation. The solution is to store the exit fullscreen
3214         request, and only act upon it when the enter animation completes.
3215
3216         * UIProcess/mac/WKFullScreenWindowController.h:
3217         * UIProcess/mac/WKFullScreenWindowController.mm:
3218         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
3219         (-[WKFullScreenWindowController exitFullScreen]):
3220
3221 2018-03-09  Jer Noble  <jer.noble@apple.com>
3222
3223         Unconditionalize more methods in VideoFullscreenInterface (and related classes)
3224         https://bugs.webkit.org/show_bug.cgi?id=183501
3225
3226         Reviewed by Eric Carlson.
3227
3228         No reason for these methods to be PLATFORM(MAC) only.
3229
3230         * UIProcess/API/Cocoa/WKWebView.mm:
3231         (-[WKWebView _videoControlsManagerDidChange]):
3232         * UIProcess/API/Cocoa/WKWebViewInternal.h:
3233         * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
3234         (WebKit::PlaybackSessionManagerProxy::setUpPlaybackControlsManagerWithID):
3235         (WebKit::PlaybackSessionManagerProxy::clearPlaybackControlsManager):
3236         * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
3237         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
3238         * UIProcess/PageClient.h:
3239         * UIProcess/WebPageProxy.cpp:
3240         (WebKit::WebPageProxy::isPlayingMediaDidChange):
3241         (WebKit::WebPageProxy::handleControlledElementIDResponse const):
3242         (WebKit::WebPageProxy::isPlayingVideoInEnhancedFullscreen const):
3243         * UIProcess/WebPageProxy.h:
3244         * UIProcess/ios/PageClientImplIOS.h:
3245         * UIProcess/ios/PageClientImplIOS.mm:
3246         (WebKit::PageClientImpl::videoControlsManagerDidChange):
3247         * UIProcess/ios/WKFullScreenWindowControllerIOS.h:
3248         * UIProcess/ios/WKFullScreenWindowControllerIOS.mm:
3249         (-[WKFullScreenWindowController videoControlsManagerDidChange]):
3250         * WebProcess/cocoa/PlaybackSessionManager.mm:
3251         (WebKit::PlaybackSessionManager::setUpPlaybackControlsManager):
3252
3253 2018-03-09  Per Arne Vollan  <pvollan@apple.com>
3254
3255         Create CA layer contexts with +remoteContextWithOptions.
3256         https://bugs.webkit.org/show_bug.cgi?id=182747
3257
3258         Reviewed by Brent Fulgham.
3259
3260         CA layer contexts (CAContext) are currently created with +contextWithCGSConnection, which is
3261         using the main WindowServer connection to create the context. Instead, the contexts can be
3262         created with +remoteContextWithOptions, which does not use the main WindowServer connection.
3263         This is a step towards limiting the access the WebContent process has to the window server.
3264         To make the +remoteContextWithOptions call succeed, the sandbox has to be modified to allow
3265         access to CARenderServer. Also, access to the WindowServer should be denied by calling
3266         CGSSetDenyWindowServerConnections(true) before entering the sandbox. This is planned to do
3267         in a follow-up patch. The call to +remoteContextWithOptions will open up WindowServer
3268         connections, since the WindowServer is the system default CA render server, but these
3269         connections come with limited WindowServer exposure. In addition, we need to open up the
3270         sandbox for accessing some IOKit properties.
3271
3272         * Platform/mac/LayerHostingContext.mm:
3273         (WebKit::LayerHostingContext::createForExternalHostingProcess):
3274         * Shared/mac/HangDetectionDisablerMac.mm:
3275         (WebKit::setClientsMayIgnoreEvents):
3276         * WebProcess/com.apple.WebProcess.sb.in:
3277
3278 2018-03-09  Brent Fulgham  <bfulgham@apple.com>
3279
3280         Remove cookie API access from WebContent Process
3281         https://bugs.webkit.org/show_bug.cgi?id=183519
3282         <rdar://problem/35368802>
3283
3284         Reviewed by Alex Christensen.
3285
3286         All cookie access is now handled in the Network Process. However, there are vestiges of the original logic that used CFNetwork APIs in the WebContent process.
3287
3288         This patch removes CFNetwork calls from the WebProcess code paths, since they serve no purpose in modern WebKit.
3289
3290         No tests because this is a code cleanup with no expected change in behavior.
3291
3292         * NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
3293         (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy): Moved from WebFrameNetworkingContext.
3294         * NetworkProcess/NetworkProcess.h:
3295         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3296         (WebKit::NetworkProcess::setSharedHTTPCookieStorage): Moved from ChildProcess, since this should only be
3297         called in the NetworkProcess.
3298         * Shared/ChildProcess.h:
3299         * Shared/mac/ChildProcessMac.mm:
3300         (WebKit::ChildProcess::setSharedHTTPCookieStorage): Deleted.
3301         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
3302         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
3303         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession): Remove CFNetwork code. This version of
3304         'ensureWebsiteDataStoreSession' is needed to maintain a dictionary on the WebProcess side so we can refer to
3305         the same network session in both the WebContent and Network processes.
3306         (WebKit::WebFrameNetworkingContext::webFrameLoaderClient const):
3307         (WebKit::WebFrameNetworkingContext::setCookieAcceptPolicyForAllContexts): Deleted.
3308         * WebProcess/cocoa/WebProcessCocoa.mm:
3309         (WebKit::WebProcess::platformInitializeWebProcess): Remove calls to CFNetwork.
3310
3311 2018-03-09  Youenn Fablet  <youenn@apple.com>
3312
3313         ServiceWorkerClientFetch should send data to its resource loader once the didReceiveResponse completion handler is called
3314         https://bugs.webkit.org/show_bug.cgi?id=183110
3315
3316         Reviewed by Chris Dumez.
3317
3318         Buffering data/finish event/fail event until the response completion handler is called.
3319
3320         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
3321         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
3322         (WebKit::ServiceWorkerClientFetch::didReceiveData):
3323         (WebKit::ServiceWorkerClientFetch::didFinish):
3324         (WebKit::ServiceWorkerClientFetch::didFail):
3325         (WebKit::ServiceWorkerClientFetch::didNotHandle):
3326         (WebKit::ServiceWorkerClientFetch::cancel):
3327         (WebKit::ServiceWorkerClientFetch::continueLoadingAfterCheckingResponse):
3328         * WebProcess/Storage/ServiceWorkerClientFetch.h:
3329
3330 2018-03-09  Jer Noble  <jer.noble@apple.com>
3331
3332         Add new CSS env constants for use with fullscreen
3333         https://bugs.webkit.org/show_bug.cgi?id=183498
3334
3335         Reviewed by Dean Jackson.
3336
3337         Pass the values given to WebFullScreenManagerProxy through the process boundary and
3338         into WebCore.
3339
3340         * UIProcess/WebFullScreenManagerProxy.cpp:
3341         (WebKit::WebFullScreenManagerProxy::setFullscreenInsetTop):
3342         (WebKit::WebFullScreenManagerProxy::setFullscreenAutoHideDelay):
3343         * UIProcess/WebFullScreenManagerProxy.h:
3344         * WebProcess/FullScreen/WebFullScreenManager.cpp:
3345         (WebKit::WebFullScreenManager::didExitFullScreen):
3346         (WebKit::WebFullScreenManager::setFullscreenInsetTop):
3347         (WebKit::WebFullScreenManager::setFullscreenAutoHideDelay):
3348         * WebProcess/FullScreen/WebFullScreenManager.h:
3349         * WebProcess/FullScreen/WebFullScreenManager.messages.in:
3350
3351 2018-03-09  Jer Noble  <jer.noble@apple.com>
3352
3353         Add isPictureInPictureActive messaging across WebKit process boundary
3354         https://bugs.webkit.org/show_bug.cgi?id=183499
3355
3356         Reviewed by Eric Carlson.
3357
3358         * UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
3359         * UIProcess/Cocoa/PlaybackSessionManagerProxy.messages.in:
3360         * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
3361         (WebKit::PlaybackSessionModelContext::pictureInPictureActiveChanged):
3362         (WebKit::PlaybackSessionManagerProxy::pictureInPictureActiveChanged):
3363
3364 2018-03-09  Stephan Szabo  <stephan.szabo@sony.com>
3365
3366         Add guard for wtf/glib include
3367         https://bugs.webkit.org/show_bug.cgi?id=183521
3368
3369         Reviewed by Alex Christensen.
3370
3371         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
3372
3373 2018-03-09  Andy Estes  <aestes@apple.com>
3374
3375         [Mac] WebKit fails to receive file promises when the embedding app is sandboxed
3376         https://bugs.webkit.org/show_bug.cgi?id=183489
3377         <rdar://problem/38267517>
3378
3379         WebKit calls -[NSFilePromiseReceiver receivePromisedFilesAtDestination:...] with
3380         NSTemporaryDirectory() as the destination for receiving file promise drops. AppKit attempts
3381         to issue a sandbox extension for this directory, but for security reasons App Sandbox
3382         refuses to do so for NSTemporaryDirectory() itself. As a result, AppKit will call our reader
3383         block with a nil error and a valid file URL, but no file will actually exist at that URL.
3384
3385         In order for App Sandbox to grant issuing the sandbox extension needed by AppKit, we need to
3386         use some other destination directory. This patch uses FileSystem::createTemporaryDirectory()
3387         to securely create a unique temporary directory inside NSTemporaryDirectory() for use as the
3388         drop destination.
3389
3390         Reviewed by Wenson Hsieh.
3391
3392         * UIProcess/Cocoa/WebViewImpl.mm:
3393         (WebKit::WebViewImpl::performDragOperation):
3394
3395 2018-03-09  Carlos Garcia Campos  <cgarcia@igalia.com>
3396
3397         [GTK] Do not use WebKitDOMHTMLFormElement as argument of signal WebKitWebPage::will-submit-form
3398         https://bugs.webkit.org/show_bug.cgi?id=183510
3399
3400         Reviewed by Michael Catanzaro.
3401
3402         In 2.22 WebKitDOMHTMLFormElement will be deprecated in GTK+ port and won't still exist in WPE. The new
3403         JavaScript GLib API will be used to replace most of the DOM API, but a few classes will remain with a minimal
3404         API for things that can't be done with JavaScript. WebKitDOMElement will stay and will be added to WPE as well,
34