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