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