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