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