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