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