c6552caa2880355c07b644ba3e224c9a0348ba26
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-03-23  Youenn Fablet  <youenn@apple.com>
2
3         CacheStorage::Engine should not ref itself when hopping to a background thread
4         https://bugs.webkit.org/show_bug.cgi?id=183925
5         <rdar://problem/38580483>
6
7         Reviewed by Chris Dumez.
8
9         Add support for weak pointers to CacheStorage Engine.
10         Use weak pointer when hopping to background threads.
11         Store callbacks in CacheStorage::Engine maps to keep them being destroyed in the main thread only.
12         Made some callbacks CompletionHandler as a bonus.
13
14         Made sure to use just one Engine for all private sessions.
15
16         * NetworkProcess/cache/CacheStorageEngine.cpp:
17         (WebKit::CacheStorage::Engine::~Engine):
18         (WebKit::CacheStorage::Engine::from):
19         (WebKit::CacheStorage::Engine::initialize):
20         (WebKit::CacheStorage::Engine::writeFile):
21         (WebKit::CacheStorage::Engine::readFile):
22         * NetworkProcess/cache/CacheStorageEngine.h:
23         (WebKit::CacheStorage::Engine::weakPtrFactory):
24
25 2018-03-23  Ryan Haddad  <ryanhaddad@apple.com>
26
27         Unreviewed build fix.
28
29         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
30
31 2018-03-23  Miguel Gomez  <magomez@igalia.com>
32
33         [GTK][WPE] Avoid software color conversion inside BitmapTextureGL
34         https://bugs.webkit.org/show_bug.cgi?id=183892
35
36         Remove the UpdateContentsFlag parameter when calling BitmapTexture::updateContents().
37
38         Reviewed by Žan Doberšek.
39
40         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
41         (WebKit::CoordinatedBackingStoreTile::swapBuffers):
42
43 2018-03-23  Michael Catanzaro  <mcatanzaro@igalia.com>
44
45         [WPE][GTK] Fix -Wswitch warnings after r229778
46         https://bugs.webkit.org/show_bug.cgi?id=183927
47
48         Reviewed by Carlos Garcia Campos.
49
50         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
51         (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse): Log a warning if Suspend is
52         received as a PolicyAction
53         * UIProcess/API/glib/WebKitNavigationClient.cpp: Ignore the ProcessSwap termination reason,
54         which should be invisible to WebKit clients
55
56 2018-03-22  Chris Dumez  <cdumez@apple.com>
57
58         Include security origin in the service worker process name
59         https://bugs.webkit.org/show_bug.cgi?id=183913
60
61         Reviewed by Youenn Fablet.
62
63         Include security origin in the service worker process name to facilitate debugging. This way, we
64         can differentiate which service worker process is used for which origin in activity monitor.
65
66         * Shared/ChildProcess.h:
67         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
68         (WebKit::XPCServiceInitializerDelegate::getExtraInitializationData):
69         * UIProcess/ServiceWorkerProcessProxy.cpp:
70         (WebKit::ServiceWorkerProcessProxy::getLaunchOptions):
71         * WebProcess/cocoa/WebProcessCocoa.mm:
72         (WebKit::WebProcess::initializeProcessName):
73
74 2018-03-22  Michael Catanzaro  <mcatanzaro@igalia.com>
75
76         Unreviewed, silence unused variable warning
77
78         * UIProcess/WebPageProxy.cpp:
79         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
80
81 2018-03-22  Dan Bernstein  <mitz@apple.com>
82
83         WKWebView doesn’t expose its spellCheckerDocumentTag
84         https://bugs.webkit.org/show_bug.cgi?id=183797
85         <rdar://problem/38678089>
86
87         Reviewed by Tim Horton.
88
89         * UIProcess/API/Cocoa/WKWebView.mm:
90         (-[WKWebView _spellCheckerDocumentTag]): Added this getter which calls through to the WebViewImpl.
91         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared _spellCheckerDocumentTag property.
92
93 2018-03-22  Chris Dumez  <cdumez@apple.com>
94
95         Use the same SWServer for all ephemeral sessions
96         https://bugs.webkit.org/show_bug.cgi?id=183921
97         <rdar://problem/36873075>
98
99         Reviewed by Youenn Fablet.
100
101         Use the same SWServer for all ephemeral sessions. SWServers never go away and we create
102         one per sessionID. When browsing doing private browsing in Safari (and other fetching
103         favorite icons), the sessionID is ephemeral and keeps changing. This means that we kept
104         constructing new SWServers that would never go away. Each SWServer has a thread so we
105         would eventually hit the thread limit for the storage process.
106
107         * StorageProcess/StorageProcess.cpp:
108         (WebKit::StorageProcess::swServerForSession):
109
110 2018-03-22  Michael Catanzaro  <mcatanzaro@igalia.com>
111
112         Unreviewed, fix format string warnings in service worker code
113
114         On Linux x86_64, uint64_t is unsigned long, not unsigned long long.
115
116         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
117         (WebKit::WebSWServerConnection::startFetch):
118         (WebKit::WebSWServerConnection::didFinishFetch):
119         (WebKit::WebSWServerConnection::didFailFetch):
120         (WebKit::WebSWServerConnection::didNotHandleFetch):
121
122 2018-03-22  Daniel Bates  <dabates@apple.com>
123
124         Expose SchemeRegistry::registerAsCanDisplayOnlyIfCanRequest() as WebKit SPI
125         https://bugs.webkit.org/show_bug.cgi?id=183907
126         <rdar://problem/38759127>
127
128         Reviewed by Alex Christensen.
129
130         Adds both modern Objective-C SPI and C SPI to allow an embedding client to register a scheme
131         whose content should be displayed/loaded if and only if it can be requested. Disregarding an
132         app that enables universal access, by using this SPI WebKit will refuse to display cross-origin
133         content for the registered schemes.
134
135         We need to add C SPI for embedding clients that have not transitioned to the modern Objective-
136         C API/SPI.
137
138         * Shared/WebProcessCreationParameters.cpp:
139         (WebKit::WebProcessCreationParameters::encode const):
140         (WebKit::WebProcessCreationParameters::decode):
141         * Shared/WebProcessCreationParameters.h:
142         * UIProcess/API/C/WKContext.cpp:
143         (WKContextRegisterURLSchemeAsCanDisplayOnlyIfCanRequest):
144         * UIProcess/API/C/WKContextPrivate.h:
145         * UIProcess/API/Cocoa/WKProcessPool.mm:
146         (-[WKProcessPool _registerURLSchemeAsCanDisplayOnlyIfCanRequest:]):
147         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
148         * UIProcess/WebProcessPool.cpp:
149         (WebKit::WebProcessPool::initializeNewWebProcess):
150         (WebKit::WebProcessPool::registerURLSchemeAsCanDisplayOnlyIfCanRequest):
151         * UIProcess/WebProcessPool.h:
152         * WebProcess/WebProcess.cpp:
153         (WebKit::WebProcess::initializeWebProcess):
154         (WebKit::WebProcess::registerURLSchemeAsCanDisplayOnlyIfCanRequest const):
155         * WebProcess/WebProcess.h:
156         * WebProcess/WebProcess.messages.in:
157
158 2018-03-22  Tim Horton  <timothy_horton@apple.com>
159
160         Improve readability of WebCore's OTHER_LDFLAGS
161         https://bugs.webkit.org/show_bug.cgi?id=183909
162         <rdar://problem/38760992>
163
164         Reviewed by Dan Bernstein.
165
166         * Configurations/Base.xcconfig:
167         * Configurations/FeatureDefines.xcconfig:
168
169 2018-03-22  Zan Dobersek  <zdobersek@igalia.com>
170
171         [TexMap] Make TextureMapperContextAttributes thread-specific
172         https://bugs.webkit.org/show_bug.cgi?id=183895
173
174         Reviewed by Carlos Garcia Campos.
175
176         CoordinatedGraphicsScene, as an implementor of the
177         TextureMapperPlatformLayerProxy::Compositor interface, doesn't have to
178         implement the texmapGL() method anymore.
179
180         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
181         (WebKit::CoordinatedGraphicsScene::onNewBufferAvailable):
182         (WebKit::CoordinatedGraphicsScene::texmapGL): Deleted.
183         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
184
185 2018-03-21  Frederic Wang  <fwang@igalia.com>
186
187         Unreviewed, update comment added in r229801.
188
189         * WebProcess/WebPage/ios/FindControllerIOS.mm:
190         (WebKit::FindController::didFindString): Remove "On Mobile" and mention bug 183889.
191
192 2018-03-21  Chris Dumez  <cdumez@apple.com>
193
194         Regression(r229831): ProcessSwap.Basic API test is crashing
195         https://bugs.webkit.org/show_bug.cgi?id=183884
196
197         Reviewed by Brady Eidson.
198
199         This code should only be called for navigation policy decisions.
200         It used to work without this check because of an early return, which
201         was dropped in r229831.
202
203         * UIProcess/WebPageProxy.cpp:
204         (WebKit::WebPageProxy::receivedPolicyDecision):
205
206 2018-03-21  Wenson Hsieh  <wenson_hsieh@apple.com>
207
208         [Extra zoom mode] Add new SPI hooks for clients to vend an input session context view
209         https://bugs.webkit.org/show_bug.cgi?id=183866
210         <rdar://problem/38692256>
211
212         Reviewed by Tim Horton.
213
214         Add new SPI hooks to _WKInputDelegate allowing internal clients to provide a view that gives additional context
215         when editing form controls, on top of the default label or placeholder text displayed by WebKit. The height
216         delegate is invoked first, giving the client an opportunity to lay out the context view to fit the given size;
217         the actual view is then queried.
218
219         If the view changes, clients may tell WebKit to reload the context view via SPI on WKFormInputSession; this call
220         to reload is plumbed through to the currently presented list view controller (at the moment, this is only the
221         text input list view controller).
222
223         * UIProcess/API/Cocoa/_WKFormInputSession.h:
224         * UIProcess/API/Cocoa/_WKInputDelegate.h:
225
226         Add the new SPI hooks, described above.
227
228         * UIProcess/ios/WKContentViewInteraction.h:
229         * UIProcess/ios/WKContentViewInteraction.mm:
230         (-[WKFormInputSession reloadFocusedElementContextView]):
231
232         Plumb the context view reload hook through WKContentView to WKTextInputListViewController.
233
234         (-[WKContentView setupInteraction]):
235         (-[WKContentView _stopAssistingNode]):
236         (-[WKContentView reloadContextViewForPresentedListViewController]):
237         (-[WKContentView focusedFormControllerDidUpdateSuggestions:]):
238
239         Slight tweak to only reload text suggestions if we are not blurring the focused element. Without this extra
240         condition, the list view controller's inner table view would get reloaded when the form input session's text
241         suggestions are set to nil when the list view controller is dismissed, causing a visible stutter in the
242         dismissal animation of view controller.
243
244 2018-03-21  Chris Dumez  <cdumez@apple.com>
245
246         WebKitTestRunner crashed in com.apple.WebKit: WebKit::WebProcessPool::terminateServiceWorkerProcesses
247         https://bugs.webkit.org/show_bug.cgi?id=183875
248
249         Reviewed by Brent Fulgham.
250
251         Protect |this| while we're iterating over m_serviceWorkerProcesses and terminating
252         each service worker process. It is possible for the WebProcess pool to get destroyed
253         as a result of terminating a service worker process.
254
255         This change is covered by layout tests that are currently crashing on the ASAN bots.
256
257         * UIProcess/WebProcessPool.cpp:
258         (WebKit::WebProcessPool::terminateServiceWorkerProcesses):
259
260 2018-03-21  Eric Carlson  <eric.carlson@apple.com>
261
262         Fix typo in inactive media stream timeout default value
263         https://bugs.webkit.org/show_bug.cgi?id=183872
264         <rdar://problem/38723903>
265
266         Reviewed by Jer Noble.
267
268         * Shared/WebPreferences.yaml: Fix typo.
269         * Shared/WebPreferencesDefaultValues.h: Ditto.
270
271 2018-03-21  Chris Dumez  <cdumez@apple.com>
272
273         Make policy decisions asynchronous
274         https://bugs.webkit.org/show_bug.cgi?id=180568
275         <rdar://problem/37131297>
276
277         Reviewed by Alex Christensen.
278
279         Get rid of synchronous IPC and synchronous code paths for policy delegates.
280         Policy decisions are now all made asynchronously and rely on asynchronous
281         IPC.
282
283         This code change is based on work by Alex Christensen.
284
285         * UIProcess/WebPageProxy.cpp:
286         (WebKit::WebPageProxy::receivedPolicyDecision):
287         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
288         (WebKit::WebPageProxy::decidePolicyForResponse):
289         * UIProcess/WebPageProxy.h:
290         * UIProcess/WebPageProxy.messages.in:
291         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
292         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
293         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
294
295 2018-03-21  Chris Dumez  <cdumez@apple.com>
296
297         ScrollViewInsetTests.RestoreInitialContentOffsetAfterCrash API test is failing with async delegates
298         https://bugs.webkit.org/show_bug.cgi?id=183787
299
300         Reviewed by Wenson Hsieh.
301
302         Without asynchronous policy delegates, when the client requests a navigation, we would:
303         1. Do a synchronous navigation policy check
304         2. If the client allows the navigation, start the provisional load
305
306         Starting the provisional load would freeze the layer tree until first meaningful
307         layout via WebFrameLoaderClient::provisionalLoadStarted() -> WebPage::didStartPageTransition().
308
309         When constructing a WebView and then requesting a load right away. This would make sure
310         we do not commit a layer tree for the initial about:blank page because the layer tree
311         would be frozen until we have something meaningful to show for the following load.
312
313         However, with asynchronous policy delegates, we are able to do a layer tree commit
314         during the asynchronous navigation policy check because the layer tree is not frozen
315         yet (provisional load has not started) and the process is not stuck on synchronous
316         IPC. When constructing a WebView and then requesting a load right away, this would
317         allow a layer tree commit for about:blank to happen before we've even started the
318         load. This would cause some API tests to fail on iOS.
319
320         To address the issue, we try and maintain pre-existing behavior by freezing the
321         layer tree during navigation policy decision.
322
323         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
324         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
325         (WebKit::WebFrameLoaderClient::didDecidePolicyForNavigationAction):
326         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
327         * WebProcess/WebPage/WebPage.cpp:
328         (WebKit::WebPage::didStartNavigationPolicyCheck):
329         (WebKit::WebPage::didCompleteNavigationPolicyCheck):
330         * WebProcess/WebPage/WebPage.h:
331
332 2018-03-21  Brent Fulgham  <bfulgham@apple.com>
333
334         Allow the WebContent process to read ViewBridge preferences
335         https://bugs.webkit.org/show_bug.cgi?id=183862
336         <rdar://problem/38459456>
337
338         Reviewed by Eric Carlson.
339
340         * WebProcess/com.apple.WebProcess.sb.in:
341
342 2018-03-21  Frederic Wang  <fwang@igalia.com>
343
344         [iOS] Text highlighted by the Find UI overlaps with NBC news header on google.com
345         https://bugs.webkit.org/show_bug.cgi?id=183658
346
347         Reviewed by Tim Horton.
348
349         On Mobile, many sites have overlay headers or footers that may overlap with the highlighted
350         text inside a scrollable overflow node. To workaround that issue, this commit changes the
351         behavior so that the text is revealed at the center of the overflow node.
352
353         * WebProcess/WebPage/ios/FindControllerIOS.mm:
354         (WebKit::FindController::didFindString): Use alignCenterAlways instead of alignToEdgeIfNeeded.
355
356 2018-03-21  Carlos Garcia Campos  <cgarcia@igalia.com>
357
358         [GTK][WPE] JSC bindings not introspectable
359         https://bugs.webkit.org/show_bug.cgi?id=136989
360
361         Reviewed by Michael Catanzaro.
362
363         Deprecate the functions that are not introspectable due to JSC C API in GTK+ port and remove them in WPE
364         port. Add alternative functions using the new JSC GLib API. We no longer need to keep a global context attached
365         to every view. We can simply create a temporary global context on demand and release it after 1 second. This
366         also allows us to remove WebPageProxy::javascriptGlobalContext() and all the related code.
367
368         * PlatformGTK.cmake:
369         * PlatformWPE.cmake:
370         * UIProcess/API/glib/WebKitJavascriptResult.cpp:
371         (_WebKitJavascriptResult::_WebKitJavascriptResult):
372         (webkitJavascriptResultCreate):
373         (webkit_javascript_result_get_global_context):
374         (webkit_javascript_result_get_value):
375         (webkit_javascript_result_get_js_value):
376         * UIProcess/API/glib/WebKitJavascriptResultPrivate.h:
377         (SharedJavascriptContext::singleton):
378         (SharedJavascriptContext::SharedJavascriptContext):
379         (SharedJavascriptContext::getOrCreateContext):
380         (SharedJavascriptContext::releaseContext):
381         * UIProcess/API/glib/WebKitUserContentManager.cpp:
382         * UIProcess/API/glib/WebKitWebView.cpp:
383         (webkit_web_view_get_javascript_global_context):
384         (webkitWebViewRunJavaScriptCallback):
385         * UIProcess/API/gtk/PageClientImpl.cpp:
386         * UIProcess/API/gtk/PageClientImpl.h:
387         * UIProcess/API/gtk/WebKitJavascriptResult.h:
388         * UIProcess/API/gtk/WebKitWebView.h:
389         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
390         * UIProcess/API/wpe/APIViewClient.h:
391         (API::ViewClient::handleDownloadRequest):
392         * UIProcess/API/wpe/PageClientImpl.cpp:
393         * UIProcess/API/wpe/PageClientImpl.h:
394         * UIProcess/API/wpe/WPEView.cpp:
395         * UIProcess/API/wpe/WPEView.h:
396         * UIProcess/API/wpe/WebKitJavascriptResult.h:
397         * UIProcess/API/wpe/WebKitWebView.h:
398         * UIProcess/PageClient.h:
399         * UIProcess/WebPageProxy.h:
400         * UIProcess/gtk/WebPageProxyGtk.cpp:
401         * UIProcess/wpe/WebPageProxyWPE.cpp:
402         * WebProcess/InjectedBundle/API/glib/WebKitFrame.cpp:
403         (webkit_frame_get_js_context):
404         (webkit_frame_get_js_context_for_script_world):
405         * WebProcess/InjectedBundle/API/gtk/WebKitFrame.h:
406         * WebProcess/InjectedBundle/API/wpe/WebKitFrame.h:
407
408 2018-03-21  Carlos Garcia Campos  <cgarcia@igalia.com>
409
410         [GTK][WPE] Initial implementation of JavaScriptCore glib bindings
411         https://bugs.webkit.org/show_bug.cgi?id=164061
412
413         Reviewed by Michael Catanzaro.
414
415         Set decorator and deprecation_guard options in API docs config files, since they are no longer common to all
416         libraries.
417
418         * PlatformGTK.cmake:
419
420 2018-03-21  Zan Dobersek  <zdobersek@igalia.com>
421
422         [CoordGraphics] Simplify CoordinatedGraphicsScene activation
423         https://bugs.webkit.org/show_bug.cgi?id=183772
424
425         Reviewed by Carlos Garcia Campos.
426
427         Simplify CoordinatedGraphicsScene::setActive() into a simple setter of
428         the m_isActive member variable. We don't have to call renderNextFrame()
429         anymore as that was only necessary to unblock CoordinatedLayerTreeHost,
430         but that can be avoided if m_isWaitingForRenderer in that class is
431         initialized to false.
432
433         CoordinatedGraphicsSceneClient::renderNextFrame() virtual method and its
434         ThreadedCompositor implementation are removed. renderNextFrame() in the
435         CoordinatedGraphicsScene class can also be removed, along with the
436         unused dispatchOnMainThread() and dispatchOnClientRunLoop() methods and
437         the associated m_clientRunLoop member variable.
438
439         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
440         (WebKit::CoordinatedGraphicsScene::CoordinatedGraphicsScene):
441         (WebKit::CoordinatedGraphicsScene::dispatchOnMainThread): Deleted.
442         (WebKit::CoordinatedGraphicsScene::dispatchOnClientRunLoop): Deleted.
443         (WebKit::CoordinatedGraphicsScene::renderNextFrame): Deleted.
444         (WebKit::CoordinatedGraphicsScene::setActive): Deleted.
445         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
446         (WebKit::CoordinatedGraphicsSceneClient::~CoordinatedGraphicsSceneClient):
447         (WebKit::CoordinatedGraphicsScene::setActive):
448         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
449         (WebKit::m_displayRefreshMonitor):
450         (WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing):
451         (WebKit::ThreadedCompositor::renderNextFrame): Deleted.
452         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
453         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
454
455 2018-03-21  Zan Dobersek  <zdobersek@igalia.com>
456
457         [TexMap] Have TextureMapperLayer::applyAnimationsRecursively() return running animation status
458         https://bugs.webkit.org/show_bug.cgi?id=183771
459
460         Reviewed by Carlos Garcia Campos.
461
462         In CoordinatedGraphicsScene::paintToCurrentGLContext(), retrieve
463         information about any running animation in the scene via the
464         TextureMapperLayer::applyAnimationsRecursively() call. Use that boolean
465         value at the end up the method, instead of again traversing the
466         TextureMapperLayer tree to determine whether any running animations are
467         present.
468
469         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
470         (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
471
472 2018-03-20  Tim Horton  <timothy_horton@apple.com>
473
474         Enable the minimal simulator feature flag when appropriate
475         https://bugs.webkit.org/show_bug.cgi?id=183807
476
477         Reviewed by Dan Bernstein.
478
479         * Configurations/FeatureDefines.xcconfig:
480
481 2018-03-19  Ryosuke Niwa  <rniwa@webkit.org>
482
483         Expose content attributes on _WKLinkIconParameters
484         https://bugs.webkit.org/show_bug.cgi?id=183768
485
486         Reviewed by Alex Christensen.
487
488         Added _WKLinkIconParameters.attributes to expose content attributes of a link element
489         which defined a favicon, touch icon, or pre-compressed touch icon.
490
491         * UIProcess/API/Cocoa/_WKLinkIconParameters.h:
492         (_WKLinkIconParameters.attributes): Added.
493         * UIProcess/API/Cocoa/_WKLinkIconParameters.mm:
494         (_WKLinkIconParameters._attributes): Added.
495         (-[_WKLinkIconParameters _initWithLinkIcon:]): Convert the hash map from WebCore to a NSDictionary.
496         (-[_WKLinkIconParameters attributes]): Added.
497
498 2018-03-20  Wenson Hsieh  <wenson_hsieh@apple.com>
499
500         Add AssistedNodeInformation plumbing for form control placeholder text and label text
501         https://bugs.webkit.org/show_bug.cgi?id=183802
502         <rdar://problem/38686273>
503
504         Reviewed by Tim Horton.
505
506         Surfaces some additional information about the currently focused element to the input delegate in the UI process.
507         See comments below for more details.
508
509         Test: WebKit.FocusedElementInfo
510
511         * Shared/AssistedNodeInformation.cpp:
512         (WebKit::AssistedNodeInformation::encode const):
513         (WebKit::AssistedNodeInformation::decode):
514         * Shared/AssistedNodeInformation.h:
515
516         Add `placeholder` and `label` to AssistedNodeInformation, which capture the value of the placeholder attribute
517         and the text of the first associated label element for the focused form control. Also add boilerplate encoder/
518         decoder support for these members.
519
520         * UIProcess/API/Cocoa/_WKFocusedElementInfo.h:
521
522         Augment _WKFocusedElementInfo to include placeholder and label.
523
524         * UIProcess/ios/WKContentViewInteraction.mm:
525         (-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:userObject:]):
526         (-[WKFocusedElementInfo label]):
527         (-[WKFocusedElementInfo placeholder]):
528         * WebProcess/WebPage/ios/WebPageIOS.mm:
529         (WebKit::WebPage::getAssistedNodeInformation):
530
531         For input elements and textareas, set the placeholder to the value of the placeholder attribute. For all
532         elements with associated labels, grab the inner text of the first label that is not empty, ignoring all labels
533         that are `display: none` (i.e. not being rendered).
534
535 2018-03-20  Brady Eidson  <beidson@apple.com>
536
537         First piece of process swapping on navigation.
538         https://bugs.webkit.org/show_bug.cgi?id=183665
539
540         Reviewed by Andy Estes.
541
542         This patch adds the first pieces of the following feature:
543         "When a navigation originating inside a WKWebView goes to a different origin,
544          swap to a new WebProcess for that navigation"
545
546         There are significant bugs to be resolved and significant optimizations to be made.
547         Which is why the feature is disabled by default.
548
549         Besides the core logic implementing the feature, this patch does a lot of related 
550         work such as:
551         - Removing some now-invalid ASSERTs
552         - Adding some ASSERTs
553         - Update various switch states to handle the new "Suspend" policy and "NavigationSwap"
554           process termination reason
555
556         * NetworkProcess/NetworkDataTaskBlob.cpp:
557         (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse):
558
559         * NetworkProcess/capture/NetworkDataTaskReplay.cpp:
560         (WebKit::NetworkCapture::NetworkDataTaskReplay::didReceiveResponse):
561
562         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
563         (toNSURLSessionResponseDisposition):
564
565         * Platform/Logging.h:
566
567         * Shared/LoadParameters.cpp:
568         (WebKit::LoadParameters::encode const):
569         (WebKit::LoadParameters::decode):
570         * Shared/LoadParameters.h:
571
572         * Shared/ProcessTerminationReason.h: Add "NavigationSwap" as a process termination reason.
573
574         * UIProcess/API/APINavigation.h:
575
576         * UIProcess/API/APIProcessPoolConfiguration.cpp:
577         (API::ProcessPoolConfiguration::copy):
578
579         * UIProcess/API/C/WKAPICast.h:
580         (WebKit::toAPI):
581
582         * UIProcess/Cocoa/NavigationState.mm:
583         (WebKit::wkProcessTerminationReason):
584
585         * UIProcess/WebFramePolicyListenerProxy.cpp:
586         (WebKit::WebFramePolicyListenerProxy::WebFramePolicyListenerProxy):
587         * UIProcess/WebFramePolicyListenerProxy.h:
588         (WebKit::WebFramePolicyListenerProxy::create):
589         (WebKit::WebFramePolicyListenerProxy::policyListenerType const):
590
591         * UIProcess/WebFrameProxy.cpp:
592         (WebKit::WebFrameProxy::setUpPolicyListenerProxy):
593         (WebKit::WebFrameProxy::activePolicyListenerProxy):
594         * UIProcess/WebFrameProxy.h:
595
596         * UIProcess/WebNavigationState.cpp:
597         (WebKit::WebNavigationState::navigation):
598         (WebKit::WebNavigationState::takeNavigation):
599
600         * UIProcess/WebPageProxy.cpp:
601         (WebKit::WebPageProxy::reattachToWebProcess):
602         (WebKit::WebPageProxy::attachToProcessForNavigation): Pretend that the existing process 
603           terminated using the new "NavigationSwap" reason, then manually start the next load.
604         (WebKit::WebPageProxy::loadRequest):
605         (WebKit::WebPageProxy::loadRequestWithNavigation):
606         (WebKit::WebPageProxy::receivedPolicyDecision):
607         (WebKit::WebPageProxy::continueNavigationInNewProcess):
608         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
609         (WebKit::WebPageProxy::decidePolicyForResponse):
610         (WebKit::WebPageProxy::processDidTerminate):
611         (WebKit::WebPageProxy::resetState):
612         (WebKit::WebPageProxy::resetStateAfterProcessExited):
613         * UIProcess/WebPageProxy.h:
614
615         * UIProcess/WebProcessPool.cpp:
616         (WebKit::WebProcessPool::processForNavigation): Determine which process should be used
617           for a proposed navigation, creating a new one if necessary.
618         * UIProcess/WebProcessPool.h:
619
620         * UIProcess/WebStorage/StorageManager.cpp:
621         (WebKit::StorageManager::SessionStorageNamespace::setAllowedConnection):
622
623         * WebProcess/WebPage/WebPage.cpp:
624         (WebKit::WebPage::loadRequest):
625
626 2018-03-20  Youenn Fablet  <youenn@apple.com>
627
628         ServiceWorkerClientFetch::didReceiveData should check for m_encodedDataLength
629         https://bugs.webkit.org/show_bug.cgi?id=183668
630
631         Reviewed by Chris Dumez.
632
633         Crash happens when releasing a RefPtr<SharedBuffer> buffer that is null.
634         It happens because ServiceWorkerClientFetch can call m_loader->didReceiveBuffer at two different places.
635         Either when receiving an IPC call or as part of completion handler for the response validation check.
636         At each call site, we release the buffer to pass it to the loader and we set m_encodedLength to zero.
637         The fix is to add the m_encodedLength check like done in the case of response validation check completion handler.
638
639         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
640         (WebKit::ServiceWorkerClientFetch::didReceiveData):
641
642 2018-03-20  Jeff Miller  <jeffm@apple.com>
643
644         Expose aggressiveTileRetentionEnabled in WKPreferences SPI to match C SPI
645         https://bugs.webkit.org/show_bug.cgi?id=183790
646
647         Reviewed by Alex Christensen.
648         
649         Expose this property on macOS only.
650
651         * UIProcess/API/Cocoa/WKPreferences.mm:
652         (-[WKPreferences _setAggressiveTileRetentionEnabled:]):
653         (-[WKPreferences _aggressiveTileRetentionEnabled]):
654         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
655
656 2018-03-20  Tim Horton  <timothy_horton@apple.com>
657
658         Add and adopt WK_PLATFORM_NAME and adjust default feature defines
659         https://bugs.webkit.org/show_bug.cgi?id=183758
660         <rdar://problem/38017644>
661
662         Reviewed by Dan Bernstein.
663
664         * Configurations/FeatureDefines.xcconfig:
665
666 2018-03-20  Chris Dumez  <cdumez@apple.com>
667
668         Unreviewed, rolling out r229726 and r229763.
669
670         Caused some API test failures on iOS
671
672         Reverted changesets:
673
674         "Make policy decisions asynchronous"
675         https://bugs.webkit.org/show_bug.cgi?id=180568
676         https://trac.webkit.org/changeset/229726
677
678         "Rebaseline three webarchive tests for WK2 after r229726."
679         https://bugs.webkit.org/show_bug.cgi?id=180568
680         https://trac.webkit.org/changeset/229763
681
682 2018-03-20  Brent Fulgham  <bfulgham@apple.com>
683
684         [iOS] Grant IOKit preference access for the Home button
685         https://bugs.webkit.org/show_bug.cgi?id=183754
686         <rdar://problem/38179704>
687
688         Reviewed by Eric Carlson.
689
690         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
691
692 2018-03-20  Wenson Hsieh  <wenson_hsieh@apple.com>
693
694         [Extra zoom mode] Adopt updated input view controller machinery for text input
695         https://bugs.webkit.org/show_bug.cgi?id=183765
696         <rdar://problem/36926269>
697
698         Reviewed by Tim Horton.
699
700         Adopt new classes for extra zoomed text inputs. Massage WKTextInputViewController into WKTextInputListView-
701         Controller and introduce WKFormControlListViewController, the eventual replacement for the base class
702         WKTextFormControlViewController that will act as the base class of all list-view-controller-based input UI in
703         extra zoom mode.
704
705         * UIProcess/ios/WKContentViewInteraction.h:
706         * UIProcess/ios/WKContentViewInteraction.mm:
707         (-[WKContentView presentTextInputViewController:]):
708         (-[WKContentView dismissTextInputViewController:]):
709         (-[WKContentView focusedFormControllerDidUpdateSuggestions:]):
710         (-[WKContentView _wheelChangedWithEvent:]):
711         * UIProcess/ios/forms/WKFormControlListViewController.h: Copied from Source/WebKit/UIProcess/ios/forms/WKTextInputViewController.h.
712         * UIProcess/ios/forms/WKFormControlListViewController.mm: Renamed from Source/WebKit/UIProcess/ios/forms/WKTextInputViewController.mm.
713         * UIProcess/ios/forms/WKTextInputListViewController.h: Copied from Source/WebKit/UIProcess/ios/forms/WKTextInputViewController.h.
714         * UIProcess/ios/forms/WKTextInputListViewController.mm: Renamed from Source/WebKit/UIProcess/ios/forms/WKTextInputViewController.h.
715         * WebKit.xcodeproj/project.pbxproj:
716
717 2018-03-19  Megan Gardner  <megan_gardner@apple.com>
718
719         Clear style colors when setting default appearance
720         https://bugs.webkit.org/show_bug.cgi?id=183759
721
722         Reviewed by Tim Horton.
723
724         Colors are cached and need to be cleared and recalculated.
725
726         * WebProcess/WebPage/WebPage.cpp:
727         (WebKit::WebPage::setDefaultAppearance):
728
729 2018-03-19  Chris Dumez  <cdumez@apple.com>
730
731         WKWebView.ClearAppCache is a flaky API test failure on High Sierra.
732         https://bugs.webkit.org/show_bug.cgi?id=181546
733         <rdar://problem/36444327>
734
735         Reviewed by Ryosuke Niwa.
736
737         in LocalStorageDatabaseTracker::deleteDatabasesModifiedSince(), add origin
738         to originIdentifiersToDelete if we cannot determine the last modification
739         time of the database file. This likely means the database file does not
740         exist. However, we still needs to make sure the origin gets removed from
741         the origins database and there may be *.wal / *.shm variants of the database
742         that are still on disk and need to be deleted.
743
744         * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
745         (WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince):
746
747 2018-03-19  Chris Dumez  <cdumez@apple.com>
748
749         Have one service worker process per security origin
750         https://bugs.webkit.org/show_bug.cgi?id=183600
751         <rdar://problem/35280128>
752
753         Reviewed by Brady Eidson.
754
755         Split service workers from different origins into their own processes
756         for security reasons.
757
758         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
759         (WebKit::WebSWServerConnection::startFetch):
760         (WebKit::WebSWServerConnection::postMessageToServiceWorker):
761         (WebKit::WebSWServerConnection::scheduleJobInServer):
762         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
763         (WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
764         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
765         * StorageProcess/StorageProcess.cpp:
766         (WebKit::StorageProcess::connectionToContextProcessFromIPCConnection):
767         (WebKit::StorageProcess::didClose):
768         (WebKit::StorageProcess::connectionToContextProcessWasClosed):
769         (WebKit::StorageProcess::needsServerToContextConnectionForOrigin const):
770         (WebKit::StorageProcess::didReceiveMessage):
771         (WebKit::StorageProcess::createStorageToWebProcessConnection):
772         (WebKit::StorageProcess::serverToContextConnectionForOrigin):
773         (WebKit::StorageProcess::createServerToContextConnection):
774         * StorageProcess/StorageProcess.h:
775         * StorageProcess/StorageProcess.messages.in:
776         * StorageProcess/StorageToWebProcessConnection.cpp:
777         (WebKit::StorageToWebProcessConnection::didReceiveMessage):
778         (WebKit::StorageToWebProcessConnection::didClose):
779         * StorageProcess/StorageToWebProcessConnection.h:
780         * UIProcess/API/C/WKContext.cpp:
781         (WKContextTerminateServiceWorkerProcess):
782         * UIProcess/API/Cocoa/WKProcessPool.mm:
783         (-[WKProcessPool _terminateServiceWorkerProcesses]):
784         (-[WKProcessPool _webPageContentProcessCount]):
785         (-[WKProcessPool _serviceWorkerProcessCount]):
786         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
787         * UIProcess/Network/NetworkProcessProxy.cpp:
788         (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
789         (WebKit::NetworkProcessProxy::canAuthenticateAgainstProtectionSpace):
790         * UIProcess/ServiceWorkerProcessProxy.cpp:
791         (WebKit::ServiceWorkerProcessProxy::create):
792         (WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
793         * UIProcess/ServiceWorkerProcessProxy.h:
794         (isType):
795         * UIProcess/Storage/StorageProcessProxy.cpp:
796         (WebKit::StorageProcessProxy::getStorageProcessConnection):
797         (WebKit::StorageProcessProxy::didFinishLaunching):
798         (WebKit::StorageProcessProxy::establishWorkerContextConnectionToStorageProcess):
799         (WebKit::StorageProcessProxy::establishWorkerContextConnectionToStorageProcessForExplicitSession):
800         * UIProcess/Storage/StorageProcessProxy.h:
801         * UIProcess/Storage/StorageProcessProxy.messages.in:
802         * UIProcess/WebProcessPool.cpp:
803         (WebKit::WebProcessPool::getStorageProcessConnection):
804         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
805         (WebKit::WebProcessPool::createNewWebProcess):
806         (WebKit::WebProcessPool::disconnectProcess):
807         (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
808         (WebKit::WebProcessPool::createWebPage):
809         (WebKit::WebProcessPool::updateServiceWorkerUserAgent):
810         (WebKit::WebProcessPool::mayHaveRegisteredServiceWorkers):
811         (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
812         (WebKit::WebProcessPool::terminateServiceWorkerProcesses):
813         (WebKit::WebProcessPool::updateProcessAssertions):
814         (WebKit::WebProcessPool::serviceWorkerProcessProxyFromPageID const):
815         * UIProcess/WebProcessPool.h:
816         * UIProcess/WebProcessProxy.cpp:
817         (WebKit::WebProcessProxy::getStorageProcessConnection):
818
819 2018-03-19  Jiewen Tan  <jiewen_tan@apple.com>
820
821         Unreviewed, another quick fix for r229699
822
823         Restricts ENABLE_WEB_AUTHN to only macOS and iOS.
824
825         * Configurations/FeatureDefines.xcconfig:
826
827 2018-03-19  Chris Dumez  <cdumez@apple.com>
828
829         Make policy decisions asynchronous
830         https://bugs.webkit.org/show_bug.cgi?id=180568
831         <rdar://problem/37131297>
832
833         Reviewed by Alex Christensen.
834
835         Get rid of synchronous IPC and synchronous code paths for policy delegates.
836         Policy decisions are now all made asynchronously and rely on asynchronous
837         IPC.
838
839         This code change is based on work by Alex Christensen.
840
841         * UIProcess/WebPageProxy.cpp:
842         (WebKit::WebPageProxy::receivedPolicyDecision):
843         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
844         (WebKit::WebPageProxy::decidePolicyForResponse):
845         * UIProcess/WebPageProxy.h:
846         * UIProcess/WebPageProxy.messages.in:
847         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
848         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
849         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
850
851 2018-03-19  Brian Burg  <bburg@apple.com>
852
853         Web Inspector: clean up WKWebView configuration code
854         https://bugs.webkit.org/show_bug.cgi?id=183747
855         <rdar://problem/38629343>
856
857         Reviewed by Timothy Hatcher.
858
859         * UIProcess/mac/WKInspectorViewController.mm:
860         (-[WKInspectorViewController webView]): Always use system
861         appearance for Inspector's web content.
862
863 2018-03-19  Eric Carlson  <eric.carlson@apple.com>
864
865         [Extra zoom mode] Require fullscreen for video playback
866         https://bugs.webkit.org/show_bug.cgi?id=183742
867         <rdar://problem/38235862>
868
869         Reviewed by Jer Noble.
870
871         * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
872         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
873         (-[WKVideoFullScreenViewController initWithAVPlayerViewController:]):
874         (-[WKVideoFullScreenViewController viewDidLoad]):
875         (-[WKVideoFullScreenViewController prefersStatusBarHidden]):
876         (WebKit::VideoFullscreenModelContext::presentingViewController):
877         (WebKit::VideoFullscreenModelContext::createVideoFullscreenViewController):
878         * WebProcess/cocoa/VideoFullscreenManager.mm:
879         (WebKit::VideoFullscreenManager::didEnterFullscreen):
880
881 2018-03-19  Daniel Bates  <dabates@apple.com>
882
883         test-webkitpy no longer runs WebKit2 tests
884         https://bugs.webkit.org/show_bug.cgi?id=183724
885
886         Reviewed by Alexey Proskuryakov.
887
888         Fixes an issue where Python emits errors "global name reset_results is not defined" when
889         running tests in messages_unittest.py using test-webkitpy.
890
891         Currently messages_unittest.py conditionally defines the global variable reset_results
892         when run as the main program (i.e. __name__ == "__main__"). When messages_unittest.py is
893         imported as a module as test-webkitpy does then it is not considered the main program
894         ;=> the top-level script environment is not __main__ ;=> we do not define the global
895         variable reset_results. Instead we should unconditionally define the global variable
896         reset_results.
897
898         * Scripts/webkit/messages_unittest.py:
899
900 2018-03-19  Per Arne Vollan  <pvollan@apple.com>
901
902         When the WebContent process is blocked from accessing the WindowServer, the call CVDisplayLinkCreateWithCGDisplay will fail.
903         https://bugs.webkit.org/show_bug.cgi?id=183604
904         <rdar://problem/38305109>
905
906         Reviewed by Brent Fulgham.
907
908         * UIProcess/WebPageProxy.h:
909         * UIProcess/WebPageProxy.messages.in:
910         * UIProcess/mac/DisplayLink.cpp: Added.
911         (WebKit::DisplayLink::DisplayLink):
912         (WebKit::DisplayLink::~DisplayLink):
913         (WebKit::DisplayLink::displayLinkCallback):
914         * UIProcess/mac/DisplayLink.h: Added.
915         * UIProcess/mac/WebPageProxyMac.mm:
916         (WebKit::WebPageProxy::startDisplayRefreshMonitor):
917         (WebKit::WebPageProxy::stopDisplayRefreshMonitor):
918         * WebKit.xcodeproj/project.pbxproj:
919         * WebProcess/WebPage/DrawingArea.cpp:
920         (WebKit::DrawingArea::createDisplayRefreshMonitor):
921         * WebProcess/WebPage/DrawingArea.h:
922         * WebProcess/WebPage/DrawingArea.messages.in:
923         * WebProcess/WebPage/mac/DrawingAreaMac.cpp: Added.
924         (WebKit::DisplayRefreshMonitorMac::create):
925         (WebKit::DisplayRefreshMonitorMac::DisplayRefreshMonitorMac):
926         (WebKit::DisplayRefreshMonitorMac::~DisplayRefreshMonitorMac):
927         (WebKit::DisplayRefreshMonitorMac::requestRefreshCallback):
928         (WebKit::DisplayRefreshMonitorMac::displayLinkFired):
929         (WebKit::DrawingArea::screenWasRefreshed):
930         (WebKit::DrawingArea::createDisplayRefreshMonitor):
931
932 2018-03-17  Jiewen Tan  <jiewen_tan@apple.com>
933
934         [WebAuthN] Implement authenticatorMakeCredential
935         https://bugs.webkit.org/show_bug.cgi?id=183527
936         <rdar://problem/35275886>
937
938         Reviewed by Brent Fulgham.
939
940         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.cpp:
941         (WebKit::WebCredentialsMessengerProxy::WebCredentialsMessengerProxy):
942         (WebKit::WebCredentialsMessengerProxy::makeCredential):
943         (WebKit::WebCredentialsMessengerProxy::getAssertion):
944         (WebKit::WebCredentialsMessengerProxy::isUserVerifyingPlatformAuthenticatorAvailable):
945         (WebKit::WebCredentialsMessengerProxy::exceptionReply):
946         (WebKit::WebCredentialsMessengerProxy::makeCredentialReply):
947         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.h:
948         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.messages.in:
949         * UIProcess/CredentialManagement/cocoa/WebCredentialsMessengerProxyCocoa.mm: Removed.
950         * WebKit.xcodeproj/project.pbxproj:
951         * WebProcess/CredentialManagement/WebCredentialsMessenger.cpp:
952         (WebKit::WebCredentialsMessenger::makeCredential):
953         (WebKit::WebCredentialsMessenger::makeCredentialReply):
954         * WebProcess/CredentialManagement/WebCredentialsMessenger.h:
955         * WebProcess/CredentialManagement/WebCredentialsMessenger.messages.in:
956
957 2018-03-17  Daniel Bates  <dabates@apple.com>
958
959         Tests fail in messages_unittest.py
960         https://bugs.webkit.org/show_bug.cgi?id=183725
961
962         Partial revert of r222113. The messages generator machinery does not know when
963         it is sufficient to emit an include for wtf/Forward.h as opposed to a concrete
964         header.
965
966         * Scripts/webkit/LegacyMessages-expected.h:
967         * Scripts/webkit/Messages-expected.h:
968
969 2018-03-16  Wenson Hsieh  <wenson_hsieh@apple.com>
970
971         Unreviewed, rolling out r229688.
972
973         There's a solution that doesn't require this SPI.
974
975         Reverted changeset:
976
977         "Add SPI to expose width and height anchors for WKWebView's
978         content view"
979         https://bugs.webkit.org/show_bug.cgi?id=183711
980         https://trac.webkit.org/changeset/229688
981
982 2018-03-16  Wenson Hsieh  <wenson_hsieh@apple.com>
983
984         Add SPI to expose width and height anchors for WKWebView's content view
985         https://bugs.webkit.org/show_bug.cgi?id=183711
986         <rdar://problem/38562899>
987
988         Reviewed by Tim Horton.
989
990         Add _contentWidthAnchor and _contentHeightAnchor SPI to WKWebView for internal clients to be able to reason
991         about the size of the content view on iOS using autolayout.
992
993         Test: WebKit.AutoLayoutPositionHeaderAndFooterViewsInScrollView.
994
995         * UIProcess/API/Cocoa/WKWebView.mm:
996         (-[WKWebView _contentWidthAnchor]):
997         (-[WKWebView _contentHeightAnchor]):
998         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
999
1000 2018-03-16  Megan Gardner  <megan_gardner@apple.com>
1001
1002         Add _useSystemAppearance to WKView
1003         https://bugs.webkit.org/show_bug.cgi?id=183706
1004         <rdar://problem/38516584>
1005
1006         Reviewed by Tim Horton.
1007
1008         Plumb useSystemAppearance and other supporting functions to WKView
1009
1010         * UIProcess/API/Cocoa/WKViewPrivate.h:
1011         * UIProcess/API/Cocoa/WKWebView.mm:
1012         (-[WKWebView _initializeWithConfiguration:]):
1013         (-[WKWebView _useSystemAppearance]):
1014         (-[WKWebView _setUseSystemAppearance:]):
1015         (-[WKWebView effectiveAppearanceDidChange]):
1016         * UIProcess/API/mac/WKView.mm:
1017         (-[WKView effectiveAppearanceDidChange]):
1018         (-[WKView _setUseSystemAppearance:]):
1019         (-[WKView _useSystemAppearance]):
1020         (-[WKView _setDefaultAppearance:]):
1021         * UIProcess/Cocoa/WebViewImpl.h:
1022         * UIProcess/Cocoa/WebViewImpl.mm:
1023         (WebKit::WebViewImpl::setUseSystemAppearance):
1024         (WebKit::WebViewImpl::useSystemAppearance):
1025         (WebKit::WebViewImpl::setDefaultAppearance):
1026
1027 2018-03-16  Brent Fulgham  <bfulgham@apple.com>
1028
1029         Set a trap to catch an infrequent form-related nullptr crash
1030         https://bugs.webkit.org/show_bug.cgi?id=183704
1031         <rdar://problem/37579354>
1032
1033         Reviewed by Ryosuke Niwa.
1034
1035         Add a RELEASE_ASSERT to see if we ever encounter a nullptr WebCore frame.
1036
1037         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1038         (WebKit::WebFrameLoaderClient::dispatchWillSubmitForm):
1039
1040 2018-03-16  Jer Noble  <jer.noble@apple.com>
1041
1042         Make Fullscreen API an Experimental Feature
1043         https://bugs.webkit.org/show_bug.cgi?id=183662
1044
1045         Reviewed by Jon Lee.
1046
1047         Add the ability to have a conditional for whether an Experimental Feature is "visible", separate from
1048         whether the preference is available, for definining platform-specific Experimental Features.
1049
1050         * Scripts/GeneratePreferences.rb:
1051         * Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb:
1052         * Shared/WebPreferences.yaml:
1053
1054 2018-03-16  Megan Gardner  <megan_gardner@apple.com>
1055
1056         Ensure that style is updated when the effective appearance changes
1057         https://bugs.webkit.org/show_bug.cgi?id=183690
1058         <rdar://problem/38385900>
1059
1060         Reviewed by Tim Horton and Wenson Hsieh.
1061
1062         Respond to and respect the effective appearance changing.
1063
1064         * UIProcess/API/Cocoa/WKWebView.mm:
1065         (-[WKWebView effectiveAppearanceDidChange]):
1066         * WebProcess/WebPage/WebPage.cpp:
1067         (WebKit::WebPage::setDefaultAppearance):
1068
1069 2018-03-16  Chris Dumez  <cdumez@apple.com>
1070
1071         URLSchemeHandler.Basic API test fails with async policy delegates
1072         https://bugs.webkit.org/show_bug.cgi?id=183678
1073
1074         Reviewed by Alex Christensen.
1075
1076         The issue is that the client calls _didPerformRedirection / didReceiveResponse / didReceiveData / didFinish
1077         on the URLScheme task one after the one, synchronously. However, redirects and responses can be processed
1078         asynchronously. To address the issue, we now queue operations requested by the client if we're waiting
1079         for an async policy delegate.
1080
1081         * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp:
1082         (WebKit::WebURLSchemeTaskProxy::didPerformRedirection):
1083         (WebKit::WebURLSchemeTaskProxy::didReceiveResponse):
1084         (WebKit::WebURLSchemeTaskProxy::didReceiveData):
1085         (WebKit::WebURLSchemeTaskProxy::didComplete):
1086         (WebKit::WebURLSchemeTaskProxy::processNextPendingTask):
1087         * WebProcess/WebPage/WebURLSchemeTaskProxy.h:
1088         (WebKit::WebURLSchemeTaskProxy::queueTask):
1089
1090 2018-03-16  Claudio Saavedra  <csaavedra@igalia.com>
1091
1092         Suppress GCC warnings by using #include instead of #import
1093
1094         Unreviewed.
1095         * UIProcess/SystemPreviewController.cpp:
1096
1097 2018-03-15  Keith Rollin  <krollin@apple.com>
1098
1099         Telemetry for stalled webpage loads
1100         https://bugs.webkit.org/show_bug.cgi?id=183221
1101         <rdar://problem/36549013>
1102
1103         Reviewed by Chris Dumez.
1104
1105         Add telemetry for page loads, tracking the pages that succeed, fail,
1106         or are canceled. This information will be used to track the overall
1107         health of our page loading as time goes on.
1108
1109         * UIProcess/WebPageProxy.cpp:
1110         (WebKit::WebPageProxy::close):
1111         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
1112         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
1113         (WebKit::WebPageProxy::didFinishLoadForFrame):
1114         (WebKit::WebPageProxy::didFailLoadForFrame):
1115         (WebKit::WebPageProxy::reportPageLoadResult):
1116         * UIProcess/WebPageProxy.h:
1117         (WebKit::WebPageProxy::reportPageLoadResult):
1118
1119 2018-03-15  Wenson Hsieh  <wenson_hsieh@apple.com>
1120
1121         [iOS WK2] Hit-testing fails when specifying a large top content inset
1122         https://bugs.webkit.org/show_bug.cgi?id=183648
1123         <rdar://problem/38421894>
1124
1125         Reviewed by Tim Horton.
1126
1127         Currently, in the process of computing unobscured content rect in the UI process on iOS, we subtract away parts
1128         of the view that are obscured by insets (e.g. MobileSafari's chrome). The helper method -[WKWebView
1129         _computeContentInset] is intended to compute these obscuring insets around the view, but it takes scroll view
1130         insets into account. This means that if WKWebView's inner scroll view has content insets, we'll end up shrinking
1131         the unobscured content rect as if the insetted region obscures the viewport; this causes visible content on the
1132         page to be uninteractible, since WKWebView erroneously thinks it's obscured.
1133
1134         To address this, we rename _computeContentInset to _computeObscuredInset, and make it _not_ affected by the
1135         scroll view's content insets. From code inspection and testing, all but one of the former call sites of
1136         _computeContentInset really need the obscured inset instead (see below). The one exception, -[WKWebView
1137         _adjustedContentOffset:], takes a scroll position from the page and maps it to a content offset in the inner
1138         UIScrollView (see below for more details).
1139
1140         Tests:  ScrollViewInsetTests.InnerHeightWithLargeTopContentInset
1141                 ScrollViewInsetTests.InnerHeightWithLargeBottomContentInset
1142                 ScrollViewInsetTests.RestoreInitialContentOffsetAfterCrash
1143                 ScrollViewInsetTests.RestoreInitialContentOffsetAfterNavigation
1144
1145         * UIProcess/API/Cocoa/WKWebView.mm:
1146         (-[WKWebView _setHasCustomContentView:loadedMIMEType:]):
1147         (-[WKWebView _initialContentOffsetForScrollView]):
1148
1149         See -_contentOffsetAdjustedForObscuredInset: below.
1150
1151         (-[WKWebView _contentOffsetAdjustedForObscuredInset:]):
1152
1153         Formerly -_adjustedContentOffset:. -_contentOffsetAdjustedForObscuredInset: no longer takes scroll view content
1154         inset into account, and only cares about insets that obscure the view. This means that the scroll position
1155         (0, 0) in the document now maps to the content offset in the inner UIScrollView, such that the top of the page
1156         is aligned with the top of the viewport.
1157
1158         However, many call sites of -_adjustedContentOffset: were intended to compute the initial, top-left-most content
1159         offset in the scroll view to scroll to when resetting the web view (i.e., they pass in CGPointZero for the
1160         scroll position). An example of this is the scroll position to jump to after web content process termination, or
1161         the scroll position after main frame navigation. In these cases, we actually want to jump to the top of the
1162         scroll view, so we do want to use the version of the computed content insets that accounts for scroll view
1163         insets.
1164
1165         Since these cases are limited to finding the top-left-most scroll position, we pull this out into a separate
1166         helper method (-_initialContentOffsetForScrollView) and replace calls to
1167         `-[self _adjustedContentOffset:CGPointZero]` with this instead.
1168
1169         (-[WKWebView _computedObscuredInset]):
1170
1171         A version of -_computeContentInset that doesn't care about scroll view insets. Used whereever we need to account
1172         for obscured insets rather than the combination of content insets and unobscured insets (e.g.
1173         -_initialContentOffsetForScrollView).
1174
1175         (-[WKWebView _processDidExit]):
1176         (-[WKWebView _didCommitLayerTree:]):
1177         (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:nextValidLayerTreeTransactionID:]):
1178         (-[WKWebView _scrollToContentScrollPosition:scrollOrigin:]):
1179         (-[WKWebView scrollViewWillEndDragging:withVelocity:targetContentOffset:]):
1180         (-[WKWebView _updateVisibleContentRects]):
1181         (-[WKWebView _navigationGestureDidBegin]):
1182
1183         In all these places where we inset the view bounds to compute the unobscured region of the viewport, it doesn't
1184         make sense to additionally inset by the scroll view's content insets, since (1) the scroll view's content insets
1185         don't obscure the viewport, and (2) it's perfectly valid for the inner scroll view to have arbitrarily large
1186         content insets.
1187
1188         (-[WKWebView _adjustedContentOffset:]): Deleted.
1189
1190         Renamed to -_contentOffsetAdjustedForObscuredInset:.
1191
1192         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1193         * UIProcess/ios/WKPDFView.mm:
1194         (-[WKPDFView _offsetForPageNumberIndicator]):
1195
1196         Similar to -_scrollToFragment: (see below).
1197
1198         (-[WKPDFView _scrollToFragment:]):
1199
1200         This helper figures out which content offset to scroll to, given the y-origin of a page in a PDF document. If
1201         insets are added to the scroll view, we end up scrolling to the wrong content offset since we'll add the height
1202         of the top content inset (imagine that the top content inset is enormous — then we'll scroll an amount equal to
1203         the top content inset _past_ the point where the y-origin of the page is at the top of the viewport).
1204
1205 2018-03-15  Brent Fulgham  <bfulgham@apple.com>
1206
1207         [macOS] Correct sandbox violations during Flash playback under ToT WebKit
1208         https://bugs.webkit.org/show_bug.cgi?id=183672
1209         <rdar://problem/38510839>
1210
1211         Reviewed by Eric Carlson.
1212
1213         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
1214         * WebProcess/com.apple.WebProcess.sb.in:
1215
1216 2018-03-15  Brent Fulgham  <bfulgham@apple.com>
1217
1218         REGRESSION(r229484): Plugins often require CGS Connections to draw
1219         https://bugs.webkit.org/show_bug.cgi?id=183663
1220         <rdar://problem/38439218>
1221
1222         Reviewed by Per Arne Vollan.
1223
1224         Flash requires an active CGSConnection to work properly. Since we don't want the WebContent
1225         process to have on, create a new plugin process-specific layer host creation method that
1226         gives this access.
1227
1228         * Platform/mac/LayerHostingContext.h:
1229         * Platform/mac/LayerHostingContext.mm:
1230         (WebKit::LayerHostingContext::createForExternalPluginHostingProcess): Added.
1231         * PluginProcess/mac/PluginControllerProxyMac.mm:
1232         (WebKit::PluginControllerProxy::updateLayerHostingContext): Use the new creation
1233         method.
1234
1235 2018-03-15  Zan Dobersek  <zdobersek@igalia.com>
1236
1237         [TexMap] Remove TextureMapperLayer::texture()
1238         https://bugs.webkit.org/show_bug.cgi?id=183635
1239
1240         Reviewed by Michael Catanzaro.
1241
1242         Remove the CoordinatedBackingStore::texture() override since the virtual
1243         method is also being removed.
1244
1245         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
1246         (WebKit::CoordinatedBackingStore::texture const): Deleted.
1247         * Shared/CoordinatedGraphics/CoordinatedBackingStore.h:
1248
1249 2018-03-14  John Wilander  <wilander@apple.com>
1250
1251         Resource Load Statistics: Add clearing of storage access to WebResourceLoadStatisticsStore::clearInMemory()
1252         https://bugs.webkit.org/show_bug.cgi?id=183641
1253         <rdar://problem/38469497>
1254
1255         Reviewed by Brent Fulgham and Chris Dumez.
1256
1257         This change is to stabilize existing layout tests by removing
1258         all storage access entries on a call to 
1259         WebResourceLoadStatisticsStore::clearInMemory().
1260         See Ryan Haddad's comment in https://bugs.webkit.org/show_bug.cgi?id=183620.
1261
1262         Almost all of the code changes are piping to get this
1263         call from the WebResourceLoadStatisticsStore to
1264         WebCore::NetworkStorageSession where entries reside.
1265
1266         * NetworkProcess/NetworkProcess.cpp:
1267         (WebKit::NetworkProcess::removeAllStorageAccess):
1268         * NetworkProcess/NetworkProcess.h:
1269         * NetworkProcess/NetworkProcess.messages.in:
1270         * UIProcess/Network/NetworkProcessProxy.cpp:
1271         (WebKit::NetworkProcessProxy::removeAllStorageAccess):
1272         * UIProcess/Network/NetworkProcessProxy.h:
1273         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1274         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
1275         (WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess):
1276         (WebKit::WebResourceLoadStatisticsStore::clearInMemory):
1277             Now also clears all storage access entries in the network process.
1278         * UIProcess/WebResourceLoadStatisticsStore.h:
1279         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1280         (WebKit::WebsiteDataStore::removeAllStorageAccessHandler):
1281         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
1282         * UIProcess/WebsiteData/WebsiteDataStore.h:
1283
1284 2018-03-14  Ryan Haddad  <ryanhaddad@apple.com>
1285
1286         Unreviewed, rolling out r229613.
1287
1288         Caused API test failures
1289
1290         Reverted changeset:
1291
1292         "Make policy decisions asynchronous"
1293         https://bugs.webkit.org/show_bug.cgi?id=180568
1294         https://trac.webkit.org/changeset/229613
1295
1296 2018-03-14  Chris Dumez  <cdumez@apple.com>
1297
1298         Reduce use of SWServerToContextConnection::globalServerToContextConnection()
1299         https://bugs.webkit.org/show_bug.cgi?id=183626
1300
1301         Reviewed by Youenn Fablet.
1302
1303         Reduce use of SWServerToContextConnection::globalServerToContextConnection() as we are moving
1304         towards having multiple context connections.
1305
1306         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1307         (WebKit::WebSWServerConnection::startFetch):
1308         (WebKit::WebSWServerConnection::postMessageToServiceWorker):
1309
1310 2018-03-14  Chris Dumez  <cdumez@apple.com>
1311
1312         Make policy decisions asynchronous
1313         https://bugs.webkit.org/show_bug.cgi?id=180568
1314         <rdar://problem/37131297>
1315
1316         Reviewed by Alex Christensen.
1317
1318         Get rid of synchronous IPC and synchronous code paths for policy delegates.
1319         Policy decisions are now all made asynchronously and rely on asynchronous
1320         IPC.
1321
1322         This code change is based on work by Alex Christensen.
1323
1324         * UIProcess/WebPageProxy.cpp:
1325         (WebKit::WebPageProxy::receivedPolicyDecision):
1326         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1327         (WebKit::WebPageProxy::decidePolicyForResponse):
1328         * UIProcess/WebPageProxy.h:
1329         * UIProcess/WebPageProxy.messages.in:
1330         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1331         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
1332         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1333
1334 2018-03-14  Chris Dumez  <cdumez@apple.com>
1335
1336         Drop unnecessary StorageToWebProcessConnection::workerContextProcessConnectionCreated()
1337         https://bugs.webkit.org/show_bug.cgi?id=183624
1338
1339         Reviewed by Youenn Fablet.
1340
1341         Drop unnecessary StorageToWebProcessConnection::workerContextProcessConnectionCreated()
1342         since it was going through all SWServers. Calling workerContextProcessConnectionCreated()
1343         on every StorageToWebProcessConnection was thus doing redundant work.
1344
1345         * StorageProcess/StorageProcess.cpp:
1346         (WebKit::StorageProcess::createStorageToWebProcessConnection):
1347         * StorageProcess/StorageToWebProcessConnection.cpp:
1348         (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
1349         (WebKit::StorageToWebProcessConnection::workerContextProcessConnectionCreated): Deleted.
1350         * StorageProcess/StorageToWebProcessConnection.h:
1351
1352 2018-03-14  Tim Horton  <timothy_horton@apple.com>
1353
1354         Fix the build after r229567
1355
1356         * Configurations/FeatureDefines.xcconfig:
1357
1358 2018-03-13  John Wilander  <wilander@apple.com>
1359
1360         Resource Load Statistics: Immediately forward cookie access for domains with previous user interaction when there's an opener document
1361         https://bugs.webkit.org/show_bug.cgi?id=183620
1362         <rdar://problem/38431469>
1363
1364         Reviewed by Brent Fulgham.
1365
1366         It turns out the fix in https://bugs.webkit.org/show_bug.cgi?id=183577
1367         wasn't enough to address the compatibility issues with popups. Some of
1368         them just detect their unpartitioned cookies, auto-dismiss themselves,
1369         and expect their unpartitioned cookies to be available under the opener
1370         afterwards. We should grant them access if the popup's domain has had
1371         user interaction _previously_.
1372
1373         Note that we still need https://bugs.webkit.org/show_bug.cgi?id=183577
1374         because if the popup's domain has not received user interaction
1375         previously, we will not grant it storage access on just the window open.
1376
1377         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1378         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
1379         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccessUnderOpener): Deleted.
1380             Renamed WebResourceLoadStatisticsStore::grantStorageAccessUnderOpener()
1381             to WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener()
1382             since there is now a case where access will not be granted, i.e. when
1383             the popup domain has not had user interaction previously.
1384         * UIProcess/WebResourceLoadStatisticsStore.h:
1385         * UIProcess/WebResourceLoadStatisticsStore.messages.in:
1386              Similar renaming.
1387         * WebProcess/WebProcess.cpp:
1388         (WebProcess::WebProcess):
1389              Similar renaming.
1390
1391 2018-03-13  Jer Noble  <jer.noble@apple.com>
1392
1393         Add missing artwork for fullscreen mode.
1394         https://bugs.webkit.org/show_bug.cgi?id=183618
1395
1396         Reviewed by Jon Lee.
1397
1398         * Resources/ios/iOS.xcassets/Done.imageset/Contents.json: Added.
1399         * Resources/ios/iOS.xcassets/Done.imageset/Done.pdf: Added.
1400         * Resources/ios/iOS.xcassets/StartPictureInPictureButton.imageset/Contents.json: Added.
1401         * Resources/ios/iOS.xcassets/StartPictureInPictureButton.imageset/StartPictureInPictureButton@1x.png: Added.
1402         * Resources/ios/iOS.xcassets/StartPictureInPictureButton.imageset/StartPictureInPictureButton@2x.png: Added.
1403         * Resources/ios/iOS.xcassets/StartPictureInPictureButton.imageset/StartPictureInPictureButton@3x.png: Added.
1404         * Resources/ios/iOS.xcassets/StopPictureInPictureButton.imageset/Contents.json: Added.
1405         * Resources/ios/iOS.xcassets/StopPictureInPictureButton.imageset/StopPictureInPictureButton@1x.png: Added.
1406         * Resources/ios/iOS.xcassets/StopPictureInPictureButton.imageset/StopPictureInPictureButton@2x.png: Added.
1407         * Resources/ios/iOS.xcassets/StopPictureInPictureButton.imageset/StopPictureInPictureButton@3x.png: Added.
1408
1409 2018-03-13  Brian Burg  <bburg@apple.com>
1410
1411         [WK2] Web Inspector: NavigationAction for opening a link in a new tab should have a UserGestureIndicator
1412         https://bugs.webkit.org/show_bug.cgi?id=183612
1413         <rdar://problem/38388641>
1414
1415         Reviewed by Timothy Hatcher.
1416
1417         The current gesture token will be attached to the NavigationAction at construction time,
1418         so set up a UserGestureIndicator when creating the action and sending it out.
1419
1420         * WebProcess/WebPage/WebInspector.cpp:
1421         (WebKit::WebInspector::openInNewTab):
1422
1423 2018-03-13  Dean Jackson  <dino@apple.com>
1424
1425         WKSystemPreviewView needs to implement some of UIScrollViewDelegate
1426         https://bugs.webkit.org/show_bug.cgi?id=183607
1427         <rdar://problem/38427622>
1428
1429         Reviewed by Antoine Quint.
1430
1431         Add an empty implementation of scrollViewDidScroll.
1432
1433         * UIProcess/ios/WKSystemPreviewView.mm:
1434         (-[WKSystemPreviewView scrollViewDidScroll:]):
1435
1436 2018-03-13  Jiewen Tan  <jiewen_tan@apple.com>
1437
1438         Soft-link LocalAuthentication.Framework
1439         https://bugs.webkit.org/show_bug.cgi?id=183587
1440         <rdar://problem/38219763>
1441
1442         Reviewed by Brian Burg.
1443
1444         * UIProcess/CredentialManagement/cocoa/WebCredentialsMessengerProxyCocoa.mm:
1445         (WebKit::WebCredentialsMessengerProxy::platformIsUserVerifyingPlatformAuthenticatorAvailable):
1446         * WebKit.xcodeproj/project.pbxproj:
1447
1448 2018-03-12  Dean Jackson  <dino@apple.com>
1449
1450         Add a WKWebViewContentProvider for system previews
1451         https://bugs.webkit.org/show_bug.cgi?id=183582
1452         <rdar://problem/38393569>
1453
1454         Reviewed by Tim Horton.
1455
1456         Implement WKSystemPreviewView, which conforms to WKWebViewContentProvider, in
1457         order to view content as a "system preview". This effectively replaces the
1458         SystemPreviewController, which will be removed soon.
1459
1460         Some of the required methods of WKWebViewContentProvider are not necessary on
1461         this instance, so a follow-up patch will clean the protocol up a bit.
1462
1463         * UIProcess/Cocoa/NavigationState.mm: Don't trigger a SystemPreview when downloading.
1464         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):
1465
1466         * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
1467         (-[WKWebViewContentProviderRegistry init]): Register the WKSystemPreviewView for
1468         MIME types retrieved from WebKitAdditions.
1469
1470         * UIProcess/ios/WKSystemPreviewView.h: Added.
1471         * UIProcess/ios/WKSystemPreviewView.mm: Added.
1472
1473         (-[WKSystemPreviewView web_initWithFrame:webView:]):
1474         (-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]): This is the
1475         method that actually creates a QuickLook preview and provides the data.
1476         (-[WKSystemPreviewView web_setMinimumSize:]):
1477         (-[WKSystemPreviewView web_setOverlaidAccessoryViewsInset:]):
1478         (-[WKSystemPreviewView web_computedContentInsetDidChange]):
1479         (-[WKSystemPreviewView web_setFixedOverlayView:]):
1480         (-[WKSystemPreviewView web_didSameDocumentNavigation:]):
1481         (-[WKSystemPreviewView web_countStringMatches:options:maxCount:]):
1482         (-[WKSystemPreviewView web_findString:options:maxCount:]):
1483         (-[WKSystemPreviewView web_hideFindUI]):
1484
1485         (-[WKSystemPreviewView numberOfPreviewItemsInPreviewController:]): QuickLook delegates.
1486         (-[WKSystemPreviewView previewController:previewItemAtIndex:]):
1487         (-[WKSystemPreviewView provideDataForItem:]):
1488         (-[WKSystemPreviewView previewControllerWillDismiss:]):
1489
1490         * WebKit.xcodeproj/project.pbxproj: Add new files.
1491
1492 2018-03-12  John Wilander  <wilander@apple.com>
1493
1494         Resource Load Statistics: Immediately forward cookie access at user interaction when there's an opener document
1495         https://bugs.webkit.org/show_bug.cgi?id=183577
1496         <rdar://problem/38266987>
1497
1498         Reviewed by Brent Fulgham.
1499
1500         * NetworkProcess/NetworkProcess.cpp:
1501         (WebKit::NetworkProcess::hasStorageAccessForFrame):
1502             Now also checks for general page access.
1503         (WebKit::NetworkProcess::grantStorageAccess):
1504             Renamed from grantStorageAccessForFrame since the frameID now is optional.
1505         (WebKit::NetworkProcess::grantStorageAccessForFrame): Deleted.
1506             Renamed since the frameID now is optional.
1507         * NetworkProcess/NetworkProcess.h:
1508             Renaming since the frameID now is optional.
1509         * NetworkProcess/NetworkProcess.messages.in:
1510             Renaming since the frameID now is optional.
1511         * NetworkProcess/NetworkResourceLoader.cpp:
1512         (WebKit::NetworkResourceLoader::logCookieInformation):
1513             Consequence of function renaming.
1514         * UIProcess/Network/NetworkProcessProxy.cpp:
1515         (WebKit::NetworkProcessProxy::grantStorageAccess):
1516         (WebKit::NetworkProcessProxy::grantStorageAccessForFrame): Deleted.
1517             Renaming since the frameID now is optional.
1518         * UIProcess/Network/NetworkProcessProxy.h:
1519         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1520         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
1521             Renaming since the frameID now is optional.
1522         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
1523             Handler renaming since the frameID now is optional.
1524         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccessUnderOpener):
1525             New function for that grants cookie access under a whole page.
1526         * UIProcess/WebResourceLoadStatisticsStore.h:
1527             Member renaming since the frameID now is optional.
1528         * UIProcess/WebResourceLoadStatisticsStore.messages.in:
1529             New message received straight from WebCore::ResourceLoadObserver.
1530         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1531         (WebKit::WebsiteDataStore::grantStorageAccessHandler):
1532             Renamed and made frameID optional.
1533         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
1534             Consequence of renaming and making frameID optional.
1535         (WebKit::WebsiteDataStore::grantStorageAccessForFrameHandler): Deleted.
1536             Renamed and made frameID optional.
1537         * UIProcess/WebsiteData/WebsiteDataStore.h:
1538         * WebProcess/WebProcess.cpp:
1539         (WebProcess::WebProcess):
1540             Now calls setGrantStorageAccessUnderOpenerCallback() on the shared
1541             WebCore::ResourceLoadObserver.
1542
1543 2018-03-12  Tim Horton  <timothy_horton@apple.com>
1544
1545         Stop using SDK conditionals to control feature definitions
1546         https://bugs.webkit.org/show_bug.cgi?id=183430
1547         <rdar://problem/38251619>
1548
1549         Reviewed by Dan Bernstein.
1550
1551         * Configurations/FeatureDefines.xcconfig:
1552         * Configurations/WebKitTargetConditionals.xcconfig: Renamed.
1553
1554 2018-03-12  Yoav Weiss  <yoav@yoav.ws>
1555
1556         Runtime flag for link prefetch and remove link subresource.
1557         https://bugs.webkit.org/show_bug.cgi?id=183540
1558
1559         Reviewed by Chris Dumez.
1560
1561         Remove the LINK_PREFETCH build time flag.
1562
1563         * Configurations/FeatureDefines.xcconfig:
1564         * WebProcess/Network/WebLoaderStrategy.cpp:
1565         (WebKit::maximumBufferingTime):
1566
1567 2018-03-12  Chris Dumez  <cdumez@apple.com>
1568
1569         Load may get committed before receiving policy for the resource response
1570         https://bugs.webkit.org/show_bug.cgi?id=183579
1571         <rdar://problem/38268780>
1572
1573         Reviewed by Youenn Fablet.
1574
1575         r228852 updated WebResourceLoader::didReceiveResponse to only send the
1576         ContinueDidReceiveResponse IPC back to the Networkprocess *after* the
1577         policy decision for the resource response has been made. This is necessary
1578         now that policy decisions can be made asynchronously.
1579
1580         However, one of the 2 code paths in NetworkProcess side (code path when
1581         the resource is already in the HTTP disk cache) failed to wait for the
1582         ContinueDidReceiveResponse IPC before sending over the data to the WebProcess.
1583         As a result, the WebProcess could commit the load before even receiving the
1584         policy response from the client.        
1585
1586         * NetworkProcess/NetworkResourceLoader.cpp:
1587         (WebKit::NetworkResourceLoader::continueDidReceiveResponse):
1588         (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
1589         (WebKit::NetworkResourceLoader::continueProcessingCachedEntryAfterDidReceiveResponse):
1590         * NetworkProcess/NetworkResourceLoader.h:
1591         Make sure NetworkResourceLoader::didRetrieveCacheEntry() does not start sending the data
1592         until the network process gets the ContinueDidReceiveResponse IPC back from the WebProcess.
1593
1594         * WebProcess/Network/WebResourceLoader.cpp:
1595         (WebKit::WebResourceLoader::didReceiveResponse):
1596         (WebKit::WebResourceLoader::didReceiveData):
1597         * WebProcess/Network/WebResourceLoader.h:
1598         Add assertion to make sure didReceiveData() never gets called before didReceiveResponse's
1599         completion handler has been called. If this hits, then the load may get committed even
1600         though the client did not reply to the policy for the resource response yet.
1601
1602 2018-03-12  Ali Juma  <ajuma@chromium.org>
1603
1604         http/tests/workers/service/service-worker-download.https.html times out with async policy delegates
1605         https://bugs.webkit.org/show_bug.cgi?id=183479
1606
1607         Reviewed by Youenn Fablet.
1608
1609         Ensure that ServiceWorkerFetchClient::m_isCheckingResponse is set before code that depends on it
1610         executes. This bit was set by code that's posted to the runloop using 'callOnMainThread' in
1611         ServiceWorkerFetchClient::didReceiveResponse. But when didReceiveResponse is executing, tasks for
1612         handling didReceiveData, didFail, or didFinish may already have been posted to the runloop, and in
1613         that case would execute before m_isCheckingResponse gets set, and then incorrectly fail to 
1614         early-out. Fix this by directly setting m_isCheckingResponse in didReceiveResponse.
1615
1616         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
1617         (WebKit::ServiceWorkerClientFetch::start):
1618         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
1619
1620 2018-03-12  Wenson Hsieh  <wenson_hsieh@apple.com>
1621
1622         REGRESSION(r211643): Dismissing WKActionSheet should not also dismiss its presenting view controller
1623         https://bugs.webkit.org/show_bug.cgi?id=183549
1624         <rdar://problem/34960698>
1625
1626         Reviewed by Andy Estes.
1627
1628         Fixes the bug by dismissing the presented view controller (i.e. the action sheet or the view controller being
1629         presented during rotation) rather than the presenting view controller.
1630
1631         Test: ActionSheetTests.DismissingActionSheetShouldNotDismissPresentingViewController
1632
1633         * UIProcess/ios/WKActionSheet.mm:
1634         (-[WKActionSheet doneWithSheet:]):
1635
1636 2018-03-12  Javier Fernandez  <jfernandez@igalia.com>
1637
1638         Remove GridLayout runtime flag
1639         https://bugs.webkit.org/show_bug.cgi?id=183484
1640
1641         Reviewed by Myles C. Maxfield.
1642
1643         The Grid Layout feature has been enabled by default for almost a
1644         year, so I think it's time to remove the runtime flag and the
1645         codepath run when the feature is disabled.
1646
1647         * Shared/WebPreferences.yaml:
1648         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1649         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1650
1651 2018-03-11  Wenson Hsieh  <wenson_hsieh@apple.com>
1652
1653         Fix the internal iOS build after r229512
1654         https://bugs.webkit.org/show_bug.cgi?id=183550
1655
1656         Reviewed by Zalan Bujtas.
1657
1658         Fixes a typo in a header import, as well as a nullability error. `SecTrustEvaluate()` takes in a nonnull outparam,
1659         which was removed in r229512; this adds the outparam back, but does not consult its value when setting the
1660         `infoDictionary`.
1661
1662         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
1663         (-[WKFullScreenWindowController _EVOrganizationName]):
1664
1665 2018-03-10  Jer Noble  <jer.noble@apple.com>
1666
1667         Improvements to fullscreen; new UI and security features
1668         https://bugs.webkit.org/show_bug.cgi?id=183503
1669
1670         Reviewed by Dean Jackson.
1671
1672         Now that the iOS Fullscreen code has more than one major class, move it into an ios/
1673         directory.
1674
1675         Clean up the WKFullScreenWindowControllerIOS class to more clearly separate external
1676         facing API from purely internal functions.
1677
1678         Move the WKFullScreenViewController out into its own file. Add support for fullscreen
1679         top inset and fullscreen autohide duration CSS constants.
1680
1681         Add a heuristic to distinguish between media control related touches and ones that look
1682         more keyboard interactions.
1683
1684         Add a new UIStackView based control to hold the fullscreen controls.
1685
1686         * UIProcess/ios/WKFullScreenWindowControllerIOS.mm: Removed.
1687         * UIProcess/ios/fullscreen/FullscreenTouchSecheuristic.cpp: Added.
1688         (WebKit::FullscreenTouchSecheuristic::scoreOfNextTouch):
1689         (WebKit::FullscreenTouchSecheuristic::reset):
1690         (WebKit::FullscreenTouchSecheuristic::distanceScore):
1691         (WebKit::FullscreenTouchSecheuristic::attenuationFactor):
1692         * UIProcess/ios/fullscreen/FullscreenTouchSecheuristic.h: 
1693         (WebKit::FullscreenTouchSecheuristic::setRampUpSpeed):
1694         (WebKit::FullscreenTouchSecheuristic::setRampDownSpeed):
1695         (WebKit::FullscreenTouchSecheuristic::setXWeight):
1696         (WebKit::FullscreenTouchSecheuristic::setYWeight):
1697         (WebKit::FullscreenTouchSecheuristic::setSize):
1698         (WebKit::FullscreenTouchSecheuristic::setGamma):
1699         (WebKit::FullscreenTouchSecheuristic::setGammaCutoff):
1700         * UIProcess/ios/fullscreen/WKFullScreenViewController.h:
1701         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm: Added.
1702         (WKFullScreenViewControllerPlaybackSessionModelClient::setParent):
1703         (WKFullScreenViewControllerPlaybackSessionModelClient::setInterface):
1704         (-[_WKExtrinsicButton setExtrinsicContentSize:]):
1705         (-[_WKExtrinsicButton intrinsicContentSize]):
1706         (-[WKFullScreenViewController initWithWebView:]):
1707         (-[WKFullScreenViewController dealloc]):
1708         (-[WKFullScreenViewController showUI]):
1709         (-[WKFullScreenViewController hideUI]):
1710         (-[WKFullScreenViewController videoControlsManagerDidChange]):
1711         (-[WKFullScreenViewController setPrefersStatusBarHidden:]):
1712         (-[WKFullScreenViewController setPlaying:]):
1713         (-[WKFullScreenViewController setPictureInPictureActive:]):
1714         (-[WKFullScreenViewController loadView]):
1715         (-[WKFullScreenViewController viewWillAppear:]):
1716         (-[WKFullScreenViewController viewDidLayoutSubviews]):
1717         (-[WKFullScreenViewController viewWillTransitionToSize:withTransitionCoordinator:]):
1718         (-[WKFullScreenViewController preferredStatusBarStyle]):
1719         (-[WKFullScreenViewController prefersStatusBarHidden]):
1720         (-[WKFullScreenViewController gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
1721         (-[WKFullScreenViewController gestureRecognizer:shouldReceiveTouch:]):
1722         (-[WKFullScreenViewController _manager]):
1723         (-[WKFullScreenViewController _effectiveFullscreenInsetTop]):
1724         (-[WKFullScreenViewController _cancelAction:]):
1725         (-[WKFullScreenViewController _togglePiPAction:]):
1726         (-[WKFullScreenViewController _touchDetected:]):
1727         (-[WKFullScreenViewController _statusBarFrameDidChange:]):
1728         (-[WKFullScreenViewController _updateWebViewFullscreenInsets]):
1729         (-[WKFullScreenViewController _showPhishingAlert]):
1730         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.h: Copied from Source/WebKit/UIProcess/ios/WKFullScreenWindowControllerIOS.h.
1731         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm: Added.
1732         (WebKit::replaceViewWithView):
1733         (WebKit::WKWebViewState::applyTo):
1734         (WebKit::WKWebViewState::store):
1735         (-[WKFullscreenAnimationController transitionDuration:]):
1736         (-[WKFullscreenAnimationController configureInitialAndFinalStatesForTransition:]):
1737         (-[WKFullscreenAnimationController animateTransition:]):
1738         (-[WKFullscreenAnimationController animationEnded:]):
1739         (-[WKFullscreenAnimationController startInteractiveTransition:]):
1740         (-[WKFullscreenAnimationController updateWithPercent:]):
1741         (-[WKFullscreenAnimationController updateWithPercent:translation:anchor:]):
1742         (-[WKFullscreenAnimationController end:]):
1743         (-[WKFullScreenInteractiveTransition initWithAnimator:anchor:]):
1744         (-[WKFullScreenInteractiveTransition wantsInteractiveStart]):
1745         (-[WKFullScreenInteractiveTransition startInteractiveTransition:]):
1746         (-[WKFullScreenInteractiveTransition updateInteractiveTransition:withTranslation:]):
1747         (-[WKFullScreenInteractiveTransition cancelInteractiveTransition]):
1748         (-[WKFullScreenInteractiveTransition finishInteractiveTransition]):
1749         (-[WKFullScreenWindowController initWithWebView:]):
1750         (-[WKFullScreenWindowController dealloc]):
1751         (-[WKFullScreenWindowController isFullScreen]):
1752         (-[WKFullScreenWindowController webViewPlaceholder]):
1753         (-[WKFullScreenWindowController enterFullScreen]):
1754         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
1755         (-[WKFullScreenWindowController requestExitFullScreen]):
1756         (-[WKFullScreenWindowController exitFullScreen]):
1757         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
1758         (-[WKFullScreenWindowController _completedExitFullScreen]):
1759         (-[WKFullScreenWindowController close]):
1760         (-[WKFullScreenWindowController webViewDidRemoveFromSuperviewWhileInFullscreen]):
1761         (-[WKFullScreenWindowController videoControlsManagerDidChange]):
1762         (-[WKFullScreenWindowController gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
1763         (-[WKFullScreenWindowController animationControllerForPresentedController:presentingController:sourceController:]):
1764         (-[WKFullScreenWindowController animationControllerForDismissedController:]):
1765         (-[WKFullScreenWindowController interactionControllerForDismissal:]):
1766         (-[WKFullScreenWindowController _exitFullscreenImmediately]):
1767         (-[WKFullScreenWindowController _invalidateEVOrganizationName]):
1768         (-[WKFullScreenWindowController _isSecure]):
1769         (-[WKFullScreenWindowController _serverTrust]):
1770         (-[WKFullScreenWindowController _EVOrganizationName]):
1771         (-[WKFullScreenWindowController _updateLocationInfo]):
1772         (-[WKFullScreenWindowController _manager]):
1773         (-[WKFullScreenWindowController _startToDismissFullscreenChanged:]):
1774         (-[WKFullScreenWindowController _interactiveDismissChanged:]):
1775         * UIProcess/ios/fullscreen/WKFullscreenStackView.h: Renamed from Source/WebKit/UIProcess/ios/WKFullScreenWindowControllerIOS.h.
1776         * UIProcess/ios/fullscreen/WKFullscreenStackView.mm: Added.
1777         (+[WKFullscreenStackView baseEffects]):
1778         (+[WKFullscreenStackView configureView:forTintEffectWithColor:filterType:]):
1779         (+[WKFullscreenStackView configureView:withBackgroundFillOfColor:opacity:filter:]):
1780         (+[WKFullscreenStackView secondaryMaterialOverlayView]):
1781         (+[WKFullscreenStackView applyPrimaryGlyphTintToView:]):
1782         (+[WKFullscreenStackView applySecondaryGlyphTintToView:]):
1783         (-[WKFullscreenStackView initWithArrangedSubviews:axis:]):
1784         (-[WKFullscreenStackView setTargetViewForSecondaryMaterialOverlay:]):
1785         (-[WKFullscreenStackView contentView]):
1786         (-[WKFullscreenStackView _setArrangedSubviews:axis:]):
1787         (-[WKFullscreenStackView setBounds:]):
1788         (-[WKFullscreenStackView updateConstraints]):
1789         * WebKit.xcodeproj/project.pbxproj:
1790
1791 2018-03-10  Megan Gardner  <megan_gardner@apple.com>
1792
1793         Media query for default appearance
1794         https://bugs.webkit.org/show_bug.cgi?id=183539
1795         <rdar://problem/38326388>
1796
1797         Reviewed by Tim Horton.
1798
1799         Write a media query to evaluate appearance.
1800
1801         * Shared/WebPageCreationParameters.cpp:
1802         (WebKit::WebPageCreationParameters::encode const):
1803         (WebKit::WebPageCreationParameters::decode):
1804         * Shared/WebPageCreationParameters.h:
1805         * UIProcess/API/Cocoa/WKWebView.mm:
1806         (-[WKWebView _initializeWithConfiguration:]):
1807         (-[WKWebView _setUseSystemAppearance:]):
1808         * UIProcess/WebPageProxy.cpp:
1809         (WebKit::WebPageProxy::creationParameters):
1810         (WebKit::WebPageProxy::setDefaultAppearance):
1811         * UIProcess/WebPageProxy.h:
1812         (WebKit::WebPageProxy::defaultAppearance const):
1813         * WebProcess/WebPage/WebPage.cpp:
1814         (WebKit::m_credentialsMessenger):
1815         (WebKit::WebPage::setDefaultAppearance):
1816         * WebProcess/WebPage/WebPage.h:
1817         * WebProcess/WebPage/WebPage.messages.in:
1818
1819 2018-03-09  Jer Noble  <jer.noble@apple.com>
1820
1821         Unconditionalize more methods in VideoFullscreenInterface (and related classes)
1822         https://bugs.webkit.org/show_bug.cgi?id=183501
1823         <rdar://problem/38312038>
1824
1825         Unreviewed build fix; add correct pragmas to code referencing m_playbackSessionManager.
1826
1827         * UIProcess/WebPageProxy.cpp:
1828         (WebKit::WebPageProxy::hasActiveVideoForControlsManager const):
1829         (WebKit::WebPageProxy::requestControlledElementID const):
1830         (WebKit::WebPageProxy::isPlayingVideoInEnhancedFullscreen const):
1831
1832 2018-03-09  Brian Burg  <bburg@apple.com>
1833
1834         Web Inspector: there should only be one way for async backend commands to send failure
1835         https://bugs.webkit.org/show_bug.cgi?id=183524
1836
1837         Reviewed by Timothy Hatcher.
1838
1839         Remove useless ErrorString argument from async commands.
1840
1841         For Automation protocol, introduce sync and async macros for filling
1842         in and sending a failure response. Now that async commands don't have
1843         an ErrorString and sync commands don't have a callback, trying to send
1844         an error with the wrong macro is a compile-time error.
1845
1846         * UIProcess/Automation/WebAutomationSession.cpp:
1847         (WebKit::WebAutomationSession::getBrowsingContexts):
1848         (WebKit::WebAutomationSession::getBrowsingContext):
1849         (WebKit::WebAutomationSession::createBrowsingContext):
1850         (WebKit::WebAutomationSession::closeBrowsingContext):
1851         (WebKit::WebAutomationSession::switchToBrowsingContext):
1852         (WebKit::WebAutomationSession::setWindowFrameOfBrowsingContext):
1853         (WebKit::WebAutomationSession::waitForNavigationToComplete):
1854         (WebKit::WebAutomationSession::navigateBrowsingContext):
1855         (WebKit::WebAutomationSession::goBackInBrowsingContext):
1856         (WebKit::WebAutomationSession::goForwardInBrowsingContext):
1857         (WebKit::WebAutomationSession::reloadBrowsingContext):
1858         (WebKit::WebAutomationSession::evaluateJavaScriptFunction):
1859         (WebKit::WebAutomationSession::resolveChildFrameHandle):
1860         (WebKit::WebAutomationSession::resolveParentFrameHandle):
1861         (WebKit::WebAutomationSession::computeElementLayout):
1862         (WebKit::WebAutomationSession::selectOptionElement):
1863         (WebKit::WebAutomationSession::isShowingJavaScriptDialog):
1864         (WebKit::WebAutomationSession::dismissCurrentJavaScriptDialog):
1865         (WebKit::WebAutomationSession::acceptCurrentJavaScriptDialog):
1866         (WebKit::WebAutomationSession::messageOfCurrentJavaScriptDialog):
1867         (WebKit::WebAutomationSession::setUserInputForCurrentJavaScriptPrompt):
1868         (WebKit::WebAutomationSession::setFilesToSelectForFileUpload):
1869         (WebKit::WebAutomationSession::getAllCookies):
1870         (WebKit::WebAutomationSession::deleteSingleCookie):
1871         (WebKit::WebAutomationSession::addSingleCookie):
1872         (WebKit::WebAutomationSession::deleteAllCookies):
1873         (WebKit::WebAutomationSession::setSessionPermissions):
1874         (WebKit::WebAutomationSession::performMouseInteraction):
1875         (WebKit::WebAutomationSession::performKeyboardInteractions):
1876         (WebKit::WebAutomationSession::takeScreenshot):
1877         (WebKit::WebAutomationSession::didTakeScreenshot):
1878         * UIProcess/Automation/WebAutomationSession.h:
1879         * UIProcess/Automation/WebAutomationSessionMacros.h:
1880         * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
1881         (WebKit::WebAutomationSession::inspectBrowsingContext):
1882
1883 2018-03-09  Jer Noble  <jer.noble@apple.com>
1884
1885         Don't pass NULL to the result parameter of SecTrustEvaluate()
1886         https://bugs.webkit.org/show_bug.cgi?id=183495
1887         <rdar://problem/38185688>
1888
1889         Reviewed by Andy Estes.
1890
1891         * UIProcess/ios/WKFullScreenWindowControllerIOS.mm:
1892         (-[WKFullScreenWindowController _EVOrganizationName]):
1893
1894 2018-03-09  Dean Jackson  <dino@apple.com>
1895
1896         Allow NavigationState to intercept requests and send them to SystemPreviewController
1897         https://bugs.webkit.org/show_bug.cgi?id=183526
1898         <rdar://problem/37801140>
1899
1900         Reviewed by Tim Horton.
1901
1902         Implement a bit more of SystemPreviewController, such that it can be used
1903         from NavigationState to identify and handle content that can be previewed.
1904
1905         * UIProcess/Cocoa/NavigationState.mm:
1906         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):
1907             If we'd in a download response policy, then check if SystemPreviewController
1908             can show the content. We ignore the download, but pass the original URL onto
1909             the preview. Ultimately, we'd want to avoid the navigation
1910             but use the download destination URL for preview.
1911
1912         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
1913         (-[_WKPreviewControllerDataSource initWithURL:]):
1914             Move the URL to property, to help use a single datasource object for all previews.
1915         (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
1916         (-[_WKPreviewControllerDelegate initWithSystemPreviewController:]):
1917             Add a delegate object, so we can detect when the preview is dismissed and return
1918             to the previous page.
1919         (-[_WKPreviewControllerDelegate previewControllerWillDismiss:]):
1920         (WebKit::SystemPreviewController::showPreview):
1921             Use single instances of the QLPreviewController, its datasource and delegate.
1922
1923         * UIProcess/SystemPreviewController.cpp:
1924             Add a helper to navigate back.
1925         (WebKit::SystemPreviewController::SystemPreviewController):
1926         (WebKit::SystemPreviewController::sendPageBack):
1927         * UIProcess/SystemPreviewController.h:
1928
1929 2018-03-09  Jer Noble  <jer.noble@apple.com>
1930
1931         webkitfullscreenchange event not fired at the same time as :-webkit-full-screen pseudo selector changes; causes glitchiness
1932         https://bugs.webkit.org/show_bug.cgi?id=183383
1933         <rdar://problem/38197028>
1934
1935         Reviewed by Eric Carlson.
1936
1937         Follow-up patch: now that the 'fullscreenchange' event is being fired slightly earlier, the
1938         Fullscreen.TopContentInset tests triggers what appears to be an existing behavior: if you
1939         exit in the middle of an enter fullscreen animation, the exit never happens, because the
1940         NSWindow never starts the exit animation. The solution is to store the exit fullscreen
1941         request, and only act upon it when the enter animation completes.
1942
1943         * UIProcess/mac/WKFullScreenWindowController.h:
1944         * UIProcess/mac/WKFullScreenWindowController.mm:
1945         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
1946         (-[WKFullScreenWindowController exitFullScreen]):
1947
1948 2018-03-09  Jer Noble  <jer.noble@apple.com>
1949
1950         Unconditionalize more methods in VideoFullscreenInterface (and related classes)
1951         https://bugs.webkit.org/show_bug.cgi?id=183501
1952
1953         Reviewed by Eric Carlson.
1954
1955         No reason for these methods to be PLATFORM(MAC) only.
1956
1957         * UIProcess/API/Cocoa/WKWebView.mm:
1958         (-[WKWebView _videoControlsManagerDidChange]):
1959         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1960         * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
1961         (WebKit::PlaybackSessionManagerProxy::setUpPlaybackControlsManagerWithID):
1962         (WebKit::PlaybackSessionManagerProxy::clearPlaybackControlsManager):
1963         * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
1964         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
1965         * UIProcess/PageClient.h:
1966         * UIProcess/WebPageProxy.cpp:
1967         (WebKit::WebPageProxy::isPlayingMediaDidChange):
1968         (WebKit::WebPageProxy::handleControlledElementIDResponse const):
1969         (WebKit::WebPageProxy::isPlayingVideoInEnhancedFullscreen const):
1970         * UIProcess/WebPageProxy.h:
1971         * UIProcess/ios/PageClientImplIOS.h:
1972         * UIProcess/ios/PageClientImplIOS.mm:
1973         (WebKit::PageClientImpl::videoControlsManagerDidChange):
1974         * UIProcess/ios/WKFullScreenWindowControllerIOS.h:
1975         * UIProcess/ios/WKFullScreenWindowControllerIOS.mm:
1976         (-[WKFullScreenWindowController videoControlsManagerDidChange]):
1977         * WebProcess/cocoa/PlaybackSessionManager.mm:
1978         (WebKit::PlaybackSessionManager::setUpPlaybackControlsManager):
1979
1980 2018-03-09  Per Arne Vollan  <pvollan@apple.com>
1981
1982         Create CA layer contexts with +remoteContextWithOptions.
1983         https://bugs.webkit.org/show_bug.cgi?id=182747
1984
1985         Reviewed by Brent Fulgham.
1986
1987         CA layer contexts (CAContext) are currently created with +contextWithCGSConnection, which is
1988         using the main WindowServer connection to create the context. Instead, the contexts can be
1989         created with +remoteContextWithOptions, which does not use the main WindowServer connection.
1990         This is a step towards limiting the access the WebContent process has to the window server.
1991         To make the +remoteContextWithOptions call succeed, the sandbox has to be modified to allow
1992         access to CARenderServer. Also, access to the WindowServer should be denied by calling
1993         CGSSetDenyWindowServerConnections(true) before entering the sandbox. This is planned to do
1994         in a follow-up patch. The call to +remoteContextWithOptions will open up WindowServer
1995         connections, since the WindowServer is the system default CA render server, but these
1996         connections come with limited WindowServer exposure. In addition, we need to open up the
1997         sandbox for accessing some IOKit properties.
1998
1999         * Platform/mac/LayerHostingContext.mm:
2000         (WebKit::LayerHostingContext::createForExternalHostingProcess):
2001         * Shared/mac/HangDetectionDisablerMac.mm:
2002         (WebKit::setClientsMayIgnoreEvents):
2003         * WebProcess/com.apple.WebProcess.sb.in:
2004
2005 2018-03-09  Brent Fulgham  <bfulgham@apple.com>
2006
2007         Remove cookie API access from WebContent Process
2008         https://bugs.webkit.org/show_bug.cgi?id=183519
2009         <rdar://problem/35368802>
2010
2011         Reviewed by Alex Christensen.
2012
2013         All cookie access is now handled in the Network Process. However, there are vestiges of the original logic that used CFNetwork APIs in the WebContent process.
2014
2015         This patch removes CFNetwork calls from the WebProcess code paths, since they serve no purpose in modern WebKit.
2016
2017         No tests because this is a code cleanup with no expected change in behavior.
2018
2019         * NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
2020         (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy): Moved from WebFrameNetworkingContext.
2021         * NetworkProcess/NetworkProcess.h:
2022         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2023         (WebKit::NetworkProcess::setSharedHTTPCookieStorage): Moved from ChildProcess, since this should only be
2024         called in the NetworkProcess.
2025         * Shared/ChildProcess.h:
2026         * Shared/mac/ChildProcessMac.mm:
2027         (WebKit::ChildProcess::setSharedHTTPCookieStorage): Deleted.
2028         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
2029         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
2030         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession): Remove CFNetwork code. This version of
2031         'ensureWebsiteDataStoreSession' is needed to maintain a dictionary on the WebProcess side so we can refer to
2032         the same network session in both the WebContent and Network processes.
2033         (WebKit::WebFrameNetworkingContext::webFrameLoaderClient const):
2034         (WebKit::WebFrameNetworkingContext::setCookieAcceptPolicyForAllContexts): Deleted.
2035         * WebProcess/cocoa/WebProcessCocoa.mm:
2036         (WebKit::WebProcess::platformInitializeWebProcess): Remove calls to CFNetwork.
2037
2038 2018-03-09  Youenn Fablet  <youenn@apple.com>
2039
2040         ServiceWorkerClientFetch should send data to its resource loader once the didReceiveResponse completion handler is called
2041         https://bugs.webkit.org/show_bug.cgi?id=183110
2042
2043         Reviewed by Chris Dumez.
2044
2045         Buffering data/finish event/fail event until the response completion handler is called.
2046
2047         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
2048         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
2049         (WebKit::ServiceWorkerClientFetch::didReceiveData):
2050         (WebKit::ServiceWorkerClientFetch::didFinish):
2051         (WebKit::ServiceWorkerClientFetch::didFail):
2052         (WebKit::ServiceWorkerClientFetch::didNotHandle):
2053         (WebKit::ServiceWorkerClientFetch::cancel):
2054         (WebKit::ServiceWorkerClientFetch::continueLoadingAfterCheckingResponse):
2055         * WebProcess/Storage/ServiceWorkerClientFetch.h:
2056
2057 2018-03-09  Jer Noble  <jer.noble@apple.com>
2058
2059         Add new CSS env constants for use with fullscreen
2060         https://bugs.webkit.org/show_bug.cgi?id=183498
2061
2062         Reviewed by Dean Jackson.
2063
2064         Pass the values given to WebFullScreenManagerProxy through the process boundary and
2065         into WebCore.
2066
2067         * UIProcess/WebFullScreenManagerProxy.cpp:
2068         (WebKit::WebFullScreenManagerProxy::setFullscreenInsetTop):
2069         (WebKit::WebFullScreenManagerProxy::setFullscreenAutoHideDelay):
2070         * UIProcess/WebFullScreenManagerProxy.h:
2071         * WebProcess/FullScreen/WebFullScreenManager.cpp:
2072         (WebKit::WebFullScreenManager::didExitFullScreen):
2073         (WebKit::WebFullScreenManager::setFullscreenInsetTop):
2074         (WebKit::WebFullScreenManager::setFullscreenAutoHideDelay):
2075         * WebProcess/FullScreen/WebFullScreenManager.h:
2076         * WebProcess/FullScreen/WebFullScreenManager.messages.in:
2077
2078 2018-03-09  Jer Noble  <jer.noble@apple.com>
2079
2080         Add isPictureInPictureActive messaging across WebKit process boundary
2081         https://bugs.webkit.org/show_bug.cgi?id=183499
2082
2083         Reviewed by Eric Carlson.
2084
2085         * UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
2086         * UIProcess/Cocoa/PlaybackSessionManagerProxy.messages.in:
2087         * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
2088         (WebKit::PlaybackSessionModelContext::pictureInPictureActiveChanged):
2089         (WebKit::PlaybackSessionManagerProxy::pictureInPictureActiveChanged):
2090
2091 2018-03-09  Stephan Szabo  <stephan.szabo@sony.com>
2092
2093         Add guard for wtf/glib include
2094         https://bugs.webkit.org/show_bug.cgi?id=183521
2095
2096         Reviewed by Alex Christensen.
2097
2098         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
2099
2100 2018-03-09  Andy Estes  <aestes@apple.com>
2101
2102         [Mac] WebKit fails to receive file promises when the embedding app is sandboxed
2103         https://bugs.webkit.org/show_bug.cgi?id=183489
2104         <rdar://problem/38267517>
2105
2106         WebKit calls -[NSFilePromiseReceiver receivePromisedFilesAtDestination:...] with
2107         NSTemporaryDirectory() as the destination for receiving file promise drops. AppKit attempts
2108         to issue a sandbox extension for this directory, but for security reasons App Sandbox
2109         refuses to do so for NSTemporaryDirectory() itself. As a result, AppKit will call our reader
2110         block with a nil error and a valid file URL, but no file will actually exist at that URL.
2111
2112         In order for App Sandbox to grant issuing the sandbox extension needed by AppKit, we need to
2113         use some other destination directory. This patch uses FileSystem::createTemporaryDirectory()
2114         to securely create a unique temporary directory inside NSTemporaryDirectory() for use as the
2115         drop destination.
2116
2117         Reviewed by Wenson Hsieh.
2118
2119         * UIProcess/Cocoa/WebViewImpl.mm:
2120         (WebKit::WebViewImpl::performDragOperation):
2121
2122 2018-03-09  Carlos Garcia Campos  <cgarcia@igalia.com>
2123
2124         [GTK] Do not use WebKitDOMHTMLFormElement as argument of signal WebKitWebPage::will-submit-form
2125         https://bugs.webkit.org/show_bug.cgi?id=183510
2126
2127         Reviewed by Michael Catanzaro.
2128
2129         In 2.22 WebKitDOMHTMLFormElement will be deprecated in GTK+ port and won't still exist in WPE. The new
2130         JavaScript GLib API will be used to replace most of the DOM API, but a few classes will remain with a minimal
2131         API for things that can't be done with JavaScript. WebKitDOMElement will stay and will be added to WPE as well,
2132         so if we change the signal parameter to WebKitDOMElement we will be able to keep using
2133         WebKitWebPage::will-submit-form without any changes. WPE will gain this signal and the rest of the API that uses
2134         DOM.
2135
2136         * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
2137         (webkit_web_page_class_init):
2138
2139 2018-03-09  Carlos Garcia Campos  <cgarcia@igalia.com>
2140
2141         Unreviewed. [GTK][WPE] Bump Since tags of resource load stats API.
2142
2143         The functionality hasn't been properly tested to be released in WebKitGTK+ 2.20.
2144
2145         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
2146         (webkit_website_data_manager_class_init):
2147         * UIProcess/API/gtk/WebKitWebsiteData.h:
2148         * UIProcess/API/wpe/WebKitWebsiteData.h:
2149
2150 2018-03-08  Zan Dobersek  <zdobersek@igalia.com>
2151
2152         Unreviewed. Suppress GCC warnings in SystemPreviewController.cpp by
2153         using the cross-platform #include directives for header inclusion,
2154         instead of #import.
2155
2156         * UIProcess/SystemPreviewController.cpp:
2157
2158 2018-03-08  Megan Gardner  <megan_gardner@apple.com>
2159
2160         Allow WebViews to disable system appearance
2161         https://bugs.webkit.org/show_bug.cgi?id=183418
2162         <rdar://problem/36975642>
2163
2164         Reviewed by Tim Horton.
2165         
2166         Allow webviews to choose whether or not to follow the default system appearance.
2167
2168         * Shared/WebPageCreationParameters.cpp:
2169         (WebKit::WebPageCreationParameters::encode const):
2170         (WebKit::WebPageCreationParameters::decode):
2171         * Shared/WebPageCreationParameters.h:
2172         * UIProcess/API/Cocoa/WKWebView.mm:
2173         (-[WKWebView _useSystemAppearance]):
2174         (-[WKWebView _setUseSystemAppearance:]):
2175         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2176         * UIProcess/WebPageProxy.cpp:
2177         (WebKit::WebPageProxy::creationParameters):
2178         (WebKit::WebPageProxy::setUseSystemAppearance):
2179         * UIProcess/WebPageProxy.h:
2180         (WebKit::WebPageProxy::useSystemAppearance const):
2181         * WebProcess/WebPage/WebPage.cpp:
2182         (WebKit::WebPage::setUseSystemAppearance):
2183         * WebProcess/WebPage/WebPage.h:
2184         * WebProcess/WebPage/WebPage.messages.in:
2185
2186 2018-03-08  Michael Catanzaro  <mcatanzaro@igalia.com>
2187
2188         Unreviewed, speculative attempt to fix CMake build after r229426
2189         https://bugs.webkit.org/show_bug.cgi?id=183382
2190         <rdar://problem/38191450>
2191
2192         * CMakeLists.txt:
2193
2194 2018-03-08  Wenson Hsieh  <wenson_hsieh@apple.com>
2195
2196         [Extra zoom mode] Support resigning first responder status when focusing a form control
2197         https://bugs.webkit.org/show_bug.cgi?id=183477
2198         <rdar://problem/38225994>
2199
2200         Reviewed by Tim Horton.
2201
2202         Currently, when presenting an input view controller in extra zoom mode, if the web view loses first responder
2203         status, we will blur the focused element, which dismisses all focused form control UI. For certain types of form
2204         controls, this prevents the user from using key pieces of functionality.
2205
2206         To address this, disconnect the notion of first responder status from DOM element focus while the form control
2207         overlay is shown. Later, when the active input session ends, if the web content view was first responder before
2208         upon focusing the element, restore first responder status on the web view. This extra tweak is needed to ensure
2209         that certain UI affordances which require first responder status on the web view continue to work after
2210         interacting with a form control that changes the first responder.
2211
2212         * UIProcess/ios/WKContentViewInteraction.h:
2213         * UIProcess/ios/WKContentViewInteraction.mm:
2214         (-[WKContentView presentFocusedFormControlViewController:]):
2215         (-[WKContentView dismissFocusedFormControlViewController:]):
2216
2217 2018-03-08  John Wilander  <wilander@apple.com>
2218
2219         Resource Load Statistics: Revert defaults read of zero values
2220         https://bugs.webkit.org/show_bug.cgi?id=183476
2221
2222         Unreviewed revert of three small changes landed in r229427.
2223
2224         * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
2225         (WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):
2226             Reverted back to strict check of greater than zero for defaults reads.
2227
2228 2018-03-08  Tim Horton  <timothy_horton@apple.com>
2229
2230         Don't have SafariServices in minimal simulator build
2231         https://bugs.webkit.org/show_bug.cgi?id=183436
2232         <rdar://problem/38254778>
2233
2234         Reviewed by Dan Bernstein.
2235
2236         * config.h:
2237
2238 2018-03-08  John Wilander  <wilander@apple.com>
2239
2240         Resource Load Statistics: Make debug mode always partition prevalent resources
2241         https://bugs.webkit.org/show_bug.cgi?id=183468
2242         <rdar://problem/38269437>
2243
2244         Reviewed by Brent Fulgham.
2245
2246         After some testing we decided that a 30 second timeout in ITP debug mode just makes
2247         it confusing. We should instead always partition prevalent resources in debug mode
2248         to make it easy to understand. The partitioned state is what developers want to test
2249         anyway.
2250
2251         * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
2252         (WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):
2253             Minor change to include 0 as valid setting.
2254         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2255         (WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode):
2256             Now just stores the setting of debug mode instead of changing the timeout.
2257         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
2258             Now does not disable partitioning under debug mode.
2259         (WebKit::WebResourceLoadStatisticsStore::shouldPartitionCookies const):
2260             Now returns true for prevalent resources with user interaction under debug mode.            
2261         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
2262             Removed duplicate debug logging statement.
2263         * UIProcess/WebResourceLoadStatisticsStore.h:
2264             Added member m_debugModeEnabled.
2265
2266 2018-03-08  Brent Fulgham  <bfulgham@apple.com>
2267
2268         Remove WebCookieManager and messaging from WebContent process.
2269         https://bugs.webkit.org/show_bug.cgi?id=183382
2270         <rdar://problem/38191450>
2271
2272         Reviewed by Alex Christensen.
2273
2274         Networking access was fully removed from the WebContent process in Bug 183192 (and related bugs). The
2275         UIProcess no longer needs to ask the WebContent process about networking-related things, and shouldn't
2276         waste everyone's time doing so.
2277
2278         This bug removes some left-over WebCookieManager API stuff, and is a first step in purging the
2279         WebContent Process from accessing cookie data.
2280
2281         * NetworkProcess/Cookies: Copied from WebProcess/Cookies.
2282         * NetworkProcess/Cookies/WebCookieManager.h:
2283         * WebKit.xcodeproj/project.pbxproj:
2284         * WebProcess/Cookies: Removed.
2285         * WebProcess/Cookies/WebCookieManager.cpp: Removed.
2286         * WebProcess/Cookies/WebCookieManager.h: Removed.
2287         * WebProcess/Cookies/WebCookieManager.messages.in: Removed.
2288         * WebProcess/Cookies/curl: Removed.
2289         * WebProcess/Cookies/curl/WebCookieManagerCurl.cpp: Removed.
2290         * WebProcess/Cookies/mac: Removed.
2291         * WebProcess/Cookies/mac/WebCookieManagerMac.mm: Removed.
2292         * WebProcess/Cookies/soup: Removed.
2293         * WebProcess/Cookies/soup/WebCookieManagerSoup.cpp: Removed.
2294         * WebProcess/InjectedBundle/InjectedBundle.cpp: Remove 'WebCookieManager.h" header.
2295         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: Ditto.
2296         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm: Ditto.
2297         * WebProcess/WebProcess.cpp:
2298         (WebKit::WebProcess::WebProcess): Remove call to add WebCookieManager as a
2299         WebProcessSupplement.
2300         * CMakeLists.txt: Revised paths.
2301         * DerivedSources.make: Ditto.
2302         * PlatformMac.cmake: Ditto.
2303         * PlatformWin.cmake: Ditto.
2304         * SourcesGTK.txt: Ditto.
2305         * SourcesWPE.txt: Ditto.
2306
2307 2018-03-08  Youenn Fablet  <youenn@apple.com>
2308
2309         libwebrtc update broke internal builds
2310         https://bugs.webkit.org/show_bug.cgi?id=183454
2311
2312         Reviewed by Eric Carlson.
2313
2314         * Configurations/BaseTarget.xcconfig:
2315
2316 2018-03-08  Youenn Fablet  <youenn@apple.com>
2317
2318         PluginInfoStore::isSupportedPlugin should check for empty mime type
2319         https://bugs.webkit.org/show_bug.cgi?id=183457
2320         <rdar://problem/38159575>
2321
2322         Reviewed by Chris Dumez.
2323
2324         * UIProcess/Plugins/PluginInfoStore.cpp:
2325         (WebKit::PluginInfoStore::isSupportedPlugin):
2326
2327 2018-03-08  Yusuke Suzuki  <utatane.tea@gmail.com>
2328
2329         [JSC][WebCore] Extend jsDynamicCast for WebCore types in WebCore and remove jsDynamicDowncast
2330         https://bugs.webkit.org/show_bug.cgi?id=183449
2331
2332         Reviewed by Mark Lam.
2333
2334         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
2335         (WebKit::WebAutomationSessionProxy::elementForNodeHandle):
2336         * WebProcess/WebPage/WebFrame.cpp:
2337         (WebKit::WebFrame::frameForContext):
2338
2339 2018-03-08  Yusuke Suzuki  <utatane.tea@gmail.com>
2340
2341         [JSC] Add inherits<T>(VM&) leveraging JSCast fast path
2342         https://bugs.webkit.org/show_bug.cgi?id=183429
2343
2344         Reviewed by Mark Lam.
2345
2346         * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
2347         (WebKit::callMethod):
2348         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
2349         (WebKit::callNPJSObject):
2350         (WebKit::constructWithConstructor):
2351         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
2352         (WebKit::NPJSObject::create):
2353         * WebProcess/WebPage/WebFrame.cpp:
2354         (WebKit::WebFrame::counterValue):
2355
2356 2018-03-08  Zan Dobersek  <zdobersek@igalia.com>
2357
2358         Remove WebCore::TextureMapperAnimation as a special case in WebKit IPC
2359         generation. Values of this type aren't being transferred across IPC.
2360
2361         Rubber-stamped by Carlos Garcia Campos.
2362
2363         * Scripts/webkit/messages.py:
2364
2365 2018-03-08  Tim Horton  <timothy_horton@apple.com>
2366
2367         Stop linking ApplicationServices directly
2368         https://bugs.webkit.org/show_bug.cgi?id=182867
2369         <rdar://problem/38252142>
2370
2371         Reviewed by Alex Christensen.
2372
2373         The frameworks that we use that live inside ApplicationServices
2374         have mostly moved out, so import them directly.
2375
2376         * Configurations/WebKit.xcconfig:
2377
2378 2018-03-08  Wenson Hsieh  <wenson_hsieh@apple.com>
2379
2380         [Extra zoom mode] Specify password mode as needed when inputting text
2381         https://bugs.webkit.org/show_bug.cgi?id=183428
2382         <rdar://problem/37609386>
2383
2384         Reviewed by Tim Horton.
2385
2386         If the focused element is a password field, or the input delegate has forced secure text entry, set a flag on
2387         the text input view controller to opt in to password text input mode.
2388
2389         * UIProcess/ios/WKContentViewInteraction.mm:
2390         (-[WKContentView presentTextInputViewController:]):
2391
2392 2018-03-07  Tim Horton  <timothy_horton@apple.com>
2393
2394         Sort and separate FeatureDefines.xcconfig
2395         https://bugs.webkit.org/show_bug.cgi?id=183427
2396
2397         Reviewed by Dan Bernstein.
2398
2399         * Configurations/FeatureDefines.xcconfig:
2400         Sort and split FeatureDefines into paragraphs
2401         (to make it easier to sort later).
2402
2403 2018-03-07  Carlos Garcia Campos  <cgarcia@igalia.com>
2404
2405         REGRESSION(r218089): [GTK] webkit_web_view_get_inspector() needs to be called, otherwise inspector does not close
2406         https://bugs.webkit.org/show_bug.cgi?id=181126
2407
2408         Reviewed by Carlos Alberto Lopez Perez.
2409
2410         Fix the condition to decide whether to detach the inspector view ourselves.
2411
2412         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
2413         (WebKit::WebInspectorProxy::platformDetach): Remove the inspector view from its parent if we don't have a client
2414         or the client didn't detach it.
2415
2416 2018-03-07  Carlos Garcia Campos  <cgarcia@igalia.com>
2417
2418         [GTK][WPE] Leak checker is not working in WebKitGLib web process tests
2419         https://bugs.webkit.org/show_bug.cgi?id=183404
2420
2421         Reviewed by Michael Catanzaro.
2422
2423         Add private helper for testing to do a garbage collection when the page is closing.
2424
2425         * WebProcess/InjectedBundle/API/glib/WebKitWebExtension.cpp:
2426         (webkitWebExtensionSetGarbageCollectOnPageDestroy):
2427         * WebProcess/InjectedBundle/API/glib/WebKitWebExtensionPrivate.h:
2428         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.h: Fix annotation of
2429         webkit_dom_client_rect_list_item(), it should be transfer full.
2430
2431 2018-03-07  Youenn Fablet  <youenn@apple.com>
2432
2433         Match unsupported plugins based on domains and not origin
2434         https://bugs.webkit.org/show_bug.cgi?id=183384
2435
2436         Reviewed by Chris Dumez.
2437
2438         Moved from a HashMap of plugins to a Vector of plugins since we cannot match exactly based on the origin.
2439
2440         * Scripts/webkit/messages.py:
2441         * UIProcess/API/C/WKContext.cpp:
2442         (WKContextAddSupportedPlugin):
2443         * UIProcess/API/Cocoa/WKProcessPool.mm:
2444         (-[WKProcessPool _addSupportedPlugin:named:withMimeTypes:withExtensions:]):
2445         * UIProcess/Plugins/PluginInfoStore.cpp:
2446         (WebKit::PluginInfoStore::isSupportedPlugin):
2447         (WebKit::PluginInfoStore::supportedPluginNames):
2448         (WebKit::PluginInfoStore::addSupportedPlugin):
2449         * UIProcess/Plugins/PluginInfoStore.h:
2450         * UIProcess/WebProcessPool.cpp:
2451         (WebKit::WebProcessPool::addSupportedPlugin):
2452         * UIProcess/WebProcessPool.h:
2453         * UIProcess/WebProcessProxy.cpp:
2454         (WebKit::WebProcessProxy::getPlugins):
2455         * UIProcess/WebProcessProxy.h:
2456         * UIProcess/WebProcessProxy.messages.in:
2457         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
2458         (WebKit::WebPluginInfoProvider::getPluginInfo):
2459         (WebKit::WebPluginInfoProvider::getWebVisiblePluginInfo):
2460         * WebProcess/Plugins/WebPluginInfoProvider.h:
2461
2462 2018-03-07  Brent Fulgham  <bfulgham@apple.com>
2463
2464         REGRESSION (r229093): Media playback on Facebook and Hulu require mDNSResponder access
2465         https://bugs.webkit.org/show_bug.cgi?id=183421
2466         <rdar://problem/38191574>
2467
2468         Reviewed by Dean Jackson.
2469
2470         CoreMedia fails to properly play back media on Facebook and Hulu if access to the
2471         mDNSResponder is blocked by the sandbox. This Bug unblocks that access while we
2472         investigate the underlying issue.
2473
2474         * WebProcess/com.apple.WebProcess.sb.in:
2475
2476 2018-03-07  Dean Jackson  <dino@apple.com>
2477
2478         Try to fix build for watchOS and tvOS.
2479
2480         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
2481         * UIProcess/SystemPreviewController.cpp:
2482
2483 2018-03-07  Dean Jackson  <dino@apple.com>
2484
2485         Add SystemPreviewController for showing system-level views of special file types
2486         https://bugs.webkit.org/show_bug.cgi?id=183413
2487         <rdar://problem/37800834>
2488
2489         Reviewed by Tim Horton.
2490
2491         Add a new controller class that hangs off WebPageProxy, with the goal
2492         of providing system-level viewing of some some file types. Specifically
2493         those that can't be shown by WebKit.
2494
2495         This is the initial implementation which is quite simple. The controller
2496         can be queried about whether it supports a MIME type, then it can be
2497         asked to show a URL.
2498
2499         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: Added.
2500         (-[_WKPreviewControllerDataSource initWithURL:]):
2501         (-[_WKPreviewControllerDataSource numberOfPreviewItemsInPreviewController:]):
2502         (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
2503         (WebKit::SystemPreviewController::canPreview const):
2504         (WebKit::SystemPreviewController::showPreview):
2505         * UIProcess/SystemPreviewController.cpp: Added.
2506         (WebKit::SystemPreviewController::SystemPreviewController):
2507         (WebKit::SystemPreviewController::canPreview const):
2508         (WebKit::SystemPreviewController::showPreview):
2509         * UIProcess/SystemPreviewController.h: Added.
2510         * UIProcess/WebPageProxy.cpp:
2511         (WebKit::m_configurationPreferenceValues):
2512         (WebKit::WebPageProxy::reattachToWebProcess):
2513         (WebKit::WebPageProxy::resetState):
2514         * UIProcess/WebPageProxy.h:
2515         (WebKit::WebPageProxy::systemPreviewController):
2516         * WebKit.xcodeproj/project.pbxproj:
2517
2518 2018-03-07  Alejandro G. Castro  <alex@igalia.com>
2519
2520         Make NetworkRTCResolver port agnostic
2521         https://bugs.webkit.org/show_bug.cgi?id=178855
2522
2523         Reviewed by Youenn Fablet.
2524
2525         Create a specific Cocoa class to isolate the generic code in the base class, make the base implementation port
2526         agnostic and dependent on DNS API in the platform directory which encapsulates the platform specific details.
2527
2528         * NetworkProcess/webrtc/NetworkRTCProvider.cpp: Create an alias class name defined per platform to instantiate the resolver.
2529         (WebKit::NetworkRTCProvider::createResolver): Used the alias class name and receive a new IPAddress class that is not
2530         dependent on rtc libwebrtc library.
2531         * NetworkProcess/webrtc/NetworkRTCResolver.cpp: Remove the platform specific code. Use the DNS API to implement the
2532         platform specific code in the default start and stop methods. Add the identifier of the resolve operation to the class.
2533         (WebKit::NetworkRTCResolver::NetworkRTCResolver): Add the identifier in the initialization.
2534         (WebKit::NetworkRTCResolver::~NetworkRTCResolver): Remove the platform specific code.
2535         (WebKit::NetworkRTCResolver::completed): Ditto.
2536         (WebKit::NetworkRTCResolver::start): Add a new implementation using the DNS API.
2537         (WebKit::NetworkRTCResolver::stop): Ditto
2538         * NetworkProcess/webrtc/NetworkRTCResolver.h: Remove the platform specific code and use the DNSResolveQueue for a general
2539         solution to implement the platform specific code. Avoid using the IPAddress class that depends on libwertc classes to make
2540         it more general regarding DNS name resolution.
2541         (WebKit::NetworkRTCResolver::start): Make this class virtual.
2542         (WebKit::NetworkRTCResolver::stop): Ditto.
2543         * NetworkProcess/webrtc/NetworkRTCResolverCocoa.cpp: Copied Cocoa code from Source/WebKit/NetworkProcess/webrtc/NetworkRTCResolver.cpp.
2544         Now this class overrides the start and stop methods that use DNS, cocoa implementation should use the DNS methods in the future and
2545         remove this class, making sure all the platform specific class is in the platform directory.
2546         * NetworkProcess/webrtc/NetworkRTCResolverCocoa.h: Copied Cocoa code from Source/WebKit/NetworkProcess/webrtc/NetworkRTCResolver.h.
2547         * PlatformGTK.cmake: Add NetworkRTCResolver compilation for GTK.
2548         * WebKit.xcodeproj/project.pbxproj: Add the NetworkRTCResolverCocoa class to the compilation.
2549
2550 2018-03-06  Brent Fulgham  <bfulgham@apple.com>
2551
2552         NetworkDataTask should enable logging for automation clients
2553         https://bugs.webkit.org/show_bug.cgi?id=183378
2554         <rdar://problem/38189556>
2555
2556         Reviewed by Brian Burg.
2557
2558         The NetworkDataTaskCocoa class was only logging if the SessionID object allowed logging.
2559         It should also be considering whether the current session is working on behalf of an
2560         automation client. If so, it should allow logging.
2561
2562         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
2563         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2564         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
2565         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
2566         (WebKit::NetworkDataTaskCocoa::isAlwaysOnLoggingAllowed const):
2567
2568 2018-03-06  Ryan Haddad  <ryanhaddad@apple.com>
2569
2570         Unreviewed build fix.
2571
2572         * UIProcess/ios/WKFullScreenWindowControllerIOS.mm:
2573         (-[WKFullScreenWindowController _EVOrganizationName]):
2574
2575 2018-03-06  Antoine Quint  <graouts@apple.com>
2576
2577         [Web Animations] Add a new runtime flag to control whether CSS Animations and CSS Transitions should run using the Web Animations timeline
2578         https://bugs.webkit.org/show_bug.cgi?id=183370
2579         <rdar://problem/38180729>
2580
2581         Reviewed by Dean Jackson.
2582
2583         Before we start creating WebAnimation objects to perform CSS Animations and CSS Transitions, which will replace the existing codepath
2584         involving CSSAnimationController and CompositeAnimation, we need a runtime flag that will allow all the new code to be turned off by
2585         default while we bring this feature up.
2586
2587         * Shared/WebPreferences.yaml:
2588         * UIProcess/API/C/WKPreferences.cpp:
2589         (WKPreferencesSetCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled):
2590         (WKPreferencesGetCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled):
2591         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2592         * UIProcess/API/Cocoa/WKPreferences.mm:
2593         (-[WKPreferences _setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled:]):
2594         (-[WKPreferences _cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled]):
2595         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2596         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2597         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2598         (WebKit::InjectedBundle::setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled):
2599         * WebProcess/InjectedBundle/InjectedBundle.h:
2600
2601 2018-03-06  Ms2ger  <Ms2ger@igalia.com>
2602
2603         [GLib] Implement WebsiteDataStore::defaultServiceWorkerRegistrationDirectory().
2604         https://bugs.webkit.org/show_bug.cgi?id=183364
2605
2606         Reviewed by Michael Catanzaro.
2607
2608         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
2609         (API::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory): implement.
2610
2611 2018-03-06  Zan Dobersek  <zdobersek@igalia.com>
2612
2613         Unreviewed. Addressing further review feedback for patch landed in r229315.
2614
2615         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
2616         (WebKit::CoordinatedGraphicsScene::commitSceneState): There's no need for
2617         explicit calls of the clear() method on both containers in the CommitScope
2618         objects, the destructors invoked for these objects from the CommitScope
2619         destructor will have the same effect.
2620
2621 2018-03-06  Zan Dobersek  <zdobersek@igalia.com>
2622
2623         [CoordGraphics] Remove unused scrolling-related code in TextureMapperLayer, CoordinatedGraphics stack
2624         https://bugs.webkit.org/show_bug.cgi?id=183340
2625
2626         Reviewed by Michael Catanzaro.
2627
2628         With most of the scrolling-related code in TextureMapperLayer on the
2629         chopping block, we can now drop the ScrollingClient inheritance and the
2630         commitScrollOffset() virtual method implementation. This enables
2631         removing the whole commitScrollOffset() call chain that ran from
2632         CoordinatedGraphicsScene through CoordinatedLayerTreeHost and
2633         CompositingCoordinator to the affected CoordinatedGraphicsLayer object.
2634
2635         The CoordinatedGraphicsScene::findScrollableContentsLayerAt() method is
2636         also unused and can be deleted.
2637
2638         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
2639         (WebKit::CoordinatedGraphicsScene::setLayerState):
2640         (WebKit::CoordinatedGraphicsScene::createLayer):
2641         (WebKit::CoordinatedGraphicsScene::commitScrollOffset): Deleted.
2642         (WebKit::CoordinatedGraphicsScene::findScrollableContentsLayerAt): Deleted.
2643         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
2644         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
2645         (WebKit::ThreadedCompositor::commitScrollOffset): Deleted.
2646         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
2647         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
2648         (WebKit::CompositingCoordinator::commitScrollOffset): Deleted.
2649         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
2650         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
2651         (WebKit::CoordinatedLayerTreeHost::commitScrollOffset): Deleted.
2652         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
2653         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
2654
2655 2018-03-06  Zan Dobersek  <zdobersek@igalia.com>
2656
2657         [CoordGraphics] Apply TextureMapperLayer animations with a single MonotonicTime value
2658         https://bugs.webkit.org/show_bug.cgi?id=183360
2659
2660         Reviewed by Sergio Villar Senin.
2661
2662         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
2663         (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
2664         Pass the monotic time value, as returned by MonotonicTime::now(), to the
2665         TextureMapperLayer::applyAnimationsRecursively() call.
2666
2667 2018-03-06  Zan Dobersek  <zdobersek@igalia.com>
2668
2669         [CoordGraphics] Clean up CoordinatedImageBacking
2670         https://bugs.webkit.org/show_bug.cgi?id=183332
2671
2672         Reviewed by Carlos Garcia Campos.
2673
2674         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
2675         (WebKit::CompositingCoordinator::createImageBackingIfNeeded):
2676         Adjust call to CoordinatedImageBacking::getCoordinatedImageBackingID().
2677
2678 2018-03-06  Zan Dobersek  <zdobersek@igalia.com>
2679
2680         CoordinatedGraphicsScene: properly limit data specific to state commit operation
2681         https://bugs.webkit.org/show_bug.cgi?id=183326
2682
2683         Reviewed by Sergio Villar Senin.
2684
2685         In the process of state commit in CoordinatedGraphicsScene, the released
2686         image backings and backing stores with pending updates are stored in
2687         Vector and HashSet objects, respectively. Instead of these two objects
2688         being member variables on the CoordinatedGraphicsScene class, keep them
2689         in the CommitScope structure that's limited to the operations done in
2690         the commitSceneState() method.
2691
2692         The two member variables are dropped, and the CommitScope object is
2693         passed by reference to any helper method that needs to append either
2694         kind of object to the respective container. At the end of the state
2695         commit, backing stores with pending updates have those updates applied,
2696         and the two containers are cleared out as the CommitScope object is
2697         destroyed.
2698
2699         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
2700         (WebKit::CoordinatedGraphicsScene::setLayerState):
2701         (WebKit::CoordinatedGraphicsScene::prepareContentBackingStore):
2702         (WebKit::CoordinatedGraphicsScene::resetBackingStoreSizeToLayerSize):
2703         (WebKit::CoordinatedGraphicsScene::removeTilesIfNeeded):
2704         (WebKit::CoordinatedGraphicsScene::updateTilesIfNeeded):
2705         (WebKit::CoordinatedGraphicsScene::syncImageBackings):
2706         (WebKit::CoordinatedGraphicsScene::updateImageBacking):
2707         (WebKit::CoordinatedGraphicsScene::clearImageBackingContents):
2708         (WebKit::CoordinatedGraphicsScene::removeImageBacking):
2709         (WebKit::CoordinatedGraphicsScene::commitSceneState):
2710         (WebKit::CoordinatedGraphicsScene::purgeGLResources):
2711         (WebKit::CoordinatedGraphicsScene::removeReleasedImageBackingsIfNeeded): Deleted.
2712         (WebKit::CoordinatedGraphicsScene::commitPendingBackingStoreOperations): Deleted.
2713         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
2714
2715 2018-03-05  Yusuke Suzuki  <utatane.tea@gmail.com>
2716
2717         Fix std::make_unique / new[] using system malloc
2718         https://bugs.webkit.org/show_bug.cgi?id=182975
2719
2720         Reviewed by JF Bastien.
2721
2722         Use Vector instead.
2723
2724         * NetworkProcess/win/SystemProxyWin.cpp:
2725         (WindowsSystemProxy::getSystemHttpProxy):
2726         * Platform/IPC/unix/ConnectionUnix.cpp:
2727         (IPC::Connection::processMessage):
2728         (IPC::Connection::sendOutputMessage):
2729         * Platform/win/LoggingWin.cpp:
2730         (WebKit::logLevelString):
2731         * Shared/SandboxExtension.h:
2732         * Shared/mac/SandboxExtensionMac.mm:
2733         (WebKit::SandboxExtension::HandleArray::allocate):
2734         (WebKit::SandboxExtension::HandleArray::operator[]):
2735         (WebKit::SandboxExtension::HandleArray::operator[] const):
2736         (WebKit::SandboxExtension::HandleArray::size const):
2737         (WebKit::SandboxExtension::HandleArray::encode const):
2738
2739 2018-03-05  Andy Estes  <aestes@apple.com>
2740
2741         [Mac] Teach WebCore::Pasteboard about file promise drags
2742         https://bugs.webkit.org/show_bug.cgi?id=183314
2743         <rdar://problem/38105493>
2744
2745         Reviewed by Darin Adler.
2746
2747         Added a FIXME comment.
2748
2749         * UIProcess/Cocoa/WebViewImpl.mm:
2750         (WebKit::WebViewImpl::performDragOperation):
2751
2752 2018-03-05  Jeff Miller  <jeffm@apple.com>
2753
2754         Expose still more WKPreferences SPI to match C SPI
2755         https://bugs.webkit.org/show_bug.cgi?id=183045
2756
2757         Reviewed by Alex Christensen.
2758
2759         * UIProcess/API/Cocoa/WKPreferences.mm:
2760         (-[WKPreferences _setAllowsInlineMediaPlayback:]):
2761         (-[WKPreferences _allowsInlineMediaPlayback]):
2762         (-[WKPreferences _setApplePayEnabled:]):
2763         (-[WKPreferences _applePayEnabled]):
2764         (-[WKPreferences _setDNSPrefetchingEnabled:]):
2765         (-[WKPreferences _dnsPrefetchingEnabled]):
2766         (-[WKPreferences _setInlineMediaPlaybackRequiresPlaysInlineAttribute:]):
2767         (-[WKPreferences _inlineMediaPlaybackRequiresPlaysInlineAttribute]):
2768         (-[WKPreferences _setInvisibleMediaAutoplayNotPermitted:]):
2769         (-[WKPreferences _invisibleMediaAutoplayNotPermitted]):
2770         (-[WKPreferences _setLegacyEncryptedMediaAPIEnabled:]):
2771         (-[WKPreferences _legacyEncryptedMediaAPIEnabled]):
2772         (-[WKPreferences _setMainContentUserGestureOverrideEnabled:]):
2773         (-[WKPreferences _mainContentUserGestureOverrideEnabled]):
2774         (-[WKPreferences _setMediaStreamEnabled:]):
2775         (-[WKPreferences _mediaStreamEnabled]):
2776         (-[WKPreferences _setNeedsStorageAccessFromFileURLsQuirk:]):
2777         (-[WKPreferences _needsStorageAccessFromFileURLsQuirk]):
2778         (-[WKPreferences _setPDFPluginEnabled:]):
2779         (-[WKPreferences _pdfPluginEnabled]):
2780         (-[WKPreferences _setRequiresUserGestureForAudioPlayback:]):
2781         (-[WKPreferences _requiresUserGestureForAudioPlayback]):
2782         (-[WKPreferences _setRequiresUserGestureForVideoPlayback:]):
2783         (-[WKPreferences _requiresUserGestureForVideoPlayback]):
2784         (-[WKPreferences _setServiceControlsEnabled:]):
2785         (-[WKPreferences _serviceControlsEnabled]):
2786         (-[WKPreferences _setShowsToolTipOverTruncatedText:]):
2787         (-[WKPreferences _showsToolTipOverTruncatedText]):
2788         (-[WKPreferences _setTextAreasAreResizable:]):
2789         (-[WKPreferences _textAreasAreResizable]):
2790         (-[WKPreferences _setUseGiantTiles:]):
2791         (-[WKPreferences _useGiantTiles]):
2792         (-[WKPreferences _setWantsBalancedSetDefersLoadingBehavior:]):
2793         (-[WKPreferences _wantsBalancedSetDefersLoadingBehavior]):
2794         (-[WKPreferences _setWebAudioEnabled:]):
2795         (-[WKPreferences _webAudioEnabled]):
2796         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2797
2798 2018-03-05  Carlos Garcia Campos  <cgarcia@igalia.com>
2799
2800         Automation: clicking on a disabled option element shouldn't produce an error
2801         https://bugs.webkit.org/show_bug.cgi?id=183284
2802
2803         Reviewed by Brian Burg.
2804
2805         This was expected by selenium, but the WebDriver spec says we should simply do nothing in those cases.
2806
2807         14.1 Element Click.
2808         https://w3c.github.io/webdriver/webdriver-spec.html#element-click
2809
2810         Fixes: imported/w3c/webdriver/tests/element_click/select.py::test_option_disabled
2811
2812         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
2813         (WebKit::WebAutomationSessionProxy::selectOptionElement):
2814
2815 2018-03-05  Carlos Garcia Campos  <cgarcia@igalia.com>
2816
2817         Automation: stale elements not detected when removed from the DOM
2818         https://bugs.webkit.org/show_bug.cgi?id=183278
2819
2820         Reviewed by Brian Burg.
2821
2822         We detect stale elements when the page is reloaded because the maps are recreated, but if an element is removed
2823         from the DOM for the same document we keep the nodes in the maps. We should clear stale elements before
2824         accessing the maps.
2825
2826         Fixes: imported/selenium/py/test/selenium/webdriver/common/webdriverwait_tests.py::testExpectedConditionStalenessOf
2827
2828         * WebProcess/Automation/WebAutomationSessionProxy.js:
2829         (let.AutomationSessionProxy.prototype.evaluateJavaScriptFunction): Call _clearStaleNodes()
2830         (let.AutomationSessionProxy.prototype.nodeForIdentifier): Ditto.
2831         (let.AutomationSessionProxy.prototype._clearStaleNodes): Check if cached nodes are still in document and remove them
2832         from the maps if they aren't.
2833
2834 2018-03-04  Yusuke Suzuki  <utatane.tea@gmail.com>
2835
2836         [WTF] Move currentCPUTime and sleep(Seconds) to CPUTime.h and Seconds.h respectively
2837         https://bugs.webkit.org/show_bug.cgi?id=183312
2838
2839         Reviewed by Mark Lam.
2840
2841         Remove wtf/CurrentTime.h include pragma.
2842
2843         * NetworkProcess/NetworkResourceLoader.cpp:
2844         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
2845         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
2846         * Platform/IPC/Connection.cpp:
2847         * Platform/unix/SharedMemoryUnix.cpp:
2848         * PluginProcess/WebProcessConnection.cpp:
2849         * Shared/ios/NativeWebTouchEventIOS.mm:
2850         * UIProcess/DrawingAreaProxyImpl.cpp:
2851         * UIProcess/ios/WKContentView.mm:
2852         * UIProcess/linux/MemoryPressureMonitor.cpp:
2853         * WebProcess/Gamepad/WebGamepad.cpp:
2854         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2855         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
2856         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
2857         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
2858         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm:
2859         * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp:
2860         * WebProcess/WebProcess.cpp:
2861         * WebProcess/cocoa/WebProcessCocoa.mm:
2862         * WebProcess/gtk/WebProcessMainGtk.cpp:
2863         * WebProcess/win/WebProcessMainWin.cpp:
2864         * WebProcess/wpe/WebProcessMainWPE.cpp:
2865
2866 2018-03-02  Brian Burg  <bburg@apple.com>
2867
2868         Web Automation: script evaluations via WebDriver should have a user gesture indicator
2869         https://bugs.webkit.org/show_bug.cgi?id=183230
2870         <rdar://problem/37959739>
2871
2872         Reviewed by Andy Estes.
2873
2874         APIs that normally require a user gesture should just work when using via WebDriver.
2875         To support cases where tests need to simulate user actions with JavaScript, use a
2876         fake user gesture, similar to how -[WKWebView evaluateJavaScript:] forces a user
2877         gesture when clients evaluate JavaScript in their web view.
2878
2879         No new tests, this is covered by W3C tests that use the Fullscreen API.
2880         This API does nothing if there is no user gesture; with this patch, it just works.
2881
2882         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
2883         (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction):
2884
2885 2018-03-04  Tim Horton  <timothy_horton@apple.com>
2886
2887         Make !ENABLE(DATA_DETECTION) iOS build actually succeed
2888         https://bugs.webkit.org/show_bug.cgi?id=183283
2889         <rdar://problem/38062148>
2890
2891         Reviewed by Sam Weinig.
2892
2893         * UIProcess/ios/WKContentViewInteraction.mm:
2894         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
2895         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
2896         Guard some more code with ENABLE(DATA_DETECTION).
2897
2898 2018-03-04  Dan Bernstein  <mitz@apple.com>
2899
2900         Building with ONLY_ACTIVE_ARCH=NO and ARCHS=x86_64 fails
2901         https://bugs.webkit.org/show_bug.cgi?id=183320
2902
2903         Reviewed by Tim Horton.
2904
2905         * Configurations/PluginService.32.xcconfig: If the Apple build tool specifies
2906           RC_ARCHS=x86_64, then let the service build for x86_64, but don’t install it.
2907
2908 2018-03-03  Brent Fulgham  <bfulgham@apple.com>
2909
2910         Notify the NetworkProcess when a session is servicing an automation client
2911         https://bugs.webkit.org/show_bug.cgi?id=183306
2912         <rdar://problem/37835783>
2913
2914         Reviewed by Brian Burg.
2915
2916         Network loads servicing WebDriver are done through an ephemeral session. While this is great
2917         for protecting a developer's machine from sharing state with test runs, it has the unintended
2918         effect of blocking certain logging operations.
2919
2920         We do not log content in ephemeral sessions to protect user privacy. However, ephemeral sessions
2921         generated by WebDriver should participate in logging so that proper testing (with logging) can
2922         be done.
2923
2924         This patch signals the NetworkProcess when an ephemeral session (created for automation purposes)
2925         is created, so that it can allow logging.
2926
2927         * NetworkProcess/NetworkProcess.cpp:
2928         (WebKit::NetworkProcess::destroySession): Remove controlled-by-automation entry.
2929         (WebKit::NetworkProcess::sessionIsControlledByAutomation const): Added.
2930         (WebKit::NetworkProcess::setSessionIsControlledByAutomation): Added.
2931         * NetworkProcess/NetworkProcess.h:
2932         * NetworkProcess/NetworkProcess.messages.in:
2933         * NetworkProcess/NetworkResourceLoader.cpp:
2934         (WebKit::NetworkResourceLoader::isAlwaysOnLoggingAllowed const): Checks if the relevant session
2935         is servicing an automation client, and returns true if it is.
2936         * UIProcess/WebPageProxy.cpp:
2937         (WebKit::WebPageProxy::WebPageProxy): Signal the network process if this page is being created
2938         for an automation client.
2939
2940 2018-03-02  Yusuke Suzuki  <utatane.tea@gmail.com>
2941
2942         [WTF] Remove RunLoop and RunLoop::Timer's interface using double as seconds
2943         https://bugs.webkit.org/show_bug.cgi?id=183293
2944
2945         Reviewed by Alex Christensen.
2946
2947         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
2948         (WebKit::CompositingRunLoop::scheduleUpdate):
2949         (WebKit::CompositingRunLoop::compositionCompleted):
2950         (WebKit::CompositingRunLoop::updateCompleted):
2951         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
2952         (WebKit::ThreadedDisplayRefreshMonitor::dispatchDisplayRefreshCallback):
2953
2954 2018-03-02  Don Olmstead  <don.olmstead@sony.com>
2955
2956         Share common WebError implementation
2957         https://bugs.webkit.org/show_bug.cgi?id=183303
2958
2959         Reviewed by Ryosuke Niwa.
2960
2961         * Shared/WebErrors.cpp:
2962         (WebKit::cancelledError):
2963         (WebKit::fileDoesNotExistError):
2964         * Shared/glib/WebErrorsGlib.cpp: Removed.
2965         * SourcesGTK.txt:
2966         * SourcesWPE.txt:
2967
2968 2018-03-02  Youenn Fablet  <youenn@apple.com>
2969
2970         LayoutTest imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-within-sw.https.html is a flaky failure
2971         https://bugs.webkit.org/show_bug.cgi?id=179248
2972         <rdar://problem/35377756>
2973
2974         Reviewed by Chris Dumez.
2975
2976         In case we go up to the initializeSize step and Caches was cleared
2977         between the time we stated to initialize and the time we got there,
2978         we need to make as if Caches was not initialized,
2979         thus keeping m_isInitialized to false and m_storage to nullptr.
2980
2981         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2982         (WebKit::CacheStorage::Caches::initializeSize):
2983
2984 2018-03-02  Youenn Fablet  <youenn@apple.com>
2985
2986         Clients should register to StorageProcess with their service worker registration identifier
2987         https://bugs.webkit.org/show_bug.cgi?id=182313
2988         <rdar://problem/38044403>
2989
2990         Reviewed by Chris Dumez.
2991
2992         Relanding.
2993
2994         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2995         (WebKit::WebSWServerConnection::registerServiceWorkerClient):
2996         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2997         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
2998         * WebProcess/Storage/WebSWClientConnection.cpp:
2999         (WebKit::WebSWClientConnection::registerServiceWorkerClient):
3000         * WebProcess/Storage/WebSWClientConnection.h:
3001
3002 2018-03-02  Tim Horton  <timothy_horton@apple.com>
3003
3004         Make it possible to disable WKPDFView
3005         https://bugs.webkit.org/show_bug.cgi?id=183281
3006         <rdar://problem/38060815>
3007
3008         Reviewed by Dan Bates.
3009
3010         * UIProcess/API/Cocoa/WKWebView.mm:
3011         (-[WKWebView _isBackground]):
3012         (-[WKWebView _isDisplayingPDF]):
3013         (-[WKWebView _dataForDisplayedPDF]):
3014         (-[WKWebView _suggestedFilenameForDisplayedPDF]):
3015         * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
3016         (-[WKWebViewContentProviderRegistry init]):
3017         * UIProcess/ios/WKPDFView.h:
3018         * UIProcess/ios/WKPDFView.mm:
3019
3020 2018-03-02  Youenn Fablet  <youenn@apple.com>
3021
3022         WebProcessProxy should handle its completion handler at destruction time
3023         https://bugs.webkit.org/show_bug.cgi?id=183224
3024
3025         Reviewed by Brady Eidson.
3026
3027         * UIProcess/WebProcessProxy.cpp:
3028         (WebKit::WebProcessProxy::~WebProcessProxy):
3029         * UIProcess/WebProcessProxy.h:
3030
3031 2018-03-02  Brent Fulgham  <bfulgham@apple.com>
3032
3033         Update WebContent process sandbox IOKit properties
3034         https://bugs.webkit.org/show_bug.cgi?id=183269
3035         <rdar://problem/37853282>
3036
3037         Reviewed by Eric Carlson.
3038
3039         * WebProcess/com.apple.WebProcess.sb.in:
3040
3041 2018-03-01  Yusuke Suzuki  <utatane.tea@gmail.com>
3042
3043         Remove monotonicallyIncreasingTime
3044         https://bugs.webkit.org/show_bug.cgi?id=182911
3045
3046         Reviewed by Michael Catanzaro.
3047
3048         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
3049         (WebKit::CacheStorage::Cache::toRecordInformation):
3050         * Platform/IPC/ArgumentCoders.cpp:
3051         (IPC::ArgumentCoder<Seconds>::encode):
3052         (IPC::ArgumentCoder<Seconds>::decode):
3053         (IPC::ArgumentCoder<MonotonicTime>::encode):
3054         (IPC::ArgumentCoder<MonotonicTime>::decode):
3055         * Platform/IPC/ArgumentCoders.h:
3056         * Shared/Gamepad/GamepadData.cpp:
3057         (WebKit::GamepadData::GamepadData):
3058         * Shared/Gamepad/GamepadData.h:
3059         (WebKit::GamepadData::lastUpdateTime const):
3060         * Shared/WebCoreArgumentCoders.cpp:
3061         (IPC::ArgumentCoder<MonotonicTime>::encode): Deleted.
3062         (IPC::ArgumentCoder<MonotonicTime>::decode): Deleted.
3063         (IPC::ArgumentCoder<Seconds>::encode): Deleted.
3064         (IPC::ArgumentCoder<Seconds>::decode): Deleted.
3065         ArgumentCoders for MonotonicTime and Seconds are now used internally.
3066         Move them to Platform/IPC/ArgumentCoders.h.
3067
3068         * Shared/WebCoreArgumentCoders.h:
3069         * UIProcess/API/glib/IconDatabase.cpp:
3070         (WebKit::IconDatabase::iconDatabaseSyncThread):
3071         * UIProcess/DrawingAreaProxyImpl.cpp:
3072         (WebKit::DrawingAreaProxyImpl::DrawingMonitor::start):
3073         (WebKit::DrawingAreaProxyImpl::DrawingMonitor::stop):
3074         (WebKit::DrawingAreaProxyImpl::DrawingMonitor::didDraw):
3075         * UIProcess/DrawingAreaProxyImpl.h:
3076         * UIProcess/Gamepad/UIGamepad.h:
3077         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
3078         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
3079         (WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidStart):
3080         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h:
3081         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
3082         (WebKit::RemoteLayerTreeHost::animationDidStart):
3083         * WebProcess/WebPage/DrawingArea.h:
3084         (WebKit::DrawingArea::acceleratedAnimationDidStart):
3085         * WebProcess/WebPage/DrawingArea.messages.in:
3086         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.h:
3087         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
3088         (mediaTimeToCurrentTime):
3089         (-[WKAnimationDelegate animationDidStart:]):
3090         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
3091         (WebKit::PlatformCALayerRemote::animationStarted):
3092         This argument `beginTime` is not CFTimeInverval actually. We add currentTimeToMediaTime
3093         conversion here to fix this issue.
3094
3095         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:
3096         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h:
3097         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
3098         (WebKit::RemoteLayerTreeContext::animationDidStart):
3099         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
3100         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
3101         (WebKit::RemoteLayerTreeDrawingArea::acceleratedAnimationDidStart):
3102         * WebProcess/cocoa/WebProcessCocoa.mm:
3103         (WebKit::WebProcess::destroyRenderingResources):
3104
3105 2018-03-02  Brent Fulgham  <bfulgham@apple.com>
3106
3107         [iOS] whitelist missing AppleJPEG logging feature
3108         https://bugs.webkit.org/show_bug.cgi?id=183270
3109         <rdar://problem/37808612>
3110
3111         Reviewed by Alex Christensen.
3112
3113         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
3114
3115 2018-03-02  Youenn Fablet  <youenn@apple.com>
3116
3117         IOChannel::read and IOChannel::write can destroy the completion handler in the thread used to manipulate thread
3118         https://bugs.webkit.org/show_bug.cgi?id=183261
3119
3120         Reviewed by Antti Koivisto.
3121
3122         Moving the completion handler when being called so that it gets desttroyed in the thread it is called.
3123
3124         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
3125         (WebKit::NetworkCache::IOChannel::read):
3126         (WebKit::NetworkCache::IOChannel::write):
3127
3128 2018-03-02  Dan Bernstein  <mitz@apple.com>
3129
3130         Safari uses WebContent.Development when loading injected bundle embedded in its app bundle
3131         https://bugs.webkit.org/show_bug.cgi?id=183275
3132
3133         Reviewed by Tim Horton.
3134
3135         * UIProcess/mac/WebProcessProxyMac.mm:
3136         (WebKit::WebProcessProxy::shouldAllowNonValidInjectedCode const): Return false if this is
3137           a platform binary. We can also return false unconditionally when building for any shipping
3138           major macOS release.
3139
3140 2018-03-01  Commit Queue  <commit-queue@webkit.org>
3141
3142         Unreviewed, rolling out r229153.
3143         https://bugs.webkit.org/show_bug.cgi?id=183274
3144
3145         it is breaking imported/w3c/web-platform-tests/service-workers
3146         /service-worker/clients-matchall-exact-controller.https.html
3147         (Requested by youenn on #webkit).
3148
3149         Reverted changeset:
3150
3151         "Clients should register to StorageProcess with their service
3152         worker registration identifier"
3153         https://bugs.webkit.org/show_bug.cgi?id=182313
3154         https://trac.webkit.org/changeset/229153
3155
3156 2018-03-01  Brent Fulgham  <bfulgham@apple.com>
3157
3158         Add the "com.apple.security.cs.disable-library-validation” entitlement to the Plugin Process
3159         https://bugs.webkit.org/show_bug.cgi?id=183252
3160         <rdar://problem/37887136>
3161
3162         Reviewed by David Kilzer.
3163
3164         * Configurations/PluginService.entitlements:
3165
3166 2018-03-01  Youenn Fablet  <youenn@apple.com>
3167
3168         Clients should register to StorageProcess with their service worker registration identifier
3169         https://bugs.webkit.org/show_bug.cgi?id=182313
3170
3171         Reviewed by Chris Dumez.
3172
3173         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3174         (WebKit::WebSWServerConnection::registerServiceWorkerClient):
3175         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
3176         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
3177         * WebProcess/Storage/WebSWClientConnection.cpp:
3178         (WebKit::WebSWClientConnection::registerServiceWorkerClient):
3179         * WebProcess/Storage/WebSWClientConnection.h:
3180
3181 2018-03-01  Youenn Fablet  <youenn@apple.com>
3182
3183         LayoutTest imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-within-sw.https.html is a flaky failure
3184         https://bugs.webkit.org/show_bug.cgi?id=179248
3185         <rdar://problem/35377756>
3186
3187         Reviewed by Chris Dumez.
3188
3189         WebKitTestRunner is clearing caches for every test but there might still be some on-going cache activity due to a previous test.
3190         In that case, the activity might try to open the Caches object at the same time the files are deleted by the clearing task.
3191         If the new test is trying to open the same caches, it will also receive the same error, hence the console log message.
3192
3193         To fix that issue, we clear the initialization pending callbacks when clearing the caches.
3194         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.
3195         Made refactoring to append the first callback into the list of pending callbacks.
3196
3197         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
3198         (WebKit::CacheStorage::Caches::initialize):
3199         (WebKit::CacheStorage::Caches::initializeSize):
3200         (WebKit::CacheStorage::Caches::clear):
3201         * NetworkProcess/cache/CacheStorageEngineCaches.h:
3202
3203 2018-03-01  Youenn Fablet  <youenn@apple.com>
3204
3205         Add API test to validate setting of service worker and cache storage directories
3206         https://bugs.webkit.org/show_bug.cgi?id=182543
3207
3208         Reviewed by Chris Dumez.
3209
3210         Add cache engine directory path to its representation dump.
3211         This is used in API tests to check that the path is correctly set.
3212
3213         Add a way for to know whether a service worker was registered from a WKWebsiteDataStore.
3214         This is used in API tests to check that the path is correctly set.
3215
3216         * NetworkProcess/cache/CacheStorageEngine.cpp:
3217         (WebKit::CacheStorage::Engine::representation):
3218         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3219         (-[WKWebsiteDataStore _hasRegisteredServiceWorker]):
3220         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
3221
3222 2018-03-01  Wenson Hsieh  <wenson_hsieh@apple.com>
3223
3224         Fix some errors due to some mach port APIs being unavailable on watchOS
3225         https://bugs.webkit.org/show_bug.cgi?id=183262
3226         <rdar://problem/38028521>
3227
3228         Reviewed by Tim Horton.
3229
3230         Minor build fix; mach_port_guard and mach_port_unguard are not available on this platform.
3231
3232         * Platform/IPC/mac/ConnectionMac.mm:
3233         (IPC::Connection::platformInvalidate):
3234         (IPC::Connection::platformInitialize):
3235         (IPC::Connection::open):
3236
3237 2018-03-01  Per Arne Vollan  <pvollan@apple.com>
3238
3239         Unreviewed build fix after r229140.
3240
3241         * WebProcess/cocoa/WebProcessCocoa.mm:
3242
3243 2018-03-01  Per Arne Vollan  <pvollan@apple.com>
3244
3245         Scrollbar preferences are ignored when the WebContent process doesn't have access to the WindowServer.
3246         https://bugs.webkit.org/show_bug.cgi?id=183231
3247         <rdar://problem/37793457>
3248
3249         Reviewed by Brent Fulgham.
3250
3251         When the WebContent process doesn't have access to the WindowServer, the scrollbars are always of the overlay type.
3252         The notification about scrollbar preferences is never received by the WebContent process when there is no
3253         WindowServer access. This can be fixed by adding an observer of scrollbar preferences in the UI process, and
3254         notifying the WebProcess about this by sending it a message. This message should also contain the preferred
3255         scrollbar type, since the call '[NSScroller preferredScrollerStyle]' will always return the overlay style when
3256         there is no WindowServer access.
3257
3258         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3259         (WebKit::WebProcessPool::registerNotificationObservers):
3260         (WebKit::WebProcessPool::unregisterNotificationObservers):
3261         * UIProcess/WebProcessPool.h:
3262         * WebProcess/WebProcess.cpp:
3263         (WebKit::WebProcess::initializeProcess):
3264         * WebProcess/WebProcess.h:
3265         * WebProcess/WebProcess.messages.in:
3266         * WebProcess/cocoa/WebProcessCocoa.mm:
3267         (WebKit::WebProcess::scrollerStylePreferenceChanged):
3268
3269 2018-03-01  Antti Koivisto  <antti@apple.com>
3270
3271         Crash when updating cache entry after validation in apps that uses class A file protection
3272         https://bugs.webkit.org/show_bug.cgi?id=183242
3273         <rdar://problem/33289058>
3274
3275         Reviewed by Chris Dumez.
3276
3277         When validating a cache entry, we keep it alive until we get a network response. With 304 response
3278         we then update the headers of this existing entry. This accesses the body data of the entry which
3279         may be backed by a mapped file. If the app uses class A protection, user might have locked
3280         the device and the entry might have become inaccessible, leading to a crash.
3281
3282         * NetworkProcess/cache/NetworkCacheEntry.cpp:
3283         (WebKit::NetworkCache::Entry::setNeedsValidation):
3284
3285         In case of class A protection, pull the data to a memory buffer immediately before starting a revalidation request.
3286         This makes the window where the file could become inaccessible much shorter (since it no longer depends on network).
3287
3288 2018-03-01  Carlos Garcia Campos  <cgarcia@igalia.com>
3289
3290         REGRESSION(r221514): [GTK] UI process crash in WebKit::WaylandCompositor::Surface::flushPendingFrameCallbacks
3291         https://bugs.webkit.org/show_bug.cgi?id=183091
3292
3293         Reviewed by Michael Catanzaro.
3294
3295         Invalidate the surface in the page map when the backing store is destroyed.
3296
3297         * UIProcess/gtk/WaylandCompositor.cpp:
3298         (WebKit::WaylandCompositor::willDestroySurface):
3299         * UIProcess/gtk/WaylandCompositor.h:
3300
3301 2018-02-28  Brian Burg  <bburg@apple.com>
3302
3303         [Cocoa] Web Automation: provide a way to ask clients the type of a JavaScript dialog
3304         https://bugs.webkit.org/show_bug.cgi?id=182660
3305         <rdar://problem/37408183>
3306
3307         Reviewed by Tim Horton and Carlos Garcia Campos.
3308
3309         Add another delegate method to ask what type of dialog is being shown.
3310         This is used to implement §18.4 Step 5, where sending text to a dialog
3311         without a prompt will return several different kinds of errors.
3312
3313         No new tests, covered by web platform tests once Safari side has landed.
3314
3315         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h: Update FIXME radar numbers.
3316         * UIProcess/Cocoa/AutomationSessionClient.h:
3317         * UIProcess/Cocoa/AutomationSessionClient.mm:
3318         (WebKit::AutomationSessionClient::AutomationSessionClient):
3319         (WebKit::toImpl):
3320         (WebKit::AutomationSessionClient::typeOfCurrentJavaScriptDialogOnPage):
3321         If there is no current dialog to be checked, the client can return the 'None'
3322         type. This gets converted into a std::nullopt and causes a command error later.
3323
3324 2018-02-28  John Wilander  <wilander@apple.com>
3325
3326         Remove assertion from ResourceLoadStatisticsClassifier::calculateResourcePrevalence() which causes crashes when domains are explicitly set as prevalent without the associated statistics
3327         https://bugs.webkit.org/show_bug.cgi?id=183233
3328
3329         Unreviewed removal of an assertion that's causing layout test crashes.
3330
3331         * Platform/classifier/ResourceLoadStatisticsClassifier.cpp:
3332         (WebKit::ResourceLoadStatisticsClassifier::calculateResourcePrevalence):
3333             Removed ASSERT(currentPrevalence == Low).
3334
3335 2018-02-28  John Wilander  <wilander@apple.com>
3336
3337         Add a second tier of prevalence to facilitate telemetry on very prevalent domains
3338         https://bugs.webkit.org/show_bug.cgi?id=183218
3339         <rdar://problem/37992388>
3340
3341         Reviewed by Brent Fulgham.
3342
3343         * Platform/classifier/ResourceLoadStatisticsClassifier.cpp:
3344         (WebKit::vectorLength):
3345             New convenience function.
3346         (WebKit::ResourceLoadStatisticsClassifier::calculateResourcePrevalence):
3347             Renamed from ResourceLoadStatisticsClassifier::hasPrevalentResourceCharacteristics().
3348             Now returns a value from the enum ResourceLoadPrevalence.
3349         (WebKit::ResourceLoadStatisticsClassifier::classifyWithVectorThreshold):
3350             Now uses the new vectorLength() convenience function.
3351         (WebKit::ResourceLoadStatisticsClassifier::hasPrevalentResourceCharacteristics): Deleted.
3352             Renamed to ResourceLoadStatisticsClassifier::calculateResourcePrevalence().
3353         * Platform/classifier/ResourceLoadStatisticsClassifier.h:
3354             Added enum ResourceLoadPrevalence.
3355         * Shared/WebCoreArgumentCoders.cpp:
3356         (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
3357         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
3358             Handling of the new boolean field isVeryPrevalentResource.
3359         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
3360         (WKWebsiteDataStoreSetStatisticsVeryPrevalentResource):
3361         (WKWebsiteDataStoreIsStatisticsVeryPrevalentResource):
3362             Test infrastructure.
3363         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
3364         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3365         (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
3366         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
3367         (WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource):
3368         (WebKit::WebResourceLoadStatisticsStore::isVeryPrevalentResource):
3369         (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
3370             All of these are for handling of the two-tier classification.
3371             Also bumped the statisticsModelVersion to 12.
3372         * UIProcess/WebResourceLoadStatisticsStore.h:
3373
3374 2018-02-28  Alex Christensen  <achristensen@webkit.org>
3375
3376         Reduce use of NetworkingContext in WebKit
3377         https://bugs.webkit.org/show_bug.cgi?id=183213
3378
3379         Reviewed by Brady Eidson.
3380
3381         * NetworkProcess/RemoteNetworkingContext.h:
3382         * WebProcess/Network/WebLoaderStrategy.cpp:
3383         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
3384         (WebKit::WebLoaderStrategy::preconnectTo):
3385         * WebProcess/Network/WebLoaderStrategy.h:
3386         * WebProcess/Plugins/PluginView.cpp:
3387         (WebKit::PluginView::proxiesForURL):
3388         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3389         * WebProcess/WebPage/WebFrame.cpp:
3390
3391 2018-02-28  Brent Fulgham  <bfulgham@apple.com>
3392
3393         Remove network access from the WebContent process sandbox
3394         https://bugs.webkit.org/show_bug.cgi?id=183192
3395         <rdar://problem/35369115>
3396
3397         Reviewed by Alex Christensen.
3398
3399         Remove the 'system-network', 'allow-network-common', and 'network-client' access from the WebContent process.
3400         That's why we have a Network Process! 
3401
3402         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
3403         * WebProcess/com.apple.WebProcess.sb.in:
3404
3405 2018-02-27  Tim Horton  <timothy_horton@apple.com>
3406
3407         Ensure target triple is propagated correctly to DerivedSources.make
3408         https://bugs.webkit.org/show_bug.cgi?id=183189
3409         <rdar://problem/37959694>
3410
3411         Reviewed by Dan Bernstein.
3412
3413         * Configurations/Base.xcconfig:
3414         * DerivedSources.make:
3415         Ditto the WebCore ChangeLog.
3416
3417 2018-02-27  Yongjun Zhang  <yongjun_zhang@apple.com>
3418
3419         Make it possible to set suggestions in extra zoom mode.
3420         https://bugs.webkit.org/show_bug.cgi?id=183154
3421         <rdar://problem/35227450>
3422
3423         Reviewed by Tim Horton.
3424
3425         In extra zoom mode, when presenting WKFocusedFormControlViewController, make it the inputDelegate for
3426         WKContentView. This is needed to ensure we can capture/cache the suggestions when _WKInputSession's
3427         suggestions is updated. Later, when we present WKTextInputViewController, we can pass the cached
3428         suggestions.
3429
3430         * UIProcess/ios/WKContentViewInteraction.mm:
3431         (-[WKContentView presentFocusedFormControlViewController:]): Set _focusedFormControlViewController as
3432             the inputDelegate for WKContentView.
3433         (-[WKContentView dismissFocusedFormControlViewController:]): Null the inputDelegate on dismissal.
3434         (-[WKContentView presentTextInputViewController:]): Pass the suggestions from WKFocusedFormControlViewController to
3435             WKTextInputViewController when the latter is presented.
3436         (-[WKContentView textInputController:didCommitText:]): Call the new delegate method textInputController:didCommitText:withSuggestion:.
3437         (-[WKContentView textInputController:didCommitText:withSuggestion:]): When a suggestions is selected, insert the
3438             suggestion which will notify the client.
3439         (-[WKContentView focusedFormControllerDidUpdateSuggestions:]): Called when the suggestion is updated after the input
3440             view controller is presented.
3441
3442 2018-02-27  Tim Horton  <timothy_horton@apple.com>
3443
3444         Stop using deprecated CADisplay SPI
3445         https://bugs.webkit.org/show_bug.cgi?id=183150
3446         <rdar://problem/37918297>
3447
3448         Reviewed by Simon Fraser.
3449
3450         * Platform/spi/ios/FrontBoardServicesSPI.h: Added.
3451         * Platform/spi/ios/UIKitSPI.h:
3452         * UIProcess/API/Cocoa/WKWebView.mm:
3453         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
3454         * WebKit.xcodeproj/project.pbxproj:
3455         Switch to the more modern way of getting the display name.
3456
3457 2018-02-27  Ryan Haddad  <ryanhaddad@apple.com>
3458
3459         Unreviewed, rolling out r229055.
3460
3461         Breaks internal builds.
3462
3463         Reverted changeset:
3464
3465         "Stop using deprecated CADisplay SPI"
3466         https://bugs.webkit.org/show_bug.cgi?id=183150
3467         https://trac.webkit.org/changeset/229055
3468
3469 2018-02-27  Wenson Hsieh  <wenson_hsieh@apple.com>
3470
3471         [Extra zoom mode] Implement additional SPI for adjusting viewport shrink-to-fit behavior
3472         https://bugs.webkit.org/show_bug.cgi?id=183100
3473         <rdar://problem/37840987>
3474
3475         Reviewed by Tim Horton.
3476
3477         Add new SPI hooks to provide finer control over certain aspects of the shrink-to-fit viewport heuristic.
3478         Currently, in certain cases of iPad multitasking, Safari allows shrinking content to fit by default. This means
3479         that even when "width=device-width" is used, if the contents of the page are too wide to fit within the
3480         viewport's width, we'll adjust the initial scale such that the viewport can fit all of the content.
3481
3482         However, in certain viewport dimensions, this heuristic is insufficient to ensure that pages are laid out and
3483         displayed properly within the viewport. Namely, one could imagine that an element with a hard-coded width that
3484         is larger than the real viewport width would cause all other elements with dimensions relative to the body to be
3485         excessively shrunk down once shrink-to-fit is applied, so the page would still look broken even if the contents
3486         of the page all fit within the viewport.
3487
3488         To mitigate this, we decouple the notions of minimum layout size from the size of the actual viewport (which we
3489         simply refer to as "view size"). This allows us to introduce a mechanism where we lay out the page at a given
3490         minimum layout size that is larger than the size of the view; later, when we determine the initial scale, we
3491         then apply shrink-to-fit scaling using the view size rather than the minimum layout size. This grants us the
3492         ability to lay out content as if our view were large, but still ensure that the contents of the page fit within
3493         the actual view.
3494
3495         * Shared/VisibleContentRectUpdateInfo.cpp:
3496         (WebKit::VisibleContentRectUpdateInfo::encode const):
3497         (WebKit::VisibleContentRectUpdateInfo::decode):
3498         (WebKit::operator<<):
3499         * Shared/VisibleContentRectUpdateInfo.h:
3500         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
3501         (WebKit::VisibleContentRectUpdateInfo::forceHorizontalShrinkToFit const):
3502         (WebKit::operator==):
3503
3504         Plumb the forceHorizontalShrinkToFit flag through VisibleContentRectUpdateInfo.
3505
3506         * Shared/WebPageCreationParameters.cpp:
3507         (WebKit::WebPageCreationParameters::encode const):
3508         (WebKit::WebPageCreationParameters::decode):
3509         * Shared/WebPageCreationParameters.h:
3510
3511         Plumb viewSize through IPC to WebPage.
3512
3513         * UIProcess/API/Cocoa/WKWebView.mm:
3514         (-[WKWebView _initializeWithConfiguration:]):
3515
3516         Start off WKWebView flags at their initial values.
3517
3518         (-[WKWebView _minimumAllowedLayoutWidth]):
3519         (-[WKWebView _setMinimumAllowedLayoutWidth:]):
3520
3521         This provides the minimum width at which the page will lay out, such that if the view width dips below this
3522         value, we'll use this minimum allowed layout width instead. 0 by default.
3523
3524         (-[WKWebView activeMinimumLayoutSizes:]):
3525
3526         Refactor this from a static function to a helper method on WKWebView that computes both the minimum layout size
3527         (which takes minimum allowed layout width into account) as well as the real view size. Refactor all call sites
3528         to use this new method, and also propagate the view size down via IPC, alongside the minimum layout size.
3529
3530         (-[WKWebView _dispatchSetMinimumLayoutSize:viewSize:]):
3531         (-[WKWebView _frameOrBoundsChanged]):
3532         (-[WKWebView _setMinimumLayoutSizeOverride:]):
3533         (-[WKWebView _setForceHorizontalViewportShrinkToFit:]):
3534         (-[WKWebView _forceHorizontalViewportShrinkToFit]):
3535
3536         Setting this flag to YES forces us to always shrink-to-fit in the horizontal axis. NO by default.
3537
3538         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
3539         (-[WKWebView _endAnimatedResize]):
3540         (activeMinimumLayoutSize): Deleted.
3541
3542         More refactoring to replace activeMinimumLayoutSize() with -activeMinimumLayoutSizes:.
3543
3544         (-[WKWebView _dispatchSetMinimumLayoutSize:]): Deleted.
3545         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3546         * UIProcess/WebPageProxy.cpp:
3547         (WebKit::WebPageProxy::creationParameters):
3548         * UIProcess/WebPageProxy.h:
3549         * UIProcess/ios/WKContentView.mm:
3550         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
3551
3552         Pass _forceHorizontalViewportShrinkToFit into the visible content rect update.
3553
3554         * UIProcess/ios/WebPageProxyIOS.mm:
3555         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
3556         (WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSize):
3557
3558         Plumb viewSize alongside the existing minimumLayoutSize.
3559
3560         * WebProcess/WebPage/WebPage.cpp:
3561         (WebKit::m_credentialsMessenger):
3562         * WebProcess/WebPage/WebPage.h:
3563         * WebProcess/WebPage/WebPage.messages.in:
3564         * WebProcess/WebPage/ios/WebPageIOS.mm:
3565         (WebKit::WebPage::setViewportConfigurationMinimumLayoutSize):
3566         (WebKit::WebPage::dynamicViewportSizeUpdate):
3567         (WebKit::WebPage::updateVisibleContentRects):
3568
3569         Set forceHorizontalShrinkToFit on the viewport configuration here.
3570
3571 2018-02-27  Tim Horton  <timothy_horton@apple.com>
3572
3573         Stop using deprecated CADisplay SPI
3574         https://bugs.webkit.org/show_bug.cgi?id=183150
3575         <rdar://problem/37918297>
3576
3577         Reviewed by Simon Fraser.
3578
3579         * Platform/spi/ios/FrontBoardServicesSPI.h: Added.
3580         * Platform/spi/ios/UIKitSPI.h:
3581         * UIProcess/API/Cocoa/WKWebView.mm:
3582         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
3583         * WebKit.xcodeproj/project.pbxproj:
3584         Switch to the more modern way of getting the display name.
3585
3586 2018-02-26  Youenn Fablet  <youenn@apple.com>
3587
3588         Caches::m_storage should be set to null in case of error at initialization time
3589         https://bugs.webkit.org/show_bug.cgi?id=183068
3590
3591         Reviewed by Chris Dumez.
3592
3593         In case of error, we need to set m_storage back to nullptr so that
3594         next tries to initialize it will restart from scratch.
3595         If we do not set it to nullptr, we end up storing the initialize
3596         callback in a queue and the callback will never be called.
3597
3598         This is difficult to test as we need the following conditions:
3599         - we need to have an error case, like a disk writing error
3600         - we need the web app to open a cache in two different pages/frames at about the same time.
3601
3602         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
3603         (WebKit::CacheStorage::Caches::initialize):
3604
3605 2018-02-26  Commit Queue  <commit-queue@webkit.org>
3606
3607         Unreviewed, rolling out r226330.
3608         https://bugs.webkit.org/show_bug.cgi?id=183152
3609
3610         incorrectly assumes enumeration callback happens once
3611         (Requested by alexchristensen on #webkit).
3612
3613         Reverted changeset:
3614
3615         "Use BlockPtrs and lambdas instead of new/delete to pass
3616         parameters to blocks in WebViewImpl::performDragOperation"
3617         https://bugs.webkit.org/show_bug.cgi?id=180795
3618         https://trac.webkit.org/changeset/226330
3619
3620 2018-02-26  Ryosuke Niwa  <rniwa@webkit.org>
3621
3622         Release assertion in WebPage::updatePreferences
3623         https://bugs.webkit.org/show_bug.cgi?id=183075
3624
3625         Reviewed by Youenn Fablet and Chris Dumez.
3626
3627         Replaced the release assertion added in r228589 with a more graceful disabling of the feature when the entitlement is missing.
3628
3629         * StorageProcess/StorageProcess.cpp:
3630         (WebKit::StorageProcess::didReceiveMessage): Added an early exit with an entitlement check to disable the feature.
3631         (WebKit::StorageProcess::initializeWebsiteDataStore): Ditto.
3632         (WebKit::StorageProcess::createStorageToWebProcessConnection): Replaced the release assertion with a debug assertion.
3633         (WebKit::StorageProcess::swServerForSession): Removed the assertion. This code can be reached when the service worker is disabled.
3634         (WebKit::StorageProcess::registerSWServerConnection): Replaced the release assertion with a debug assertion.
3635         * WebProcess/WebPage/WebPage.cpp:
3636         (WebKit::WebPage::updatePreferences): Disable the feature instead of crashing when the entitlement is missing.
3637
3638 2018-02-26  Chris Dumez  <cdumez@apple.com>
3639
3640         Regression(r223431): Crash under didReceiveChallenge in NetworkSessionCocoa
3641         https://bugs.webkit.org/show_bug.cgi?id=183134
3642         <rdar://problem/36339049>
3643
3644         Reviewed by Alex Christensen.
3645
3646         Like other delegates functions in this file, it is possible for didReceiveChallenge to get called
3647         after _session has been nulled out. Other delegate functions already had early returns when
3648         _session is null. However, such early return was missing in didReceiveChallenge.
3649
3650         This patch ends the early return to didReceiveChallenge so that we do not end up calling
3651         _session->downloadID(taskIdentifier) on a null _session.
3652
3653         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3654         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
3655
3656 2018-02-26  Youenn Fablet  <youenn@apple.com>
3657
3658         MessagePort is not always destroyed in the right thread
3659         https://bugs.webkit.org/show_bug.cgi?id=183053
3660
3661         Reviewed by Chris Dumez.
3662
3663         Update code to pass a lambda to MessagePort::existingMessagePortForIdentifier.
3664
3665         * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.cpp:
3666         (WebKit::WebMessagePortChannelProvider::checkProcessLocalPortForActivity):
3667         * WebProcess/WebProcess.cpp:
3668         (WebKit::WebProcess::messagesAvailableForPort):
3669
3670 2018-02-25  Alexey Proskuryakov  <ap@apple.com>
3671
3672         Font smoothing doesn't get disabled if the preference is set before launching WebContent process
3673         https://bugs.webkit.org/show_bug.cgi?id=183108
3674
3675         Reviewed by Tim Horton.
3676
3677         * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess):
3678         Fix the bug. While at it, also avoid the anti-pattern in setAlwaysUsesComplexTextCodePath.
3679
3680 2018-02-25  Philippe Normand  <pnormand@igalia.com>
3681
3682         Unreviewed GTK Debug build fix after r228942.
3683
3684         * UIProcess/API/glib/IconDatabase.cpp:
3685         (WebKit::IconDatabase::iconDatabaseSyncThread):
3686         (WebKit::IconDatabase::syncThreadMainLoop):
3687         (WebKit::IconDatabase::readFromDatabase):
3688         (WebKit::IconDatabase::writeToDatabase):
3689         (WebKit::IconDatabase::cleanupSyncThread):
3690
3691 2018-02-25  Chris Dumez  <cdumez@apple.com>
3692
3693         Service workers do not work well inside Web.app
3694         https://bugs.webkit.org/show_bug.cgi?id=183105
3695         <rdar://problem/37864140>
3696
3697         Reviewed by Youenn Fablet.
3698
3699         * StorageProcess/StorageProcess.cpp:
3700         (WebKit::StorageProcess::didReceiveMessage):
3701         We were failing to forward IPC messages to the ChildProcess class here. As a result,
3702         the ChildProcess::RegisterURLSchemeServiceWorkersCanHandle IPC was being ignored
3703         by the StorageProcess.
3704
3705 2018-02-24  Zan Dobersek  <zdobersek@igalia.com>
3706
3707         Unreviewed WPE breakage fix.
3708
3709         * WebProcess/wpe/WebProcessMainWPE.cpp: Call g_set_prgname() in WebProcess 
3710         to prepare the GLib state for subsequent GStreamer initialization.
3711
3712 2018-02-23  John Wilander  <wilander@apple.com>
3713
3714         Introduce ITP debug logging as an opt-in developer feature
3715         https://bugs.webkit.org/show_bug.cgi?id=183065
3716         <rdar://problem/37803761>
3717
3718         Reviewed by Brent Fulgham.
3719
3720         * Platform/Logging.h:
3721             Added a dedicated channel for Resource Load Statistics debug logging
3722             since this will be part of a developer-facing feature and should not
3723             be mixed with general Resource Load Statistics logging.
3724         * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
3725         (WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):
3726             Now picks up the user default setting for
3727             ResourceLoadStatisticsDebugLoggingEnabled.
3728         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3729         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
3730             Now logs for which domains it purges website data if
3731             ResourceLoadStatisticsDebugLoggingEnabled is set.
3732         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
3733             Now logs for which domains it partitions and blocks cookies
3734             in third-party contexts if ResourceLoadStatisticsDebugLoggingEnabled
3735             is set.
3736         * UIProcess/WebResourceLoadStatisticsStore.h:
3737
3738 2018-02-23  Brent Fulgham  <bfulgham@apple.com>
3739
3740         [macOS] Correct sandbox violation during media playback
3741         https://bugs.webkit.org/show_bug.cgi?id=183092
3742         <rdar://problem/37718495>
3743
3744         Reviewed by Eric Carlson.
3745
3746         * WebProcess/com.apple.WebProcess.sb.in:
3747
3748 2018-02-23  Yousuke Kimoto  <yousuke.kimoto@sony.com>
3749
3750         [MSVC] Unknown a type definition error in WebResourceLoadStatisticsStore on wincairo webkit
3751         https://bugs.webkit.org/show_bug.cgi?id=182873
3752
3753         Reviewed by Yusuke Suzuki.
3754
3755         * UIProcess/WebResourceLoadStatisticsStore.h:
3756
3757 2018-02-23  Carlos Garcia Campos  <cgarcia@igalia.com>
3758
3759         [GStreamer][MiniBrowser] Honor GStreamer command line parameters in MiniBrowser
3760         https://bugs.webkit.org/show_bug.cgi?id=173655
3761         <rdar://problem/37706341>
3762
3763         Reviewed by Philippe Normand.
3764
3765         Actually pass the gst command line options to the WebProcess. The options in /proc/self/cmdline are separated by
3766         null characters, so we are effectively passing always the first option only, which is the program name. Then, in
3767         the web process we always ignore the first option and providing WebProcess unconditionally, so we were doing
3768         nothing.
3769
3770         * UIProcess/gtk/WebProcessPoolGtk.cpp:
3771         (WebKit::WebProcessPool::platformInitializeWebProcess): Use WebCore::extractGStreamerOptionsFromCommandLine()
3772         * UIProcess/wpe/WebProcessPoolWPE.cpp:
3773         (WebKit::WebProcessPool::platformInitializeWebProcess): Ditto.
3774         * WebProcess/soup/WebProcessSoup.cpp:
3775         (WebKit::WebProcess::platformInitializeWebProcess): Move the vector.
3776
3777 2018-02-22  Yusuke Suzuki  <utatane.tea@gmail.com>
3778
3779         Remove currentTime() / currentTimeMS()
3780         https://bugs.webkit.org/show_bug.cgi?id=183052
3781
3782         Reviewed by Mark Lam.
3783
3784         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
3785         * PluginProcess/WebProcessConnection.cpp:
3786         * Shared/WebProcessCreationParameters.h:
3787         * Shared/linux/WebMemorySamplerLinux.cpp:
3788         (WebKit::WebMemorySampler::sampleWebKit const):
3789         * Shared/mac/WebMemorySampler.mac.mm:
3790         (WebKit::WebMemorySampler::sampleWebKit const):
3791         * UIProcess/API/C/WKContext.cpp:
3792         (WKContextSetPlugInAutoStartOriginsFilteringOutEntriesAddedAfterTime):
3793         * UIProcess/API/glib/IconDatabase.cpp:
3794         (WebKit::IconDatabase::setIconDataForIconURL):
3795         (WebKit::IconDatabase::synchronousLoadDecisionForIconURL):
3796         (WebKit::IconDatabase::performURLImport):
3797         * UIProcess/DrawingAreaProxyImpl.cpp:
3798         * UIProcess/Plugins/PlugInAutoStartProvider.cpp:
3799         (WebKit::expirationTimeFromNow):
3800         (WebKit::PlugInAutoStartProvider::addAutoStartOriginHash):
3801         (WebKit::PlugInAutoStartProvider::autoStartOriginsTableCopy const):
3802         (WebKit::PlugInAutoStartProvider::setAutoStartOriginsTable):
3803         (WebKit::PlugInAutoStartProvider::setAutoStartOriginsFilteringOutEntriesAddedAfterTime):
3804         (WebKit::PlugInAutoStartProvider::setAutoStartOriginsTableWithItemsPassingTest):
3805         (WebKit::PlugInAutoStartProvider::didReceiveUserInteraction):
3806         * UIProcess/Plugins/PlugInAutoStartProvider.h:
3807         * UIProcess/WebProcessPool.cpp:
3808         (WebKit::WebProcessPool::processDidFinishLaunching):
3809         (WebKit::WebProcessPool::startMemorySampler):
3810         (WebKit::WebProcessPool::setPlugInAutoStartOriginsFilteringOutEntriesAddedAfterTime):
3811         * UIProcess/WebProcessPool.h:
3812         * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
3813         (API::InjectedBundle::PageLoaderClient::willPerformClientRedirectForFrame):
3814         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
3815         (WebKit::InjectedBundlePageLoaderClient::willPerformClientRedirectForFrame):
3816         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
3817         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3818         (WebKit::WebFrameLoaderClient::dispatchWillPerformClientRedirect):
3819         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
3820         * WebProcess/WebProcess.cpp:
3821         (WebKit::m_webSQLiteDatabaseTracker):
3822         (WebKit::WebProcess::isPlugInAutoStartOriginHash):
3823         (WebKit::WebProcess::plugInDidStartFromOrigin):
3824         (WebKit::WebProcess::didAddPlugInAutoStartOriginHash):
3825         (WebKit::WebProcess::resetPlugInAutoStartOriginDefaultHashes):
3826         (WebKit::WebProcess::resetPlugInAutoStartOriginHashes):
3827         (WebKit::WebProcess::plugInDidReceiveUserInteraction):
3828         * WebProcess/WebProcess.h:
3829         * WebProcess/WebProcess.messages.in:
3830         * WebProcess/cocoa/WebProcessCocoa.mm:
3831         * WebProcess/wpe/WebProcessMainWPE.cpp:
3832
3833 2018-02-22  Matt Baker  <mattbaker@apple.com>
3834
3835         Web Inspector: REGRESSION (r228349): ImageBitmap builtin is now runtime guarded
3836         https://bugs.webkit.org/show_bug.cgi?id=183056
3837         <rdar://problem/37799067>
3838
3839         Reviewed by Joseph Pecoraro.
3840
3841         * WebProcess/WebPage/WebInspectorUI.cpp:
3842         (WebKit::WebInspectorUI::WebInspectorUI):
3843
3844 2018-02-22  Youenn Fablet  <youenn@apple.com>
3845
3846         Caches::initialize should call all pending initialization callbacks in case of error
3847         https://bugs.webkit.org/show_bug.cgi?id=183062
3848
3849         Reviewed by Chris Dumez.
3850
3851         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
3852         (WebKit::CacheStorage::Caches::initialize):
3853         (WebKit::CacheStorage::Caches::initializeSize):
3854
3855 2018-02-22  Youenn Fablet  <youenn@apple.com>
3856
3857         CacheStorage::Engine::Caches::writeRecord is not always calling the completion handler
3858         https://bugs.webkit.org/show_bug.cgi?id=183055
3859
3860         Reviewed by Chris Dumez.
3861
3862         Add a completion handler to Storage::store.
3863         Use it instead in Caches::writeRecord.
3864         This ensures that the Cache add/put promise will be called once all write operations have been done.
3865
3866         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
3867         (WebKit::CacheStorage::Caches::writeRecord):
3868         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3869         (WebKit::NetworkCache::Storage::WriteOperation::WriteOperation):
3870         (WebKit::NetworkCache::Storage::finishWriteOperation):
3871         (WebKit::NetworkCache::Storage::store):
3872         * NetworkProcess/cache/NetworkCacheStorage.h:
3873         (WebKit::NetworkCache::Storage::store):
3874
3875 2018-02-22  Ryosuke Niwa  <rniwa@webkit.org>
3876
3877         Add an entitlement check for service worker on iOS
3878         https://bugs.webkit.org/show_bug.cgi?id=182865
3879
3880         Reviewed by Dan Bernstein.
3881
3882         Addressed Dan's comment by using xpc_connection_copy_entitlement_value instead of obtaining the audit token first.
3883
3884         * Shared/mac/SandboxUtilities.h:
3885         * Shared/mac/SandboxUtilities.mm:
3886         (WebKit::connectedProcessHasEntitlement):
3887         * StorageProcess/ios/StorageProcessIOS.mm:
3888         (WebKit::StorageProcess::parentProcessHasServiceWorkerEntitlement const):
3889         * WebProcess/WebPage/ios/WebPageIOS.mm:
3890         (WebKit::WebPage::parentProcessHasServiceWorkerEntitlement const):
3891
3892 2018-02-22  Youenn Fablet  <youenn@apple.com>
3893
3894         Fetch event release assert should take into account the fetch mode
3895         https://bugs.webkit.org/show_bug.cgi?id=183047
3896
3897         Reviewed by Chris Dumez.
3898
3899         In case of navigation tasks, we should use the request URL and not the origin of the loading client.
3900
3901         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
3902         (WebKit::isValidFetch):
3903         (WebKit::WebSWContextManagerConnection::startFetch):
3904
3905 2018-02-22  Yousuke Kimoto  <yousuke.kimoto@sony.com>
3906
3907         [WinCairo] Fix compile errors in WebPageWin.cpp and WebProcessWin.cpp due to WebCore forwarding header paths
3908         https://bugs.webkit.org/show_bug.cgi?id=182969
3909
3910         Reviewed by Konstantin Tokarev.
3911
3912         * WebProcess/WebPage/win/WebPageWin.cpp:
3913         * WebProcess/win/WebProcessWin.cpp:
3914
3915 2018-02-22  Yusuke Suzuki  <utatane.tea@gmail.com>
3916
3917         Remove sleep(double) and sleepMS(double) interfaces
3918         https://bugs.webkit.org/show_bug.cgi?id=183038
3919
3920         Reviewed by Mark Lam.
3921
3922         * PluginProcess/WebProcessConnection.cpp:
3923         (WebKit::WebProcessConnection::createPluginAsynchronously):
3924         * UIProcess/linux/MemoryPressureMonitor.cpp:
3925         (WebKit::pollIntervalForUsedMemoryPercentage):
3926         (WebKit::MemoryPressureMonitor::MemoryPressureMonitor):
3927         * WebProcess/wpe/WebProcessMainWPE.cpp:
3928
3929 2018-02-22  Youenn Fablet  <youenn@apple.com>
3930
3931         Add release logging for CacheStorage::Engine disk related functions
3932         https://bugs.webkit.org/show_bug.cgi?id=183042
3933
3934         Reviewed by Chris Dumez.
3935
3936         * NetworkProcess/cache/CacheStorageEngine.cpp:
3937         (WebKit::CacheStorage::Engine::writeFile):
3938         (WebKit::CacheStorage::Engine::readFile):
3939
3940 2018-02-22  Matt Lewis  <jlewis3@apple.com>
3941
3942         Unreviewed, rolling out r228902.
3943
3944         This broke internal builds.
3945
3946         Reverted changeset:
3947
3948         "[Cocoa] Web Automation: provide a way to ask clients the type
3949         of a JavaScript dialog"
3950         https://bugs.webkit.org/show_bug.cgi?id=182660
3951         https://trac.webkit.org/changeset/228902
3952
3953 2018-02-22  Youenn Fablet  <youenn@apple.com>
3954
3955         Add release asserts for service worker fetch and postMessage events
3956         https://bugs.webkit.org/show_bug.cgi?id=183025
3957         rdar://problem/37765052
3958
3959         Reviewed by Daniel Bates.
3960
3961         Add assertion to protect interception of a fetch load by a service worker with
3962         a different origin from the page.
3963
3964         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
3965         (WebKit::WebSWContextManagerConnection::startFetch):
3966
3967 2018-02-22  Ms2ger  <Ms2ger@igalia.com>
3968
3969         [GTK][WPE] Fix some build errors in service workers code
3970         https://bugs.webkit.org/show_bug.cgi?id=182966
3971
3972         Reviewed by Žan Doberšek.
3973
3974         * CMakeLists.txt: add missing files.
3975         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: add missing includes.
3976         * UIProcess/ServiceWorkerProcessProxy.cpp: use #include rather than #import in C++; add missing ifdef.
3977         * UIProcess/ServiceWorkerProcessProxy.h: add missing ifdef.
3978         * WebProcess/Storage/WebSWClientConnection.cpp: add missing includes.
3979         * WebProcess/Storage/WebSWContextManagerConnection.cpp: add missing includes.
3980         (WebKit::WebSWContextManagerConnection::WebSWContextManagerConnection):
3981           call the function that exists outside cocoa.
3982
3983 2018-02-21  Per Arne Vollan  <pvollan@apple.com>
3984
3985         The WebContent process should not use NSScreen in the screenAvailableRect/screenRect implementations.
3986         https://bugs.webkit.org/show_bug.cgi?id=182855
3987
3988         Reviewed by Brent Fulgham.
3989
3990         On macOS, the functions screenAvailableRect and screenRect is implemented using NSScreen, which is communicating
3991         with the WindowServer. To avoid this WindowServer communication from the WebContent process when calling
3992         screenAvailableRect and screenRect, it is possible to let the UIProcess send a message to the WebContent
3993         process whenever there is a change in the display properties, and have the WebContent process cache these
3994         display properties. This message should also be sent to a newly started WebContent process.
3995
3996         * UIProcess/WebProcessPool.cpp:
3997         (WebKit::displayReconfigurationCallBack):
3998         (WebKit::registerDisplayConfigurationCallback):
3999         (WebKit::WebProcessPool::initializeNewWebProcess):
4000         (WebKit::WebProcessPool::warmInitialProcess):
4001         * WebProcess/WebProcess.cpp:
4002         (WebKit::WebProcess::setScreenProperties):
4003         * WebProcess/WebProcess.h:
4004         * WebProcess/WebProcess.messages.in:
4005
4006 2018-02-21  Christopher Reid  <chris.reid@sony.com>
4007
4008         [Curl] Curl Cookie Database File should be configurable using NetworkProcessCreationParameters
4009         https://bugs.webkit.org/show_bug.cgi?id=182751
4010
4011         Reviewed by Youenn Fablet.
4012
4013         Adding a cookiePersistentStorageFile parameter to Curl's NetworkProcessCreationParameters.
4014         This parameter is based on Soup's cookiePersistentStoragePath.
4015         This parameter is not used yet, it is added to prepare for WinCairo WebKit support.
4016
4017         * NetworkProcess/NetworkProcessCreationParameters.cpp:
4018         * NetworkProcess/NetworkProcessCreationParameters.h:
4019         * NetworkProcess/curl/NetworkProcessCurl.cpp:
4020         * WebProcess/Cookies/WebCookieManager.h:
4021         * WebProcess/Cookies/curl/WebCookieManagerCurl.cpp:
4022
4023 2018-02-21  Brian Burg  <bburg@apple.com>
4024
4025         [Cocoa] Web Automation: provide a way to ask clients the type of a JavaScript dialog
4026         https://bugs.webkit.org/show_bug.cgi?id=182660
4027         <rdar://problem/37408183>
4028
4029         Reviewed by Tim