[WTF] Move currentCPUTime and sleep(Seconds) to CPUTime.h and Seconds.h respectively
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-03-04  Yusuke Suzuki  <utatane.tea@gmail.com>
2
3         [WTF] Move currentCPUTime and sleep(Seconds) to CPUTime.h and Seconds.h respectively
4         https://bugs.webkit.org/show_bug.cgi?id=183312
5
6         Reviewed by Mark Lam.
7
8         Remove wtf/CurrentTime.h include pragma.
9
10         * NetworkProcess/NetworkResourceLoader.cpp:
11         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
12         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
13         * Platform/IPC/Connection.cpp:
14         * Platform/unix/SharedMemoryUnix.cpp:
15         * PluginProcess/WebProcessConnection.cpp:
16         * Shared/ios/NativeWebTouchEventIOS.mm:
17         * UIProcess/DrawingAreaProxyImpl.cpp:
18         * UIProcess/ios/WKContentView.mm:
19         * UIProcess/linux/MemoryPressureMonitor.cpp:
20         * WebProcess/Gamepad/WebGamepad.cpp:
21         * WebProcess/Plugins/PDF/PDFPlugin.mm:
22         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
23         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
24         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
25         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm:
26         * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp:
27         * WebProcess/WebProcess.cpp:
28         * WebProcess/cocoa/WebProcessCocoa.mm:
29         * WebProcess/gtk/WebProcessMainGtk.cpp:
30         * WebProcess/win/WebProcessMainWin.cpp:
31         * WebProcess/wpe/WebProcessMainWPE.cpp:
32
33 2018-03-02  Brian Burg  <bburg@apple.com>
34
35         Web Automation: script evaluations via WebDriver should have a user gesture indicator
36         https://bugs.webkit.org/show_bug.cgi?id=183230
37         <rdar://problem/37959739>
38
39         Reviewed by Andy Estes.
40
41         APIs that normally require a user gesture should just work when using via WebDriver.
42         To support cases where tests need to simulate user actions with JavaScript, use a
43         fake user gesture, similar to how -[WKWebView evaluateJavaScript:] forces a user
44         gesture when clients evaluate JavaScript in their web view.
45
46         No new tests, this is covered by W3C tests that use the Fullscreen API.
47         This API does nothing if there is no user gesture; with this patch, it just works.
48
49         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
50         (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction):
51
52 2018-03-04  Tim Horton  <timothy_horton@apple.com>
53
54         Make !ENABLE(DATA_DETECTION) iOS build actually succeed
55         https://bugs.webkit.org/show_bug.cgi?id=183283
56         <rdar://problem/38062148>
57
58         Reviewed by Sam Weinig.
59
60         * UIProcess/ios/WKContentViewInteraction.mm:
61         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
62         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
63         Guard some more code with ENABLE(DATA_DETECTION).
64
65 2018-03-04  Dan Bernstein  <mitz@apple.com>
66
67         Building with ONLY_ACTIVE_ARCH=NO and ARCHS=x86_64 fails
68         https://bugs.webkit.org/show_bug.cgi?id=183320
69
70         Reviewed by Tim Horton.
71
72         * Configurations/PluginService.32.xcconfig: If the Apple build tool specifies
73           RC_ARCHS=x86_64, then let the service build for x86_64, but don’t install it.
74
75 2018-03-03  Brent Fulgham  <bfulgham@apple.com>
76
77         Notify the NetworkProcess when a session is servicing an automation client
78         https://bugs.webkit.org/show_bug.cgi?id=183306
79         <rdar://problem/37835783>
80
81         Reviewed by Brian Burg.
82
83         Network loads servicing WebDriver are done through an ephemeral session. While this is great
84         for protecting a developer's machine from sharing state with test runs, it has the unintended
85         effect of blocking certain logging operations.
86
87         We do not log content in ephemeral sessions to protect user privacy. However, ephemeral sessions
88         generated by WebDriver should participate in logging so that proper testing (with logging) can
89         be done.
90
91         This patch signals the NetworkProcess when an ephemeral session (created for automation purposes)
92         is created, so that it can allow logging.
93
94         * NetworkProcess/NetworkProcess.cpp:
95         (WebKit::NetworkProcess::destroySession): Remove controlled-by-automation entry.
96         (WebKit::NetworkProcess::sessionIsControlledByAutomation const): Added.
97         (WebKit::NetworkProcess::setSessionIsControlledByAutomation): Added.
98         * NetworkProcess/NetworkProcess.h:
99         * NetworkProcess/NetworkProcess.messages.in:
100         * NetworkProcess/NetworkResourceLoader.cpp:
101         (WebKit::NetworkResourceLoader::isAlwaysOnLoggingAllowed const): Checks if the relevant session
102         is servicing an automation client, and returns true if it is.
103         * UIProcess/WebPageProxy.cpp:
104         (WebKit::WebPageProxy::WebPageProxy): Signal the network process if this page is being created
105         for an automation client.
106
107 2018-03-02  Yusuke Suzuki  <utatane.tea@gmail.com>
108
109         [WTF] Remove RunLoop and RunLoop::Timer's interface using double as seconds
110         https://bugs.webkit.org/show_bug.cgi?id=183293
111
112         Reviewed by Alex Christensen.
113
114         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
115         (WebKit::CompositingRunLoop::scheduleUpdate):
116         (WebKit::CompositingRunLoop::compositionCompleted):
117         (WebKit::CompositingRunLoop::updateCompleted):
118         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
119         (WebKit::ThreadedDisplayRefreshMonitor::dispatchDisplayRefreshCallback):
120
121 2018-03-02  Don Olmstead  <don.olmstead@sony.com>
122
123         Share common WebError implementation
124         https://bugs.webkit.org/show_bug.cgi?id=183303
125
126         Reviewed by Ryosuke Niwa.
127
128         * Shared/WebErrors.cpp:
129         (WebKit::cancelledError):
130         (WebKit::fileDoesNotExistError):
131         * Shared/glib/WebErrorsGlib.cpp: Removed.
132         * SourcesGTK.txt:
133         * SourcesWPE.txt:
134
135 2018-03-02  Youenn Fablet  <youenn@apple.com>
136
137         LayoutTest imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-within-sw.https.html is a flaky failure
138         https://bugs.webkit.org/show_bug.cgi?id=179248
139         <rdar://problem/35377756>
140
141         Reviewed by Chris Dumez.
142
143         In case we go up to the initializeSize step and Caches was cleared
144         between the time we stated to initialize and the time we got there,
145         we need to make as if Caches was not initialized,
146         thus keeping m_isInitialized to false and m_storage to nullptr.
147
148         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
149         (WebKit::CacheStorage::Caches::initializeSize):
150
151 2018-03-02  Youenn Fablet  <youenn@apple.com>
152
153         Clients should register to StorageProcess with their service worker registration identifier
154         https://bugs.webkit.org/show_bug.cgi?id=182313
155         <rdar://problem/38044403>
156
157         Reviewed by Chris Dumez.
158
159         Relanding.
160
161         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
162         (WebKit::WebSWServerConnection::registerServiceWorkerClient):
163         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
164         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
165         * WebProcess/Storage/WebSWClientConnection.cpp:
166         (WebKit::WebSWClientConnection::registerServiceWorkerClient):
167         * WebProcess/Storage/WebSWClientConnection.h:
168
169 2018-03-02  Tim Horton  <timothy_horton@apple.com>
170
171         Make it possible to disable WKPDFView
172         https://bugs.webkit.org/show_bug.cgi?id=183281
173         <rdar://problem/38060815>
174
175         Reviewed by Dan Bates.
176
177         * UIProcess/API/Cocoa/WKWebView.mm:
178         (-[WKWebView _isBackground]):
179         (-[WKWebView _isDisplayingPDF]):
180         (-[WKWebView _dataForDisplayedPDF]):
181         (-[WKWebView _suggestedFilenameForDisplayedPDF]):
182         * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
183         (-[WKWebViewContentProviderRegistry init]):
184         * UIProcess/ios/WKPDFView.h:
185         * UIProcess/ios/WKPDFView.mm:
186
187 2018-03-02  Youenn Fablet  <youenn@apple.com>
188
189         WebProcessProxy should handle its completion handler at destruction time
190         https://bugs.webkit.org/show_bug.cgi?id=183224
191
192         Reviewed by Brady Eidson.
193
194         * UIProcess/WebProcessProxy.cpp:
195         (WebKit::WebProcessProxy::~WebProcessProxy):
196         * UIProcess/WebProcessProxy.h:
197
198 2018-03-02  Brent Fulgham  <bfulgham@apple.com>
199
200         Update WebContent process sandbox IOKit properties
201         https://bugs.webkit.org/show_bug.cgi?id=183269
202         <rdar://problem/37853282>
203
204         Reviewed by Eric Carlson.
205
206         * WebProcess/com.apple.WebProcess.sb.in:
207
208 2018-03-01  Yusuke Suzuki  <utatane.tea@gmail.com>
209
210         Remove monotonicallyIncreasingTime
211         https://bugs.webkit.org/show_bug.cgi?id=182911
212
213         Reviewed by Michael Catanzaro.
214
215         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
216         (WebKit::CacheStorage::Cache::toRecordInformation):
217         * Platform/IPC/ArgumentCoders.cpp:
218         (IPC::ArgumentCoder<Seconds>::encode):
219         (IPC::ArgumentCoder<Seconds>::decode):
220         (IPC::ArgumentCoder<MonotonicTime>::encode):
221         (IPC::ArgumentCoder<MonotonicTime>::decode):
222         * Platform/IPC/ArgumentCoders.h:
223         * Shared/Gamepad/GamepadData.cpp:
224         (WebKit::GamepadData::GamepadData):
225         * Shared/Gamepad/GamepadData.h:
226         (WebKit::GamepadData::lastUpdateTime const):
227         * Shared/WebCoreArgumentCoders.cpp:
228         (IPC::ArgumentCoder<MonotonicTime>::encode): Deleted.
229         (IPC::ArgumentCoder<MonotonicTime>::decode): Deleted.
230         (IPC::ArgumentCoder<Seconds>::encode): Deleted.
231         (IPC::ArgumentCoder<Seconds>::decode): Deleted.
232         ArgumentCoders for MonotonicTime and Seconds are now used internally.
233         Move them to Platform/IPC/ArgumentCoders.h.
234
235         * Shared/WebCoreArgumentCoders.h:
236         * UIProcess/API/glib/IconDatabase.cpp:
237         (WebKit::IconDatabase::iconDatabaseSyncThread):
238         * UIProcess/DrawingAreaProxyImpl.cpp:
239         (WebKit::DrawingAreaProxyImpl::DrawingMonitor::start):
240         (WebKit::DrawingAreaProxyImpl::DrawingMonitor::stop):
241         (WebKit::DrawingAreaProxyImpl::DrawingMonitor::didDraw):
242         * UIProcess/DrawingAreaProxyImpl.h:
243         * UIProcess/Gamepad/UIGamepad.h:
244         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
245         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
246         (WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidStart):
247         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h:
248         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
249         (WebKit::RemoteLayerTreeHost::animationDidStart):
250         * WebProcess/WebPage/DrawingArea.h:
251         (WebKit::DrawingArea::acceleratedAnimationDidStart):
252         * WebProcess/WebPage/DrawingArea.messages.in:
253         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.h:
254         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
255         (mediaTimeToCurrentTime):
256         (-[WKAnimationDelegate animationDidStart:]):
257         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
258         (WebKit::PlatformCALayerRemote::animationStarted):
259         This argument `beginTime` is not CFTimeInverval actually. We add currentTimeToMediaTime
260         conversion here to fix this issue.
261
262         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:
263         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h:
264         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
265         (WebKit::RemoteLayerTreeContext::animationDidStart):
266         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
267         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
268         (WebKit::RemoteLayerTreeDrawingArea::acceleratedAnimationDidStart):
269         * WebProcess/cocoa/WebProcessCocoa.mm:
270         (WebKit::WebProcess::destroyRenderingResources):
271
272 2018-03-02  Brent Fulgham  <bfulgham@apple.com>
273
274         [iOS] whitelist missing AppleJPEG logging feature
275         https://bugs.webkit.org/show_bug.cgi?id=183270
276         <rdar://problem/37808612>
277
278         Reviewed by Alex Christensen.
279
280         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
281
282 2018-03-02  Youenn Fablet  <youenn@apple.com>
283
284         IOChannel::read and IOChannel::write can destroy the completion handler in the thread used to manipulate thread
285         https://bugs.webkit.org/show_bug.cgi?id=183261
286
287         Reviewed by Antti Koivisto.
288
289         Moving the completion handler when being called so that it gets desttroyed in the thread it is called.
290
291         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
292         (WebKit::NetworkCache::IOChannel::read):
293         (WebKit::NetworkCache::IOChannel::write):
294
295 2018-03-02  Dan Bernstein  <mitz@apple.com>
296
297         Safari uses WebContent.Development when loading injected bundle embedded in its app bundle
298         https://bugs.webkit.org/show_bug.cgi?id=183275
299
300         Reviewed by Tim Horton.
301
302         * UIProcess/mac/WebProcessProxyMac.mm:
303         (WebKit::WebProcessProxy::shouldAllowNonValidInjectedCode const): Return false if this is
304           a platform binary. We can also return false unconditionally when building for any shipping
305           major macOS release.
306
307 2018-03-01  Commit Queue  <commit-queue@webkit.org>
308
309         Unreviewed, rolling out r229153.
310         https://bugs.webkit.org/show_bug.cgi?id=183274
311
312         it is breaking imported/w3c/web-platform-tests/service-workers
313         /service-worker/clients-matchall-exact-controller.https.html
314         (Requested by youenn on #webkit).
315
316         Reverted changeset:
317
318         "Clients should register to StorageProcess with their service
319         worker registration identifier"
320         https://bugs.webkit.org/show_bug.cgi?id=182313
321         https://trac.webkit.org/changeset/229153
322
323 2018-03-01  Brent Fulgham  <bfulgham@apple.com>
324
325         Add the "com.apple.security.cs.disable-library-validation” entitlement to the Plugin Process
326         https://bugs.webkit.org/show_bug.cgi?id=183252
327         <rdar://problem/37887136>
328
329         Reviewed by David Kilzer.
330
331         * Configurations/PluginService.entitlements:
332
333 2018-03-01  Youenn Fablet  <youenn@apple.com>
334
335         Clients should register to StorageProcess with their service worker registration identifier
336         https://bugs.webkit.org/show_bug.cgi?id=182313
337
338         Reviewed by Chris Dumez.
339
340         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
341         (WebKit::WebSWServerConnection::registerServiceWorkerClient):
342         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
343         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
344         * WebProcess/Storage/WebSWClientConnection.cpp:
345         (WebKit::WebSWClientConnection::registerServiceWorkerClient):
346         * WebProcess/Storage/WebSWClientConnection.h:
347
348 2018-03-01  Youenn Fablet  <youenn@apple.com>
349
350         LayoutTest imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-within-sw.https.html is a flaky failure
351         https://bugs.webkit.org/show_bug.cgi?id=179248
352         <rdar://problem/35377756>
353
354         Reviewed by Chris Dumez.
355
356         WebKitTestRunner is clearing caches for every test but there might still be some on-going cache activity due to a previous test.
357         In that case, the activity might try to open the Caches object at the same time the files are deleted by the clearing task.
358         If the new test is trying to open the same caches, it will also receive the same error, hence the console log message.
359
360         To fix that issue, we clear the initialization pending callbacks when clearing the caches.
361         This prevents the new test to receive the error since the new test should only start some cache activity after the cache clear task is done.
362         Made refactoring to append the first callback into the list of pending callbacks.
363
364         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
365         (WebKit::CacheStorage::Caches::initialize):
366         (WebKit::CacheStorage::Caches::initializeSize):
367         (WebKit::CacheStorage::Caches::clear):
368         * NetworkProcess/cache/CacheStorageEngineCaches.h:
369
370 2018-03-01  Youenn Fablet  <youenn@apple.com>
371
372         Add API test to validate setting of service worker and cache storage directories
373         https://bugs.webkit.org/show_bug.cgi?id=182543
374
375         Reviewed by Chris Dumez.
376
377         Add cache engine directory path to its representation dump.
378         This is used in API tests to check that the path is correctly set.
379
380         Add a way for to know whether a service worker was registered from a WKWebsiteDataStore.
381         This is used in API tests to check that the path is correctly set.
382
383         * NetworkProcess/cache/CacheStorageEngine.cpp:
384         (WebKit::CacheStorage::Engine::representation):
385         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
386         (-[WKWebsiteDataStore _hasRegisteredServiceWorker]):
387         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
388
389 2018-03-01  Wenson Hsieh  <wenson_hsieh@apple.com>
390
391         Fix some errors due to some mach port APIs being unavailable on watchOS
392         https://bugs.webkit.org/show_bug.cgi?id=183262
393         <rdar://problem/38028521>
394
395         Reviewed by Tim Horton.
396
397         Minor build fix; mach_port_guard and mach_port_unguard are not available on this platform.
398
399         * Platform/IPC/mac/ConnectionMac.mm:
400         (IPC::Connection::platformInvalidate):
401         (IPC::Connection::platformInitialize):
402         (IPC::Connection::open):
403
404 2018-03-01  Per Arne Vollan  <pvollan@apple.com>
405
406         Unreviewed build fix after r229140.
407
408         * WebProcess/cocoa/WebProcessCocoa.mm:
409
410 2018-03-01  Per Arne Vollan  <pvollan@apple.com>
411
412         Scrollbar preferences are ignored when the WebContent process doesn't have access to the WindowServer.
413         https://bugs.webkit.org/show_bug.cgi?id=183231
414         <rdar://problem/37793457>
415
416         Reviewed by Brent Fulgham.
417
418         When the WebContent process doesn't have access to the WindowServer, the scrollbars are always of the overlay type.
419         The notification about scrollbar preferences is never received by the WebContent process when there is no
420         WindowServer access. This can be fixed by adding an observer of scrollbar preferences in the UI process, and
421         notifying the WebProcess about this by sending it a message. This message should also contain the preferred
422         scrollbar type, since the call '[NSScroller preferredScrollerStyle]' will always return the overlay style when
423         there is no WindowServer access.
424
425         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
426         (WebKit::WebProcessPool::registerNotificationObservers):
427         (WebKit::WebProcessPool::unregisterNotificationObservers):
428         * UIProcess/WebProcessPool.h:
429         * WebProcess/WebProcess.cpp:
430         (WebKit::WebProcess::initializeProcess):
431         * WebProcess/WebProcess.h:
432         * WebProcess/WebProcess.messages.in:
433         * WebProcess/cocoa/WebProcessCocoa.mm:
434         (WebKit::WebProcess::scrollerStylePreferenceChanged):
435
436 2018-03-01  Antti Koivisto  <antti@apple.com>
437
438         Crash when updating cache entry after validation in apps that uses class A file protection
439         https://bugs.webkit.org/show_bug.cgi?id=183242
440         <rdar://problem/33289058>
441
442         Reviewed by Chris Dumez.
443
444         When validating a cache entry, we keep it alive until we get a network response. With 304 response
445         we then update the headers of this existing entry. This accesses the body data of the entry which
446         may be backed by a mapped file. If the app uses class A protection, user might have locked
447         the device and the entry might have become inaccessible, leading to a crash.
448
449         * NetworkProcess/cache/NetworkCacheEntry.cpp:
450         (WebKit::NetworkCache::Entry::setNeedsValidation):
451
452         In case of class A protection, pull the data to a memory buffer immediately before starting a revalidation request.
453         This makes the window where the file could become inaccessible much shorter (since it no longer depends on network).
454
455 2018-03-01  Carlos Garcia Campos  <cgarcia@igalia.com>
456
457         REGRESSION(r221514): [GTK] UI process crash in WebKit::WaylandCompositor::Surface::flushPendingFrameCallbacks
458         https://bugs.webkit.org/show_bug.cgi?id=183091
459
460         Reviewed by Michael Catanzaro.
461
462         Invalidate the surface in the page map when the backing store is destroyed.
463
464         * UIProcess/gtk/WaylandCompositor.cpp:
465         (WebKit::WaylandCompositor::willDestroySurface):
466         * UIProcess/gtk/WaylandCompositor.h:
467
468 2018-02-28  Brian Burg  <bburg@apple.com>
469
470         [Cocoa] Web Automation: provide a way to ask clients the type of a JavaScript dialog
471         https://bugs.webkit.org/show_bug.cgi?id=182660
472         <rdar://problem/37408183>
473
474         Reviewed by Tim Horton and Carlos Garcia Campos.
475
476         Add another delegate method to ask what type of dialog is being shown.
477         This is used to implement §18.4 Step 5, where sending text to a dialog
478         without a prompt will return several different kinds of errors.
479
480         No new tests, covered by web platform tests once Safari side has landed.
481
482         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h: Update FIXME radar numbers.
483         * UIProcess/Cocoa/AutomationSessionClient.h:
484         * UIProcess/Cocoa/AutomationSessionClient.mm:
485         (WebKit::AutomationSessionClient::AutomationSessionClient):
486         (WebKit::toImpl):
487         (WebKit::AutomationSessionClient::typeOfCurrentJavaScriptDialogOnPage):
488         If there is no current dialog to be checked, the client can return the 'None'
489         type. This gets converted into a std::nullopt and causes a command error later.
490
491 2018-02-28  John Wilander  <wilander@apple.com>
492
493         Remove assertion from ResourceLoadStatisticsClassifier::calculateResourcePrevalence() which causes crashes when domains are explicitly set as prevalent without the associated statistics
494         https://bugs.webkit.org/show_bug.cgi?id=183233
495
496         Unreviewed removal of an assertion that's causing layout test crashes.
497
498         * Platform/classifier/ResourceLoadStatisticsClassifier.cpp:
499         (WebKit::ResourceLoadStatisticsClassifier::calculateResourcePrevalence):
500             Removed ASSERT(currentPrevalence == Low).
501
502 2018-02-28  John Wilander  <wilander@apple.com>
503
504         Add a second tier of prevalence to facilitate telemetry on very prevalent domains
505         https://bugs.webkit.org/show_bug.cgi?id=183218
506         <rdar://problem/37992388>
507
508         Reviewed by Brent Fulgham.
509
510         * Platform/classifier/ResourceLoadStatisticsClassifier.cpp:
511         (WebKit::vectorLength):
512             New convenience function.
513         (WebKit::ResourceLoadStatisticsClassifier::calculateResourcePrevalence):
514             Renamed from ResourceLoadStatisticsClassifier::hasPrevalentResourceCharacteristics().
515             Now returns a value from the enum ResourceLoadPrevalence.
516         (WebKit::ResourceLoadStatisticsClassifier::classifyWithVectorThreshold):
517             Now uses the new vectorLength() convenience function.
518         (WebKit::ResourceLoadStatisticsClassifier::hasPrevalentResourceCharacteristics): Deleted.
519             Renamed to ResourceLoadStatisticsClassifier::calculateResourcePrevalence().
520         * Platform/classifier/ResourceLoadStatisticsClassifier.h:
521             Added enum ResourceLoadPrevalence.
522         * Shared/WebCoreArgumentCoders.cpp:
523         (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
524         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
525             Handling of the new boolean field isVeryPrevalentResource.
526         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
527         (WKWebsiteDataStoreSetStatisticsVeryPrevalentResource):
528         (WKWebsiteDataStoreIsStatisticsVeryPrevalentResource):
529             Test infrastructure.
530         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
531         * UIProcess/WebResourceLoadStatisticsStore.cpp:
532         (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
533         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
534         (WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource):
535         (WebKit::WebResourceLoadStatisticsStore::isVeryPrevalentResource):
536         (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
537             All of these are for handling of the two-tier classification.
538             Also bumped the statisticsModelVersion to 12.
539         * UIProcess/WebResourceLoadStatisticsStore.h:
540
541 2018-02-28  Alex Christensen  <achristensen@webkit.org>
542
543         Reduce use of NetworkingContext in WebKit
544         https://bugs.webkit.org/show_bug.cgi?id=183213
545
546         Reviewed by Brady Eidson.
547
548         * NetworkProcess/RemoteNetworkingContext.h:
549         * WebProcess/Network/WebLoaderStrategy.cpp:
550         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
551         (WebKit::WebLoaderStrategy::preconnectTo):
552         * WebProcess/Network/WebLoaderStrategy.h:
553         * WebProcess/Plugins/PluginView.cpp:
554         (WebKit::PluginView::proxiesForURL):
555         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
556         * WebProcess/WebPage/WebFrame.cpp:
557
558 2018-02-28  Brent Fulgham  <bfulgham@apple.com>
559
560         Remove network access from the WebContent process sandbox
561         https://bugs.webkit.org/show_bug.cgi?id=183192
562         <rdar://problem/35369115>
563
564         Reviewed by Alex Christensen.
565
566         Remove the 'system-network', 'allow-network-common', and 'network-client' access from the WebContent process.
567         That's why we have a Network Process! 
568
569         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
570         * WebProcess/com.apple.WebProcess.sb.in:
571
572 2018-02-27  Tim Horton  <timothy_horton@apple.com>
573
574         Ensure target triple is propagated correctly to DerivedSources.make
575         https://bugs.webkit.org/show_bug.cgi?id=183189
576         <rdar://problem/37959694>
577
578         Reviewed by Dan Bernstein.
579
580         * Configurations/Base.xcconfig:
581         * DerivedSources.make:
582         Ditto the WebCore ChangeLog.
583
584 2018-02-27  Yongjun Zhang  <yongjun_zhang@apple.com>
585
586         Make it possible to set suggestions in extra zoom mode.
587         https://bugs.webkit.org/show_bug.cgi?id=183154
588         <rdar://problem/35227450>
589
590         Reviewed by Tim Horton.
591
592         In extra zoom mode, when presenting WKFocusedFormControlViewController, make it the inputDelegate for
593         WKContentView. This is needed to ensure we can capture/cache the suggestions when _WKInputSession's
594         suggestions is updated. Later, when we present WKTextInputViewController, we can pass the cached
595         suggestions.
596
597         * UIProcess/ios/WKContentViewInteraction.mm:
598         (-[WKContentView presentFocusedFormControlViewController:]): Set _focusedFormControlViewController as
599             the inputDelegate for WKContentView.
600         (-[WKContentView dismissFocusedFormControlViewController:]): Null the inputDelegate on dismissal.
601         (-[WKContentView presentTextInputViewController:]): Pass the suggestions from WKFocusedFormControlViewController to
602             WKTextInputViewController when the latter is presented.
603         (-[WKContentView textInputController:didCommitText:]): Call the new delegate method textInputController:didCommitText:withSuggestion:.
604         (-[WKContentView textInputController:didCommitText:withSuggestion:]): When a suggestions is selected, insert the
605             suggestion which will notify the client.
606         (-[WKContentView focusedFormControllerDidUpdateSuggestions:]): Called when the suggestion is updated after the input
607             view controller is presented.
608
609 2018-02-27  Tim Horton  <timothy_horton@apple.com>
610
611         Stop using deprecated CADisplay SPI
612         https://bugs.webkit.org/show_bug.cgi?id=183150
613         <rdar://problem/37918297>
614
615         Reviewed by Simon Fraser.
616
617         * Platform/spi/ios/FrontBoardServicesSPI.h: Added.
618         * Platform/spi/ios/UIKitSPI.h:
619         * UIProcess/API/Cocoa/WKWebView.mm:
620         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
621         * WebKit.xcodeproj/project.pbxproj:
622         Switch to the more modern way of getting the display name.
623
624 2018-02-27  Ryan Haddad  <ryanhaddad@apple.com>
625
626         Unreviewed, rolling out r229055.
627
628         Breaks internal builds.
629
630         Reverted changeset:
631
632         "Stop using deprecated CADisplay SPI"
633         https://bugs.webkit.org/show_bug.cgi?id=183150
634         https://trac.webkit.org/changeset/229055
635
636 2018-02-27  Wenson Hsieh  <wenson_hsieh@apple.com>
637
638         [Extra zoom mode] Implement additional SPI for adjusting viewport shrink-to-fit behavior
639         https://bugs.webkit.org/show_bug.cgi?id=183100
640         <rdar://problem/37840987>
641
642         Reviewed by Tim Horton.
643
644         Add new SPI hooks to provide finer control over certain aspects of the shrink-to-fit viewport heuristic.
645         Currently, in certain cases of iPad multitasking, Safari allows shrinking content to fit by default. This means
646         that even when "width=device-width" is used, if the contents of the page are too wide to fit within the
647         viewport's width, we'll adjust the initial scale such that the viewport can fit all of the content.
648
649         However, in certain viewport dimensions, this heuristic is insufficient to ensure that pages are laid out and
650         displayed properly within the viewport. Namely, one could imagine that an element with a hard-coded width that
651         is larger than the real viewport width would cause all other elements with dimensions relative to the body to be
652         excessively shrunk down once shrink-to-fit is applied, so the page would still look broken even if the contents
653         of the page all fit within the viewport.
654
655         To mitigate this, we decouple the notions of minimum layout size from the size of the actual viewport (which we
656         simply refer to as "view size"). This allows us to introduce a mechanism where we lay out the page at a given
657         minimum layout size that is larger than the size of the view; later, when we determine the initial scale, we
658         then apply shrink-to-fit scaling using the view size rather than the minimum layout size. This grants us the
659         ability to lay out content as if our view were large, but still ensure that the contents of the page fit within
660         the actual view.
661
662         * Shared/VisibleContentRectUpdateInfo.cpp:
663         (WebKit::VisibleContentRectUpdateInfo::encode const):
664         (WebKit::VisibleContentRectUpdateInfo::decode):
665         (WebKit::operator<<):
666         * Shared/VisibleContentRectUpdateInfo.h:
667         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
668         (WebKit::VisibleContentRectUpdateInfo::forceHorizontalShrinkToFit const):
669         (WebKit::operator==):
670
671         Plumb the forceHorizontalShrinkToFit flag through VisibleContentRectUpdateInfo.
672
673         * Shared/WebPageCreationParameters.cpp:
674         (WebKit::WebPageCreationParameters::encode const):
675         (WebKit::WebPageCreationParameters::decode):
676         * Shared/WebPageCreationParameters.h:
677
678         Plumb viewSize through IPC to WebPage.
679
680         * UIProcess/API/Cocoa/WKWebView.mm:
681         (-[WKWebView _initializeWithConfiguration:]):
682
683         Start off WKWebView flags at their initial values.
684
685         (-[WKWebView _minimumAllowedLayoutWidth]):
686         (-[WKWebView _setMinimumAllowedLayoutWidth:]):
687
688         This provides the minimum width at which the page will lay out, such that if the view width dips below this
689         value, we'll use this minimum allowed layout width instead. 0 by default.
690
691         (-[WKWebView activeMinimumLayoutSizes:]):
692
693         Refactor this from a static function to a helper method on WKWebView that computes both the minimum layout size
694         (which takes minimum allowed layout width into account) as well as the real view size. Refactor all call sites
695         to use this new method, and also propagate the view size down via IPC, alongside the minimum layout size.
696
697         (-[WKWebView _dispatchSetMinimumLayoutSize:viewSize:]):
698         (-[WKWebView _frameOrBoundsChanged]):
699         (-[WKWebView _setMinimumLayoutSizeOverride:]):
700         (-[WKWebView _setForceHorizontalViewportShrinkToFit:]):
701         (-[WKWebView _forceHorizontalViewportShrinkToFit]):
702
703         Setting this flag to YES forces us to always shrink-to-fit in the horizontal axis. NO by default.
704
705         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
706         (-[WKWebView _endAnimatedResize]):
707         (activeMinimumLayoutSize): Deleted.
708
709         More refactoring to replace activeMinimumLayoutSize() with -activeMinimumLayoutSizes:.
710
711         (-[WKWebView _dispatchSetMinimumLayoutSize:]): Deleted.
712         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
713         * UIProcess/WebPageProxy.cpp:
714         (WebKit::WebPageProxy::creationParameters):
715         * UIProcess/WebPageProxy.h:
716         * UIProcess/ios/WKContentView.mm:
717         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
718
719         Pass _forceHorizontalViewportShrinkToFit into the visible content rect update.
720
721         * UIProcess/ios/WebPageProxyIOS.mm:
722         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
723         (WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSize):
724
725         Plumb viewSize alongside the existing minimumLayoutSize.
726
727         * WebProcess/WebPage/WebPage.cpp:
728         (WebKit::m_credentialsMessenger):
729         * WebProcess/WebPage/WebPage.h:
730         * WebProcess/WebPage/WebPage.messages.in:
731         * WebProcess/WebPage/ios/WebPageIOS.mm:
732         (WebKit::WebPage::setViewportConfigurationMinimumLayoutSize):
733         (WebKit::WebPage::dynamicViewportSizeUpdate):
734         (WebKit::WebPage::updateVisibleContentRects):
735
736         Set forceHorizontalShrinkToFit on the viewport configuration here.
737
738 2018-02-27  Tim Horton  <timothy_horton@apple.com>
739
740         Stop using deprecated CADisplay SPI
741         https://bugs.webkit.org/show_bug.cgi?id=183150
742         <rdar://problem/37918297>
743
744         Reviewed by Simon Fraser.
745
746         * Platform/spi/ios/FrontBoardServicesSPI.h: Added.
747         * Platform/spi/ios/UIKitSPI.h:
748         * UIProcess/API/Cocoa/WKWebView.mm:
749         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
750         * WebKit.xcodeproj/project.pbxproj:
751         Switch to the more modern way of getting the display name.
752
753 2018-02-26  Youenn Fablet  <youenn@apple.com>
754
755         Caches::m_storage should be set to null in case of error at initialization time
756         https://bugs.webkit.org/show_bug.cgi?id=183068
757
758         Reviewed by Chris Dumez.
759
760         In case of error, we need to set m_storage back to nullptr so that
761         next tries to initialize it will restart from scratch.
762         If we do not set it to nullptr, we end up storing the initialize
763         callback in a queue and the callback will never be called.
764
765         This is difficult to test as we need the following conditions:
766         - we need to have an error case, like a disk writing error
767         - we need the web app to open a cache in two different pages/frames at about the same time.
768
769         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
770         (WebKit::CacheStorage::Caches::initialize):
771
772 2018-02-26  Commit Queue  <commit-queue@webkit.org>
773
774         Unreviewed, rolling out r226330.
775         https://bugs.webkit.org/show_bug.cgi?id=183152
776
777         incorrectly assumes enumeration callback happens once
778         (Requested by alexchristensen on #webkit).
779
780         Reverted changeset:
781
782         "Use BlockPtrs and lambdas instead of new/delete to pass
783         parameters to blocks in WebViewImpl::performDragOperation"
784         https://bugs.webkit.org/show_bug.cgi?id=180795
785         https://trac.webkit.org/changeset/226330
786
787 2018-02-26  Ryosuke Niwa  <rniwa@webkit.org>
788
789         Release assertion in WebPage::updatePreferences
790         https://bugs.webkit.org/show_bug.cgi?id=183075
791
792         Reviewed by Youenn Fablet and Chris Dumez.
793
794         Replaced the release assertion added in r228589 with a more graceful disabling of the feature when the entitlement is missing.
795
796         * StorageProcess/StorageProcess.cpp:
797         (WebKit::StorageProcess::didReceiveMessage): Added an early exit with an entitlement check to disable the feature.
798         (WebKit::StorageProcess::initializeWebsiteDataStore): Ditto.
799         (WebKit::StorageProcess::createStorageToWebProcessConnection): Replaced the release assertion with a debug assertion.
800         (WebKit::StorageProcess::swServerForSession): Removed the assertion. This code can be reached when the service worker is disabled.
801         (WebKit::StorageProcess::registerSWServerConnection): Replaced the release assertion with a debug assertion.
802         * WebProcess/WebPage/WebPage.cpp:
803         (WebKit::WebPage::updatePreferences): Disable the feature instead of crashing when the entitlement is missing.
804
805 2018-02-26  Chris Dumez  <cdumez@apple.com>
806
807         Regression(r223431): Crash under didReceiveChallenge in NetworkSessionCocoa
808         https://bugs.webkit.org/show_bug.cgi?id=183134
809         <rdar://problem/36339049>
810
811         Reviewed by Alex Christensen.
812
813         Like other delegates functions in this file, it is possible for didReceiveChallenge to get called
814         after _session has been nulled out. Other delegate functions already had early returns when
815         _session is null. However, such early return was missing in didReceiveChallenge.
816
817         This patch ends the early return to didReceiveChallenge so that we do not end up calling
818         _session->downloadID(taskIdentifier) on a null _session.
819
820         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
821         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
822
823 2018-02-26  Youenn Fablet  <youenn@apple.com>
824
825         MessagePort is not always destroyed in the right thread
826         https://bugs.webkit.org/show_bug.cgi?id=183053
827
828         Reviewed by Chris Dumez.
829
830         Update code to pass a lambda to MessagePort::existingMessagePortForIdentifier.
831
832         * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.cpp:
833         (WebKit::WebMessagePortChannelProvider::checkProcessLocalPortForActivity):
834         * WebProcess/WebProcess.cpp:
835         (WebKit::WebProcess::messagesAvailableForPort):
836
837 2018-02-25  Alexey Proskuryakov  <ap@apple.com>
838
839         Font smoothing doesn't get disabled if the preference is set before launching WebContent process
840         https://bugs.webkit.org/show_bug.cgi?id=183108
841
842         Reviewed by Tim Horton.
843
844         * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess):
845         Fix the bug. While at it, also avoid the anti-pattern in setAlwaysUsesComplexTextCodePath.
846
847 2018-02-25  Philippe Normand  <pnormand@igalia.com>
848
849         Unreviewed GTK Debug build fix after r228942.
850
851         * UIProcess/API/glib/IconDatabase.cpp:
852         (WebKit::IconDatabase::iconDatabaseSyncThread):
853         (WebKit::IconDatabase::syncThreadMainLoop):
854         (WebKit::IconDatabase::readFromDatabase):
855         (WebKit::IconDatabase::writeToDatabase):
856         (WebKit::IconDatabase::cleanupSyncThread):
857
858 2018-02-25  Chris Dumez  <cdumez@apple.com>
859
860         Service workers do not work well inside Web.app
861         https://bugs.webkit.org/show_bug.cgi?id=183105
862         <rdar://problem/37864140>
863
864         Reviewed by Youenn Fablet.
865
866         * StorageProcess/StorageProcess.cpp:
867         (WebKit::StorageProcess::didReceiveMessage):
868         We were failing to forward IPC messages to the ChildProcess class here. As a result,
869         the ChildProcess::RegisterURLSchemeServiceWorkersCanHandle IPC was being ignored
870         by the StorageProcess.
871
872 2018-02-24  Zan Dobersek  <zdobersek@igalia.com>
873
874         Unreviewed WPE breakage fix.
875
876         * WebProcess/wpe/WebProcessMainWPE.cpp: Call g_set_prgname() in WebProcess 
877         to prepare the GLib state for subsequent GStreamer initialization.
878
879 2018-02-23  John Wilander  <wilander@apple.com>
880
881         Introduce ITP debug logging as an opt-in developer feature
882         https://bugs.webkit.org/show_bug.cgi?id=183065
883         <rdar://problem/37803761>
884
885         Reviewed by Brent Fulgham.
886
887         * Platform/Logging.h:
888             Added a dedicated channel for Resource Load Statistics debug logging
889             since this will be part of a developer-facing feature and should not
890             be mixed with general Resource Load Statistics logging.
891         * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
892         (WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):
893             Now picks up the user default setting for
894             ResourceLoadStatisticsDebugLoggingEnabled.
895         * UIProcess/WebResourceLoadStatisticsStore.cpp:
896         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
897             Now logs for which domains it purges website data if
898             ResourceLoadStatisticsDebugLoggingEnabled is set.
899         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
900             Now logs for which domains it partitions and blocks cookies
901             in third-party contexts if ResourceLoadStatisticsDebugLoggingEnabled
902             is set.
903         * UIProcess/WebResourceLoadStatisticsStore.h:
904
905 2018-02-23  Brent Fulgham  <bfulgham@apple.com>
906
907         [macOS] Correct sandbox violation during media playback
908         https://bugs.webkit.org/show_bug.cgi?id=183092
909         <rdar://problem/37718495>
910
911         Reviewed by Eric Carlson.
912
913         * WebProcess/com.apple.WebProcess.sb.in:
914
915 2018-02-23  Yousuke Kimoto  <yousuke.kimoto@sony.com>
916
917         [MSVC] Unknown a type definition error in WebResourceLoadStatisticsStore on wincairo webkit
918         https://bugs.webkit.org/show_bug.cgi?id=182873
919
920         Reviewed by Yusuke Suzuki.
921
922         * UIProcess/WebResourceLoadStatisticsStore.h:
923
924 2018-02-23  Carlos Garcia Campos  <cgarcia@igalia.com>
925
926         [GStreamer][MiniBrowser] Honor GStreamer command line parameters in MiniBrowser
927         https://bugs.webkit.org/show_bug.cgi?id=173655
928         <rdar://problem/37706341>
929
930         Reviewed by Philippe Normand.
931
932         Actually pass the gst command line options to the WebProcess. The options in /proc/self/cmdline are separated by
933         null characters, so we are effectively passing always the first option only, which is the program name. Then, in
934         the web process we always ignore the first option and providing WebProcess unconditionally, so we were doing
935         nothing.
936
937         * UIProcess/gtk/WebProcessPoolGtk.cpp:
938         (WebKit::WebProcessPool::platformInitializeWebProcess): Use WebCore::extractGStreamerOptionsFromCommandLine()
939         * UIProcess/wpe/WebProcessPoolWPE.cpp:
940         (WebKit::WebProcessPool::platformInitializeWebProcess): Ditto.
941         * WebProcess/soup/WebProcessSoup.cpp:
942         (WebKit::WebProcess::platformInitializeWebProcess): Move the vector.
943
944 2018-02-22  Yusuke Suzuki  <utatane.tea@gmail.com>
945
946         Remove currentTime() / currentTimeMS()
947         https://bugs.webkit.org/show_bug.cgi?id=183052
948
949         Reviewed by Mark Lam.
950
951         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
952         * PluginProcess/WebProcessConnection.cpp:
953         * Shared/WebProcessCreationParameters.h:
954         * Shared/linux/WebMemorySamplerLinux.cpp:
955         (WebKit::WebMemorySampler::sampleWebKit const):
956         * Shared/mac/WebMemorySampler.mac.mm:
957         (WebKit::WebMemorySampler::sampleWebKit const):
958         * UIProcess/API/C/WKContext.cpp:
959         (WKContextSetPlugInAutoStartOriginsFilteringOutEntriesAddedAfterTime):
960         * UIProcess/API/glib/IconDatabase.cpp:
961         (WebKit::IconDatabase::setIconDataForIconURL):
962         (WebKit::IconDatabase::synchronousLoadDecisionForIconURL):
963         (WebKit::IconDatabase::performURLImport):
964         * UIProcess/DrawingAreaProxyImpl.cpp:
965         * UIProcess/Plugins/PlugInAutoStartProvider.cpp:
966         (WebKit::expirationTimeFromNow):
967         (WebKit::PlugInAutoStartProvider::addAutoStartOriginHash):
968         (WebKit::PlugInAutoStartProvider::autoStartOriginsTableCopy const):
969         (WebKit::PlugInAutoStartProvider::setAutoStartOriginsTable):
970         (WebKit::PlugInAutoStartProvider::setAutoStartOriginsFilteringOutEntriesAddedAfterTime):
971         (WebKit::PlugInAutoStartProvider::setAutoStartOriginsTableWithItemsPassingTest):
972         (WebKit::PlugInAutoStartProvider::didReceiveUserInteraction):
973         * UIProcess/Plugins/PlugInAutoStartProvider.h:
974         * UIProcess/WebProcessPool.cpp:
975         (WebKit::WebProcessPool::processDidFinishLaunching):
976         (WebKit::WebProcessPool::startMemorySampler):
977         (WebKit::WebProcessPool::setPlugInAutoStartOriginsFilteringOutEntriesAddedAfterTime):
978         * UIProcess/WebProcessPool.h:
979         * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
980         (API::InjectedBundle::PageLoaderClient::willPerformClientRedirectForFrame):
981         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
982         (WebKit::InjectedBundlePageLoaderClient::willPerformClientRedirectForFrame):
983         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
984         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
985         (WebKit::WebFrameLoaderClient::dispatchWillPerformClientRedirect):
986         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
987         * WebProcess/WebProcess.cpp:
988         (WebKit::m_webSQLiteDatabaseTracker):
989         (WebKit::WebProcess::isPlugInAutoStartOriginHash):
990         (WebKit::WebProcess::plugInDidStartFromOrigin):
991         (WebKit::WebProcess::didAddPlugInAutoStartOriginHash):
992         (WebKit::WebProcess::resetPlugInAutoStartOriginDefaultHashes):
993         (WebKit::WebProcess::resetPlugInAutoStartOriginHashes):
994         (WebKit::WebProcess::plugInDidReceiveUserInteraction):
995         * WebProcess/WebProcess.h:
996         * WebProcess/WebProcess.messages.in:
997         * WebProcess/cocoa/WebProcessCocoa.mm:
998         * WebProcess/wpe/WebProcessMainWPE.cpp:
999
1000 2018-02-22  Matt Baker  <mattbaker@apple.com>
1001
1002         Web Inspector: REGRESSION (r228349): ImageBitmap builtin is now runtime guarded
1003         https://bugs.webkit.org/show_bug.cgi?id=183056
1004         <rdar://problem/37799067>
1005
1006         Reviewed by Joseph Pecoraro.
1007
1008         * WebProcess/WebPage/WebInspectorUI.cpp:
1009         (WebKit::WebInspectorUI::WebInspectorUI):
1010
1011 2018-02-22  Youenn Fablet  <youenn@apple.com>
1012
1013         Caches::initialize should call all pending initialization callbacks in case of error
1014         https://bugs.webkit.org/show_bug.cgi?id=183062
1015
1016         Reviewed by Chris Dumez.
1017
1018         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
1019         (WebKit::CacheStorage::Caches::initialize):
1020         (WebKit::CacheStorage::Caches::initializeSize):
1021
1022 2018-02-22  Youenn Fablet  <youenn@apple.com>
1023
1024         CacheStorage::Engine::Caches::writeRecord is not always calling the completion handler
1025         https://bugs.webkit.org/show_bug.cgi?id=183055
1026
1027         Reviewed by Chris Dumez.
1028
1029         Add a completion handler to Storage::store.
1030         Use it instead in Caches::writeRecord.
1031         This ensures that the Cache add/put promise will be called once all write operations have been done.
1032
1033         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
1034         (WebKit::CacheStorage::Caches::writeRecord):
1035         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1036         (WebKit::NetworkCache::Storage::WriteOperation::WriteOperation):
1037         (WebKit::NetworkCache::Storage::finishWriteOperation):
1038         (WebKit::NetworkCache::Storage::store):
1039         * NetworkProcess/cache/NetworkCacheStorage.h:
1040         (WebKit::NetworkCache::Storage::store):
1041
1042 2018-02-22  Ryosuke Niwa  <rniwa@webkit.org>
1043
1044         Add an entitlement check for service worker on iOS
1045         https://bugs.webkit.org/show_bug.cgi?id=182865
1046
1047         Reviewed by Dan Bernstein.
1048
1049         Addressed Dan's comment by using xpc_connection_copy_entitlement_value instead of obtaining the audit token first.
1050
1051         * Shared/mac/SandboxUtilities.h:
1052         * Shared/mac/SandboxUtilities.mm:
1053         (WebKit::connectedProcessHasEntitlement):
1054         * StorageProcess/ios/StorageProcessIOS.mm:
1055         (WebKit::StorageProcess::parentProcessHasServiceWorkerEntitlement const):
1056         * WebProcess/WebPage/ios/WebPageIOS.mm:
1057         (WebKit::WebPage::parentProcessHasServiceWorkerEntitlement const):
1058
1059 2018-02-22  Youenn Fablet  <youenn@apple.com>
1060
1061         Fetch event release assert should take into account the fetch mode
1062         https://bugs.webkit.org/show_bug.cgi?id=183047
1063
1064         Reviewed by Chris Dumez.
1065
1066         In case of navigation tasks, we should use the request URL and not the origin of the loading client.
1067
1068         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1069         (WebKit::isValidFetch):
1070         (WebKit::WebSWContextManagerConnection::startFetch):
1071
1072 2018-02-22  Yousuke Kimoto  <yousuke.kimoto@sony.com>
1073
1074         [WinCairo] Fix compile errors in WebPageWin.cpp and WebProcessWin.cpp due to WebCore forwarding header paths
1075         https://bugs.webkit.org/show_bug.cgi?id=182969
1076
1077         Reviewed by Konstantin Tokarev.
1078
1079         * WebProcess/WebPage/win/WebPageWin.cpp:
1080         * WebProcess/win/WebProcessWin.cpp:
1081
1082 2018-02-22  Yusuke Suzuki  <utatane.tea@gmail.com>
1083
1084         Remove sleep(double) and sleepMS(double) interfaces
1085         https://bugs.webkit.org/show_bug.cgi?id=183038
1086
1087         Reviewed by Mark Lam.
1088
1089         * PluginProcess/WebProcessConnection.cpp:
1090         (WebKit::WebProcessConnection::createPluginAsynchronously):
1091         * UIProcess/linux/MemoryPressureMonitor.cpp:
1092         (WebKit::pollIntervalForUsedMemoryPercentage):
1093         (WebKit::MemoryPressureMonitor::MemoryPressureMonitor):
1094         * WebProcess/wpe/WebProcessMainWPE.cpp:
1095
1096 2018-02-22  Youenn Fablet  <youenn@apple.com>
1097
1098         Add release logging for CacheStorage::Engine disk related functions
1099         https://bugs.webkit.org/show_bug.cgi?id=183042
1100
1101         Reviewed by Chris Dumez.
1102
1103         * NetworkProcess/cache/CacheStorageEngine.cpp:
1104         (WebKit::CacheStorage::Engine::writeFile):
1105         (WebKit::CacheStorage::Engine::readFile):
1106
1107 2018-02-22  Matt Lewis  <jlewis3@apple.com>
1108
1109         Unreviewed, rolling out r228902.
1110
1111         This broke internal builds.
1112
1113         Reverted changeset:
1114
1115         "[Cocoa] Web Automation: provide a way to ask clients the type
1116         of a JavaScript dialog"
1117         https://bugs.webkit.org/show_bug.cgi?id=182660
1118         https://trac.webkit.org/changeset/228902
1119
1120 2018-02-22  Youenn Fablet  <youenn@apple.com>
1121
1122         Add release asserts for service worker fetch and postMessage events
1123         https://bugs.webkit.org/show_bug.cgi?id=183025
1124         rdar://problem/37765052
1125
1126         Reviewed by Daniel Bates.
1127
1128         Add assertion to protect interception of a fetch load by a service worker with
1129         a different origin from the page.
1130
1131         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1132         (WebKit::WebSWContextManagerConnection::startFetch):
1133
1134 2018-02-22  Ms2ger  <Ms2ger@igalia.com>
1135
1136         [GTK][WPE] Fix some build errors in service workers code
1137         https://bugs.webkit.org/show_bug.cgi?id=182966
1138
1139         Reviewed by Žan Doberšek.
1140
1141         * CMakeLists.txt: add missing files.
1142         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: add missing includes.
1143         * UIProcess/ServiceWorkerProcessProxy.cpp: use #include rather than #import in C++; add missing ifdef.
1144         * UIProcess/ServiceWorkerProcessProxy.h: add missing ifdef.
1145         * WebProcess/Storage/WebSWClientConnection.cpp: add missing includes.
1146         * WebProcess/Storage/WebSWContextManagerConnection.cpp: add missing includes.
1147         (WebKit::WebSWContextManagerConnection::WebSWContextManagerConnection):
1148           call the function that exists outside cocoa.
1149
1150 2018-02-21  Per Arne Vollan  <pvollan@apple.com>
1151
1152         The WebContent process should not use NSScreen in the screenAvailableRect/screenRect implementations.
1153         https://bugs.webkit.org/show_bug.cgi?id=182855
1154
1155         Reviewed by Brent Fulgham.
1156
1157         On macOS, the functions screenAvailableRect and screenRect is implemented using NSScreen, which is communicating
1158         with the WindowServer. To avoid this WindowServer communication from the WebContent process when calling
1159         screenAvailableRect and screenRect, it is possible to let the UIProcess send a message to the WebContent
1160         process whenever there is a change in the display properties, and have the WebContent process cache these
1161         display properties. This message should also be sent to a newly started WebContent process.
1162
1163         * UIProcess/WebProcessPool.cpp:
1164         (WebKit::displayReconfigurationCallBack):
1165         (WebKit::registerDisplayConfigurationCallback):
1166         (WebKit::WebProcessPool::initializeNewWebProcess):
1167         (WebKit::WebProcessPool::warmInitialProcess):
1168         * WebProcess/WebProcess.cpp:
1169         (WebKit::WebProcess::setScreenProperties):
1170         * WebProcess/WebProcess.h:
1171         * WebProcess/WebProcess.messages.in:
1172
1173 2018-02-21  Christopher Reid  <chris.reid@sony.com>
1174
1175         [Curl] Curl Cookie Database File should be configurable using NetworkProcessCreationParameters
1176         https://bugs.webkit.org/show_bug.cgi?id=182751
1177
1178         Reviewed by Youenn Fablet.
1179
1180         Adding a cookiePersistentStorageFile parameter to Curl's NetworkProcessCreationParameters.
1181         This parameter is based on Soup's cookiePersistentStoragePath.
1182         This parameter is not used yet, it is added to prepare for WinCairo WebKit support.
1183
1184         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1185         * NetworkProcess/NetworkProcessCreationParameters.h:
1186         * NetworkProcess/curl/NetworkProcessCurl.cpp:
1187         * WebProcess/Cookies/WebCookieManager.h:
1188         * WebProcess/Cookies/curl/WebCookieManagerCurl.cpp:
1189
1190 2018-02-21  Brian Burg  <bburg@apple.com>
1191
1192         [Cocoa] Web Automation: provide a way to ask clients the type of a JavaScript dialog
1193         https://bugs.webkit.org/show_bug.cgi?id=182660
1194         <rdar://problem/37408183>
1195
1196         Reviewed by Tim Horton and Carlos Garcia Campos.
1197
1198         Add another delegate method to ask what type of dialog is being shown.
1199         This is used to implement §18.4 Step 5, where sending text to a dialog
1200         without a prompt will return several different kinds of errors.
1201
1202         No new tests, covered by web platform tests once Safari side has landed.
1203
1204         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h: Update FIXME radar numbers.
1205         * UIProcess/Cocoa/AutomationSessionClient.h:
1206         * UIProcess/Cocoa/AutomationSessionClient.mm:
1207         (WebKit::AutomationSessionClient::AutomationSessionClient):
1208         (WebKit::toImpl):
1209         (WebKit::AutomationSessionClient::typeOfCurrentJavaScriptDialogOnPage):
1210         If there is no current dialog to be checked, the client can return the 'None'
1211         type. This gets converted into a std::nullopt and causes a command error later.
1212
1213 2018-02-21  Yousuke Kimoto  <yousuke.kimoto@sony.com>
1214
1215         [WinCairo] Fix compile errors of WebProcess and NetworkProcess due to no implementation for windows
1216         https://bugs.webkit.org/show_bug.cgi?id=182870
1217
1218         Reviewed by Youenn Fablet.
1219
1220         * NetworkProcess/NetworkProcess.cpp:
1221         (WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
1222         * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
1223         (WebKit::PluginProcessConnectionManager::getPluginProcessConnection):
1224         * WebProcess/WebPage/WebInspector.cpp:
1225         (WebKit::WebInspector::openFrontendConnection):
1226         * WebProcess/WebPage/WebInspectorUI.cpp:
1227         (WebKit::WebInspectorUI::establishConnection):
1228         * WebProcess/WebProcess.cpp:
1229         (WebKit::WebProcess::ensureNetworkProcessConnection):
1230
1231 2018-02-21  Don Olmstead  <don.olmstead@sony.com>
1232
1233         [CMake][Win] Use cmakeconfig.h rather than config.h and Platform.h
1234         https://bugs.webkit.org/show_bug.cgi?id=182883
1235
1236         Reviewed by Per Arne Vollan.
1237
1238         * config.h:
1239
1240 2018-02-21  Brian Burg  <bburg@apple.com>
1241
1242         Web Automation: failed provisional loads cause "Navigate To" command to hang
1243         https://bugs.webkit.org/show_bug.cgi?id=183007
1244         <rdar://problem/37751819>
1245
1246         Reviewed by Andy Estes.
1247
1248         This hang was revealed by WPT test current_url.py::get_current_url_file_protocol. Now the
1249         test simply fails because Safari chooses a policy of 'Ignore' for externally-opened files.
1250         I filed an upstream issue with the test here: https://github.com/w3c/webdriver/issues/1232
1251
1252         * UIProcess/WebPageProxy.cpp:
1253         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
1254         Notify the session that the load failed in the frame, just like we do
1255         for non-provisional failed loads and successful loads.
1256
1257 2018-02-20  Nan Wang  <n_wang@apple.com>
1258
1259         AX: Keyboard focus not following VoiceOver cursor into web content or within web content.
1260         https://bugs.webkit.org/show_bug.cgi?id=182752
1261         <rdar://problem/37518233>
1262
1263         Reviewed by Ryosuke Niwa.
1264
1265         * UIProcess/PageClient.h:
1266         * UIProcess/WebPageProxy.h:
1267         * UIProcess/WebPageProxy.messages.in:
1268         * UIProcess/ios/PageClientImplIOS.h:
1269         * UIProcess/ios/PageClientImplIOS.mm:
1270         (WebKit::PageClientImpl::assistiveTechnologyMakeFirstResponder):
1271         * UIProcess/ios/WebPageProxyIOS.mm:
1272         (WebKit::WebPageProxy::assistiveTechnologyMakeFirstResponder):
1273         * UIProcess/mac/PageClientImplMac.h:
1274         * UIProcess/mac/PageClientImplMac.mm:
1275         (WebKit::PageClientImpl::assistiveTechnologyMakeFirstResponder):
1276         * UIProcess/mac/WebPageProxyMac.mm:
1277         (WebKit::WebPageProxy::assistiveTechnologyMakeFirstResponder):
1278         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1279         (WebKit::WebChromeClient::assistiveTechnologyMakeFirstResponder):
1280         * WebProcess/WebCoreSupport/WebChromeClient.h:
1281
1282 2018-02-14  Brian Burg  <bburg@apple.com>
1283
1284         Web Automation: combine session commands to resize and move top-level browsing contexts
1285         https://bugs.webkit.org/show_bug.cgi?id=182749
1286         <rdar://problem/37515170>
1287
1288         Reviewed by Andy Estes.
1289
1290         Since moving and resizing the window are both accomplished by setting the window frame,
1291         and the W3C WebDriver specification has a Get/Set Window Rect command, it's time to
1292         deduplicate these two methods which basically do the same thing.
1293
1294         Adopt modern JSON::Value getters that return std::optional<float>. I have been trying
1295         to move the protocol over to this style wholesale, but it is probably easier to do
1296         this conversion in smaller pieces. And so, I have started to do so.
1297
1298         This change is covered by existing WebDriver tests.
1299
1300         * UIProcess/Automation/Automation.json: Add new command.
1301         * UIProcess/Automation/WebAutomationSession.cpp:
1302         (WebKit::WebAutomationSession::setWindowFrameOfBrowsingContext): Added.
1303         (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext): Deleted.
1304         (WebKit::WebAutomationSession::moveWindowOfBrowsingContext): Deleted.
1305         * UIProcess/Automation/WebAutomationSession.h:
1306
1307 2018-02-20  Brian Burg  <bburg@apple.com>
1308
1309         ASSERT under WebAutomationSession::setProcessPool() when running W3C test suite a second time
1310         https://bugs.webkit.org/show_bug.cgi?id=182991
1311         <rdar://problem/37620578>
1312
1313         Reviewed by Timothy Hatcher.
1314
1315         Sometimes when running more than one session end-to-end with the same browser instance,
1316         UIProcess would crash under addMessageReceiver because another WebAutomationSession was still
1317         registered. This is hard to reproduce, but upon code inspection, the receiver management code
1318         is somewhat problematic because it only runs when the WebAutomationSession destructor runs.
1319         In some cases the client could retain two sessions and cause the first one to never remove itself
1320         as the message receiver.
1321
1322         Instead of unregistering the session as a message receiver underneath the session's destructor,
1323         do this whenever a new session supplants an old session since there is only one active session at a time.
1324
1325         * UIProcess/Automation/WebAutomationSession.cpp:
1326         (WebKit::WebAutomationSession::~WebAutomationSession):
1327         * UIProcess/WebProcessPool.cpp:
1328         (WebKit::WebProcessPool::setAutomationSession):
1329
1330 2018-02-20  Tim Horton  <timothy_horton@apple.com>
1331
1332         Introduce HAVE(IOSURFACE_ACCELERATOR)
1333         https://bugs.webkit.org/show_bug.cgi?id=182955
1334         <rdar://problem/37699510>
1335
1336         Reviewed by Sam Weinig.
1337
1338         * Shared/RemoteLayerTree/RemoteLayerBackingStore.h:
1339         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
1340         * Shared/cg/ShareableBitmapCG.cpp:
1341         * UIProcess/API/Cocoa/WKWebView.mm:
1342         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
1343         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
1344         * UIProcess/mac/ViewSnapshotStore.h:
1345         * UIProcess/mac/ViewSnapshotStore.mm:
1346
1347 2018-02-20  Chris Dumez  <cdumez@apple.com>
1348
1349         Provisional load may get committed before receiving the decidePolicyForNavigationResponse response
1350         https://bugs.webkit.org/show_bug.cgi?id=182720
1351         <rdar://problem/37515204>
1352
1353         Reviewed by Alex Christensen.
1354
1355         * WebProcess/Network/WebResourceLoader.cpp:
1356         (WebKit::WebResourceLoader::didReceiveResponse):
1357         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
1358         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
1359         * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp:
1360         (WebKit::WebURLSchemeTaskProxy::didReceiveResponse):
1361
1362 2018-02-20  Matt Lewis  <jlewis3@apple.com>
1363
1364         Unreviewed, rolling out r228829.
1365
1366         This caused a consistent failure in the API test
1367         WebKit.InteractionDeadlockAfterCrash on iOS Simulator
1368
1369         Reverted changeset:
1370
1371         "Switch to UIWKTextInteractionAssistant for non-editable text"
1372         https://bugs.webkit.org/show_bug.cgi?id=182834
1373         https://trac.webkit.org/changeset/228829
1374
1375 2018-02-20  Megan Gardner  <megan_gardner@apple.com>
1376
1377         Switch to UIWKTextInteractionAssistant for non-editable text
1378         https://bugs.webkit.org/show_bug.cgi?id=182834
1379         
1380         Reviewed by Wenson Hsieh and Tim Horton.
1381         
1382         Switching to only using the UIWKTextInteractionAssistant. Only character granularity is now supported. 
1383         Also keep the from regressing gating the keyboard bring up on user interaction. The presents of a  
1384         textInteractionAssistant can no longer be used as proxy for the presence of the keyboard.
1385
1386         * UIProcess/ios/WKContentViewInteraction.mm:
1387         (-[WKContentView useSelectionAssistantWithGranularity:]):
1388         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
1389
1390 2018-02-20  John Wilander  <wilander@apple.com>
1391
1392         Make WebResourceLoadStatisticsStore::processStatisticsAndDataRecords() call WebProcessProxy::notifyPageStatisticsAndDataRecordsProcessed() in a proper callback
1393         https://bugs.webkit.org/show_bug.cgi?id=182719
1394         <rdar://problem/37517370>
1395
1396         Reviewed by Brent Fulgham.
1397
1398         This will allow the page notification, statistics pruning, and persistence write
1399         to be done at the right time and hopefully stabilize the layout tests including:
1400         http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-deletion.html
1401
1402         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1403         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
1404             Now takes a callback parameter.
1405         (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
1406         * UIProcess/WebResourceLoadStatisticsStore.h:
1407             Now calls WebProcessProxy::notifyPageStatisticsAndDataRecordsProcessed()
1408             in a callback provided to WebResourceLoadStatisticsStore::removeDataRecords().
1409
1410 2018-02-20  Zan Dobersek  <zdobersek@igalia.com>
1411
1412         [Cairo] Drop target GraphicsContext usage in Cairo operations
1413         https://bugs.webkit.org/show_bug.cgi?id=182964
1414
1415         Reviewed by Carlos Garcia Campos.
1416
1417         The GraphicsContext parameters in various Cairo operations are not used
1418         anymore, so they can be removed. Callsites are updated to reflect this.
1419
1420         * Shared/cairo/ShareableBitmapCairo.cpp:
1421         (WebKit::ShareableBitmap::paint):
1422         * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
1423         (WebKit::convertCairoSurfaceToShareableBitmap):
1424
1425 2018-02-20  Philippe Normand  <pnormand@igalia.com>
1426
1427         [GStreamer][MiniBrowser] Honor GStreamer command line parameters in MiniBrowser
1428         https://bugs.webkit.org/show_bug.cgi?id=173655
1429
1430         Reviewed by Xabier Rodriguez-Calvar.
1431
1432         The FIXME in GStreamerUtilities.cpp asks to pass the command line
1433         parameters to the GStreamer initialization function.
1434
1435         Based on initial patch by: Vanessa Chipirrás Navalón  <vchipirras@igalia.com>
1436
1437         * Shared/WebProcessCreationParameters.cpp:
1438         (WebKit::WebProcessCreationParameters::encode const):
1439         (WebKit::WebProcessCreationParameters::decode):
1440         * Shared/WebProcessCreationParameters.h: Define the vector which contains the GStreamer options.
1441         * UIProcess/gtk/WebProcessPoolGtk.cpp:
1442         (WebKit::WebProcessPool::platformInitializeWebProcess): Read from cmdline file
1443         the GStreamer options written by console.
1444         * WebProcess/soup/WebProcessSoup.cpp:
1445         (WebKit::WebProcess::platformInitializeWebProcess): Call initializeGStreamer() method passing
1446         the vector which contains the options.
1447
1448 2018-02-20  Yousuke Kimoto  <yousuke.kimoto@sony.com>
1449
1450         [Win] Fix MSVC's treating __attribute__((warn_unused_result))
1451         https://bugs.webkit.org/show_bug.cgi?id=182479
1452
1453         Reviewed by Darin Adler.
1454
1455         Since MSVC doesn't understand "__attribute__", "_Check_return_" is used instead.
1456         If clang and VisualStudio 2017 are used, a macro with "__attriute__" will be chosen.
1457
1458         * UIProcess/API/cpp/WKRetainPtr.h:
1459
1460 2018-02-19  Brady Eidson  <beidson@apple.com>
1461
1462         Add WebProcessPool option for process swapping on navigation.
1463         https://bugs.webkit.org/show_bug.cgi?id=182945
1464
1465         Reviewed by Alex Christensen.
1466
1467         Just the most basic groundwork for testing a new WK2 feature.
1468
1469         * UIProcess/API/APIProcessPoolConfiguration.h:
1470
1471         * UIProcess/API/C/WKContextConfigurationRef.cpp:
1472         (WKContextConfigurationProcessSwapsOnNavigation):
1473         (WKContextConfigurationSetProcessSwapsOnNavigation):
1474         * UIProcess/API/C/WKContextConfigurationRef.h:
1475
1476         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
1477         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
1478         (-[_WKProcessPoolConfiguration setProcessSwapsOnNavigation:]):
1479         (-[_WKProcessPoolConfiguration processSwapsOnNavigation]):
1480
1481 2018-02-19  Daniel Bates  <dabates@apple.com>
1482
1483         Null pointer dereference in WebPageProxy::urlSchemeHandlerForScheme()
1484         https://bugs.webkit.org/show_bug.cgi?id=182905
1485         <rdar://problem/37676775>
1486
1487         Reviewed by Alex Christensen.
1488
1489         Return nullptr when querying for the scheme handler of the null string.
1490
1491         Before a navigation is performed WebKit checks if the destination URL is associated with an app
1492         unless the embedding client overrides the WKNavigationDelegate delegate callback -webView:decidePolicyForNavigationAction:decisionHandler.
1493         If the URL is not associated with an app then WebKit may fall back to checking if the embedding
1494         client registered a scheme handler for it. Currently we assume that the scheme is a non-null
1495         string when checking the scheme handler registry. However the scheme can be a null string if
1496         it is part of a malformed URL. And this leads to bad news bears when we try to use it to look
1497         for a scheme handler. Instead check that the scheme is a non-null string before checking to see
1498         if it is in the scheme handler registry.
1499
1500         * UIProcess/WebPageProxy.cpp:
1501         (WebKit::WebPageProxy::urlSchemeHandlerForScheme):
1502
1503 2018-02-19  Eric Carlson  <eric.carlson@apple.com>
1504
1505         [Extra zoom mode] Don't allow PiP media playback
1506         https://bugs.webkit.org/show_bug.cgi?id=182930
1507         <rdar://problem/37676259>
1508
1509         Reviewed by Andy Estes.
1510
1511         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1512         (-[WKWebViewConfiguration init]): Don't enable PiP mode. Require user interaction for
1513         all media types.
1514
1515 2018-02-19  Ryan Haddad  <ryanhaddad@apple.com>
1516
1517         Unreviewed, rolling out r228696.
1518
1519         The API test added with this change is timing out on macOS.
1520
1521         Reverted changeset:
1522
1523         "Null pointer dereference in
1524         WebPageProxy::urlSchemeHandlerForScheme()"
1525         https://bugs.webkit.org/show_bug.cgi?id=182905
1526         https://trac.webkit.org/changeset/228696
1527
1528 2018-02-19  Daniel Bates  <dabates@apple.com>
1529
1530         Null pointer dereference in WebPageProxy::urlSchemeHandlerForScheme()
1531         https://bugs.webkit.org/show_bug.cgi?id=182905
1532
1533         Reviewed by Alex Christensen.
1534
1535         Return nullptr when querying for the scheme handler of the null string.
1536
1537         Before a navigation is performed WebKit checks if the destination URL is associated with an app
1538         unless the embedding client overrides the WKNavigationDelegate delegate callback -webView:decidePolicyForNavigationAction:decisionHandler.
1539         If the URL is not associated with an app then WebKit may fall back to checking if the embedding
1540         client registered a scheme handler for it. Currently we assume that the scheme is a non-null
1541         string when checking the scheme handler registry. However the scheme can be a null string if
1542         it is part of a malformed URL. And this leads to bad news bears when we try to use it to look
1543         for a scheme handler. Instead check that the scheme is a non-null string before checking to see
1544         if it is in the scheme handler registry.
1545
1546         * UIProcess/WebPageProxy.cpp:
1547         (WebKit::WebPageProxy::urlSchemeHandlerForScheme):
1548
1549 2018-02-19  Ms2ger  <Ms2ger@igalia.com>
1550
1551         Explicitly qualify some method calls on this in lamdas in Service Worker code.
1552         https://bugs.webkit.org/show_bug.cgi?id=182875
1553
1554         Reviewed by Chris Dumez.
1555
1556         This is necessary for the code to build with GCC 5. Other code already
1557         appears to have been adapted similarly.
1558
1559         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1560         (WebKit::WebSWServerConnection::startFetch):
1561
1562 2018-02-18  Reza Abbasian  <rabbasian@apple.com>
1563
1564         Set the appropriate AutoFill context for suggested passwords.
1565         https://bugs.webkit.org/show_bug.cgi?id=182718
1566         <rdar://problem/36326863>
1567
1568         Reviewed by Wenson Hsieh and Tim Horton.
1569
1570         Before starting the input session, call the new delegate to query if AutoFill password suggestion assistance
1571         is required for the focused element.
1572
1573         * UIProcess/API/Cocoa/_WKFormInputSession.h:
1574         * UIProcess/API/Cocoa/_WKInputDelegate.h:
1575         Introduce a new delegate to be called  before starting an input session to query if AutoFill password suggestion
1576         assistance is required for the focused element.
1577         * UIProcess/ios/WKContentViewInteraction.h:
1578         * UIProcess/ios/WKContentViewInteraction.mm:
1579         (-[WKFormInputSession initWithContentView:focusedElementInfo:requiresStrongPasswordAssistance:]):
1580         (-[WKFormInputSession requiresStrongPasswordAssistance]):
1581         (-[WKContentView cleanupInteraction]):
1582         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
1583         Call the delegate to find out if AutoFill suggested password assistance is required.
1584         (-[WKContentView _stopAssistingNode]):
1585         (-[WKContentView _autofillContext]): If the first responder is a password element and requires
1586         assistance for AutoFill suggested password, set the appropriate AutoFill context.
1587         (-[WKFormInputSession initWithContentView:focusedElementInfo:]): Deleted.
1588
1589 2018-02-17  Wenson Hsieh  <wenson_hsieh@apple.com>
1590
1591         [Extra zoom mode] Form control values are stale after dismissing and representing input view controllers
1592         https://bugs.webkit.org/show_bug.cgi?id=182877
1593         <rdar://problem/37604395>
1594
1595         Reviewed by Tim Horton.
1596
1597         Currently, when presenting an input view controller for a focused element, we populate the initial form control
1598         value using the WKContentView's assisted node information when it was last focused. However, if the user edits
1599         the value of a form control, dismisses to the form control view controller (while the element is still focused)
1600         and then begins editing the field again, the initial text will be the previous value of the input, since the
1601         AssistedNodeInformation isn't up to date.
1602
1603         To fix this, we introduce a mechanism to update WKContentView's AssistedNodeInformation for the current assisted
1604         node. This overwrites _assistedNodeInformation with new information computed from the web process, as long as
1605         the assisted node before and after the request is made in the UI process has not changed. We accomplish this by
1606         adding an identifier to AssistedNodeInformation, which is monotonically incremented when an element is focused
1607         in the web process. The UI process may then use this identifier to determine whether AssistedNodeInformations
1608         are describing the same focused element.
1609
1610         One interesting consideration here is that a normal AssistedNodeInformation update (propagated when focusing an
1611         element) may be deferred in the UI process until the next layer tree commit. In the absence of the assisted node
1612         identifier check, one could imagine a scenario in which the assisted node information in the UI process gets
1613         "updated" from a new value to an old value:
1614
1615         1. The web process focuses an element and sends AssistedNodeInformation `A`.
1616         2. WKContentView calls -updateCurrentAssistedNodeInformation.
1617         3. The web process sends AssistedNodeInformation `B`.
1618         4. `A` is received in the UI process, but deferred.
1619         5. The UI process receives `B` and sets _assistedNodeInformation to `B`.
1620         6. The UI process calls -_startAssistingNode: and sets _assistedNodeInformation to `A`.
1621
1622         This would mean that the _assistedNodeInformation is set to an earlier value, `A`, after being set to a later
1623         value, `B`. However, because the AssistedNodeInformation identifier in step (2) refers to the assisted node
1624         prior to step (1), the assisted node identifier in (5) would not match this identifier, and we would simply bail
1625         instead of overwriting assisted node information.
1626
1627         We use this AssistedNodeInformation update mechanism after inserting text via input view controllers, and also
1628         after reentering edit mode from the focused form control view controller. This fixes two issues where changing
1629         the size of the focused element after editing it results in the focused form overlay highlighting a stale frame,
1630         and also when setting the initial text when reentering edit mode for a form control that is already focused.
1631
1632         * Shared/AssistedNodeInformation.cpp:
1633         (WebKit::AssistedNodeInformation::encode const):
1634         (WebKit::AssistedNodeInformation::decode):
1635         * Shared/AssistedNodeInformation.h:
1636
1637         Add a new monotonically increasing identifier (per WebPage) which associates a AssistedNodeInformation with a
1638         focused element. In the event that the web process crashes and relaunches (thus resetting this identifier),
1639         AssistedNodeInformation state in the UI process is now also reset (see -cleanupInteraction), so we won't end up
1640         confusing AssistedNodeInformations computed by different WebPages between a web process crash.
1641
1642         * UIProcess/WebPageProxy.h:
1643
1644         A bit of related refactoring here to remove an unnecessary bool flag that indicates whether we have a deferred
1645         assisted node information. Instead, just use the presence of m_deferredNodeAssistanceArguments.
1646
1647         * UIProcess/WebPageProxy.messages.in:
1648
1649         Add a AssistedNodeInformationCallback IPC message.
1650
1651         * UIProcess/ios/WKContentViewInteraction.mm:
1652         (-[WKContentView cleanupInteraction]):
1653
1654         Clear out the previous AssistedNodeInformation. See above for details.
1655
1656         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
1657         (-[WKContentView updateCurrentAssistedNodeInformation:]):
1658
1659         Tries to update AssistedNodeInformation for the current assisted node, invoking the completion callback when
1660         finished. This may result in the assisted node information not being updated due to the current assisted node
1661         changing in the time between the start of the request and the information being received in the UI process.
1662
1663         (-[WKContentView presentViewControllerForCurrentAssistedNode]):
1664
1665         Refactored from -presentViewControllerForAssistedNode:, such that it no longer takes an AssistedNodeInformation
1666         as an argument, but rather just uses WKContentView's current _assistedNodeInformation. This was just being
1667         called with _assistedNodeInformation from all call sites anyways.
1668
1669         (-[WKContentView textInputController:didCommitText:]):
1670
1671         Request an AssistedNodeInformation update after setting the value of a form control; if the assisted node hasn't
1672         changed, update the focused form control overlay. This is needed to handle cases where the focused element's
1673         frame may have changed after inserting text (e.g. due to line wrapping), and the focused form control overlay
1674         needs to be updated to reflect this change.
1675
1676         (-[WKContentView focusedFormControlControllerDidBeginEditing:]):
1677
1678         Request an AssistedNodeInformation update before reentering edit mode; if the assisted node hasn't changed since
1679         the start of the request, present the appropriate input view controller.
1680
1681         (-[WKContentView presentViewControllerForAssistedNode:]): Deleted.
1682         * UIProcess/ios/WebPageProxyIOS.mm:
1683         (WebKit::WebPageProxy::assistedNodeInformationCallback):
1684         (WebKit::WebPageProxy::requestAssistedNodeInformation):
1685         (WebKit::WebPageProxy::didCommitLayerTree):
1686         (WebKit::WebPageProxy::startAssistingNode):
1687         (WebKit::WebPageProxy::stopAssistingNode):
1688         * WebProcess/WebPage/WebPage.cpp:
1689         (WebKit::WebPage::elementDidFocus):
1690
1691         Increment the assisted node identifier.
1692
1693         * WebProcess/WebPage/WebPage.h:
1694         * WebProcess/WebPage/WebPage.messages.in:
1695         * WebProcess/WebPage/ios/WebPageIOS.mm:
1696         (WebKit::WebPage::requestAssistedNodeInformation):
1697
1698         Compute and return an AssistedNodeInformation.
1699
1700         (WebKit::WebPage::getAssistedNodeInformation):
1701
1702 2018-02-16  Dean Jackson  <dino@apple.com>
1703
1704         Use OPENGL macros to be more clear about which OpenGL/ES WebGL uses on Cocoa
1705         https://bugs.webkit.org/show_bug.cgi?id=182894
1706
1707         Reviewed by Tim Horton.
1708
1709         Rename OPENGL_ES_2 to OPENGL_ES.
1710
1711         * CMakeLists.txt:
1712         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1713         * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
1714         (WebKit::AcceleratedBackingStoreWayland::paint):
1715         * UIProcess/gtk/WaylandCompositor.cpp:
1716         (WebKit::WaylandCompositor::initializeEGL):
1717
1718 2018-02-16  Ryosuke Niwa  <rniwa@webkit.org>
1719
1720         Add an entitlement check for service worker on iOS
1721         https://bugs.webkit.org/show_bug.cgi?id=182865
1722         <rdar://problem/37505903>
1723
1724         Reviewed by Brady Eidson.
1725
1726         Added an entitlement check to enable service workers on iOS.
1727
1728         * Shared/mac/SandboxUtilities.h:
1729         * Shared/mac/SandboxUtilities.mm:
1730         (WebKit::connectedProcessHasEntitlement): Added.
1731         * StorageProcess/StorageProcess.cpp:
1732         (WebKit::StorageProcess::createStorageToWebProcessConnection): Enforce the entitlement check by crashing
1733         when this code is executed without the parent process having the service worker entitlement. This should
1734         never happen unless someone is trying to bypass the entitlement check in UI Process since we ordinarily
1735         disable service worker gracefully in WKWebView _initializeWithConfiguration.
1736         (WebKit::StorageProcess::swServerForSession): Ditto.
1737         (WebKit::StorageProcess::registerSWServerConnection): Ditto.
1738         * StorageProcess/StorageProcess.h:
1739         (WebKit::StorageProcess::parentProcessHasServiceWorkerEntitlement const): Added.
1740         * StorageProcess/ios/StorageProcessIOS.mm:
1741         (WebKit::StorageProcess::parentProcessHasServiceWorkerEntitlement const): Added.
1742         * UIProcess/API/Cocoa/WKWebView.mm:
1743         (-[WKWebView _initializeWithConfiguration:]): Disable the service workers when the entitlement is
1744         missing from the current process. The entitlement is enforced by WebContent and Storage process.
1745         This check avoids crashing WebContent process and gracefully disabling the feature.
1746         * WebProcess/WebPage/WebPage.cpp:
1747         (WebKit::WebPage::updatePreferences): Enforce the entitlement check.
1748         * WebProcess/WebPage/WebPage.h:
1749         (WebKit::WebPage::parentProcessHasServiceWorkerEntitlement const): Added.
1750         * WebProcess/WebPage/ios/WebPageIOS.mm:
1751         (WebKit::WebPage::parentProcessHasServiceWorkerEntitlement const): Added.
1752
1753 2018-02-16  Youenn Fablet  <youenn@apple.com>
1754
1755         Allow specifying which plug-ins are supported
1756         https://bugs.webkit.org/show_bug.cgi?id=182748
1757
1758         Reviewed by Chris Dumez.
1759
1760         Add a C and ObjC API to set which plug-ins are specified.
1761         Plug-ins may be allowed by origin of the main page or for all origins.
1762
1763         If the API to set a supported plug-in is called, WebKit enters a mode
1764         where it will block any plug-in that is not on the list.
1765
1766         The list of supported plug-ins is stored in UIProcess and sent to WebProcess.
1767         This allows to compute the list of visible plug-ins according supported plugins.
1768
1769         PluginInfoStore is storing the list of supported plugins and can
1770         answer whether a plug-in creation request is to be made unsupported or not.
1771         It also creates the structure sent to WebProcess for computing plugin visibility.
1772
1773         Updated ArgumentCoders to accept modern HashSet decoders.
1774
1775         * Platform/IPC/ArgumentCoders.h:
1776         * UIProcess/API/C/WKContext.cpp:
1777         (WKContextAddSupportedPlugin):
1778         (WKContextClearSupportedPlugins):
1779         * UIProcess/API/C/WKContextPrivate.h:
1780         * UIProcess/API/Cocoa/WKProcessPool.mm:
1781         (-[WKProcessPool _addSupportedPlugin:named:withMimeTypes:withExtensions:]):
1782         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1783         * UIProcess/Plugins/PluginInfoStore.cpp:
1784         (WebKit::PluginInfoStore::isSupportedPlugin):
1785         (WebKit::PluginInfoStore::SupportedPlugins::isSupported):
1786         (WebKit::PluginInfoStore::SupportedPlugin::isSupported):
1787         (WebKit::PluginInfoStore::supportedPluginNames):
1788         (WebKit::PluginInfoStore::addSupportedPlugin):
1789         * UIProcess/Plugins/PluginInfoStore.h:
1790         (WebKit::PluginInfoStore::clearSupportedPlugins):
1791         * UIProcess/WebPageProxy.cpp:
1792         (WebKit::WebPageProxy::findPlugin):
1793         (WebKit::WebPageProxy::unavailablePluginButtonClicked):
1794         * UIProcess/WebPageProxy.h:
1795         * UIProcess/WebPageProxy.messages.in:
1796         * UIProcess/WebProcessPool.cpp:
1797         (WebKit::WebProcessPool::addSupportedPlugin):
1798         (WebKit::WebProcessPool::clearSupportedPlugins):
1799         * UIProcess/WebProcessPool.h:
1800         * UIProcess/WebProcessProxy.cpp:
1801         (WebKit::WebProcessProxy::getPlugins):
1802         * UIProcess/WebProcessProxy.h:
1803         * UIProcess/WebProcessProxy.messages.in:
1804         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
1805         (WebKit::WebPluginInfoProvider::getPluginInfo):
1806         (WebKit::WebPluginInfoProvider::getWebVisiblePluginInfo):
1807         (WebKit::WebPluginInfoProvider::populatePluginCache):
1808         * WebProcess/Plugins/WebPluginInfoProvider.h:
1809         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1810         (WebKit::WebChromeClient::shouldUnavailablePluginMessageBeButton const):
1811         * WebProcess/WebPage/WebPage.cpp:
1812         (WebKit::WebPage::createPlugin):
1813         (WebKit::WebPage::canPluginHandleResponse):
1814
1815 2018-02-16  Jiewen Tan  <jiewen_tan@apple.com>
1816
1817         [WebAuthN] Implement PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable()
1818         https://bugs.webkit.org/show_bug.cgi?id=182771
1819         <rdar://problem/36459988>
1820
1821         Reviewed by Brent Fulgham.
1822
1823         This patch utilizes LocalAuthentication Framework to determine if biometrics
1824         are enrolled on a device, which is the user verifying platform authenticator.
1825         To do so, it links the framework to WebKit.
1826
1827         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.cpp:
1828         (WebKit::WebCredentialsMessengerProxy::isUserVerifyingPlatformAuthenticatorAvailable):
1829         (WebKit::WebCredentialsMessengerProxy::isUserVerifyingPlatformAuthenticatorAvailableReply):
1830         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.h:
1831         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.messages.in:
1832         * UIProcess/CredentialManagement/cocoa/WebCredentialsMessengerProxyCocoa.mm:
1833         (WebKit::WebCredentialsMessengerProxy::platformIsUserVerifyingPlatformAuthenticatorAvailable):
1834         * WebKit.xcodeproj/project.pbxproj:
1835         * WebProcess/CredentialManagement/WebCredentialsMessenger.cpp:
1836         (WebKit::WebCredentialsMessenger::isUserVerifyingPlatformAuthenticatorAvailable):
1837         (WebKit::WebCredentialsMessenger::isUserVerifyingPlatformAuthenticatorAvailableReply):
1838         * WebProcess/CredentialManagement/WebCredentialsMessenger.h:
1839         * WebProcess/CredentialManagement/WebCredentialsMessenger.messages.in:
1840
1841 2018-02-16  Per Arne Vollan  <pvollan@apple.com>
1842
1843         Implement stopping of run loop in the WebContent process when using NSRunLoop.
1844         https://bugs.webkit.org/show_bug.cgi?id=182499
1845         <rdar://problem/37247424>
1846
1847         Reviewed by Brent Fulgham.
1848
1849         Add the method ChildProcess::stopNSRunLoop to end the WebContent process by executing a block
1850         with 'exit(0)' on the main run loop. 
1851
1852         * Shared/ChildProcess.h:
1853         * Shared/mac/ChildProcessMac.mm:
1854         (WebKit::ChildProcess::stopNSRunLoop):
1855         * WebProcess/cocoa/WebProcessCocoa.mm:
1856         (WebKit::WebProcess::platformInitializeWebProcess):
1857         (WebKit::WebProcess::stopRunLoop):
1858
1859 2018-02-16  Yousuke Kimoto  <yousuke.kimoto@sony.com>
1860
1861         [WinCario] Add NetworkSessionCurl
1862         https://bugs.webkit.org/show_bug.cgi?id=182680
1863
1864         Reviewed by Konstantin Tokarev.
1865
1866         * NetworkProcess/NetworkSession.cpp:
1867         (WebKit::NetworkSession::create):
1868         * PlatformWin.cmake:
1869
1870 2018-02-16  Chris Dumez  <cdumez@apple.com>
1871
1872         ASSERTION FAILED: !m_processes[i] || *m_processes[i] == process in MessagePortChannel::entanglePortWithProcess()
1873         https://bugs.webkit.org/show_bug.cgi?id=182054
1874         <rdar://problem/36871207>
1875
1876         Reviewed by Brady Eidson.
1877
1878         Pipe postMessage messages to and from service workers via the UIProcess instead of going
1879         directly to the StorageProcess. This is temporarily needed to avoid races due to the
1880         MessagePort registry currently living in the UIProcess and postMessage messages potentially
1881         sending MessagePort objects.
1882
1883         This change is covered by tests on the bots that currently flakily crash in debug.
1884
1885         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1886         * StorageProcess/StorageProcess.cpp:
1887         (WebKit::StorageProcess::postMessageToServiceWorker):
1888         * StorageProcess/StorageProcess.h:
1889         * StorageProcess/StorageProcess.messages.in:
1890         * UIProcess/WebProcessPool.cpp:
1891         (WebKit::WebProcessPool::postMessageToServiceWorkerClient):
1892         (WebKit::WebProcessPool::postMessageToServiceWorker):
1893         * UIProcess/WebProcessPool.h:
1894         * UIProcess/WebProcessPool.messages.in:
1895         * WebProcess/Storage/WebSWClientConnection.cpp:
1896         (WebKit::WebSWClientConnection::postMessageToServiceWorker):
1897         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1898         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerClient):
1899
1900 2018-02-16  Wenson Hsieh  <wenson_hsieh@apple.com>
1901
1902         [Extra zoom mode] Add basic support for <input type='date'> using date picker UI
1903         https://bugs.webkit.org/show_bug.cgi?id=182847
1904         <rdar://problem/35143111>
1905
1906         Reviewed by Tim Horton.
1907
1908         Add support for presenting date pickers when focusing a date input.
1909
1910         * UIProcess/ios/WKContentViewInteraction.h:
1911         * UIProcess/ios/WKContentViewInteraction.mm:
1912         (-[WKContentView _stopAssistingNode]):
1913         (-[WKContentView dismissAllInputViewControllers]):
1914
1915         Pull logic to dismiss input view controllers into a single helper.
1916
1917         (-[WKContentView presentDatePickerViewController:]):
1918         (-[WKContentView dismissDatePickerViewController:]):
1919         (-[WKContentView presentViewControllerForAssistedNode:]):
1920         (-[WKContentView textInputController:didCommitText:]):
1921         (-[WKContentView _wheelChangedWithEvent:]):
1922
1923         Delegate wheel events to the date picker.
1924
1925         * UIProcess/ios/forms/WKDatePickerViewController.h: Added.
1926         * UIProcess/ios/forms/WKDatePickerViewController.mm: Added.
1927
1928         Add harness files for the WKDatePickerViewController implementation in WebKitAdditions.
1929
1930         * WebKit.xcodeproj/project.pbxproj:
1931
1932 2018-02-15  Youenn Fablet  <youenn@apple.com>
1933
1934         Resources loaded from service workers are not downloadable
1935         https://bugs.webkit.org/show_bug.cgi?id=182848
1936
1937         Reviewed by Chris Dumez.
1938
1939         Downloads are not supporting resources loaded through service worker.
1940         As a temporary solution, we will let network process handle it.
1941         Note that this would not work if the URL can only be loaded through service worker.
1942         Note also that for navigation loads, if the content type is the default one (application/octet-stream) we are overriding it to
1943         text/html as we do not support mime sniffing yet from service worker responses.
1944         This might interfere with automatic downloads from navigation.
1945
1946         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1947         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
1948
1949 2018-02-15  Megan Gardner  <megan_gardner@apple.com>
1950
1951         Support scrolling for non-editable web-selection and start autoscroll when near screen edges
1952         https://bugs.webkit.org/show_bug.cgi?id=182815
1953
1954         Add support for autoscrolling during a selection. This also takes into account the edges of the screen
1955         and starts autoscrolling when you get close, while still allowing autoscrolling when you are past the bounds
1956         of the WebView.
1957
1958         Reviewed by Tim Horton.
1959
1960         * UIProcess/ios/WKContentViewInteraction.mm:
1961         (-[WKContentView startAutoscroll:]):
1962         (-[WKContentView resignFirstResponderForWebView]):
1963         (-[WKContentView useSelectionAssistantWithGranularity:]):
1964         (-[WKContentView selectedTextRange]):
1965         * UIProcess/ios/WebPageProxyIOS.mm:
1966         (WebKit::WebPageProxy::startAutoscrollAtPosition):
1967         * WebProcess/WebPage/ios/WebPageIOS.mm:
1968         (WebKit::WebPage::startAutoscrollAtPosition):
1969         (WebKit::WebPage::cancelAutoscroll):
1970
1971 2018-02-15  John Wilander  <wilander@apple.com>
1972
1973         Resource Load Statistics: Make sure WebResourceLoadStatisticsStore::mergeWithDataFromDecoder() can ingest older plist versions and not reset the database
1974         https://bugs.webkit.org/show_bug.cgi?id=182812
1975         <rdar://problem/37511406>
1976
1977         Reviewed by Brent Fulgham.
1978
1979         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1980         (WebKit::WebResourceLoadStatisticsStore::mergeWithDataFromDecoder):
1981             Now does the following:
1982             - Logs when there is a model version mismatch.
1983             - Does not ingest statistics if the version on disk is newer than the supported one.
1984             - Does ingest statistics if the version on disk is older than the supported one.
1985             - Passes on the version found on disk to WebCore::ResourceLoadStatistics::decode().
1986
1987 2018-02-15  Jiewen Tan  <jiewen_tan@apple.com>
1988
1989         [WebAuthN] Revisit the whole async model of task dispatching, timeout and aborting
1990         https://bugs.webkit.org/show_bug.cgi?id=181946
1991         <rdar://problem/37258262>
1992
1993         Reviewed by Chris Dumez.
1994
1995         Dummy WebCredentialsMessenger and WebCredentialsMessengerProxy are crafted to establish
1996         a message exchange channel between UIProcess and WebProcess.
1997
1998         * DerivedSources.make:
1999         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.cpp: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
2000         (WebKit::WebCredentialsMessengerProxy::WebCredentialsMessengerProxy):
2001         (WebKit::WebCredentialsMessengerProxy::~WebCredentialsMessengerProxy):
2002         (WebKit::WebCredentialsMessengerProxy::makeCredential):
2003         (WebKit::WebCredentialsMessengerProxy::getAssertion):
2004         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.h: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
2005         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.messages.in: Added.
2006         * UIProcess/WebPageProxy.cpp:
2007         (WebKit::m_configurationPreferenceValues):
2008         (WebKit::WebPageProxy::reattachToWebProcess):
2009         (WebKit::WebPageProxy::resetState):
2010         * UIProcess/WebPageProxy.h:
2011         * WebKit.xcodeproj/project.pbxproj:
2012         * WebProcess/CredentialManagement/WebCredentialsMessenger.cpp: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
2013         (WebKit::WebCredentialsMessenger::WebCredentialsMessenger):
2014         (WebKit::WebCredentialsMessenger::~WebCredentialsMessenger):
2015         (WebKit::WebCredentialsMessenger::makeCredential):
2016         (WebKit::WebCredentialsMessenger::getAssertion):
2017         (WebKit::WebCredentialsMessenger::makeCredentialReply):
2018         (WebKit::WebCredentialsMessenger::getAssertionReply):
2019         * WebProcess/CredentialManagement/WebCredentialsMessenger.h: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
2020         * WebProcess/CredentialManagement/WebCredentialsMessenger.messages.in: Added.
2021         * WebProcess/WebPage/WebPage.cpp:
2022         (WebKit::m_credentialsMessenger):
2023         (WebKit::m_cpuLimit): Deleted.
2024         * WebProcess/WebPage/WebPage.h:
2025
2026 2018-02-15  Michael Catanzaro  <mcatanzaro@igalia.com>
2027
2028         [WPE] Unify build of platform-specific files in WebKit layer
2029         https://bugs.webkit.org/show_bug.cgi?id=182696
2030
2031         Reviewed by Žan Doberšek.
2032
2033         This is easy, because all needed changes were made in the previously-landed patch.
2034
2035         * CMakeLists.txt:
2036         * PlatformWPE.cmake:
2037
2038 2018-02-15  Don Olmstead  <don.olmstead@sony.com>
2039
2040         WebCore headers should not be included relatively within dependent projects
2041         https://bugs.webkit.org/show_bug.cgi?id=182805
2042
2043         Reviewed by Chris Dumez.
2044
2045         * NetworkProcess/capture/NetworkCaptureManager.cpp:
2046         * NetworkProcess/webrtc/NetworkRTCMonitor.h:
2047         * Shared/gtk/WebEventFactory.cpp:
2048         * UIProcess/API/gtk/PageClientImpl.cpp:
2049         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2050         * UIProcess/gtk/WebPageProxyGtk.cpp:
2051         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
2052         * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
2053         * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp:
2054         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
2055         * WebProcess/WebPage/wpe/WebPageWPE.cpp:
2056
2057 2018-02-15  Matt Lewis  <jlewis3@apple.com>
2058
2059         Unreviewed, rolling out r228495.
2060
2061         This caused mulitple perf tests to fail consistently.
2062
2063         Reverted changeset:
2064
2065         "Resource Load Statistics: Make sure
2066         WebResourceLoadStatisticsStore::mergeWithDataFromDecoder() can
2067         ingest older plist versions and not reset the database"
2068         https://bugs.webkit.org/show_bug.cgi?id=182812
2069         https://trac.webkit.org/changeset/228495
2070
2071 2018-02-14  Ross Kirsling  <ross.kirsling@sony.com>
2072
2073         Default definition of InjectedBundle::PlatformBundle should not be Windows-specific.
2074         https://bugs.webkit.org/show_bug.cgi?id=182810
2075
2076         Reviewed by Michael Catanzaro.
2077
2078         This branch was added in r228455, but should not be limited to OS(WINDOWS).
2079
2080         * WebProcess/InjectedBundle/InjectedBundle.h:
2081
2082 2018-02-14  Ross Kirsling  <ross.kirsling@sony.com>
2083
2084         Default implementations of nativeEvent() should be platform-agnostic.
2085         https://bugs.webkit.org/show_bug.cgi?id=182806
2086
2087         Reviewed by Darin Adler.
2088
2089         * Shared/NativeWebKeyboardEvent.h:
2090         * Shared/NativeWebMouseEvent.h:
2091         * Shared/NativeWebWheelEvent.h:
2092
2093 2018-02-14  John Wilander  <wilander@apple.com>
2094
2095         Resource Load Statistics: Make sure WebResourceLoadStatisticsStore::mergeWithDataFromDecoder() can ingest older plist versions and not reset the database
2096         https://bugs.webkit.org/show_bug.cgi?id=182812
2097         <rdar://problem/37511406>
2098
2099         Reviewed by Brent Fulgham.
2100
2101         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2102         (WebKit::WebResourceLoadStatisticsStore::mergeWithDataFromDecoder):
2103             Now does the following:
2104             - Logs when there is a model version mismatch.
2105             - Does not ingest statistics if the version on disk is newer than the supported one.
2106             - Does ingest statistics if the version on disk is older than the supported one.
2107             - Passes on the version found on disk to WebCore::ResourceLoadStatistics::decode().
2108
2109 2018-02-14  Daniel Bates  <dabates@apple.com>
2110
2111         Disallow cross-origin subresources from asking for credentials
2112         https://bugs.webkit.org/show_bug.cgi?id=182579
2113         <rdar://problem/36162271>
2114
2115         Reviewed by Andy Estes.
2116
2117         Add a private preference to toggle allowing non-mixed content cross-origin subresources to load.
2118         WebKitTestRunner toggles this preference when it sees the test option allowCrossOriginSubresourcesToAskForCredential.
2119
2120         * Shared/WebPreferences.yaml:
2121         * UIProcess/API/C/WKPreferences.cpp:
2122         (WKPreferencesSetAllowCrossOriginSubresourcesToAskForCredentials):
2123         (WKPreferencesGetAllowCrossOriginSubresourcesToAskForCredentials):
2124         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2125
2126 2018-02-14  John Wilander  <wilander@apple.com>
2127
2128         Make maximumParallelReadCount static to fix lambda capture error in WebKit::NetworkCache::Storage::traverse()
2129         https://bugs.webkit.org/show_bug.cgi?id=182797
2130         <rdar://problem/37540594>
2131
2132         Reviewed by Tim Horton.
2133
2134         This capture was added in r228455 and causes a build failure when
2135         run with -Wunused-lambda-capture. Xcode also warns about it.
2136
2137         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2138         (WebKit::NetworkCache::Storage::traverse):
2139
2140 2018-02-14  Ryosuke Niwa  <rniwa@webkit.org>
2141
2142         EventDispatcher::wheelEvent uses a wrong enum values in switch
2143         https://bugs.webkit.org/show_bug.cgi?id=182796
2144
2145         Reviewed by Chris Dumez.
2146
2147         EventDispatcher::wheelEvent is using PlatformWheelEventPhaseBegan and PlatformWheelEventPhaseEnded
2148         but the enum type of wheelEvent.phase() is WebWheelEvent::Phase.
2149
2150         The enum values are indentical for both so there is no behavioral change.
2151
2152         * WebProcess/WebPage/EventDispatcher.cpp:
2153         (WebKit::EventDispatcher::wheelEvent):
2154
2155 2018-02-14  Maureen Daum  <mdaum@apple.com>
2156
2157         Add C SPI for support of Website Data Store in Website Policies
2158         https://bugs.webkit.org/show_bug.cgi?id=182698
2159         <rdar://problem/37412008>
2160
2161         Reviewed by Andy Estes.
2162
2163         Expand the API added for _WKWebsitePolicies.websiteDataStore in r225989 and r226325
2164         to be available in the C API. In the ObjC API, we handle setting the website data
2165         store in NavigationState::NavigationClient::decidePolicyForNavigationAction. There
2166         we throw an exception if setting the website data store isn't supported, and then
2167         change the website data store. The equivalent place to do this work in the C API is
2168         in WKFramePolicyListenerUseWithPolicies. However, instead of throwing exceptions,
2169         release asserts are used.
2170
2171         * UIProcess/API/C/WKFramePolicyListener.cpp:
2172         (WKFramePolicyListenerUseWithPolicies):
2173         If the website policies data contains a website data store, do the same checks that
2174         are done in NavigationState::NavigationClient::decidePolicyForNavigationAction. Namely,
2175         that it is a valid website data store and it is a policy decision for a main frame navigation.
2176         If these checks are met, change the website data store.
2177         * UIProcess/API/C/WKPage.cpp:
2178         (WKPageUpdateWebsitePolicies):
2179         * UIProcess/API/C/WKWebsitePolicies.cpp:
2180         (WKWebsitePoliciesGetDataStore):
2181         (WKWebsitePoliciesSetDataStore):
2182         * UIProcess/API/C/WKWebsitePolicies.h:
2183         * UIProcess/WebFrameListenerProxy.cpp:
2184         (WebKit::WebFrameListenerProxy::changeWebsiteDataStore):
2185         (WebKit::WebFrameListenerProxy::isMainFrame):
2186         Expose whether the frame proxy is for a main frame, which is required to verify that
2187         website policies only specify a website data store for main frame policy decisions.
2188         * UIProcess/WebFrameListenerProxy.h:
2189         * UIProcess/WebFramePolicyListenerProxy.cpp:
2190         * UIProcess/WebFrameProxy.cpp:
2191         (WebKit::WebFrameProxy::changeWebsiteDataStore):
2192         * UIProcess/WebFrameProxy.h:
2193
2194 2018-02-14  Ryan Haddad  <ryanhaddad@apple.com>
2195
2196         Unreviewed, rolling out r228444.
2197
2198         Introduced API and Layout test failures.
2199
2200         Reverted changeset:
2201
2202         "[WebAuthN] Revisit the whole async model of task dispatching,
2203         timeout and aborting"
2204         https://bugs.webkit.org/show_bug.cgi?id=181946
2205         https://trac.webkit.org/changeset/228444
2206
2207 2018-02-13  Yousuke Kimoto  <yousuke.kimoto@sony.com>
2208
2209         [WinCairo] Fix build errors which come from including headers and not suitable implementation for windows
2210         https://bugs.webkit.org/show_bug.cgi?id=182679
2211
2212         Reviewed by Michael Catanzaro.
2213
2214         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
2215         (WebKit::NetworkCache::BlobStorage::add):
2216         * NetworkProcess/cache/NetworkCacheData.cpp:
2217         (WebKit::NetworkCache::Data::mapToFile const):
2218         (WebKit::NetworkCache::mapFile):
2219         (WebKit::NetworkCache::adoptAndMapFile):
2220         (WebKit::NetworkCache::readOrMakeSalt):
2221         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
2222         (WebKit::NetworkCache::directoryEntryType):
2223         (WebKit::NetworkCache::traverseDirectory):
2224         (WebKit::NetworkCache::fileTimes):
2225         (WebKit::NetworkCache::updateFileModificationTimeIfNeeded):
2226         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2227         (WebKit::NetworkCache::Storage::traverse):
2228         * NetworkProcess/win/SystemProxyWin.h:
2229         * Platform/IPC/Attachment.h:
2230         * Platform/Module.h:
2231         * Platform/SharedMemory.h:
2232         * PluginProcess/WebProcessConnection.cpp:
2233         * Shared/API/c/WKBase.h:
2234         * Shared/ChildProcess.cpp:
2235         * Shared/WebCoreArgumentCoders.h:
2236         * UIProcess/ProcessAssertion.h:
2237         * WebProcess/InjectedBundle/InjectedBundle.h:
2238         * WebProcess/WebProcess.cpp:
2239
2240 2018-02-13  Commit Queue  <commit-queue@webkit.org>
2241
2242         Unreviewed, rolling out r228431.
2243         https://bugs.webkit.org/show_bug.cgi?id=182766
2244
2245         Regressed CMake build stability (Requested by dolmstead on
2246         #webkit).
2247
2248         Reverted changeset:
2249
2250         "[CMake] Make WebCore headers copies"
2251         https://bugs.webkit.org/show_bug.cgi?id=182512
2252         https://trac.webkit.org/changeset/228431
2253
2254 2018-02-13  Jiewen Tan  <jiewen_tan@apple.com>
2255
2256         [WebAuthN] Revisit the whole async model of task dispatching, timeout and aborting
2257         https://bugs.webkit.org/show_bug.cgi?id=181946
2258         <rdar://problem/37258262>
2259
2260         Reviewed by Chris Dumez.
2261
2262         Dummy WebCredentialsMessenger and WebCredentialsMessengerProxy are crafted to establish
2263         a message exchange channel between UIProcess and WebProcess.
2264
2265         * DerivedSources.make:
2266         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.cpp: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
2267         (WebKit::WebCredentialsMessengerProxy::WebCredentialsMessengerProxy):
2268         (WebKit::WebCredentialsMessengerProxy::~WebCredentialsMessengerProxy):
2269         (WebKit::WebCredentialsMessengerProxy::makeCredential):
2270         (WebKit::WebCredentialsMessengerProxy::getAssertion):
2271         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.h: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
2272         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.messages.in: Added.
2273         * UIProcess/WebPageProxy.cpp:
2274         (WebKit::m_configurationPreferenceValues):
2275         (WebKit::WebPageProxy::reattachToWebProcess):
2276         * UIProcess/WebPageProxy.h:
2277         * WebKit.xcodeproj/project.pbxproj:
2278         * WebProcess/CredentialManagement/WebCredentialsMessenger.cpp: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
2279         (WebKit::WebCredentialsMessenger::WebCredentialsMessenger):
2280         (WebKit::WebCredentialsMessenger::~WebCredentialsMessenger):
2281         (WebKit::WebCredentialsMessenger::makeCredential):
2282         (WebKit::WebCredentialsMessenger::getAssertion):
2283         (WebKit::WebCredentialsMessenger::makeCredentialReply):
2284         (WebKit::WebCredentialsMessenger::getAssertionReply):
2285         * WebProcess/CredentialManagement/WebCredentialsMessenger.h: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
2286         * WebProcess/CredentialManagement/WebCredentialsMessenger.messages.in: Added.
2287         * WebProcess/WebPage/WebPage.cpp:
2288         (WebKit::m_credentialsMessenger):
2289         (WebKit::m_cpuLimit): Deleted.
2290         * WebProcess/WebPage/WebPage.h:
2291
2292 2018-02-13  Youenn Fablet  <youenn@apple.com>
2293
2294         Add support for configuring WebsiteDatastore service worker and cache storage path
2295         https://bugs.webkit.org/show_bug.cgi?id=182674
2296
2297         Reviewed by Chris Dumez.
2298
2299         Beef up WKWebsiteDataStoreConfiguration to easily set the WebsiteDataStore
2300         service worker registration and cache storage directory path.
2301
2302         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2303         (-[WKWebsiteDataStore _initWithConfiguration:]):
2304         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
2305         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
2306         (-[_WKWebsiteDataStoreConfiguration _cacheStorageDirectory]):
2307         (-[_WKWebsiteDataStoreConfiguration _setCacheStorageDirectory:]):
2308         (-[_WKWebsiteDataStoreConfiguration _serviceWorkerRegistrationDirectory]):
2309         (-[_WKWebsiteDataStoreConfiguration _setServiceWorkerRegistrationDirectory:]):
2310
2311 2018-02-13  Brian Burg  <bburg@apple.com>
2312
2313         Web Automation: don't return an error if resizing/moving a window has no effect
2314         https://bugs.webkit.org/show_bug.cgi?id=182742
2315
2316         Reviewed by Tim Horton.
2317
2318         * UIProcess/Automation/WebAutomationSession.cpp:
2319         (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext):
2320         (WebKit::WebAutomationSession::moveWindowOfBrowsingContext):
2321         Unify the behavior for all ports. Don't raise an error if the command was
2322         idempotent (by mistake or not). It should not be an error to re-maximize a window.
2323
2324 2018-02-13  Don Olmstead  <don.olmstead@sony.com>
2325
2326         [CMake] Make WebCore headers copies
2327         https://bugs.webkit.org/show_bug.cgi?id=182512
2328
2329         Reviewed by Keith Miller.
2330
2331         * CMakeLists.txt:
2332         * NetworkProcess/capture/NetworkCaptureManager.cpp:
2333         * NetworkProcess/webrtc/NetworkRTCMonitor.h:
2334         * PlatformWPE.cmake:
2335         * Scripts/generate-forwarding-headers.pl:
2336         * Shared/gtk/WebEventFactory.cpp:
2337         * UIProcess/API/gtk/PageClientImpl.cpp:
2338         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2339         * UIProcess/gtk/WebPageProxyGtk.cpp:
2340         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
2341         * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
2342         * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp:
2343         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
2344         * WebProcess/WebPage/wpe/WebPageWPE.cpp:
2345
2346 2018-02-13  Brent Fulgham  <bfulgham@apple.com>
2347
2348         [iOS] whitelist iokit-get-properties
2349         https://bugs.webkit.org/show_bug.cgi?id=182722
2350         <rdar://problem/30929165>
2351
2352         Reviewed by Eric Carlson.
2353
2354         Update the iOS sandbox to block access to IOKit properties that are not needed for
2355         legitimate WebContent process use. This brings the iOS sandbox in line with the
2356         work done under macOS.
2357
2358         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2359
2360 2018-02-12  John Wilander  <wilander@apple.com>
2361
2362         Resource Load Statistics: Classify resources as prevalent based on redirects to other prevalent resources
2363         https://bugs.webkit.org/show_bug.cgi?id=182664
2364         <rdar://problem/37372572>
2365
2366         Reviewed by Brent Fulgham.
2367
2368         * Platform/classifier/ResourceLoadStatisticsClassifier.cpp:
2369         (WebKit::ResourceLoadStatisticsClassifier::hasPrevalentResourceCharacteristics):
2370             Unique top frame redirects now counts toward classification as prevalent.
2371         * Shared/WebCoreArgumentCoders.cpp:
2372         (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
2373         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
2374         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2375         (WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectFrom):
2376         (WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectTo):
2377         (WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectFrom):
2378             Test infrastructure.
2379         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
2380         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2381             Bumped the statistics model to 11 because of the added fields.
2382         (WebKit::WebResourceLoadStatisticsStore::recursivelyGetAllDomainsThatHaveRedirectedToThisDomain):
2383             This function back traces redirect chains to classify domains
2384             that have redirected to a newly classified prevalent resource.
2385         (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
2386             Now uses the new convenience function WebResourceLoadStatisticsStore::setPrevalentResource().
2387         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
2388             New convenience function to make sure we always call
2389             WebResourceLoadStatisticsStore::recursivelyGetAllDomainsThatHaveRedirectedToThisDomain()
2390             and capture redirect chains backward.
2391         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
2392         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
2393         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
2394         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom):
2395         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo):
2396         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom):
2397             Test infrastructure.
2398         * UIProcess/WebResourceLoadStatisticsStore.h:
2399
2400 2018-02-12  Antti Koivisto  <antti@apple.com>
2401
2402         Update NetworkCache::Storage::lastStableVersion after r226349
2403         https://bugs.webkit.org/show_bug.cgi?id=182723
2404         <rdar://problem/37469554>
2405         
2406         Reviewed by Ryosuke Niwa.
2407
2408         * NetworkProcess/cache/NetworkCacheStorage.h:
2409
2410         Allow deleting version 11 caches.
2411
2412 2018-02-12  Wenson Hsieh  <wenson_hsieh@apple.com>
2413
2414         [Extra zoom mode] Add support for <input type='time'> using time picker UI
2415         https://bugs.webkit.org/show_bug.cgi?id=182683
2416         <rdar://problem/35143162>
2417
2418         Reviewed by Tim Horton.
2419
2420         Adds support for showing a time picker when an input of type time is focused in extra zoomed mode.
2421
2422         * UIProcess/ios/WKContentViewInteraction.h:
2423         * UIProcess/ios/WKContentViewInteraction.mm:
2424         (-[WKContentView _stopAssistingNode]):
2425         (-[WKContentView presentTimePickerViewController:]):
2426         (-[WKContentView dismissTimePickerViewController:]):
2427
2428         Add helpers to dismiss and present the time picker view controller.
2429
2430         (-[WKContentView presentViewControllerForAssistedNode:]):
2431
2432         When focusing InputType::Time, present a time picker. Additionally, tweak the logic here to use the generic text
2433         input view controller as a fallback when the other input view controllers (number pads, select menus and time
2434         pickers thus far) are not relevant. This prevents us from completely being unable to edit form controls that are
2435         currently unsupported.
2436
2437         (-[WKContentView textInputController:didCommitText:]):
2438         (-[WKContentView textInputControllerDidRequestDismissal:]):
2439
2440         Tweak WKContentView for changes to WKTextFormControlViewControllerDelegate.
2441
2442         (-[WKContentView actionNameForFocusedFormControlController:]):
2443
2444         Adjust this implementation to hide the focused form control "Go" button for selects and time inputs. This
2445         currently doesn't work for these form controls because it relies on implicit form submission; this should be
2446         fixed by future changes, after which we should revert this adjustment.
2447
2448         (-[WKContentView _wheelChangedWithEvent:]):
2449
2450         Delegate wheel events to the time picker if needed.
2451
2452         (-[WKContentView textInputController:didRequestDismissalWithAction:]): Deleted.
2453
2454         Renamed to -textInputControllerDidRequestDismissal:.
2455
2456         * UIProcess/ios/forms/WKTimePickerViewController.h: Added.
2457         * UIProcess/ios/forms/WKTimePickerViewController.mm: Added.
2458         * WebKit.xcodeproj/project.pbxproj:
2459
2460 2018-02-11  Michael Catanzaro  <mcatanzaro@igalia.com>
2461
2462         [GTK] Unify builds for platform-specific files in WebKit layer
2463         https://bugs.webkit.org/show_bug.cgi?id=182450
2464
2465         Reviewed by Carlos Garcia Campos.
2466
2467         Add most GTK-specific sources to unified build. API files are exempted, except for the DOM
2468         API. Files shared with PluginProcessGTK2 are also exempted. Finally, files with name
2469         conflicts in headers, which appears difficult to fix, are also exempted.
2470
2471         * CMakeLists.txt:
2472         * NetworkProcess/CustomProtocols/soup/LegacyCustomProtocolManagerSoup.cpp:
2473         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
2474         * NetworkProcess/soup/NetworkProcessSoup.cpp:
2475         * NetworkProcess/soup/NetworkSessionSoup.cpp:
2476         * NetworkProcess/soup/RemoteNetworkingContextSoup.cpp:
2477         * Platform/classifier/ResourceLoadStatisticsClassifier.cpp:
2478         * PlatformGTK.cmake:
2479         * PluginProcess/unix/PluginControllerProxyUnix.cpp:
2480         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
2481         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
2482         * Shared/CoordinatedGraphics/SimpleViewportController.cpp:
2483         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
2484         * Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp:
2485         * Shared/Plugins/unix/PluginSearchPath.cpp:
2486         * Shared/cairo/ShareableBitmapCairo.cpp:
2487         * Shared/glib/WebContextMenuItemGlib.cpp:
2488         * Shared/glib/WebErrorsGlib.cpp:
2489         * Shared/gtk/ArgumentCodersGtk.cpp:
2490         * Shared/gtk/NativeWebKeyboardEventGtk.cpp:
2491         * Shared/gtk/ProcessExecutablePathGtk.cpp:
2492         * Shared/gtk/WebErrorsGtk.cpp:
2493         * Shared/gtk/WebEventFactory.cpp:
2494         * Shared/linux/WebMemorySamplerLinux.cpp:
2495         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
2496         * Shared/soup/WebErrorsSoup.cpp:
2497         * SourcesGTK.txt: Added.
2498         * UIProcess/AcceleratedDrawingAreaProxy.cpp:
2499         * UIProcess/Automation/cairo/WebAutomationSessionCairo.cpp:
2500         * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
2501         * UIProcess/BackingStore.cpp:
2502         * UIProcess/DrawingAreaProxyImpl.cpp:
2503         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
2504         * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
2505         * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
2506         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2507         * UIProcess/WebResourceLoadStatisticsTelemetry.cpp:
2508         * UIProcess/WebStorage/StorageManager.cpp:
2509         * UIProcess/cairo/BackingStoreCairo.cpp:
2510         * UIProcess/gtk/AcceleratedBackingStore.cpp:
2511         * UIProcess/gtk/DragAndDropHandler.cpp:
2512         * UIProcess/gtk/GestureController.cpp:
2513         * UIProcess/gtk/HardwareAccelerationManager.cpp:
2514         * UIProcess/gtk/InputMethodFilter.cpp:
2515         * UIProcess/gtk/TextCheckerGtk.cpp:
2516         * UIProcess/gtk/WaylandCompositor.cpp:
2517         * UIProcess/gtk/WebColorPickerGtk.cpp:
2518         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
2519         * UIProcess/gtk/WebPasteboardProxyGtk.cpp:
2520         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
2521         * WebProcess/Cookies/soup/WebCookieManagerSoup.cpp:
2522         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.cpp:
2523         (webkit_dom_attr_dom_event_target_init):
2524         (webkit_dom_attr_set_property):
2525         (webkit_dom_attr_get_property):
2526         (webkit_dom_attr_class_init):
2527         (webkit_dom_event_target_init): Deleted.
2528         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.cpp:
2529         (webkit_dom_cdata_section_dom_event_target_init):
2530         (webkit_dom_event_target_init): Deleted.
2531         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.cpp:
2532         (webkit_dom_css_rule_set_property):
2533         (webkit_dom_css_rule_get_property):
2534         (webkit_dom_css_rule_class_init):
2535         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.cpp:
2536         (webkit_dom_css_rule_list_get_property):
2537         (webkit_dom_css_rule_list_class_init):
2538         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.cpp:
2539         (webkit_dom_css_style_declaration_set_property):
2540         (webkit_dom_css_style_declaration_get_property):
2541         (webkit_dom_css_style_declaration_class_init):
2542         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.cpp:
2543         (webkit_dom_css_style_sheet_get_property):
2544         (webkit_dom_css_style_sheet_class_init):
2545         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.cpp:
2546         (webkit_dom_css_value_set_property):
2547         (webkit_dom_css_value_get_property):
2548         (webkit_dom_css_value_class_init):
2549         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp:
2550         (webkit_dom_character_data_dom_event_target_init):
2551         (webkit_dom_character_data_set_property):
2552         (webkit_dom_character_data_get_property):
2553         (webkit_dom_character_data_class_init):
2554         (webkit_dom_event_target_init): Deleted.
2555         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.cpp:
2556         (webkit_dom_client_rect_get_property):
2557         (webkit_dom_client_rect_class_init):
2558         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp:
2559         (webkit_dom_client_rect_list_get_property):
2560         (webkit_dom_client_rect_list_class_init):
2561         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.cpp:
2562         (webkit_dom_comment_dom_event_target_init):
2563         (webkit_dom_event_target_init): Deleted.
2564         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.cpp:
2565         (webkit_dom_dom_selection_get_property):
2566         (webkit_dom_dom_selection_class_init):
2567         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.cpp:
2568         (webkit_dom_dom_token_list_set_property):
2569         (webkit_dom_dom_token_list_get_property):
2570         (webkit_dom_dom_token_list_class_init):
2571         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
2572         (webkit_dom_dom_window_dom_event_target_init):
2573         (webkit_dom_dom_window_set_property):
2574         (webkit_dom_dom_window_get_property):
2575         (webkit_dom_dom_window_class_init):
2576         (webkit_dom_event_target_init): Deleted.
2577         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
2578         (webkit_dom_document_dom_event_target_init):
2579         (webkit_dom_document_set_property):
2580         (webkit_dom_document_get_property):
2581         (webkit_dom_document_class_init):
2582         (webkit_dom_event_target_init): Deleted.
2583         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp:
2584         (webkit_dom_document_fragment_dom_event_target_init):
2585         (webkit_dom_document_fragment_get_property):
2586         (webkit_dom_document_fragment_class_init):
2587         (webkit_dom_event_target_init): Deleted.
2588         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.cpp:
2589         (webkit_dom_document_type_dom_event_target_init):
2590         (webkit_dom_document_type_get_property):
2591         (webkit_dom_document_type_class_init):
2592         (webkit_dom_event_target_init): Deleted.
2593         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
2594         (webkit_dom_element_dom_event_target_init):
2595         (webkit_dom_element_set_property):
2596         (webkit_dom_element_get_property):
2597         (webkit_dom_element_class_init):
2598         (webkit_dom_event_target_init): Deleted.
2599         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.cpp:
2600         (webkit_dom_event_set_property):
2601         (webkit_dom_event_get_property):
2602         (webkit_dom_event_class_init):
2603         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.cpp:
2604         (webkit_dom_file_get_property):
2605         (webkit_dom_file_class_init):
2606         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.cpp:
2607         (webkit_dom_file_list_get_property):
2608         (webkit_dom_file_list_class_init):
2609         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.cpp:
2610         (webkit_dom_html_anchor_element_dom_event_target_init):
2611         (webkit_dom_html_anchor_element_set_property):
2612         (webkit_dom_html_anchor_element_get_property):
2613         (webkit_dom_html_anchor_element_class_init):
2614         (webkit_dom_event_target_init): Deleted.
2615         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.cpp:
2616         (webkit_dom_html_applet_element_dom_event_target_init):
2617         (webkit_dom_html_applet_element_set_property):
2618         (webkit_dom_html_applet_element_get_property):
2619         (webkit_dom_html_applet_element_class_init):
2620         (webkit_dom_event_target_init): Deleted.
2621         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.cpp:
2622         (webkit_dom_html_area_element_dom_event_target_init):
2623         (webkit_dom_html_area_element_set_property):
2624         (webkit_dom_html_area_element_get_property):
2625         (webkit_dom_html_area_element_class_init):
2626         (webkit_dom_event_target_init): Deleted.
2627         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.cpp:
2628         (webkit_dom_html_br_element_dom_event_target_init):
2629         (webkit_dom_html_br_element_set_property):
2630         (webkit_dom_html_br_element_get_property):
2631         (webkit_dom_html_br_element_class_init):
2632         (webkit_dom_event_target_init): Deleted.
2633         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.cpp:
2634         (webkit_dom_html_base_element_dom_event_target_init):
2635         (webkit_dom_html_base_element_set_property):
2636         (webkit_dom_html_base_element_get_property):
2637         (webkit_dom_html_base_element_class_init):
2638         (webkit_dom_event_target_init): Deleted.
2639         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.cpp:
2640         (webkit_dom_html_body_element_dom_event_target_init):
2641         (webkit_dom_html_body_element_set_property):
2642         (webkit_dom_html_body_element_get_property):
2643         (webkit_dom_html_body_element_class_init):
2644         (webkit_dom_event_target_init): Deleted.
2645         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.cpp:
2646         (webkit_dom_html_button_element_dom_event_target_init):
2647         (webkit_dom_html_button_element_set_property):
2648         (webkit_dom_html_button_element_get_property):
2649         (webkit_dom_html_button_element_class_init):
2650         (webkit_dom_event_target_init): Deleted.
2651         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.cpp:
2652         (webkit_dom_html_canvas_element_dom_event_target_init):
2653         (webkit_dom_html_canvas_element_set_property):
2654         (webkit_dom_html_canvas_element_get_property):
2655         (webkit_dom_html_canvas_element_class_init):
2656         (webkit_dom_event_target_init): Deleted.
2657         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.cpp:
2658         (webkit_dom_html_collection_get_property):
2659         (webkit_dom_html_collection_class_init):
2660         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.cpp:
2661         (webkit_dom_html_d_list_element_dom_event_target_init):
2662         (webkit_dom_html_d_list_element_set_property):
2663         (webkit_dom_html_d_list_element_get_property):
2664         (webkit_dom_html_d_list_element_class_init):
2665         (webkit_dom_event_target_init): Deleted.
2666         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.cpp:
2667         (webkit_dom_html_directory_element_dom_event_target_init):
2668         (webkit_dom_html_directory_element_set_property):
2669         (webkit_dom_html_directory_element_get_property):
2670         (webkit_dom_html_directory_element_class_init):
2671         (webkit_dom_event_target_init): Deleted.
2672         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.cpp:
2673         (webkit_dom_html_div_element_dom_event_target_init):
2674         (webkit_dom_html_div_element_set_property):
2675         (webkit_dom_html_div_element_get_property):
2676         (webkit_dom_html_div_element_class_init):
2677         (webkit_dom_event_target_init): Deleted.
2678         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.cpp:
2679         (webkit_dom_html_document_dom_event_target_init):
2680         (webkit_dom_html_document_set_property):
2681         (webkit_dom_html_document_get_property):
2682         (webkit_dom_html_document_class_init):
2683         (webkit_dom_event_target_init): Deleted.
2684         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp:
2685         (webkit_dom_html_element_dom_event_target_init):
2686         (webkit_dom_html_element_set_property):
2687         (webkit_dom_html_element_get_property):
2688         (webkit_dom_html_element_class_init):
2689         (webkit_dom_event_target_init): Deleted.
2690         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.cpp:
2691         (webkit_dom_html_embed_element_dom_event_target_init):
2692         (webkit_dom_html_embed_element_set_property):
2693         (webkit_dom_html_embed_element_get_property):
2694         (webkit_dom_html_embed_element_class_init):
2695         (webkit_dom_event_target_init): Deleted.
2696         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.cpp:
2697         (webkit_dom_html_field_set_element_dom_event_target_init):
2698         (webkit_dom_html_field_set_element_get_property):
2699         (webkit_dom_html_field_set_element_class_init):
2700         (webkit_dom_event_target_init): Deleted.
2701         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.cpp:
2702         (webkit_dom_html_font_element_dom_event_target_init):
2703         (webkit_dom_html_font_element_set_property):
2704         (webkit_dom_html_font_element_get_property):
2705         (webkit_dom_html_font_element_class_init):
2706         (webkit_dom_event_target_init): Deleted.
2707         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.cpp:
2708         (webkit_dom_html_form_element_dom_event_target_init):
2709         (webkit_dom_html_form_element_set_property):
2710         (webkit_dom_html_form_element_get_property):
2711         (webkit_dom_html_form_element_class_init):
2712         (webkit_dom_event_target_init): Deleted.
2713         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.cpp:
2714         (webkit_dom_html_frame_element_dom_event_target_init):
2715         (webkit_dom_html_frame_element_set_property):
2716         (webkit_dom_html_frame_element_get_property):
2717         (webkit_dom_html_frame_element_class_init):
2718         (webkit_dom_event_target_init): Deleted.
2719         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.cpp:
2720         (webkit_dom_html_frame_set_element_dom_event_target_init):
2721         (webkit_dom_html_frame_set_element_set_property):
2722         (webkit_dom_html_frame_set_element_get_property):
2723         (webkit_dom_html_frame_set_element_class_init):
2724         (webkit_dom_event_target_init): Deleted.
2725         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.cpp:
2726         (webkit_dom_html_hr_element_dom_event_target_init):
2727         (webkit_dom_html_hr_element_set_property):
2728         (webkit_dom_html_hr_element_get_property):
2729         (webkit_dom_html_hr_element_class_init):
2730         (webkit_dom_event_target_init): Deleted.
2731         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.cpp:
2732         (webkit_dom_html_head_element_dom_event_target_init):
2733         (webkit_dom_html_head_element_set_property):
2734         (webkit_dom_html_head_element_get_property):
2735         (webkit_dom_html_head_element_class_init):
2736         (webkit_dom_event_target_init): Deleted.
2737         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.cpp:
2738         (webkit_dom_html_heading_element_dom_event_target_init):
2739         (webkit_dom_html_heading_element_set_property):
2740         (webkit_dom_html_heading_element_get_property):
2741         (webkit_dom_html_heading_element_class_init):
2742         (webkit_dom_event_target_init): Deleted.
2743         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.cpp:
2744         (webkit_dom_html_html_element_dom_event_target_init):
2745         (webkit_dom_html_html_element_set_property):
2746         (webkit_dom_html_html_element_get_property):
2747         (webkit_dom_html_html_element_class_init):
2748         (webkit_dom_event_target_init): Deleted.
2749         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.cpp:
2750         (webkit_dom_html_iframe_element_dom_event_target_init):
2751         (webkit_dom_html_iframe_element_set_property):
2752         (webkit_dom_html_iframe_element_get_property):
2753         (webkit_dom_html_iframe_element_class_init):
2754         (webkit_dom_event_target_init): Deleted.
2755         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.cpp:
2756         (webkit_dom_html_image_element_dom_event_target_init):
2757         (webkit_dom_html_image_element_set_property):
2758         (webkit_dom_html_image_element_get_property):
2759         (webkit_dom_html_image_element_class_init):
2760         (webkit_dom_event_target_init): Deleted.
2761         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
2762         (webkit_dom_html_input_element_dom_event_target_init):
2763         (webkit_dom_html_input_element_set_property):
2764         (webkit_dom_html_input_element_get_property):
2765         (webkit_dom_html_input_element_class_init):
2766         (webkit_dom_event_target_init): Deleted.
2767         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.cpp:
2768         (webkit_dom_html_li_element_dom_event_target_init):
2769         (webkit_dom_html_li_element_set_property):
2770         (webkit_dom_html_li_element_get_property):
2771         (webkit_dom_html_li_element_class_init):
2772         (webkit_dom_event_target_init): Deleted.
2773         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.cpp:
2774         (webkit_dom_html_label_element_dom_event_target_init):
2775         (webkit_dom_html_label_element_set_property):
2776         (webkit_dom_html_label_element_get_property):
2777         (webkit_dom_html_label_element_class_init):
2778         (webkit_dom_event_target_init): Deleted.
2779         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.cpp:
2780         (webkit_dom_html_legend_element_dom_event_target_init):
2781         (webkit_dom_html_legend_element_set_property):
2782         (webkit_dom_html_legend_element_get_property):
2783         (webkit_dom_html_legend_element_class_init):
2784         (webkit_dom_event_target_init): Deleted.
2785         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.cpp:
2786         (webkit_dom_html_link_element_dom_event_target_init):
2787         (webkit_dom_html_link_element_set_property):
2788         (webkit_dom_html_link_element_get_property):
2789         (webkit_dom_html_link_element_class_init):
2790         (webkit_dom_event_target_init): Deleted.
2791         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.cpp:
2792         (webkit_dom_html_map_element_dom_event_target_init):
2793         (webkit_dom_html_map_element_set_property):
2794         (webkit_dom_html_map_element_get_property):
2795         (webkit_dom_html_map_element_class_init):
2796         (webkit_dom_event_target_init): Deleted.
2797         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.cpp:
2798         (webkit_dom_html_marquee_element_dom_event_target_init):
2799         (webkit_dom_event_target_init): Deleted.
2800         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.cpp:
2801         (webkit_dom_html_menu_element_dom_event_target_init):
2802         (webkit_dom_html_menu_element_set_property):
2803         (webkit_dom_html_menu_element_get_property):
2804         (webkit_dom_html_menu_element_class_init):
2805         (webkit_dom_event_target_init): Deleted.
2806         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.cpp:
2807         (webkit_dom_html_meta_element_dom_event_target_init):
2808         (webkit_dom_html_meta_element_set_property):
2809         (webkit_dom_html_meta_element_get_property):
2810         (webkit_dom_html_meta_element_class_init):
2811         (webkit_dom_event_target_init): Deleted.
2812         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.cpp:
2813         (webkit_dom_html_mod_element_dom_event_target_init):
2814         (webkit_dom_html_mod_element_set_property):
2815         (webkit_dom_html_mod_element_get_property):
2816         (webkit_dom_html_mod_element_class_init):
2817         (webkit_dom_event_target_init): Deleted.
2818         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.cpp:
2819         (webkit_dom_html_o_list_element_dom_event_target_init):
2820         (webkit_dom_html_o_list_element_set_property):
2821         (webkit_dom_html_o_list_element_get_property):
2822         (webkit_dom_html_o_list_element_class_init):
2823         (webkit_dom_event_target_init): Deleted.
2824         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.cpp:
2825         (webkit_dom_html_object_element_dom_event_target_init):
2826         (webkit_dom_html_object_element_set_property):
2827         (webkit_dom_html_object_element_get_property):
2828         (webkit_dom_html_object_element_class_init):
2829         (webkit_dom_event_target_init): Deleted.
2830         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.cpp:
2831         (webkit_dom_html_opt_group_element_dom_event_target_init):
2832         (webkit_dom_html_opt_group_element_set_property):
2833         (webkit_dom_html_opt_group_element_get_property):
2834         (webkit_dom_html_opt_group_element_class_init):
2835         (webkit_dom_event_target_init): Deleted.
2836         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.cpp:
2837         (webkit_dom_html_option_element_dom_event_target_init):
2838         (webkit_dom_html_option_element_set_property):
2839         (webkit_dom_html_option_element_get_property):
2840         (webkit_dom_html_option_element_class_init):
2841         (webkit_dom_event_target_init): Deleted.
2842         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollection.cpp:
2843         (webkit_dom_html_options_collection_set_property):
2844         (webkit_dom_html_options_collection_get_property):
2845         (webkit_dom_html_options_collection_class_init):
2846         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.cpp:
2847         (webkit_dom_html_paragraph_element_dom_event_target_init):
2848         (webkit_dom_html_paragraph_element_set_property):
2849         (webkit_dom_html_paragraph_element_get_property):
2850         (webkit_dom_html_paragraph_element_class_init):
2851         (webkit_dom_event_target_init): Deleted.
2852         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.cpp:
2853         (webkit_dom_html_param_element_dom_event_target_init):
2854         (webkit_dom_html_param_element_set_property):
2855         (webkit_dom_html_param_element_get_property):
2856         (webkit_dom_html_param_element_class_init):
2857         (webkit_dom_event_target_init): Deleted.
2858         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.cpp:
2859         (webkit_dom_html_pre_element_dom_event_target_init):
2860         (webkit_dom_html_pre_element_set_property):
2861         (webkit_dom_html_pre_element_get_property):
2862         (webkit_dom_html_pre_element_class_init):
2863         (webkit_dom_event_target_init): Deleted.
2864         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.cpp:
2865         (webkit_dom_html_quote_element_dom_event_target_init):
2866         (webkit_dom_html_quote_element_set_property):
2867         (webkit_dom_html_quote_element_get_property):
2868         (webkit_dom_html_quote_element_class_init):
2869         (webkit_dom_event_target_init): Deleted.
2870         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.cpp:
2871         (webkit_dom_html_script_element_dom_event_target_init):
2872         (webkit_dom_html_script_element_set_property):
2873         (webkit_dom_html_script_element_get_property):
2874         (webkit_dom_html_script_element_class_init):
2875         (webkit_dom_event_target_init): Deleted.
2876         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
2877         (webkit_dom_html_select_element_dom_event_target_init):
2878         (webkit_dom_html_select_element_set_property):
2879         (webkit_dom_html_select_element_get_property):
2880         (webkit_dom_html_select_element_class_init):
2881         (webkit_dom_event_target_init): Deleted.
2882         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.cpp:
2883         (webkit_dom_html_style_element_dom_event_target_init):
2884         (webkit_dom_html_style_element_set_property):
2885         (webkit_dom_html_style_element_get_property):
2886         (webkit_dom_html_style_element_class_init):
2887         (webkit_dom_event_target_init): Deleted.
2888         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.cpp:
2889         (webkit_dom_html_table_caption_element_dom_event_target_init):
2890         (webkit_dom_html_table_caption_element_set_property):
2891         (webkit_dom_html_table_caption_element_get_property):
2892         (webkit_dom_html_table_caption_element_class_init):
2893         (webkit_dom_event_target_init): Deleted.
2894         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.cpp:
2895         (webkit_dom_html_table_cell_element_dom_event_target_init):
2896         (webkit_dom_html_table_cell_element_set_property):
2897         (webkit_dom_html_table_cell_element_get_property):
2898         (webkit_dom_html_table_cell_element_class_init):
2899         (webkit_dom_event_target_init): Deleted.
2900         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.cpp:
2901         (webkit_dom_html_table_col_element_dom_event_target_init):
2902         (webkit_dom_html_table_col_element_set_property):
2903         (webkit_dom_html_table_col_element_get_property):
2904         (webkit_dom_html_table_col_element_class_init):
2905         (webkit_dom_event_target_init): Deleted.
2906         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.cpp:
2907         (webkit_dom_html_table_element_dom_event_target_init):
2908         (webkit_dom_html_table_element_set_property):
2909         (webkit_dom_html_table_element_get_property):
2910         (webkit_dom_html_table_element_class_init):
2911         (webkit_dom_event_target_init): Deleted.
2912         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.cpp:
2913         (webkit_dom_html_table_row_element_dom_event_target_init):
2914         (webkit_dom_html_table_row_element_set_property):
2915         (webkit_dom_html_table_row_element_get_property):
2916         (webkit_dom_html_table_row_element_class_init):
2917         (webkit_dom_html_table_row_element_insert_cell):
2918         (webkit_dom_event_target_init): Deleted.
2919         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.cpp:
2920         (webkit_dom_html_table_section_element_dom_event_target_init):
2921         (webkit_dom_html_table_section_element_set_property):
2922         (webkit_dom_html_table_section_element_get_property):
2923         (webkit_dom_html_table_section_element_class_init):
2924         (webkit_dom_event_target_init): Deleted.
2925         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.cpp:
2926         (webkit_dom_html_text_area_element_dom_event_target_init):
2927         (webkit_dom_html_text_area_element_set_property):
2928         (webkit_dom_html_text_area_element_get_property):
2929         (webkit_dom_html_text_area_element_class_init):
2930         (webkit_dom_event_target_init): Deleted.
2931         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.cpp:
2932         (webkit_dom_html_title_element_dom_event_target_init):
2933         (webkit_dom_html_title_element_set_property):
2934         (webkit_dom_html_title_element_get_property):
2935         (webkit_dom_html_title_element_class_init):
2936         (webkit_dom_event_target_init): Deleted.
2937         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.cpp:
2938         (webkit_dom_html_u_list_element_dom_event_target_init):
2939         (webkit_dom_html_u_list_element_set_property):
2940         (webkit_dom_html_u_list_element_get_property):
2941         (webkit_dom_html_u_list_element_class_init):
2942         (webkit_dom_event_target_init): Deleted.
2943         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEvent.cpp:
2944         (webkit_dom_keyboard_event_get_property):
2945         (webkit_dom_keyboard_event_class_init):
2946         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.cpp:
2947         (webkit_dom_media_list_set_property):
2948         (webkit_dom_media_list_get_property):
2949         (webkit_dom_media_list_class_init):
2950         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEvent.cpp:
2951         (webkit_dom_mouse_event_get_property):
2952         (webkit_dom_mouse_event_class_init):
2953         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.cpp:
2954         (webkit_dom_named_node_map_get_property):
2955         (webkit_dom_named_node_map_class_init):
2956         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.cpp:
2957         (webkit_dom_node_dom_event_target_init):
2958         (webkit_dom_node_set_property):
2959         (webkit_dom_node_get_property):
2960         (webkit_dom_node_class_init):
2961         (webkit_dom_event_target_init): Deleted.
2962         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIterator.cpp:
2963         (webkit_dom_node_iterator_get_property):
2964         (webkit_dom_node_iterator_class_init):
2965         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeList.cpp:
2966         (webkit_dom_node_list_get_property):
2967         (webkit_dom_node_list_class_init):
2968         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMObject.cpp:
2969         (webkitDOMObjectSetProperty):
2970         (webkit_dom_object_class_init):
2971         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.cpp:
2972         (webkit_dom_processing_instruction_dom_event_target_init):
2973         (webkit_dom_processing_instruction_get_property):
2974         (webkit_dom_processing_instruction_class_init):
2975         (webkit_dom_event_target_init): Deleted.
2976         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.cpp:
2977         (webkit_dom_range_get_property):
2978         (webkit_dom_range_class_init):
2979         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheet.cpp:
2980         (webkit_dom_style_sheet_set_property):
2981         (webkit_dom_style_sheet_get_property):
2982         (webkit_dom_style_sheet_class_init):
2983         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetList.cpp:
2984         (webkit_dom_style_sheet_list_get_property):
2985         (webkit_dom_style_sheet_list_class_init):
2986         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp:
2987         (webkit_dom_text_dom_event_target_init):
2988         (webkit_dom_text_get_property):
2989         (webkit_dom_text_class_init):
2990         (webkit_dom_event_target_init): Deleted.
2991         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalker.cpp:
2992         (webkit_dom_tree_walker_get_property):
2993         (webkit_dom_tree_walker_class_init):
2994         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEvent.cpp:
2995         (webkit_dom_ui_event_get_property):
2996         (webkit_dom_ui_event_class_init):
2997         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.cpp:
2998         (webkit_dom_wheel_event_get_property):
2999         (webkit_dom_wheel_event_class_init):
3000         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.cpp:
3001         (webkit_dom_xpath_result_get_property):
3002         (webkit_dom_xpath_result_class_init):
3003         * WebProcess/InjectedBundle/glib/InjectedBundleGlib.cpp:
3004         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
3005         * WebProcess/Plugins/Netscape/unix/NetscapePluginUnix.cpp:
3006         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
3007         * WebProcess/WebCoreSupport/curl/WebFrameNetworkingContext.cpp:
3008         * WebProcess/WebCoreSupport/gtk/WebContextMenuClientGtk.cpp:
3009         * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
3010         * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
3011         * WebProcess/WebCoreSupport/gtk/WebPopupMenuGtk.cpp:
3012         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
3013         * WebProcess/WebPage/AcceleratedSurface.cpp:
3014         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
3015         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
3016         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
3017         * WebProcess/WebPage/DrawingAreaImpl.cpp:
3018         * WebProcess/WebPage/gtk/AcceleratedSurfaceWayland.cpp:
3019         * WebProcess/WebPage/gtk/AcceleratedSurfaceX11.cpp:
3020         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
3021         * WebProcess/gtk/WaylandCompositorDisplay.cpp:
3022         * WebProcess/gtk/WebProcessMainGtk.cpp:
3023
3024 2018-02-05  Carlos Garcia Campos  <cgarcia@igalia.com>
3025
3026         WebDriver: addCookie command should prepend a dot to domain if missing
3027         https://bugs.webkit.org/show_bug.cgi?id=182328
3028         <rdar://problem/37116398>
3029
3030         Reviewed by Michael Catanzaro.
3031
3032         RFC 2965: If an explicitly specified value does not start with a dot, the user agent supplies a leading dot.
3033
3034         Fixes: imported/w3c/webdriver/tests/cookies/add_cookie.py::test_add_domain_cookie
3035
3036         * UIProcess/Automation/WebAutomationSession.cpp:
3037         (WebKit::WebAutomationSession::addSingleCookie):
3038
3039 2018-02-11  Yousuke Kimoto  <yousuke.kimoto@sony.com>
3040
3041         [WinCairo] Add WKBaseWin.h
3042         https://bugs.webkit.org/show_bug.cgi?id=182681
3043
3044         Reviewed by Yusuke Suzuki.
3045
3046         * PlatformWin.cmake:
3047         * Shared/API/c/win/WKBaseWin.h: Added.
3048
3049 2018-02-09  Ross Kirsling  <ross.kirsling@sony.com>
3050
3051         Remove invalidated WebPage::handleEditingKeyboardEvent default implementation after r228260.
3052         https://bugs.webkit.org/show_bug.cgi?id=182663
3053
3054         Reviewed by Chris Dumez.
3055
3056         This would need to be updated to turn `keyEvent` into `underlyingPlatformEvent`;
3057         instead, we can remove it, as it's only for Windows, which doesn't yet support WK2.
3058
3059         * WebProcess/WebPage/WebPage.cpp:
3060         (WebKit::WebPage::handleEditingKeyboardEvent): Deleted.
3061
3062 2018-02-09  Nan Wang  <n_wang@apple.com>
3063
3064         AX: Accessibility is not notified when a web process cancels the suspension
3065         https://bugs.webkit.org/show_bug.cgi?id=182659
3066
3067         Reviewed by Ryosuke Niwa.
3068
3069         We were notifying Accessibility with the web process suspended information in actualPrepareToSuspend
3070         and processDidResume. However, the suspension can be canceled during the prepare call. So that we
3071         should also post a notification in cancelPrepareToSuspend.
3072
3073         * WebProcess/WebProcess.cpp:
3074         (WebKit::WebProcess::cancelPrepareToSuspend):
3075
3076 2018-02-09  Brent Fulgham  <bfulgham@apple.com>
3077
3078         Sandbox violating attempting to read log formatting preference file
3079         https://bugs.webkit.org/show_bug.cgi?id=182648
3080         <rdar://problem/36629495>
3081
3082         Reviewed by Eric Carlson.
3083
3084         Various frameworks attempt to read logging format information from /usr/local/lib/log. The sandbox is blocking
3085         this, generating log spam and preventing some logging features from working properly. We should allow read
3086         access to this path.
3087
3088         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
3089         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
3090         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
3091         * WebProcess/com.apple.WebProcess.sb.in:
3092
3093 2018-02-08  Chris Dumez  <cdumez@apple.com>
3094
3095         There should be a way to disable [OverrideBuiltins] behavior in a given DOMWrapperWorld
3096         https://bugs.webkit.org/show_bug.cgi?id=182524
3097         <rdar://problem/9057327>
3098
3099         Reviewed by Ryosuke Niwa.
3100
3101         Add C API on WKBundleScriptWorld and Cocoa API on WKWebProcessPlugInScriptWorld to
3102         disable the [OverrideBuiltins] behavior on a given script world.
3103
3104         The [OverrideBuiltins] behavior [1] is legacy behavior that is needed for Web compatibility
3105         but allowing the client to disable this behavior in a given world makes development easier
3106         and running injected script on uncontrolled content a lot more reliable.
3107
3108         [1] https://heycam.github.io/webidl/#OverrideBuiltins
3109
3110         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.h:
3111         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.mm:
3112         (-[WKWebProcessPlugInScriptWorld disableOverrideBuiltinsBehavior]):
3113         * WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp:
3114         (WKBundleScriptWorldDisableOverrideBuiltinsBehavior):
3115         * WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.h:
3116         * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp:
3117         (WebKit::InjectedBundleScriptWorld::disableOverrideBuiltinsBehavior):
3118         * WebProcess/InjectedBundle/InjectedBundleScriptWorld.h:
3119
3120 2018-02-08  Ross Kirsling  <ross.kirsling@sony.com>
3121
3122         Remove WebProcessPool::platformInitialize stub.
3123         https://bugs.webkit.org/show_bug.cgi?id=182621
3124
3125         Reviewed by Alex Christensen.
3126
3127         The #if here could be simplified to PLATFORM(WIN), but Windows too will need a proper implementation
3128         as part of WK2 support, so this stub shouldn't need to exist at all.
3129
3130         * UIProcess/WebProcessPool.cpp:
3131         (WebKit::WebProcessPool::platformInitialize): Deleted.
3132
3133 2018-02-08  Michael Catanzaro  <mcatanzaro@igalia.com>
3134
3135         TestController should not exercise cocoa-specific resource load statistics APIs
3136         https://bugs.webkit.org/show_bug.cgi?id=182355
3137
3138         Reviewed by Alex Christensen.
3139
3140         Remove the Cocoa testing SPI, since it's redundant with the C API. Also, add a couple
3141         missing cookie partitioning callbacks to the C API.
3142
3143         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
3144         (WKWebsiteDataStoreStatisticsUpdateCookiePartitioning):
3145         (WKWebsiteDataStoreSetStatisticsShouldPartitionCookiesForHost):
3146         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
3147         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3148         (-[WKWebsiteDataStore _resourceLoadStatisticsSetLastSeen:forHost:]): Deleted.
3149         (-[WKWebsiteDataStore _resourceLoadStatisticsSetIsPrevalentResource:forHost:]): Deleted.
3150         (-[WKWebsiteDataStore _resourceLoadStatisticsIsPrevalentResource:completionHandler:]): Deleted.
3151         (-[WKWebsiteDataStore _resourceLoadStatisticsIsRegisteredAsSubFrameUnder:topFrameHost:completionHandler:]): Deleted.
3152         (-[WKWebsiteDataStore _resourceLoadStatisticsIsRegisteredAsRedirectingTo:hostRedirectedTo:completionHandler:]): Deleted.
3153         (-[WKWebsiteDataStore _resourceLoadStatisticsSetHadUserInteraction:forHost:]): Deleted.
3154         (-[WKWebsiteDataStore _resourceLoadStatisticsSetHasHadNonRecentUserInteractionForHost:]): Deleted.
3155         (-[WKWebsiteDataStore _resourceLoadStatisticsHadUserInteraction:completionHandler:]): Deleted.
3156         (-[WKWebsiteDataStore _resourceLoadStatisticsSetIsGrandfathered:forHost:]): Deleted.
3157         (-[WKWebsiteDataStore _resourceLoadStatisticsIsGrandfathered:completionHandler:]): Deleted.
3158         (-[WKWebsiteDataStore _resourceLoadStatisticsSetSubframeUnderTopFrameOrigin:forHost:]): Deleted.
3159         (-[WKWebsiteDataStore _resourceLoadStatisticsSetSubresourceUnderTopFrameOrigin:forHost:]): Deleted.
3160         (-[WKWebsiteDataStore _resourceLoadStatisticsSetSubresourceUniqueRedirectTo:forHost:]): Deleted.
3161         (-[WKWebsiteDataStore _resourceLoadStatisticsSetTimeToLiveUserInteraction:]): Deleted.
3162         (-[WKWebsiteDataStore _resourceLoadStatisticsSetTimeToLiveCookiePartitionFree:]): Deleted.
3163         (-[WKWebsiteDataStore _resourceLoadStatisticsSetMinimumTimeBetweenDataRecordsRemoval:]): Deleted.
3164         (-[WKWebsiteDataStore _resourceLoadStatisticsSetGrandfatheringTime:]): Deleted.
3165         (-[WKWebsiteDataStore _resourceLoadStatisticsSetMaxStatisticsEntries:]): Deleted.
3166         (-[WKWebsiteDataStore _resourceLoadStatisticsSetPruneEntriesDownTo:]): Deleted.
3167         (-[WKWebsiteDataStore _resourceLoadStatisticsProcessStatisticsAndDataRecords]): Deleted.
3168         (-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning]): Deleted.
3169         (-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning:]): Deleted.
3170         (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:]): Deleted.
3171         (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:completionHandler:]): Deleted.
3172         (-[WKWebsiteDataStore _resourceLoadStatisticsSubmitTelemetry]): Deleted.
3173         (-[WKWebsiteDataStore _resourceLoadStatisticsSetNotifyPagesWhenDataRecordsWereScanned:]): Deleted.
3174         (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldClassifyResourcesBeforeDataRecordsRemoval:]): Deleted.
3175         (-[WKWebsiteDataStore _resourceLoadStatisticsSetNotifyPagesWhenTelemetryWasCaptured:]): Deleted.
3176         (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStore]): Deleted.
3177         (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStore:]): Deleted.
3178         (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours:]): Deleted.
3179         (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours:completionHandler:]): Deleted.
3180         (-[WKWebsiteDataStore _resourceLoadStatisticsResetToConsistentState]): Deleted.
3181         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
3182
3183 2018-02-08  Don Olmstead  <don.olmstead@sony.com>
3184
3185         Remove JavaScriptCore/ForwardingHeaders directory
3186         https://bugs.webkit.org/show_bug.cgi?id=182594
3187
3188         Reviewed by Mark Lam.
3189
3190         * PlatformGTK.cmake:
3191
3192 2018-02-08  Tim Horton  <timothy_horton@apple.com>
3193
3194         Make WebKit public headers modules-safe
3195         https://bugs.webkit.org/show_bug.cgi?id=182611
3196         <rdar://problem/37160164>
3197
3198         Reviewed by Dan Bernstein.
3199
3200         * UIProcess/API/Cocoa/WKPreviewElementInfo.h:
3201         * UIProcess/API/Cocoa/WKSnapshotConfiguration.h:
3202         Import headers without which these WebKit headers can not be used alone.
3203
3204         * WebKit.xcodeproj/project.pbxproj:
3205         Make WKWindowFeaturesPrivate a private header like it was supposed to be.
3206
3207 2018-02-08  Matt Lewis  <jlewis3@apple.com>
3208
3209         Unreviewed, rolling out r228262.
3210
3211         This broke an internal build alongside r228261.
3212
3213         Reverted changeset:
3214
3215         "WebDriver: addCookie command should prepend a dot to domain
3216         if missing"
3217         https://bugs.webkit.org/show_bug.cgi?id=182328
3218         https://trac.webkit.org/changeset/228262
3219
3220 2018-02-08  Miguel Gomez  <magomez@igalia.com>
3221
3222         [GTK] WaylandCompositor misusing eglGetProcAddress
3223         https://bugs.webkit.org/show_bug.cgi?id=182490
3224
3225         Reviewed by Michael Catanzaro.
3226
3227         Check that the appropriate extensions are available before calling eglGetProcAddress, as even
3228         getting a non null value from it, the functionality can be disabled at runtime.
3229
3230         * UIProcess/gtk/WaylandCompositor.cpp:
3231         (WebKit::WaylandCompositor::initializeEGL):
3232
3233 2018-02-08  Frederic Wang  <fwang@igalia.com>
3234
3235         Add scrolling node types to distinguish main frames and subframes.
3236         https://bugs.webkit.org/show_bug.cgi?id=182533
3237
3238         Reviewed by Simon Fraser.
3239
3240         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp: Replace the case of
3241         FrameScrollingNode with MainFrameScrollingNode and SubframeScrollingNode.
3242         (WebKit::encodeNodeAndDescendants):
3243         (WebKit::RemoteScrollingCoordinatorTransaction::decode):
3244         (WebKit::dump):
3245         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp: Ditto.
3246         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
3247         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp: Ditto and pass the node type to the
3248         constructor of the frame scrolling node.
3249         (WebKit::RemoteScrollingTree::createScrollingTreeNode):
3250         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm: Replace the case of
3251         FrameScrollingNode with MainFrameScrollingNode and SubframeScrollingNode.
3252         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
3253         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm: In order to
3254         determine whether the node is a main frame or subframe, use the node type instead of checking
3255         whether the node as a parent.
3256         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll):
3257
3258 2018-02-05  Carlos Garcia Campos  <cgarcia@igalia.com>
3259
3260         WebDriver: addCookie command should prepend a dot to domain if missing
3261         https://bugs.webkit.org/show_bug.cgi?id=182328
3262         <rdar://problem/37116398>
3263
3264         Reviewed by Michael Catanzaro.
3265
3266         RFC 2965: If an explicitly specified value does not start with a dot, the user agent supplies a leading dot.
3267
3268         Fixes: imported/w3c/webdriver/tests/cookies/add_cookie.py::test_add_domain_cookie
3269
3270         * UIProcess/Automation/WebAutomationSession.cpp:
3271         (WebKit::WebAutomationSession::addSingleCookie):
3272
3273 2018-01-13  Darin Adler  <darin@apple.com>
3274
3275         Event improvements
3276         https://bugs.webkit.org/show_bug.cgi?id=179591
3277
3278         Reviewed by Chris Dumez.
3279
3280         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.cpp:
3281         (webkit_dom_wheel_event_init_wheel_event): Updated to call initWebKitWheelEvent.
3282
3283         * WebProcess/Plugins/PluginView.cpp: Removed include of ScriptValue.h.
3284
3285         * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
3286         (WebKit::WebEditorClient::executePendingEditorCommands):
3287         Updated for name change from keyEvent to underlyingPlatformEvent.
3288         (WebKit::WebEditorClient::handleInputMethodKeydown): Ditto.
3289         * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp:
3290         (WebKit::WebEditorClient::handleKeyboardEvent): Ditto.
3291         (WebKit::WebEditorClient::handleInputMethodKeydown): Ditto.
3292
3293         * WebProcess/WebPage/WebPage.cpp: Removed include of ScriptValue.h.
3294
3295         * WebProcess/WebPage/ios/WebPageIOS.mm:
3296         (WebKit::WebPage::handleEditingKeyboardEvent): Updated for name change from
3297         keyEvent to underlyingPlatformEvent.
3298         * WebProcess/WebPage/mac/WebPageMac.mm:
3299         (WebKit::WebPage::executeKeypressCommandsInternal): Ditto.
3300         (WebKit::WebPage::handleEditingKeyboardEvent): Ditto.
3301
3302 2018-02-07  Antti Koivisto  <antti@apple.com> and Youenn Fablet  <youenn@apple.com>
3303
3304         REGRESSION(r227758): Webpage fails to load due to crash in com.apple.WebKit: WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse + 267
3305         https://bugs.webkit.org/show_bug.cgi?id=182532
3306         <rdar://problem/36414017>
3307
3308         Reviewed by Chris Dumez.
3309
3310         No test case, don't know how to make one. The repro involves multipart HTTP streaming and details are hazy.
3311         We were calling a function that was WTFMoved away just a few lines above.
3312
3313         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3314         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
3315
3316 2018-02-07  Tim Horton  <timothy_horton@apple.com>
3317
3318         Evernote device management web view sometimes displays at the wrong scale
3319         https://bugs.webkit.org/show_bug.cgi?id=182590
3320         <rdar://problem/36633687>
3321
3322         Reviewed by Simon Fraser.
3323
3324         Evernote implements the WKWebView's scroll view's delegate method
3325         viewForZoomingInScrollView: and returns nil. This results in
3326         WKScrollView's zoomScale always returning 1, no matter what the
3327         WKContentView's actual scale is. This will result in us never updating
3328         the WKContentView's scale to 1. When loading a page that has a few
3329         scale changes during load but ends up at scale 1, we get stuck at whatever
3330         intermediate scale immediately preceded settling on 1.
3331
3332         Fix this by not forwarding viewForZoomingInScrollView: to the external
3333         WKScrollView delegate; we are in charge of the contents of the scroll
3334         view (including which view scrollView's zoomScale should track), and
3335         overriding viewForZoomingInScrollView: is only ever going to lead to
3336         a broken WebKit.
3337
3338         * UIProcess/ios/WKScrollView.mm:
3339         (shouldForwardScrollViewDelegateMethodToExternalDelegate):
3340         (-[WKScrollViewDelegateForwarder forwardInvocation:]):
3341         (-[WKScrollViewDelegateForwarder forwardingTargetForSelector:]):
3342
3343 2018-02-07  Wenson Hsieh  <wenson_hsieh@apple.com>
3344
3345         [Extra zoom mode] Delegate scrolling from the content view to input view controllers
3346         https://bugs.webkit.org/show_bug.cgi?id=182534
3347         <rdar://problem/37276625>
3348
3349         Reviewed by Tim Horton.
3350
3351         Override -_wheelChangedWithEvent: on the content view, and give extra zoomed input view controllers a chance to
3352         handle the event.
3353
3354         * Platform/spi/ios/UIKitSPI.h:
3355         * UIProcess/ios/WKContentViewInteraction.mm:
3356         (-[WKContentView _wheelChangedWithEvent:]):
3357
3358 2018-02-07  Wenson Hsieh  <wenson_hsieh@apple.com>
3359
3360         [Extra zoom mode] Implement multiple and single select menus
3361         https://bugs.webkit.org/show_bug.cgi?id=182525
3362         <rdar://problem/35143016>
3363
3364         Reviewed by Tim Horton.
3365
3366         Add support for presenting picker views when focusing single or multiple select elements. See changes below for
3367         additional detail.
3368
3369         * UIProcess/ios/WKContentViewInteraction.h:
3370         * UIProcess/ios/WKContentViewInteraction.mm:
3371         (-[WKContentView _startAssistingKeyboard]):
3372
3373         Move logic for presenting view controllers when focusing elements out of _startAssistingKeyboard, and into
3374         _startAssistingNode:(...). This is because _startAssistingKeyboard is only invoked for certain types of focused
3375         element types; importantly, this set excludes select elements. Putting the call to present the focused view
3376         controller there also didn't make much since, considering that these new view controllers are not tied to
3377         keyboards in any way.
3378
3379         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
3380         (-[WKContentView _stopAssistingNode]):
3381
3382         Dismiss any select menu that is being presented.
3383
3384         (-[WKContentView presentSelectMenuViewController:]):
3385         (-[WKContentView dismissSelectMenuViewController:]):
3386
3387         Introduce idempotent helpers for presenting and dismissing the select menu view controller.
3388
3389         (-[WKContentView presentViewControllerForAssistedNode:]):
3390         (-[WKContentView selectMenu:didSelectItemAtIndex:]):
3391
3392         For single select menus. Called when the user selects a row.
3393
3394         (-[WKContentView didCancelSelectionInSelectMenu:]):
3395         (-[WKContentView numberOfItemsInSelectMenu:]):
3396         (-[WKContentView selectMenu:displayTextForItemAtIndex:]):
3397
3398         Indicates the text value to show at a given index.
3399
3400         (-[WKContentView selectMenu:didCheckItemAtIndex:checked:]):
3401
3402         For multiple select menus, invoked when an item is checked. The `checked` parameter indicates whether or not the
3403         item is now checked.
3404
3405         (-[WKContentView selectMenuSupportsMultipleSelection:]):
3406
3407         Indicates whether this select menu is single-item-only, or allows multiple items to be selected (checked).
3408
3409         (-[WKContentView selectMenu:hasCheckedOptionAtIndex:]):
3410
3411         For multiple select menus. Determines whether an option at the given index is checked.
3412
3413         (-[WKContentView startingIndexForSelectMenu:]):
3414
3415         Determines the index to instantly scroll to when presenting the select menu.