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