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