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