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