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