[CoordGraphics] UpdateAtlas constructor should receive an IntSize, not a dimension...
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2017-11-24  Zan Dobersek  <zdobersek@igalia.com>
2
3         [CoordGraphics] UpdateAtlas constructor should receive an IntSize, not a dimension value
4         https://bugs.webkit.org/show_bug.cgi?id=179976
5
6         Reviewed by Carlos Garcia Campos.
7
8         Have the UpdateAtlas constructor receive an IntSize object that specifies
9         the desired size for the CoordinatedBuffer. Passing in a dimension doesn't
10         really make sense since this value isn't dynamically configurable, and
11         the only value that is passed in is already a power-of-two.
12
13         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
14         (WebKit::CompositingCoordinator::getCoordinatedBuffer):
15         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp:
16         (WebKit::UpdateAtlas::UpdateAtlas):
17         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h:
18
19 2017-11-23  Sam Weinig  <sam@webkit.org>
20
21         Remove unneeded ScriptController::processingUserGesture() forwarding functions
22         https://bugs.webkit.org/show_bug.cgi?id=179954
23
24         Reviewed by Darin Adler.
25
26         Replace ScriptController::processingUserGesture() and ScriptController::processingUserGestureForMedia()
27         with direct calls to the corresponding UserGestureIndicator functions.
28
29         * WebProcess/InjectedBundle/InjectedBundle.cpp:
30         (WebKit::InjectedBundle::isProcessingUserGesture):
31         * WebProcess/WebPage/WebPage.cpp:
32         (WebKit::WebPage::addResourceRequest):
33
34 2017-11-23  Chris Dumez  <cdumez@apple.com>
35
36         WebSWServerConnection should register/unregister itself with the StorageProcess
37         https://bugs.webkit.org/show_bug.cgi?id=179965
38
39         Reviewed by Darin Adler.
40
41         WebSWServerConnection should register/unregister itself with the StorageProcess instead of relying
42         on StorageToWebProcessConnection to do so on its behalf. This is less error-prone.
43
44         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
45         (WebKit::WebSWServerConnection::WebSWServerConnection):
46         (WebKit::WebSWServerConnection::~WebSWServerConnection):
47         * StorageProcess/StorageToWebProcessConnection.cpp:
48         (WebKit::StorageToWebProcessConnection::~StorageToWebProcessConnection):
49         (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
50         (WebKit::StorageToWebProcessConnection::removeSWServerConnection):
51
52 2017-11-23  Darin Adler  <darin@apple.com>
53
54         Reduce WTF::String operations that do unnecessary Unicode operations instead of ASCII
55         https://bugs.webkit.org/show_bug.cgi?id=179907
56
57         Reviewed by Sam Weinig.
58
59         * NetworkProcess/cache/NetworkCache.cpp:
60         (WebKit::NetworkCache::isMediaMIMEType): Use startsWithLettersIgnoringASCIICase.
61         * NetworkProcess/cache/NetworkCacheKey.cpp:
62         (WebKit::NetworkCache::hashString): Use isAllASCII..
63         * UIProcess/API/C/WKWebsitePolicies.cpp:
64         (WKWebsitePoliciesSetCustomHeaderFields): Use startsWithLettersIgnoringASCIICase..
65         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
66         (-[_WKWebsitePolicies setCustomHeaderFields:]): Ditto.
67         * UIProcess/WebPageProxy.cpp:
68         (WebKit::WebPageProxy::savePDFToFileInDownloadsFolder): Use endsWithIgnoringASCIICase.
69         * UIProcess/WebPreferences.cpp:
70         (WebKit::WebPreferences::WebPreferences): Initialize m_identifier explicitly. Somehow
71         changing the String default constructor to be "= default" led to a warning that we
72         otherwise did not get about not initializing m_identifier. Arguably a compiler bug,
73         but legitimately strange that the copy constructor does not copy m_identifier and so
74         nice to be explicit about it, I guess.
75         * UIProcess/mac/WebPageProxyMac.mm:
76         (WebKit::WebPageProxy::savePDFToTemporaryFolderAndOpenWithNativeApplicationRaw): Use
77         endsWithIgnoringASCIICase.
78         (WebKit::WebPageProxy::openPDFFromTemporaryFolderWithNativeApplication): Ditto.
79         * WebProcess/WebPage/WebPage.cpp:
80         (WebKit::WebPage::createPlugin): Ditto.
81         * WebProcess/WebPage/ios/WebPageIOS.mm:
82         (WebKit::WebPage::platformEditorState const): Use isAllSpecialCharacters<isHTMLSpace>.
83
84 2017-11-23  Zan Dobersek  <zdobersek@igalia.com>
85
86         [CoordGraphics] Simplify CoordinatedGraphicsLayer's content buffer updates
87         https://bugs.webkit.org/show_bug.cgi?id=179972
88
89         Reviewed by Carlos Garcia Campos.
90
91         In CompositingCoordinator, add the getCoordinatedBuffer() method, replacing
92         paintToSurface(). The new method traverses the list of UpdateAtlases and
93         returns any CoordinatedBuffer object that was free to use. If none exist,
94         a new UpdateAtlas object is created, and its CoordinatedBuffer is returned.
95
96         In  UpdateAtlas, the paintOnAvailableBuffer() method is replaced with
97         getCoordinatedBuffer(). The latter allocates the necessary area but then
98         returns a reference to the CoordinatedBuffer buffer, along with the atlas ID
99         and the allocated rectangle information, and does not invoke any painting
100         operation like paintOnAvailableBuffer() did.
101
102         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
103         (WebKit::CompositingCoordinator::getCoordinatedBuffer):
104         (WebKit::CompositingCoordinator::paintToSurface): Deleted.
105         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
106         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp:
107         (WebKit::UpdateAtlas::getCoordinatedBuffer):
108         (WebKit::UpdateAtlas::paintOnAvailableBuffer): Deleted.
109         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h:
110
111 2017-11-23  Zan Dobersek  <zdobersek@igalia.com>
112
113         [CoordGraphics] Remove relay CoordinatedBuffer::Client implementations
114         https://bugs.webkit.org/show_bug.cgi?id=179970
115
116         Reviewed by Carlos Garcia Campos.
117
118         Drop the helper UpdateAtlasSurfaceClient class and instead directly use
119         the CoordinatedBuffer's GraphicsContext to perform clip and translation
120         operations based on the allocated rectangle, to pre-fill the target rect
121         with transparent color in case the alpha channel is supported, and to
122         then invoke CoordinatedBuffer::Client::paintToSurfaceContext() method,
123         passing the GraphicsContext as the argument.
124
125         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp:
126         (WebKit::UpdateAtlas::paintOnAvailableBuffer):
127         (): Deleted.
128
129 2017-11-23  Zan Dobersek  <zdobersek@igalia.com>
130
131         [CoordGraphics] Replace CoordinatedSurface, ThreadSafeCoordinatedSurface with CoordinatedBuffer
132         https://bugs.webkit.org/show_bug.cgi?id=179967
133
134         Reviewed by Carlos Garcia Campos.
135
136         Replace uses of CoordinatedSurface class with CoordinatedBuffer. The
137         ThreadSafeCoordinatedSurface class is removed, along with the code in
138         CoordinatedLayerTreeHost that established a CoordinatedSurface factory.
139
140         * PlatformGTK.cmake:
141         * PlatformWPE.cmake:
142         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
143         (WebKit::CoordinatedBackingStoreTile::swapBuffers):
144         (WebKit::CoordinatedBackingStoreTile::setBackBuffer):
145         (WebKit::CoordinatedBackingStore::updateTile):
146         * Shared/CoordinatedGraphics/CoordinatedBackingStore.h:
147         Rename m_surface to m_buffer, m_surfaceOffset to m_bufferOffset.
148         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
149         (WebKit::CoordinatedGraphicsScene::createUpdateAtlas):
150         (WebKit::CoordinatedGraphicsScene::updateImageBacking):
151         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
152         * Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.cpp: Removed.
153         * Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.h: Removed.
154         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
155         (WebKit::CompositingCoordinator::updateImageBacking):
156         (WebKit::CompositingCoordinator::createUpdateAtlas):
157         (WebKit::CompositingCoordinator::paintToSurface):
158         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
159         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
160         (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
161         (WebKit::CoordinatedLayerTreeHost::createCoordinatedSurface): Deleted.
162         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
163         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp:
164         (WebKit::UpdateAtlas::UpdateAtlas):
165         (WebKit::UpdateAtlas::~UpdateAtlas):
166         (WebKit::UpdateAtlas::paintOnAvailableBuffer):
167         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h:
168         Rename m_surface to m_buffer.
169         (WebKit::UpdateAtlas::size const):
170         (WebKit::UpdateAtlas::supportsAlpha const):
171
172 2017-11-22  Ali Juma  <ajuma@chromium.org>
173
174         Implement VisualViewport API attributes
175         https://bugs.webkit.org/show_bug.cgi?id=179385
176
177         Reviewed by Frédéric Wang.
178
179         Add a VisualViewportAPI experimental feature.
180
181         * Shared/WebPreferences.yaml:
182
183 2017-11-22  Tim Horton <timothy_horton@apple.com> and Michael Catanzaro <mcatanzaro@igalia.com>
184
185         Remove build-webkit's notion of feature flags having a default value
186         https://bugs.webkit.org/show_bug.cgi?id=177338
187
188         Reviewed by Carlos Alberto Lopez Perez.
189
190         Use ENABLE_EXPERIMENTAL_FEATURES instead of ENABLE_DEVELOPER_MODE to enable runtime
191         experimental features.
192
193         * Shared/WebPreferencesDefaultValues.h:
194
195 2017-11-22  Commit Queue  <commit-queue@webkit.org>
196
197         Unreviewed, rolling out r225093.
198         https://bugs.webkit.org/show_bug.cgi?id=179938
199
200         Compilation failed on WinCairo 64-bit Release (Requested by
201         fredw on #webkit).
202
203         Reverted changeset:
204
205         "Implement VisualViewport API attributes"
206         https://bugs.webkit.org/show_bug.cgi?id=179385
207         https://trac.webkit.org/changeset/225093
208
209 2017-11-21  Ali Juma  <ajuma@chromium.org>
210
211         Implement VisualViewport API attributes
212         https://bugs.webkit.org/show_bug.cgi?id=179385
213
214         Reviewed by Frédéric Wang.
215
216         Add a VisualViewportAPI experimental feature.
217
218         * Shared/WebPreferences.yaml:
219
220 2017-11-21  Christopher Reid  <chris.reid@sony.com>
221
222         [PAL] Remove FileSystem's dependency on WebCoreNSStringExtras
223         https://bugs.webkit.org/show_bug.cgi?id=179504
224
225         Reviewed by Darin Adler.
226
227         * UIProcess/Cocoa/WebViewImpl.mm:
228         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
229         * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
230
231 2017-11-21  Carlos Garcia Campos  <cgarcia@igalia.com>
232
233         [WPE] WPEWebProcess: Couldn't find current GLX or EGL context
234         https://bugs.webkit.org/show_bug.cgi?id=179883
235
236         Reviewed by Žan Doberšek.
237
238         I'm seeing that message quite often when running the unit tests. The problem seems to be that some tests run so
239         fast that the web process never renders the first frame, so the context is created but never made current. I've
240         checked with apitrace that there are calls to eglQueryContext with null display, causing a EGL_BAD_DISPLAY, but
241         I don't know where those calls are originated. Making the context current right after it's created fixes the
242         problem.
243
244         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
245         (WebKit::ThreadedCompositor::createGLContext): Always call makeContextCurrent() right after the context is created.
246
247 2017-11-20  Carlos Garcia Campos  <cgarcia@igalia.com>
248
249         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.19.2 release.
250
251         * gtk/NEWS: Add release notes for 2.19.2.
252
253 2017-11-20  Don Olmstead  <don.olmstead@sony.com>
254
255         Add declspec within WebKit API
256         https://bugs.webkit.org/show_bug.cgi?id=179893
257
258         Reviewed by Darin Adler.
259
260         * Shared/API/c/WKDeclarationSpecifiers.h:
261
262 2017-11-20  Mario Sanchez Prada  <mario@endlessm.com>
263
264         [GTK] New API to add, retrieve and delete cookies via WebKitCookieManager
265         https://bugs.webkit.org/show_bug.cgi?id=177932
266
267         Reviewed by Carlos Garcia Campos.
268
269         Added new API to WebKitCookieManager to add, retrieve and delete complete
270         cookies into/out-of a running session, and updated documentation sections.
271
272         * UIProcess/API/glib/WebKitCookieManager.cpp:
273         (webkit_cookie_manager_add_cookie): New function.
274         (webkit_cookie_manager_add_cookie_finish): Ditto.
275         (webkit_cookie_manager_get_cookies): Ditto.
276         (webkit_cookie_manager_get_cookies_finish): Ditto.
277         (webkit_cookie_manager_delete_cookie): Ditto.
278         (webkit_cookie_manager_delete_cookie_finish): Ditto.
279         * UIProcess/API/gtk/WebKitCookieManager.h: Added new functions.
280         * UIProcess/API/wpe/WebKitCookieManager.h: Ditto.
281         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Ditto.
282
283 2017-11-20  Carlos Garcia Campos  <cgarcia@igalia.com>
284
285         [WPE] webkit_web_view_new() should enable specifying wpe_view_backend object
286         https://bugs.webkit.org/show_bug.cgi?id=178655
287
288         Reviewed by Michael Catanzaro.
289
290         Update all WebKitWebView constructors to receive a WebKitWebViewBackend as argument. It's now required to
291         provide a backend to create a web view, but it can be NULL to use the default one. WebKitWebViewBackend is a
292         boxed type wrapping a struct wpe_view_backend* used as construct only property of WebKitWebView. The view always
293         takes the ownership of the WebKitWebViewBackend which owns the struct wpe_view_backend*. An optional
294         GDestroyNotify and user data pointer can be passed to the WebKitWebViewBackend constructor to provide a custom
295         deleter for the backend. In the C API the struct wpe_view_backend* is also mandatory now, but it can't be NULL
296         and it's owned by the caller, not the view.
297
298         * PlatformWPE.cmake:
299         * UIProcess/API/C/wpe/WKView.cpp:
300         (WKViewCreate):
301         * UIProcess/API/C/wpe/WKView.h:
302         * UIProcess/API/glib/WebKitWebView.cpp:
303         (_WebKitWebViewPrivate::~_WebKitWebViewPrivate):
304         (webkitWebViewConstructed):
305         (webkitWebViewSetProperty):
306         (webkitWebViewGetProperty):
307         (webkit_web_view_class_init):
308         (webkitWebViewCreatePage):
309         (webkit_web_view_get_backend):
310         * UIProcess/API/wpe/WPEView.cpp:
311         (WKWPE::m_backend):
312         (WKWPE::View::~View):
313         * UIProcess/API/wpe/WebKitWebView.h:
314         * UIProcess/API/wpe/WebKitWebViewBackend.cpp: Added.
315         (_WebKitWebViewBackend::_WebKitWebViewBackend):
316         (_WebKitWebViewBackend::~_WebKitWebViewBackend):
317         (webkitWebViewBackendRef):
318         (webkitWebViewBackendUnref):
319         (webkitWebViewBackendCreateDefault):
320         (webkit_web_view_backend_new):
321         (webkit_web_view_backend_get_wpe_backend):
322         * UIProcess/API/wpe/WebKitWebViewBackend.h: Added.
323         * UIProcess/API/wpe/WebKitWebViewBackendPrivate.h: Added.
324         * UIProcess/API/wpe/WebKitWebViewWPE.cpp:
325         (webkit_web_view_new):
326         (webkit_web_view_new_with_context):
327         (webkit_web_view_new_with_related_view):
328         (webkit_web_view_new_with_settings):
329         (webkit_web_view_new_with_user_content_manager):
330         * UIProcess/API/wpe/webkit.h:
331
332 2017-11-20  Carlos Garcia Campos  <cgarcia@igalia.com>
333
334         [GTK][WPE] webkit_cookie_manager_delete_all_cookies doesn't delete the cookies if called before a web process is running
335         https://bugs.webkit.org/show_bug.cgi?id=175265
336
337         Reviewed by Michael Catanzaro.
338
339         This is what happens:
340
341         1- We create our WebKitWebContext that creates its WebProcessPool.
342         2- We set a persistent cookies storage.
343         3- We ask the website data store to delete all cookies, but since website data store is a web process observer
344            and we haven't spawned any web process yet, it creates a new WebProcessPool with the default configuration
345            (no persistent cookies) and sends the message to delete the cookies there.
346         4- The network process of the second process pool does nothing because it doesn't have cookies at all.
347
348         We need to set the primary data store of the WebProcessPool when WebKitWebContext is constructed to ensure that
349         one is used before the web process is launched.
350
351         * UIProcess/API/glib/WebKitWebContext.cpp:
352         (webkitWebContextConstructed):
353
354 2017-11-19  Tim Horton  <timothy_horton@apple.com>
355
356         Remove unused TOUCH_ICON_LOADING feature flag
357         https://bugs.webkit.org/show_bug.cgi?id=179873
358
359         Reviewed by Simon Fraser.
360
361         * Configurations/FeatureDefines.xcconfig:
362
363 2017-11-19  Tim Horton  <timothy_horton@apple.com>
364
365         Remove unused LEGACY_VENDOR_PREFIXES feature flag
366         https://bugs.webkit.org/show_bug.cgi?id=179872
367
368         Reviewed by Darin Adler.
369
370         * Configurations/FeatureDefines.xcconfig:
371
372 2017-11-18  Chris Dumez  <cdumez@apple.com>
373
374         ASSERTION FAILED: registration in WebCore::SWServerJobQueue::scriptContextStarted(ServiceWorkerIdentifier)
375         https://bugs.webkit.org/show_bug.cgi?id=179846
376
377         Reviewed by Darin Adler.
378
379         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
380         (WebKit::WebSWServerConnection::rejectJobInClient):
381         (WebKit::WebSWServerConnection::resolveRegistrationJobInClient):
382         (WebKit::WebSWServerConnection::resolveUnregistrationJobInClient):
383         (WebKit::WebSWServerConnection::startScriptFetchInClient):
384         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
385         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
386         * WebProcess/Storage/WebSWClientConnection.messages.in:
387         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
388         (WebKit::WebSWContextManagerConnection::serviceWorkerStartedWithMessage):
389         (WebKit::WebSWContextManagerConnection::didFinishInstall):
390         * WebProcess/Storage/WebSWContextManagerConnection.h:
391
392 2017-11-18  Tim Horton  <timothy_horton@apple.com>
393
394         Rename some Network Capture debugging defines
395         https://bugs.webkit.org/show_bug.cgi?id=179870
396
397         Reviewed by Darin Adler.
398
399         * NetworkProcess/capture/NetworkCaptureLogging.h:
400         * NetworkProcess/capture/NetworkCaptureManager.cpp:
401         (WebKit::NetworkCapture::Manager::findMatch):
402         (WebKit::NetworkCapture::Manager::fuzzyMatchURLs):
403         These shouldn't have WTF in their name - they have nothing to do with WTF.
404         These shouldn't use ENABLE(), since they're not features, just debugging macros.
405
406 2017-11-17  Chris Dumez  <cdumez@apple.com>
407
408         [Service Workers] Implement "Notify Controller Change" algorithm
409         https://bugs.webkit.org/show_bug.cgi?id=179822
410
411         Reviewed by Youenn Fablet.
412
413         * Scripts/webkit/messages.py:
414         (class_template_headers):
415         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
416         (WebKit::WebSWServerConnection::notifyClientsOfControllerChange):
417         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
418         * WebProcess/Storage/WebSWClientConnection.messages.in:
419
420 2017-11-17  Chris Dumez  <cdumez@apple.com>
421
422         Use a strongly typed identifier for SWServer::Connection
423         https://bugs.webkit.org/show_bug.cgi?id=179848
424
425         Reviewed by Brady Eidson.
426
427         Use a strongly typed identifier for SWServer::Connection, for clarity.
428
429         * Scripts/webkit/messages.py:
430         (forward_declarations_and_headers):
431         (forward_declarations_and_headers.templates):
432         (headers_for_type):
433         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
434         (WebKit::WebSWServerConnection::WebSWServerConnection):
435         (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope):
436         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
437         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
438         * StorageProcess/StorageProcess.cpp:
439         (WebKit::StorageProcess::didFailFetch):
440         (WebKit::StorageProcess::didNotHandleFetch):
441         (WebKit::StorageProcess::didReceiveFetchResponse):
442         (WebKit::StorageProcess::didReceiveFetchData):
443         (WebKit::StorageProcess::didReceiveFetchFormData):
444         (WebKit::StorageProcess::didFinishFetch):
445         * StorageProcess/StorageProcess.h:
446         * StorageProcess/StorageProcess.messages.in:
447         * StorageProcess/StorageToWebProcessConnection.cpp:
448         (WebKit::StorageToWebProcessConnection::didReceiveMessage):
449         (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
450         (WebKit::StorageToWebProcessConnection::removeSWServerConnection):
451         (WebKit::generateIDBConnectionToServerIdentifier):
452         (WebKit::StorageToWebProcessConnection::establishIDBConnectionToServer):
453         * StorageProcess/StorageToWebProcessConnection.h:
454         * StorageProcess/StorageToWebProcessConnection.messages.in:
455         * WebProcess/Storage/WebSWClientConnection.cpp:
456         (WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope):
457         * WebProcess/Storage/WebSWClientConnection.h:
458         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
459         (WebKit::WebSWContextManagerConnection::startFetch):
460         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerGlobalScope):
461         * WebProcess/Storage/WebSWContextManagerConnection.h:
462         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
463         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
464         (WebKit::WebServiceWorkerFetchTaskClient::WebServiceWorkerFetchTaskClient):
465         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:
466         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
467         (WebKit::WebToStorageProcessConnection::didReceiveMessage):
468         (WebKit::WebToStorageProcessConnection::serviceWorkerConnectionForSession):
469         * WebProcess/Storage/WebToStorageProcessConnection.h:
470
471 2017-11-17  John Wilander  <wilander@apple.com>
472
473         Storage Access API: UI process should update network process about granted access
474         https://bugs.webkit.org/show_bug.cgi?id=176943
475         <rdar://problem/34440612>
476
477         Reviewed by Alex Christensen.
478
479         * NetworkProcess/NetworkProcess.cpp:
480         (WebKit::NetworkProcess::updateStorageAccessForPrevalentDomains):
481             Updates storage access on the session.
482         * NetworkProcess/NetworkProcess.h:
483         * NetworkProcess/NetworkProcess.messages.in:
484         * NetworkProcess/NetworkProcessCreationParameters.cpp:
485         (WebKit::NetworkProcessCreationParameters::encode const):
486         (WebKit::NetworkProcessCreationParameters::decode):
487         * NetworkProcess/NetworkProcessCreationParameters.h:
488         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
489         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
490         (WebKit::NetworkProcess::setStorageAccessAPIEnabled):
491         * UIProcess/API/C/WKCookieManager.cpp:
492         (WKCookieManagerSetStorageAccessAPIEnabled):
493         * UIProcess/API/C/WKCookieManager.h:
494         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
495         (WKWebsiteDataStoreSetStatisticsHasHadNonRecentUserInteraction):
496         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
497         * UIProcess/API/Cocoa/WKProcessPool.mm:
498         (-[WKProcessPool _isStorageAccessAPIEnabled]):
499         (-[WKProcessPool _setStorageAccessAPIEnabled:]):
500         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
501         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
502         (-[WKWebsiteDataStore _resourceLoadStatisticsSetHasHadNonRecentUserInteractionForHost:]):
503             Test infrastructure.
504         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
505         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
506         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
507         (WebKit::WebProcessPool::setStorageAccessAPIEnabled):
508         * UIProcess/Network/NetworkProcessProxy.cpp:
509         (WebKit::nextRequestStorageAccessContextId):
510         (WebKit::NetworkProcessProxy::updateStorageAccessForPrevalentDomains):
511             Sends a message to the network process to update storage access.
512         (WebKit::NetworkProcessProxy::storageAccessRequestResult):
513             Receives a message from the network process that storage access
514             was updated.
515         * UIProcess/Network/NetworkProcessProxy.h:
516         * UIProcess/Network/NetworkProcessProxy.messages.in:
517         * UIProcess/WebCookieManagerProxy.cpp:
518         (WebKit::WebCookieManagerProxy::setStorageAccessAPIEnabled):
519         * UIProcess/WebCookieManagerProxy.h:
520         * UIProcess/WebProcessPool.h:
521         * UIProcess/WebResourceLoadStatisticsStore.cpp:
522         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
523         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
524         (WebKit::WebResourceLoadStatisticsStore::logNonRecentUserInteraction):
525             Test infrastructure.
526         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
527             Now makes the API call even if the only operation is to clear first.
528         * UIProcess/WebResourceLoadStatisticsStore.h:
529         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
530         (WebKit::WebsiteDataStore::updateStorageAccessForPrevalentDomainsHandler):
531             Propagates the storage access directive to the network process proxy.
532         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
533         * UIProcess/WebsiteData/WebsiteDataStore.h:
534
535 2017-11-16  Yousuke Kimoto  <yousuke.kimoto@sony.com>
536
537         [WinCairo] Add network (curl) files for wincairo webkit
538         https://bugs.webkit.org/show_bug.cgi?id=179474
539
540         Reviewed by Alex Christensen.
541
542         * Shared/curl/WebCoreArgumentCodersCurl.cpp:
543         (IPC::ArgumentCoder<CertificateInfo>::decode): Fidex return value since currently no operation is needed for wincairo webkit.
544         (IPC::ArgumentCoder<ResourceError>::decodePlatformData): Fidex return value since currently no operation is needed for wincairo webkit.
545         * WebProcess/WebCoreSupport/curl/WebFrameNetworkingContext.cpp: Renamed from Source/WebKit/WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.cpp.
546         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
547         * WebProcess/WebCoreSupport/curl/WebFrameNetworkingContext.h: Renamed from Source/WebKit/WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.h.
548
549 2017-11-16  Don Olmstead  <don.olmstead@sony.com>
550
551         [WinCairo] Update WinCairoRequirements
552         https://bugs.webkit.org/show_bug.cgi?id=179790
553
554         Reviewed by Alex Christensen.
555
556         * PlatformWin.cmake:
557
558 2017-11-16  Youenn Fablet  <youenn@apple.com>
559
560         Service Worker should get the body of intercepted requests
561         https://bugs.webkit.org/show_bug.cgi?id=179776
562
563         Reviewed by Alex Christensen.
564
565         Pass a FormDataReference when starting fetch IPC.
566         Convert this FormDataReference in a FormData and using it to set the FetchRequest body properly in Service Worker process.
567         Forbid fetch interception when URL is not HTTP/HTTPS.
568
569         * Platform/IPC/FormDataReference.h:
570         (IPC::FormDataReference::FormDataReference):
571         (IPC::FormDataReference::takeData):
572         (IPC::FormDataReference::encode const):
573         (IPC::FormDataReference::decode):
574         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
575         (WebKit::WebSWServerConnection::startFetch):
576         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
577         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
578         * WebProcess/Storage/WebSWClientConnection.cpp:
579         (WebKit::WebSWClientConnection::startFetch):
580         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
581         (WebKit::WebSWContextManagerConnection::startFetch):
582         * WebProcess/Storage/WebSWContextManagerConnection.h:
583         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
584         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
585         (WebKit::WebServiceWorkerProvider::handleFetch):
586
587 2017-11-16  Daniel Bates  <dabates@apple.com>
588
589         Add feature define for alternative presentation button element
590         https://bugs.webkit.org/show_bug.cgi?id=179692
591         Part of <rdar://problem/34917108>
592
593         Reviewed by Andy Estes.
594
595         Only enabled on Cocoa platforms by default.
596
597         * Configurations/FeatureDefines.xcconfig:
598
599 2017-11-16  Chris Dumez  <cdumez@apple.com>
600
601         [Service Worker] Implement "Try Clear Registration" algorithm
602         https://bugs.webkit.org/show_bug.cgi?id=179791
603
604         Reviewed by Youenn Fablet.
605
606         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
607         * WebProcess/Storage/WebSWClientConnection.cpp:
608         (WebKit::WebSWClientConnection::serviceWorkerStartedControllingClient):
609         (WebKit::WebSWClientConnection::serviceWorkerStoppedControllingClient):
610         * WebProcess/Storage/WebSWClientConnection.h:
611
612 2017-11-16  Michael Catanzaro  <mcatanzaro@igalia.com>
613
614         REGRESSION(r224179): layer flush now requires sync IPC to compute undo/redo availability in EditorState
615         https://bugs.webkit.org/show_bug.cgi?id=179797
616
617         Reviewed by Simon Fraser.
618
619         r224179 introduced a performance regression. The newly-added code in WebPage::editorState is
620         part of a performance-critical path. (The editor state is computed and sent to the UI
621         process during the layer flush.) Calls to Editor::canUndo and Editor::canRedo were added,
622         but these calls are both implemented with sync IPC calls to WebPageProxy in the UI process.
623         WebPageProxy passes them along to PageClientImpl to compute the availability of the
624         commands.
625
626         That's all pointless because this code only exists for the purpose of getting editing
627         command availability to the UI process. In the case of undo and redo, it's not needed at
628         all. I did not realize that when writing the code. So canUndo and canRedo should be removed
629         from EditorState. This ought to be sufficient to avoid the perf regression.
630
631         No changes are needed to the GTK/WPE WebKitEditorState API. The API is reimplemented using
632         WebPageProxy::canUndoRedo instead of EditorState. There should be no changes in behavior,
633         only performance.
634
635         * Shared/EditorState.cpp:
636         (WebKit::EditorState::PostLayoutData::encode const):
637         (WebKit::EditorState::PostLayoutData::decode):
638         * Shared/EditorState.h:
639         * UIProcess/API/glib/WebKitEditorState.cpp:
640         (webkitEditorStateCreate):
641         (webkitEditorStateChanged):
642         * UIProcess/API/glib/WebKitEditorStatePrivate.h:
643         * UIProcess/API/glib/WebKitWebView.cpp:
644         (webkit_web_view_get_editor_state):
645         * UIProcess/WebPageProxy.cpp:
646         (WebKit::WebPageProxy::canUndo):
647         (WebKit::WebPageProxy::canRedo):
648         * UIProcess/WebPageProxy.h:
649         * WebProcess/WebPage/WebPage.cpp:
650         (WebKit::WebPage::editorState const):
651
652 2017-11-16  Megan Gardner  <megan_gardner@apple.com>
653
654         Remove allowBlockSelection as block selection is not supported anymore
655         https://bugs.webkit.org/show_bug.cgi?id=179738
656
657         Reviewed by Tim Horton.
658
659         Remove all instances of the alloweBlockSelection flag. Blocks selection is fully disabled
660         and thus this flag will do nothing. This was only added as a debug measure last year, and nothing
661         ever actually used it.
662
663         * Shared/WebPageCreationParameters.cpp:
664         (WebKit::WebPageCreationParameters::encode const):
665         (WebKit::WebPageCreationParameters::decode):
666         * Shared/WebPageCreationParameters.h:
667         * UIProcess/API/Cocoa/WKWebView.mm:
668         (-[WKWebView _allowsBlockSelection]): Deleted.
669         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
670         (-[WKWebViewConfiguration init]):
671         (-[WKWebViewConfiguration copyWithZone:]):
672         (-[WKWebViewConfiguration _allowsBlockSelection]): Deleted.
673         (-[WKWebViewConfiguration _setAllowsBlockSelection:]): Deleted.
674         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
675         * UIProcess/API/Cocoa/WKWebViewInternal.h:
676         * UIProcess/PageClient.h:
677         * UIProcess/WebPageProxy.cpp:
678         (WebKit::WebPageProxy::creationParameters):
679         * UIProcess/ios/PageClientImplIOS.h:
680         * UIProcess/ios/PageClientImplIOS.mm:
681         (WebKit::PageClientImpl::allowsBlockSelection): Deleted.
682         * WebProcess/WebPage/WebPage.cpp:
683         * WebProcess/WebPage/WebPage.h:
684
685 2017-11-16  Brent Fulgham  <bfulgham@apple.com>
686
687         Whitelist additional IOKit properties based on customer feedback
688         https://bugs.webkit.org/show_bug.cgi?id=179782
689         <rdar://problem/35508246>
690
691         Reviewed by Dean Jackson.
692
693         Expand the IOKit property whitelist to recognize a few more properties as valid based on review of logs
694         from customer systems and our test infrastructure.
695
696         * WebProcess/com.apple.WebProcess.sb.in:
697
698 2017-11-15  Brady Eidson  <beidson@apple.com>
699
700         Implement basics of "Terminate Service Worker" algorithm.
701         https://bugs.webkit.org/show_bug.cgi?id=179551
702
703         Reviewed by Chris Dumez.
704
705         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
706         (WebKit::WebSWServerToContextConnection::terminateWorker):
707         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
708         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
709
710         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
711         (WebKit::WebSWContextManagerConnection::terminateWorker):
712         (WebKit::WebSWContextManagerConnection::workerTerminated):
713         * WebProcess/Storage/WebSWContextManagerConnection.h:
714         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
715
716 2017-11-15  Brent Fulgham  <bfulgham@apple.com>
717
718         Remove access to 'com.apple.mediaaccessibility.public' preferences in WebContent sandbox
719         https://bugs.webkit.org/show_bug.cgi?id=179747
720         <rdar://problem/35367346>
721
722         Reviewed by Dean Jackson.
723
724         The 'mediaaccessibilityd' process handles access to MediaAccessibility preferences. We don't need
725         to grant the WebContent Process sandbox access to them.
726
727         * WebProcess/com.apple.WebProcess.sb.in: 
728
729 2017-11-15  Alex Christensen  <achristensen@webkit.org>
730
731         Revert r224885
732         https://bugs.webkit.org/show_bug.cgi?id=179719
733
734         * UIProcess/API/APIContentRuleListStore.cpp:
735         (API::compiledToFile):
736         r224885 was a speculative fix that did not fix anything on the bots.
737
738 2017-11-15  Brent Fulgham  <bfulgham@apple.com>
739
740         Unreviewed build fix after r224830.
741
742         * WebProcess/com.apple.WebProcess.sb.in: Add missing sysctl-read permissions needed
743         to support testing on Mac Mini hardware.
744
745 2017-11-15  Youenn Fablet  <youenn@apple.com>
746
747         Add ServiceWorker to WebProcess plumbery for FormData fetch responses
748         https://bugs.webkit.org/show_bug.cgi?id=179694
749
750         Reviewed by Alex Christensen.
751
752         Added plumbery from Service Worker up to Web Process to pass form data response bodies.
753         A follow-up patch should read the data from Network Process and send it to the ResourceLoader.
754
755         * Platform/IPC/FormDataReference.h: Added.
756         (IPC::FormDataReference::FormDataReference):
757         (IPC::FormDataReference::takeData):
758         (IPC::FormDataReference::encode const):
759         (IPC::FormDataReference::decode):
760         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
761         (WebKit::WebSWServerConnection::didReceiveFetchFormData):
762         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
763         * StorageProcess/StorageProcess.cpp:
764         (WebKit::StorageProcess::didReceiveFetchFormData):
765         * StorageProcess/StorageProcess.h:
766         * StorageProcess/StorageProcess.messages.in:
767         * WebKit.xcodeproj/project.pbxproj:
768         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
769         (WebKit::ServiceWorkerClientFetch::didReceiveFormData):
770         * WebProcess/Storage/ServiceWorkerClientFetch.h:
771         * WebProcess/Storage/ServiceWorkerClientFetch.messages.in:
772         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
773         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveFormData):
774         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:
775
776 2017-11-15  Alex Christensen  <achristensen@webkit.org>
777
778         Move a compiled WKContentRuleList to its destination before calling mmap
779         https://bugs.webkit.org/show_bug.cgi?id=179719
780
781         Reviewed by Brady Eidson.
782
783         Right now we compile a WKContentRuleList to a temporary file, call mmap, close the file, then move it.
784         Sometimes, especially on bots running tests, the move fails because the temporary file doesn't exist
785         any more.  Moving the file before mmaping and closing the file might prevent this failure.
786
787         * UIProcess/API/APIContentRuleListStore.cpp:
788         (API::compiledToFile):
789
790 2017-11-15  Chris Dumez  <cdumez@apple.com>
791
792         [Service Workers] Implement Client API
793         https://bugs.webkit.org/show_bug.cgi?id=179709
794
795         Reviewed by Alex Christensen.
796
797         * Shared/WebCoreArgumentCoders.cpp:
798         * Shared/WebCoreArgumentCoders.h:
799         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
800         (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope):
801         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
802         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
803         * WebProcess/Storage/WebSWClientConnection.cpp:
804         (WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope):
805         * WebProcess/Storage/WebSWClientConnection.h:
806         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
807         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerGlobalScope):
808         * WebProcess/Storage/WebSWContextManagerConnection.h:
809         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
810
811 2017-11-15  Ryan Haddad  <ryanhaddad@apple.com>
812
813         Unreviewed, rolling out r224863.
814
815         Introduced LayoutTest crashes on iOS Simulator.
816
817         Reverted changeset:
818
819         "Move JSONValues to WTF and convert uses of InspectorValues.h
820         to JSONValues.h"
821         https://bugs.webkit.org/show_bug.cgi?id=173793
822         https://trac.webkit.org/changeset/224863
823
824 2017-11-14  Brent Fulgham  <bfulgham@apple.com>
825
826         Remove access to "com.apple.pbs.fetch_services" from WebContent sandbox
827         https://bugs.webkit.org/show_bug.cgi?id=179689
828         <rdar://problem/35369172>
829
830         Reviewed by Per Arne Vollan.
831
832         WebKit's WebContent process should not have any need to interact with the fetch_services
833         API exposed to the system. These interactions (if needed) should be happening in the UIProcess,
834         so we should prevent the untrusted Web Content Process from being able to connect.
835
836         * WebProcess/com.apple.WebProcess.sb.in:
837
838 2017-11-15  Michael Catanzaro  <mcatanzaro@igalia.com>
839
840         Remove GTK web inspector images
841         https://bugs.webkit.org/show_bug.cgi?id=179716
842
843         Reviewed by Carlos Garcia Campos.
844
845         * InspectorGResources.cmake:
846
847 2017-11-15  Gabriel Ivascu  <givascu@igalia.com>
848
849         [GTK] Automatically adjust font size when gtk-xft-dpi changes
850         https://bugs.webkit.org/show_bug.cgi?id=142673
851
852         Some follow-up fixes for the previous patch.
853
854         Reviewed by Carlos Garcia Campos.
855
856         * UIProcess/API/glib/WebKitSettings.cpp:
857         (webKitSettingsDispose):
858         (webKitSettingsConstructed):
859
860 2017-11-14  Nan Wang  <n_wang@apple.com>
861
862         AX: AOM: Implement AccessibleNode class and support label and role attributes
863         https://bugs.webkit.org/show_bug.cgi?id=179494
864
865         Reviewed by Ryosuke Niwa.
866
867         * Shared/WebPreferences.yaml:
868         * UIProcess/API/C/WKPreferences.cpp:
869         (WKPreferencesSetAccessibilityObjectModelEnabled):
870         (WKPreferencesGetAccessibilityObjectModelEnabled):
871         * UIProcess/API/C/WKPreferencesRefPrivate.h:
872
873 2017-11-14  Carlos Garcia Campos  <cgarcia@igalia.com>
874
875         Move JSONValues to WTF and convert uses of InspectorValues.h to JSONValues.h
876         https://bugs.webkit.org/show_bug.cgi?id=173793
877
878         Reviewed by Brian Burg.
879
880         Based on patch by Brian Burg.
881
882         * UIProcess/Automation/WebAutomationSession.cpp:
883         (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext):
884         (WebKit::WebAutomationSession::moveWindowOfBrowsingContext):
885         (WebKit::WebAutomationSession::waitForNavigationToCompleteOnPage):
886         (WebKit::WebAutomationSession::waitForNavigationToCompleteOnFrame):
887         (WebKit::WebAutomationSession::respondToPendingPageNavigationCallbacksWithTimeout):
888         (WebKit::WebAutomationSession::respondToPendingFrameNavigationCallbacksWithTimeout):
889         (WebKit::WebAutomationSession::navigationOccurredForFrame):
890         (WebKit::WebAutomationSession::documentLoadedForFrame):
891         (WebKit::WebAutomationSession::inspectorFrontendLoaded):
892         (WebKit::WebAutomationSession::keyboardEventsFlushedForPage):
893         (WebKit::WebAutomationSession::evaluateJavaScriptFunction):
894         (WebKit::WebAutomationSession::setFilesToSelectForFileUpload):
895         (WebKit::WebAutomationSession::addSingleCookie):
896         (WebKit::WebAutomationSession::setSessionPermissions):
897         (WebKit::WebAutomationSession::performMouseInteraction):
898         (WebKit::WebAutomationSession::performKeyboardInteractions):
899         * UIProcess/Automation/WebAutomationSession.h:
900
901 2017-11-14  Chris Dumez  <cdumez@apple.com>
902
903         [Service Workers] Implement container.getRegistrations()
904         https://bugs.webkit.org/show_bug.cgi?id=179672
905
906         Reviewed by Brady Eidson.
907
908         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
909         (WebKit::WebSWServerConnection::getRegistrations):
910         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
911         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
912         * WebProcess/Storage/WebSWClientConnection.cpp:
913         (WebKit::WebSWClientConnection::didGetRegistrations):
914         (WebKit::WebSWClientConnection::getRegistrations):
915         * WebProcess/Storage/WebSWClientConnection.h:
916         * WebProcess/Storage/WebSWClientConnection.messages.in:
917
918 2017-11-14  Youenn Fablet  <youenn@apple.com>
919
920         Implement ServiceWorker handle fetch for navigation loads
921         https://bugs.webkit.org/show_bug.cgi?id=179404
922
923         Reviewed by Alex Christensen and Chris Dumez.
924
925         Update handle fetch algorithm to support navigation requests.
926         In case of navigation requests, set service worker response mime type to text/html if none is provided.
927
928         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
929         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
930         * WebProcess/Storage/WebSWClientConnection.cpp:
931         (WebKit::WebSWClientConnection::startFetch):
932         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
933         (WebKit::shouldHandleFetch):
934         (WebKit::WebServiceWorkerProvider::handleFetch):
935
936 2017-11-14  Alex Christensen  <achristensen@webkit.org>
937
938         Remove Cocoa CFURLConnection loading code
939         https://bugs.webkit.org/show_bug.cgi?id=179688
940
941         Reviewed by Antti Koivisto.
942
943         * NetworkProcess/Downloads/Download.h:
944
945 2017-11-14  Daniel Bates  <dabates@apple.com>
946
947         Update comment in FeatureDefines.xcconfig to reflect location of Visual Studio property files
948         for feature defines
949
950         Following r195498 and r201917 the Visual Studio property files for feature defines have
951         moved from directory WebKitLibraries/win/tools/vsprops to directory Source/cmake/tools/vsprops.
952         Update the comment in FeatureDefines.xcconfig to reflect the new location and names of these
953         files.
954
955         * Configurations/FeatureDefines.xcconfig:
956
957 2017-11-14  Brent Fulgham  <bfulgham@apple.com>
958
959         Whitelist some IOKIt properties to avoid sandbox violations on YouTube
960         https://bugs.webkit.org/show_bug.cgi?id=179683
961         <rdar://problem/35415368>
962
963         Reviewed by Dean Jackson.
964
965         YouTube video playback on some hardware (and some video encodings) generates sandbox violations. Add
966         whitelist entries for the relevant IOKit properties needed to support these activities.
967
968         * WebProcess/com.apple.WebProcess.sb.in:
969
970 2017-11-14  Daniel Bates  <dabates@apple.com>
971
972         Mark WebChromeClient::requestStorageAccess() as final
973         https://bugs.webkit.org/show_bug.cgi?id=179673
974
975         Reviewed by Sam Weinig.
976
977         Mark WebChromeClient::requestStorageAccess() as final so that it overrides the virtual function
978         in ChromeClient with the same name and hence we actually call it through a ChromeClient pointer.
979
980         * WebProcess/WebCoreSupport/WebChromeClient.h:
981
982 2017-11-14  Youenn Fablet  <youenn@apple.com>
983
984         WebSWClientConnection should do IPC to StorageProcess if its WebSWOriginTable is not yet initialized
985         https://bugs.webkit.org/show_bug.cgi?id=179668
986
987         Reviewed by Chris Dumez.
988
989         There may be cases where the origin table is not initialized and we would think there is no service worker registration.
990         In such a case, we should go to the StorageProcess.
991         StorageProcess is now sending an IPC message back to each registered SW connection so that WebProcess will know whether its map
992         is correctly initialized or not.
993
994         Renaming hasServiceWorkerRegisteredForOrigin in mayHaveServiceWorkerRegisteredForOrigin.
995
996         * WebProcess/Storage/WebSWClientConnection.cpp:
997         (WebKit::WebSWClientConnection::mayHaveServiceWorkerRegisteredForOrigin const):
998         (WebKit::WebSWClientConnection::matchRegistration):
999         (WebKit::WebSWClientConnection::hasServiceWorkerRegisteredForOrigin const): Deleted.
1000         * WebProcess/Storage/WebSWClientConnection.h:
1001         * WebProcess/Storage/WebSWOriginTable.h:
1002         (WebKit::WebSWOriginTable::isInitialized const):
1003         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
1004         (WebKit::shouldHandleFetch):
1005
1006 2017-11-14  Brent Fulgham  <bfulgham@apple.com>
1007
1008         Consolidate sysctl-read rules in WebProcess sandbox
1009         https://bugs.webkit.org/show_bug.cgi?id=179674
1010         <rdar://problem/35367154>
1011
1012         Reviewed by Dean Jackson.
1013
1014         Consolidate the various calls to 'allow sysctl-read' imported during Bug 179548 into
1015         the main function in the sandbox profile.
1016
1017         Remove the statement to grant global sysctl-read permissions that was copied into this
1018         sandbox profile in an earlier checkin. We started blocking the blanket read permissions in
1019         macOS 10.13, and want to continue to do so.
1020         
1021         The earlier "grant global read access" in 'system.sb' apparently allowed some sysctl reads
1022         to occur before we hit the block declaration in the WebContent sandbox. Now that we are
1023         consistently blocking systcl reads from the start, we need to add whitelist entries for a
1024         few more entries to avoid creating new sandbox violations.
1025
1026         * WebProcess/com.apple.WebProcess.sb.in:
1027
1028 2017-11-14  Alex Christensen  <achristensen@webkit.org>
1029
1030         Remove WebKit CFURLConnection code
1031         https://bugs.webkit.org/show_bug.cgi?id=179645
1032
1033         Reviewed by Alexey Proskuryakov.
1034
1035         The CFURLConnection code is Windows-specific now. Nobody can use it in modern WebKit.
1036
1037         * NetworkProcess/Downloads/Download.h:
1038         * NetworkProcess/Downloads/mac/DownloadMac.mm:
1039         * NetworkProcess/NetworkLoad.h:
1040         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1041         (WebKit::serverTrustCredential):
1042         * NetworkProcess/mac/NetworkLoadMac.mm:
1043         * Shared/Authentication/AuthenticationManager.cpp:
1044         (WebKit::AuthenticationManager::useCredentialForSingleChallenge):
1045         (WebKit::AuthenticationManager::continueWithoutCredentialForSingleChallenge):
1046         (WebKit::AuthenticationManager::cancelSingleChallenge):
1047         (WebKit::AuthenticationManager::performDefaultHandlingForSingleChallenge):
1048         (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge):
1049         * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
1050         * Shared/Authentication/mac/AuthenticationManager.mac.mm:
1051         (WebKit::AuthenticationManager::tryUseCertificateInfoForChallenge):
1052         * Shared/WebProcessCreationParameters.cpp:
1053         (WebKit::WebProcessCreationParameters::encode const):
1054         (WebKit::WebProcessCreationParameters::decode):
1055         * Shared/WebProcessCreationParameters.h:
1056         * Shared/mac/WebCoreArgumentCodersMac.mm:
1057         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
1058         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
1059         * config.h:
1060
1061 2017-11-14  Alex Christensen  <achristensen@webkit.org>
1062
1063         Remove assertions added in r224791
1064         https://bugs.webkit.org/show_bug.cgi?id=178751#c10
1065
1066         * NetworkProcess/mac/RemoteNetworkingContext.mm:
1067         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
1068         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
1069         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
1070         I had added assertions that sandbox extension handle consumption succeeds.
1071         In the API test IndexedDB.StructuredCloneBackwardCompatibility we get a sandbox extension handle
1072         to give access to a directory that does not exist and consumption fails.  We want it to fail,
1073         so my optimistic addition of a success assertion was incorrect.  The test passes without it
1074         and behaves like it used to.
1075
1076 2017-11-14  Tim Horton  <timothy_horton@apple.com>
1077
1078         Don't use -[NSString stringWithFormat:] to build defaults keys
1079         https://bugs.webkit.org/show_bug.cgi?id=179680
1080
1081         Reviewed by Simon Fraser.
1082
1083         * UIProcess/mac/WebPreferencesMac.mm:
1084         (WebKit::makeKey):
1085         (WebKit::debugUserDefaultsValue):
1086         Use string concatenation instead of stringWithFormat to build
1087         preference keys. This wasn't a huge cost, but it shaves a few milliseconds
1088         off process launch.
1089
1090 2017-11-14  Alex Christensen  <achristensen@webkit.org>
1091
1092         Clean up old URL parser remnants
1093         https://bugs.webkit.org/show_bug.cgi?id=179573
1094
1095         Reviewed by Darin Adler.
1096
1097         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
1098         (WebKit::WebContextMenuClient::searchWithGoogle):
1099         Use https if we do end up searching with google.
1100
1101 2017-11-14  Antti Koivisto  <antti@apple.com>
1102
1103         Enable display:contents by default
1104         https://bugs.webkit.org/show_bug.cgi?id=179655
1105
1106         Reviewed by Sam Weinig.
1107
1108         * Shared/WebPreferences.yaml:
1109
1110         Make non-experimental and enabled.
1111
1112 2017-11-10  Brent Fulgham  <bfulgham@apple.com>
1113
1114         Consolidate mach-lookup calls in WebProcess sandbox
1115         https://bugs.webkit.org/show_bug.cgi?id=179650
1116         <rdar://problem/35367154>
1117
1118         Reviewed by Dean Jackson.
1119
1120         Consolidate the various calls to 'allow mach-lookup' imported during Bug 179548 into the main
1121         function in the sandbox profile. Remove some entries that are not needed by WebKit.
1122
1123         Remove the statement to grant global permission to perform mach-lookup for any xpc
1124         service name that was copied into this sandbox profile in Bug 179548. We started blocking
1125         this in macOS 10.13 and want to continue to do so.
1126         
1127         The earlier "grant global permission" in 'system.sb' apparently allowed some xpc lookups to occur
1128         before we hit the block declaration in the WebContent sandbox. Now that we are consistently blocking
1129         mach lookups we need to add whitelist entries for a few more services to avoid creating new
1130         sandbox violations.
1131
1132         * WebProcess/com.apple.WebProcess.sb.in:
1133
1134 2017-11-14  Tim Horton  <timothy_horton@apple.com>
1135
1136         Long pressing a phone number with spaces in it results in a link sheet instead of a data detectors sheet
1137         https://bugs.webkit.org/show_bug.cgi?id=179646
1138         <rdar://problem/35337288>
1139
1140         Reviewed by Simon Fraser.
1141
1142         * UIProcess/ios/WKActionSheetAssistant.mm:
1143         (-[WKActionSheetAssistant showImageSheet]):
1144         (-[WKActionSheetAssistant showLinkSheet]):
1145         (-[WKActionSheetAssistant showDataDetectorsSheet]):
1146         * UIProcess/ios/WKContentViewInteraction.mm:
1147         (-[WKContentView _actionForLongPressFromPositionInformation:]):
1148         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
1149         Make use of canBePresentedByDataDetectors with our WebCore URL instead
1150         of (sometimes unsucessfully) reparsing the URL with NSURL's parser.
1151         Also, avoid a few unnecessary round-trips through String when converting
1152         from URL to NSURL.
1153
1154 2017-11-14  Brent Fulgham  <bfulgham@apple.com>
1155
1156         REGRESSION(r224799): WebKit crashes on Sierra due to sandbox violation
1157         https://bugs.webkit.org/show_bug.cgi?id=179656
1158         
1159         Unreviewed build fix.
1160
1161         * WebProcess/com.apple.WebProcess.sb.in: Switch to Dan's recommended version check.
1162
1163 2017-11-13  Joseph Pecoraro  <pecoraro@apple.com>
1164
1165         Give a ServiceWorker WebContentProcess a different display name
1166         https://bugs.webkit.org/show_bug.cgi?id=179653
1167
1168         Reviewed by Brady Eidson.
1169
1170         * UIProcess/WebProcessProxy.h:
1171         * UIProcess/WebProcessProxy.cpp:
1172         (WebKit::WebProcessProxy::create):
1173         Call connect after construction so virtual methods will use subclass implementations.
1174
1175         * UIProcess/ServiceWorkerProcessProxy.h:
1176         * UIProcess/ServiceWorkerProcessProxy.cpp:
1177         (WebKit::ServiceWorkerProcessProxy::create):
1178         Copy the pattern from WebProcessProxy to ensure connect() gets called after construction.
1179
1180         (WebKit::ServiceWorkerProcessProxy::getLaunchOptions):
1181         Set a launch option to signal this is a Service Worker process.
1182
1183         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
1184         (WebKit::XPCServiceInitializerDelegate::getExtraInitializationData):
1185         * WebProcess/cocoa/WebProcessCocoa.mm:
1186         (WebKit::WebProcess::initializeProcessName):
1187         Consume the launch option to configuration the process name.
1188
1189 2017-11-13  Ryosuke Niwa  <rniwa@webkit.org>
1190
1191         REGRESSION(r224799): WebKit crashes at launch on macOS Sierra due to a sandbox violation
1192         https://bugs.webkit.org/show_bug.cgi?id=179656
1193
1194         Unreviewed. Revert r224799 on macOS Sierra.
1195
1196         * WebProcess/com.apple.WebProcess.sb.in:
1197
1198 2017-11-13  Chris Dumez  <cdumez@apple.com>
1199
1200         Send ServiceWorkerData structs to the WebProcesses instead of ServiceWorkerIdentifiers
1201         https://bugs.webkit.org/show_bug.cgi?id=179649
1202
1203         Reviewed by Brady Eidson.
1204
1205         * Shared/WebCoreArgumentCoders.h:
1206         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1207         (WebKit::WebSWServerConnection::updateRegistrationStateInClient):
1208         (WebKit::WebSWServerConnection::postMessageToServiceWorkerClient):
1209         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1210         * WebProcess/Storage/WebSWClientConnection.cpp:
1211         (WebKit::WebSWClientConnection::postMessageToServiceWorkerClient):
1212         * WebProcess/Storage/WebSWClientConnection.h:
1213         * WebProcess/Storage/WebSWClientConnection.messages.in:
1214
1215 2017-11-13  Brady Eidson  <beidson@apple.com>
1216
1217         Massive "Server-process-to-context-process" connection overhaul.
1218         https://bugs.webkit.org/show_bug.cgi?id=179554
1219
1220         Reviewed by Chris Dumez.
1221
1222         * DerivedSources.make:
1223         * WebKit.xcodeproj/project.pbxproj:
1224
1225         * Shared/WebCoreArgumentCoders.h:
1226
1227         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1228         (WebKit::WebSWServerConnection::sendToContextProcess):
1229         (WebKit::WebSWServerConnection::installServiceWorkerContext): Deleted.
1230         (WebKit::WebSWServerConnection::fireInstallEvent): Deleted.
1231         (WebKit::WebSWServerConnection::fireActivateEvent): Deleted.
1232         (WebKit::WebSWServerConnection::setContextConnection): Deleted.
1233         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1234
1235         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp: Copied from Source/WebCore/workers/service/server/SWServerWorker.cpp.
1236         (WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
1237         (WebKit::WebSWServerToContextConnection::messageSenderConnection):
1238         (WebKit::WebSWServerToContextConnection::messageSenderDestinationID):
1239         (WebKit::WebSWServerToContextConnection::connectionClosed):
1240         (WebKit::WebSWServerToContextConnection::installServiceWorkerContext):
1241         (WebKit::WebSWServerToContextConnection::fireInstallEvent):
1242         (WebKit::WebSWServerToContextConnection::fireActivateEvent):
1243         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h: Copied from Source/WebCore/workers/service/ServiceWorkerTypes.h.
1244         (WebKit::WebSWServerToContextConnection::create):
1245         (WebKit::WebSWServerToContextConnection::ipcConnection const):
1246         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in: Copied from Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.messages.in.
1247
1248         * StorageProcess/StorageProcess.cpp:
1249         (WebKit::StorageProcess::didClose):
1250         (WebKit::StorageProcess::didReceiveMessage):
1251         (WebKit::StorageProcess::globalServerToContextConnection):
1252         (WebKit::StorageProcess::createServerToContextConnection):
1253         (WebKit::StorageProcess::didGetWorkerContextProcessConnection):
1254         (WebKit::StorageProcess::workerContextProcessConnection): Deleted.
1255         (WebKit::StorageProcess::createWorkerContextProcessConnection): Deleted.
1256         (WebKit::StorageProcess::serviceWorkerContextFailedToStart): Deleted.
1257         (WebKit::StorageProcess::serviceWorkerContextStarted): Deleted.
1258         (WebKit::StorageProcess::didFinishServiceWorkerInstall): Deleted.
1259         (WebKit::StorageProcess::didFinishServiceWorkerActivation): Deleted.
1260         (WebKit::StorageProcess::setServiceWorkerHasPendingEvents): Deleted.
1261         * StorageProcess/StorageProcess.h:
1262         * StorageProcess/StorageProcess.messages.in:
1263
1264         * StorageProcess/StorageToWebProcessConnection.cpp:
1265         (WebKit::StorageToWebProcessConnection::didReceiveMessage):
1266         (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
1267         (WebKit::StorageToWebProcessConnection::workerContextProcessConnectionCreated):
1268
1269         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1270         (WebKit::WebSWContextManagerConnection::installServiceWorker):
1271         (WebKit::WebSWContextManagerConnection::serviceWorkerStartedWithMessage):
1272         (WebKit::WebSWContextManagerConnection::fireInstallEvent):
1273         (WebKit::WebSWContextManagerConnection::fireActivateEvent):
1274         (WebKit::WebSWContextManagerConnection::didFinishInstall):
1275         (WebKit::WebSWContextManagerConnection::didFinishActivation):
1276         (WebKit::WebSWContextManagerConnection::setServiceWorkerHasPendingEvents):
1277         * WebProcess/Storage/WebSWContextManagerConnection.h:
1278         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
1279
1280 2017-11-13  Brent Fulgham  <bfulgham@apple.com>
1281
1282         WebContent sandbox should not include 'system.sb'
1283         https://bugs.webkit.org/show_bug.cgi?id=179548
1284         <rdar://problem/35367154>
1285
1286         Reviewed by Darin Adler.
1287
1288         Stop including 'system.sb', and just include the portions of that sandbox that we
1289         actually use in WebContent Process. This is the first step in some further sandbox
1290         tightening.
1291
1292         * WebProcess/com.apple.WebProcess.sb.in:
1293
1294 2017-11-13  Simon Fraser  <simon.fraser@apple.com>
1295
1296         When navigating back to a page, compositing layers may not use accelerated drawing
1297         https://bugs.webkit.org/show_bug.cgi?id=178749
1298         rdar://problem/35158946
1299
1300         Reviewed by Dean Jackson.
1301
1302         Avoid assertions when a test enables accelerated drawing (which we can't support
1303         in the iOS simulator).
1304
1305         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
1306         (WebKit::RemoteLayerBackingStore::ensureBackingStore):
1307
1308 2017-11-13  Youenn Fablet  <youenn@apple.com>
1309
1310         matchRegistration does not need to go to StorageProcess if no service worker is registered
1311         https://bugs.webkit.org/show_bug.cgi?id=179480
1312
1313         Reviewed by Chris Dumez.
1314
1315         Removed origin store handling from StorageProcess since it is now handled within SWServer.
1316         Updated clearing of web site data accordingly.
1317         Optimized matchRegistration by looking at the origin store before doing any IPC.
1318         Do IPC to the StorageProcess if the origin store is not yet initialized on the WebProcess.
1319
1320         * StorageProcess/ServiceWorker/WebSWOriginStore.h:
1321         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1322         (WebKit::WebSWServerConnection::resolveRegistrationJobInClient):
1323         (WebKit::WebSWServerConnection::resolveUnregistrationJobInClient):
1324         * StorageProcess/StorageProcess.cpp:
1325         (WebKit::StorageProcess::deleteWebsiteData):
1326         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
1327         (WebKit::StorageProcess::swServerForSession):
1328         (WebKit::StorageProcess::swOriginStoreForSession):
1329         (WebKit::StorageProcess::registerSWServerConnection):
1330         (WebKit::StorageProcess::unregisterSWServerConnection):
1331         (WebKit::StorageProcess::ensureSWOriginStoreForSession): Deleted.
1332         (WebKit::StorageProcess::swOriginStoreForSession const): Deleted.
1333         * StorageProcess/StorageProcess.h:
1334         * StorageProcess/ServiceWorker/WebSWOriginStore.cpp:
1335         (WebKit::WebSWOriginStore::addToStore):
1336         (WebKit::WebSWOriginStore::removeFromStore):
1337         (WebKit::WebSWOriginStore::clearStore):
1338         (WebKit::WebSWOriginStore::add): Deleted.
1339         (WebKit::WebSWOriginStore::remove): Deleted.
1340         (WebKit::WebSWOriginStore::clear): Deleted.
1341         * StorageProcess/ServiceWorker/WebSWOriginStore.h:
1342         * WebProcess/Storage/WebSWClientConnection.cpp:
1343         (WebKit::WebSWClientConnection::matchRegistration):
1344
1345 2017-11-13  Alex Christensen  <achristensen@webkit.org>
1346
1347         Merge NetworkProcess::EnsurePrivateBrowsingSession and NetworkProcess::AddWebsiteDataStore into one message type
1348         https://bugs.webkit.org/show_bug.cgi?id=178751
1349
1350         Reviewed by Brady Eidson.
1351
1352         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1353         (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession):
1354         * NetworkProcess/NetworkProcess.cpp:
1355         (WebKit::NetworkProcess::initializeNetworkProcess):
1356         (WebKit::NetworkProcess::ensurePrivateBrowsingSession): Deleted.
1357         * NetworkProcess/NetworkProcess.h:
1358         * NetworkProcess/NetworkProcess.messages.in:
1359         * NetworkProcess/RemoteNetworkingContext.h:
1360         * NetworkProcess/mac/RemoteNetworkingContext.mm:
1361         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
1362         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession): Deleted.
1363         * Shared/WebsiteDataStoreParameters.cpp:
1364         (WebKit::WebsiteDataStoreParameters::legacyPrivateSessionParameters):
1365         * Shared/WebsiteDataStoreParameters.h:
1366         * UIProcess/WebProcessPool.cpp:
1367         (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
1368         (WebKit::WebProcessPool::createNewWebProcess):
1369         (WebKit::WebProcessPool::pageAddedToProcess):
1370         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1371         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
1372         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
1373         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
1374         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
1375         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession): Deleted.
1376         * WebProcess/WebPage/WebPage.cpp:
1377         (WebKit::WebPage::setSessionID):
1378         * WebProcess/WebProcess.cpp:
1379         (WebKit::WebProcess::ensurePrivateBrowsingSession): Deleted.
1380         * WebProcess/WebProcess.h:
1381         * WebProcess/WebProcess.messages.in:
1382
1383 2017-11-13  Alex Christensen  <achristensen@webkit.org>
1384
1385         Add logs to debug content extension test failures
1386         https://bugs.webkit.org/show_bug.cgi?id=179624
1387
1388         Reviewed by Chris Dumez.
1389
1390         * UIProcess/API/APIContentRuleListStore.cpp:
1391         (API::compiledToFile):
1392         Right now I'm seeing this log:
1393         "Rule list compilation failed: Unspecified error during compile."
1394         I need more information to debug what is failing on the bots.
1395
1396 2017-11-07  Brian Burg  <bburg@apple.com>
1397
1398         Web Automation: inViewCenterPoint should not include topContentInset when computed in viewport coordinates
1399         https://bugs.webkit.org/show_bug.cgi?id=179129
1400         <rdar://problem/35297038>
1401
1402         Reviewed by Simon Fraser.
1403
1404         When computing the in view center point per W3C specification, the top content inset
1405         is inadvertently added back in when converting to the root view coordinate system.
1406
1407         This patch reworks the protocol command so that it explicitly requests a coordinate
1408         system, with options for "Page" (root / contents), "LayoutViewport", and "VisualViewport".
1409         The latter is not implemented in this patch, since it is intended for use on iOS someday.
1410
1411         * UIProcess/Automation/Automation.json:
1412         Change usesViewport to CoordinateSystem.
1413         Add a new coordinate system enum type and use it.
1414         Fix relevant comments for Automation.computElementLayout.
1415
1416         * UIProcess/Automation/WebAutomationSession.h:
1417         * UIProcess/Automation/WebAutomationSession.cpp:
1418         (WebKit::protocolStringToCoordinateSystem):
1419         (WebKit::WebAutomationSession::computeElementLayout):
1420         Parse the requested coordinate system and send it in the message to the web process.
1421
1422         * WebKit.xcodeproj/project.pbxproj:
1423         * WebProcess/Automation/WebAutomationSessionProxy.messages.in:
1424         * WebProcess/Automation/WebAutomationSessionProxy.h:
1425         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
1426         (WebKit::WebAutomationSessionProxy::computeElementLayout):
1427         Rework the implementation. Get the element bounds and in-view center point in
1428         client coordinates and convert back to root view coordinates for CoordinateSystem::Page.
1429
1430 2017-11-08  Keith Miller  <keith_miller@apple.com>
1431
1432         Async iteration should only fetch the next method once and add feature flag
1433         https://bugs.webkit.org/show_bug.cgi?id=179451
1434
1435         Reviewed by Geoffrey Garen.
1436
1437         Add feature flag for Async iteration.
1438
1439         * Configurations/FeatureDefines.xcconfig:
1440
1441 2017-11-13  Mark Lam  <mark.lam@apple.com>
1442
1443         Add more overflow check book-keeping for MarkedArgumentBuffer.
1444         https://bugs.webkit.org/show_bug.cgi?id=179634
1445         <rdar://problem/35492517>
1446
1447         Reviewed by Saam Barati.
1448
1449         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
1450         (WebKit::NPJSObject::construct):
1451         (WebKit::NPJSObject::invoke):
1452
1453 2017-11-13  Timothy Horton  <timothy_horton@apple.com>
1454
1455         Address some post-landing review comments from r224728
1456         https://bugs.webkit.org/show_bug.cgi?id=179576
1457
1458         * Platform/IPC/mac/MachMessage.h:
1459         (IPC::MachMessage::setMessageReceiverName):
1460         (IPC::MachMessage::setMessageName):
1461         More moving!
1462
1463 2017-11-13  Tim Horton  <timothy_horton@apple.com>
1464
1465         Occasional MobileSafari crash under -[WKPDFView web_setMinimumSize:]
1466         https://bugs.webkit.org/show_bug.cgi?id=179628
1467         <rdar://problem/34773037>
1468
1469         Reviewed by Simon Fraser.
1470
1471         * UIProcess/ios/WKPDFView.mm:
1472         (-[WKPDFView _computePageAndDocumentFrames]):
1473         Similar to r223444, avoid propagating null CGRects into the view hierarchy.
1474         In this case, the null rect comes from applying margins to a rect that is 
1475         smaller than the margins. We could check for that specifically, but a
1476         more-general check for a null rect seems reasonable.
1477
1478 2017-11-13  Tim Horton  <timothy_horton@apple.com>
1479
1480         Use the real mach type instead of reinterpret_casting in MachMessage
1481         https://bugs.webkit.org/show_bug.cgi?id=179629
1482
1483         Reviewed by Dan Bernstein.
1484
1485         * Platform/IPC/mac/MachMessage.cpp:
1486         (IPC::MachMessage::header):
1487         * Platform/IPC/mac/MachMessage.h:
1488         Just use mach_msg_header_t proper, and avoid the reinterpret_cast.
1489         This also corrects the alignment of the struct on platforms where
1490         alignof(mach_msg_header_t) != alignof(uint8_t).
1491
1492 2017-11-13  Gabriel Ivascu  <givascu@igalia.com>
1493
1494         [GTK] Automatically adjust font size when gtk-xft-dpi changes
1495         https://bugs.webkit.org/show_bug.cgi?id=142673
1496
1497         Reviewed by Michael Catanzaro.
1498
1499         * UIProcess/API/glib/WebKitSettings.cpp:
1500         (webKitSettingsDispose):
1501         (webKitSettingsConstructed):
1502         (webkit_settings_class_init):
1503
1504 2017-11-13  Chris Dumez  <cdumez@apple.com>
1505
1506         Implement "Service Worker Has No Pending Events" / "Update Service Worker Extended Events Set" algorithms
1507         https://bugs.webkit.org/show_bug.cgi?id=179618
1508
1509         Reviewed by Brady Eidson.
1510
1511         * StorageProcess/StorageProcess.cpp:
1512         (WebKit::StorageProcess::setServiceWorkerHasPendingEvents):
1513         * StorageProcess/StorageProcess.h:
1514         * StorageProcess/StorageProcess.messages.in:
1515         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1516         (WebKit::WebSWContextManagerConnection::setServiceWorkerHasPendingEvents):
1517         * WebProcess/Storage/WebSWContextManagerConnection.h:
1518
1519 2017-11-13  Wenson Hsieh  <wenson_hsieh@apple.com>
1520
1521         [Attachment Support] Implement SPI for clients to request data for a given attachment
1522         https://bugs.webkit.org/show_bug.cgi?id=179586
1523         <rdar://problem/35355720>
1524
1525         Reviewed by Darin Adler.
1526
1527         Adds support in WebKit for fetching data for a given attachment element. See WebCore/ChangeLog for more details.
1528         Most of the changes here are boilerplate plumbing of -requestAttachmentData through the client layers.
1529
1530         Test coverage by augmenting existing API tests in WKAttachmentTests, and adding 3 new tests.
1531
1532         * UIProcess/API/APIAttachment.cpp:
1533         (API::Attachment::requestData):
1534         * UIProcess/API/APIAttachment.h:
1535         * UIProcess/API/Cocoa/_WKAttachment.h:
1536         * UIProcess/API/Cocoa/_WKAttachment.mm:
1537         (-[_WKAttachment requestData:]):
1538         * UIProcess/WebPageProxy.cpp:
1539         (WebKit::WebPageProxy::sharedBufferCallback):
1540
1541         Add a new IPC callback helper type, SharedBufferCallback. This is similar to the existing DataCallback, but
1542         instead of deserializing to an API::Data, we convert to a SharedBuffer instead. Additionally,
1543         SharedBufferCallback is able to draw a distinction between null data and empty data. This allows -requestData:
1544         to distinguish between cases where (for instance) the data for a given attachment is an empty blob, and when
1545         the attachment doesn't exist at all.
1546
1547         (WebKit::WebPageProxy::dataCallback):
1548         (WebKit::WebPageProxy::insertAttachment):
1549         (WebKit::WebPage::invokeSharedBufferCallback):
1550         (WebKit::WebPageProxy::requestAttachmentData):
1551         * UIProcess/WebPageProxy.h:
1552         * UIProcess/WebPageProxy.messages.in:
1553         * WebProcess/WebPage/WebPage.cpp:
1554         (WebKit::WebPage::requestAttachmentData):
1555         * WebProcess/WebPage/WebPage.h:
1556         * WebProcess/WebPage/WebPage.messages.in:
1557
1558 2017-11-12  Darin Adler  <darin@apple.com>
1559
1560         More is<> and downcast<>, less static_cast<>
1561         https://bugs.webkit.org/show_bug.cgi?id=179600
1562
1563         Reviewed by Chris Dumez.
1564
1565         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivate.cpp:
1566         (WebKit::wrap): Use is/downcast.
1567         * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
1568         (WebKit::WebEditorClient::handleKeyboardEvent): Ditto.
1569         * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp:
1570         (WebKit::WebEditorClient::handleKeyboardEvent): Ditto.
1571         * WebProcess/WebPage/WebPage.cpp:
1572         (WebKit::WebPage::handleEditingKeyboardEvent): Ditto.
1573         * WebProcess/WebPage/mac/WebPageMac.mm:
1574         (WebKit::frameForEvent): Ditto.
1575
1576 2017-11-12  Gabriel Ivascu  <givascu@igalia.com>
1577
1578         [GTK] Add functionality to handle font sizes in points
1579         https://bugs.webkit.org/show_bug.cgi?id=179285
1580
1581         Reviewed by Carlos Garcia Campos and Michael Catanzaro.
1582
1583         * UIProcess/API/glib/WebKitSettings.cpp:
1584         (webkit_settings_class_init):
1585         (webkit_settings_font_size_to_points):
1586         (webkit_settings_font_size_to_pixels):
1587         * UIProcess/API/gtk/WebKitSettings.h:
1588         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
1589
1590 2017-11-11  Tim Horton  <timothy_horton@apple.com>
1591
1592         Increase the alignment requirement of WKObject's wrapped C++ object
1593         https://bugs.webkit.org/show_bug.cgi?id=179518
1594
1595         Reviewed by Dan Bernstein.
1596
1597         * Shared/API/APIObject.h:
1598         * Shared/Cocoa/APIObject.mm:
1599         (API::allocateWKObject):
1600         (API::Object::fromWKObjectExtraSpace):
1601         (API::Object::newObject):
1602         * Shared/Cocoa/WKObject.mm:
1603         (-[WKObject dealloc]):
1604         (-[WKObject _apiObject]):
1605         * UIProcess/API/Cocoa/WKConnection.mm:
1606         (-[WKConnection dealloc]):
1607         (-[WKConnection _apiObject]):
1608         (-[WKConnection _connection]):
1609         Increase the alignment of the C++ object stored inside WKObject's extra space
1610         to 8-bytes, for platforms where some types require greater-than-pointer alignment.
1611         To achieve this, increase the size of the extra-space allocation by the difference
1612         between 8 bytes and pointer-alignment, and then align within that.
1613
1614 2017-11-11  Tim Horton  <timothy_horton@apple.com>
1615
1616         Avoid composing the message + recipient name for crash logs until a failure actually occurs
1617         https://bugs.webkit.org/show_bug.cgi?id=179576
1618
1619         Reviewed by Dan Bernstein.
1620
1621         * Platform/IPC/mac/ConnectionMac.mm:
1622         (IPC::Connection::sendMessage):
1623         (IPC::Connection::sendOutgoingMessage):
1624         * Platform/IPC/mac/MachMessage.h:
1625         (IPC::MachMessage::messageReceiverName const):
1626         (IPC::MachMessage::setMessageReceiverName):
1627         (IPC::MachMessage::messageName const):
1628         (IPC::MachMessage::setMessageName):
1629         Store the message name and receiver name separately on MachMessage,
1630         only composing them into a string if the message is unhandled. This
1631         makes the time spent composing the string in sendOutgoingMessage
1632         completely disappear. In absolute terms, it wasn't huge, but if you
1633         do enough IPC it starts to add up.
1634
1635 2017-11-10  Chris Dumez  <cdumez@apple.com>
1636
1637         [Service Workers] Implement "Try Activate" / "Activate" algorithms
1638         https://bugs.webkit.org/show_bug.cgi?id=179436
1639
1640         Reviewed by Brady Eidson.
1641
1642         Implement proper "Try Activate" / "Activate" algorithms as per:
1643         - https://w3c.github.io/ServiceWorker/#try-activate-algorithm
1644         - https://w3c.github.io/ServiceWorker/#activation-algorithm
1645
1646         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1647         (WebKit::WebSWServerConnection::fireActivateEvent):
1648         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1649         * StorageProcess/StorageProcess.cpp:
1650         (WebKit::StorageProcess::didFinishServiceWorkerActivation):
1651         * StorageProcess/StorageProcess.h:
1652         * StorageProcess/StorageProcess.messages.in:
1653         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1654         (WebKit::WebSWContextManagerConnection::fireActivateEvent):
1655         (WebKit::WebSWContextManagerConnection::didFinishActivation):
1656         * WebProcess/Storage/WebSWContextManagerConnection.h:
1657         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
1658
1659 2017-11-10  John Wilander  <wilander@apple.com>
1660
1661         Ignore HSTS for partitioned, cross-origin subresource requests
1662         https://bugs.webkit.org/show_bug.cgi?id=178993
1663         <rdar://problem/34962462>
1664
1665         Reviewed by Brent Fulgham.
1666
1667         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1668         (downgradeRequest):
1669             Convenience function to downgrade a request if
1670             CFNetwork as already upgraded it during
1671             canonicalization. This allows the rest of 
1672             WebKit's processing to function, such as UIR
1673             and mixed content blocking.
1674         (updateIgnoreStrictTransportSecuritySettingIfNecessary):
1675             Adds and removed the ignore request accordingly.
1676         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
1677             Now asks CFNetwork to ignore HSTS on resource loads we
1678             partition cookies for.
1679         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
1680             Now asks CFNetwork to ignore HSTS on resource loads we
1681             partition cookies for.
1682
1683 2017-11-10  Alex Christensen  <achristensen@webkit.org>
1684
1685         _WKThumbnailView initialization with WKWebView needs to call correct initWithFrame
1686         https://bugs.webkit.org/show_bug.cgi?id=179537
1687         <rdar://problem/35275219>
1688
1689         Reviewed by Darin Adler.
1690
1691         I introduced this in r223439 and made an ObjC mistake.  This is what I get for adding SPI with no tests.
1692         I fixed this by making the existing WKView/_WKThumbnailView API tests work with WKWebView.
1693
1694         * UIProcess/API/Cocoa/_WKThumbnailView.mm:
1695         (-[_WKThumbnailView initWithFrame:fromWKWebView:]):
1696
1697 2017-11-10  Carlos Garcia Campos  <cgarcia@igalia.com>
1698
1699         [GTK][WPE] Switch to use API::NavigationClient
1700         https://bugs.webkit.org/show_bug.cgi?id=178720
1701
1702         Reviewed by Alex Christensen.
1703
1704         Replace WebKitLoaderClient and WebKitPolicyClient with WebKitNavigationClient that implements
1705         API::NavigationClient.
1706
1707         * PlatformGTK.cmake:
1708         * PlatformWPE.cmake:
1709         * UIProcess/API/APINavigationAction.h: Add new constructor that receives a target frame name instead of a target
1710         frame info.
1711         * UIProcess/API/APINavigationClient.h:
1712         (API::NavigationClient::didDisplayInsecureContent): Added.
1713         (API::NavigationClient::didRunInsecureContent): Added.
1714         (API::NavigationClient::decidePolicyForNavigationResponse): Change NavigationResponse parameter to be a
1715         Ref<NavigationResponse>&& instead of a NavigationResponse&.
1716         * UIProcess/API/C/WKPage.cpp:
1717         (WKPageSetPageNavigationClient): Update NavigationResponse parameter.
1718         * UIProcess/API/glib/WebKitBackForwardList.cpp:
1719         (webkitBackForwardListChanged):
1720         * UIProcess/API/glib/WebKitBackForwardListPrivate.h:
1721         * UIProcess/API/glib/WebKitNavigationAction.cpp:
1722         (webkitNavigationActionCreate): Wrap the given API::NavigationAction.
1723         (webkit_navigation_action_get_navigation_type): Use the wrapped API::NavigationAction.
1724         (webkit_navigation_action_get_mouse_button): Ditto.
1725         (webkit_navigation_action_get_modifiers): Ditto.
1726         (webkit_navigation_action_get_request): Ditto.
1727         (webkit_navigation_action_is_user_gesture): Ditto.
1728         (webkit_navigation_action_is_redirect): Ditto.
1729         * UIProcess/API/glib/WebKitNavigationActionPrivate.h:
1730         (_WebKitNavigationAction::_WebKitNavigationAction):
1731         * UIProcess/API/glib/WebKitNavigationClient.cpp: Renamed from Source/WebKit/UIProcess/API/glib/WebKitLoaderClient.cpp.
1732         (NavigationClient::NavigationClient):
1733         (attachNavigationClientToView):
1734         * UIProcess/API/glib/WebKitNavigationClient.h: Renamed from Source/WebKit/UIProcess/API/glib/WebKitLoaderClient.h.
1735         * UIProcess/API/glib/WebKitNavigationPolicyDecision.cpp:
1736         (webkit_navigation_policy_decision_get_frame_name): Add FIXME.
1737         (webkitNavigationPolicyDecisionCreate): Get the target frame name from the API::NavigationAction.
1738         * UIProcess/API/glib/WebKitNavigationPolicyDecisionPrivate.h:
1739         * UIProcess/API/glib/WebKitPolicyClient.cpp: Removed.
1740         * UIProcess/API/glib/WebKitPolicyClient.h: Removed.
1741         * UIProcess/API/glib/WebKitPolicyDecision.cpp:
1742         (webkitPolicyDecisionSetListener): Remove the madePolicyDecision boolean member, we can null-check the listener instead.
1743         (webkit_policy_decision_use): Ensure listener is nullptr after being invoked to prevent the decision from being made
1744         more than once.
1745         (webkit_policy_decision_ignore): Ditto.
1746         (webkit_policy_decision_download): Ditto.
1747         * UIProcess/API/glib/WebKitPolicyDecisionPrivate.h:
1748         * UIProcess/API/glib/WebKitResponsePolicyDecision.cpp:
1749         (webkit_response_policy_decision_get_request): Use the wrapped API::NavigationResponse.
1750         (webkit_response_policy_decision_get_response): Ditto.
1751         (webkit_response_policy_decision_is_mime_type_supported): Ditto.
1752         (webkitResponsePolicyDecisionCreate): Wrap the given API::NavigationResponse.
1753         * UIProcess/API/glib/WebKitResponsePolicyDecisionPrivate.h:
1754         * UIProcess/API/glib/WebKitUIClient.cpp:
1755         (UIClient::createNewPage): Create the WebKitNavigationAction from a new API::NavigationAction.
1756         * UIProcess/API/glib/WebKitWebView.cpp:
1757         (webkitWebViewConstructed): Attach navigation client.
1758         * UIProcess/Cocoa/NavigationState.h: Update API::NavigationResponse parameter of decidePolicyForNavigationResponse.
1759         * UIProcess/Cocoa/NavigationState.mm:
1760         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):
1761         * UIProcess/WebPageProxy.cpp:
1762         (WebKit::WebPageProxy::didDisplayInsecureContentForFrame): Notify the navigation client if it's used.
1763         (WebKit::WebPageProxy::didRunInsecureContentForFrame): Ditto.
1764         (WebKit::WebPageProxy::decidePolicyForNewWindowAction): Use the new API::NavigationAction constructor to pass
1765         the target frame name, instead of a null target frame info.
1766         (WebKit::WebPageProxy::decidePolicyForResponse): Move the API::NavigationResponse.
1767
1768 2017-11-09  Chris Dumez  <cdumez@apple.com>
1769
1770         Unreviewed, rolling out r224661.
1771
1772         Broke build on several internal Mac/iOS bots
1773
1774         Reverted changeset:
1775
1776         "Ignore HSTS for partitioned, cross-origin subresource
1777         requests"
1778         https://bugs.webkit.org/show_bug.cgi?id=178993
1779         https://trac.webkit.org/changeset/224661
1780
1781 2017-11-09  Chris Dumez  <cdumez@apple.com>
1782
1783         ServiceWorkerRegistration objects may get recycled for different SWServerRegistration objects
1784         https://bugs.webkit.org/show_bug.cgi?id=179517
1785
1786         Reviewed by Brady Eidson.
1787
1788         * Scripts/webkit/messages.py:
1789         (forward_declarations_and_headers):
1790         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1791         (WebKit::WebSWServerConnection::updateRegistrationStateInClient):
1792         (WebKit::WebSWServerConnection::fireUpdateFoundEvent):
1793         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1794         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
1795         * WebProcess/Storage/WebSWClientConnection.cpp:
1796         (WebKit::WebSWClientConnection::addServiceWorkerRegistrationInServer):
1797         (WebKit::WebSWClientConnection::removeServiceWorkerRegistrationInServer):
1798         * WebProcess/Storage/WebSWClientConnection.h:
1799         * WebProcess/Storage/WebSWClientConnection.messages.in:
1800
1801 2017-11-09  John Wilander  <wilander@apple.com>
1802
1803         Ignore HSTS for partitioned, cross-origin subresource requests
1804         https://bugs.webkit.org/show_bug.cgi?id=178993
1805         <rdar://problem/34962462>
1806
1807         Reviewed by Brent Fulgham.
1808
1809         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1810         (downgradeRequest):
1811             Convenience function to downgrade a request if
1812             CFNetwork as already upgraded it during
1813             canonicalization. This allows the rest of 
1814             WebKit's processing to function, such as UIR
1815             and mixed content blocking.
1816         (updateIgnoreStrictTransportSecuritySettingIfNecessary):
1817             Adds and removed the ignore request accordingly.
1818         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
1819             Now asks CFNetwork to ignore HSTS on resource loads we
1820             partition cookies for.
1821         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
1822             Now asks CFNetwork to ignore HSTS on resource loads we
1823             partition cookies for.
1824
1825 2017-11-09  Chris Dumez  <cdumez@apple.com>
1826
1827         Implement real post 'install' event steps of the Install algorithm (steps 14+)
1828         https://bugs.webkit.org/show_bug.cgi?id=179401
1829
1830         Reviewed by Brady Eidson.
1831
1832         Implement step 14+ of Install algorithm, as per:
1833         - https://w3c.github.io/ServiceWorker/#installation-algorithm
1834
1835         * Scripts/webkit/messages.py:
1836         (headers_for_type):
1837         * Shared/WebCoreArgumentCoders.h:
1838         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1839         (WebKit::WebSWServerConnection::resolveRegistrationJobInClient):
1840         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1841         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
1842         * WebProcess/Storage/WebSWClientConnection.cpp:
1843         (WebKit::WebSWClientConnection::didResolveRegistrationPromise):
1844         * WebProcess/Storage/WebSWClientConnection.h:
1845         * WebProcess/Storage/WebSWClientConnection.messages.in:
1846
1847 2017-11-09  Megan Gardner  <megan_gardner@apple.com>
1848
1849         Clean out unused selection items from UIKitSPI
1850         https://bugs.webkit.org/show_bug.cgi?id=179459
1851
1852         Reviewed by Tim Horton.
1853
1854         Many of these should have been removed from previous commits, but they were missed.
1855         None of these enums or methods are being used by WebKit anymore, and removing them will keep things
1856         clean and allow UIKit to remove things that are not used at all by anyone anymore.
1857
1858         * Platform/spi/ios/UIKitSPI.h:
1859
1860 2017-11-09  Christopher Reid  <chris.reid@sony.com>
1861
1862         Use enum classes within FileSystem
1863         https://bugs.webkit.org/show_bug.cgi?id=175172
1864
1865         Reviewed by Darin Adler.
1866
1867         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
1868         * NetworkProcess/NetworkDataTaskBlob.cpp:
1869         * NetworkProcess/cache/NetworkCache.cpp:
1870         * NetworkProcess/capture/NetworkCaptureManager.cpp:
1871         * NetworkProcess/capture/NetworkCaptureRecorder.cpp:
1872         * Shared/WebMemorySampler.cpp:
1873         * UIProcess/API/APIContentRuleListStore.cpp:
1874         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
1875
1876 2017-11-09  Youenn Fablet  <youenn@apple.com>
1877
1878         ServiceWorkerClientFetch should create not null ResourceError
1879         https://bugs.webkit.org/show_bug.cgi?id=179485
1880
1881         Reviewed by Darin Adler.
1882
1883         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
1884         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
1885
1886 2017-11-09  Andy Estes  <aestes@apple.com>
1887
1888         [iOS] Adopt UIPreviewDataAttachmentListIsContentManaged
1889         https://bugs.webkit.org/show_bug.cgi?id=179458
1890         <rdar://problem/35034691>
1891
1892         Reviewed by Dan Bernstein.
1893
1894         * Platform/spi/ios/UIKitSPI.h:
1895         * UIProcess/ios/WKContentViewInteraction.mm:
1896         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
1897
1898 2017-11-08  Joseph Pecoraro  <pecoraro@apple.com>
1899
1900         Include a more complete block signature in public headers to avoid potential -Wstrict-prototypes warnings
1901         https://bugs.webkit.org/show_bug.cgi?id=179466
1902
1903         Reviewed by Dan Bernstein.
1904
1905         * UIProcess/API/Cocoa/WKHTTPCookieStore.h:
1906         * UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
1907         (-[WKHTTPCookieStore setCookie:completionHandler:]):
1908         (-[WKHTTPCookieStore deleteCookie:completionHandler:]):
1909
1910 2017-11-08  Jeremy Jones  <jeremyj@apple.com>
1911
1912         Make WKFullScreenWidnowController more robust against modification by the embedding app.
1913         https://bugs.webkit.org/show_bug.cgi?id=179413
1914         rdar://problem/35408061
1915
1916         Reviewed by Darin Adler.
1917
1918         Present fullscreen UViewController in a separate UIWindow to prevent interaction with the embedding app's
1919         UIViewController hierarchy.
1920
1921         Immediately tear down the fullscreen interface if the embedding app removes the WKWebView from the fullscreen window.
1922         This prevents the fullscreen interface from getting into an invalid state.
1923
1924         Preserve scrollView.zoomScale because it is not effectively preserved by the more indirect _viewScale.
1925
1926         Use a custom root view controller to allow hiding of the status bar.
1927
1928         Remove the no-longer-necessary dispatch_after calls during enter and exit fullscreen.
1929
1930         * UIProcess/API/Cocoa/WKWebView.mm:
1931         (-[WKWebView removeFromSuperview]):
1932         * UIProcess/ios/WKFullScreenWindowControllerIOS.h:
1933         * UIProcess/ios/WKFullScreenWindowControllerIOS.mm:
1934         (WebKit::WKWebViewState::applyTo):
1935         (WebKit::WKWebViewState::store):
1936         (-[_WKFullScreenViewController loadView]):
1937         (-[_WKFullscreenRootViewController prefersStatusBarHidden]):
1938         (-[WKFullScreenWindowController enterFullScreen]):
1939         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
1940         (-[WKFullScreenWindowController completedExitFullScreen]):
1941         (-[WKFullScreenWindowController exitFullscreenImmediately]):
1942         (-[WKFullScreenWindowController close]):
1943         (-[WKFullScreenWindowController webViewDidRemoveFromSuperviewWhileInFullscreen]):
1944         (-[_WKFullScreenViewController viewDidDisappear:]): Deleted.
1945
1946 2017-11-08  Jeremy Jones  <jeremyj@apple.com>
1947
1948         HTMLMediaElement should not use element fullscreen on iOS
1949         https://bugs.webkit.org/show_bug.cgi?id=179418
1950         rdar://problem/35409277
1951
1952         Reviewed by Eric Carlson.
1953
1954         Add ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN to determine if HTMLMediaElement should use element full screen or not.
1955
1956         * Configurations/FeatureDefines.xcconfig:
1957
1958 2017-11-08  Wenson Hsieh  <wenson_hsieh@apple.com>
1959
1960         [Attachment Support] Implement delegate hooks for attachment element insertion and removal
1961         https://bugs.webkit.org/show_bug.cgi?id=179016
1962         <rdar://problem/35250890>
1963
1964         Reviewed by Tim Horton.
1965
1966         See WebCore/ChangeLog for more details.
1967
1968         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1969         * UIProcess/API/Cocoa/WKWebView.mm:
1970         (-[WKWebView _didInsertAttachment:]):
1971         (-[WKWebView _didRemoveAttachment:]):
1972         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1973         * UIProcess/Cocoa/PageClientImplCocoa.h:
1974         * UIProcess/Cocoa/PageClientImplCocoa.mm:
1975         (WebKit::PageClientImplCocoa::didInsertAttachment):
1976         (WebKit::PageClientImplCocoa::didRemoveAttachment):
1977         * UIProcess/PageClient.h:
1978         (WebKit::PageClient::didInsertAttachment):
1979         (WebKit::PageClient::didRemoveAttachment):
1980         * UIProcess/WebPageProxy.cpp:
1981         (WebKit::WebPageProxy::didInsertAttachment):
1982         (WebKit::WebPageProxy::didRemoveAttachment):
1983         * UIProcess/WebPageProxy.h:
1984         * UIProcess/WebPageProxy.messages.in:
1985         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1986         (WebKit::WebEditorClient::didInsertAttachment):
1987         (WebKit::WebEditorClient::didRemoveAttachment):
1988         * WebProcess/WebCoreSupport/WebEditorClient.h:
1989
1990 2017-11-08  Carlos Garcia Campos  <cgarcia@igalia.com>
1991
1992         REGRESSION(r223773): [GTK] WebKitWebInspector bring-to-front signal is emitted right after open-window
1993         https://bugs.webkit.org/show_bug.cgi?id=179365
1994
1995         Reviewed by Michael Catanzaro.
1996
1997         In the GTK+ API, open-window already implies presenting the window to bring it to the front, so it's not
1998         expected that bring-to-front is emitted on open. This is happening since r223773 that moved common code from
1999         platform specific inspector files to the main file, but in the case of open the mac implementation was not
2000         exactly the same as the GTK+ one. This broke /webkit2/WebKitWebInspector/default and
2001         /webkit2/WebKitWebInspector/manual-attach-detach.
2002
2003         * UIProcess/WebInspectorProxy.cpp:
2004         (WebKit::WebInspectorProxy::open): Set m_isOpening for the scope of the function.
2005         * UIProcess/WebInspectorProxy.h: Add m_isOpening.
2006         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
2007         (WebKit::WebInspectorProxy::platformBringToFront): Return early if m_isOpening is true.
2008
2009 2017-11-07  Carlos Garcia Campos  <cgarcia@igalia.com>
2010
2011         REGRESSION(r224179): [GTK] Several WebViewEditor tests are failing since r224179
2012         https://bugs.webkit.org/show_bug.cgi?id=179366
2013
2014         Reviewed by Michael Catanzaro.
2015
2016         In r224179, webkit_web_view_can_execute_editing_command() was optimized to use the sync path for commands
2017         supported by the WebViewEditorState, but the state requires a redraw to be up to date. We can't know if
2018         WebViewEditorState is in sync, when webkit_web_view_can_execute_editing_command() is called, so we always need
2019         to ask the web process.
2020
2021         * UIProcess/API/glib/WebKitWebView.cpp:
2022         (webkit_web_view_can_execute_editing_command):
2023
2024 2017-11-07  Carlos Garcia Campos  <cgarcia@igalia.com>
2025
2026         [GTK][WPE] Build inspector resources using copy-user-interface-resources.pl script
2027         https://bugs.webkit.org/show_bug.cgi?id=179317
2028
2029         Reviewed by Michael Catanzaro.
2030
2031         This is the script used by Apple and it has several advantages:
2032
2033           - It allows to combine and minify most of the js and css files, which improves performance and binary size.
2034           - It removes the debug resources and assertions in production builds.
2035           - It allows to remove the test resources in production builds.
2036
2037         The patch also moves the common cmake code to generate the resources to a new file InspectorGResources.cmake included
2038         by GTK+ and WPE platform cmake files.
2039
2040         * InspectorGResources.cmake: Added.
2041         * PlatformGTK.cmake:
2042         * PlatformWPE.cmake:
2043
2044 2017-11-07  Jeremy Jones  <jeremyj@apple.com>
2045
2046         Add downcast support for FullscreenClient.
2047         https://bugs.webkit.org/show_bug.cgi?id=178824
2048
2049         Reviewed by Simon Fraser.
2050
2051         Add SPECIALIZE_TYPE_TRAITS macros for API::FullscreenClient and WebKit::Fullscreen client so 
2052         downcasts can be done safely.
2053
2054         * UIProcess/API/APIFullscreenClient.h:
2055         (API::FullscreenClient::isType const):
2056         * UIProcess/API/C/mac/WKPagePrivateMac.mm:
2057         (WKPageSetFullscreenDelegate):
2058         (WKPageGetFullscreenDelegate):
2059         * UIProcess/API/Cocoa/WKWebView.mm:
2060         (-[WKWebView _setFullscreenDelegate:]):
2061         (-[WKWebView _fullscreenDelegate]):
2062         * UIProcess/Cocoa/FullscreenClient.h:
2063         (isType):
2064         * UIProcess/Cocoa/FullscreenClient.mm:
2065
2066 2017-11-07  Brady Eidson  <beidson@apple.com>
2067
2068         Implement "UpdateWorkerState" and use it
2069         https://bugs.webkit.org/show_bug.cgi?id=179318
2070
2071         Reviewed by Chris Dumez.
2072
2073         * Scripts/webkit/messages.py:
2074         (headers_for_type):
2075         * Shared/WebCoreArgumentCoders.h:
2076  
2077        * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2078         (WebKit::WebSWServerConnection::updateWorkerStateInClient):
2079         (WebKit::WebSWServerConnection::installServiceWorkerContext):
2080         (WebKit::WebSWServerConnection::setContextConnection):
2081         (WebKit::WebSWServerConnection::updateServiceWorkerContext): Deleted.
2082         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2083
2084         * WebProcess/Storage/WebSWClientConnection.messages.in:
2085
2086         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2087         (WebKit::WebSWContextManagerConnection::installServiceWorker):
2088         (WebKit::WebSWContextManagerConnection::updateServiceWorker): Deleted.
2089         * WebProcess/Storage/WebSWContextManagerConnection.h:
2090         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
2091
2092 2017-11-07  Commit Queue  <commit-queue@webkit.org>
2093
2094         Unreviewed, rolling out r224512 and r224521.
2095         https://bugs.webkit.org/show_bug.cgi?id=179388
2096
2097         An API test added with this change is failing an assertion on
2098         the bots. (Requested by ryanhaddad on #webkit).
2099
2100         Reverted changesets:
2101
2102         "[Attachment Support] Implement delegate hooks for attachment
2103         element insertion and removal"
2104         https://bugs.webkit.org/show_bug.cgi?id=179016
2105         https://trac.webkit.org/changeset/224512
2106
2107         "Remove stray logging from a newly added API test"
2108         https://trac.webkit.org/changeset/224521
2109
2110 2017-11-07  Chris Dumez  <cdumez@apple.com>
2111
2112         [Service Workers] Add support for "install" event
2113         https://bugs.webkit.org/show_bug.cgi?id=179338
2114
2115         Reviewed by Youenn Fablet.
2116
2117         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2118         (WebKit::WebSWServerConnection::firePostInstallEvents):
2119         (WebKit::WebSWServerConnection::fireInstallEvent):
2120         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2121         * StorageProcess/StorageProcess.cpp:
2122         (WebKit::StorageProcess::didFinishServiceWorkerInstall):
2123         * StorageProcess/StorageProcess.h:
2124         * StorageProcess/StorageProcess.messages.in:
2125         * WebProcess/Storage/WebSWClientConnection.messages.in:
2126         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2127         (WebKit::WebSWContextManagerConnection::fireInstallEvent):
2128         (WebKit::WebSWContextManagerConnection::didFinishInstall):
2129         * WebProcess/Storage/WebSWContextManagerConnection.h:
2130         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
2131
2132 2017-11-07  Youenn Fablet  <youenn@apple.com>
2133
2134         Support the case of fetch events that are not responded
2135         https://bugs.webkit.org/show_bug.cgi?id=179336
2136
2137         Reviewed by Chris Dumez.
2138
2139         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
2140         (WebKit::WebServiceWorkerFetchTaskClient::didNotHandle):
2141         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:
2142
2143 2017-11-06  Alex Christensen  <achristensen@webkit.org>
2144
2145         Make ResourceLoader::willSendRequestInternal asynchronous
2146         https://bugs.webkit.org/show_bug.cgi?id=179251
2147
2148         Reviewed by Andy Estes.
2149
2150         * WebProcess/Network/WebLoaderStrategy.cpp:
2151         (WebKit::WebLoaderStrategy::loadResource):
2152         (WebKit::WebLoaderStrategy::schedulePluginStreamLoad):
2153         * WebProcess/Network/WebLoaderStrategy.h:
2154         * WebProcess/Plugins/PluginView.cpp:
2155         (WebKit::PluginView::Stream::start):
2156
2157 2017-11-06  Wenson Hsieh  <wenson_hsieh@apple.com>
2158
2159         [Attachment Support] Implement delegate hooks for attachment element insertion and removal
2160         https://bugs.webkit.org/show_bug.cgi?id=179016
2161         <rdar://problem/35250890>
2162
2163         Reviewed by Tim Horton.
2164
2165         Adds boilerplate plumbing to WebEditorClient, WebPage, and the usual machinery in the UI process to notify
2166         WebKit2 clients when attachment elements have been inserted or removed from the document. See the WebCore
2167         ChangeLog for more details about the implementation, or the Tools ChangeLog for more information about new API
2168         tests.
2169
2170         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2171         * UIProcess/API/Cocoa/WKWebView.mm:
2172         (-[WKWebView _didInsertAttachment:]):
2173         (-[WKWebView _didRemoveAttachment:]):
2174         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2175         * UIProcess/Cocoa/PageClientImplCocoa.h:
2176         * UIProcess/Cocoa/PageClientImplCocoa.mm:
2177         (WebKit::PageClientImplCocoa::didInsertAttachment):
2178         (WebKit::PageClientImplCocoa::didRemoveAttachment):
2179         * UIProcess/PageClient.h:
2180         (WebKit::PageClient::didInsertAttachment):
2181         (WebKit::PageClient::didRemoveAttachment):
2182         * UIProcess/WebPageProxy.cpp:
2183         (WebKit::WebPageProxy::didInsertAttachment):
2184         (WebKit::WebPageProxy::didRemoveAttachment):
2185         * UIProcess/WebPageProxy.h:
2186         * UIProcess/WebPageProxy.messages.in:
2187         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2188         (WebKit::WebEditorClient::didInsertAttachment):
2189         (WebKit::WebEditorClient::didRemoveAttachment):
2190         * WebProcess/WebCoreSupport/WebEditorClient.h:
2191
2192 2017-11-06  Jeremy Jones  <jeremyj@apple.com>
2193
2194         iOS element fullscreen should use a UIGestureRecognizer to detect user interaction.
2195         https://bugs.webkit.org/show_bug.cgi?id=179029
2196         rdar://problem/35307882
2197
2198         Reviewed by Simon Fraser.
2199
2200         Replace _WKTapDelegatingView with a UILongPressGestureRecognizer. When set with a duration of 0, it effectively
2201         recognizes UITouchBegin events.
2202
2203         * UIProcess/ios/WKFullScreenWindowControllerIOS.mm:
2204         (-[_WKFullScreenViewController loadView]):
2205         (-[_WKFullScreenViewController gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
2206         (-[_WKTapDelegatingView setTarget:action:]): Deleted.
2207         (-[_WKTapDelegatingView hitTest:withEvent:]): Deleted.
2208
2209 2017-11-06  Chris Dumez  <cdumez@apple.com>
2210
2211         [Service Workers] Add proper implementation for 'updatefound' event
2212         https://bugs.webkit.org/show_bug.cgi?id=179302
2213
2214         Reviewed by Brady Eidson.
2215
2216         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2217         (WebKit::WebSWServerConnection::fireUpdateFoundEvent):
2218         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2219         * WebProcess/Storage/WebSWClientConnection.messages.in:
2220
2221 2017-11-06  Christopher Reid  <chris.reid@sony.com>
2222
2223         Use enum classes within FileSystem
2224         https://bugs.webkit.org/show_bug.cgi?id=175172
2225
2226         Reviewed by Myles C. Maxfield.
2227
2228         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
2229         * NetworkProcess/NetworkDataTaskBlob.cpp:
2230         * NetworkProcess/cache/NetworkCache.cpp:
2231         * NetworkProcess/capture/NetworkCaptureManager.cpp:
2232         * NetworkProcess/capture/NetworkCaptureRecorder.cpp:
2233         * Shared/WebMemorySampler.cpp:
2234         * UIProcess/API/APIContentRuleListStore.cpp:
2235         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
2236
2237 2017-11-06  Michael Catanzaro  <mcatanzaro@igalia.com>
2238
2239         [WPE] Properly use SYSTEM_INCLUDE_DIRECTORIES for WebKit build target
2240         https://bugs.webkit.org/show_bug.cgi?id=179097
2241
2242         Reviewed by Žan Doberšek.
2243
2244         * PlatformWPE.cmake:
2245
2246 2017-11-05  Yusuke Suzuki  <utatane.tea@gmail.com>
2247
2248         JIT call inline caches should cache calls to objects with getCallData/getConstructData traps
2249         https://bugs.webkit.org/show_bug.cgi?id=144458
2250
2251         Reviewed by Saam Barati.
2252
2253         * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
2254         (WebKit::JSNPMethod::JSNPMethod):
2255         (WebKit::JSNPMethod::getCallData): Deleted.
2256         * WebProcess/Plugins/Netscape/JSNPMethod.h:
2257         (WebKit::JSNPMethod::createStructure):
2258
2259 2017-11-04  Chris Dumez  <cdumez@apple.com>
2260
2261         REGRESSION(r223718): Leaking WebProcessPool after reconfiguration
2262         https://bugs.webkit.org/show_bug.cgi?id=179123
2263         <rdar://problem/35294685>
2264
2265         Reviewed by Geoff Garen.
2266
2267         Make sure we destroy the ServiceWorker WebProcess once all other WebProcesses
2268         go away at there is no use keeping it running at this point. Also, this prevents
2269         leaking the WebProcessPool since the WebProcessProxy holds a strong reference
2270         to the WebProcessPool.
2271
2272         * UIProcess/WebProcessPool.cpp:
2273         (WebKit::WebProcessPool::disconnectProcess):
2274
2275 2017-11-01  Darin Adler  <darin@apple.com>
2276
2277         Simplify event dispatch code and make it a bit more consistent
2278         https://bugs.webkit.org/show_bug.cgi?id=178991
2279
2280         Reviewed by Chris Dumez.
2281
2282         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.cpp:
2283         (webkit_dom_event_get_src_element): Call target instead of srcElement.
2284
2285 2017-11-04  Aishwarya Nirmal  <anirmal@apple.com>
2286
2287         [Touch Bar Web API] Add support for menuitem tag
2288         https://bugs.webkit.org/show_bug.cgi?id=179020
2289
2290         Reviewed by Ryosuke Niwa.
2291
2292         Adds in the MenuItemElementEnabled flag so that the menu item element is a runtime-
2293         enabled feature. It has a default value of false.
2294
2295         * Shared/WebPreferences.yaml:
2296         * UIProcess/API/C/WKPreferences.cpp:
2297         (WKPreferencesSetMenuItemElementEnabled):
2298         (WKPreferencesGetMenuItemElementEnabled):
2299         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2300
2301 2017-11-03  Chris Dumez  <cdumez@apple.com>
2302
2303         Unreviewed, rolling out r224438.
2304
2305         Has caused assertions on the bots
2306
2307         Reverted changeset:
2308
2309         "REGRESSION(r223718): Leaking WebProcessPool after
2310         reconfiguration"
2311         https://bugs.webkit.org/show_bug.cgi?id=179123
2312         https://trac.webkit.org/changeset/224438
2313
2314 2017-11-03  Youenn Fablet  <youenn@apple.com>
2315
2316         Requests handled by Service Worker should not go through preflighting
2317         https://bugs.webkit.org/show_bug.cgi?id=179250
2318
2319         Reviewed by Alex Christensen.
2320
2321         * WebProcess/Network/WebLoaderStrategy.cpp:
2322         (WebKit::WebLoaderStrategy::scheduleLoad):
2323         * WebProcess/Storage/WebSWClientConnection.cpp:
2324         (WebKit::WebSWClientConnection::startFetch):
2325         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
2326         (WebKit::shouldHandleFetch):
2327
2328 2017-11-03  Chris Dumez  <cdumez@apple.com>
2329
2330         REGRESSION(r223718): Leaking WebProcessPool after reconfiguration
2331         https://bugs.webkit.org/show_bug.cgi?id=179123
2332         <rdar://problem/35294685>
2333
2334         Reviewed by Geoffrey Garen.
2335
2336         Make sure we destroy the ServiceWorker WebProcess once all other WebProcesses
2337         go away at there is no use keeping it running at this point. Also, this prevents
2338         leaking the WebProcessPool since the WebProcessProxy holds a strong reference
2339         to the WebProcessPool.
2340
2341         * UIProcess/WebProcessPool.cpp:
2342         (WebKit::WebProcessPool::disconnectProcess):
2343
2344 2017-11-03  Youenn Fablet  <youenn@apple.com>
2345
2346         Implement Service Worker Matching Registration algorithm
2347         https://bugs.webkit.org/show_bug.cgi?id=178882
2348
2349         Reviewed by Chris Dumez.
2350
2351         Added IPC plumbery for matchRegistration request and response.
2352         Added some limited clearing of workers and registrations.
2353
2354         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2355         (WebKit::WebSWServerConnection::matchRegistration):
2356         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2357         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
2358         * StorageProcess/StorageProcess.cpp:
2359         (WebKit::StorageProcess::deleteWebsiteData):
2360         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
2361         * WebProcess/Storage/WebSWClientConnection.cpp:
2362         (WebKit::WebSWClientConnection::didMatchRegistration):
2363         (WebKit::WebSWClientConnection::matchRegistration):
2364         * WebProcess/Storage/WebSWClientConnection.h:
2365         * WebProcess/Storage/WebSWClientConnection.messages.in:
2366         * WebProcess/Storage/WebServiceWorkerProvider.h:
2367
2368 2017-11-03  Jeremy Jones  <jeremyj@apple.com>
2369
2370         Element fullscreen should use FloatRects instead of IntRects in beganEnterFullScreenWithInitialFrame
2371         https://bugs.webkit.org/show_bug.cgi?id=179033
2372         rdar://problem/35309279
2373         
2374         Reviewed by Darin Adler.
2375
2376         Screen coordinates are floats, so use NSRect instead of IntRect on Mac.
2377
2378         * UIProcess/mac/WKFullScreenWindowController.h:
2379         * UIProcess/mac/WKFullScreenWindowController.mm:
2380         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
2381         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
2382
2383 2017-11-03  Chris Dumez  <cdumez@apple.com>
2384
2385         Use a single identifier type to identify Service Workers
2386         https://bugs.webkit.org/show_bug.cgi?id=179192
2387
2388         Reviewed by Brady Eidson.
2389
2390         Use a single identifier type to identify Service Workers. We had both a String
2391         identifier and a uint64_t identifier for each service worker. We now consistently
2392         use a ServiceWorkerIdentifier which is a strongly typed identifier backed by a
2393         uint64_t.
2394
2395         * Scripts/webkit/messages.py:
2396         (forward_declarations_and_headers):
2397         (forward_declarations_and_headers.templates):
2398         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2399         (WebKit::WebSWServerConnection::startFetch):
2400         (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope):
2401         (WebKit::WebSWServerConnection::postMessageToServiceWorkerClient):
2402         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2403         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
2404         * StorageProcess/StorageProcess.cpp:
2405         (WebKit::StorageProcess::serviceWorkerContextFailedToStart):
2406         (WebKit::StorageProcess::serviceWorkerContextStarted):
2407         (WebKit::StorageProcess::postMessageToServiceWorkerClient):
2408         * StorageProcess/StorageProcess.h:
2409         * StorageProcess/StorageProcess.messages.in:
2410         * WebProcess/Storage/WebSWClientConnection.cpp:
2411         (WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope):
2412         (WebKit::WebSWClientConnection::postMessageToServiceWorkerClient):
2413         * WebProcess/Storage/WebSWClientConnection.h:
2414         * WebProcess/Storage/WebSWClientConnection.messages.in:
2415         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2416         (WebKit::WebSWContextManagerConnection::updateServiceWorker):
2417         (WebKit::WebSWContextManagerConnection::serviceWorkerStartedWithMessage):
2418         (WebKit::WebSWContextManagerConnection::startFetch):
2419         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerGlobalScope):
2420         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerClient):
2421         * WebProcess/Storage/WebSWContextManagerConnection.h:
2422         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
2423
2424 2017-11-03  Antti Koivisto  <antti@apple.com>
2425
2426         Enable display:contents by default as experimental feature
2427         https://bugs.webkit.org/show_bug.cgi?id=179239
2428         <rdar://problem/35334612>
2429
2430         Reviewed by Darin Adler.
2431
2432         We pass most of the WPT tests. What remains is mostly flexbox related edge cases.
2433
2434         * Shared/WebPreferences.yaml:
2435
2436 2017-11-03  Frederic Wang  <fwang@igalia.com>
2437
2438         Use WK_IOS_TBA instead of WK_MAC_TBA to indicate availability of private functions on iOS
2439         https://bugs.webkit.org/show_bug.cgi?id=179238
2440
2441         Reviewed by Darin Adler.
2442
2443         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2444         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
2445
2446 2017-11-02  Maciej Stachowiak  <mjs@apple.com>
2447
2448         Don't try to guess plugin MIME type from a file extension in a URL (no observable effect)
2449         https://bugs.webkit.org/show_bug.cgi?id=178333
2450
2451         Reviewed by Darin Adler.
2452
2453         * WebProcess/Plugins/PluginView.cpp:
2454         (WebKit::PluginView::pluginDidReceiveUserInteraction): loadedMIMEType --> serviceType
2455         * WebProcess/WebPage/WebPage.cpp:
2456         (WebKit::WebPage::determinePrimarySnapshottedPlugIn): ditto
2457
2458 2017-11-02  Brady Eidson  <beidson@apple.com>
2459
2460         SW: Implement "Update Registration State" algorithm (unused for now)
2461         https://bugs.webkit.org/show_bug.cgi?id=179186
2462
2463         Reviewed by Chris Dumez.
2464
2465         * Scripts/webkit/messages.py:
2466         (headers_for_type):
2467
2468         * Shared/WebCoreArgumentCoders.h:
2469
2470         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2471         (WebKit::WebSWServerConnection::updateRegistrationStateInClient):
2472         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2473         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
2474
2475         * WebProcess/Storage/WebSWClientConnection.cpp:
2476         (WebKit::WebSWClientConnection::addServiceWorkerRegistrationInServer):
2477         (WebKit::WebSWClientConnection::removeServiceWorkerRegistrationInServer):
2478         * WebProcess/Storage/WebSWClientConnection.h:
2479         * WebProcess/Storage/WebSWClientConnection.messages.in:
2480
2481 2017-11-02  Alex Christensen  <achristensen@webkit.org>
2482
2483         Use CompletionHandlers for redirects
2484         https://bugs.webkit.org/show_bug.cgi?id=179163
2485
2486         Reviewed by Tim Horton.
2487
2488         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
2489         (WebKit::BlobDownloadClient::willSendRequestAsync):
2490         * NetworkProcess/Downloads/BlobDownloadClient.h:
2491         * NetworkProcess/NetworkDataTask.h:
2492         * NetworkProcess/NetworkLoad.cpp:
2493         (WebKit::NetworkLoad::~NetworkLoad):
2494         (WebKit::NetworkLoad::continueWillSendRequest):
2495         (WebKit::NetworkLoad::willSendRequestAsync):
2496         * NetworkProcess/NetworkLoad.h:
2497         * NetworkProcess/NetworkLoadClient.h:
2498         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2499         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
2500         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
2501         * UIProcess/API/APIDownloadClient.h:
2502         (API::DownloadClient::willSendRequest):
2503         * UIProcess/API/C/WKContext.cpp:
2504         (WKContextSetDownloadClient):
2505         * UIProcess/Cocoa/DownloadClient.h:
2506         * UIProcess/Cocoa/DownloadClient.mm:
2507         (WebKit::DownloadClient::willSendRequest):
2508         * WebProcess/Network/WebResourceLoader.cpp:
2509         (WebKit::WebResourceLoader::willSendRequest):
2510         * WebProcess/Plugins/PluginView.cpp:
2511         (WebKit::PluginView::Stream::~Stream):
2512         (WebKit::PluginView::Stream::continueLoad):
2513         (WebKit::PluginView::Stream::willSendRequest):
2514         * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp:
2515
2516 2017-11-02  Christopher Reid  <chris.reid@sony.com>
2517
2518         Add a FileSystem namespace to FileSystem.cpp
2519         https://bugs.webkit.org/show_bug.cgi?id=179063
2520
2521         Reviewed by Darin Adler.
2522
2523         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
2524         * NetworkProcess/Downloads/BlobDownloadClient.h:
2525         * NetworkProcess/NetworkDataTaskBlob.cpp:
2526         * NetworkProcess/NetworkDataTaskBlob.h:
2527         * NetworkProcess/NetworkProcess.cpp:
2528         * NetworkProcess/cache/CacheStorageEngine.cpp:
2529         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2530         * NetworkProcess/cache/NetworkCache.cpp:
2531         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
2532         * NetworkProcess/cache/NetworkCacheData.cpp:
2533         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
2534         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
2535         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
2536         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
2537         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2538         * NetworkProcess/capture/NetworkCaptureManager.cpp:
2539         * NetworkProcess/capture/NetworkCaptureManager.h:
2540         * NetworkProcess/capture/NetworkCaptureRecorder.cpp:
2541         * NetworkProcess/capture/NetworkCaptureResource.h:
2542         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2543         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2544         * NetworkProcess/soup/NetworkProcessSoup.cpp:
2545         * Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp:
2546         * Shared/Plugins/unix/PluginSearchPath.cpp:
2547         * Shared/WebMemorySampler.cpp:
2548         * Shared/WebMemorySampler.h:
2549         * Shared/gtk/ProcessExecutablePathGtk.cpp:
2550         * Shared/ios/ChildProcessIOS.mm:
2551         * Shared/mac/ChildProcessMac.mm:
2552         * Shared/mac/SandboxExtensionMac.mm:
2553         * Shared/wpe/ProcessExecutablePathWPE.cpp:
2554         * StorageProcess/StorageProcess.cpp:
2555         * UIProcess/API/APIContentRuleListStore.cpp:
2556         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
2557         * UIProcess/API/glib/IconDatabase.cpp:
2558         * UIProcess/API/glib/WebKitFaviconDatabase.cpp:
2559         * UIProcess/API/glib/WebKitFileChooserRequest.cpp:
2560         * UIProcess/API/glib/WebKitWebContext.cpp:
2561         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
2562         * UIProcess/Automation/WebAutomationSession.cpp:
2563         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2564         * UIProcess/Cocoa/WebViewImpl.mm:
2565         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
2566         * UIProcess/Plugins/gtk/PluginInfoCache.cpp:
2567         * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
2568         * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
2569         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
2570         * UIProcess/WebStorage/LocalStorageDatabase.cpp:
2571         * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
2572         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
2573         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2574         * UIProcess/gtk/WebProcessPoolGtk.cpp:
2575         * UIProcess/mac/WebPageProxyMac.mm:
2576         * UIProcess/wpe/WebProcessPoolWPE.cpp:
2577         * WebProcess/InjectedBundle/API/glib/WebKitExtensionManager.cpp:
2578         * WebProcess/InjectedBundle/glib/InjectedBundleGlib.cpp:
2579         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
2580         * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
2581         * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
2582         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
2583
2584 2017-11-02  Joseph Pecoraro  <pecoraro@apple.com>
2585
2586         Make ServiceWorker a Remote Inspector debuggable target
2587         https://bugs.webkit.org/show_bug.cgi?id=179043
2588         <rdar://problem/34126008>
2589
2590         Reviewed by Brian Burg.
2591
2592         * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.h:
2593         * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm:
2594         (debuggableTypeString):
2595         Provide a way to start a Remote Web Inspector frontend for a ServiceWorker target type.
2596
2597 2017-11-02  Ryan Haddad  <ryanhaddad@apple.com>
2598
2599         Unreviewed, rolling out r224353.
2600
2601         Breaks internal builds.
2602
2603         Reverted changeset:
2604
2605         "Ignore HSTS for partitioned, cross-origin subresource
2606         requests"
2607         https://bugs.webkit.org/show_bug.cgi?id=178993
2608         https://trac.webkit.org/changeset/224353
2609
2610 2017-11-02  John Wilander  <wilander@apple.com>
2611
2612         Ignore HSTS for partitioned, cross-origin subresource requests
2613         https://bugs.webkit.org/show_bug.cgi?id=178993
2614         <rdar://problem/34962462>
2615
2616         Reviewed by Brent Fulgham and Alex Christensen.
2617
2618         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2619         (downgradeRequest):
2620             Convenience function to downgrade a request if
2621             CFNetwork as already upgraded it during
2622             canonicalization. This allows the rest of 
2623             WebKit's processing to function, such as UIR
2624             and mixed content blocking.
2625         (updateIgnoreStrictTransportSecuritySettingIfNecessary):
2626             Adds and removed the ignore request accordingly.
2627         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
2628             Now asks CFNetwork to ignore HSTS on resource loads we
2629             partition cookies for.
2630         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
2631             Now asks CFNetwork to ignore HSTS on resource loads we
2632             partition cookies for.
2633
2634 2017-11-02  Yousuke Kimoto  <yousuke.kimoto@sony.com>
2635
2636         [WinCairo] Add IPC files for wincairo webkit
2637         https://bugs.webkit.org/show_bug.cgi?id=177919
2638
2639         Reviewed by Alex Christensen.
2640
2641         * Platform/IPC/Attachment.cpp:
2642         * Platform/IPC/Attachment.h:
2643         (IPC::Attachment::Attachment):
2644         (IPC::Attachment::handle):
2645         * Platform/IPC/Connection.h:
2646         (IPC::Connection::identifierIsNull):
2647         (IPC::Connection::sendWithReply):
2648         * Platform/IPC/win/AttachmentWin.cpp: Added.
2649         (IPC::Attachment::encode const):
2650         (IPC::getDuplicatedHandle):
2651         (IPC::Attachment::decode):
2652         * Platform/IPC/win/ConnectionWin.cpp: Added.
2653         (IPC::Connection::createServerAndClientIdentifiers):
2654         (IPC::Connection::platformInitialize):
2655         (IPC::Connection::platformInvalidate):
2656         (IPC::Connection::readEventHandler):
2657         (IPC::Connection::writeEventHandler):
2658         (IPC::Connection::open):
2659         (IPC::Connection::platformCanSendOutgoingMessages const):
2660         (IPC::Connection::sendOutgoingMessage):
2661         (IPC::Connection::willSendSyncMessage):
2662         (IPC::Connection::didReceiveSyncReply):
2663         * PlatformWin.cmake:
2664
2665 2017-11-02  Megan Gardner  <megan_gardner@apple.com>
2666
2667         Early out selection update when data is not present
2668         https://bugs.webkit.org/show_bug.cgi?id=179084
2669
2670         Reviewed by Ryosuke Niwa.
2671
2672         We should early out of a selection update when we do not have the data that is necessary to make that
2673         update. This mostly helps avoid debug asserts, but will be helpful with the selection changes that are
2674         ongoing.
2675
2676         * UIProcess/ios/WKContentViewInteraction.mm:
2677         (-[WKContentView _updateChangedSelection:]):
2678
2679 2017-11-02  Eric Carlson  <eric.carlson@apple.com>
2680
2681         [MediaStream] audioTrack.label is always empty on macOS
2682         https://bugs.webkit.org/show_bug.cgi?id=179175
2683         <rdar://problem/35315438>
2684
2685         Reviewed by Youenn Fablet.
2686
2687         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
2688         (WebKit::UserMediaCaptureManager::createCaptureSource): Pass settings.label to Source constructor.
2689
2690 2017-11-02  Frederic Wang  <fwang@igalia.com>
2691
2692         Add references to bug 179167 in FIXME comments
2693         https://bugs.webkit.org/show_bug.cgi?id=179168
2694
2695         Reviewed by Daniel Bates.
2696
2697         * Configurations/FeatureDefines.xcconfig:
2698
2699 2017-11-01  Jeremy Jones  <jeremyj@apple.com>
2700
2701         Implement WKFullscreenWindowController for iOS.
2702         https://bugs.webkit.org/show_bug.cgi?id=178924
2703         rdar://problem/34697120
2704
2705         Reviewed by Simon Fraser.
2706
2707         Plumb relevant calls through WKWebView and PageClientImplIOS.
2708
2709         This forms the base implementation for element fullscreen. This will animate an element into fullscreen and back to inline.
2710         It does this by replacing the WKWebView with a placeholder image and presenting the WKWebView with a fullscreen view controller.
2711         This also attempts to preserve UI state of the WKWebView when it is placed back inline.
2712
2713         To enable _WKFullscreenDelegate for iOS, this adds an iOS version of the delegate methods that passes WKWebView instead of NSView.
2714         The iOS version of these functions are renamed to be more specific and disambiguate them from the video fullscreen delegate methods.
2715
2716         This also adds an image asset for the done button.
2717
2718         * Configurations/FeatureDefines.xcconfig:
2719         * UIProcess/API/Cocoa/WKWebView.mm:
2720         (-[WKWebView hasFullScreenWindowController]):
2721         (-[WKWebView fullScreenWindowController]):
2722         (-[WKWebView closeFullScreenWindowController]):
2723         (-[WKWebView fullScreenPlaceholderView]):
2724         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2725         * UIProcess/API/Cocoa/_WKFullscreenDelegate.h:
2726         * UIProcess/Cocoa/FullscreenClient.h:
2727         * UIProcess/Cocoa/FullscreenClient.mm:
2728         (WebKit::FullscreenClient::FullscreenClient):
2729         (WebKit::FullscreenClient::setDelegate):
2730         (WebKit::FullscreenClient::willEnterFullscreen):
2731         (WebKit::FullscreenClient::didEnterFullscreen):
2732         (WebKit::FullscreenClient::willExitFullscreen):
2733         (WebKit::FullscreenClient::didExitFullscreen):
2734         * UIProcess/ios/PageClientImplIOS.mm:
2735         (WebKit::PageClientImpl::closeFullScreenManager):
2736         (WebKit::PageClientImpl::isFullScreen):
2737         (WebKit::PageClientImpl::enterFullScreen):
2738         (WebKit::PageClientImpl::exitFullScreen):
2739         (WebKit::PageClientImpl::beganEnterFullScreen):
2740         (WebKit::PageClientImpl::beganExitFullScreen):
2741         * UIProcess/ios/WKContentView.mm:
2742         * UIProcess/ios/WKFullScreenWindowControllerIOS.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKFullscreenDelegate.h.
2743         * UIProcess/ios/WKFullScreenWindowControllerIOS.mm: Added.
2744         (WebKit::replaceViewWithView):
2745         (WebKit::WKWebViewState::applyTo):
2746         (WebKit::WKWebViewState::store):
2747         (-[_WKTapDelgatingView setTarget:action:]):
2748         (-[_WKTapDelgatingView hitTest:withEvent:]):
2749         (-[_WKFullScreenViewController dealloc]):
2750         (-[_WKFullScreenViewController viewWillTransitionToSize:withTransitionCoordinator:]):
2751         (+[_WKFullScreenViewController configureView:withBackgroundFillOfColor:opacity:filter:]):
2752         (-[_WKFullScreenViewController _updateTransparencyOfVisualEffectView:]):
2753         (-[_WKFullScreenViewController createVisualEffectViewWithFrame:]):
2754         (-[_WKFullScreenViewController loadView]):
2755         (-[_WKFullScreenViewController viewWillAppear:]):
2756         (-[_WKFullScreenViewController viewDidDisappear:]):
2757         (-[_WKFullScreenViewController cancelAction:]):
2758         (-[_WKFullScreenViewController hideCancelButton]):
2759         (-[_WKFullScreenViewController showCancelButton]):
2760         (-[_WKFullScreenViewController setTarget:action:]):
2761         (-[_WKFullScreenViewController prefersStatusBarHidden]):
2762         (-[WKFullscreenAnimationController transitionDuration:]):
2763         (-[WKFullscreenAnimationController animateTransition:]):
2764         (-[WKFullscreenAnimationController animationEnded:]):
2765         (-[WKFullScreenWindowController initWithWebView:page:]):
2766         (-[WKFullScreenWindowController dealloc]):
2767         (-[WKFullScreenWindowController isFullScreen]):
2768         (-[WKFullScreenWindowController webViewPlaceholder]):
2769         (-[WKFullScreenWindowController enterFullScreen]):
2770         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
2771         (-[WKFullScreenWindowController completedEnterFullScreen]):
2772         (-[WKFullScreenWindowController exitFullScreen]):
2773         (-[WKFullScreenWindowController requestExitFullScreen]):
2774         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
2775         (-[WKFullScreenWindowController completedExitFullScreen]):
2776         (-[WKFullScreenWindowController close]):
2777         (-[WKFullScreenWindowController _manager]):
2778         (-[WKFullScreenWindowController animationControllerForPresentedController:presentingController:sourceController:]):
2779         (-[WKFullScreenWindowController animationControllerForDismissedController:]):
2780         * WebKit.xcassets/Contents.json: Added.
2781         * WebKit.xcassets/Done.imageset/Contents.json: Added.
2782         * WebKit.xcassets/Done.imageset/Done.pdf: Added.
2783         * WebKit.xcodeproj/project.pbxproj:
2784         * WebProcess/FullScreen/WebFullScreenManager.cpp:
2785         (WebKit::WebFullScreenManager::willEnterFullScreen):
2786         (WebKit::WebFullScreenManager::willExitFullScreen):
2787
2788 2017-11-01  Daniel Bates  <dabates@apple.com>
2789
2790         XMLHttpRequest should not sniff content encoding
2791         https://bugs.webkit.org/show_bug.cgi?id=175597
2792         <rdar://problem/34912624>
2793
2794         Reviewed by Alex Christensen.
2795
2796         Fixes an issue where the body of an HTTP response with headers "Content-Type: application/octet-stream" and
2797         "Content-Encoding: gzip" associated with an XHR request to a .gz file would not be automatically gzipped
2798         decompressed. Specifically, such a response would be treated analogous to a response with headers
2799         "Content-Type: application/gzip" and "Content-Encoding: identity". This behavior does not conform to the
2800         behavior of the Content-Encoding header as defined in the HTTP 1.1 and later specs. Moreover this behavior
2801         breaks the Epic Zen Garden demo: <https://s3.amazonaws.com/mozilla-games/ZenGarden/EpicZenGarden.html>.
2802
2803         On macOS 10.13.2 opt out of content encoding sniffing when making an XHR request. We likely can
2804         selectively opt out of content encoding sniffing for other network requests. This will be done
2805         in subsequent commits to make it straightforward to identify site breakage (if any).
2806
2807         * NetworkProcess/Downloads/Download.cpp:
2808         (WebKit::Download::start): Enable content encoding sniff to match existing behavior.
2809         (WebKit::Download::startWithHandle): Ditto.
2810         * NetworkProcess/NetworkDataTask.cpp:
2811         (WebKit::NetworkDataTask::create): Pass through the content encoding sniffing policy.
2812         * NetworkProcess/NetworkLoad.cpp:
2813         (WebKit::NetworkLoad::NetworkLoad): Ditto.
2814         * NetworkProcess/NetworkLoadParameters.h:
2815         * NetworkProcess/NetworkResourceLoadParameters.cpp:
2816         (WebKit::NetworkResourceLoadParameters::encode const): Encode content encoding sniffing policy.
2817         (WebKit::NetworkResourceLoadParameters::decode): Decode content encoding sniffing policy.
2818         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
2819         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad): Enable content encoding sniff to match existing
2820         behavior. We should look to disable content encoding sniffing in a subsequent change.
2821         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
2822         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2823         (WebKit::applySniffingPoliciesAndBindRequestToInferfaceIfNeeded): Added helper function
2824         to apply sniffing policies and bind request to interface, if applicable.
2825         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): Modified to take the content encoding sniffing
2826         policy. Calls applySniffingPoliciesAndBindRequestToInferfaceIfNeeded() to apply this policy. Also use
2827         convenience function URL::isLocalFile() to determine if the URL is a file URL.
2828         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
2829         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup): Pass through the content encoding sniffing policy.
2830         * NetworkProcess/soup/NetworkDataTaskSoup.h:
2831         * WebProcess/Network/WebLoaderStrategy.cpp:
2832         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): Pass through the content encoding sniffing policy.
2833         (WebKit::WebLoaderStrategy::loadResourceSynchronously): Enable content encoding sniff to match existing
2834         behavior.
2835
2836 2017-11-01  Brady Eidson  <beidson@apple.com>
2837
2838         Plumbing for handling SW scripts failing to evaluate
2839         https://bugs.webkit.org/show_bug.cgi?id=178926
2840
2841         Reviewed by Chris Dumez.
2842
2843         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2844         (WebKit::WebSWServerConnection::updateServiceWorkerContext):
2845         (WebKit::WebSWServerConnection::setContextConnection):
2846         (WebKit::WebSWServerConnection::startServiceWorkerContext): Deleted.
2847         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2848
2849         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2850         (WebKit::WebSWContextManagerConnection::updateServiceWorker):
2851         (WebKit::WebSWContextManagerConnection::serviceWorkerStartedWithMessage):
2852         (WebKit::WebSWContextManagerConnection::startServiceWorker): Deleted.
2853         * WebProcess/Storage/WebSWContextManagerConnection.h:
2854         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
2855
2856 2017-11-01  Frederic Wang  <fwang@igalia.com>
2857
2858         Make iOS Find UI reveal matches in scrollable elements
2859         https://bugs.webkit.org/show_bug.cgi?id=178789
2860
2861         Reviewed by Tim Horton.
2862
2863         * WebProcess/WebPage/ios/FindControllerIOS.mm:
2864         (WebKit::FindController::didFindString): Reveal selection up to the main frame. The main frame
2865         is handled by the SmartMagnificationController.
2866
2867 2017-11-01  Michael Catanzaro  <mcatanzaro@igalia.com>
2868
2869         REGRESSION(r224192): [WPE] Fix WebEventFactory::createWebWheelEvent
2870         https://bugs.webkit.org/show_bug.cgi?id=179098
2871
2872         Reviewed by Sam Weinig.
2873
2874         * Shared/wpe/WebEventFactory.cpp:
2875         (WebKit::WebEventFactory::createWebWheelEvent):
2876
2877 2017-10-31  Tim Horton  <timothy_horton@apple.com>
2878
2879         Clean up some drag and drop feature flags
2880         https://bugs.webkit.org/show_bug.cgi?id=179082
2881
2882         Reviewed by Simon Fraser.
2883
2884         * Configurations/FeatureDefines.xcconfig:
2885
2886 2017-10-31  Wenson Hsieh  <wenson_hsieh@apple.com>
2887
2888         Followup to r224238: API::Attachment should generate a _WKAttachment ObjC wrapper
2889         https://bugs.webkit.org/show_bug.cgi?id=179080
2890
2891         Reviewed by Tim Horton.
2892
2893         Fixes a failing API test. The new Attachment object type added in r224238 was not actually being handled in
2894         Object::newObject, so a plain WKObject Objective C wrapper was being created; fix this by allocating a new
2895         _WKAttachment object for Type::Attachment.
2896
2897         * Shared/Cocoa/APIObject.mm:
2898         (API::Object::newObject):
2899
2900 2017-10-31  Tim Horton  <timothy_horton@apple.com>
2901
2902         Fix up some content filtering feature flags
2903         https://bugs.webkit.org/show_bug.cgi?id=179079
2904
2905         Reviewed by Simon Fraser.
2906
2907         * Configurations/FeatureDefines.xcconfig:
2908
2909 2017-10-31  Youenn Fablet  <youenn@apple.com>
2910
2911         rwt should allow service worker to load localhost HTTPS resources with any certificate
2912         https://bugs.webkit.org/show_bug.cgi?id=179018
2913
2914         Reviewed by Chris Dumez.
2915
2916         Allowing ServiceWorkerProcessProxy to handle authentication challenge.
2917         Temporarily adding a boolean flag through WebProcessPool to lower the SSL certificate verifications for service workers.
2918         This allows reducing flakiness in our layout tests for rwt.
2919         Future work should be done to expose a correct API for the application level to handle authentication challenges properly.
2920
2921         * UIProcess/API/C/WKContext.cpp:
2922         (WKContextSetAllowsAnySSLCertificateForServiceWorkerTesting):
2923         * UIProcess/API/C/WKContextPrivate.h:
2924         * UIProcess/API/Cocoa/WKProcessPool.mm:
2925         (-[WKProcessPool _setAllowsAnySSLCertificateForServiceWorker:]):
2926         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2927         * UIProcess/Network/NetworkProcessProxy.cpp:
2928         (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
2929         (WebKit::NetworkProcessProxy::canAuthenticateAgainstProtectionSpace):
2930         * UIProcess/ServiceWorkerProcessProxy.cpp:
2931         (WebKit::ServiceWorkerProcessProxy::didReceiveAuthenticationChallenge):
2932         * UIProcess/ServiceWorkerProcessProxy.h:
2933         * UIProcess/WebProcessPool.h:
2934
2935 2017-10-31  Joseph Pecoraro  <pecoraro@apple.com>
2936
2937         Web Inspector: UIProcess ASSERT in ~RemoteWebInspectorProxy when InspectorProcess crashes
2938         https://bugs.webkit.org/show_bug.cgi?id=179044
2939
2940         Reviewed by Alex Christensen.
2941
2942         * UIProcess/RemoteWebInspectorProxy.cpp:
2943         (WebKit::RemoteWebInspectorProxy::frontendDidClose):
2944         Add a protector to keep the proxy alive for the duration of this method.
2945
2946 2017-10-31  Youenn Fablet  <youenn@apple.com>
2947
2948         Crash in:  com.apple.WebKit: WebKit::CacheStorage::Caches::initializeSize(WTF::Function<void (std::optional<WebCore::DOMCacheEngine::Error>&&)>&&) + 30 (CacheStorageEngineCaches.cpp:163)
2949         https://bugs.webkit.org/show_bug.cgi?id=179037
2950
2951         Reviewed by Chris Dumez.
2952
2953         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2954         (WebKit::CacheStorage::Caches::initializeSize): the storage backend may be cleared when clearing caches by the UI Process.
2955         Returning early in that case. A web application will typically fail to open a cache in this case.
2956         On retry, the cache should be opened.
2957
2958 2017-10-31  Wenson Hsieh  <wenson_hsieh@apple.com>
2959
2960         [Attachment Support] Implement WKWebView SPI for inserting attachment elements
2961         https://bugs.webkit.org/show_bug.cgi?id=179013
2962         <rdar://problem/35249668>
2963
2964         Reviewed by Tim Horton.
2965
2966         Adds native SPI to insert attachment elements given a filename, an optional MIME type, and a data blob. See
2967         change-by-change comments below for more detail. Covered by a new API test.
2968
2969         * PlatformMac.cmake:
2970         * Shared/API/APIObject.h:
2971         * Shared/API/Cocoa/WebKitPrivate.h:
2972         * UIProcess/API/APIAttachment.cpp: Copied from Source/WebKit/Shared/API/Cocoa/WebKitPrivate.h.
2973         (API::Attachment::create):
2974         (API::Attachment::Attachment):
2975         (API::Attachment::~Attachment):
2976
2977         Introduce API::Attachment, which represents a platform-agnostic Attachment.
2978
2979         * UIProcess/API/APIAttachment.h: Copied from Source/WebKit/Shared/API/Cocoa/WebKitPrivate.h.
2980         * UIProcess/API/Cocoa/WKWebView.mm:
2981         (-[WKWebView _insertAttachmentWithFilename:contentType:data:options:completion:]):
2982
2983         Adds support for inserting a new attachment element. Calls out to WebPageProxy to insert the attachment from the
2984         given data blob, and creates a new API-object-backed _WKAttachment.
2985
2986         (-[WKWebView _executeEditCommand:argument:completion:]):
2987
2988         Support passing in a nil completion block.
2989
2990         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2991         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2992         * UIProcess/API/Cocoa/_WKAttachment.h: Copied from Source/WebKit/Shared/API/Cocoa/WebKitPrivate.h.
2993         * UIProcess/API/Cocoa/_WKAttachment.mm: Copied from Source/WebCore/html/HTMLAttachmentElement.h.
2994
2995         Introduces _WKAttachment, an Objective C wrapper around the API::Attachment.
2996
2997         (-[_WKAttachment _apiObject]):
2998         (-[_WKAttachment isEqual:]):
2999         (-[_WKAttachment uniqueIdentifier]):
3000         (-[_WKAttachment hash]):
3001
3002         Add _WKAttachment, a WebKit SPI object that wraps an attachment element unique identifier. Also, allow
3003         _WKAttachment to be used as a hashable NSDictionary key.
3004
3005         (-[_WKAttachment description]):
3006         * UIProcess/API/Cocoa/_WKAttachmentInternal.h: Copied from Source/WebKit/Shared/API/Cocoa/WebKitPrivate.h.
3007         (API::wrapper):
3008         * UIProcess/WebPageProxy.cpp:
3009         (WebKit::WebPageProxy::insertAttachment):
3010
3011         Implement IPC support for inserting an attachment.
3012
3013         * UIProcess/WebPageProxy.h:
3014         * WebKit.xcodeproj/project.pbxproj:
3015         * WebProcess/WebPage/WebPage.cpp:
3016         (WebKit::WebPage::insertAttachment):
3017         * WebProcess/WebPage/WebPage.h:
3018         * WebProcess/WebPage/WebPage.messages.in:
3019
3020 2017-10-31  Alex Christensen  <achristensen@webkit.org>
3021
3022         Fix custom header field setting with reloads and asynchronous navigation action policy decisions
3023         https://bugs.webkit.org/show_bug.cgi?id=179064
3024
3025         Reviewed by Tim Horton.
3026
3027         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3028         (WebKit::WebFrameLoaderClient::applyToDocumentLoader):
3029         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
3030         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
3031         * WebProcess/WebPage/WebFrame.cpp:
3032         (WebKit::WebFrame::didReceivePolicyDecision):
3033         * WebProcess/WebPage/WebFrame.h:
3034         * WebProcess/WebPage/WebPage.cpp:
3035         (WebKit::WebPage::didReceivePolicyDecision):
3036
3037 2017-10-31  Carlos Garcia Campos  <cgarcia@igalia.com>
3038
3039         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.19.1 release.
3040
3041         * gtk/NEWS: Add release notes for 2.19.1.
3042
3043 2017-10-31  Carlos Garcia Campos  <cgarcia@igalia.com>
3044
3045         Unreviewed. Fix GTK+ make distcheck.
3046
3047         Include WebCore/TextEncodingRegistry.h to ensure the forwarding header is generated.
3048
3049         * UIProcess/API/glib/WebKitSettings.cpp:
3050
3051 2017-10-31  Commit Queue  <commit-queue@webkit.org>
3052
3053         Unreviewed, rolling out r223884.
3054         https://bugs.webkit.org/show_bug.cgi?id=179055
3055
3056         It broke GTK+ make distcheck (Requested by KaL on #webkit).
3057
3058         Reverted changeset:
3059
3060         "[GTK][WPE] generate-forwarding-headers.pl should also scan
3061         derived sources in WebKit framework"
3062         https://bugs.webkit.org/show_bug.cgi?id=178579
3063         https://trac.webkit.org/changeset/223884
3064
3065 2017-10-30  Fujii Hironori  <Hironori.Fujii@sony.com>
3066
3067         Use LazyNeverDestroyed instead of DEFINE_GLOBAL for XMLNames, HTMLNames, MathMLNames and SVGNames
3068         https://bugs.webkit.org/show_bug.cgi?id=175118
3069
3070         Reviewed by Alex Christensen.
3071
3072         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPrivate.cpp:
3073         (WebKit::wrap):
3074
3075 2017-10-27  Megan Gardner  <megan_gardner@apple.com>
3076
3077         Correctly determine affinity when inserting text via Keyboard Suggestions
3078         https://bugs.webkit.org/show_bug.cgi?id=178969
3079
3080         Reviewed by Ryosuke Niwa.
3081
3082         Use the logic of VisiblePosition to correctly determine cursor affinity. We were
3083         defaulting to upstream, but that in incorrect and resulted in hitting asserts that
3084         we should not. This should give us the correct affinity in all cases.
3085
3086         * WebProcess/WebPage/ios/WebPageIOS.mm:
3087         (WebKit::WebPage::syncApplyAutocorrection):
3088
3089 2017-10-30  Commit Queue  <commit-queue@webkit.org>
3090
3091         Unreviewed, rolling out r224078.
3092         https://bugs.webkit.org/show_bug.cgi?id=179026
3093
3094         MotionMark regression (Requested by shallawa on #webkit).
3095
3096         Reverted changeset:
3097
3098         "When navigating back to a page, compositing layers may not
3099         use accelerated drawing"
3100         https://bugs.webkit.org/show_bug.cgi?id=178749
3101         https://trac.webkit.org/changeset/224078
3102
3103 2017-10-30  Sam Weinig  <sam@webkit.org>
3104
3105         [Setting] Only expose experimental features that are compiled in
3106         https://bugs.webkit.org/show_bug.cgi?id=179023
3107
3108         Reviewed by Tim Horton.
3109
3110         * Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb:
3111         
3112             Update template to conditionally expose experimental features based on their
3113             'condition' option in WebPreferences.yaml
3114
3115 2017-10-30  Michael Catanzaro  <mcatanzaro@igalia.com>
3116
3117         [WPE] Fix build warnings
3118         https://bugs.webkit.org/show_bug.cgi?id=178899
3119
3120         Reviewed by Carlos Alberto Lopez Perez.
3121
3122         * PlatformWPE.cmake:
3123
3124 2017-10-30  Sam Weinig  <sam@webkit.org>
3125
3126         [Settings] Replace macro driven experimental features code with generated code
3127         https://bugs.webkit.org/show_bug.cgi?id=178994
3128
3129         Reviewed by Simon Fraser.
3130
3131         As a first step toward allowing experimental features to vary based on compile
3132         time flags, replace the macro driven implementation of the WebPreferences part
3133         of experimental features, with one generated from a template file.
3134
3135         * CMakeLists.txt:
3136         * DerivedSources.make:
3137         * Scripts/GeneratePreferences.rb:
3138         * WebKit.xcodeproj/project.pbxproj:
3139
3140             Generate the new template.
3141         
3142         * Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb: Added.
3143         * UIProcess/WebPreferences.cpp:
3144         (WebKit::createExperimentalFeaturesVector): Deleted.
3145         (WebKit::WebPreferences::experimentalFeatures): Deleted.
3146         (WebKit::WebPreferences::isEnabledForFeature const): Deleted.
3147         (WebKit::WebPreferences::setEnabledForFeature): Deleted.
3148         (WebKit::WebPreferences::enableAllExperimentalFeatures): Deleted.
3149         
3150             Replace macro implementation with template generated one.
3151
3152 2017-10-30  Michael Catanzaro  <mcatanzaro@igalia.com>
3153
3154         [WPE] Build more files under WebCore as unified sources and get rid of WebCorePlatformWPE build target
3155         https://bugs.webkit.org/show_bug.cgi?id=178964
3156
3157         Reviewed by Carlos Alberto Lopez Perez.
3158
3159         * PlatformWPE.cmake:
3160
3161 2017-10-30  Michael Catanzaro  <mcatanzaro@igalia.com>
3162
3163         [WPE][GTK] Expose availability of certain editing commands in WebKitEditorState
3164         https://bugs.webkit.org/show_bug.cgi?id=168219
3165
3166         Reviewed by Ryosuke Niwa.
3167
3168         Expose canCut, canCopy, canPaste, canUndo, and canRedo in EditorState::PostLayouData.
3169
3170         Add corresponding new WPE/GTK API.
3171
3172         Remove allowsCopy from WebKitTestResultData. It's unused, does not work correctly in all
3173         circumstances, and irritates Ryosuke.
3174
3175         Also, remove a bunch of #ifs guarding post layout data, since it's now used on all ports.
3176
3177         * Shared/EditorState.cpp:
3178         (WebKit::EditorState::encode const):
3179         (WebKit::EditorState::decode):
3180         (WebKit::EditorState::PostLayoutData::encode const):
3181         (WebKit::EditorState::PostLayoutData::decode):
3182         * Shared/EditorState.h:
3183         (WebKit::EditorState::postLayoutData const const):
3184         * Shared/WebHitTestResultData.cpp:
3185         (WebKit::WebHitTestResultData::WebHitTestResultData):
3186         (WebKit::WebHitTestResultData::encode const):
3187         (WebKit::WebHitTestResultData::decode):
3188         * Shared/WebHitTestResultData.h:
3189         * UIProcess/API/APIHitTestResult.h:
3190         (API::HitTestResult::allowsCopy const): Deleted.
3191         * UIProcess/API/glib/WebKitEditorState.cpp:
3192         (webkitEditorStateChanged):
3193         (webkit_editor_state_is_cut_available):
3194         (webkit_editor_state_is_copy_available):
3195         (webkit_editor_state_is_paste_available):
3196         (webkit_editor_state_is_undo_available):
3197         (webkit_editor_state_is_redo_available):
3198         * UIProcess/API/glib/WebKitWebView.cpp:
3199         (webkit_web_view_can_execute_editing_command):
3200         * UIProcess/API/gtk/WebKitEditorState.h:
3201         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
3202         * UIProcess/API/wpe/WebKitEditorState.h:
3203         * WebProcess/WebPage/WebPage.cpp:
3204         (WebKit::WebPage::editorState const):
3205         * WebProcess/WebPage/mac/WebPageMac.mm:
3206         (WebKit::WebPage::performImmediateActionHitTestAtLocation):
3207
3208 2017-10-27  Sam Weinig  <sam@webkit.org>
3209
3210         [Settings] Generate more of the WebKit preferences code
3211         https://bugs.webkit.org/show_bug.cgi?id=178945
3212
3213         Reviewed by Chris Dumez.
3214
3215         Generate WebPreferencesKeys.{h,cpp} and WebPreferencesStoreDefaultsMap.cpp
3216
3217         * CMakeLists.txt:
3218         * DerivedSources.make:
3219         * WebKit.xcodeproj/project.pbxproj:
3220         * Scripts/GeneratePreferences.rb:
3221         
3222             Generate new files.
3223         
3224         * Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb:
3225         
3226             Update include.
3227         
3228         * Scripts/PreferencesTemplates/WebPreferencesKeys.cpp.erb: Added.
3229         * Scripts/PreferencesTemplates/WebPreferencesKeys.h.erb: Added.
3230         * Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb: Added.
3231
3232             Add template files for new generated files.
3233
3234         * Shared/WebPreferencesDefaultValues.h: Copied from Source/WebKit/Shared/WebPreferencesDefinitionsBase.h.
3235         * Shared/WebPreferencesDefinitionsBase.h:
3236         
3237             Renamed WebPreferencesDefinitionsBase.h to WebPreferencesDefaultValues.h to better indicate what it is.
3238         
3239         * Shared/WebPreferencesKeys.cpp: Removed.
3240         * Shared/WebPreferencesKeys.h: Removed.
3241         
3242             Replaced with generated versions.
3243
3244         * Shared/WebPreferencesStore.cpp:
3245         (WebKit::defaults): Deleted.
3246         * Shared/WebPreferencesStore.h:
3247         
3248             Replace macro driven defaults map with generated WebPreferencesStoreDefaultsMap.cpp.
3249
3250 2017-10-28  Chris Dumez  <cdumez@apple.com>
3251
3252         self.ExtendableEvent / Client / Clients / WindowClient do not exist in a Service Worker
3253         https://bugs.webkit.org/show_bug.cgi?id=178976
3254
3255         Reviewed by Sam Weinig.
3256
3257         Actually enable the Service Worker RuntimeEnabledFeature in the Service Worker
3258         WebProcess.
3259
3260         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
3261         (WebKit::WebSWContextManagerConnection::updatePreferences):
3262
3263 2017-10-28  Joseph Pecoraro  <pecoraro@apple.com>
3264
3265         Make postprocess-framework-headers.sh a little easier to read
3266         https://bugs.webkit.org/show_bug.cgi?id=178971
3267
3268         Reviewed by Sam Weinig.
3269
3270         * mac/postprocess-framework-headers.sh:
3271
3272 2017-10-27  Daniel Bates  <dabates@apple.com>
3273
3274         Attempt to fix the Apple El Capitan build following <https://trac.webkit.org/changeset/224134>
3275         (https://bugs.webkit.org/show_bug.cgi?id=178919)
3276
3277         Move definition of NetworkLoad::isAllowedToAskUserForCredentials() outside of USE(NETWORK_SESSION)-guarded section.
3278
3279         * NetworkProcess/NetworkLoad.cpp:
3280         (WebKit::NetworkLoad::isAllowedToAskUserForCredentials const):
3281
3282 2017-10-27  Daniel Bates  <dabates@apple.com>
3283
3284         Only allow non-mixed content protected subresources to ask for credentials
3285         https://bugs.webkit.org/show_bug.cgi?id=178919
3286         <rdar://problem/35015245>
3287
3288         Reviewed by Alex Christensen.
3289
3290         Only allow non-mixed content protected subresources to ask for credentials. It is not meaningful
3291         to allow protected mixed-content subresources to ask for credentials.
3292
3293         * NetworkProcess/Downloads/PendingDownload.cpp:
3294         (WebKit::PendingDownload::PendingDownload): Initialize m_isAllowedToAskUserForCredentials based on
3295         the specified resource load parameters or NetworkLoad object.
3296         * NetworkProcess/Downloads/PendingDownload.h: Add override for NetworkLoadClient::isAllowedToAskUserForCredentials().
3297         * NetworkProcess/NetworkLoad.cpp:
3298         (WebKit::NetworkLoad::isAllowedToAskUserForCredentials const): Added.
3299         (WebKit::NetworkLoad::completeAuthenticationChallenge): Ask NetworkLoadClient whether the load is
3300         allowed to prompt for credentials.
3301         (WebKit::NetworkLoad::didReceiveAuthenticationChallenge): Ditto.
3302         * NetworkProcess/NetworkLoad.h:
3303         * NetworkProcess/NetworkLoadClient.h:
3304         * NetworkProcess/NetworkResourceLoader.cpp:
3305         (WebKit::NetworkResourceLoader::NetworkResourceLoader): Initialize m_isAllowedToAskUserForCredentials
3306         based on the specified resource load parameters.
3307         (WebKit::NetworkResourceLoader::willSendRedirectedRequest): We do not support prompting for credentials
3308         for synchronous loads.
3309         (WebKit::NetworkResourceLoader::continueWillSendRequest): Modified to take an argument as to whether the
3310         load is allowed to ask the user for credentials and updates state.
3311         * NetworkProcess/NetworkResourceLoader.h:
3312         * NetworkProcess/NetworkResourceLoader.messages.in: Modified message ContinueWillSendRequest to take a
3313         boolean as to whether the load is allowed to ask the user for credentials.
3314         * NetworkProcess/PreconnectTask.h: Override NetworkLoadClient::isAllowedToAskUserForCredentials()
3315         such that we never ask for credentials. This matches our current behavior.
3316         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h: Ditto.
3317         * WebProcess/Network/WebResourceLoader.cpp:
3318         (WebKit::WebResourceLoader::willSendRequest): Query ResourceLoader as to whether the load is allowed to
3319         ask the user for credentials and pass this state to NetworkResourceLoader.
3320
3321 2017-10-27  Adrian Perez de Castro  <aperez@igalia.com>
3322
3323         [GTK][CMake] Incorrect conditional check when adding build dir to GIR runtime library path
3324         https://bugs.webkit.org/show_bug.cgi?id=178936
3325
3326         Reviewed by Michael Catanzaro.
3327
3328         * PlatformGTK.cmake: Fix spelling of variable used in conditional.
3329
3330 2017-10-27  Chris Dumez  <cdumez@apple.com>
3331
3332         Add initial support for serviceWorkerClient.postMessage()
3333         https://bugs.webkit.org/show_bug.cgi?id=178794
3334
3335         Reviewed by Youenn Fablet.
3336
3337         Add initial support for serviceWorkerClient.postMessage():
3338         - https://w3c.github.io/ServiceWorker/#client-postmessage
3339
3340         It is now possible to do bi-directional communication with a service worker
3341         via postMessage().
3342
3343         * Shared/WebCoreArgumentCoders.cpp:
3344         (IPC::ArgumentCoder<ServiceWorkerClientIdentifier>::encode):
3345         (IPC::ArgumentCoder<ServiceWorkerClientIdentifier>::decode):
3346         * Shared/WebCoreArgumentCoders.h:
3347         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3348         (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope):
3349         (WebKit::WebSWServerConnection::postMessageToServiceWorkerClient):
3350         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
3351         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
3352         * StorageProcess/StorageProcess.cpp:
3353         (WebKit::StorageProcess::postMessageToServiceWorkerClient):
3354         * StorageProcess/StorageProcess.h:
3355         * StorageProcess/StorageProcess.messages.in:
3356         * WebProcess/Storage/WebSWClientConnection.cpp:
3357         (WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope):
3358         (WebKit::WebSWClientConnection::postMessageToServiceWorkerClient):
3359         * WebProcess/Storage/WebSWClientConnection.h:
3360         * WebProcess/Storage/WebSWClientConnection.messages.in:
3361         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
3362         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerGlobalScope):
3363         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerClient):
3364         * WebProcess/Storage/WebSWContextManagerConnection.h:
3365         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
3366
3367 2017-10-27  David Kilzer  <ddkilzer@apple.com>
3368
3369         REGRESSION (r224077): DeprecatedGlobalSettings::setAVKitEnabled() not protected by HAVE(AVKIT)
3370
3371         Unreviewed build fix.
3372
3373         * WebProcess/WebPage/WebPage.cpp:
3374         (WebKit::WebPage::updatePreferences): Fix build.
3375
3376 2017-10-26  Jeremy Jones  <jeremyj@apple.com>
3377
3378         Implement seek tolerance methods in WebAVPlayerController.
3379         https://bugs.webkit.org/show_bug.cgi?id=178838
3380         rdar://problem/33781777
3381
3382         Reviewed by Eric Carlson.
3383
3384         This implementes additional methods on WebAVPlayerController that allows AVKit more control over seeking.
3385
3386         * UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
3387         * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
3388         (WebKit::PlaybackSessionModelContext::seekToTime):
3389         (WebKit::PlaybackSessionManagerProxy::seekToTime):
3390         * WebProcess/cocoa/PlaybackSessionManager.h:
3391         * WebProcess/cocoa/PlaybackSessionManager.messages.in:
3392         * WebProcess/cocoa/PlaybackSessionManager.mm:
3393         (WebKit::PlaybackSessionManager::seekToTime):
3394
3395 2017-10-26  Brian Burg  <bburg@apple.com>
3396
3397         Web Automation: denying user permission for getUserMedia doesn't work
3398         https://bugs.webkit.org/show_bug.cgi?id=178895
3399
3400         Reviewed by Youenn Fablet.
3401
3402         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
3403         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
3404         The ordering of special cases is incorrect. Safari configures its automation views to
3405         allow mock devices and never prompt for them. These checks were before the check for
3406         the automation session's getUserMedia permission. Switch these checks.
3407
3408         Also change the deny reason so that subsequent requests are also denied. This matches
3409         behavior when a user denies a permission request on a real dialog. With this change,
3410         the DOM error changes from SecurityError to NotAllowedError, which makes more sense.
3411
3412 2017-10-26  Michael Catanzaro  <mcatanzaro@igalia.com>
3413
3414         Unreviewed, fix GCC warning spam after r224077
3415         https://bugs.webkit.org/show_bug.cgi?id=178823
3416
3417         Need to leave a blank line at the bottom of the file.
3418
3419         * Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb:
3420
3421 2017-10-25  Simon Fraser  <simon.fraser@apple.com>
3422
3423         When navigating back to a page, compositing layers may not use accelerated drawing
3424         https://bugs.webkit.org/show_bug.cgi?id=178749
3425         rdar://problem/35158946
3426
3427         Reviewed by Dean Jackson.
3428
3429         Avoid assertions when a test enables accelerated drawing (which we can't support
3430         in the iOS simulator).
3431
3432         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
3433         (WebKit::RemoteLayerBackingStore::ensureBackingStore):
3434
3435 2017-10-26  Sam Weinig  <sam@webkit.org>
3436
3437         [Settings] Generate the bulk of WebPage::updatePreferences(...)
3438         https://bugs.webkit.org/show_bug.cgi?id=178823
3439
3440         Reviewed by Tim Horton.
3441
3442         * CMakeLists.txt:
3443         * DerivedSources.make:
3444         * WebKit.xcodeproj/project.pbxproj:
3445
3446             Add new file generation.
3447
3448         * Scripts/GeneratePreferences.rb:
3449         
3450             Replace 'webkitOnly' boolean option with a new 'webcoreBinding' option.
3451             'webcoreBinding' supports the following values:
3452                 - none (same as webkit only)
3453                 - custom (means that you do bind to a webcore concept, but currently it must
3454                   be done in a custom manner)
3455                 - DeprecatedGlobalSettings (binds to a DeprecatedGlobalSettings setting)
3456                 - RuntimeEnabledFeatures (binds to a RuntimeEnabledFeatures setting)
3457             If 'webcoreBinding' is not provided, the preference binds to WebCore Setting
3458             of either the same name or the override name provided by the new 'webcoreName'
3459             option (we should try to remove the need for 'webcoreName' by unifying with 
3460             WebCore on preference/setting naming).
3461             
3462             A 'condition' option was also added to indicate that the preference is only available
3463             when that macro condition is true.
3464             
3465             Since we are generating most of WebPage::updatePreferences, we can simplify the
3466             macros in WebPreferencesDefinitions.h to only have normal/debug/experimental variants
3467             and remove the need for per-type macros, which were only used in WebPage::updatePreferences.
3468         
3469         * Scripts/PreferencesTemplates/WebPageUpdatePreferences.cpp.erb: Added.