Delay some service worker operations until after the database import completes.
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2017-12-08  Brady Eidson  <beidson@apple.com>
2
3         Delay some service worker operations until after the database import completes.
4         https://bugs.webkit.org/show_bug.cgi?id=180573
5
6         Reviewed by Chris Dumez.
7
8         * StorageProcess/ServiceWorker/WebSWOriginStore.cpp:
9         (WebKit::WebSWOriginStore::importComplete): Tell the Origin Table on all connects that
10           the import is complete.
11         (WebKit::WebSWOriginStore::registerSWServerConnection):
12         * StorageProcess/ServiceWorker/WebSWOriginStore.h:
13
14         * WebProcess/Storage/WebSWClientConnection.cpp:
15         (WebKit::WebSWClientConnection::mayHaveServiceWorkerRegisteredForOrigin const):
16         (WebKit::WebSWClientConnection::setSWOriginTableIsImported): Run deferred tasks!
17         (WebKit::WebSWClientConnection::matchRegistration): If the import isn't complete yet, delay
18           the match registration task until later.
19         (WebKit::WebSWClientConnection::runOrDelayTask): Either send the message now or save off
20           the task to wait until the import is complete.
21         (WebKit::WebSWClientConnection::getRegistrations): If the import isn't complete yet, delay
22           the get registrations task until later.
23         (WebKit::WebSWClientConnection::initializeSWOriginTableAsEmpty): Deleted.
24         * WebProcess/Storage/WebSWClientConnection.h:
25         * WebProcess/Storage/WebSWClientConnection.messages.in:
26
27         * WebProcess/Storage/WebSWOriginTable.cpp:
28         (WebKit::WebSWOriginTable::setSharedMemory):
29         * WebProcess/Storage/WebSWOriginTable.h:
30         (WebKit::WebSWOriginTable::isImported const):
31         (WebKit::WebSWOriginTable::setIsImported):
32         (WebKit::WebSWOriginTable::isInitialized const): Deleted.
33         (WebKit::WebSWOriginTable::initializeAsEmpty): Deleted.
34
35 2017-12-08  Youenn Fablet  <youenn@apple.com>
36
37         Service Worker should use a correct user agent
38         https://bugs.webkit.org/show_bug.cgi?id=180566
39         <rdar://problem/35926295>
40
41         Reviewed by Chris Dumez.
42
43         Add support to set service worker user agent from UIProcess to service worker process.
44         One user agent is currently supported per service worker process and it can be changed at any given time.
45         Only new service worker will use the new value.
46         Once a service worker is launched, it will stay with the same user agent value.
47
48         This sets both navigator.userAgent and User-Agent header name used for fetch within a service worker.
49         Compute the service worker process user agent by picking the last user agent set for a web page.
50
51         * UIProcess/ServiceWorkerProcessProxy.cpp:
52         (WebKit::ServiceWorkerProcessProxy::start):
53         (WebKit::ServiceWorkerProcessProxy::setUserAgent):
54         * UIProcess/ServiceWorkerProcessProxy.h:
55         * UIProcess/WebPageProxy.cpp:
56         (WebKit::WebPageProxy::setApplicationNameForUserAgent):
57         * UIProcess/WebProcessPool.cpp:
58         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
59         (WebKit::WebProcessPool::createWebPage):
60         (WebKit::WebProcessPool::updateServiceWorkerUserAgent):
61         * UIProcess/WebProcessPool.h:
62         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
63         (WebKit::WebSWContextManagerConnection::installServiceWorker):
64         (WebKit::WebSWContextManagerConnection::setUserAgent):
65         (WebKit::WebSWContextManagerConnection::removeFrameLoaderClient):
66         * WebProcess/Storage/WebSWContextManagerConnection.h:
67         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
68
69 2017-12-07  Simon Fraser  <simon.fraser@apple.com>
70
71         Wrong caret position for input field inside a fixed position parent on iOS 11
72         https://bugs.webkit.org/show_bug.cgi?id=176896
73         rdar://problem/33726145
74
75         Reviewed by Tim Horton.
76
77         In r219668 I added code to compute a layout viewport rect in the web process, so that
78         after programmatic scrolling, getBoundingClientRect() would return the correct values.
79         However, that computation sometimes used a different visual viewport than the UI process,
80         resulting in a different layout viewport being set. This would happen when the keyboard
81         was visible, and the combination of this and zooming when focusing an input would result
82         in a state where the scrolling tree contained notes computed with the bad layout viewport.
83         This could cause apparently offset fixed elements, and bad caret positioning if those fixed
84         elements contained the focused input.
85
86         Fix by passing to the web process the same visual viewport rect that the UI process is using,
87         namely "unobscuredContentRectRespectingInputViewBounds". This was already being set in
88         VisibleContentRectUpdateInfo but wasn't encoded/decoded, so fix that. Set it as an optional<>
89         on FrameView when different from the normal visual viewport, and return it from
90         visualViewportRect().
91
92         Some other minor logging changes.
93
94         * Shared/VisibleContentRectUpdateInfo.cpp:
95         (WebKit::VisibleContentRectUpdateInfo::encode const):
96         (WebKit::VisibleContentRectUpdateInfo::decode):
97         (WebKit::operator<<):
98         * Shared/VisibleContentRectUpdateInfo.h:
99         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
100         * WebProcess/WebPage/ios/WebPageIOS.mm:
101         (WebKit::WebPage::updateVisibleContentRects):
102
103 2017-12-06  Simon Fraser  <simon.fraser@apple.com>
104
105         When the iPhone keyboard is up, sometimes we never commit a stable update and re-show the caret
106         https://bugs.webkit.org/show_bug.cgi?id=180498
107
108         Reviewed by Tim Horton.
109
110         When the keyboard is showing, we would think that the page was in a rubber-banding state
111         because contentOffsetBoundedInValidRange() would always clamp the content offset to a different
112         value.
113
114         This happened because scrollView.contentInset don't change when the keyboard is showing,
115         but UIKit actually consults scrollView.adjustedContentInset, which does. If we use
116         scrollView.adjustedContentInset in this computation, we'll get a correct answer.
117
118         Also rewrote the clamping logic to be more similar to what UIKit does internally when computing
119         min/max content offset.
120
121         * UIProcess/API/Cocoa/WKWebView.mm:
122         (contentOffsetBoundedInValidRange):
123
124 2017-12-08  Chris Dumez  <cdumez@apple.com>
125
126         Clearing all Website Data should remove service worker registrations on disk
127         https://bugs.webkit.org/show_bug.cgi?id=180558
128
129         Reviewed by Youenn Fablet.
130
131         * StorageProcess/StorageProcess.cpp:
132         (WebKit::StorageProcess::deleteWebsiteData):
133         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
134
135 2017-12-08  Youenn Fablet  <youenn@apple.com>
136
137         WebServiceWorkerProvider should use Cancellation error to notify DTL that it cannot handle a fetch
138         https://bugs.webkit.org/show_bug.cgi?id=180584
139
140         Reviewed by Alex Christensen.
141
142         * WebProcess/Network/WebLoaderStrategy.cpp:
143         (WebKit::WebLoaderStrategy::scheduleLoad):
144
145 2017-12-08  Youenn Fablet  <youenn@apple.com>
146
147         Service Worker should use a correct SessionID
148         https://bugs.webkit.org/show_bug.cgi?id=180585
149
150         Reviewed by Alex Christensen.
151
152         Store SessionID in SWServer and send it as part of service worker instantiation.
153         Use it when creating service worker thread in service worker process.
154
155         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
156         (WebKit::WebSWServerToContextConnection::installServiceWorkerContext):
157         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
158         * StorageProcess/StorageProcess.cpp:
159         (WebKit::StorageProcess::swServerForSession):
160         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
161         (WebKit::WebSWContextManagerConnection::installServiceWorker):
162         * WebProcess/Storage/WebSWContextManagerConnection.h:
163         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
164
165 2017-12-08  Youenn Fablet  <youenn@apple.com>
166
167         FetchResponse should keep unfiltered ResourceResponse so that it can be used in Service Worker
168         https://bugs.webkit.org/show_bug.cgi?id=179641
169         <rdar://problem/35923570>
170
171         Reviewed by Alex Christensen.
172
173         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
174         (WebKit::ServiceWorkerClientFetch::didReceiveResponse): In case of opaque redirected response, handle it as a regular response.
175
176 2017-12-08  Alex Christensen  <achristensen@webkit.org>
177
178         Remove unused code in WebPageGroup
179         https://bugs.webkit.org/show_bug.cgi?id=180604
180
181         Reviewed by Youenn Fablet.
182
183         * UIProcess/WebPageGroup.cpp:
184         (WebKit::WebPageGroup::userContentController):
185         (WebKit::WebPageGroup::createNonNull): Deleted.
186         (WebKit::WebPageGroup::preferencesDidChange): Deleted.
187         * UIProcess/WebPageGroup.h:
188         * UIProcess/WebProcessPool.cpp:
189         (WebKit::WebProcessPool::WebProcessPool):
190
191 2017-12-08  Alex Christensen  <achristensen@webkit.org>
192
193         Modernize APIWebsiteDataStore.h and WebProcessPool.h
194         https://bugs.webkit.org/show_bug.cgi?id=180588
195
196         Reviewed by Chris Dumez.
197
198         pragma once, Ref instead of RefPtr, initializer list in header instead of literals in constructor.
199
200         * UIProcess/API/APIWebsiteDataStore.h:
201         * UIProcess/WebProcessPool.cpp:
202         (WebKit::WebProcessPool::WebProcessPool):
203         * UIProcess/WebProcessPool.h:
204
205 2017-12-08  Yusuke Suzuki  <utatane.tea@gmail.com>
206
207         Remove pthread_once in favor of dispatch_once
208         https://bugs.webkit.org/show_bug.cgi?id=180591
209
210         Reviewed by Saam Barati.
211
212         * PluginProcess/mac/PluginProcessMac.mm:
213         (WebKit::shouldCallRealDebugger):
214         (WebKit::initShouldCallRealDebugger): Deleted.
215
216 2017-12-08  Chris Dumez  <cdumez@apple.com>
217
218         ProcessPoolConfiguration::copy() fails to copy the service worker path
219         https://bugs.webkit.org/show_bug.cgi?id=180595
220
221         Reviewed by Brady Eidson.
222
223         * UIProcess/API/APIProcessPoolConfiguration.cpp:
224         (API::ProcessPoolConfiguration::copy):
225
226 2017-12-08  Chris Dumez  <cdumez@apple.com>
227
228         Different WebKitTestRunner instances should use different service worker registrations databases
229         https://bugs.webkit.org/show_bug.cgi?id=180589
230
231         Reviewed by Brady Eidson.
232
233         * UIProcess/API/C/WKContextConfigurationRef.cpp:
234         (WKContextConfigurationCopyServiceWorkerDatabaseDirectory):
235         (WKContextConfigurationSetServiceWorkerDatabaseDirectory):
236         * UIProcess/API/C/WKContextConfigurationRef.h:
237
238 2017-12-08  Alex Christensen  <achristensen@webkit.org>
239
240         Pass std::optional<WebsitePolicies> instead of WebsitePolicies
241         https://bugs.webkit.org/show_bug.cgi?id=180563
242
243         Reviewed by Andy Estes.
244
245         WebsitePolicies are only passed along when a decidePolicyForNavigationAction SPI completion handler
246         is called with a valid _WKWebsitePolicies object.  In other cases, we don't have one.  Rather than
247         making WebsitePolicies have a default value for everything that won't change policies, pass
248         a std::optional<WebsitePolicies> which indicates better when we don't have new policies.
249
250         No change in behavior, but this will enable me to add things to WebsitePolicies that have no default value.
251
252         * Shared/WebsitePolicies.h:
253         Make WebsitePolicies a class with public members because the IPC code generators don't understand std::optional<struct type>
254         * UIProcess/API/C/WKAPICast.h:
255         * UIProcess/Cocoa/NavigationState.mm:
256         (WebKit::tryAppLink):
257         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
258         * UIProcess/WebFrameListenerProxy.cpp:
259         (WebKit::WebFrameListenerProxy::receivedPolicyDecision):
260         * UIProcess/WebFrameListenerProxy.h:
261         * UIProcess/WebFramePolicyListenerProxy.cpp:
262         (WebKit::WebFramePolicyListenerProxy::use):
263         * UIProcess/WebFramePolicyListenerProxy.h:
264         * UIProcess/WebFrameProxy.cpp:
265         (WebKit::WebFrameProxy::receivedPolicyDecision):
266         * UIProcess/WebFrameProxy.h:
267         * UIProcess/WebPageProxy.cpp:
268         (WebKit::WebPageProxy::receivedPolicyDecision):
269         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
270         * UIProcess/WebPageProxy.h:
271         * UIProcess/WebPageProxy.messages.in:
272         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
273         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
274         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
275         * WebProcess/WebPage/WebFrame.cpp:
276         (WebKit::WebFrame::didReceivePolicyDecision):
277         * WebProcess/WebPage/WebFrame.h:
278         * WebProcess/WebPage/WebPage.cpp:
279         (WebKit::WebPage::didReceivePolicyDecision):
280         * WebProcess/WebPage/WebPage.h:
281         * WebProcess/WebPage/WebPage.messages.in:
282
283 2017-12-08  Yusuke Suzuki  <utatane.tea@gmail.com>
284
285         [WTF] Remove remaining use of Mutex
286         https://bugs.webkit.org/show_bug.cgi?id=180579
287
288         Reviewed by Alex Christensen.
289
290         Remove unused "BinarySemaphore.h".
291
292         * Platform/IPC/win/ConnectionWin.cpp:
293
294 2017-12-08  Michael Catanzaro  <mcatanzaro@igalia.com>
295
296         [GTK] WebInspectorProxyClient needs a virtual destructor
297         https://bugs.webkit.org/show_bug.cgi?id=180533
298
299         Reviewed by Carlos Garcia Campos.
300
301         Otherwise the derived class portion of the object, WebKitInspectorClient, is not destroyed.
302
303         * UIProcess/gtk/WebInspectorProxyClient.h:
304
305 2017-12-07  Yousuke Kimoto  <yousuke.kimoto@sony.com>
306
307         [WinCairo] Fix ResourceError handling in ArgumentCoder for wincairo webkit
308         https://bugs.webkit.org/show_bug.cgi?id=180483
309
310         Reviewed by Alex Christensen.
311
312         * Shared/curl/WebCoreArgumentCodersCurl.cpp:
313         (IPC::ArgumentCoder<ResourceError>::encodePlatformData):
314         (IPC::ArgumentCoder<ResourceError>::decodePlatformData):
315
316 2017-12-07  Youenn Fablet  <youenn@apple.com>
317
318         StartFetch should take a ServiceWorkerIdentifier
319         https://bugs.webkit.org/show_bug.cgi?id=180478
320
321         Reviewed by Brady Eidson.
322
323         Before the patch, StartFetch was taking an optional ServiceWorkerIdentifier.
324         Now that every navigation fetch is querying its matching registration, it can no longer be optional.
325
326         In the case there is a problem in running the service worker at start fetch time,
327         answer to the WebProcess to go to network so that the request does not get stalled.
328
329         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
330         (WebKit::WebSWServerConnection::startFetch):
331         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
332         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
333         * WebProcess/Storage/WebSWClientConnection.cpp:
334         (WebKit::WebSWClientConnection::startFetch):
335         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
336         (WebKit::WebSWContextManagerConnection::startFetch):
337         * WebProcess/Storage/WebSWContextManagerConnection.h:
338         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
339
340 2017-12-07  Saam Barati  <sbarati@apple.com>
341
342         We need to grab the JSLock in InjectedBundle::createWebDataFromUint8Array
343         https://bugs.webkit.org/show_bug.cgi?id=180492
344
345         Reviewed by Alex Christensen.
346
347         InjectedBundle::createWebDataFromUint8Array calls into WebCore APIs that allocate
348         out of the JS heap. It's only legal to allocate out of the JS heap when holding the JS lock.
349
350         * WebProcess/InjectedBundle/InjectedBundle.cpp:
351         (WebKit::InjectedBundle::createWebDataFromUint8Array):
352
353 2017-12-07  Simon Fraser  <simon.fraser@apple.com>
354
355         Propagate WebKit2Logging channels to the Web Process
356         https://bugs.webkit.org/show_bug.cgi?id=180517
357
358         Reviewed by Tim Horton.
359
360         If you set WebKit2Logging, you want those channels active in both the UI process and
361         the web process, but without tricky 'defaults' gyrations, setting them in the web process
362         was hard.
363
364         Instead, send them through to the process via WebProcessCreationParameters, as we do
365         for WebCoreLogging channels.
366
367         * Platform/LogInitialization.h:
368         * Platform/Logging.cpp:
369         (WebKit::initializeLogChannelsIfNecessary):
370         * Shared/WebProcessCreationParameters.cpp:
371         (WebKit::WebProcessCreationParameters::encode const):
372         (WebKit::WebProcessCreationParameters::decode):
373         * Shared/WebProcessCreationParameters.h:
374         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
375         (WebKit::WebProcessPool::platformInitializeWebProcess):
376         * WebProcess/cocoa/WebProcessCocoa.mm:
377         (WebKit::WebProcess::platformInitializeWebProcess):
378
379 2017-12-07  Simon Fraser  <simon.fraser@apple.com>
380
381         Add logging for EditorState in RemoteLayerTree transactions
382         https://bugs.webkit.org/show_bug.cgi?id=180515
383
384         Reviewed by Wenson Hsieh.
385        
386         Make EditorState TextStream-able, and dump it in layer tree transactions.
387
388         * Shared/EditorState.cpp:
389         (WebKit::operator<<):
390         * Shared/EditorState.h:
391         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
392         (WebKit::RemoteLayerTreeTransaction::description const):
393
394 2017-12-07  Youenn Fablet  <youenn@apple.com>
395
396         CacheStorage Cache should not remove any disk entry when clearing its memory representation
397         https://bugs.webkit.org/show_bug.cgi?id=180546
398
399         Reviewed by Brady Eidson.
400
401         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
402         (WebKit::CacheStorage::Cache::clearMemoryRepresentation):
403
404 2017-12-07  Myles C. Maxfield  <mmaxfield@apple.com>
405
406         [Cocoa] Add SPI to disallow user-installed fonts
407         https://bugs.webkit.org/show_bug.cgi?id=180062
408         <rdar://problem/35042408>
409
410         Reviewed by Simon Fraser.
411
412         * Shared/WebPreferences.yaml:
413         * UIProcess/API/C/WKPreferences.cpp:
414         (WKPreferencesSetShouldDisallowUserInstalledFonts):
415         (WKPreferencesGetShouldDisallowUserInstalledFonts):
416         * UIProcess/API/C/WKPreferencesRefPrivate.h:
417         * UIProcess/API/Cocoa/WKPreferences.mm:
418         (-[WKPreferences _shouldDisallowUserInstalledFonts]):
419         (-[WKPreferences _setShouldDisallowUserInstalledFonts:]):
420         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
421
422 2017-12-07  David Quesada  <david_quesada@apple.com>
423
424         [Web App Manifest] Support display-mode media feature
425         https://bugs.webkit.org/show_bug.cgi?id=180376
426         rdar://problem/35837993
427
428         Reviewed by Geoffrey Garen.
429
430         * UIProcess/API/Cocoa/_WKApplicationManifest.h:
431         * UIProcess/API/Cocoa/_WKApplicationManifest.mm:
432         (-[_WKApplicationManifest initWithCoder:]):
433         (-[_WKApplicationManifest encodeWithCoder:]):
434         (-[_WKApplicationManifest displayMode]):
435
436 2017-12-07  Chris Dumez  <cdumez@apple.com>
437
438         Unreviewed build fix after r225622.
439
440         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
441         (WebKit::WebSWServerConnection::postMessageToServiceWorkerFromServiceWorker):
442
443 2017-12-06  Chris Dumez  <cdumez@apple.com>
444
445         We should be able to recover after a Service Worker process crash
446         https://bugs.webkit.org/show_bug.cgi?id=180477
447
448         Reviewed by Brady Eidson and Youenn Fablet.
449
450         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
451         (WebKit::WebSWServerConnection::startFetch):
452         (WebKit::WebSWServerConnection::postMessageToServiceWorkerFromClient):
453         (WebKit::WebSWServerConnection::postMessageToServiceWorkerFromServiceWorker):
454         Update calls to SWServer::runServiceWorkerIfNecessary() that that it is asynchronous
455         and takes in a lambda.
456
457         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
458         (WebKit::WebSWServerConnection::ipcConnection const):
459         Add getter for the underlying IPC connection.
460
461         * StorageProcess/StorageProcess.cpp:
462         (WebKit::StorageProcess::didClose):
463         (WebKit::StorageProcess::connectionToContextProcessWasClosed):
464         Move some code to connectionToContextProcessWasClosed() to avoid duplication.
465         Also, relaunch the Service Worker process if it has exited but we still
466         have SWServer connections to regular Web Processes.
467
468         (WebKit::StorageProcess::needsServerToContextConnection const):
469         Utility function to determine if we still need the service worker process.
470         The current rule is that we need the service worker (aka "context") process
471         if we still have SWServer connections to regular Web Processes.
472
473         * StorageProcess/StorageProcess.h:
474
475         * StorageProcess/StorageToWebProcessConnection.cpp:
476         (WebKit::StorageToWebProcessConnection::didClose):
477         If didClose() is called for the connection to the service worker context,
478         let the StorageProcess know so that it can clear its state and relaunch
479         the process if necessary.
480
481         * UIProcess/API/C/WKContext.cpp:
482         (WKContextTerminateServiceWorkerProcess):
483         * UIProcess/API/C/WKContextPrivate.h:
484         * UIProcess/API/Cocoa/WKProcessPool.mm:
485         (-[WKProcessPool _terminateServiceWorkerProcess]):
486         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
487         Add SPI to terminate the service worker process.
488
489         * UIProcess/WebProcessPool.cpp:
490         (WebKit::m_serviceWorkerProcessTerminationTimer):
491         (WebKit::WebProcessPool::createNewWebProcess):
492         (WebKit::WebProcessPool::disconnectProcess):
493         (WebKit::WebProcessPool::terminateServiceWorkerProcess):
494         * UIProcess/WebProcessPool.h:
495         We used to shutdown the ServiceWorker process right away as soon as the last regular
496         WebProcess was gone. We now give it a grace period of 5 seconds in case a new
497         WebProcess gets launched shortly after.
498
499 2017-12-02  Darin Adler  <darin@apple.com>
500
501         Modernize some aspects of text codecs, eliminate WebKit use of strcasecmp
502         https://bugs.webkit.org/show_bug.cgi?id=180009
503
504         Reviewed by Alex Christensen.
505
506         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
507         (WebKit::initializeProtectionSpace): Use equalLettersIgnoringASCIICase instead
508         of strcasecmp.
509
510 2017-12-06  David Quesada  <david_quesada@apple.com>
511
512         [Web App Manifest] Add SPI for applying a manifest to a top-level browsing context
513         https://bugs.webkit.org/show_bug.cgi?id=180368
514         rdar://problem/34748067
515
516         Reviewed by Geoffrey Garen.
517
518         Add a new property WKWebViewConfiguration._applicationManifest to specify manifest
519         to apply to application contexts (aka. top-level browsing contexts, i.e. web views).
520         The manifest is ultimately stored on the MainFrame of the Pages created from the
521         web view configuration.
522
523         No new tests, no change in behavior.
524
525         * Shared/WebPageCreationParameters.cpp:
526         (WebKit::WebPageCreationParameters::encode const):
527         (WebKit::WebPageCreationParameters::decode):
528         * Shared/WebPageCreationParameters.h:
529         * UIProcess/API/APIPageConfiguration.cpp:
530         (API::PageConfiguration::copy const):
531         (API::PageConfiguration::applicationManifest const):
532         (API::PageConfiguration::setApplicationManifest):
533         * UIProcess/API/APIPageConfiguration.h:
534         * UIProcess/API/Cocoa/WKWebView.mm:
535         (-[WKWebView _initializeWithConfiguration:]):
536         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
537         (-[WKWebViewConfiguration copyWithZone:]):
538         (-[WKWebViewConfiguration _applicationManifest]):
539         (-[WKWebViewConfiguration _setApplicationManifest:]):
540         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
541         * UIProcess/API/Cocoa/_WKApplicationManifestInternal.h:
542         * UIProcess/WebPageProxy.cpp:
543         (WebKit::WebPageProxy::creationParameters):
544         * WebProcess/WebPage/WebPage.cpp:
545         (WebKit::m_cpuLimit):
546
547 2017-12-06  Jeff Miller  <jeffm@apple.com>
548
549         -[WKWebViewConfiguration copyWithZone] doesn't copy _groupIdentifier
550         https://bugs.webkit.org/show_bug.cgi?id=180504
551
552         Reviewed by Geoffrey Garen.
553
554         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
555         (-[WKWebViewConfiguration copyWithZone:]):
556         Copy _groupIdentifier.
557
558 2017-12-06  David Quesada  <david_quesada@apple.com>
559
560         [Web App Manifest] Add SPI for fetching the manifest
561         https://bugs.webkit.org/show_bug.cgi?id=180294
562         rdar://problem/34747968
563
564         Reviewed by Geoffrey Garen.
565
566         Add a new method -[WKWebView _getApplicationManifestWithCompletionHandler:] to request
567         the manifest associated with the current page.
568
569         * Shared/API/APIObject.h:
570         * Shared/Cocoa/APIObject.mm:
571         (API::Object::newObject):
572         * UIProcess/API/APIApplicationManifest.h: Copied from Source/WebCore/Modules/applicationmanifest/ApplicationManifest.h.
573             Add a new API object type for application manifests.
574         * UIProcess/API/C/WKPage.cpp:
575         (WKPageGetApplicationManifest_b):
576             Add a C version of this SPI for WebKitTestRunner.
577         * UIProcess/API/C/WKPagePrivate.h:
578         * UIProcess/API/Cocoa/WKWebView.mm:
579         (-[WKWebView _getApplicationManifestWithCompletionHandler:]):
580         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
581         * UIProcess/API/Cocoa/_WKApplicationManifest.h: Copied from Source/WebCore/Modules/applicationmanifest/ApplicationManifest.h.
582         * UIProcess/API/Cocoa/_WKApplicationManifest.mm: Added.
583         (-[_WKApplicationManifest initWithCoder:]):
584         (-[_WKApplicationManifest encodeWithCoder:]):
585         (+[_WKApplicationManifest applicationManifestFromJSON:manifestURL:documentURL:]):
586         (-[_WKApplicationManifest _apiObject]):
587         (nullableNSString):
588         (-[_WKApplicationManifest name]):
589         (-[_WKApplicationManifest shortName]):
590         (-[_WKApplicationManifest applicationDescription]):
591         (-[_WKApplicationManifest scope]):
592         (-[_WKApplicationManifest startURL]):
593         * UIProcess/API/Cocoa/_WKApplicationManifestInternal.h: Copied from Source/WebCore/Modules/applicationmanifest/ApplicationManifest.h.
594         (API::wrapper):
595         * UIProcess/WebPageProxy.cpp:
596         (WebKit::WebPageProxy::applicationManifestCallback):
597         (WebKit::WebPageProxy::getApplicationManifest):
598         * UIProcess/WebPageProxy.h:
599         * UIProcess/WebPageProxy.messages.in:
600         * WebKit.xcodeproj/project.pbxproj:
601         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
602         (WebKit::WebFrameLoaderClient::finishedLoadingApplicationManifest):
603         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
604         * WebProcess/WebPage/WebPage.cpp:
605         (WebKit::WebPage::getApplicationManifest):
606         (WebKit::WebPage::didFinishLoadingApplicationManifest):
607         * WebProcess/WebPage/WebPage.h:
608         * WebProcess/WebPage/WebPage.messages.in:
609
610 2017-12-06  Per Arne Vollan  <pvollan@apple.com>
611
612         The WebProcess should use the NSRunLoop runloop type.
613         https://bugs.webkit.org/show_bug.cgi?id=179804
614         <rdar://problem/14012823>
615
616         Reviewed by Brent Fulgham.
617
618         * Platform/IPC/mac/ConnectionMac.mm:
619         (IPC::AccessibilityProcessSuspendedNotification):
620         * Shared/ChildProcess.h:
621         * Shared/mac/ChildProcessMac.mm:
622         (WebKit::ChildProcess::launchServicesCheckIn):
623         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
624         (WebKit::shouldLeakBoost):
625         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist:
626         * WebProcess/WebProcess.cpp:
627         (WebKit::WebProcess::initializeProcess):
628
629 2017-12-06  Nan Wang  <n_wang@apple.com>
630
631         AX: [iOS] Post accessibility notification when a web process changes its suspended state
632         https://bugs.webkit.org/show_bug.cgi?id=180458
633         <rdar://problem/35869115>
634
635         Reviewed by Chris Dumez.
636
637         Post accessibility notification with the pid information when a web process
638         becomes suspended or resumes running.
639
640         * WebProcess/WebProcess.cpp:
641         (WebKit::WebProcess::actualPrepareToSuspend):
642         (WebKit::WebProcess::processDidResume):
643         * WebProcess/WebProcess.h:
644         * WebProcess/cocoa/WebProcessCocoa.mm:
645         (WebKit::WebProcess::accessibilityProcessSuspendedNotification):
646
647 2017-12-06  Ryan Haddad  <ryanhaddad@apple.com>
648
649         Unreviewed build fix, removed unused lambda capture.
650
651         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
652         (WebKit::CacheStorageEngineConnection::open):
653
654 2017-12-06  John Wilander  <wilander@apple.com>
655
656         Storage Access API: Make document.hasStorageAccess a function and always allow access for same-origin iframes
657         https://bugs.webkit.org/show_bug.cgi?id=176944
658         <rdar://problem/34440658>
659
660         Reviewed by Brent Fulgham.
661
662         This change introduces document.hasStorageAccess() as a function which
663         returns a promise instead of being a property. Since cookie access can
664         be due to both a granted request and recent user interaction as first
665         party, the WebKit::WebResourceLoadStatisticsStore needs to be consulted.
666
667         * UIProcess/WebPageProxy.cpp:
668         (WebKit::WebPageProxy::hasStorageAccess):
669         * UIProcess/WebPageProxy.h:
670         * UIProcess/WebPageProxy.messages.in:
671         * UIProcess/WebResourceLoadStatisticsStore.cpp:
672         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
673         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
674             Now adds an entry for granted access. A bug found through testing.
675             Switched from WTF::Function to WTF::CompletionHandler.
676         * UIProcess/WebResourceLoadStatisticsStore.h:
677         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
678         (WebKit::WebsiteDataStore::hasStorageAccess):
679         (WebKit::WebsiteDataStore::requestStorageAccess):
680             Switched from WTF::Function to WTF::CompletionHandler.
681         * UIProcess/WebsiteData/WebsiteDataStore.h:
682         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
683         (WebKit::WebChromeClient::hasStorageAccess):
684         (WebKit::WebChromeClient::requestStorageAccess):
685             Switched from WTF::Function to WTF::CompletionHandler.
686         * WebProcess/WebCoreSupport/WebChromeClient.h:
687         * WebProcess/WebPage/WebPage.cpp:
688         (WebKit::WebPage::hasStorageAccess):
689         (WebKit::WebPage::requestStorageAccess):
690             Switched from WTF::Function to WTF::CompletionHandler.
691         * WebProcess/WebPage/WebPage.h:
692
693 2017-12-06  Youenn Fablet  <youenn@apple.com>
694
695         CacheStorageEngineConnection should protect its IPC Connection when doing asynchronous tasks
696         https://bugs.webkit.org/show_bug.cgi?id=180461
697
698         Reviewed by Chris Dumez.
699
700         Protecting the IPC connection instead of the CacheStorageEngineConnection
701         since CacheStorageEngineConnection only keeps a reference to the NetworkConnectionToWebProcess.
702
703         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
704         (WebKit::CacheStorageEngineConnection::open):
705         (WebKit::CacheStorageEngineConnection::remove):
706         (WebKit::CacheStorageEngineConnection::caches):
707         (WebKit::CacheStorageEngineConnection::retrieveRecords):
708         (WebKit::CacheStorageEngineConnection::deleteMatchingRecords):
709         (WebKit::CacheStorageEngineConnection::putRecords):
710         (WebKit::CacheStorageEngineConnection::clearMemoryRepresentation):
711
712 2017-12-06  Zan Dobersek  <zdobersek@igalia.com>
713
714         [CoordGraphics] Introduce Nicosia::PaintingContext, add Cairo implementation
715         https://bugs.webkit.org/show_bug.cgi?id=180239
716
717         Reviewed by Michael Catanzaro.
718
719         With Nicosia::Buffer now only providing the memory area into which the
720         tile content was rasterized, we can simplify the BitmapTexture update
721         greatly -- we don't have to create a BitmapImage anymore and retrieve
722         memory pointer from the contained cairo_surface_t object. Instead, we
723         just copy to GPU the memory that Nicosia::Buffer controls.
724
725         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
726         (WebKit::CoordinatedBackingStoreTile::swapBuffers):
727
728 2017-12-05  Brent Fulgham  <bfulgham@apple.com>
729
730         Limit user agent versioning to an upper bound
731         https://bugs.webkit.org/show_bug.cgi?id=180365
732         <rdar://problem/34550617>
733
734         Reviewed by Joseph Pecoraro.
735
736         * UIProcess/ios/WebPageProxyIOS.mm:
737         (WebKit::WebPageProxy::standardUserAgent): Don't pass the WebKit bundle version when
738         creatin the User Agent string.
739         (WebKit::webKitBundleVersionString): Deleted.
740         * UIProcess/mac/WebPageProxyMac.mm:
741         (WebKit::WebPageProxy::standardUserAgent): Ditto.
742         (WebKit::webKitBundleVersionString): Deleted.
743
744 2017-12-05  Alex Christensen  <achristensen@webkit.org>
745
746         Fix crash when loading a file URL that does not have a fileSystemPath representation
747         https://bugs.webkit.org/show_bug.cgi?id=180448
748         <rdar://problem/22805921>
749
750         Reviewed by Chris Dumez.
751
752         * UIProcess/WebProcessProxy.cpp:
753         (WebKit::WebProcessProxy::assumeReadAccessToBaseURL):
754         Check if a String is null before adding it to a HashSet.
755
756 2017-12-05  Youenn Fablet  <youenn@apple.com>
757
758         Implement https://w3c.github.io/ServiceWorker/#clients-claim
759         https://bugs.webkit.org/show_bug.cgi?id=180261
760
761         Reviewed by Chris Dumez.
762
763         Add IPC plumbery for clients claim between ServiceWorker process and Storage process.
764
765         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
766         (WebKit::WebSWServerToContextConnection::claimCompleted):
767         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
768         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
769         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
770         (WebKit::WebSWContextManagerConnection::claim):
771         (WebKit::WebSWContextManagerConnection::claimCompleted):
772         * WebProcess/Storage/WebSWContextManagerConnection.h:
773         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
774
775 2017-12-05  Chris Dumez  <cdumez@apple.com>
776
777         Add support for ServiceWorkerContainer.prototype.ready
778         https://bugs.webkit.org/show_bug.cgi?id=180383
779
780         Reviewed by Youenn Fablet.
781
782         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
783         (WebKit::WebSWServerConnection::whenRegistrationReady):
784         (WebKit::WebSWServerConnection::resolveRegistrationReadyRequests):
785         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
786         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
787         * WebProcess/Storage/WebSWClientConnection.cpp:
788         (WebKit::WebSWClientConnection::matchRegistration):
789         (WebKit::WebSWClientConnection::whenRegistrationReady):
790         (WebKit::WebSWClientConnection::registrationReady):
791         (WebKit::WebSWClientConnection::getRegistrations):
792         * WebProcess/Storage/WebSWClientConnection.h:
793         * WebProcess/Storage/WebSWClientConnection.messages.in:
794
795 2017-12-05  Youenn Fablet  <youenn@apple.com>
796
797         Implement setting of service worker to client in SWServer without going to WebProcess
798         https://bugs.webkit.org/show_bug.cgi?id=180382
799
800         Reviewed by Chris Dumez.
801
802         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
803         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
804         (WebKit::WebSWServerConnection::registerServiceWorkerClient):
805         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
806         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
807         * WebProcess/Storage/WebSWClientConnection.cpp:
808         (WebKit::WebSWClientConnection::registerServiceWorkerClient):
809         (WebKit::WebSWClientConnection::serviceWorkerStartedControllingClient): Deleted.
810         (WebKit::WebSWClientConnection::serviceWorkerStoppedControllingClient): Deleted.
811         * WebProcess/Storage/WebSWClientConnection.h:
812
813 2017-12-04  Chris Dumez  <cdumez@apple.com>
814
815         Support container.getRegistration() / getRegistrations() inside service workers
816         https://bugs.webkit.org/show_bug.cgi?id=180360
817
818         Reviewed by Youenn Fablet.
819
820         * WebProcess/Storage/WebSWClientConnection.cpp:
821         (WebKit::WebSWClientConnection::didMatchRegistration):
822         (WebKit::WebSWClientConnection::didGetRegistrations):
823         (WebKit::WebSWClientConnection::matchRegistration):
824         (WebKit::WebSWClientConnection::getRegistrations):
825
826 2017-12-04  Brady Eidson  <beidson@apple.com>
827
828         Followup to:
829         Get a directory path to SWServers for storing ServiceWorker registrations
830         https://bugs.webkit.org/show_bug.cgi?id=180362
831
832         Unreviewed.
833
834         * StorageProcess/StorageProcess.cpp:
835         (WebKit::StorageProcess::swServerForSession): Change this ASSERT which is invalid in private browsing sessions.
836
837 2017-12-04  Simon Fraser  <simon.fraser@apple.com>
838
839         Minor DisplayRefreshMonitor-related cleanup
840         https://bugs.webkit.org/show_bug.cgi?id=179802
841
842         Reviewed by Sam Weinig.
843
844         Use RunLoopObserver::WellKnownRunLoopOrders. We want to fire before layer flushing.
845
846         * UIProcess/WebPageProxy.cpp:
847         (WebKit::m_configurationPreferenceValues):
848
849 2017-12-04  Brent Fulgham  <bfulgham@apple.com>
850
851         Don't force creation of process pool when enabling resource load statistics
852         https://bugs.webkit.org/show_bug.cgi?id=180374
853         <rdar://problem/35545639>
854
855         Reviewed by Alex Christensen.
856
857         Pass appropriate arguments to the 'processPool' accessor so that we only get the
858         set of existing process pools. We don't want to pay the cost of launching new
859         process pools just to set this flag. The flag will be properly set when the pools
860         are created as soon as a WebView is instantiated.
861
862         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
863         (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
864
865 2017-12-04  David Quesada  <david_quesada@apple.com>
866
867         Add a class for parsing application manifests
868         https://bugs.webkit.org/show_bug.cgi?id=177973
869         rdar://problem/34747949
870
871         Reviewed by Geoffrey Garen.
872
873         * Configurations/FeatureDefines.xcconfig: Add ENABLE_APPLICATION_MANIFEST feature flag.
874
875 2017-12-04  Wenson Hsieh  <wenson_hsieh@apple.com>
876
877         Rename a static helper in TouchBarMenuItemData.cpp to match style guidelines.
878         https://bugs.webkit.org/show_bug.cgi?id=180305
879
880         Reviewed by Andy Estes.
881
882         Style guidelines state that we should use bare words for getters, so getItemType should just be
883         itemType. Since this collides with the itemType member variable, this patch also renames that
884         member variable to the more concise "type".
885
886         No change in behavior.
887
888         * Shared/TouchBarMenuItemData.cpp:
889         (WebKit::itemType):
890         (WebKit::TouchBarMenuItemData::TouchBarMenuItemData):
891         (WebKit::TouchBarMenuItemData::encode const):
892         (WebKit::TouchBarMenuItemData::decode):
893         (WebKit::getItemType): Deleted.
894         * Shared/TouchBarMenuItemData.h:
895         (WebKit::operator==):
896
897 2017-12-04  Brian Burg  <bburg@apple.com>
898
899         Web Automation: add flag to preserve legacy page screenshot behavior
900         https://bugs.webkit.org/show_bug.cgi?id=180313
901         <rdar://problem/34379930>
902
903         Reviewed by Joseph Pecoraro.
904
905         For compatibility with JSON Wire Protocol implemented by Safari,
906         we need to retain the ability to perform whole page contents
907         snapshots using Automation.takeScreenshot. Add an extra flag,
908         clipToViewport, which can be used by W3C-conforming drivers.
909
910         * UIProcess/Automation/Automation.json: Add new flag.
911         * UIProcess/Automation/WebAutomationSession.h:
912         * UIProcess/Automation/WebAutomationSession.cpp:
913         (WebKit::WebAutomationSession::takeScreenshot):
914         * WebProcess/Automation/WebAutomationSessionProxy.h:
915         * WebProcess/Automation/WebAutomationSessionProxy.messages.in:
916         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
917         (WebKit::snapshotRectForScreenshot):
918         (WebKit::WebAutomationSessionProxy::takeScreenshot):
919         If the flag is false, take a screenshot of the whole page contents.
920
921 2017-12-04  JF Bastien  <jfbastien@apple.com>
922
923         Update std::expected to match libc++ coding style
924         https://bugs.webkit.org/show_bug.cgi?id=180264
925
926         Reviewed by Alex Christensen.
927
928         Update various uses of Expected, mostly renaming valueOr and
929         hasValue to the STL naming convention.
930
931         * NetworkProcess/cache/CacheStorageEngine.cpp:
932         (WebKit::CacheStorage::Engine::open):
933         (WebKit::CacheStorage::Engine::retrieveCaches):
934         (WebKit::CacheStorage::Engine::retrieveRecords):
935         (WebKit::CacheStorage::Engine::putRecords):
936         (WebKit::CacheStorage::Engine::deleteMatchingRecords):
937         (WebKit::CacheStorage::Engine::fetchEntries):
938         (WebKit::CacheStorage::Engine::clearMemoryRepresentation):
939         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
940         (WebKit::CacheStorage::ReadRecordTaskCounter::appendRecord):
941         (WebKit::CacheStorage::Cache::updateRecordToDisk):
942         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
943         (WebKit::CacheStorage::Caches::initialize):
944         (WebKit::CacheStorage::Caches::readCachesFromDisk):
945         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
946         (WebKit::NetworkRTCProvider::createResolver):
947         * Platform/IPC/ArgumentCoders.h:
948
949 2017-12-04  Brady Eidson  <beidson@apple.com>
950
951         Get a directory path to SWServers for storing ServiceWorker registrations.
952         https://bugs.webkit.org/show_bug.cgi?id=180362
953
954         Reviewed by Chris Dumez.
955
956         This gets all of the plumbing in place for specifying a ServiceWorker registration storage path
957         in a particular WebsiteDataStore.
958
959         * Shared/Storage/StorageProcessCreationParameters.cpp:
960         (WebKit::StorageProcessCreationParameters::encode const):
961         (WebKit::StorageProcessCreationParameters::decode):
962         * Shared/Storage/StorageProcessCreationParameters.h:
963
964         * StorageProcess/StorageProcess.cpp:
965         (WebKit::StorageProcess::initializeWebsiteDataStore):
966         (WebKit::StorageProcess::swServerForSession):
967         * StorageProcess/StorageProcess.h:
968
969         * UIProcess/API/APIProcessPoolConfiguration.cpp:
970         (API::ProcessPoolConfiguration::createWithLegacyOptions):
971         (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
972         (API::ProcessPoolConfiguration::ProcessPoolConfiguration):
973         * UIProcess/API/APIProcessPoolConfiguration.h:
974
975         * UIProcess/API/APIWebsiteDataStore.h:
976         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
977         (API::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory):
978         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
979         (API::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory):
980
981         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
982         (WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory):
983         (WebKit::WebProcessPool::legacyPlatformDefaultServiceWorkerRegistrationDirectory):
984         * UIProcess/WebProcessPool.cpp:
985         (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
986         * UIProcess/WebProcessPool.h:
987
988         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
989         (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
990         (WebKit::WebsiteDataStore::storageProcessParameters):
991         * UIProcess/WebsiteData/WebsiteDataStore.h:
992         (WebKit::WebsiteDataStore::resolvedServiceWorkerRegistrationDirectory const):
993
994         * UIProcess/gtk/WebProcessPoolGtk.cpp:
995         (WebKit::WebProcessPool::legacyPlatformDefaultServiceWorkerRegistrationDirectory):
996
997         * UIProcess/wpe/WebProcessPoolWPE.cpp:
998         (WebKit::WebProcessPool::legacyPlatformDefaultServiceWorkerRegistrationDirectory):
999
1000 2017-12-04  Frederic Wang  <fwang@igalia.com>
1001
1002         Make ScrollingTreeNode::enclosingFrameNode return the node itself for frame nodes
1003         https://bugs.webkit.org/show_bug.cgi?id=180353
1004
1005         Reviewed by Antonio Gomes.
1006
1007         This function was introduced in bug 175135 to solve a rendering bug with fixed positioned
1008         nodes in overflow nodes. For a frame node, the reference frame to use for fixed nodes is
1009         actually the frame node itself or otherwise we will get the same rendering bug. This patch
1010         makes enclosingFrameNode return the node itself when it is a frame node and renames it to
1011         clarify this behavior. Currently, enclosingFrameNode is not used for frame nodes so the
1012         behavior is unchanged.
1013
1014         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
1015         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll): Use auto* and
1016         the new function name.
1017
1018 2017-12-04  Michael Catanzaro  <mcatanzaro@igalia.com>
1019
1020         [GTK] Implement PAL::SleepDisabler
1021         https://bugs.webkit.org/show_bug.cgi?id=178485
1022
1023         Reviewed by Carlos Garcia Campos.
1024
1025         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1026         (webkitWebViewBaseDispose):
1027         (webkitWebViewBaseEnterFullScreen):
1028         (webkitWebViewBaseExitFullScreen):
1029         (screenSaverInhibitedCallback): Deleted.
1030         (webkitWebViewBaseSendInhibitMessageToScreenSaver): Deleted.
1031         (screenSaverProxyCreatedCallback): Deleted.
1032         (webkitWebViewBaseInhibitScreenSaver): Deleted.
1033         (webkitWebViewBaseUninhibitScreenSaver): Deleted.
1034
1035 2017-12-03  Yusuke Suzuki  <utatane.tea@gmail.com>
1036
1037         WTF shouldn't have both Thread and ThreadIdentifier
1038         https://bugs.webkit.org/show_bug.cgi?id=180308
1039
1040         Reviewed by Darin Adler.
1041
1042         * UIProcess/API/glib/IconDatabase.cpp:
1043         * UIProcess/GenericCallback.h:
1044         (WebKit::GenericCallback::~GenericCallback):
1045         (WebKit::GenericCallback::performCallbackWithReturnValue):
1046
1047 2017-12-03  Chris Dumez  <cdumez@apple.com>
1048
1049         Support serviceWorker.postMessage() inside service workers
1050         https://bugs.webkit.org/show_bug.cgi?id=180328
1051
1052         Reviewed by Darin Adler.
1053
1054         Support serviceWorker.postMessage() inside service workers.
1055
1056         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1057         (WebKit::WebSWServerConnection::postMessageToServiceWorkerFromClient):
1058         (WebKit::WebSWServerConnection::postMessageToServiceWorkerFromServiceWorker):
1059         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1060         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
1061         * WebProcess/Storage/WebSWClientConnection.cpp:
1062         (WebKit::WebSWClientConnection::postMessageToServiceWorker):
1063         * WebProcess/Storage/WebSWClientConnection.h:
1064         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1065         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerFromClient):
1066         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerFromServiceWorker):
1067         * WebProcess/Storage/WebSWContextManagerConnection.h:
1068         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
1069
1070 2017-12-03  Chris Dumez  <cdumez@apple.com>
1071
1072         Implement self.skipWaiting() inside service workers
1073         https://bugs.webkit.org/show_bug.cgi?id=180329
1074
1075         Reviewed by Darin Adler.
1076
1077         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
1078         (WebKit::WebSWServerToContextConnection::didFinishSkipWaiting):
1079         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
1080         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
1081         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1082         (WebKit::WebSWContextManagerConnection::skipWaiting):
1083         (WebKit::WebSWContextManagerConnection::didFinishSkipWaiting):
1084         * WebProcess/Storage/WebSWContextManagerConnection.h:
1085         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
1086
1087 2017-12-02  Youenn Fablet  <youenn@apple.com>
1088
1089         Implement https://w3c.github.io/ServiceWorker/#clients-getall
1090         https://bugs.webkit.org/show_bug.cgi?id=180276
1091
1092         Reviewed by Chris Dumez.
1093
1094         Add IPC plumbery for clients.matchAll between ServiceWorker process and Storage process.
1095
1096         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
1097         (WebKit::WebSWServerToContextConnection::matchAllCompleted):
1098         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
1099         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
1100         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1101         (WebKit::WebSWContextManagerConnection::matchAll):
1102         (WebKit::WebSWContextManagerConnection::matchAllCompleted):
1103         * WebProcess/Storage/WebSWContextManagerConnection.h:
1104         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
1105
1106 2017-12-02  Joseph Pecoraro  <pecoraro@apple.com>
1107
1108         Remote Web Inspector window always shows up at the default size
1109         https://bugs.webkit.org/show_bug.cgi?id=180284
1110         <rdar://problem/35430255>
1111
1112         Reviewed by Brian Burg.
1113
1114         * UIProcess/mac/RemoteWebInspectorProxyMac.mm:
1115         (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
1116         Give remote web inspector windows an autosave name so that their frame can
1117         be automatically saved and restored by the system.
1118
1119 2017-12-02  Simon Fraser  <simon.fraser@apple.com>
1120
1121         Add a log channel for viewports
1122         https://bugs.webkit.org/show_bug.cgi?id=180295
1123
1124         Reviewed by Zalan Bujtas.
1125
1126         Add a "Viewports" log channel to log viewport scaling information, and enhance the
1127         WebKit "VisibleRects" channel to log additional data for the same reason.
1128
1129         * UIProcess/API/Cocoa/WKWebView.mm:
1130         (-[WKWebView _didCommitLayerTree:]):
1131         (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:nextValidLayerTreeTransactionID:]):
1132         (-[WKWebView _dispatchSetMinimumLayoutSize:]):
1133         (-[WKWebView _endAnimatedResize]):
1134         (-[WKWebView _resizeWhileHidingContentWithUpdates:]):
1135         * WebProcess/WebPage/WebPage.cpp:
1136         (WebKit::WebPage::setFixedLayoutSize):
1137         (WebKit::WebPage::mainFrameDidLayout):
1138         (WebKit::WebPage::didCommitLoad):
1139         * WebProcess/WebPage/ios/WebPageIOS.mm:
1140         (WebKit::scaleAfterViewportWidthChange):
1141         (WebKit::WebPage::setViewportConfigurationMinimumLayoutSize):
1142         (WebKit::WebPage::dynamicViewportSizeUpdate):
1143         (WebKit::WebPage::resetViewportDefaultConfiguration):
1144         (WebKit::WebPage::viewportConfigurationChanged):
1145         (WebKit::WebPage::updateVisibleContentRects):
1146
1147 2017-12-02  Carlos Garcia Campos  <cgarcia@igalia.com>
1148
1149         WebDriver: handle user prompts shown while executing scripts
1150         https://bugs.webkit.org/show_bug.cgi?id=179979
1151
1152         Reviewed by Brian Burg.
1153
1154         * UIProcess/Automation/Automation.json: Add UnexpectedAlertOpen error.
1155         * UIProcess/Automation/WebAutomationSession.cpp:
1156         (WebKit::WebAutomationSession::willShowJavaScriptDialog): Finish pending evaluateJavaScriptFunction operations
1157         with UnexpectedAlertOpen error.
1158
1159 2017-12-02  Wenson Hsieh  <wenson_hsieh@apple.com>
1160
1161         Make some minor adjustments to TouchBarMenuData and TouchBarMenuItemData
1162         https://bugs.webkit.org/show_bug.cgi?id=180305
1163
1164         Reviewed by Joseph Pecoraro.
1165
1166         Mark some methods and parameters as const, use the default constructor in more places, and also remove a few
1167         extraneous imported headers.
1168
1169         * Shared/TouchBarMenuData.cpp:
1170         (WebKit::TouchBarMenuData::TouchBarMenuData):
1171
1172         Add a FIXME regarding the use of the 'id' attribute.
1173
1174         (WebKit::TouchBarMenuData::decode):
1175         * Shared/TouchBarMenuData.h:
1176         (WebKit::TouchBarMenuData::items const):
1177         (WebKit::TouchBarMenuData::setID):
1178         (WebKit::TouchBarMenuData::isPageCustomized const):
1179         (WebKit::TouchBarMenuData::items): Deleted.
1180         (WebKit::TouchBarMenuData::isPageCustomized): Deleted.
1181         * Shared/TouchBarMenuItemData.cpp:
1182         (WebKit::getItemType):
1183
1184         Change a helper method from a static class function to a static function in the implementation file.
1185
1186         (WebKit::TouchBarMenuItemData::TouchBarMenuItemData):
1187         (WebKit::TouchBarMenuItemData::encode const):
1188         (WebKit::TouchBarMenuItemData::decode):
1189         (WebKit::TouchBarMenuItemData::getItemType): Deleted.
1190         * Shared/TouchBarMenuItemData.h:
1191         (WebKit::operator==):
1192
1193         Remove the commandName member variable, since it doesn't make sense to propagate an event handler
1194         attribute from WebCore to the client layer.
1195
1196         * UIProcess/WebPageProxy.messages.in:
1197
1198 2017-12-01  Zan Dobersek  <zdobersek@igalia.com>
1199
1200         Unreviewed GTK+ debug build fix. Replace ASSERT_UNUSED() with UNUSED_PARAM()
1201         in WebKit::WebPage methods that used to operate on HTMLMenuElement pointer
1202         values (which have been converted to references).
1203
1204         * WebProcess/WebPage/WebPage.cpp:
1205         (WebKit::WebPage::didInsertMenuElement):
1206         (WebKit::WebPage::didRemoveMenuElement):
1207         (WebKit::WebPage::didInsertMenuItemElement):
1208         (WebKit::WebPage::didRemoveMenuItemElement):
1209
1210 2017-12-01  Simon Fraser  <simon.fraser@apple.com>
1211
1212         Reduce the number of calls to ViewportConfiguration::updateConfiguration()
1213         https://bugs.webkit.org/show_bug.cgi?id=180299
1214
1215         Reviewed by Zalan Bujtas.
1216
1217         There are several calls to ViewportConfiguration::setDefaultConfiguration() during loading
1218         with the same arguments. We can avoid unnecessary calls to updateConfiguration() by returning
1219         early if the configuration hasn't changed.
1220
1221         Also move the fetching of ViewportConfiguration::xhtmlMobileParameters() from didReceiveMobileDocType()
1222         into resetViewportDefaultConfiguration() where we grab all the other default configs.
1223
1224         * WebProcess/WebPage/WebPage.h:
1225         * WebProcess/WebPage/ios/WebPageIOS.mm:
1226         (WebKit::WebPage::didReceiveMobileDocType):
1227         (WebKit::WebPage::resetViewportDefaultConfiguration):
1228
1229 2017-12-01  Aishwarya Nirmal  <anirmal@apple.com>
1230
1231         [Touch Bar Web API] Object representing Touch Bar Menu to send between Web and UI Processes
1232         https://bugs.webkit.org/show_bug.cgi?id=179714
1233
1234         Reviewed by Wenson Hsieh.
1235
1236         These changes define the TouchBarMenuData and TouchBarMenuItemData objects which draw information
1237         from touch bar HTMLMenuElement and HTMLMenuItemElement. These objects represent the contents of
1238         the page-customized touch bar. Changes to the html elements representing the touch bar are sent 
1239         to the UI process.
1240
1241         * Shared/TouchBarMenuData.cpp: Copied from Source/WebCore/html/HTMLMenuItemElement.cpp.
1242         (WebKit::TouchBarMenuData::TouchBarMenuData):
1243         (WebKit::TouchBarMenuData::addMenuItem):
1244         (WebKit::TouchBarMenuData::removeMenuItem):
1245         (WebKit::TouchBarMenuData::encode const):
1246         (WebKit::TouchBarMenuData::decode):
1247         * Shared/TouchBarMenuData.h: Copied from Source/WebCore/html/HTMLMenuItemElement.h.
1248         (WebKit::TouchBarMenuData::items):
1249         (WebKit::TouchBarMenuData::isPageCustomized):
1250         (WebKit::TouchBarMenuData::setIsPageCustomized):
1251         * Shared/TouchBarMenuItemData.cpp: Added.
1252         (WebKit::TouchBarMenuItemData::getItemType):
1253         (WebKit::TouchBarMenuItemData::TouchBarMenuItemData):
1254         (WebKit::TouchBarMenuItemData::encode const):
1255         (WebKit::TouchBarMenuItemData::decode):
1256         * Shared/TouchBarMenuItemData.h: Added.
1257         (WebKit::operator<):
1258         (WebKit::operator>):
1259         (WebKit::operator<=):
1260         (WebKit::operator>=):
1261         (WebKit::operator==):
1262         (WebKit::operator!=):
1263         * UIProcess/WebPageProxy.cpp:
1264         (WebKit::WebPageProxy::touchBarMenuDataChanged):
1265         (WebKit::WebPageProxy::touchBarMenuItemDataAdded):
1266         (WebKit::WebPageProxy::touchBarMenuItemDataRemoved):
1267         * UIProcess/WebPageProxy.h:
1268         (WebKit::WebPageProxy::touchBarMenuData const):
1269         * UIProcess/WebPageProxy.messages.in:
1270         * WebKit.xcodeproj/project.pbxproj:
1271         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1272         (WebKit::WebChromeClient::didInsertMenuElement):
1273         (WebKit::WebChromeClient::didRemoveMenuElement):
1274         (WebKit::WebChromeClient::didInsertMenuItemElement):
1275         (WebKit::WebChromeClient::didRemoveMenuItemElement):
1276         * WebProcess/WebCoreSupport/WebChromeClient.h:
1277         * WebProcess/WebPage/WebPage.cpp:
1278         (WebKit::WebPage::didInsertMenuElement):
1279         (WebKit::WebPage::didRemoveMenuElement):
1280         (WebKit::WebPage::didInsertMenuItemElement):
1281         (WebKit::WebPage::didRemoveMenuItemElement):
1282         (WebKit::WebPage::sendTouchBarMenuDataRemovedUpdate):
1283         (WebKit::WebPage::sendTouchBarMenuDataAddedUpdate):
1284         (WebKit::WebPage::sendTouchBarMenuItemDataAddedUpdate):
1285         (WebKit::WebPage::sendTouchBarMenuItemDataRemovedUpdate):
1286         * WebProcess/WebPage/WebPage.h:
1287
1288 2017-12-01  Daniel Bates  <dabates@apple.com>
1289
1290         Alternative Presentation Button: Provide a way to query for the replaced elements
1291         https://bugs.webkit.org/show_bug.cgi?id=180114
1292         <rdar://problem/35710539>
1293
1294         Reviewed by Tim Horton.
1295
1296         Add SPI to query for the elements that were replaced by an Alternative Presentation Button.
1297
1298         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
1299         (-[WKWebProcessPlugInFrame elementsReplacedByAlternativePresentationButtonWithIdentifier:]): Added.
1300         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFramePrivate.h:
1301         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
1302         (WKBundleElementsReplacedByAlternativePresentationButton): Added.
1303         * WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h:
1304
1305 2017-12-01  Youenn Fablet  <youenn@apple.com>
1306
1307         Implement https://w3c.github.io/ServiceWorker/#clients-get
1308         https://bugs.webkit.org/show_bug.cgi?id=180167
1309
1310         Reviewed by Chris Dumez.
1311
1312         Add IPC plumbery for clientFromId between ServiceWorker process and Storage process.
1313
1314         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
1315         (WebKit::WebSWServerToContextConnection::clientFromIdCompleted):
1316         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
1317         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
1318         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1319         (WebKit::WebSWContextManagerConnection::findClientByIdentifier):
1320         (WebKit::WebSWContextManagerConnection::findClientByIdentifierCompleted):
1321         * WebProcess/Storage/WebSWContextManagerConnection.h:
1322         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
1323
1324 2017-12-01  Brian Burg  <bburg@apple.com>
1325
1326         Web Inspector: move Inspector::Protocol::Array<T> to JSON namespace
1327         https://bugs.webkit.org/show_bug.cgi?id=173662
1328
1329         Reviewed by Joseph Pecoraro.
1330
1331         Adopt new type names.
1332
1333         * UIProcess/Automation/WebAutomationSession.cpp:
1334         (WebKit::WebAutomationSession::getNextContext):
1335         (WebKit::WebAutomationSession::getBrowsingContexts):
1336         (WebKit::buildArrayForCookies):
1337         (WebKit::WebAutomationSession::getSessionPermissions):
1338         * UIProcess/Automation/WebAutomationSession.h:
1339
1340 2017-12-01  Wenson Hsieh  <wenson_hsieh@apple.com>
1341
1342         [Attachment Support] Implement SPI for clients to update a given attachment's data
1343         https://bugs.webkit.org/show_bug.cgi?id=180184
1344         <rdar://problem/35355731>
1345
1346         Reviewed by Tim Horton.
1347
1348         Add plumbing to the web process for setting the attachment data (and optionally, the content type and/or file
1349         name) of a given attachment. See WebCore ChangeLog for more detail. Changes covered by new API tests.
1350
1351         * UIProcess/API/APIAttachment.cpp:
1352         (API::Attachment::setDataAndContentType):
1353         * UIProcess/API/APIAttachment.h:
1354         * UIProcess/API/Cocoa/_WKAttachment.h:
1355
1356         Add nullability annotations around _WKAttachment SPI methods.
1357
1358         * UIProcess/API/Cocoa/_WKAttachment.mm:
1359         (-[_WKAttachment setData:newContentType:newFilename:completion:]):
1360         * UIProcess/WebPageProxy.cpp:
1361         (WebKit::WebPageProxy::setAttachmentDataAndContentType):
1362         * UIProcess/WebPageProxy.h:
1363         * WebProcess/WebPage/WebPage.cpp:
1364         (WebKit::WebPage::setAttachmentDataAndContentType):
1365         * WebProcess/WebPage/WebPage.h:
1366         * WebProcess/WebPage/WebPage.messages.in:
1367
1368 2017-12-01  Brady Eidson  <beidson@apple.com>
1369
1370         Add Internals.terminateServiceWorker, and the ability to restart service workers for postMessage.
1371         https://bugs.webkit.org/show_bug.cgi?id=180170
1372
1373         Reviewed by Chris Dumez.
1374
1375         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1376         (WebKit::WebSWServerConnection::startFetch):
1377         (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope):
1378         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1379         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
1380
1381         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
1382         (WebKit::WebSWServerToContextConnection::syncTerminateWorker):
1383         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
1384
1385         * StorageProcess/StorageToWebProcessConnection.cpp:
1386         (WebKit::StorageToWebProcessConnection::didReceiveSyncMessage):
1387
1388         * WebProcess/Storage/WebSWClientConnection.cpp:
1389         (WebKit::WebSWClientConnection::syncTerminateWorker):
1390         * WebProcess/Storage/WebSWClientConnection.h:
1391
1392         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1393         (WebKit::WebSWContextManagerConnection::terminateWorker):
1394         (WebKit::WebSWContextManagerConnection::syncTerminateWorker):
1395         * WebProcess/Storage/WebSWContextManagerConnection.h:
1396         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
1397
1398         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
1399         (WebKit::WebToStorageProcessConnection::didReceiveSyncMessage):
1400         * WebProcess/Storage/WebToStorageProcessConnection.h:
1401
1402 2017-12-01  Youenn Fablet  <youenn@apple.com>
1403
1404         Clear WebSWClientConnection in case storage process IPC connection is closing
1405         https://bugs.webkit.org/show_bug.cgi?id=180210
1406
1407         Reviewed by Chris Dumez.
1408
1409         Clear the sw connection maps when connection is closing.
1410         Call related completion handlers for each connection.
1411
1412         * WebProcess/Storage/WebSWClientConnection.cpp:
1413         (WebKit::WebSWClientConnection::connectionToServerLost):
1414         * WebProcess/Storage/WebSWClientConnection.h:
1415         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
1416         (WebKit::WebToStorageProcessConnection::didClose):
1417         (WebKit::WebToStorageProcessConnection::idbConnectionToServerForSession):
1418         (WebKit::WebToStorageProcessConnection::serviceWorkerConnectionForSession):
1419         * WebProcess/Storage/WebToStorageProcessConnection.h:
1420
1421 2017-12-01  Eric Carlson  <eric.carlson@apple.com>
1422
1423         [MediaStream] Use CaptureDevice instead of device ID to identify devices
1424         https://bugs.webkit.org/show_bug.cgi?id=180206
1425         <rdar://problem/35775758>
1426
1427         Reviewed by Youenn Fablet.
1428
1429         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
1430         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
1431         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
1432         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
1433         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1434         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
1435         (WebKit::UserMediaPermissionRequestManagerProxy::grantAccess):
1436         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
1437         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
1438         * UIProcess/UserMediaPermissionRequestProxy.cpp:
1439         (WebKit::UserMediaPermissionRequestProxy::allow):
1440         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
1441         (WebKit::UserMediaPermissionRequestManager::userMediaAccessWasGranted):
1442         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
1443         * WebProcess/WebPage/WebPage.cpp:
1444         (WebKit::WebPage::userMediaAccessWasGranted):
1445         * WebProcess/WebPage/WebPage.h:
1446         * WebProcess/WebPage/WebPage.messages.in:
1447         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
1448         (WebKit::UserMediaCaptureManager::createCaptureSource):
1449         * WebProcess/cocoa/UserMediaCaptureManager.h:
1450
1451 2017-12-01  Carlos Garcia Campos  <cgarcia@igalia.com>
1452
1453         WebDriver: link and partial links queries don't work in xhtml documents
1454         https://bugs.webkit.org/show_bug.cgi?id=180191
1455
1456         Reviewed by Brian Burg.
1457
1458         We convert the queries to use xpath, which works for html documents, but it doesn't work for xhtml. In case of
1459         xhtml we would need to provide a namespace resolver and elements would need to be prefixed with 'xhtml:'. It's
1460         easier to simply iterate the link elements and compare the text.
1461
1462         Fixes: imported/w3c/webdriver/tests/retrieval/find_element_from_element.py::test_xhtml_namespace[link text-full link text]
1463                imported/w3c/webdriver/tests/retrieval/find_element_from_element.py::test_xhtml_namespace[partial link text-link text]
1464                imported/w3c/webdriver/tests/retrieval/find_element_from_elements.py::test_xhtml_namespace[link text-full link text]
1465                imported/w3c/webdriver/tests/retrieval/find_element_from_elements.py::test_xhtml_namespace[partial link text-link text]
1466                imported/w3c/webdriver/tests/retrieval/find_element.py::test_xhtml_namespace[link text-full link text]
1467                imported/w3c/webdriver/tests/retrieval/find_element.py::test_xhtml_namespace[partial link text-link text]
1468                imported/w3c/webdriver/tests/retrieval/find_elements.py::test_xhtml_namespace[link text-full link text]
1469                imported/w3c/webdriver/tests/retrieval/find_elements.py::test_xhtml_namespace[partial link text-link text]
1470
1471         * UIProcess/Automation/atoms/FindNodes.js:
1472         (switch):
1473         (tryToFindNode):
1474
1475 2017-11-30  Alex Christensen  <achristensen@webkit.org>
1476
1477         REGRESSION (r224791): cookies are shared between ephemeral sessions in the same process pool
1478         https://bugs.webkit.org/show_bug.cgi?id=180235
1479
1480         Reviewed by Joseph Pecoraro.
1481
1482         In r224791 I assumed that uiProcessCookieStorageIdentifier would be empty in the ephemeral session initialization message.
1483         This is not the case.  We did not catch this because almost all of our ephemeral session testing uses the legacyPrivateSessionID.
1484         I add checks for if the SessionID is ephemeral like we already have in WebFrameNetworkingContext::ensureWebsiteDataStoreSession.
1485         I also add an API test that makes sure cookies are not shared between ephemeral sessions the way they are made through the API.
1486
1487         * NetworkProcess/mac/RemoteNetworkingContext.mm:
1488         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
1489
1490 2017-11-30  Stephan Szabo  <stephan.szabo@sony.com>
1491
1492         Make LegacyCustomProtocolManager optional for network process
1493         https://bugs.webkit.org/show_bug.cgi?id=176230
1494
1495         Reviewed by Alex Christensen.
1496
1497         * CMakeLists.txt:
1498         * Configurations/FeatureDefines.xcconfig:
1499         * NetworkProcess/NetworkProcess.cpp:
1500         (WebKit::NetworkProcess::NetworkProcess):
1501         (WebKit::NetworkProcess::initializeNetworkProcess):
1502         * PlatformGTK.cmake:
1503         * PlatformMac.cmake:
1504         * PlatformWPE.cmake:
1505         * UIProcess/Network/NetworkProcessProxy.cpp:
1506         (WebKit::NetworkProcessProxy::NetworkProcessProxy):
1507         (WebKit::NetworkProcessProxy::didClose):
1508         * UIProcess/Network/NetworkProcessProxy.h:
1509         * UIProcess/WebProcessPool.cpp:
1510         (WebKit::WebProcessPool::setLegacyCustomProtocolManagerClient):
1511         (WebKit::WebProcessPool::registerSchemeForCustomProtocol):
1512         (WebKit::WebProcessPool::unregisterSchemeForCustomProtocol):
1513
1514 2017-11-30  Ryan Haddad  <ryanhaddad@apple.com>
1515
1516         Unreviewed build fix, suppress deprecation warnings.
1517
1518         * Shared/mac/SandboxExtensionMac.mm:
1519         (WebKit::SandboxExtensionImpl::sandboxExtensionForType):
1520
1521 2017-11-30  Daniel Bates  <dabates@apple.com>
1522
1523         Expose SPI didClickAlternativePresentationButtonWithUserInfo on iOS
1524         https://bugs.webkit.org/show_bug.cgi?id=180218
1525         <rdar://problem/35782555>
1526
1527         Reviewed by Alex Christensen.
1528
1529         We want to support the SPI didClickAlternativePresentationButtonWithUserInfo on Cocoa platforms.
1530
1531         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1532         * UIProcess/Cocoa/UIDelegate.h:
1533         * UIProcess/Cocoa/UIDelegate.mm:
1534         (WebKit::UIDelegate::setDelegate):
1535         (WebKit::UIDelegate::UIClient::didClickAlternativePresentationButton):
1536
1537 2017-11-30  Joseph Pecoraro  <pecoraro@apple.com>
1538
1539         [Cocoa] Web Automation: _WKAutomationSessionConfiguration leak
1540         https://bugs.webkit.org/show_bug.cgi?id=180222
1541
1542         Reviewed by Brian Burg.
1543
1544         * UIProcess/Cocoa/AutomationClient.mm:
1545         (WebKit::AutomationClient::requestAutomationSessionWithCapabilities):
1546
1547 2017-11-30  Joseph Pecoraro  <pecoraro@apple.com>
1548
1549         Fix some NSOperationQueue leaks
1550         https://bugs.webkit.org/show_bug.cgi?id=180221
1551
1552         Reviewed by Wenson Hsieh.
1553
1554         * UIProcess/Cocoa/WebViewImpl.mm:
1555         (WebKit::WebViewImpl::performDragOperation):
1556
1557 2017-11-30  Brian Burg  <bburg@apple.com>
1558
1559         Web Automation: computeElementLayout does not correctly translate iframe client coordinates to main frame coordinates
1560         https://bugs.webkit.org/show_bug.cgi?id=180213
1561         <rdar://problem/30260141>
1562
1563         Reviewed by Simon Fraser.
1564
1565         The current implementation computes points in terms of the frame in which the element is located.
1566         However, WebDriver expects coordinates to be relative to the top-level document since
1567         these coordinates are used for generating click events, among other things.
1568
1569         To convert from frame client coordinates to main frame client coordinates, round-trip
1570         both inViewCenterPoint and elementBounds to root view coordinates and back
1571         to the main frame's contents/client coordinates. Then convert this to page coordinates if needed.
1572
1573         This progresses several tests in the Selenium Python test suite:
1574
1575          - event_firing_webdriver_tests.py::test_should_fire_navigation_events
1576          - frame_switching_tests.py::testShouldBeAbleToClickInAFrameThatRewritesTopWindowLocation
1577          - frame_switching_tests.py::testShouldBeAbleToSwitchToTheTopIfTheFrameIsDeletedFromUnderUs
1578          - frame_switching_tests.py::testShouldBeAbleToSwitchToTheTopIfTheFrameIsDeletedFromUnderUsWithFrameIndex
1579          - frame_switching_tests.py::testShouldBeAbleToSwitchToTheTopIfTheFrameIsDeletedFromUnderUsWithWebelement
1580          - frame_switching_tests.py::testShouldNotBeAbleToDoAnythingTheFrameIsDeletedFromUnderUs
1581          - position_and_size_tests.py::testShouldGetCoordinatesOfAnInvisibleElement
1582
1583         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
1584         (WebKit::WebAutomationSessionProxy::computeElementLayout):
1585         Get both the frame and main frame FrameViews and convert coordinates to the root view.
1586         This is somewhat lossy as clientToDocument* deals with FloatPoints but contentsToRootView
1587         deals with IntPoints. For the purposes of WebDriver, lossiness is not a problem since
1588         integer values are expected anyway.
1589
1590         The imperative nature of the coordinate calculations is difficult to debug, so I converted
1591         this function to only assign to each variable once.
1592
1593 2017-11-30  Alex Christensen  <achristensen@webkit.org>
1594
1595         WKURLSchemeHandler.request should include HTTPBody
1596         https://bugs.webkit.org/show_bug.cgi?id=180220
1597
1598         Reviewed by Brady Eidson.
1599
1600         * Shared/URLSchemeTaskParameters.cpp: Added.
1601         (WebKit::URLSchemeTaskParameters::encode const):
1602         (WebKit::URLSchemeTaskParameters::decode):
1603         * Shared/URLSchemeTaskParameters.h: Added.
1604         * UIProcess/API/Cocoa/WKURLSchemeTask.mm:
1605         (-[WKURLSchemeTaskImpl request]):
1606         * UIProcess/WebPageProxy.cpp:
1607         (WebKit::WebPageProxy::startURLSchemeTask):
1608         * UIProcess/WebPageProxy.h:
1609         * UIProcess/WebPageProxy.messages.in:
1610         * UIProcess/WebURLSchemeHandler.cpp:
1611         (WebKit::WebURLSchemeHandler::startTask):
1612         * UIProcess/WebURLSchemeHandler.h:
1613         * UIProcess/WebURLSchemeTask.cpp:
1614         (WebKit::WebURLSchemeTask::create):
1615         (WebKit::WebURLSchemeTask::WebURLSchemeTask):
1616         * UIProcess/WebURLSchemeTask.h:
1617         * WebKit.xcodeproj/project.pbxproj:
1618         * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp:
1619         (WebKit::WebURLSchemeTaskProxy::startLoading):
1620
1621 2017-11-30  Darin Adler  <darin@apple.com>
1622
1623         [Mac] remove unneeded RetainPtr use introduced in r225142
1624         https://bugs.webkit.org/show_bug.cgi?id=180202
1625
1626         Reviewed by Tim Horton.
1627
1628         * WebProcess/Plugins/PDF/PDFPlugin.h: Got rid of unnecessary RetainPtr.
1629         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1630         (WebKit::PDFPlugin::lookupTextAtLocation const): Ditto.
1631         * WebProcess/WebPage/WebPage.h: Ditto.
1632         * WebProcess/WebPage/mac/WebPageMac.mm:
1633         (WebKit::WebPage::performDictionaryLookupAtLocation): Ditto.
1634         (WebKit::WebPage::performDictionaryLookupForSelection): Ditto.
1635         (WebKit::WebPage::performImmediateActionHitTestAtLocation): Ditto.
1636         (WebKit::WebPage::lookupTextAtLocation): Ditto.
1637
1638 2017-11-30  Zan Dobersek  <zdobersek@igalia.com>
1639
1640         [CoordGraphics] Move CoordinatedGraphicsLayer painting behind Nicosia::PaintingEngine
1641         https://bugs.webkit.org/show_bug.cgi?id=180141
1642
1643         Reviewed by Carlos Garcia Campos.
1644
1645         CompositingCoordinator must implement the paintingEngine() method now
1646         that the method's been added to the CoordinatedGraphicsLayerClient
1647         interface. The CompositingCoordinator manages the Nicosia::PaintingEngine
1648         object through the new m_paintingEngine member variable, and returns the
1649         reference to this object in the paintingEngine() method.
1650
1651         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
1652         (WebKit::CompositingCoordinator::CompositingCoordinator):
1653         (WebKit::CompositingCoordinator::paintingEngine):
1654         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
1655         Drop unnecessary typedefs.
1656
1657 2017-11-29  Wenson Hsieh  <wenson_hsieh@apple.com>
1658
1659         [Attachment Support] Implement SPI for clients to make an attachment element display in-place
1660         https://bugs.webkit.org/show_bug.cgi?id=180153
1661         <rdar://problem/35735252>
1662
1663         Reviewed by Tim Horton.
1664
1665         Add new WebKit SPI, -[_WKAttachment setDisplayOptions:completion:], and add plumbing for attachment display
1666         options to the web content process. Changes covered by 4 new API tests.
1667
1668         * Scripts/webkit/messages.py:
1669         (headers_for_type):
1670         * UIProcess/API/APIAttachment.cpp:
1671         (API::Attachment::setDisplayOptions):
1672         * UIProcess/API/APIAttachment.h:
1673         * UIProcess/API/Cocoa/WKWebView.mm:
1674         (-[WKWebView _insertAttachmentWithFilename:contentType:data:options:completion:]):
1675
1676         Respect given display options when inserting a new attachment.
1677
1678         * UIProcess/API/Cocoa/_WKAttachment.h:
1679         * UIProcess/API/Cocoa/_WKAttachment.mm:
1680         (-[_WKAttachmentDisplayOptions coreDisplayOptions]):
1681
1682         Introduce a helper to convert from the Cocoa _WKAttachmentDisplayOptions object to platform-agnostic
1683         AttachmentDisplayOptions.
1684
1685         (-[_WKAttachment setDisplayOptions:completion:]):
1686         (WebKit::if): Deleted.
1687         * UIProcess/API/Cocoa/_WKAttachmentInternal.h:
1688         * UIProcess/WebPageProxy.cpp:
1689         (WebKit::WebPageProxy::insertAttachment):
1690         (WebKit::WebPageProxy::setAttachmentDisplayOptions):
1691         * UIProcess/WebPageProxy.h:
1692         * WebProcess/WebPage/WebPage.cpp:
1693         (WebKit::WebPage::insertAttachment):
1694         (WebKit::WebPage::requestAttachmentData):
1695         (WebKit::WebPage::setAttachmentDisplayOptions):
1696         (WebKit::WebPage::attachmentElementWithIdentifier const):
1697
1698         Pull common logic to retrieve an attachment element matching a given identifier out into a helper.
1699
1700         * WebProcess/WebPage/WebPage.h:
1701         * WebProcess/WebPage/WebPage.messages.in:
1702
1703 2017-11-29  Brent Fulgham  <bfulgham@apple.com>
1704
1705         Part 2: Adopt updated NSKeyed[Un]Archiver API when available
1706         https://bugs.webkit.org/show_bug.cgi?id=180127
1707         <rdar://problem/35710738>
1708
1709         Reviewed by Simon Fraser.
1710
1711         The API that accepts a user-allocated NSMutableData is deprecated. Switch (for macOS 10.12 and newer)
1712         to the modern API. Use the original API for macOS builds prior to 10.12.
1713
1714         * Shared/Cocoa/DataDetectionResult.mm:
1715         (WebKit::DataDetectionResult::encode const):
1716         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
1717         (IPC::ArgumentCoder<WebCore::Payment>::encode):
1718         (IPC::ArgumentCoder<WebCore::PaymentContact>::encode):
1719         (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::encode):
1720         (IPC::ArgumentCoder<WebCore::PaymentMethod>::encode):
1721         * Shared/ios/InteractionInformationAtPosition.mm:
1722         (WebKit::InteractionInformationAtPosition::encode const):
1723         * Shared/mac/WebCoreArgumentCodersMac.mm:
1724         (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData):
1725         (IPC::ArgumentCoder<Credential>::encodePlatformData):
1726         (IPC::ArgumentCoder<ContentFilterUnblockHandler>::encode):
1727         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::encodePlatformData):
1728         * Shared/mac/WebHitTestResultData.mm:
1729         (WebKit::WebHitTestResultData::platformEncode const):
1730         * UIProcess/API/Cocoa/WKProcessPool.mm:
1731         (-[WKProcessPool _setObject:forBundleParameter:]):
1732         (-[WKProcessPool _setObjectsForBundleParametersWithDictionary:]):
1733         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1734         (WebKit::WebProcessPool::platformInitializeWebProcess):
1735         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
1736         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]):
1737
1738 2017-11-29  Brady Eidson  <beidson@apple.com>
1739
1740         When managing context startups, make ServiceWorkerJobDataIdentifier's optional.
1741         https://bugs.webkit.org/show_bug.cgi?id=180166
1742
1743         Reviewed by Chris Dumez.
1744
1745         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
1746
1747         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1748         (WebKit::WebSWContextManagerConnection::serviceWorkerStartedWithMessage):
1749         (WebKit::WebSWContextManagerConnection::didFinishInstall):
1750         * WebProcess/Storage/WebSWContextManagerConnection.h:
1751
1752 2017-11-29  Youenn Fablet  <youenn@apple.com>
1753
1754         Add support for service worker generated redirections
1755         https://bugs.webkit.org/show_bug.cgi?id=179498
1756
1757         Reviewed by Darin Adler.
1758
1759         Small refactoring to allow a service worker redirected fetch to follow the redirection through the service worker.
1760
1761         * WebProcess/Network/WebLoaderStrategy.cpp:
1762         (WebKit::WebLoaderStrategy::scheduleLoad): Make use of the loader request in case a network load is needed after a service worker redirection.
1763         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
1764         (WebKit::ServiceWorkerClientFetch::create):
1765         (WebKit::ServiceWorkerClientFetch::~ServiceWorkerClientFetch):
1766         (WebKit::ServiceWorkerClientFetch::ServiceWorkerClientFetch):
1767         (WebKit::ServiceWorkerClientFetch::start):
1768         (WebKit::ServiceWorkerClientFetch::didReceiveResponse): Check for response.
1769         Generate redirected request if needed and call loader callback to process the redirection.
1770         Adding some states so that if didFinish is called before the willSendRequest callback, redirection is followed.
1771         (WebKit::ServiceWorkerClientFetch::didFinish):
1772         In case redirection should be followed, wait for didFinish to follow it.
1773         This simplifies the model although introducing some limited latency.
1774         * WebProcess/Storage/ServiceWorkerClientFetch.h:
1775         * WebProcess/Storage/WebSWClientConnection.cpp:
1776         (WebKit::WebSWClientConnection::startFetch):
1777         * WebProcess/Storage/WebSWClientConnection.h:
1778         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
1779         (WebKit::WebServiceWorkerProvider::handleFetch):
1780
1781 2017-11-29  Youenn Fablet  <youenn@apple.com>
1782
1783         Add support for FetchEvent.clientId
1784         https://bugs.webkit.org/show_bug.cgi?id=180052
1785
1786         Reviewed by Chris Dumez.
1787
1788         Using FetchOption persistency coders for cache API and modernizing IPC FetchOptions decoding.
1789
1790         * WebKit/Shared/WebCoreArgumentCoders.cpp:
1791         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
1792         (WebKit::CacheStorage::Cache::encode):
1793         (WebKit::CacheStorage::Cache::decodeRecordHeader):
1794         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1795         (WebKit::WebSWContextManagerConnection::startFetch):
1796         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1797         (WebKit::WebSWContextManagerConnection::startFetch):
1798
1799 2017-11-29  Alex Christensen  <achristensen@webkit.org>
1800
1801         Make WebFrameLoaderClient more robust against null pointer dereferencing
1802         https://bugs.webkit.org/show_bug.cgi?id=180157
1803         <rdar://problem/34895616>
1804
1805         Reviewed by Tim Horton.
1806
1807         There has always been rare null pointer crashes in this code, but they have become more common
1808         now that we are waiting for completion handlers for redirects, which makes it more likely that
1809         we are hitting this code after we have detached from the core frame.
1810
1811         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1812         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
1813         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
1814         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1815         * WebProcess/WebPage/WebFrame.cpp:
1816         (WebKit::WebFrame::page const):
1817
1818 2017-11-29  Alex Christensen  <achristensen@webkit.org>
1819
1820         Fix Mac CMake build.
1821
1822         * PlatformMac.cmake:
1823
1824 2017-11-29  Chris Dumez  <cdumez@apple.com>
1825
1826         StorageToWebProcessConnection & WebSWServerToContextConnection should use the same underlying IPC::Connection
1827         https://bugs.webkit.org/show_bug.cgi?id=180147
1828
1829         Reviewed by Brady Eidson.
1830
1831         StorageToWebProcessConnection & WebSWServerToContextConnection should use the same underlying IPC::Connection.
1832         Otherwise, we have with 2 IPC::Connections between the StorageProcess and the ServiceWorker (aka Context) process,
1833         which makes synchronization of IPC messages difficult.
1834
1835         * StorageProcess/StorageProcess.cpp:
1836         (WebKit::StorageProcess::createStorageToWebProcessConnection):
1837         (WebKit::StorageProcess::createServerToContextConnection):
1838         * StorageProcess/StorageProcess.h:
1839         * StorageProcess/StorageProcess.messages.in:
1840         * StorageProcess/StorageToWebProcessConnection.cpp:
1841         (WebKit::StorageToWebProcessConnection::didReceiveMessage):
1842         * UIProcess/ServiceWorkerProcessProxy.cpp:
1843         (WebKit::ServiceWorkerProcessProxy::start):
1844         * UIProcess/ServiceWorkerProcessProxy.h:
1845         * UIProcess/Storage/StorageProcessProxy.cpp:
1846         (WebKit::StorageProcessProxy::getStorageProcessConnection):
1847         (WebKit::StorageProcessProxy::didFinishLaunching):
1848         (WebKit::StorageProcessProxy::establishWorkerContextConnectionToStorageProcess):
1849         * UIProcess/Storage/StorageProcessProxy.h:
1850         * UIProcess/Storage/StorageProcessProxy.messages.in:
1851         * UIProcess/WebProcessPool.cpp:
1852         (WebKit::WebProcessPool::getStorageProcessConnection):
1853         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
1854         * UIProcess/WebProcessPool.h:
1855         * UIProcess/WebProcessProxy.cpp:
1856         (WebKit::WebProcessProxy::getStorageProcessConnection):
1857         * UIProcess/WebProcessProxy.h:
1858         (WebKit::WebProcessProxy::isServiceWorkerProcess const):
1859         * UIProcess/WebProcessProxy.messages.in:
1860         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
1861         (WebKit::WebToStorageProcessConnection::didReceiveMessage):
1862         * WebProcess/WebProcess.cpp:
1863         (WebKit::WebProcess::didReceiveMessage):
1864         (WebKit::WebProcess::establishWorkerContextConnectionToStorageProcess):
1865         * WebProcess/WebProcess.h:
1866         * WebProcess/WebProcess.messages.in:
1867
1868 2017-11-29  Chris Dumez  <cdumez@apple.com>
1869
1870         ensure*Connection() methods on WebProcess should return a reference
1871         https://bugs.webkit.org/show_bug.cgi?id=180149
1872
1873         Reviewed by Alex Christensen.
1874
1875         ensure*Connection() methods on WebProcess should return a reference instead of not returning
1876         anything. Also get rid of the non-ensure variants which called "ensure" internally and are
1877         no longer needed.
1878
1879         * Shared/mac/CookieStorageShim.mm:
1880         (WebKit::webKitCookieStorageCopyRequestHeaderFieldsForURL):
1881         * WebProcess/Cache/WebCacheStorageConnection.cpp:
1882         (WebKit::WebCacheStorageConnection::connection):
1883         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
1884         (WebKit::WebIDBConnectionToServer::messageSenderConnection):
1885         (WebKit::preregisterSandboxExtensionsIfNecessary):
1886         * WebProcess/Databases/WebDatabaseProvider.cpp:
1887         (WebKit::WebDatabaseProvider::idbConnectionToServerForSession):
1888         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
1889         (WebKit::BlobRegistryProxy::registerFileBlobURL):
1890         (WebKit::BlobRegistryProxy::registerBlobURL):
1891         (WebKit::BlobRegistryProxy::registerBlobURLOptionallyFileBacked):
1892         (WebKit::BlobRegistryProxy::unregisterBlobURL):
1893         (WebKit::BlobRegistryProxy::registerBlobURLForSlice):
1894         (WebKit::BlobRegistryProxy::blobSize):
1895         (WebKit::BlobRegistryProxy::writeBlobsToTemporaryFiles):
1896         * WebProcess/Network/NetworkProcessConnection.cpp:
1897         (WebKit::NetworkProcessConnection::writeBlobsToTemporaryFiles):
1898         * WebProcess/Network/WebLoaderStrategy.cpp:
1899         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
1900         (WebKit::WebLoaderStrategy::remove):
1901         (WebKit::WebLoaderStrategy::setDefersLoading):
1902         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
1903         (WebKit::WebLoaderStrategy::startPingLoad):
1904         (WebKit::WebLoaderStrategy::preconnectTo):
1905         (WebKit::WebLoaderStrategy::storeDerivedDataToCache):
1906         (WebKit::WebLoaderStrategy::setCaptureExtraNetworkLoadMetricsEnabled):
1907         * WebProcess/Network/WebResourceLoader.cpp:
1908         (WebKit::WebResourceLoader::messageSenderConnection):
1909         * WebProcess/Network/WebSocketStream.cpp:
1910         (WebKit::WebSocketStream::WebSocketStream):
1911         (WebKit::WebSocketStream::messageSenderConnection):
1912         * WebProcess/Network/webrtc/LibWebRTCResolver.cpp:
1913         (WebKit::sendOnMainThread):
1914         * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
1915         (WebKit::sendOnMainThread):
1916         * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
1917         (WebKit::LibWebRTCSocketFactory::CreateServerTcpSocket):
1918         (WebKit::LibWebRTCSocketFactory::CreateUdpSocket):
1919         (WebKit::LibWebRTCSocketFactory::CreateClientTcpSocket):
1920         (WebKit::LibWebRTCSocketFactory::createNewConnectionSocket):
1921         * WebProcess/Network/webrtc/WebRTCMonitor.cpp:
1922         (WebKit::sendOnMainThread):
1923         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
1924         (WebKit::WebServiceWorkerProvider::serviceWorkerConnectionForSession):
1925         (WebKit::WebServiceWorkerProvider::handleFetch):
1926         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1927         (WebKit::WebPlatformStrategies::cookiesForDOM):
1928         (WebKit::WebPlatformStrategies::setCookiesFromDOM):
1929         (WebKit::WebPlatformStrategies::cookiesEnabled):
1930         (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue):
1931         (WebKit::WebPlatformStrategies::getRawCookies):
1932         (WebKit::WebPlatformStrategies::deleteCookie):
1933         * WebProcess/WebPage/WebFrame.cpp:
1934         (WebKit::WebFrame::startDownload):
1935         (WebKit::WebFrame::convertMainResourceLoadToDownload):
1936         * WebProcess/WebProcess.cpp:
1937         (WebKit::WebProcess::ensureLegacyPrivateBrowsingSessionInNetworkProcess):
1938         (WebKit::WebProcess::ensureNetworkProcessConnection):
1939         (WebKit::WebProcess::ensureWebToStorageProcessConnection):
1940         (WebKit::WebProcess::prefetchDNS):
1941         * WebProcess/WebProcess.h:
1942
1943 2017-11-29  Alex Christensen  <achristensen@webkit.org>
1944
1945         Modernize API::SerializedScriptValue
1946         https://bugs.webkit.org/show_bug.cgi?id=180115
1947
1948         Reviewed by Brady Eidson.
1949
1950         Also remove some SPI that hasn't been used anywhere since Mountain Lion.
1951
1952         * Shared/API/APISerializedScriptValue.h:
1953         (API::SerializedScriptValue::create):
1954         (API::SerializedScriptValue::internalRepresentation):
1955         (API::SerializedScriptValue::SerializedScriptValue):
1956         * Shared/API/c/WKSerializedScriptValue.cpp:
1957         (WKSerializedScriptValueDeserialize):
1958         (WKSerializedScriptValueCreateWithInternalRepresentation): Deleted.
1959         (WKSerializedScriptValueGetInternalRepresentation): Deleted.
1960         * Shared/API/c/WKSerializedScriptValuePrivate.h: Removed.
1961         * UIProcess/API/Cocoa/WKWebView.mm:
1962         (-[WKWebView _evaluateJavaScript:forceUserGesture:completionHandler:]):
1963         * WebKit.xcodeproj/project.pbxproj:
1964
1965 2017-11-29  Michael Catanzaro  <mcatanzaro@igalia.com>
1966
1967         REGRESSION(r218064): [GTK] Broke entering fullscreen mode in debug builds
1968         https://bugs.webkit.org/show_bug.cgi?id=180120
1969
1970         Reviewed by Carlos Garcia Campos.
1971
1972         These assertions need to be swapped. Fixes /webkit2/WebKitWebView/fullscreen in debug mode.
1973
1974         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1975         (webkitWebViewBaseEnterFullScreen):
1976         (webkitWebViewBaseExitFullScreen):
1977
1978 2017-11-29  Zan Dobersek  <zdobersek@igalia.com>
1979
1980         [CoordGraphics] Rename CoordinatedBuffer to Nicosia::Buffer
1981         https://bugs.webkit.org/show_bug.cgi?id=180135
1982
1983         Reviewed by Carlos Garcia Campos.
1984
1985         Adjust code to the CoordinatedBuffer -> Nicosia::Buffer transition.
1986
1987         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
1988         (WebKit::CoordinatedBackingStoreTile::setBackBuffer):
1989         (WebKit::CoordinatedBackingStore::updateTile):
1990         * Shared/CoordinatedGraphics/CoordinatedBackingStore.h:
1991         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1992         (WebKit::CoordinatedGraphicsScene::createUpdateAtlas):
1993         (WebKit::CoordinatedGraphicsScene::updateImageBacking):
1994         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
1995         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
1996         (WebKit::CompositingCoordinator::updateImageBacking):
1997         (WebKit::CompositingCoordinator::createUpdateAtlas):
1998         (WebKit::CompositingCoordinator::getCoordinatedBuffer):
1999         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
2000         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp:
2001         (WebKit::UpdateAtlas::UpdateAtlas):
2002         (WebKit::UpdateAtlas::getCoordinatedBuffer):
2003         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h:
2004
2005 2017-11-28  Brent Fulgham  <bfulgham@apple.com>
2006
2007         Adopt updated NSKeyed[Un]Archiver API when available
2008         https://bugs.webkit.org/show_bug.cgi?id=180127
2009         <rdar://problem/35710738>
2010
2011         Reviewed by Alex Christensen.
2012
2013         Switch to new NSKeyed[Un]Archiver methods when available. We do not attempt
2014         to adopt secure coding in places we were not under the original API.
2015
2016         * Platform/ios/AccessibilityIOS.mm:
2017         (WebKit::newAccessibilityRemoteToken): Use secure-by-default API.
2018         * Shared/Cocoa/DataDetectionResult.mm:
2019         (WebKit::DataDetectionResult::encode const): Ditto.
2020         (WebKit::DataDetectionResult::decode): Ditto.
2021         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
2022         (IPC::ArgumentCoder<WebCore::Payment>::encode): Ditto.
2023         (IPC::ArgumentCoder<WebCore::Payment>::decode): Ditto.
2024         (IPC::ArgumentCoder<WebCore::PaymentContact>::encode): Ditto.
2025         (IPC::ArgumentCoder<WebCore::PaymentContact>::decode): Ditto.
2026         (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::encode): Ditto.
2027         (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::decode): Ditto.
2028         (IPC::ArgumentCoder<WebCore::PaymentMethod>::encode): Ditto.
2029         (IPC::ArgumentCoder<WebCore::PaymentMethod>::decode): Ditto.
2030         * Shared/ios/InteractionInformationAtPosition.mm:
2031         (WebKit::InteractionInformationAtPosition::encode const): Ditto.
2032         (WebKit::InteractionInformationAtPosition::decode): Ditto.
2033         * Shared/mac/WebCoreArgumentCodersMac.mm:
2034         (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData): Ditto.
2035         (IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData): Ditto.
2036         (IPC::ArgumentCoder<Credential>::encodePlatformData): Ditto.
2037         (IPC::ArgumentCoder<Credential>::decodePlatformData): Ditto.
2038         (IPC::ArgumentCoder<ContentFilterUnblockHandler>::encode): Ditto.
2039         (IPC::ArgumentCoder<ContentFilterUnblockHandler>::decode): Ditto.
2040         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::encodePlatformData): Ditto.
2041         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::decodePlatformData): Ditto.
2042         * Shared/mac/WebHitTestResultData.mm:
2043         (WebKit::WebHitTestResultData::platformEncode const): Ditto.
2044         (WebKit::WebHitTestResultData::platformDecode): Ditto.
2045         * UIProcess/API/Cocoa/WKProcessPool.mm:
2046         (-[WKProcessPool _setObject:forBundleParameter:]): Ditto.
2047         (-[WKProcessPool _setObjectsForBundleParametersWithDictionary:]): Ditto.
2048         * UIProcess/API/Cocoa/WKWebView.mm:
2049         (-[WKWebView _setInputDelegate:]): Ditto.
2050         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2051         (WebKit::WebProcessPool::platformInitializeWebProcess): Ditto.
2052         * UIProcess/ios/PageClientImplIOS.mm:
2053         (WebKit::PageClientImpl::startAssistingNode): Ditto.
2054         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2055         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Ditto.
2056         * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
2057         (WebKit::InjectedBundle::initialize): Ditto.
2058         (WebKit::InjectedBundle::setBundleParameter): Ditto.
2059         (WebKit::InjectedBundle::setBundleParameters): Ditto.
2060
2061 2017-11-28  Youenn Fablet  <youenn@apple.com>
2062
2063         NetworkCache::Storage should protect itself when removing operations from its maps
2064         https://bugs.webkit.org/show_bug.cgi?id=180118
2065
2066         Reviewed by Antti Koivisto.
2067
2068         The operations can contain ref to the Storage object and removing them from the map may destroy the Storage object
2069
2070         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2071         (WebKit::NetworkCache::Storage::remove):
2072         (WebKit::NetworkCache::Storage::finishReadOperation):
2073         (WebKit::NetworkCache::Storage::finishWriteOperation):
2074         (WebKit::NetworkCache::Storage::traverse):
2075
2076 2017-11-28  Youenn Fablet  <youenn@apple.com>
2077
2078         Register Documents as ServiceWorker clients to the StorageProcess
2079         https://bugs.webkit.org/show_bug.cgi?id=180047
2080
2081         Reviewed by Brady Eidson.
2082
2083         Adding IPC to register/unregister clients to the storage process.
2084         This will be used to enable service worker termination, and implementation of Clients API.
2085
2086         WebSWServerConnection keeps a hash map of all its related clients.
2087         This allows unregistering these clients if the corresponding web process crashes.
2088
2089         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2090         (WebKit::WebSWServerConnection::~WebSWServerConnection):
2091         (WebKit::WebSWServerConnection::registerServiceWorkerClient):
2092         (WebKit::WebSWServerConnection::unregisterServiceWorkerClient):
2093         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2094         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
2095         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
2096         * WebProcess/Storage/WebSWClientConnection.cpp:
2097         (WebKit::WebSWClientConnection::registerServiceWorkerClient):
2098         (WebKit::WebSWClientConnection::unregisterServiceWorkerClient):
2099         * WebProcess/Storage/WebSWClientConnection.h:
2100
2101 2017-11-28  Said Abou-Hallawa  <sabouhallawa@apple.com>
2102
2103         [CG] PostScript images should be supported if they are sub-resource images
2104         https://bugs.webkit.org/show_bug.cgi?id=178502
2105         <rdar://problem/35102988>
2106
2107         Reviewed by Simon Fraser.
2108
2109         Make convertPostScriptDataToPDF() be as static function of PDFDocumentImage
2110         in WebCore.
2111
2112         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2113         (WebKit::PDFPlugin::convertPostScriptDataIfNeeded):
2114         (WebKit::convertPostScriptDataToPDF): Deleted.
2115
2116 2017-11-28  Alex Christensen  <achristensen@webkit.org>
2117
2118         Add SPI for adding strings directly to a _WKVisitedLinkStore
2119         https://bugs.webkit.org/show_bug.cgi?id=180100
2120
2121         Reviewed by Geoffrey Garen.
2122
2123         * UIProcess/API/Cocoa/_WKVisitedLinkStore.h:
2124         * UIProcess/API/Cocoa/_WKVisitedLinkStore.mm:
2125         (-[_WKVisitedLinkStore addVisitedLinkWithString:]):
2126         This is a performance optimization for rdar://problem/16321391
2127
2128 2017-11-28  Joseph Pecoraro  <pecoraro@apple.com>
2129
2130         REGRESSION: Web Inspector: context menu actions "Download Image" and "Open Image in New Window" don't work
2131         https://bugs.webkit.org/show_bug.cgi?id=178808
2132         <rdar://problem/35176608>
2133
2134         Reviewed by Brian Burg.
2135
2136         * UIProcess/mac/WKInspectorViewController.mm:
2137         (-[WKInspectorViewController _webView:contextMenu:forElement:]):
2138         Continue to hide the image context menu actions like we used to.
2139         Investigating making these context menus work can be done as a
2140         follow-up task.
2141
2142         * UIProcess/mac/WKWebInspectorWKWebView.mm:
2143         (-[WKWebInspectorWKWebView initWithFrame:configuration:]):
2144         Use nullptr instead of 0.
2145
2146 2017-11-14  Carlos Garcia Campos  <cgarcia@igalia.com>
2147
2148         Move JSONValues to WTF and convert uses of InspectorValues.h to JSONValues.h
2149         https://bugs.webkit.org/show_bug.cgi?id=173793
2150
2151         Reviewed by Joseph Pecocaro.
2152
2153         Based on patch by Brian Burg.
2154
2155         * UIProcess/Automation/WebAutomationSession.cpp:
2156         (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext):
2157         (WebKit::WebAutomationSession::moveWindowOfBrowsingContext):
2158         (WebKit::WebAutomationSession::waitForNavigationToCompleteOnPage):
2159         (WebKit::WebAutomationSession::waitForNavigationToCompleteOnFrame):
2160         (WebKit::WebAutomationSession::respondToPendingPageNavigationCallbacksWithTimeout):
2161         (WebKit::WebAutomationSession::respondToPendingFrameNavigationCallbacksWithTimeout):
2162         (WebKit::WebAutomationSession::navigationOccurredForFrame):
2163         (WebKit::WebAutomationSession::documentLoadedForFrame):
2164         (WebKit::WebAutomationSession::inspectorFrontendLoaded):
2165         (WebKit::WebAutomationSession::keyboardEventsFlushedForPage):
2166         (WebKit::WebAutomationSession::evaluateJavaScriptFunction):
2167         (WebKit::WebAutomationSession::setFilesToSelectForFileUpload):
2168         (WebKit::WebAutomationSession::addSingleCookie):
2169         (WebKit::WebAutomationSession::setSessionPermissions):
2170         (WebKit::WebAutomationSession::performMouseInteraction):
2171         (WebKit::WebAutomationSession::performKeyboardInteractions):
2172         * UIProcess/Automation/WebAutomationSession.h:
2173
2174 2017-11-28  Daniel Bates  <dabates@apple.com>
2175
2176         [Cocoa] First pass at implementing alternative presentation button element
2177         https://bugs.webkit.org/show_bug.cgi?id=179785
2178         Part of <rdar://problem/34917108>
2179
2180         Reviewed by Brent Fulgham.
2181
2182         Expose SPI to substitute the alternative presentation button for one or more elements
2183         and remove the alternative presentation button. Add a private delegate callback when
2184         the alternative presentation button is clicked.
2185
2186         * UIProcess/API/APIUIClient.h:
2187         (API::UIClient::didClickAlternativePresentationButton): Added.
2188         * UIProcess/API/C/WKPageUIClient.h:
2189         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2190         * UIProcess/Cocoa/UIDelegate.h:
2191         * UIProcess/Cocoa/UIDelegate.mm:
2192         (WebKit::UIDelegate::setDelegate): Wired up delegate callback.
2193         (WebKit::UIDelegate::UIClient::didClickAlternativePresentationButton): Added.
2194         * UIProcess/WebPageProxy.cpp:
2195         (WebKit::WebPageProxy::handleAlternativePresentationButtonClick): Added.
2196         * UIProcess/WebPageProxy.h:
2197         * UIProcess/WebPageProxy.messages.in:
2198         * WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h:
2199         (API::InjectedBundle::PageUIClient::didClickAlternativePresentationButton): Added.
2200         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h:
2201         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
2202         (-[WKWebProcessPlugInFrame substituteElements:withAlternativePresentationButtonWithIdentifier:]): Added.
2203         (-[WKWebProcessPlugInFrame removeAlternativePresentationButton:]): Added.
2204         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFramePrivate.h:
2205         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
2206         (WKBundleSubstituteWithAlternativePresentationButton): Added.
2207         (WKBundleRemoveAlternativePresentationButton): Added.
2208         * WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h:
2209         * WebProcess/InjectedBundle/API/c/WKBundlePageUIClient.h:
2210         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
2211         (WebKit::InjectedBundlePageUIClient::didClickAlternativePresentationButton): Added.
2212         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
2213         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2214         (WebKit::WebChromeClient::handleAlternativePresentationButtonClick): Added.
2215         * WebProcess/WebCoreSupport/WebChromeClient.h:
2216
2217 2017-11-27  Chris Dumez  <cdumez@apple.com>
2218
2219         ASSERTION FAILED: addResult.isNewEntry WebCore::SWServerRegistration::addClientUsingRegistration(WebCore::ServiceWorkerClientIdentifier const&) + 141
2220         https://bugs.webkit.org/show_bug.cgi?id=180049
2221
2222         Reviewed by Brady Eidson.
2223
2224         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
2225         * WebProcess/Storage/WebSWClientConnection.cpp:
2226         (WebKit::WebSWClientConnection::addServiceWorkerRegistrationInServer):
2227         (WebKit::WebSWClientConnection::removeServiceWorkerRegistrationInServer):
2228         (WebKit::WebSWClientConnection::serviceWorkerStartedControllingClient):
2229         (WebKit::WebSWClientConnection::serviceWorkerStoppedControllingClient):
2230         * WebProcess/Storage/WebSWClientConnection.h:
2231
2232 2017-11-27  Jeremy Jones  <jeremyj@apple.com>
2233
2234         downcast to WebKit::FullscreenClient can sometimes fail.
2235         https://bugs.webkit.org/show_bug.cgi?id=179849
2236
2237         Reviewed by Darin Adler.
2238
2239         There are cases during teardown where fullscreenClient() has been cleared back to an API::FullscreenClient.
2240         Because those cases, WKWebView should test before downcasting to WebKit::FullscreenClient.
2241
2242         This is causing a crash when fullscreen delegate is cleared after a page is closed.
2243
2244         * UIProcess/API/Cocoa/WKWebView.mm:
2245         (-[WKWebView _setFullscreenDelegate:]):
2246         (-[WKWebView _fullscreenDelegate]):
2247
2248 2017-11-27  Chris Dumez  <cdumez@apple.com>
2249
2250         Give Document a strongly typed identifier instead of a uint64_t
2251         https://bugs.webkit.org/show_bug.cgi?id=180041
2252
2253         Reviewed by Youenn Fablet.
2254
2255         Give Document a strongly typed identifier instead of a uint64_t, for clarity.
2256
2257         * Platform/IPC/ArgumentCoders.h:
2258         * Scripts/webkit/messages.py:
2259         (forward_declarations_and_headers):
2260         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2261         (WebKit::WebSWServerConnection::notifyClientsOfControllerChange):
2262         (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope):
2263         (WebKit::WebSWServerConnection::postMessageToServiceWorkerClient):
2264         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2265         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
2266         * StorageProcess/StorageProcess.cpp:
2267         (WebKit::StorageProcess::postMessageToServiceWorkerClient):
2268         * WebProcess/Storage/WebSWClientConnection.cpp:
2269         (WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope):
2270         (WebKit::WebSWClientConnection::serviceWorkerStartedControllingClient):
2271         (WebKit::WebSWClientConnection::serviceWorkerStoppedControllingClient):
2272         (WebKit::WebSWClientConnection::postMessageToServiceWorkerClient):
2273         * WebProcess/Storage/WebSWClientConnection.h:
2274         * WebProcess/Storage/WebSWClientConnection.messages.in:
2275
2276 2017-11-27  Yacine Bandou  <yacine.bandou_ext@softathome.com>
2277
2278         [GTK][WPE] Add "enable-encrypted-media" property to WebKitWebSettings
2279         https://bugs.webkit.org/show_bug.cgi?id=18005
2280
2281         Reviewed by Michael Catanzaro.
2282
2283         EncryptedMedia is an experimental JavaScript API for playing encrypted media in HTML.
2284         This property will only work as intended if the EncryptedMedia feature is enabled at build time
2285         with the ENABLE_ENCRYPTED_MEDIA flag.
2286
2287         * UIProcess/API/glib/WebKitSettings.cpp:
2288         (webKitSettingsSetProperty):
2289         (webKitSettingsGetProperty):
2290         (webkit_settings_class_init):
2291         (webkit_settings_get_enable_encrypted_media):
2292         (webkit_settings_set_enable_encrypted_media):
2293         * UIProcess/API/gtk/WebKitSettings.h:
2294         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
2295         * UIProcess/API/wpe/WebKitSettings.h:
2296
2297 2017-11-27  Tim Horton  <timothy_horton@apple.com>
2298
2299         One too many zeroes in macOS version number in FeatureDefines
2300         https://bugs.webkit.org/show_bug.cgi?id=180011
2301
2302         Reviewed by Dan Bernstein.
2303
2304         * Configurations/FeatureDefines.xcconfig:
2305
2306 2017-11-27  Zan Dobersek  <zdobersek@igalia.com>
2307
2308         [CoordGraphics] Prettify ID value handling in UpdateAtlas and UpdateAtlas::Client
2309         https://bugs.webkit.org/show_bug.cgi?id=180038
2310
2311         Reviewed by Carlos Garcia Campos.
2312
2313         In the UpdateAtlas class, provide an ID type that aliases to uint32_t.
2314         The m_id member variable (ex-m_ID) uses this type, and it's also now
2315         used in the Client interface.
2316
2317         While poking around, the header is modified to use '#pragma once',
2318         and m_id is moved to the more logical first position among member
2319         variables.
2320
2321         The static ID variable is modified to use the new type, and renamed
2322         to s_nextID. Comment alongside the namespace scope closure is fixed
2323         to use the appropriate name.
2324
2325         createUpdateAtlas() and removeUpdateAtlas() methods in the
2326         CompositingCoordinator class are modified to use the UpdateAtlas::ID
2327         type, and the former has the second parameter changed from RefPtr<>
2328         to Ref<>.
2329
2330         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
2331         (WebKit::CompositingCoordinator::createUpdateAtlas):
2332         (WebKit::CompositingCoordinator::removeUpdateAtlas):
2333         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
2334         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp:
2335         (WebKit::UpdateAtlas::UpdateAtlas):
2336         (WebKit::UpdateAtlas::~UpdateAtlas):
2337         (WebKit::UpdateAtlas::getCoordinatedBuffer):
2338         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h:
2339
2340 2017-11-27  Zan Dobersek  <zdobersek@igalia.com>
2341
2342         [CoordGraphics] CompositingCoordinator: clean up Client vtable, GraphicsLayerClient overrides
2343         https://bugs.webkit.org/show_bug.cgi?id=180037
2344
2345         Reviewed by Carlos Garcia Campos.
2346
2347         Remove the CompositingCoordinator::Client::paintLayerContents() method since
2348         the only implementation in CoordinatedLayerTreeHost was empty.
2349
2350         Subsequently, the CompositingCoordinator::paintContents() override of the
2351         GraphicsLayerClient method can also be removed. The notifyAnimationStarted()
2352         override is empty, just like the base method, so it's removed as well.
2353
2354         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
2355         (WebKit::CompositingCoordinator::deviceScaleFactor const): Bring method up
2356         to the notifyFlushRequired() code, since both are overrides of the
2357         GraphicsLayerClient-inherited methods.
2358         (WebKit::CompositingCoordinator::pageScaleFactor const): Ditto.
2359         (WebKit::CompositingCoordinator::notifyAnimationStarted): Deleted.
2360         (WebKit::CompositingCoordinator::paintContents): Deleted.
2361         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
2362         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
2363         (WebKit::CoordinatedLayerTreeHost::paintLayerContents): Deleted.
2364         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
2365
2366 2017-11-27  Carlos Garcia Campos  <cgarcia@igalia.com>
2367
2368         REGRESSION(r223073): disk cache directory is no longer copied in ProcessPoolConfiguration::copy()
2369         https://bugs.webkit.org/show_bug.cgi?id=180031
2370
2371         Reviewed by Youenn Fablet.
2372
2373         This has caused GTK/WPE test /webkit2/WebKitWebsiteData/configuration to fail, and the wrong directory is used
2374         by the network process. I think it was removed by mistake in r223073.
2375
2376         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2377         (API::ProcessPoolConfiguration::copy): Copy m_diskCacheDirectory too.
2378
2379 2017-11-27  Adrian Perez de Castro  <aperez@igalia.com>
2380
2381         [WPE][GTK] Improve contents of pkg-config .pc files
2382         https://bugs.webkit.org/show_bug.cgi?id=180032
2383
2384         Reviewed by Carlos Garcia Campos.
2385
2386         * gtk/webkit2gtk-web-extension.pc.in: Add URL, edit Name and Description.
2387         * gtk/webkit2gtk.pc.in: Add URL, edit Name.
2388         * wpe/wpe-webkit.pc.in: Add URL, edit Name and Description.
2389
2390 2017-11-23  Darin Adler  <darin@apple.com>
2391
2392         Fix dictionary leak in lookup, convert FindOptions to OptionSet, tweak code style nearby
2393         https://bugs.webkit.org/show_bug.cgi?id=179981
2394
2395         Reviewed by Sam Weinig.
2396
2397         * WebProcess/Plugins/PDF/PDFPlugin.h: Use some references instead of pointers. Made more
2398         things final and private. Changed functions with multiple return values to use tuples
2399         instead of out arguments for clarity, especially because some were using pointers and it
2400         was ambiguous whether the pointers could be nullptr. Tweaked formatting. Moved initialization
2401         of data members into the class definition.
2402
2403         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2404         (WebKit::PDFPlugin::create): Take a reference.
2405         (WebKit::PDFPlugin::PDFPlugin): Ditto. Also moved some initialization to the class definition.
2406         (WebKit::PDFPlugin::countFindMatches): Added comment about ignored maxMatchCount argument.
2407         (WebKit::PDFPlugin::findString): Use contains instead of & to check bits in options.
2408         Simplified slightly confusing match count code that was doing some unnecessary comparisons
2409         with the maximum match count. Use auto a bit.
2410         (WebKit::coreCursor): Renamed from pdfLayerControllerCursorTypeToCursor since this is C++
2411         and overloading works based on the argument type.
2412         (WebKit::PDFPlugin::notifyCursorChanged): Updated for name change.
2413         (WebKit::PDFPlugin::lookupTextAtLocation const): Return a tuple instead of using two out
2414         arguments and use a RetainPtr so we don't leak the options dictionary.
2415
2416         * WebProcess/Plugins/PluginProxy.h: Removed unneeded include of FindOptions.h.
2417
2418         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
2419         (WebKit::WebContextMenuClient::lookUpInDictionary): Pass a reference.
2420
2421         * WebProcess/WebPage/FindController.cpp:
2422         (WebKit::core): Use |= instead of | to build up a FindOptions.
2423         (WebKit::FindController::FindController): Initialize data members in the class definition.
2424         (WebKit::pluginViewForFrame): Deleted. Callers now use WebPage::pluginViewForFrame.
2425         (WebKit::FindController::updateFindUIAfterPageScroll): Added a FIXME about some peculiar code.
2426         (WebKit::FindController::findString): Use |= rather than | to add in an option.
2427         (WebKit::FindController::hideFindUI): Use { } rather than 0 for no options.
2428         * WebProcess/WebPage/FindController.h: Moved initialization to the header. Exported the core
2429         function that converts WebKit::FindOptions to WebCore::FindOptions.
2430
2431         * WebProcess/WebPage/WebFrame.cpp:
2432         (WebKit::WebFrame::handlesPageScaleGesture const): Use WebPage::pluginViewForFrame.
2433         (WebKit::WebFrame::requiresUnifiedScaleFactor const): Use WebPage::pluginViewForFrame.
2434
2435         * WebProcess/WebPage/WebPage.cpp:
2436         (WebKit::WebPage::createPlugin): Removed unneeded local variable and UNUSED_PARAM.
2437         (WebKit::WebPage::focusedPluginViewForFrame): Use pluginViewForFrame.
2438         (WebKit::WebPage::pluginViewForFrame): Added a null check since this takes a pointer.
2439         Use is/downcast insteadof more ad hoc coding style.
2440         (WebKit::WebPage::findStringFromInjectedBundle): Call core to convert WebKit::FindOptions
2441         to WebCore::FindOptions. Before, this was accidentally relying on the bits from the two
2442         enumrations matching! The stricter type checking of OptionSet helps us catch mistakes
2443         like this.
2444
2445         * WebProcess/WebPage/WebPage.h: Updated for the above. Also flattened out nested #if
2446         statements, made forward declarations unconditional, and re-sorted them. Changed the
2447         Mac-specific lookupTextAtLocation to return a tuple (see below).
2448
2449         * WebProcess/WebPage/ios/WebPageIOS.mm:
2450         (WebKit::WebPage::performDictionaryLookupForSelection): Take a reference instead of a pointer.
2451         (WebKit::WebPage::performDictionaryLookupForRange): Ditto.
2452         (WebKit::rangeNearPositionMatchesText): Use { } rather than 0 for no options.
2453
2454         * WebProcess/WebPage/mac/WebPageMac.mm:
2455         (WebKit::WebPage::performDictionaryLookupAtLocation): Use RetainPtr<NSDictionary> to fix
2456         code that used to leak.
2457         (WebKit::WebPage::performDictionaryLookupForSelection): Ditto.
2458         (WebKit::WebPage::performDictionaryLookupOfCurrentSelection): Use a reference.
2459         (WebKit::WebPage::dictionaryPopupInfoForRange): Updated for changed argument types.
2460         (WebKit::WebPage::dictionaryPopupInfoForSelectionInPDFPlugin): Ditto.
2461         (WebKit::WebPage::performDictionaryLookupForRange): Ditto.
2462         (WebKit::WebPage::performImmediateActionHitTestAtLocation): Updated to handle the
2463         tuple result from the lookupTextAtLocation functions.
2464         (WebKit::WebPage::lookupTextAtLocation): Changed to return a tuple and use RetainPtr
2465         for the NSDictionary to help fix the leak.
2466
2467 2017-11-24  Zan Dobersek  <zdobersek@igalia.com>
2468
2469         [CoordGraphics] CoordinatedGraphicsLayer::updateContentBuffers() should always assume a non-null CoordinatedBuffer
2470         https://bugs.webkit.org/show_bug.cgi?id=179977
2471
2472         Reviewed by Carlos Garcia Campos.
2473
2474         Make CompositingCoordinator::getCoordinatedBuffer() return a Ref<CoordinatedBuffer>
2475         value. In case an UpdateAtlas with enough free area is found, its CoordinatedBuffer
2476         is dereferenced into the return value. In case a new UpdateAtlas is created, the
2477         returned CoordinatedBuffer pointer is asserted to be non-null and dereferenced.
2478
2479         The retrieved CoordinatedBuffer pointer on a newly-created UpdateAtlas should never
2480         be null since the tiles are smaller in size than the UpdateAtlas area. The assert
2481         is done in release configurations as well since the code in CoordinatedGraphicsLayer
2482         assumes the returned pointer will be non-null, so it's just a matter of where to
2483         crash first in case somehow a null value is returned.
2484
2485         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
2486         (WebKit::CompositingCoordinator::getCoordinatedBuffer):
2487         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
2488
2489 2017-11-24  Zan Dobersek  <zdobersek@igalia.com>
2490
2491         [CoordGraphics] UpdateAtlas constructor should receive an IntSize, not a dimension value
2492         https://bugs.webkit.org/show_bug.cgi?id=179976
2493
2494         Reviewed by Carlos Garcia Campos.
2495
2496         Have the UpdateAtlas constructor receive an IntSize object that specifies
2497         the desired size for the CoordinatedBuffer. Passing in a dimension doesn't
2498         really make sense since this value isn't dynamically configurable, and
2499         the only value that is passed in is already a power-of-two.
2500
2501         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
2502         (WebKit::CompositingCoordinator::getCoordinatedBuffer):
2503         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp:
2504         (WebKit::UpdateAtlas::UpdateAtlas):
2505         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h:
2506
2507 2017-11-23  Sam Weinig  <sam@webkit.org>
2508
2509         Remove unneeded ScriptController::processingUserGesture() forwarding functions
2510         https://bugs.webkit.org/show_bug.cgi?id=179954
2511
2512         Reviewed by Darin Adler.
2513
2514         Replace ScriptController::processingUserGesture() and ScriptController::processingUserGestureForMedia()
2515         with direct calls to the corresponding UserGestureIndicator functions.
2516
2517         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2518         (WebKit::InjectedBundle::isProcessingUserGesture):
2519         * WebProcess/WebPage/WebPage.cpp:
2520         (WebKit::WebPage::addResourceRequest):
2521
2522 2017-11-23  Chris Dumez  <cdumez@apple.com>
2523
2524         WebSWServerConnection should register/unregister itself with the StorageProcess
2525         https://bugs.webkit.org/show_bug.cgi?id=179965
2526
2527         Reviewed by Darin Adler.
2528
2529         WebSWServerConnection should register/unregister itself with the StorageProcess instead of relying
2530         on StorageToWebProcessConnection to do so on its behalf. This is less error-prone.
2531
2532         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2533         (WebKit::WebSWServerConnection::WebSWServerConnection):
2534         (WebKit::WebSWServerConnection::~WebSWServerConnection):
2535         * StorageProcess/StorageToWebProcessConnection.cpp:
2536         (WebKit::StorageToWebProcessConnection::~StorageToWebProcessConnection):
2537         (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
2538         (WebKit::StorageToWebProcessConnection::removeSWServerConnection):
2539
2540 2017-11-23  Darin Adler  <darin@apple.com>
2541
2542         Reduce WTF::String operations that do unnecessary Unicode operations instead of ASCII
2543         https://bugs.webkit.org/show_bug.cgi?id=179907
2544
2545         Reviewed by Sam Weinig.
2546
2547         * NetworkProcess/cache/NetworkCache.cpp:
2548         (WebKit::NetworkCache::isMediaMIMEType): Use startsWithLettersIgnoringASCIICase.
2549         * NetworkProcess/cache/NetworkCacheKey.cpp:
2550         (WebKit::NetworkCache::hashString): Use isAllASCII..
2551         * UIProcess/API/C/WKWebsitePolicies.cpp:
2552         (WKWebsitePoliciesSetCustomHeaderFields): Use startsWithLettersIgnoringASCIICase..
2553         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
2554         (-[_WKWebsitePolicies setCustomHeaderFields:]): Ditto.
2555         * UIProcess/WebPageProxy.cpp:
2556         (WebKit::WebPageProxy::savePDFToFileInDownloadsFolder): Use endsWithIgnoringASCIICase.
2557         * UIProcess/WebPreferences.cpp:
2558         (WebKit::WebPreferences::WebPreferences): Initialize m_identifier explicitly. Somehow
2559         changing the String default constructor to be "= default" led to a warning that we
2560         otherwise did not get about not initializing m_identifier. Arguably a compiler bug,
2561         but legitimately strange that the copy constructor does not copy m_identifier and so
2562         nice to be explicit about it, I guess.
2563         * UIProcess/mac/WebPageProxyMac.mm:
2564         (WebKit::WebPageProxy::savePDFToTemporaryFolderAndOpenWithNativeApplicationRaw): Use
2565         endsWithIgnoringASCIICase.
2566         (WebKit::WebPageProxy::openPDFFromTemporaryFolderWithNativeApplication): Ditto.
2567         * WebProcess/WebPage/WebPage.cpp:
2568         (WebKit::WebPage::createPlugin): Ditto.
2569         * WebProcess/WebPage/ios/WebPageIOS.mm:
2570         (WebKit::WebPage::platformEditorState const): Use isAllSpecialCharacters<isHTMLSpace>.
2571
2572 2017-11-23  Zan Dobersek  <zdobersek@igalia.com>
2573
2574         [CoordGraphics] Simplify CoordinatedGraphicsLayer's content buffer updates
2575         https://bugs.webkit.org/show_bug.cgi?id=179972
2576
2577         Reviewed by Carlos Garcia Campos.
2578
2579         In CompositingCoordinator, add the getCoordinatedBuffer() method, replacing
2580         paintToSurface(). The new method traverses the list of UpdateAtlases and
2581         returns any CoordinatedBuffer object that was free to use. If none exist,
2582         a new UpdateAtlas object is created, and its CoordinatedBuffer is returned.
2583
2584         In  UpdateAtlas, the paintOnAvailableBuffer() method is replaced with
2585         getCoordinatedBuffer(). The latter allocates the necessary area but then
2586         returns a reference to the CoordinatedBuffer buffer, along with the atlas ID
2587         and the allocated rectangle information, and does not invoke any painting
2588         operation like paintOnAvailableBuffer() did.
2589
2590         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
2591         (WebKit::CompositingCoordinator::getCoordinatedBuffer):
2592         (WebKit::CompositingCoordinator::paintToSurface): Deleted.
2593         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
2594         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp:
2595         (WebKit::UpdateAtlas::getCoordinatedBuffer):
2596         (WebKit::UpdateAtlas::paintOnAvailableBuffer): Deleted.
2597         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h:
2598
2599 2017-11-23  Zan Dobersek  <zdobersek@igalia.com>
2600
2601         [CoordGraphics] Remove relay CoordinatedBuffer::Client implementations
2602         https://bugs.webkit.org/show_bug.cgi?id=179970
2603
2604         Reviewed by Carlos Garcia Campos.
2605
2606         Drop the helper UpdateAtlasSurfaceClient class and instead directly use
2607         the CoordinatedBuffer's GraphicsContext to perform clip and translation
2608         operations based on the allocated rectangle, to pre-fill the target rect
2609         with transparent color in case the alpha channel is supported, and to
2610         then invoke CoordinatedBuffer::Client::paintToSurfaceContext() method,
2611         passing the GraphicsContext as the argument.
2612
2613         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp:
2614         (WebKit::UpdateAtlas::paintOnAvailableBuffer):
2615         (): Deleted.
2616
2617 2017-11-23  Zan Dobersek  <zdobersek@igalia.com>
2618
2619         [CoordGraphics] Replace CoordinatedSurface, ThreadSafeCoordinatedSurface with CoordinatedBuffer
2620         https://bugs.webkit.org/show_bug.cgi?id=179967
2621
2622         Reviewed by Carlos Garcia Campos.
2623
2624         Replace uses of CoordinatedSurface class with CoordinatedBuffer. The
2625         ThreadSafeCoordinatedSurface class is removed, along with the code in
2626         CoordinatedLayerTreeHost that established a CoordinatedSurface factory.
2627
2628         * PlatformGTK.cmake:
2629         * PlatformWPE.cmake:
2630         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
2631         (WebKit::CoordinatedBackingStoreTile::swapBuffers):
2632         (WebKit::CoordinatedBackingStoreTile::setBackBuffer):
2633         (WebKit::CoordinatedBackingStore::updateTile):
2634         * Shared/CoordinatedGraphics/CoordinatedBackingStore.h:
2635         Rename m_surface to m_buffer, m_surfaceOffset to m_bufferOffset.
2636         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
2637         (WebKit::CoordinatedGraphicsScene::createUpdateAtlas):
2638         (WebKit::CoordinatedGraphicsScene::updateImageBacking):
2639         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
2640         * Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.cpp: Removed.
2641         * Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.h: Removed.
2642         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
2643         (WebKit::CompositingCoordinator::updateImageBacking):
2644         (WebKit::CompositingCoordinator::createUpdateAtlas):
2645         (WebKit::CompositingCoordinator::paintToSurface):
2646         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
2647         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
2648         (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
2649         (WebKit::CoordinatedLayerTreeHost::createCoordinatedSurface): Deleted.
2650         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
2651         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp:
2652         (WebKit::UpdateAtlas::UpdateAtlas):
2653         (WebKit::UpdateAtlas::~UpdateAtlas):
2654         (WebKit::UpdateAtlas::paintOnAvailableBuffer):
2655         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h:
2656         Rename m_surface to m_buffer.
2657         (WebKit::UpdateAtlas::size const):
2658         (WebKit::UpdateAtlas::supportsAlpha const):
2659
2660 2017-11-22  Ali Juma  <ajuma@chromium.org>
2661
2662         Implement VisualViewport API attributes
2663         https://bugs.webkit.org/show_bug.cgi?id=179385
2664
2665         Reviewed by Frédéric Wang.
2666
2667         Add a VisualViewportAPI experimental feature.
2668
2669         * Shared/WebPreferences.yaml:
2670
2671 2017-11-22  Tim Horton <timothy_horton@apple.com> and Michael Catanzaro <mcatanzaro@igalia.com>
2672
2673         Remove build-webkit's notion of feature flags having a default value
2674         https://bugs.webkit.org/show_bug.cgi?id=177338
2675
2676         Reviewed by Carlos Alberto Lopez Perez.
2677
2678         Use ENABLE_EXPERIMENTAL_FEATURES instead of ENABLE_DEVELOPER_MODE to enable runtime
2679         experimental features.
2680
2681         * Shared/WebPreferencesDefaultValues.h:
2682
2683 2017-11-22  Commit Queue  <commit-queue@webkit.org>
2684
2685         Unreviewed, rolling out r225093.
2686         https://bugs.webkit.org/show_bug.cgi?id=179938
2687
2688         Compilation failed on WinCairo 64-bit Release (Requested by
2689         fredw on #webkit).
2690
2691         Reverted changeset:
2692
2693         "Implement VisualViewport API attributes"
2694         https://bugs.webkit.org/show_bug.cgi?id=179385
2695         https://trac.webkit.org/changeset/225093
2696
2697 2017-11-21  Ali Juma  <ajuma@chromium.org>
2698
2699         Implement VisualViewport API attributes
2700         https://bugs.webkit.org/show_bug.cgi?id=179385
2701
2702         Reviewed by Frédéric Wang.
2703
2704         Add a VisualViewportAPI experimental feature.
2705
2706         * Shared/WebPreferences.yaml:
2707
2708 2017-11-21  Christopher Reid  <chris.reid@sony.com>
2709
2710         [PAL] Remove FileSystem's dependency on WebCoreNSStringExtras
2711         https://bugs.webkit.org/show_bug.cgi?id=179504
2712
2713         Reviewed by Darin Adler.
2714
2715         * UIProcess/Cocoa/WebViewImpl.mm:
2716         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2717         * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
2718
2719 2017-11-21  Carlos Garcia Campos  <cgarcia@igalia.com>
2720
2721         [WPE] WPEWebProcess: Couldn't find current GLX or EGL context
2722         https://bugs.webkit.org/show_bug.cgi?id=179883
2723
2724         Reviewed by Žan Doberšek.
2725
2726         I'm seeing that message quite often when running the unit tests. The problem seems to be that some tests run so
2727         fast that the web process never renders the first frame, so the context is created but never made current. I've
2728         checked with apitrace that there are calls to eglQueryContext with null display, causing a EGL_BAD_DISPLAY, but
2729         I don't know where those calls are originated. Making the context current right after it's created fixes the
2730         problem.
2731
2732         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
2733         (WebKit::ThreadedCompositor::createGLContext): Always call makeContextCurrent() right after the context is created.
2734
2735 2017-11-20  Carlos Garcia Campos  <cgarcia@igalia.com>
2736
2737         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.19.2 release.
2738
2739         * gtk/NEWS: Add release notes for 2.19.2.
2740
2741 2017-11-20  Don Olmstead  <don.olmstead@sony.com>
2742
2743         Add declspec within WebKit API
2744         https://bugs.webkit.org/show_bug.cgi?id=179893
2745
2746         Reviewed by Darin Adler.
2747
2748         * Shared/API/c/WKDeclarationSpecifiers.h:
2749
2750 2017-11-20  Mario Sanchez Prada  <mario@endlessm.com>
2751
2752         [GTK] New API to add, retrieve and delete cookies via WebKitCookieManager
2753         https://bugs.webkit.org/show_bug.cgi?id=177932
2754
2755         Reviewed by Carlos Garcia Campos.
2756
2757         Added new API to WebKitCookieManager to add, retrieve and delete complete
2758         cookies into/out-of a running session, and updated documentation sections.
2759
2760         * UIProcess/API/glib/WebKitCookieManager.cpp:
2761         (webkit_cookie_manager_add_cookie): New function.
2762         (webkit_cookie_manager_add_cookie_finish): Ditto.
2763         (webkit_cookie_manager_get_cookies): Ditto.
2764         (webkit_cookie_manager_get_cookies_finish): Ditto.
2765         (webkit_cookie_manager_delete_cookie): Ditto.
2766         (webkit_cookie_manager_delete_cookie_finish): Ditto.
2767         * UIProcess/API/gtk/WebKitCookieManager.h: Added new functions.
2768         * UIProcess/API/wpe/WebKitCookieManager.h: Ditto.
2769         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Ditto.
2770
2771 2017-11-20  Carlos Garcia Campos  <cgarcia@igalia.com>
2772
2773         [WPE] webkit_web_view_new() should enable specifying wpe_view_backend object
2774         https://bugs.webkit.org/show_bug.cgi?id=178655
2775
2776         Reviewed by Michael Catanzaro.
2777
2778         Update all WebKitWebView constructors to receive a WebKitWebViewBackend as argument. It's now required to
2779         provide a backend to create a web view, but it can be NULL to use the default one. WebKitWebViewBackend is a
2780         boxed type wrapping a struct wpe_view_backend* used as construct only property of WebKitWebView. The view always
2781         takes the ownership of the WebKitWebViewBackend which owns the struct wpe_view_backend*. An optional
2782         GDestroyNotify and user data pointer can be passed to the WebKitWebViewBackend constructor to provide a custom
2783         deleter for the backend. In the C API the struct wpe_view_backend* is also mandatory now, but it can't be NULL
2784         and it's owned by the caller, not the view.
2785
2786         * PlatformWPE.cmake:
2787         * UIProcess/API/C/wpe/WKView.cpp:
2788         (WKViewCreate):
2789         * UIProcess/API/C/wpe/WKView.h:
2790         * UIProcess/API/glib/WebKitWebView.cpp:
2791         (_WebKitWebViewPrivate::~_WebKitWebViewPrivate):
2792         (webkitWebViewConstructed):
2793         (webkitWebViewSetProperty):
2794         (webkitWebViewGetProperty):
2795         (webkit_web_view_class_init):
2796         (webkitWebViewCreatePage):
2797         (webkit_web_view_get_backend):
2798         * UIProcess/API/wpe/WPEView.cpp:
2799         (WKWPE::m_backend):
2800         (WKWPE::View::~View):
2801         * UIProcess/API/wpe/WebKitWebView.h:
2802         * UIProcess/API/wpe/WebKitWebViewBackend.cpp: Added.
2803         (_WebKitWebViewBackend::_WebKitWebViewBackend):
2804         (_WebKitWebViewBackend::~_WebKitWebViewBackend):
2805         (webkitWebViewBackendRef):
2806         (webkitWebViewBackendUnref):
2807         (webkitWebViewBackendCreateDefault):
2808         (webkit_web_view_backend_new):
2809         (webkit_web_view_backend_get_wpe_backend):
2810         * UIProcess/API/wpe/WebKitWebViewBackend.h: Added.
2811         * UIProcess/API/wpe/WebKitWebViewBackendPrivate.h: Added.
2812         * UIProcess/API/wpe/WebKitWebViewWPE.cpp:
2813         (webkit_web_view_new):
2814         (webkit_web_view_new_with_context):
2815         (webkit_web_view_new_with_related_view):
2816         (webkit_web_view_new_with_settings):
2817         (webkit_web_view_new_with_user_content_manager):
2818         * UIProcess/API/wpe/webkit.h:
2819
2820 2017-11-20  Carlos Garcia Campos  <cgarcia@igalia.com>
2821
2822         [GTK][WPE] webkit_cookie_manager_delete_all_cookies doesn't delete the cookies if called before a web process is running
2823         https://bugs.webkit.org/show_bug.cgi?id=175265
2824
2825         Reviewed by Michael Catanzaro.
2826
2827         This is what happens:
2828
2829         1- We create our WebKitWebContext that creates its WebProcessPool.
2830         2- We set a persistent cookies storage.
2831         3- We ask the website data store to delete all cookies, but since website data store is a web process observer
2832            and we haven't spawned any web process yet, it creates a new WebProcessPool with the default configuration
2833            (no persistent cookies) and sends the message to delete the cookies there.
2834         4- The network process of the second process pool does nothing because it doesn't have cookies at all.
2835
2836         We need to set the primary data store of the WebProcessPool when WebKitWebContext is constructed to ensure that
2837         one is used before the web process is launched.
2838
2839         * UIProcess/API/glib/WebKitWebContext.cpp:
2840         (webkitWebContextConstructed):
2841
2842 2017-11-19  Tim Horton  <timothy_horton@apple.com>
2843
2844         Remove unused TOUCH_ICON_LOADING feature flag
2845         https://bugs.webkit.org/show_bug.cgi?id=179873
2846
2847         Reviewed by Simon Fraser.
2848
2849         * Configurations/FeatureDefines.xcconfig:
2850
2851 2017-11-19  Tim Horton  <timothy_horton@apple.com>
2852
2853         Remove unused LEGACY_VENDOR_PREFIXES feature flag
2854         https://bugs.webkit.org/show_bug.cgi?id=179872
2855
2856         Reviewed by Darin Adler.
2857
2858         * Configurations/FeatureDefines.xcconfig:
2859
2860 2017-11-18  Chris Dumez  <cdumez@apple.com>
2861
2862         ASSERTION FAILED: registration in WebCore::SWServerJobQueue::scriptContextStarted(ServiceWorkerIdentifier)
2863         https://bugs.webkit.org/show_bug.cgi?id=179846
2864
2865         Reviewed by Darin Adler.
2866
2867         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2868         (WebKit::WebSWServerConnection::rejectJobInClient):
2869         (WebKit::WebSWServerConnection::resolveRegistrationJobInClient):
2870         (WebKit::WebSWServerConnection::resolveUnregistrationJobInClient):
2871         (WebKit::WebSWServerConnection::startScriptFetchInClient):
2872         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2873         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
2874         * WebProcess/Storage/WebSWClientConnection.messages.in:
2875         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2876         (WebKit::WebSWContextManagerConnection::serviceWorkerStartedWithMessage):
2877         (WebKit::WebSWContextManagerConnection::didFinishInstall):
2878         * WebProcess/Storage/WebSWContextManagerConnection.h:
2879
2880 2017-11-18  Tim Horton  <timothy_horton@apple.com>
2881
2882         Rename some Network Capture debugging defines
2883         https://bugs.webkit.org/show_bug.cgi?id=179870
2884
2885         Reviewed by Darin Adler.
2886
2887         * NetworkProcess/capture/NetworkCaptureLogging.h:
2888         * NetworkProcess/capture/NetworkCaptureManager.cpp:
2889         (WebKit::NetworkCapture::Manager::findMatch):
2890         (WebKit::NetworkCapture::Manager::fuzzyMatchURLs):
2891         These shouldn't have WTF in their name - they have nothing to do with WTF.
2892         These shouldn't use ENABLE(), since they're not features, just debugging macros.
2893
2894 2017-11-17  Chris Dumez  <cdumez@apple.com>
2895
2896         [Service Workers] Implement "Notify Controller Change" algorithm
2897         https://bugs.webkit.org/show_bug.cgi?id=179822
2898
2899         Reviewed by Youenn Fablet.
2900
2901         * Scripts/webkit/messages.py:
2902         (class_template_headers):
2903         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2904         (WebKit::WebSWServerConnection::notifyClientsOfControllerChange):
2905         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2906         * WebProcess/Storage/WebSWClientConnection.messages.in:
2907
2908 2017-11-17  Chris Dumez  <cdumez@apple.com>
2909
2910         Use a strongly typed identifier for SWServer::Connection
2911         https://bugs.webkit.org/show_bug.cgi?id=179848
2912
2913         Reviewed by Brady Eidson.
2914
2915         Use a strongly typed identifier for SWServer::Connection, for clarity.
2916
2917         * Scripts/webkit/messages.py:
2918         (forward_declarations_and_headers):
2919         (forward_declarations_and_headers.templates):
2920         (headers_for_type):
2921         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2922         (WebKit::WebSWServerConnection::WebSWServerConnection):
2923         (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope):
2924         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2925         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
2926         * StorageProcess/StorageProcess.cpp:
2927         (WebKit::StorageProcess::didFailFetch):
2928         (WebKit::StorageProcess::didNotHandleFetch):
2929         (WebKit::StorageProcess::didReceiveFetchResponse):
2930         (WebKit::StorageProcess::didReceiveFetchData):
2931         (WebKit::StorageProcess::didReceiveFetchFormData):
2932         (WebKit::StorageProcess::didFinishFetch):
2933         * StorageProcess/StorageProcess.h:
2934         * StorageProcess/StorageProcess.messages.in:
2935         * StorageProcess/StorageToWebProcessConnection.cpp:
2936         (WebKit::StorageToWebProcessConnection::didReceiveMessage):
2937         (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
2938         (WebKit::StorageToWebProcessConnection::removeSWServerConnection):
2939         (WebKit::generateIDBConnectionToServerIdentifier):
2940         (WebKit::StorageToWebProcessConnection::establishIDBConnectionToServer):
2941         * StorageProcess/StorageToWebProcessConnection.h:
2942         * StorageProcess/StorageToWebProcessConnection.messages.in:
2943         * WebProcess/Storage/WebSWClientConnection.cpp:
2944         (WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope):
2945         * WebProcess/Storage/WebSWClientConnection.h:
2946         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2947         (WebKit::WebSWContextManagerConnection::startFetch):
2948         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerGlobalScope):
2949         * WebProcess/Storage/WebSWContextManagerConnection.h:
2950         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
2951         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
2952         (WebKit::WebServiceWorkerFetchTaskClient::WebServiceWorkerFetchTaskClient):
2953         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:
2954         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
2955         (WebKit::WebToStorageProcessConnection::didReceiveMessage):
2956         (WebKit::WebToStorageProcessConnection::serviceWorkerConnectionForSession):
2957         * WebProcess/Storage/WebToStorageProcessConnection.h:
2958
2959 2017-11-17  John Wilander  <wilander@apple.com>
2960
2961         Storage Access API: UI process should update network process about granted access
2962         https://bugs.webkit.org/show_bug.cgi?id=176943
2963         <rdar://problem/34440612>
2964
2965         Reviewed by Alex Christensen.
2966
2967         * NetworkProcess/NetworkProcess.cpp:
2968         (WebKit::NetworkProcess::updateStorageAccessForPrevalentDomains):
2969             Updates storage access on the session.
2970         * NetworkProcess/NetworkProcess.h:
2971         * NetworkProcess/NetworkProcess.messages.in:
2972         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2973         (WebKit::NetworkProcessCreationParameters::encode const):
2974         (WebKit::NetworkProcessCreationParameters::decode):
2975         * NetworkProcess/NetworkProcessCreationParameters.h:
2976         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2977         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
2978         (WebKit::NetworkProcess::setStorageAccessAPIEnabled):
2979         * UIProcess/API/C/WKCookieManager.cpp:
2980         (WKCookieManagerSetStorageAccessAPIEnabled):
2981         * UIProcess/API/C/WKCookieManager.h:
2982         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2983         (WKWebsiteDataStoreSetStatisticsHasHadNonRecentUserInteraction):
2984         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
2985         * UIProcess/API/Cocoa/WKProcessPool.mm:
2986         (-[WKProcessPool _isStorageAccessAPIEnabled]):
2987         (-[WKProcessPool _setStorageAccessAPIEnabled:]):
2988         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2989         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2990         (-[WKWebsiteDataStore _resourceLoadStatisticsSetHasHadNonRecentUserInteractionForHost:]):
2991             Test infrastructure.
2992         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
2993         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2994         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2995         (WebKit::WebProcessPool::setStorageAccessAPIEnabled):
2996         * UIProcess/Network/NetworkProcessProxy.cpp:
2997         (WebKit::nextRequestStorageAccessContextId):
2998         (WebKit::NetworkProcessProxy::updateStorageAccessForPrevalentDomains):
2999             Sends a message to the network process to update storage access.
3000         (WebKit::NetworkProcessProxy::storageAccessRequestResult):
3001             Receives a message from the network process that storage access
3002             was updated.
3003         * UIProcess/Network/NetworkProcessProxy.h:
3004         * UIProcess/Network/NetworkProcessProxy.messages.in:
3005         * UIProcess/WebCookieManagerProxy.cpp:
3006         (WebKit::WebCookieManagerProxy::setStorageAccessAPIEnabled):
3007         * UIProcess/WebCookieManagerProxy.h:
3008         * UIProcess/WebProcessPool.h:
3009         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3010         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
3011         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
3012         (WebKit::WebResourceLoadStatisticsStore::logNonRecentUserInteraction):
3013             Test infrastructure.
3014         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
3015             Now makes the API call even if the only operation is to clear first.
3016         * UIProcess/WebResourceLoadStatisticsStore.h:
3017         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3018         (WebKit::WebsiteDataStore::updateStorageAccessForPrevalentDomainsHandler):
3019             Propagates the storage access directive to the network process proxy.
3020         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
3021         * UIProcess/WebsiteData/WebsiteDataStore.h:
3022
3023 2017-11-16  Yousuke Kimoto  <yousuke.kimoto@sony.com>
3024
3025         [WinCairo] Add network (curl) files for wincairo webkit
3026         https://bugs.webkit.org/show_bug.cgi?id=179474
3027
3028         Reviewed by Alex Christensen.
3029
3030         * Shared/curl/WebCoreArgumentCodersCurl.cpp:
3031         (IPC::ArgumentCoder<CertificateInfo>::decode): Fidex return value since currently no operation is needed for wincairo webkit.
3032         (IPC::ArgumentCoder<ResourceError>::decodePlatformData): Fidex return value since currently no operation is needed for wincairo webkit.
3033         * WebProcess/WebCoreSupport/curl/WebFrameNetworkingContext.cpp: Renamed from Source/WebKit/WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.cpp.
3034         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
3035         * WebProcess/WebCoreSupport/curl/WebFrameNetworkingContext.h: Renamed from Source/WebKit/WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.h.
3036
3037 2017-11-16  Don Olmstead  <don.olmstead@sony.com>
3038
3039         [WinCairo] Update WinCairoRequirements
3040         https://bugs.webkit.org/show_bug.cgi?id=179790
3041
3042         Reviewed by Alex Christensen.
3043
3044         * PlatformWin.cmake:
3045
3046 2017-11-16  Youenn Fablet  <youenn@apple.com>
3047
3048         Service Worker should get the body of intercepted requests
3049         https://bugs.webkit.org/show_bug.cgi?id=179776
3050
3051         Reviewed by Alex Christensen.
3052
3053         Pass a FormDataReference when starting fetch IPC.
3054         Convert this FormDataReference in a FormData and using it to set the FetchRequest body properly in Service Worker process.
3055         Forbid fetch interception when URL is not HTTP/HTTPS.
3056
3057         * Platform/IPC/FormDataReference.h:
3058         (IPC::FormDataReference::FormDataReference):
3059         (IPC::FormDataReference::takeData):
3060         (IPC::FormDataReference::encode const):
3061         (IPC::FormDataReference::decode):
3062         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3063         (WebKit::WebSWServerConnection::startFetch):
3064         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
3065         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
3066         * WebProcess/Storage/WebSWClientConnection.cpp:
3067         (WebKit::WebSWClientConnection::startFetch):
3068         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
3069         (WebKit::WebSWContextManagerConnection::startFetch):
3070         * WebProcess/Storage/WebSWContextManagerConnection.h:
3071         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
3072         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
3073         (WebKit::WebServiceWorkerProvider::handleFetch):
3074
3075 2017-11-16  Daniel Bates  <dabates@apple.com>
3076
3077         Add feature define for alternative presentation button element
3078         https://bugs.webkit.org/show_bug.cgi?id=179692
3079         Part of <rdar://problem/34917108>
3080
3081         Reviewed by Andy Estes.
3082
3083         Only enabled on Cocoa platforms by default.
3084
3085         * Configurations/FeatureDefines.xcconfig:
3086
3087 2017-11-16  Chris Dumez  <cdumez@apple.com>
3088
3089         [Service Worker] Implement "Try Clear Registration" algorithm
3090         https://bugs.webkit.org/show_bug.cgi?id=179791
3091
3092         Reviewed by Youenn Fablet.
3093
3094         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
3095         * WebProcess/Storage/WebSWClientConnection.cpp:
3096         (WebKit::WebSWClientConnection::serviceWorkerStartedControllingClient):
3097         (WebKit::WebSWClientConnection::serviceWorkerStoppedControllingClient):
3098         * WebProcess/Storage/WebSWClientConnection.h:
3099
3100 2017-11-16  Michael Catanzaro  <mcatanzaro@igalia.com>
3101
3102         REGRESSION(r224179): layer flush now requires sync IPC to compute undo/redo availability in EditorState
3103         https://bugs.webkit.org/show_bug.cgi?id=179797
3104
3105         Reviewed by Simon Fraser.
3106
3107         r224179 introduced a performance regression. The newly-added code in WebPage::editorState is
3108         part of a performance-critical path. (The editor state is computed and sent to the UI
3109         process during the layer flush.) Calls to Editor::canUndo and Editor::canRedo were added,
3110         but these calls are both implemented with sync IPC calls to WebPageProxy in the UI process.
3111         WebPageProxy passes them along to PageClientImpl to compute the availability of the
3112         commands.
3113
3114         That's all pointless because this code only exists for the purpose of getting editing
3115         command availability to the UI process. In the case of undo and redo, it's not needed at
3116         all. I did not realize that when writing the code. So canUndo and canRedo should be removed
3117         from EditorState. This ought to be sufficient to avoid the perf regression.
3118
3119         No changes are needed to the GTK/WPE WebKitEditorState API. The API is reimplemented using
3120         WebPageProxy::canUndoRedo instead of EditorState. There should be no changes in behavior,
3121         only performance.
3122
3123         * Shared/EditorState.cpp:
3124         (WebKit::EditorState::PostLayoutData::encode const):
3125         (WebKit::EditorState::PostLayoutData::decode):
3126         * Shared/EditorState.h:
3127         * UIProcess/API/glib/WebKitEditorState.cpp:
3128         (webkitEditorStateCreate):
3129         (webkitEditorStateChanged):
3130         * UIProcess/API/glib/WebKitEditorStatePrivate.h:
3131         * UIProcess/API/glib/WebKitWebView.cpp:
3132         (webkit_web_view_get_editor_state):
3133         * UIProcess/WebPageProxy.cpp:
3134         (WebKit::WebPageProxy::canUndo):
3135         (WebKit::WebPageProxy::canRedo):
3136         * UIProcess/WebPageProxy.h:
3137         * WebProcess/WebPage/WebPage.cpp:
3138         (WebKit::WebPage::editorState const):
3139
3140 2017-11-16  Megan Gardner  <megan_gardner@apple.com>
3141
3142         Remove allowBlockSelection as block selection is not supported anymore
3143         https://bugs.webkit.org/show_bug.cgi?id=179738
3144
3145         Reviewed by Tim Horton.
3146
3147         Remove all instances of the alloweBlockSelection flag. Blocks selection is fully disabled
3148         and thus this flag will do nothing. This was only added as a debug measure last year, and nothing
3149         ever actually used it.
3150
3151         * Shared/WebPageCreationParameters.cpp:
3152         (WebKit::WebPageCreationParameters::encode const):
3153         (WebKit::WebPageCreationParameters::decode):
3154         * Shared/WebPageCreationParameters.h:
3155         * UIProcess/API/Cocoa/WKWebView.mm:
3156         (-[WKWebView _allowsBlockSelection]): Deleted.
3157         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3158         (-[WKWebViewConfiguration init]):
3159         (-[WKWebViewConfiguration copyWithZone:]):
3160         (-[WKWebViewConfiguration _allowsBlockSelection]): Deleted.
3161         (-[WKWebViewConfiguration _setAllowsBlockSelection:]): Deleted.
3162         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
3163         * UIProcess/API/Cocoa/WKWebViewInternal.h:
3164         * UIProcess/PageClient.h:
3165         * UIProcess/WebPageProxy.cpp:
3166         (WebKit::WebPageProxy::creationParameters):
3167         * UIProcess/ios/PageClientImplIOS.h:
3168         * UIProcess/ios/PageClientImplIOS.mm:
3169         (WebKit::PageClientImpl::allowsBlockSelection): Deleted.
3170         * WebProcess/WebPage/WebPage.cpp:
3171         * WebProcess/WebPage/WebPage.h:
3172
3173 2017-11-16  Brent Fulgham  <bfulgham@apple.com>
3174
3175         Whitelist additional IOKit properties based on customer feedback
3176         https://bugs.webkit.org/show_bug.cgi?id=179782
3177         <rdar://problem/35508246>
3178
3179         Reviewed by Dean Jackson.
3180
3181         Expand the IOKit property whitelist to recognize a few more properties as valid based on review of logs
3182         from customer systems and our test infrastructure.
3183
3184         * WebProcess/com.apple.WebProcess.sb.in:
3185
3186 2017-11-15  Brady Eidson  <beidson@apple.com>
3187
3188         Implement basics of "Terminate Service Worker" algorithm.
3189         https://bugs.webkit.org/show_bug.cgi?id=179551
3190
3191         Reviewed by Chris Dumez.
3192
3193         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
3194         (WebKit::WebSWServerToContextConnection::terminateWorker):
3195         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
3196         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
3197
3198         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
3199         (WebKit::WebSWContextManagerConnection::terminateWorker):
3200         (WebKit::WebSWContextManagerConnection::workerTerminated):
3201         * WebProcess/Storage/WebSWContextManagerConnection.h:
3202         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
3203
3204 2017-11-15  Brent Fulgham  <bfulgham@apple.com>
3205
3206         Remove access to 'com.apple.mediaaccessibility.public' preferences in WebContent sandbox
3207         https://bugs.webkit.org/show_bug.cgi?id=179747
3208         <rdar://problem/35367346>
3209
3210         Reviewed by Dean Jackson.
3211
3212         The 'mediaaccessibilityd' process handles access to MediaAccessibility preferences. We don't need
3213         to grant the WebContent Process sandbox access to them.
3214
3215         * WebProcess/com.apple.WebProcess.sb.in: 
3216
3217 2017-11-15  Alex Christensen  <achristensen@webkit.org>
3218
3219         Revert r224885
3220         https://bugs.webkit.org/show_bug.cgi?id=179719
3221
3222         * UIProcess/API/APIContentRuleListStore.cpp:
3223         (API::compiledToFile):
3224         r224885 was a speculative fix that did not fix anything on the bots.
3225
3226 2017-11-15  Brent Fulgham  <bfulgham@apple.com>
3227
3228         Unreviewed build fix after r224830.
3229
3230         * WebProcess/com.apple.WebProcess.sb.in: Add missing sysctl-read permissions needed
3231         to support testing on Mac Mini hardware.
3232
3233 2017-11-15  Youenn Fablet  <youenn@apple.com>
3234
3235         Add ServiceWorker to WebProcess plumbery for FormData fetch responses
3236         https://bugs.webkit.org/show_bug.cgi?id=179694
3237
3238         Reviewed by Alex Christensen.
3239
3240         Added plumbery from Service Worker up to Web Process to pass form data response bodies.
3241         A follow-up patch should read the data from Network Process and send it to the ResourceLoader.
3242
3243         * Platform/IPC/FormDataReference.h: Added.
3244         (IPC::FormDataReference::FormDataReference):
3245         (IPC::FormDataReference::takeData):
3246         (IPC::FormDataReference::encode const):
3247         (IPC::FormDataReference::decode):
3248         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3249         (WebKit::WebSWServerConnection::didReceiveFetchFormData):
3250         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
3251         * StorageProcess/StorageProcess.cpp:
3252         (WebKit::StorageProcess::didReceiveFetchFormData):
3253         * StorageProcess/StorageProcess.h:
3254         * StorageProcess/StorageProcess.messages.in:
3255         * WebKit.xcodeproj/project.pbxproj:
3256         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
3257         (WebKit::ServiceWorkerClientFetch::didReceiveFormData):
3258         * WebProcess/Storage/ServiceWorkerClientFetch.h:
3259         * WebProcess/Storage/ServiceWorkerClientFetch.messages.in:
3260         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
3261         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveFormData):
3262         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:
3263
3264 2017-11-15  Alex Christensen  <achristensen@webkit.org>
3265
3266         Move a compiled WKContentRuleList to its destination before calling mmap
3267         https://bugs.webkit.org/show_bug.cgi?id=179719
3268
3269         Reviewed by Brady Eidson.
3270
3271         Right now we compile a WKContentRuleList to a temporary file, call mmap, close the file, then move it.
3272         Sometimes, especially on bots running tests, the move fails because the temporary file doesn't exist
3273         any more.  Moving the file before mmaping and closing the file might prevent this failure.
3274
3275         * UIProcess/API/APIContentRuleListStore.cpp:
3276         (API::compiledToFile):
3277
3278 2017-11-15  Chris Dumez  <cdumez@apple.com>
3279
3280         [Service Workers] Implement Client API
3281         https://bugs.webkit.org/show_bug.cgi?id=179709
3282
3283         Reviewed by Alex Christensen.
3284
3285         * Shared/WebCoreArgumentCoders.cpp:
3286         * Shared/WebCoreArgumentCoders.h:
3287         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3288         (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope):
3289         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
3290         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
3291         * WebProcess/Storage/WebSWClientConnection.cpp:
3292         (WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope):
3293         * WebProcess/Storage/WebSWClientConnection.h:
3294         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
3295         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerGlobalScope):
3296         * WebProcess/Storage/WebSWContextManagerConnection.h:
3297         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
3298
3299 2017-11-15  Ryan Haddad  <ryanhaddad@apple.com>
3300
3301         Unreviewed, rolling out r224863.
3302
3303         Introduced LayoutTest crashes on iOS Simulator.
3304
3305         Reverted changeset:
3306
3307         "Move JSONValues to WTF and convert uses of InspectorValues.h
3308         to JSONValues.h"
3309         https://bugs.webkit.org/show_bug.cgi?id=173793
3310         https://trac.webkit.org/changeset/224863
3311
3312 2017-11-14  Brent Fulgham  <bfulgham@apple.com>
3313
3314         Remove access to "com.apple.pbs.fetch_services" from WebContent sandbox
3315         https://bugs.webkit.org/show_bug.cgi?id=179689
3316         <rdar://problem/35369172>
3317
3318         Reviewed by Per Arne Vollan.
3319
3320         WebKit's WebContent process should not have any need to interact with the fetch_services
3321         API exposed to the system. These interactions (if needed) should be happening in the UIProcess,
3322         so we should prevent the untrusted Web Content Process from being able to connect.
3323
3324         * WebProcess/com.apple.WebProcess.sb.in:
3325
3326 2017-11-15  Michael Catanzaro  <mcatanzaro@igalia.com>
3327
3328         Remove GTK web inspector images
3329         https://bugs.webkit.org/show_bug.cgi?id=179716
3330
3331         Reviewed by Carlos Garcia Campos.
3332
3333         * InspectorGResources.cmake:
3334
3335 2017-11-15  Gabriel Ivascu  <givascu@igalia.com>
3336
3337         [GTK] Automatically adjust font size when gtk-xft-dpi changes
3338         https://bugs.webkit.org/show_bug.cgi?id=142673
3339
3340         Some follow-up fixes for the previous patch.
3341
3342         Reviewed by Carlos Garcia Campos.
3343
3344         * UIProcess/API/glib/WebKitSettings.cpp:
3345         (webKitSettingsDispose):
3346         (webKitSettingsConstructed):
3347
3348 2017-11-14  Nan Wang  <n_wang@apple.com>
3349
3350         AX: AOM: Implement AccessibleNode class and support label and role attributes
3351         https://bugs.webkit.org/show_bug.cgi?id=179494
3352
3353         Reviewed by Ryosuke Niwa.
3354
3355         * Shared/WebPreferences.yaml:
3356         * UIProcess/API/C/WKPreferences.cpp:
3357         (WKPreferencesSetAccessibilityObjectModelEnabled):
3358         (WKPreferencesGetAccessibilityObjectModelEnabled):
3359         * UIProcess/API/C/WKPreferencesRefPrivate.h:
3360
3361 2017-11-14  Carlos Garcia Campos  <cgarcia@igalia.com>
3362
3363         Move JSONValues to WTF and convert uses of InspectorValues.h to JSONValues.h
3364         https://bugs.webkit.org/show_bug.cgi?id=173793
3365
3366         Reviewed by Brian Burg.
3367
3368         Based on patch by Brian Burg.
3369
3370         * UIProcess/Automation/WebAutomationSession.cpp:
3371         (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext):
3372         (WebKit::WebAutomationSession::moveWindowOfBrowsingContext):
3373         (WebKit::WebAutomationSession::waitForNavigationToCompleteOnPage):
3374         (WebKit::WebAutomationSession::waitForNavigationToCompleteOnFrame):
3375         (WebKit::WebAutomationSession::respondToPendingPageNavigationCallbacksWithTimeout):
3376         (WebKit::WebAutomationSession::respondToPendingFrameNavigationCallbacksWithTimeout):
3377         (WebKit::WebAutomationSession::navigationOccurredForFrame):
3378         (WebKit::WebAutomationSession::documentLoadedForFrame):
3379         (WebKit::WebAutomationSession::inspectorFrontendLoaded):
3380         (WebKit::WebAutomationSession::keyboardEventsFlushedForPage):
3381         (WebKit::WebAutomationSession::evaluateJavaScriptFunction):
3382         (WebKit::WebAutomationSession::setFilesToSelectForFileUpload):
3383         (WebKit::WebAutomationSession::addSingleCookie):
3384         (WebKit::WebAutomationSession::setSessionPermissions):
3385         (WebKit::WebAutomationSession::performMouseInteraction):
3386         (WebKit::WebAutomationSession::performKeyboardInteractions):
3387         * UIProcess/Automation/WebAutomationSession.h:
3388
3389 2017-11-14  Chris Dumez  <cdumez@apple.com>
3390
3391         [Service Workers] Implement container.getRegistrations()
3392         https://bugs.webkit.org/show_bug.cgi?id=179672
3393
3394         Reviewed by Brady Eidson.
3395
3396         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3397         (WebKit::WebSWServerConnection::getRegistrations):
3398         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
3399         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
3400         * WebProcess/Storage/WebSWClientConnection.cpp:
3401         (WebKit::WebSWClientConnection::didGetRegistrations):
3402         (WebKit::WebSWClientConnection::getRegistrations):
3403         * WebProcess/Storage/WebSWClientConnection.h:
3404         * WebProcess/Storage/WebSWClientConnection.messages.in:
3405
3406 2017-11-14  Youenn Fablet  <youenn@apple.com>
3407
3408         Implement ServiceWorker handle fetch for navigation loads
3409         https://bugs.webkit.org/show_bug.cgi?id=179404
3410
3411         Reviewed by Alex Christensen and Chris Dumez.
3412
3413         Update handle fetch algorithm to support navigation requests.
3414         In case of navigation requests, set service worker response mime type to text/html if none is provided.
3415
3416         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
3417         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
3418         * WebProcess/Storage/WebSWClientConnection.cpp:
3419         (WebKit::WebSWClientConnection::startFetch):
3420         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
3421         (WebKit::shouldHandleFetch):
3422         (WebKit::WebServiceWorkerProvider::handleFetch):
3423
3424 2017-11-14  Alex Christensen  <achristensen@webkit.org>
3425
3426         Remove Cocoa CFURLConnection loading code
3427         https://bugs.webkit.org/show_bug.cgi?id=179688
3428
3429         Reviewed by Antti Koivisto.
3430
3431         * NetworkProcess/Downloads/Download.h:
3432
3433 2017-11-14  Daniel Bates  <dabates@apple.com>
3434
3435         Update comment in FeatureDefines.xcconfig to reflect location of Visual Studio property files
3436         for feature defines
3437
3438         Following r195498 and r201917 the Visual Studio property files for feature defines have
3439         moved from directory WebKitLibraries/win/tools/vsprops to directory Source/cmake/tools/vsprops.
3440         Update the comment in FeatureDefines.xcconfig to reflect the new location and names of these
3441         files.
3442
3443         * Configurations/FeatureDefines.xcconfig:
3444
3445 2017-11-14  Brent Fulgham  <bfulgham@apple.com>
3446
3447         Whitelist some IOKIt properties to avoid sandbox violations on YouTube
3448         https://bugs.webkit.org/show_bug.cgi?id=179683
3449         <rdar://problem/35415368>
3450
3451         Reviewed by Dean Jackson.
3452
3453         YouTube video playback on some hardware (and some video encodings) generates sandbox violations. Add
3454         whitelist entries for the relevant IOKit properties needed to support these activities.
3455
3456         * WebProcess/com.apple.WebProcess.sb.in:
3457
3458 2017-11-14  Daniel Bates  <dabates@apple.com>
3459
3460         Mark WebChromeClient::requestStorageAccess() as final
3461         https://bugs.webkit.org/show_bug.cgi?id=179673
3462
3463         Reviewed by Sam Weinig.
3464
3465         Mark WebChromeClient::requestStorageAccess() as final so that it overrides the virtual function
3466         in ChromeClient with the same name and hence we actually call it through a ChromeClient pointer.
3467
3468         * WebProcess/WebCoreSupport/WebChromeClient.h:
3469
3470 2017-11-14  Youenn Fablet  <youenn@apple.com>
3471
3472         WebSWClientConnection should do IPC to StorageProcess if its WebSWOriginTable is not yet initialized
3473         https://bugs.webkit.org/show_bug.cgi?id=179668
3474
3475         Reviewed by Chris Dumez.
3476
3477         There may be cases where the origin table is not initialized and we would think there is no service worker registration.
3478         In such a case, we should go to the StorageProcess.
3479         StorageProcess is now sending an IPC message back to each registered SW connection so that WebProcess will know whether its map
3480         is correctly initialized or not.
3481
3482         Renaming hasServiceWorkerRegisteredForOrigin in mayHaveServiceWorkerRegisteredForOrigin.
3483
3484         * WebProcess/Storage/WebSWClientConnection.cpp:
3485         (WebKit::WebSWClientConnection::mayHaveServiceWorkerRegisteredForOrigin const):
3486         (WebKit::WebSWClientConnection::matchRegistration):
3487         (WebKit::WebSWClientConnection::hasServiceWorkerRegisteredForOrigin const): Deleted.
3488         * WebProcess/Storage/WebSWClientConnection.h:
3489         * WebProcess/Storage/WebSWOriginTable.h:
3490         (WebKit::WebSWOriginTable::isInitialized const):
3491         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
3492         (WebKit::shouldHandleFetch):
3493
3494 2017-11-14  Brent Fulgham  <bfulgham@apple.com>
3495
3496         Consolidate sysctl-read rules in WebProcess sandbox
3497         https://bugs.webkit.org/show_bug.cgi?id=179674
3498         <rdar://problem/35367154>
3499
3500         Reviewed by Dean Jackson.
3501
3502         Consolidate the various calls to 'allow sysctl-read' imported during Bug 179548 into
3503         the main function in the sandbox profile.
3504
3505         Remove the statement to grant global sysctl-read permissions that was copied into this
3506         sandbox profile in an earlier checkin. We started blocking the blanket read permissions in
3507         macOS 10.13, and want to continue to do so.
3508         
3509         The earlier "grant global read access" in 'system.sb' apparently allowed some sysctl reads
3510         to occur before we hit the block declaration in the WebContent sandbox. Now that we are
3511         consistently blocking systcl reads from the start, we need to add whitelist entries for a
3512         few more entries to avoid creating new sandbox violations.
3513
3514         * WebProcess/com.apple.WebProcess.sb.in:
3515
3516 2017-11-14  Alex Christensen  <achristensen@webkit.org>
3517
3518         Remove WebKit CFURLConnection code
3519         https://bugs.webkit.org/show_bug.cgi?id=179645
3520
3521         Reviewed by Alexey Proskuryakov.
3522
3523         The CFURLConnection code is Windows-specific now. Nobody can use it in modern WebKit.
3524
3525         * NetworkProcess/Downloads/Download.h:
3526         * NetworkProcess/Downloads/mac/DownloadMac.mm:
3527         * NetworkProcess/NetworkLoad.h:
3528         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3529         (WebKit::serverTrustCredential):
3530         * NetworkProcess/mac/NetworkLoadMac.mm:
3531         * Shared/Authentication/AuthenticationManager.cpp:
3532         (WebKit::AuthenticationManager::useCredentialForSingleChallenge):
3533         (WebKit::AuthenticationManager::continueWithoutCredentialForSingleChallenge):
3534         (WebKit::AuthenticationManager::cancelSingleChallenge):
3535         (WebKit::AuthenticationManager::performDefaultHandlingForSingleChallenge):
3536         (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge):
3537         * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
3538         * Shared/Authentication/mac/AuthenticationManager.mac.mm:
3539         (WebKit::AuthenticationManager::tryUseCertificateInfoForChallenge):
3540         * Shared/WebProcessCreationParameters.cpp:
3541         (WebKit::WebProcessCreationParameters::encode const):
3542         (WebKit::WebProcessCreationParameters::decode):
3543         * Shared/WebProcessCreationParameters.h:
3544         * Shared/mac/WebCoreArgumentCodersMac.mm:
3545         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
3546         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
3547         * config.h:
3548
3549 2017-11-14  Alex Christensen  <achristensen@webkit.org>
3550
3551         Remove assertions added in r224791
3552         https://bugs.webkit.org/show_bug.cgi?id=178751#c10
3553
3554         * NetworkProcess/mac/RemoteNetworkingContext.mm:
3555         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
3556         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
3557         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
3558         I had added assertions that sandbox extension handle consumption succeeds.
3559         In the API test IndexedDB.StructuredCloneBackwardCompatibility we get a sandbox extension handle
3560         to give access to a directory that does not exist and consumption fails.  We want it to fail,
3561         so my optimistic addition of a success assertion was incorrect.  The test passes without it
3562         and behaves like it used to.
3563
3564 2017-11-14  Tim Horton  <timothy_horton@apple.com>
3565
3566         Don't use -[NSString stringWithFormat:] to build defaults keys
3567         https://bugs.webkit.org/show_bug.cgi?id=179680
3568
3569         Reviewed by Simon Fraser.
3570
3571         * UIProcess/mac/WebPreferencesMac.mm:
3572         (WebKit::makeKey):
3573         (WebKit::debugUserDefaultsValue):
3574         Use string concatenation instead of stringWithFormat to build
3575         preference keys. This wasn't a huge cost, but it shaves a few milliseconds
3576         off process launch.
3577
3578 2017-11-14  Alex Christensen  <achristensen@webkit.org>
3579
3580         Clean up old URL parser remnants
3581         https://bugs.webkit.org/show_bug.cgi?id=179573
3582
3583         Reviewed by Darin Adler.
3584
3585         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
3586         (WebKit::WebContextMenuClient::searchWithGoogle):
3587         Use https if we do end up searching with google.
3588
3589 2017-11-14  Antti Koivisto  <antti@apple.com>
3590
3591         Enable display:contents by default
3592         https://bugs.webkit.org/show_bug.cgi?id=179655
3593
3594         Reviewed by Sam Weinig.
3595
3596         * Shared/WebPreferences.yaml:
3597
3598         Make non-experimental and enabled.
3599
3600 2017-11-10  Brent Fulgham  <bfulgham@apple.com>
3601
3602         Consolidate mach-lookup calls in WebProcess sandbox
3603         https://bugs.webkit.org/show_bug.cgi?id=179650
3604         <rdar://problem/35367154>
3605
3606         Reviewed by Dean Jackson.
3607
3608         Consolidate the various calls to 'allow mach-lookup' imported during Bug 179548 into the main
3609         function in the sandbox profile. Remove some entries that are not needed by WebKit.
3610
3611         Remove the statement to grant global permission to perform mach-lookup for any xpc
3612         service name that was copied into this sandbox profile in Bug 179548. We started blocking
3613         this in macOS 10.13 and want to continue to do so.
3614         
3615         The earlier "grant global permission" in 'system.sb' apparently allowed some xpc lookups to occur
3616         before we hit the block declaration in the WebContent sandbox. Now that we are consistently blocking
3617         mach lookups we need to add whitelist entries for a few more services to avoid creating new
3618         sandbox violations.
3619
3620         * WebProcess/com.apple.WebProcess.sb.in:
3621
3622 2017-11-14  Tim Horton  <timothy_horton@apple.com>
3623
3624         Long pressing a phone number with spaces in it results in a link sheet instead of a data detectors sheet
3625         https://bugs.webkit.org/show_bug.cgi?id=179646
3626         <rdar://problem/35337288>
3627
3628         Reviewed by Simon Fraser.
3629
3630         * UIProcess/ios/WKActionSheetAssistant.mm:
3631         (-[WKActionSheetAssistant showImageSheet]):
3632         (-[WKActionSheetAssistant showLinkSheet]):
3633         (-[WKActionSheetAssistant showDataDetectorsSheet]):
3634         * UIProcess/ios/WKContentViewInteraction.mm:
3635         (-[WKContentView _actionForLongPressFromPositionInformation:]):
3636         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
3637         Make use of canBePresentedByDataDetectors with our WebCore URL instead
3638         of (sometimes unsucessfully) reparsing the URL with NSURL's parser.
3639         Also, avoid a few unnecessary round-trips through String when converting
3640         from URL to NSURL.
3641
3642 2017-11-14  Brent Fulgham  <bfulgham@apple.com>
3643
3644         REGRESSION(r224799): WebKit crashes on Sierra due to sandbox violation
3645         https://bugs.webkit.org/show_bug.cgi?id=179656
3646         
3647         Unreviewed build fix.
3648
3649         * WebProcess/com.apple.WebProcess.sb.in: Switch to Dan's recommended version check.
3650
3651 2017-11-13  Joseph Pecoraro  <pecoraro@apple.com>
3652
3653         Give a ServiceWorker WebContentProcess a different display name
3654         https://bugs.webkit.org/show_bug.cgi?id=179653
3655
3656         Reviewed by Brady Eidson.
3657
3658         * UIProcess/WebProcessProxy.h:
3659         * UIProcess/WebProcessProxy.cpp:
3660         (WebKit::WebProcessProxy::create):
3661         Call connect after construction so virtual methods will use subclass implementations.
3662
3663         * UIProcess/ServiceWorkerProcessProxy.h:
3664         * UIProcess/ServiceWorkerProcessProxy.cpp:
3665         (WebKit::ServiceWorkerProcessProxy::create):
3666         Copy the pattern from WebProcessProxy to ensure connect() gets called after construction.
3667
3668         (WebKit::ServiceWorkerProcessProxy::getLaunchOptions):
3669         Set a launch option to signal this is a Service Worker process.
3670
3671         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
3672         (WebKit::XPCServiceInitializerDelegate::getExtraInitializationData):
3673         * WebProcess/cocoa/WebProcessCocoa.mm:
3674         (WebKit::WebProcess::initializeProcessName):
3675         Consume the launch option to configuration the process name.
3676
3677 2017-11-13  Ryosuke Niwa  <rniwa@webkit.org>
3678
3679         REGRESSION(r224799): WebKit crashes at launch on macOS Sierra due to a sandbox violation
3680         https://bugs.webkit.org/show_bug.cgi?id=179656
3681
3682         Unreviewed. Revert r224799 on macOS Sierra.
3683
3684         * WebProcess/com.apple.WebProcess.sb.in:
3685
3686 2017-11-13  Chris Dumez  <cdumez@apple.com>
3687
3688         Send ServiceWorkerData structs to the WebProcesses instead of ServiceWorkerIdentifiers
3689         https://bugs.webkit.org/show_bug.cgi?id=179649
3690
3691         Reviewed by Brady Eidson.
3692
3693         * Shared/WebCoreArgumentCoders.h:
3694         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3695         (WebKit::WebSWServerConnection::updateRegistrationStateInClient):
3696         (WebKit::WebSWServerConnection::postMessageToServiceWorkerClient):
3697         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
3698         * WebProcess/Storage/WebSWClientConnection.cpp:
3699         (WebKit::WebSWClientConnection::postMessageToServiceWorkerClient):
3700         * WebProcess/Storage/WebSWClientConnection.h:
3701         * WebProcess/Storage/WebSWClientConnection.messages.in:
3702
3703 2017-11-13  Brady Eidson  <beidson@apple.com>
3704
3705         Massive "Server-process-to-context-process" connection overhaul.
3706         https://bugs.webkit.org/show_bug.cgi?id=179554
3707
3708         Reviewed by Chris Dumez.
3709
3710         * DerivedSources.make:
3711         * WebKit.xcodeproj/project.pbxproj:
3712
3713         * Shared/WebCoreArgumentCoders.h:
3714
3715         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3716         (WebKit::WebSWServerConnection::sendToContextProcess):
3717         (WebKit::WebSWServerConnection::installServiceWorkerContext): Deleted.
3718         (WebKit::WebSWServerConnection::fireInstallEvent): Deleted.
3719         (WebKit::WebSWServerConnection::fireActivateEvent): Deleted.
3720         (WebKit::WebSWServerConnection::setContextConnection): Deleted.
3721         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
3722
3723         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp: Copied from Source/WebCore/workers/service/server/SWServerWorker.cpp.
3724         (WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
3725         (WebKit::WebSWServerToContextConnection::messageSenderConnection):
3726         (WebKit::WebSWServerToContextConnection::messageSenderDestinationID):
3727         (WebKit::WebSWServerToContextConnection::connectionClosed):
3728         (WebKit::WebSWServerToContextConnection::installServiceWorkerContext):
3729         (WebKit::WebSWServerToContextConnection::fireInstallEvent):
3730         (WebKit::WebSWServerToContextConnection::fireActivateEvent):
3731         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h: Copied from Source/WebCore/workers/service/ServiceWorkerTypes.h.
3732         (WebKit::WebSWServerToContextConnection::create):
3733         (WebKit::WebSWServerToContextConnection::ipcConnection const):
3734         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in: Copied from Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.messages.in.
3735
3736         * StorageProcess/StorageProcess.cpp:
3737         (WebKit::StorageProcess::didClose):
3738         (WebKit::StorageProcess::didReceiveMessage):
3739         (WebKit::StorageProcess::globalServerToContextConnection):
3740         (WebKit::StorageProcess::createServerToContextConnection):
3741         (WebKit::StorageProcess::didGetWorkerContextProcessConnection):
3742         (WebKit::StorageProcess::workerContextProcessConnection): Deleted.
3743         (WebKit::StorageProcess::createWorkerContextProcessConnection): Deleted.
3744         (WebKit::StorageProcess::serviceWorkerContextFailedToStart): Deleted.
3745         (WebKit::StorageProcess::serviceWorkerContextStarted): Deleted.
3746         (WebKit::StorageProcess::didFinishServiceWorkerInstall): Deleted.
3747         (WebKit::StorageProcess::didFinishServiceWorkerActivation): Deleted.
3748         (WebKit::StorageProcess::setServiceWorkerHasPendingEvents): Deleted.
3749         * StorageProcess/StorageProcess.h:
3750         * StorageProcess/StorageProcess.messages.in:
3751
3752         * StorageProcess/StorageToWebProcessConnection.cpp:
3753         (WebKit::StorageToWebProcessConnection::didReceiveMessage):
3754         (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
3755         (WebKit::StorageToWebProcessConnection::workerContextProcessConnectionCreated):
3756
3757         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
3758         (WebKit::WebSWContextManagerConnection::installServiceWorker):
3759         (WebKit::WebSWContextManagerConnection::serviceWorkerStartedWithMessage):
3760         (WebKit::WebSWContextManagerConnection::fireInstallEvent):
3761         (WebKit::WebSWContextManagerConnection::fireActivateEvent):
3762         (WebKit::WebSWContextManagerConnection::didFinishInstall):
3763         (WebKit::WebSWContextManagerConnection::didFinishActivation):
3764         (WebKit::WebSWContextManagerConnection::setServiceWorkerHasPendingEvents):
3765         * WebProcess/Storage/WebSWContextManagerConnection.h:
3766         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
3767
3768 2017-11-13  Brent Fulgham  <bfulgham@apple.com>
3769
3770         WebContent sandbox should not include 'system.sb'
3771         https://bugs.webkit.org/show_bug.cgi?id=179548
3772         <rdar://problem/35367154>
3773
3774         Reviewed by Darin Adler.
3775
3776         Stop including 'system.sb', and just include the portions of that sandbox that we
3777         actually use in WebContent Process. This is the first step in some further sandbox
3778         tightening.
3779
3780         * WebProcess/com.apple.WebProcess.sb.in:
3781
3782 2017-11-13  Simon Fraser  <simon.fraser@apple.com>
3783
3784         When navigating back to a page, compositing layers may not use accelerated drawing
3785         https://bugs.webkit.org/show_bug.cgi?id=178749
3786         rdar://problem/35158946
3787
3788         Reviewed by Dean Jackson.
3789
3790         Avoid assertions when a test enables accelerated drawing (which we can't support
3791         in the iOS simulator).
3792
3793         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
3794         (WebKit::RemoteLayerBackingStore::ensureBackingStore):
3795
3796 2017-11-13  Youenn Fablet  <youenn@apple.com>
3797
3798         matchRegistration does not need to go to StorageProcess if no service worker is registered
3799         https://bugs.webkit.org/show_bug.cgi?id=179480
3800
3801         Reviewed by Chris Dumez.
3802
3803         Removed origin store handling from StorageProcess since it is now handled within SWServer.
3804         Updated clearing of web site data accordingly.
3805         Optimized matchRegistration by looking at the origin store before doing any IPC.
3806         Do IPC to the StorageProcess if the origin store is not yet initialized on the WebProcess.
3807
3808         * StorageProcess/ServiceWorker/WebSWOriginStore.h:
3809         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3810         (WebKit::WebSWServerConnection::resolveRegistrationJobInClient):
3811         (WebKit::WebSWServerConnection::resolveUnregistrationJobInClient):
3812         * StorageProcess/StorageProcess.cpp:
3813         (WebKit::StorageProcess::deleteWebsiteData):
3814         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
3815         (WebKit::StorageProcess::swServerForSession):
3816         (WebKit::StorageProcess::swOriginStoreForSession):
3817         (WebKit::StorageProcess::registerSWServerConnection):
3818         (WebKit::StorageProcess::unregisterSWServerConnection):
3819         (WebKit::StorageProcess::ensureSWOriginStoreForSession): Deleted.
3820         (WebKit::StorageProcess::swOriginStoreForSession const): Deleted.
3821         * StorageProcess/StorageProcess.h:
3822         * StorageProcess/ServiceWorker/WebSWOriginStore.cpp:
3823         (WebKit::WebSWOriginStore::addToStore):
3824         (WebKit::WebSWOriginStore::removeFromStore):
3825         (WebKit::WebSWOriginStore::clearStore):
3826         (WebKit::WebSWOriginStore::add): Deleted.
3827         (WebKit::WebSWOriginStore::remove): Deleted.
3828         (WebKit::WebSWOriginStore::clear): Deleted.
3829         * StorageProcess/ServiceWorker/WebSWOriginStore.h:
3830         * WebProcess/Storage/WebSWClientConnection.cpp:
3831         (WebKit::WebSWClientConnection::matchRegistration):
3832
3833 2017-11-13  Alex Christensen  <achristensen@webkit.org>
3834
3835         Merge NetworkProcess::EnsurePrivateBrowsingSession and NetworkProcess::AddWebsiteDataStore into one message type
3836         https://bugs.webkit.org/show_bug.cgi?id=178751
3837
3838         Reviewed by Brady Eidson.
3839
3840         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3841         (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession):
3842         * NetworkProcess/NetworkProcess.cpp:
3843         (WebKit::NetworkProcess::initializeNetworkProcess):
3844         (WebKit::NetworkProcess::ensurePrivateBrowsingSession): Deleted.
3845         * NetworkProcess/NetworkProcess.h:
3846         * NetworkProcess/NetworkProcess.messages.in:
3847         * NetworkProcess/RemoteNetworkingContext.h:
3848         * NetworkProcess/mac/RemoteNetworkingContext.mm:
3849         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
3850         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession): Deleted.
3851         * Shared/WebsiteDataStoreParameters.cpp:
3852         (WebKit::WebsiteDataStoreParameters::legacyPrivateSessionParameters):
3853         * Shared/WebsiteDataStoreParameters.h:
3854         * UIProcess/WebProcessPool.cpp:
3855         (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
3856         (WebKit::WebProcessPool::createNewWebProcess):
3857         (WebKit::WebProcessPool::pageAddedToProcess):
3858         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3859         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
3860         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
3861         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
3862         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
3863         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession): Deleted.
3864         * WebProcess/WebPage/WebPage.cpp:
3865         (WebKit::WebPage::setSessionID):
3866         * WebProcess/WebProcess.cpp:
3867         (WebKit::WebProcess::ensurePrivateBrowsingSession): Deleted.
3868         * WebProcess/WebProcess.h:
3869         * WebProcess/WebProcess.messages.in:
3870
3871 2017-11-13  Alex Christensen  <achristensen@webkit.org>
3872
3873         Add logs to debug content extension test failures
3874         https://bugs.webkit.org/show_bug.cgi?id=179624
3875
3876         Reviewed by Chris Dumez.
3877
3878         * UIProcess/API/APIContentRuleListStore.cpp:
3879         (API::compiledToFile):
3880         Right now I'm seeing this log:
3881         "Rule list compilation failed: Unspecified error during compile."
3882         I need more information to debug what is failing on the bots.
3883
3884 2017-11-07  Brian Burg  <bburg@apple.com>
3885
3886         Web Automation: inViewCenterPoint should not include topContentInset when computed in viewport coordinates
3887         https://bugs.webkit.org/show_bug.cgi?id=179129
3888         <rdar://problem/35297038>
3889
3890         Reviewed by Simon Fraser.
3891
3892         When computing the in view center point per W3C specification, the top content inset
3893         is inadvertently added back in when converting to the root view coordinate system.
3894
3895         This patch reworks the protocol command so that it explicitly requests a coordinate
3896         system, with options for "Page" (root / contents), "LayoutViewport", and "VisualViewport".
3897         The latter is not implemented in this patch, since it is intended for use on iOS someday.
3898
3899         * UIProcess/Automation/Automation.json:
3900         Change usesViewport to CoordinateSystem.
3901         Add a new coordinate system enum type and use it.
3902         Fix relevant comments for Automation.computElementLayout.
3903
3904         * UIProcess/Automation/WebAutomationSession.h:
3905         * UIProcess/Automation/WebAutomationSession.cpp:
3906         (WebKit::protocolStringToCoordinateSystem):
3907         (WebKit::WebAutomationSession::computeElementLayout):
3908         Parse the requested coordinate system and send it in the message to the web process.
3909
3910         * WebKit.xcodeproj/project.pbxproj:
3911         * WebProcess/Automation/WebAutomationSessionProxy.messages.in:
3912         * WebProcess/Automation/WebAutomationSessionProxy.h:
3913         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
3914         (WebKit::WebAutomationSessionProxy::computeElementLayout):
3915         Rework the implementation. Get the element bounds and in-view center point in
3916         client coordinates and convert back to root view coordinates for CoordinateSystem::Page.
3917
3918 2017-11-08  Keith Miller  <keith_miller@apple.com>
3919
3920         Async iteration should only fetch the next method once and add feature flag
3921         https://bugs.webkit.org/show_bug.cgi?id=179451
3922
3923         Reviewed by Geoffrey Garen.
3924
3925         Add feature flag for Async iteration.
3926
3927         * Configurations/FeatureDefines.xcconfig:
3928
3929 2017-11-13  Mark Lam  <mark.lam@apple.com>
3930
3931         Add more overflow check book-keeping for MarkedArgumentBuffer.
3932         https://bugs.webkit.org/show_bug.cgi?id=179634
3933         <rdar://problem/35492517>
3934
3935         Reviewed by Saam Barati.
3936
3937         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
3938         (WebKit::NPJSObject::construct):
3939         (WebKit::NPJSObject::invoke):
3940
3941 2017-11-13  Timothy Horton  <timothy_horton@apple.com>
3942
3943         Address some post-landing review comments from r224728
3944         https://bugs.webkit.org/show_bug.cgi?id=179576
3945
3946         * Platform/IPC/mac/MachMessage.h:
3947         (IPC::MachMessage::setMessageReceiverName):
3948         (IPC::MachMessage::setMessageName):
3949         More moving!
3950
3951 2017-11-13  Tim Horton  <timothy_horton@apple.com>
3952
3953         Occasional MobileSafari crash under -[WKPDFView web_setMinimumSize:]
3954         https://bugs.webkit.org/show_bug.cgi?id=179628
3955         <rdar://problem/34773037>
3956
3957         Reviewed by Simon Fraser.
3958
3959         * UIProcess/ios/WKPDFView.mm:
3960         (-[WKPDFView _computePageAndDocumentFrames]):
3961         Similar to r223444, avoid propagating null CGRects into the view hierarchy.
3962         In this case, the null rect comes from applying margins to a rect that is 
3963         smaller than the margins. We could check for that specifically, but a
3964         more-general check for a null rect seems reasonable.
3965
3966 2017-11-13  Tim Horton  <timothy_horton@apple.com>
3967
3968         Use the real mach type instead of reinterpret_casting in MachMessage
3969         https://bugs.webkit.org/show_bug.cgi?id=179629
3970
3971         Reviewed by Dan Bernstein.
3972
3973         * Platform/IPC/mac/MachMessage.cpp:
3974         (IPC::MachMessage::header):
3975         * Platform/IPC/mac/MachMessage.h:
3976         Just use mach_msg_header_t proper, and avoid the reinterpret_cast.
3977         This also corrects the alignment of the struct on platforms where
3978         alignof(mach_msg_header_t) != alignof(uint8_t).
3979
3980 2017-11-13  Gabriel Ivascu  <givascu@igalia.com>
3981
3982         [GTK] Automatically adjust font size when gtk-xft-dpi changes
3983         https://bugs.webkit.org/show_bug.cgi?id=142673
3984
3985         Reviewed by Michael Catanzaro.
3986
3987         * UIProcess/API/glib/WebKitSettings.cpp:
3988         (webKitSettingsDispose):
3989         (webKitSettingsConstructed):
3990         (webkit_settings_class_init):
3991
3992 2017-11-13  Chris Dumez  <cdumez@apple.com>
3993
3994         Implement "Service Worker Has No Pending Events" / "Update Service Worker Extended Events Set" algorithms
3995         https://bugs.webkit.org/show_bug.cgi?id=179618
3996
3997         Reviewed by Brady Eidson.
3998
3999         * StorageProcess/StorageProcess.cpp:
4000         (WebKit::StorageProcess::setServiceWorkerHasPendingEvents):
4001         * StorageProcess/StorageProcess.h:
4002         * StorageProcess/StorageProcess.messages.in:
4003         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
4004         (WebKit::WebSWContextManagerConnection::setServiceWorkerHasPendingEvents):
4005         * WebProcess/Storage/WebSWContextManagerConnection.h:
4006
4007 2017-11-13  Wenson Hsieh  <wenson_hsieh@apple.com>
4008
4009         [Attachment Support] Implement SPI for clients to request data for a given attachment
4010         https://bugs.webkit.org/show_bug.cgi?id=179586
4011         <rdar://problem/35355720>
4012
4013         Reviewed by Darin Adler.
4014
4015         Adds support in WebKit for fetching data for a given attachment element. See WebCore/ChangeLog for more details.
4016         Most of the changes here are boilerplate plumbing of -requestAttachmentData through the client layers.
4017
4018         Test coverage by augmenting existing API tests in WKAttachmentTests, and adding 3 new tests.
4019
4020         * UIProcess/API/APIAttachment.cpp:
4021         (API::Attachment::requestData):
4022         * UIProcess/API/APIAttachment.h:
4023         * UIProcess/API/Cocoa/_WKAttachment.h:
4024         * UIProcess/API/Cocoa/_WKAttachment.mm:
4025         (-[_WKAttachment requestData:]):
4026         * UIProcess/WebPageProxy.cpp:
4027         (WebKit::WebPageProxy::sharedBufferCallback):
4028
4029         Add a new IPC callback helper type, SharedBufferCallback. This is similar to the existing DataCallback, but
4030         instead of deserializing to an API::Data, we convert to a SharedBuffer instead. Addi