[GTK] Use the DisplayRefreshMonitor facilities
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2017-04-11  Zan Dobersek  <zdobersek@igalia.com>
2
3         [GTK] Use the DisplayRefreshMonitor facilities
4         https://bugs.webkit.org/show_bug.cgi?id=170599
5
6         Reviewed by Carlos Garcia Campos.
7
8         ThreadedCompositor gains a DisplayRefreshMonitor member that it can use
9         to better coordinate display refresh callbacks on the main thread. Still,
10         because currently the GTK+ port doesn't have a reliable way of notifying
11         the ThreadedCompositor of a vsync event, a timer targeting 60FPS is used
12         in order to keep the updates at a reasonable rate. When the timer is fired,
13         the ThreadedCompositor decides how to proceed based on state changes that
14         might have occurred during composition or whether there's any display
15         refresh callbacks that require handling on the main thread.
16
17         CompositingRunLoop now stores its state in an atomic variable that's then
18         inspected whenever a new update is scheduled or completed. When scheduled,
19         if there's no update in progress, a new update is requested through the
20         timer. If there's already an update in progress, a new update is marked
21         as pending after the current one completes. In that case, when the update
22         is completed, a new update is requested through the timer.
23
24         ThreadedDisplayRefreshMonitor is used to coordinate updates between the
25         main and the composition thread whenever the CoordinatedGraphics state
26         demands it, or whenever there are clients registered to that monitor that
27         require an update (e.g. a requestAnimationFrame() callback). After the
28         update on the composition thread is finished, and the DisplayRefreshMonitor
29         object requires an update, a callback at the same priority as the layer
30         flush timer is scheduled on the main thread. In that callback we handle
31         any clients registered for this DisplayRefreshMonitor before proceeding
32         to handle any changes to the CoordinatedGraphics scene. In case the
33         DisplayRefreshMonitor clients or the layer flushes already queued up
34         any changes to the state, we immediately ask the ThreadedCompositor for
35         an update.
36
37         * PlatformGTK.cmake:
38         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
39         (WebKit::CoordinatedGraphicsScene::updateViewport):
40         (WebKit::CoordinatedGraphicsScene::commitSceneState):
41         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
42         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
43         (WebKit::CompositingRunLoop::CompositingRunLoop):
44         (WebKit::CompositingRunLoop::isActive):
45         (WebKit::CompositingRunLoop::scheduleUpdate):
46         (WebKit::CompositingRunLoop::stopUpdates):
47         (WebKit::CompositingRunLoop::updateCompleted):
48         (WebKit::CompositingRunLoop::updateTimerFired):
49         (WebKit::CompositingRunLoop::isCurrent):
50         (WebKit::CompositingRunLoop::startUpdateTimer): Deleted.
51         (WebKit::CompositingRunLoop::stopUpdateTimer): Deleted.
52         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
53         (): Deleted.
54         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
55         (WebKit::m_displayRefreshMonitor):
56         (WebKit::ThreadedCompositor::invalidate):
57         (WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing):
58         (WebKit::ThreadedCompositor::updateViewport):
59         (WebKit::ThreadedCompositor::scheduleDisplayImmediately):
60         (WebKit::ThreadedCompositor::renderLayerTree):
61         (WebKit::ThreadedCompositor::sceneUpdateFinished):
62         (WebKit::ThreadedCompositor::updateSceneState):
63         (WebKit::ThreadedCompositor::displayRefreshMonitor):
64         (WebKit::ThreadedCompositor::renderNextFrameIfNeeded):
65         (WebKit::ThreadedCompositor::completeCoordinatedUpdateIfNeeded):
66         (WebKit::ThreadedCompositor::coordinateUpdateCompletionWithClient):
67         (WebKit::ThreadedCompositor::performFrameCompletion):
68         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
69         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp: Added.
70         (WebKit::ThreadedDisplayRefreshMonitor::ThreadedDisplayRefreshMonitor):
71         (WebKit::ThreadedDisplayRefreshMonitor::requestRefreshCallback):
72         (WebKit::ThreadedDisplayRefreshMonitor::requiresDisplayRefreshCallback):
73         (WebKit::ThreadedDisplayRefreshMonitor::dispatchDisplayRefreshCallback):
74         (WebKit::ThreadedDisplayRefreshMonitor::invalidate):
75         (WebKit::ThreadedDisplayRefreshMonitor::displayRefreshCallback):
76         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.h: Copied from Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h.
77         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
78         (WebKit::AcceleratedDrawingArea::createDisplayRefreshMonitor):
79         * WebProcess/WebPage/AcceleratedDrawingArea.h:
80         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
81         (WebKit::ThreadedCoordinatedLayerTreeHost::createDisplayRefreshMonitor):
82         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
83         * WebProcess/WebPage/LayerTreeHost.h:
84         (WebKit::LayerTreeHost::createDisplayRefreshMonitor):
85
86 2017-04-11  Alex Christensen  <achristensen@webkit.org>
87
88         Modernize and clean up code
89         https://bugs.webkit.org/show_bug.cgi?id=170752
90
91         Reviewed by Sam Weinig.
92
93         * NetworkProcess/NetworkResourceLoader.h:
94         * Shared/WebPreferencesStore.h:
95         * UIProcess/API/APIHitTestResult.cpp:
96         (API::HitTestResult::create):
97         * UIProcess/API/APIHitTestResult.h:
98         * UIProcess/API/C/WKPreferences.cpp:
99         (WKPreferencesCreate):
100         (WKPreferencesCreateWithIdentifier):
101         (WKPreferencesCreateCopy):
102         * UIProcess/Authentication/AuthenticationChallengeProxy.h:
103         * UIProcess/WebPreferences.cpp:
104         (WebKit::WebPreferences::createWithLegacyDefaults):
105         (WebKit::WebPreferences::copy):
106         * UIProcess/WebPreferences.h:
107         * WebProcess/Network/WebLoaderStrategy.h:
108         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
109         (WebKit::WebEditorClient::requestCheckingOfString):
110         * WebProcess/WebPage/WebPage.cpp:
111         (WebKit::WebPage::addTextCheckingRequest):
112         * WebProcess/WebPage/WebPage.h:
113         * WebProcess/WebPage/ios/WebPageIOS.mm:
114         (WebKit::WebPage::rangeForWebSelectionAtPosition):
115         (WebKit::WebPage::rangeForBlockAtPoint):
116         (WebKit::WebPage::expandedRangeFromHandle):
117         (WebKit::WebPage::contractedRangeFromHandle):
118         (WebKit::WebPage::computeExpandAndShrinkThresholdsForHandle):
119         (WebKit::WebPage::changeBlockSelection):
120         (WebKit::WebPage::rangeForGranularityAtPoint):
121         (WebKit::WebPage::computePagesForPrintingAndDrawToPDF):
122
123 2017-04-11  Dean Jackson  <dino@apple.com>
124
125         Disable outdated WritableStream API
126         https://bugs.webkit.org/show_bug.cgi?id=170749
127         <rdar://problem/31446233>
128
129         Reviewed by Tim Horton.
130
131         The API we implement is no longer accurate. Disable it until we
132         are compatible with the new specification
133
134         * Configurations/FeatureDefines.xcconfig:
135
136 2017-04-11  Dan Bernstein  <mitz@apple.com>
137
138         [Cocoa] WebKit unnecessarily soft-links CorePrediction
139         https://bugs.webkit.org/show_bug.cgi?id=170644
140
141         Reviewed by Sam Weinig.
142
143         * Configurations/BaseTarget.xcconfig: Defined HAVE_CORE_PREDICTION and added
144           HAVE_CORE_PREDICTION to the preprocessor defintions when the former is YES.
145
146         * Configurations/WebKit.xcconfig: Have the linker link against CorePrediction where
147           available. On macOS, use weak linking, because CorePrediction is not available in the
148           Base System.
149
150         * Platform/classifier/cocoa/CorePredictionSoftLink.h: Removed.
151
152         * Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp: Guarded with
153           #if HAVE(CORE_PREDICTION).
154         (WebKit::isNullFunctionPointer): Added this helper.
155         (WebKit::ResourceLoadStatisticsClassifierCocoa::canUseCorePrediction): Replaced
156           dlopen()-based runtime check with a null check.
157
158         * Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.h: Guarded with #if
159           HAVE(CORE_PREDICTION).
160
161         * Platform/spi/Cocoa/CorePredictionSPI.h: Added.
162
163         * UIProcess/WebResourceLoadStatisticsStore.h: Updated guards to include HAVE(CORE_PREDICTION).
164
165         * WebKit2.xcodeproj/project.pbxproj: pdated file references for removal and addition.
166
167 2017-04-11  David Quesada  <david_quesada@apple.com>
168
169         Add SPI for handling geolocation authorization requests
170         https://bugs.webkit.org/show_bug.cgi?id=170362
171         rdar://problem/17508627
172
173         Reviewed by Alex Christensen.
174
175         Add a new WKUIDelegate method for the WKGeolocationProviderIOS to call when a web page
176         requests geolocation access. To support testing this change, make it possible to override
177         the CoreLocation abstraction WKGeolocationProviderIOS uses. There is now a configurable
178         object on the process pool that implements a protocol for providing location updates for
179         web views in the process pool. If the client doesn't provide this object,
180         WKGeolocationProviderIOS falls back to an object that wraps the existing WebKit1
181         WebGeolocationCoreLocationProvider and conforms to the new protocol.
182
183         * Shared/Cocoa/APIObject.mm:
184         (API::Object::newObject):
185         * Shared/WebGeolocationPosition.h:
186         (WebKit::WebGeolocationPosition::create):
187         * UIProcess/API/C/WKGeolocationPosition.cpp:
188         (WKGeolocationPositionCreate_b):
189         * UIProcess/API/Cocoa/WKProcessPool.mm:
190         (-[WKProcessPool _coreLocationProvider]):
191         (-[WKProcessPool _setCoreLocationProvider:]):
192         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
193         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
194         * UIProcess/API/Cocoa/_WKGeolocationCoreLocationProvider.h: Copied from Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.cpp.
195         * UIProcess/API/Cocoa/_WKGeolocationPosition.h: Copied from Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.cpp.
196         * UIProcess/API/Cocoa/_WKGeolocationPosition.mm: Added.
197         (WebKit::if):
198         (-[_WKGeolocationPosition dealloc]):
199         (-[_WKGeolocationPosition _apiObject]):
200         * UIProcess/API/Cocoa/_WKGeolocationPositionInternal.h: Copied from Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.cpp.
201         (WebKit::wrapper):
202         * UIProcess/ios/WKGeolocationProviderIOS.mm:
203         (kit):
204         (-[WKGeolocationProviderIOS initWithProcessPool:]):
205         (-[WKGeolocationProviderIOS geolocationAuthorizationGranted]):
206         (-[WKGeolocationProviderIOS positionChanged:]):
207         (-[WKLegacyCoreLocationProvider setListener:]):
208         (-[WKLegacyCoreLocationProvider requestGeolocationAuthorization]):
209         (-[WKLegacyCoreLocationProvider start]):
210         (-[WKLegacyCoreLocationProvider stop]):
211         (-[WKLegacyCoreLocationProvider setEnableHighAccuracy:]):
212         (-[WKLegacyCoreLocationProvider geolocationAuthorizationGranted]):
213         (-[WKLegacyCoreLocationProvider geolocationAuthorizationDenied]):
214         (-[WKLegacyCoreLocationProvider positionChanged:]):
215         (-[WKLegacyCoreLocationProvider errorOccurred:]):
216         (-[WKLegacyCoreLocationProvider resetGeolocation]):
217         Implement a new class that bridges the currently used WebGeolocationCoreLocationProvider
218         to conform to the _WKGeolocationCoreLocationProvider protocol that WKGeolocationProviderIOS
219         expects.
220         * WebKit2.xcodeproj/project.pbxproj:
221
222 2017-04-11  Eric Carlson  <eric.carlson@apple.com>
223
224         [MediaStream] Set correct audio session category when capturing audio
225         https://bugs.webkit.org/show_bug.cgi?id=170736
226         <rdar://problem/31559405>
227
228         Reviewed by Jer Noble.
229
230         * UIProcess/WebPageProxy.cpp:
231         (WebKit::WebPageProxy::isPlayingMediaDidChange):
232
233 2017-04-11  Youenn Fablet  <youenn@apple.com>
234
235         Activate WebRTC data channel tests for WK1
236         https://bugs.webkit.org/show_bug.cgi?id=170710
237
238         Reviewed by Eric Carlson.
239
240         * WebProcess/Network/webrtc/LibWebRTCProvider.h: Making sure networking is not done in the Web process.
241
242 2017-04-11  Chris Fleizach  <cfleizach@apple.com>
243
244         AX: PDF plugin needs to support PDF-DOM Mode
245         https://bugs.webkit.org/show_bug.cgi?id=170589
246
247         Reviewed by Tim Horton.
248
249         Provide access to DOM objects with PDF document. This mean:
250            1) Support a different set of attributes for WKPDFPluginAccessibilityObject.
251                 WKPDFPluginAccessibilityObject is now a group instead of forwarding attribute calls to the pdf layer.
252            2) Connect the focused UI element to the active annotation if possible.
253            3) Mark the PDF associated nodes with an attribute so they can be identified later so their correct parent can be found.
254
255         * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h:
256         * WebProcess/Plugins/PDF/PDFPlugin.h:
257         * WebProcess/Plugins/PDF/PDFPlugin.mm:
258         (-[WKPDFPluginAccessibilityObject pdfLayerController]):
259         (-[WKPDFPluginAccessibilityObject setPdfLayerController:]):
260         (-[WKPDFPluginAccessibilityObject convertRectToScreenSpace:]):
261         (-[WKPDFPluginAccessibilityObject accessibilityAttributeValue:]):
262         (-[WKPDFPluginAccessibilityObject accessibilityAttributeNames]):
263         (-[WKPDFPluginAccessibilityObject accessibilityActionNames]):
264         (-[WKPDFPluginAccessibilityObject accessibilityParameterizedAttributeNames]):
265         (-[WKPDFPluginAccessibilityObject accessibilityFocusedUIElement]):
266         (-[WKPDFPluginAccessibilityObject accessibilityAssociatedControlForAnnotation:]):
267         (-[WKPDFPluginAccessibilityObject accessibilityHitTest:]):
268         (WebKit::PDFPlugin::convertFromRootViewToPDFView):
269         (WebKit::PDFPlugin::convertFromPDFViewToScreen):
270         (WebKit::PDFPlugin::pluginHandlesContentOffsetForAccessibilityHitTest):
271         (WebKit::PDFPlugin::axObjectCache):
272         (WebKit::PDFPlugin::accessibilityShadowPluginParentForElement):
273         * WebProcess/Plugins/PDF/PDFPluginAnnotation.mm:
274         (WebKit::PDFPluginAnnotation::attach):
275         * WebProcess/Plugins/Plugin.h:
276         (WebKit::Plugin::accessibilityShadowPluginParentForElement):
277         (WebKit::Plugin::pluginHandlesContentOffsetForAccessibilityHitTest):
278         * WebProcess/Plugins/PluginView.cpp:
279         (WebKit::PluginView::accessibilityShadowPluginParentForElement):
280         * WebProcess/Plugins/PluginView.h:
281         * WebProcess/WebPage/WebPage.h:
282         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
283         (-[WKAccessibilityWebPageObject accessibilityHitTest:]):
284
285 2017-04-11  Adrian Perez de Castro  <aperez@igalia.com>
286
287         [GTK] Attach popup menu to web view widget
288         https://bugs.webkit.org/show_bug.cgi?id=145866
289
290         Use gtk_menu_attach_to_widget() to let GTK+ know that popup menus belong to a certain web view.
291         This improves the positioning choices that the toolkit can do, and solves a long-standing issue
292         that caused long popup menus to hang outside of the available display area under Wayland.
293
294         Based on a patch by Jonas Ådahl <jadahl@gmail.com>.
295
296         Reviewed by Carlos Garcia Campos.
297
298         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
299         (WebKit::WebPopupMenuProxyGtk::showPopupMenu):
300
301 2017-04-10  Alex Christensen  <achristensen@webkit.org>
302
303         Revert r215217
304         https://bugs.webkit.org/show_bug.cgi?id=170703
305
306         * Configurations/FeatureDefines.xcconfig:
307
308 2017-04-10  Alex Christensen  <achristensen@webkit.org>
309
310         Continue enabling WebRTC
311         https://bugs.webkit.org/show_bug.cgi?id=170703
312
313         Reviewed by Youenn Fablet.
314
315         * Configurations/FeatureDefines.xcconfig:
316
317 2017-04-10  Alex Christensen  <achristensen@webkit.org>
318
319         REGRESSION(r195479) First main resource load in new WebProcess bypasses content extensions
320         https://bugs.webkit.org/show_bug.cgi?id=170707
321         <rdar://problem/27788755>
322
323         Reviewed by Tim Horton.
324
325         We fix this by sending the UserContentController with the WebPageCreationParameters
326         instead of in a IPC message immediately following creation.  By the time the WebPage
327         receives its second message, it has already started loading the first main resource.
328         
329         I also changed all instances of calling ChildProcessProxy::connection() to send a message
330         in favor of calling ChildProcessProxy::send, which does the same thing except if a child
331         process has not started, it will put the message in a queue and send it when the process
332         is finished launching.  This was necessary because the UserContentController is now connected
333         to the process sooner, so there were some API tests that would try to send messages between
334         initiating a process launch and finishing a process launch, and this change preserves the
335         existing behavior in those cases.
336
337         * Shared/WebPageCreationParameters.cpp:
338         (WebKit::WebPageCreationParameters::encode):
339         (WebKit::WebPageCreationParameters::decode):
340         * Shared/WebPageCreationParameters.h:
341         * UIProcess/Databases/DatabaseProcessProxy.cpp:
342         (WebKit::DatabaseProcessProxy::getDatabaseProcessConnection):
343         (WebKit::DatabaseProcessProxy::didFinishLaunching):
344         * UIProcess/Downloads/DownloadProxy.cpp:
345         (WebKit::DownloadProxy::cancel):
346         (WebKit::DownloadProxy::canAuthenticateAgainstProtectionSpace):
347         (WebKit::DownloadProxy::willSendRequest):
348         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync):
349         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
350         (WebKit::WebUserContentControllerProxy::addProcess):
351         (WebKit::WebUserContentControllerProxy::addUserContentWorldUse):
352         (WebKit::WebUserContentControllerProxy::removeUserContentWorldUses):
353         (WebKit::WebUserContentControllerProxy::addUserScript):
354         (WebKit::WebUserContentControllerProxy::removeUserScript):
355         (WebKit::WebUserContentControllerProxy::removeAllUserScripts):
356         (WebKit::WebUserContentControllerProxy::addUserStyleSheet):
357         (WebKit::WebUserContentControllerProxy::removeUserStyleSheet):
358         (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets):
359         (WebKit::WebUserContentControllerProxy::addUserScriptMessageHandler):
360         (WebKit::WebUserContentControllerProxy::removeUserMessageHandlerForName):
361         (WebKit::WebUserContentControllerProxy::removeAllUserMessageHandlers):
362         (WebKit::WebUserContentControllerProxy::addContentExtension):
363         (WebKit::WebUserContentControllerProxy::removeContentExtension):
364         (WebKit::WebUserContentControllerProxy::removeAllContentExtensions):
365         * UIProcess/UserContent/WebUserContentControllerProxy.h:
366         * UIProcess/VisitedLinkStore.cpp:
367         (WebKit::VisitedLinkStore::removeAll):
368         (WebKit::VisitedLinkStore::pendingVisitedLinksTimerFired):
369         (WebKit::VisitedLinkStore::sendTable):
370         * UIProcess/WebPageProxy.cpp:
371         (WebKit::WebPageProxy::finishInitializingWebPageAfterProcessLaunch):
372         (WebKit::WebPageProxy::creationParameters):
373         * UIProcess/WebProcessProxy.cpp:
374         (WebKit::WebProcessProxy::addWebUserContentControllerProxy):
375         * UIProcess/WebProcessProxy.h:
376         * WebProcess/UserContent/WebUserContentController.h:
377         * WebProcess/WebPage/WebPage.cpp:
378         (WebKit::m_backgroundCPULimit):
379
380 2017-04-10  Alex Christensen  <achristensen@webkit.org>
381
382         Add API to get available content extension identifiers in a WKContentExtensionStore
383         https://bugs.webkit.org/show_bug.cgi?id=170093
384
385         Reviewed by Geoffrey Garen.
386
387         * UIProcess/API/APIContentExtensionStore.cpp:
388         (API::constructedPathPrefix):
389         (API::constructedPathFilter):
390         (API::constructedPath):
391         (API::ContentExtensionStore::getAvailableContentExtensionIdentifiers):
392         * UIProcess/API/APIContentExtensionStore.h:
393         * UIProcess/API/Cocoa/WKContentExtensionStore.h:
394         * UIProcess/API/Cocoa/WKContentExtensionStore.mm:
395         (-[WKContentExtensionStore _compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:releasesArgument:]):
396         (-[WKContentExtensionStore lookUpContentExtensionForIdentifier:completionHandler:]):
397         (-[WKContentExtensionStore getAvailableContentExtensionIdentifiers:]):
398         (-[WKContentExtensionStore removeContentExtensionForIdentifier:completionHandler:]):
399
400 2017-04-10  Jeremy Jones  <jeremyj@apple.com>
401
402         Add CoreAudioCaptureSource.
403         https://bugs.webkit.org/show_bug.cgi?id=170112
404         rdar://problem/30293338
405
406         Reviewed by Tim Horton.
407
408         Add UseAVFoundationAudioCapture preference to switch back from the new default of CoreAudio.
409
410         * Shared/WebPreferencesDefinitions.h:
411         * UIProcess/API/C/WKPreferences.cpp:
412         (WKPreferencesSetUseAVFoundationAudioCapture):
413         (WKPreferencesGetUseAVFoundationAudioCapture):
414         * UIProcess/API/C/WKPreferencesRefPrivate.h:
415         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
416         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
417         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
418         (WebKit::UserMediaPermissionRequestManagerProxy::syncWithWebCorePrefs):
419         * WebProcess/WebPage/WebPage.cpp:
420         (WebKit::WebPage::updatePreferences):
421
422 2017-04-10  Brent Fulgham  <bfulgham@apple.com>
423
424         [WK2][macOS] Block access to Apple Events before launch.
425         https://bugs.webkit.org/show_bug.cgi?id=170626
426         <rdar://problem/16079334>
427
428         Reviewed by Alexey Proskuryakov.
429
430         Clear the environment of the AppleEvent server name before initializing
431         AppKit so we never bother connecting.
432
433         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
434         (main):
435
436 2017-04-10  Adrian Perez de Castro  <aperez@igalia.com>
437
438         [GTK] Misplaced right click menu on web page due to deprecated gtk_menu_popup()
439         https://bugs.webkit.org/show_bug.cgi?id=170553
440
441         Reviewed by Michael Catanzaro.
442
443         Use gtk_menu_popup_at_pointer() and gtk_menu_popup_at_rect() when building with GTK+ 3.22 or
444         newer. This allows the Wayland GTK+ backend to properly position popup menus, and also avoids
445         using functions which were deprecated starting at that GTK+ release.
446
447         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
448         (WebKit::WebContextMenuProxyGtk::show): Use gtk_menu_popup_at_pointer() as there is always a
449         pointer event that can be passed to it.
450         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
451         (WebKit::WebPopupMenuProxyGtk::showPopupMenu): Use gtk_menu_popup_at_rect(), using the coordinates
452         of the control passed as reference rectangle. Some conditional code is needed because with newer
453         GTK+ versions a relative offset instead of an absolute position is needed.
454
455 2017-04-10  Adrian Perez de Castro  <aperez@igalia.com>
456
457         [GTK] Opening a popup menu does not pre-select the active item
458         https://bugs.webkit.org/show_bug.cgi?id=170680
459
460         Reviewed by Michael Catanzaro.
461
462         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
463         (WebKit::WebPopupMenuProxyGtk::showPopupMenu): Use gtk_menu_shell_select_item() to
464         ensure that the active item appears selected right after popping up the menu.
465
466 2017-04-10  Carlos Garcia Campos  <cgarcia@igalia.com>
467
468         [GTK] Enable DOM timer throttling and CSS animations suspension
469         https://bugs.webkit.org/show_bug.cgi?id=170669
470
471         Reviewed by Žan Doberšek.
472
473         * Shared/WebPreferencesDefinitions.h:
474
475 2017-04-10  Chris Dumez  <cdumez@apple.com>
476
477         Drop Timer::startOneShot() overload taking a double
478         https://bugs.webkit.org/show_bug.cgi?id=170659
479
480         Reviewed by Yusuke Suzuki.
481
482         Drop Timer::startOneShot() overload taking a double as people should use Seconds type now.
483
484         * NetworkProcess/PingLoad.h:
485         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
486         (WebKit::NetworkDataTaskSoup::startTimeout):
487         * Platform/IPC/Connection.h:
488         * Platform/IPC/mac/ConnectionMac.mm:
489         (IPC::ConnectionTerminationWatchdog::createConnectionTerminationWatchdog):
490         (IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog):
491         (IPC::Connection::terminateSoon):
492         * PluginProcess/PluginProcess.cpp:
493         (WebKit::PluginProcess::setMinimumLifetime):
494         * PluginProcess/PluginProcess.h:
495         * Shared/ChildProcess.cpp:
496         (WebKit::ChildProcess::ChildProcess):
497         * Shared/ChildProcess.h:
498         (WebKit::ChildProcess::setTerminationTimeout):
499         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
500         (WebKit::CompositingRunLoop::startUpdateTimer):
501         * Shared/Plugins/PluginProcessCreationParameters.h:
502         * Shared/WebMemorySampler.cpp:
503         (WebKit::WebMemorySampler::initializeTimers):
504         * Shared/WebProcessCreationParameters.h:
505         * UIProcess/API/Cocoa/APISerializedScriptValueCocoa.mm:
506         (API::SharedJSContext::ensureContext):
507         * UIProcess/ChildProcessProxy.cpp:
508         (WebKit::ChildProcessProxy::shutDownProcess):
509         * UIProcess/Cocoa/NavigationState.mm:
510         (WebKit::NavigationState::didChangeIsLoading):
511         * UIProcess/Cocoa/ViewGestureController.cpp:
512         (WebKit::ViewGestureController::SnapshotRemovalTracker::startWatchdog):
513         * UIProcess/Cocoa/ViewGestureController.h:
514         * UIProcess/DrawingAreaProxyImpl.cpp:
515         (WebKit::DrawingAreaProxyImpl::discardBackingStoreSoon):
516         (WebKit::DrawingAreaProxyImpl::DrawingMonitor::start):
517         (WebKit::DrawingAreaProxyImpl::DrawingMonitor::didDraw):
518         * UIProcess/Gamepad/UIGamepadProvider.cpp:
519         * UIProcess/Plugins/PluginProcessProxy.cpp:
520         * UIProcess/ProcessThrottler.cpp:
521         * UIProcess/ResponsivenessTimer.cpp:
522         * UIProcess/WebProcessPool.cpp:
523         (WebKit::WebProcessPool::createNewWebProcess):
524         * UIProcess/gtk/GestureController.cpp:
525         (WebKit::GestureController::DragGesture::begin):
526         * UIProcess/mac/WebInspectorProxyMac.mm:
527         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
528         (WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModeNow):
529         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
530         (WebKit::CoordinatedLayerTreeHost::scheduleAnimation):
531         * WebProcess/WebPage/WebPage.cpp:
532         (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
533         * WebProcess/WebProcess.cpp:
534
535 2017-04-09  Wenson Hsieh  <wenson_hsieh@apple.com>
536
537         [WK2] Add infrastructure to perform actions after an asynchronous position information request finishes
538         https://bugs.webkit.org/show_bug.cgi?id=170658
539         <rdar://problem/31431450>
540
541         Reviewed by Tim Horton.
542
543         Introduces doAfterPositionInformationUpdate:forRequest:, which WKContentView can use internally to perform
544         an action requiring InteractionInformationAtPosition asynchronously. See below for additional details.
545
546         New API unit test: DataInteractionTests.UnresponsivePageDoesNotHangUI.
547
548         * UIProcess/ios/WKContentViewInteraction.h:
549         * UIProcess/ios/WKContentViewInteraction.mm:
550         (-[WKContentView _actionForLongPressFromPositionInformation:]):
551         (-[WKContentView _actionForLongPress]):
552         (-[WKContentView doAfterPositionInformationUpdate:forRequest:]):
553
554         If current position information satisfies the request, then perform the given block immediately; otherwise, we
555         save the block and request as a pair in a list of pending position information handlers, and then make a new
556         request to the web process for position information if the currently outgoing request does not already satisfy
557         the given request.
558
559         (-[WKContentView ensurePositionInformationIsUpToDate:]):
560
561         Fire all asynchronous position information handlers that are satisfied by the incoming position information.
562
563         (-[WKContentView requestAsynchronousPositionInformationUpdate:]):
564         (-[WKContentView _currentPositionInformationIsValidForRequest:]):
565         (-[WKContentView _hasValidOutstandingPositionInformationRequest:]):
566
567         Pulled out common logic for managing InteractionInformationRequests into separate helper methods.
568
569         (-[WKContentView _invokeAndRemovePendingHandlersValidForCurrentPositionInformation]):
570         (-[WKContentView gestureRecognizerShouldBegin:]):
571
572         Refactored to use ensurePositionInformationIsUpToDate:. There is no behavior change here, but it makes sure that
573         this particular request will also any valid pending position information handlers.
574
575         (-[WKContentView _positionInformationDidChange:]):
576
577         Fire all asynchronous position information handlers that are satisfied by the incoming position information.
578
579         (-[WKContentView pointIsInDataInteractionContent:]): Deleted.
580
581         We should no longer use this method, since it makes a synchronous request to the web process -- see
582         positionInformationMayStartDataInteraction.
583
584 2017-04-09  Chris Dumez  <cdumez@apple.com>
585
586         Drop Timer::startRepeating() overload taking a double
587         https://bugs.webkit.org/show_bug.cgi?id=170656
588
589         Reviewed by Yusuke Suzuki.
590
591         Drop Timer::startRepeating() overload taking a double as people should use Seconds type now.
592
593         * Shared/WebMemorySampler.cpp:
594         (WebKit::WebMemorySampler::initializeTimers):
595         * UIProcess/Cocoa/ViewGestureController.cpp:
596         * UIProcess/HighPerformanceGraphicsUsageSampler.cpp:
597         * UIProcess/PerActivityStateCPUUsageSampler.cpp:
598         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
599         (WebKit::NetscapePlugin::Timer::start):
600         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
601         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
602         (WebKit::CompositingCoordinator::scheduleReleaseInactiveAtlases):
603
604 2017-04-09  Jon Lee  <jonlee@apple.com>
605
606         [WK2][iOS] Add CoreMedia entitlement for WebProcess
607         https://bugs.webkit.org/show_bug.cgi?id=170623
608         rdar://problem/30020073
609
610         Reviewed by Youenn Fablet.
611
612         * Configurations/WebContent-iOS.entitlements: Update entitlement to an array of strings instead of bool.
613
614 2017-04-09  Chris Dumez  <cdumez@apple.com>
615
616         Start dropping Timer API dealing with double
617         https://bugs.webkit.org/show_bug.cgi?id=170649
618
619         Reviewed by Yusuke Suzuki.
620
621         Start dropping Timer API dealing with double as people should use Seconds now.
622
623         * NetworkProcess/NetworkDataTask.cpp:
624         (WebKit::NetworkDataTask::scheduleFailure):
625         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
626         (WebKit::NetworkDataTaskCocoa::resume):
627         * PluginProcess/PluginControllerProxy.cpp:
628         (WebKit::PluginControllerProxy::destroy):
629         (WebKit::PluginControllerProxy::startPaintTimer):
630         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
631         (webkitWebViewBaseScheduleUpdateActivityState):
632         * UIProcess/DrawingAreaProxy.cpp:
633         (WebKit::DrawingAreaProxy::setViewExposedRect):
634         * UIProcess/DrawingAreaProxyImpl.cpp:
635         (WebKit::DrawingAreaProxyImpl::DrawingMonitor::start):
636         * UIProcess/Plugins/gtk/PluginInfoCache.cpp:
637         (WebKit::PluginInfoCache::updatePluginInfo):
638         * UIProcess/VisitedLinkStore.cpp:
639         (WebKit::VisitedLinkStore::addVisitedLinkHash):
640         * UIProcess/WebProcessPool.cpp:
641         (WebKit::m_hiddenPageThrottlingAutoIncreasesCounter):
642         * UIProcess/gtk/GestureController.cpp:
643         (WebKit::GestureController::ZoomGesture::scaleChanged):
644         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
645         (WebKit::WebPopupMenuProxyGtk::menuUnmappedCallback):
646         * WebProcess/Network/WebLoaderStrategy.cpp:
647         (WebKit::WebLoaderStrategy::scheduleInternallyFailedLoad):
648         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
649         (WebKit::NPRuntimeObjectMap::addToInvalidationQueue):
650         * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
651         (WebKit::NetscapePluginStream::deliverDataToPlugin):
652         * WebProcess/Plugins/PluginView.cpp:
653         (WebKit::PluginView::pendingURLRequestsTimerFired):
654         (WebKit::PluginView::loadURL):
655         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
656         (WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModeSoon):
657         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
658         (WebKit::CoordinatedLayerTreeHost::scheduleLayerFlush):
659         * WebProcess/WebPage/DrawingAreaImpl.cpp:
660         (WebKit::DrawingAreaImpl::scheduleDisplay):
661         * WebProcess/WebPage/WebPage.cpp:
662         (WebKit::WebPage::updateIsInWindow):
663         (WebKit::WebPage::addPluginView):
664         (WebKit::WebPage::setMayStartMediaWhenInWindow):
665         (WebKit::WebPage::didFinishLoad):
666         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
667         (WebKit::TiledCoreAnimationDrawingArea::activityStateDidChange):
668
669 2017-04-08  Chris Dumez  <cdumez@apple.com>
670
671         Drop std::chrono support from Timer class
672         https://bugs.webkit.org/show_bug.cgi?id=170645
673
674         Reviewed by Sam Weinig.
675
676         Drop std::chrono support from Timer class now that we prefer using Seconds type.
677
678         * NetworkProcess/NetworkLoad.cpp:
679         (WebKit::NetworkLoad::Throttle::Throttle):
680         (WebKit::NetworkLoad::didReceiveResponseNetworkSession):
681         * NetworkProcess/NetworkProcess.h:
682         (WebKit::NetworkProcess::loadThrottleLatency):
683         * NetworkProcess/NetworkProcessCreationParameters.cpp:
684         * NetworkProcess/NetworkProcessCreationParameters.h:
685         * NetworkProcess/NetworkResourceLoadParameters.h:
686         * NetworkProcess/NetworkResourceLoader.cpp:
687         (WebKit::NetworkResourceLoader::startNetworkLoad):
688         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
689         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
690         * NetworkProcess/cache/NetworkCacheStorage.cpp:
691         (WebKit::NetworkCache::Storage::dispatchReadOperation):
692         (WebKit::NetworkCache::Storage::store):
693         * Shared/CacheModel.cpp:
694         (WebKit::calculateMemoryCacheSizes):
695         * Shared/CacheModel.h:
696         * Shared/mac/RemoteLayerBackingStoreCollection.mm:
697         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
698         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
699         * WebProcess/Network/WebLoaderStrategy.cpp:
700         (WebKit::maximumBufferingTime):
701         * WebProcess/Plugins/PluginView.cpp:
702         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
703         (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlushImmediately):
704         (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush):
705         * WebProcess/WebProcess.cpp:
706         (WebKit::m_resourceLoadStatisticsStore):
707         (WebKit::WebProcess::setCacheModel):
708
709 2017-04-08  Chris Dumez  <cdumez@apple.com>
710
711         Unreviewed attempt to fix GTK build after r215138.
712
713         * UIProcess/API/gtk/WebKitUIClient.cpp:
714
715 2017-04-08  Youenn Fablet  <youenn@apple.com>
716
717         WebRTC tests gardening
718         https://bugs.webkit.org/show_bug.cgi?id=170508
719
720         Reviewed by Eric Carlson.
721
722         * Configurations/FeatureDefines.xcconfig:
723
724 2017-04-08  Chris Dumez  <cdumez@apple.com>
725
726         Timer's nextFireInterval() / repeatInterval() should return Seconds
727         https://bugs.webkit.org/show_bug.cgi?id=170639
728
729         Reviewed by Simon Fraser.
730
731         Timer's nextFireInterval() / repeatInterval() should return Seconds, not double.
732
733         * WebProcess/WebPage/WebPage.cpp:
734         (WebKit::WebPage::layerVolatilityTimerFired):
735         (WebKit::WebPage::markLayersVolatile):
736
737 2017-04-07  Alex Christensen  <achristensen@webkit.org>
738
739         Modernize WebPage.h
740         https://bugs.webkit.org/show_bug.cgi?id=170633
741
742         Reviewed by Joseph Pecoraro.
743
744         * UIProcess/API/APIUIClient.h:
745         (API::UIClient::createNewPage):
746         * UIProcess/API/C/WKPage.cpp:
747         (WebKit::RunBeforeUnloadConfirmPanelResultListener::create):
748         (WebKit::RunJavaScriptAlertResultListener::create):
749         (WebKit::RunJavaScriptConfirmResultListener::create):
750         (WebKit::RunJavaScriptConfirmResultListener::RunJavaScriptConfirmResultListener):
751         (WebKit::RunJavaScriptPromptResultListener::create):
752         (WebKit::RunJavaScriptPromptResultListener::RunJavaScriptPromptResultListener):
753         (WKPageSetPageUIClient):
754         * UIProcess/Cocoa/UIDelegate.h:
755         * UIProcess/Cocoa/UIDelegate.mm:
756         (WebKit::UIDelegate::UIClient::createNewPage):
757         * WebProcess/WebPage/WebPage.cpp:
758         (WebKit::WebPage::loadDataImpl):
759         (WebKit::WebPage::loadStringImpl):
760         (WebKit::WebPage::loadData):
761         (WebKit::WebPage::scaledSnapshotWithOptions):
762         (WebKit::WebPage::SandboxExtensionTracker::willPerformLoadDragDestinationAction):
763         (WebKit::WebPage::SandboxExtensionTracker::setPendingProvisionalSandboxExtension):
764         * WebProcess/WebPage/WebPage.h:
765
766 2017-04-07  Alex Christensen  <achristensen@webkit.org>
767
768         Use audit_token_t instead of pid_t for checking sandbox of other processes
769         https://bugs.webkit.org/show_bug.cgi?id=170616
770         <rdar://problem/31158189>
771
772         Reviewed by Daniel Bates.
773
774         pid's can be reused, so it's theoretically unsafe to use the pid of another process to check whether it's sandboxed.
775         Use an audit_token_t instead to be more sure that we are not mistakenly checking a new process that has reused the
776         old process's pid. For the current process, though, we have no xpc_connection_t to the process because we are the process.
777
778         * PluginProcess/mac/PluginProcessMac.mm:
779         (WebKit::PluginProcess::initializeSandbox):
780         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
781         (WebKit::XPCServiceInitializerDelegate::isClientSandboxed):
782         * Shared/mac/SandboxUtilities.h:
783         * Shared/mac/SandboxUtilities.mm:
784         (WebKit::currentProcessIsSandboxed):
785         (WebKit::connectedProcessIsSandboxed):
786         (WebKit::processIsSandboxed): Deleted.
787         * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
788         (WebKit::WebProcessProxy::platformIsBeingDebugged):
789         * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
790         (WebKit::PluginInfoStore::shouldUsePlugin):
791         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
792         (WebKit::PluginProcessProxy::platformGetLaunchOptions):
793
794 2017-04-07  Brent Fulgham  <bfulgham@apple.com>
795
796         [WK2][iOS] Add CoreMedia entitlement for WebProcess
797         https://bugs.webkit.org/show_bug.cgi?id=170623
798         <rdar://problem/30020073>
799
800         Reviewed by Youenn Fablet.
801
802         Add new "com.apple.tcc.delegated-services" entitlement to allow CoreMedia
803         to work properly in WebRTC.
804
805         * Configurations/WebContent-iOS.entitlements:
806
807 2017-04-07  Alex Christensen  <achristensen@webkit.org>
808
809         Private browsing sessions should not look in keychain for client certificates
810         https://bugs.webkit.org/show_bug.cgi?id=170618
811         <rdar://problem/18457427>
812
813         Reviewed by Dan Bernstein.
814
815         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
816         (WebKit::configurationForSessionID):
817
818 2017-04-07  Chris Dumez  <cdumez@apple.com>
819
820         We should log how much CPU a background process was using when killing it due to CPU limiting
821         https://bugs.webkit.org/show_bug.cgi?id=170619
822
823         Reviewed by Andreas Kling.
824
825         * WebProcess/cocoa/WebProcessCocoa.mm:
826         (WebKit::WebProcess::updateBackgroundCPUMonitorState):
827
828 2017-04-07  Wenson Hsieh  <wenson_hsieh@apple.com>
829
830         Missing conversion from window to content coordinates when adjusting unobscured content rects for input view
831         https://bugs.webkit.org/show_bug.cgi?id=170603
832
833         Reviewed by Simon Fraser.
834
835         Refactors -[WKContentView _computeUnobscuredContentRectRespectingInputViewBounds:unobscuredContentRect:inputViewBounds:scale:]
836         to convert the input view bounds into content coordinates instead of using the zoom scale to adjust the height of inputViewBounds.
837         Covered by the existing LayoutTest, fixed-element-on-bottom-with-keyboard.html.
838
839         * UIProcess/ios/WKContentView.mm:
840         (-[WKContentView _computeUnobscuredContentRectRespectingInputViewBounds:unobscuredContentRect:inputViewBounds:scale:]):
841
842 2017-04-07  Michael Catanzaro  <mcatanzaro@igalia.com>
843
844         [GTK] Various build errors when plugin support is disabled
845         https://bugs.webkit.org/show_bug.cgi?id=170015
846
847         Reviewed by Carlos Garcia Campos.
848
849         * PluginProcess/unix/PluginControllerProxyUnix.cpp:
850         * UIProcess/API/gtk/WebKitWebsiteData.cpp:
851         (recordContainsSupportedDataTypes):
852         (toWebKitWebsiteDataTypes):
853         * UIProcess/API/gtk/WebKitWebsiteDataManager.cpp:
854         (toWebsiteDataTypes):
855
856 2017-04-07  John Wilander  <wilander@apple.com>
857
858         WebSocket streams should have network usage attributed to correct process
859         https://bugs.webkit.org/show_bug.cgi?id=170322
860         <rdar://problem/26413551>
861
862         Reviewed by Alex Christensen.
863
864         Changes here are due to the added WebCore::SourceApplicationAuditToken parameter
865         in WebCore::SocketStreamHandleImpl::create().
866         WebKit::NetworkSocketStream takes it and passes it on.
867
868         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
869         (WebKit::NetworkConnectionToWebProcess::createSocketStream):
870         * NetworkProcess/NetworkSocketStream.cpp:
871         (WebKit::NetworkSocketStream::create):
872         (WebKit::NetworkSocketStream::NetworkSocketStream):
873         * NetworkProcess/NetworkSocketStream.h:
874
875 2017-04-07  Michael Catanzaro  <mcatanzaro@igalia.com>
876
877         Unreviewed, fix missing return value warning
878
879         * UIProcess/WebProcessProxy.cpp:
880         (WebKit::diagnosticLoggingKeyForSimulatedCrashReason):
881
882 2017-04-07  Carlos Garcia Campos  <cgarcia@igalia.com>
883
884         [GTK] Update the priorities used in glib main loop sources
885         https://bugs.webkit.org/show_bug.cgi?id=170457
886
887         Reviewed by Žan Doberšek.
888
889         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
890         (WebKit::CompositingRunLoop::CompositingRunLoop):
891         * UIProcess/DrawingAreaProxyImpl.cpp:
892         (WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl):
893         (WebKit::DrawingAreaProxyImpl::DrawingMonitor::DrawingMonitor):
894         * UIProcess/gtk/WaylandCompositor.cpp:
895         (WebKit::createWaylandLoopSource):
896         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
897         (WebKit::AcceleratedDrawingArea::AcceleratedDrawingArea):
898         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
899         (WebKit::CompositingCoordinator::CompositingCoordinator):
900         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
901         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
902         (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
903         * WebProcess/WebPage/DrawingAreaImpl.cpp:
904         (WebKit::DrawingAreaImpl::DrawingAreaImpl):
905
906 2017-04-06  Alex Christensen  <achristensen@webkit.org>
907
908         Add WKContentExtensionStore.h and WKContentExtension.h to public WebKit.h
909         https://bugs.webkit.org/show_bug.cgi?id=170533
910
911         Reviewed by Daniel Bates.
912
913         * Shared/API/Cocoa/WebKit.h:
914         In r213696 I added two public headers.  All public headers in WebKit are included with
915         #import <WebKit/WebKit.h>
916
917 2017-04-06  Joseph Pecoraro  <pecoraro@apple.com>
918
919         Web Inspector: Hangs when loading under SpeculativeLoad::shouldCaptureExtraNetworkLoadMetrics
920         https://bugs.webkit.org/show_bug.cgi?id=170575
921
922         Rubber-stamped by Brian Burg.
923
924         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
925         (WebKit::NetworkCache::SpeculativeLoad::shouldCaptureExtraNetworkLoadMetrics): Deleted.
926         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
927         m_networkLoad is a wrapper around `this` as the client, so we would infinite loop here.
928
929 2017-04-06  Commit Queue  <commit-queue@webkit.org>
930
931         Unreviewed, rolling out r214973.
932         https://bugs.webkit.org/show_bug.cgi?id=170578
933
934         Causes issues in Safari (Requested by bradee-oh on #webkit).
935
936         Reverted changeset:
937
938         "Refactor so WebsiteDataStores always have a StorageManager."
939         https://bugs.webkit.org/show_bug.cgi?id=170521
940         http://trac.webkit.org/changeset/214973
941
942 2017-04-06  Ryan Haddad  <ryanhaddad@apple.com>
943
944         Unreviewed, rolling out r215046.
945
946         This change broke internal builds.
947
948         Reverted changeset:
949
950         "WebRTC tests gardening"
951         https://bugs.webkit.org/show_bug.cgi?id=170508
952         http://trac.webkit.org/changeset/215046
953
954 2017-04-06  Joseph Pecoraro  <pecoraro@apple.com>
955
956         Web Inspector: Only Capture Extra Network Load Metrics when there is a Web Inspector Frontend
957         https://bugs.webkit.org/show_bug.cgi?id=170525
958
959         Reviewed by Youenn Fablet.
960
961         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
962         (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
963         Only collect extra metrics if the WebProcess this load is for has enabled
964         collecting extra metrics.
965
966         * WebProcess/Network/WebLoaderStrategy.cpp:
967         (WebKit::WebLoaderStrategy::setCaptureExtraNetworkLoadMetricsEnabled):
968         * WebProcess/Network/WebLoaderStrategy.h:
969         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
970         (WebKit::NetworkConnectionToWebProcess::setCaptureExtraNetworkLoadMetricsEnabled):
971         * NetworkProcess/NetworkConnectionToWebProcess.h:
972         (WebKit::NetworkConnectionToWebProcess::captureExtraNetworkLoadMetricsEnabled):
973         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
974         New bool state toggled through the loader policy.
975
976         * NetworkProcess/NetworkDataTask.cpp:
977         (WebKit::NetworkDataTask::shouldCaptureExtraNetworkLoadMetrics):
978         * NetworkProcess/NetworkDataTask.h:
979         (WebKit::NetworkDataTaskClient::shouldCaptureExtraNetworkLoadMetrics):
980         * NetworkProcess/NetworkLoad.cpp:
981         (WebKit::NetworkLoad::shouldCaptureExtraNetworkLoadMetrics):
982         * NetworkProcess/NetworkLoad.h:
983         * NetworkProcess/NetworkLoadClient.h:
984         (WebKit::NetworkLoadClient::shouldCaptureExtraNetworkLoadMetrics):
985         * NetworkProcess/NetworkResourceLoader.cpp:
986         (WebKit::NetworkResourceLoader::shouldCaptureExtraNetworkLoadMetrics):
987         * NetworkProcess/NetworkResourceLoader.h:
988         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
989         (WebKit::NetworkCache::SpeculativeLoad::shouldCaptureExtraNetworkLoadMetrics):
990         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
991         Default handling for network loads is to not include extra data. Thread
992         client messages back from the NetworkLoads / SpeculativeLoads to check
993         the NetworkConnectionToWebProcess state on whether or not we should collect
994         extra metrics.
995
996 2017-04-06  Joseph Pecoraro  <pecoraro@apple.com>
997
998         Web Inspector: Show all headers in the Request Headers section of the Resource details sidebar
999         https://bugs.webkit.org/show_bug.cgi?id=16531
1000         <rdar://problem/5712895>
1001
1002         Reviewed by Timothy Hatcher.
1003
1004         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1005         (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
1006         Include a complete list of the request headers sent for this load.
1007         There may be headers that WebCore did not know about and developer
1008         tools should be informed of.
1009
1010 2017-04-06  Anders Carlsson  <andersca@apple.com>
1011
1012         OptionSet options need to be powers of two
1013         https://bugs.webkit.org/show_bug.cgi?id=170565
1014
1015         Reviewed by Chris Dumez.
1016
1017         Change Cache::Option to be powers of two.
1018
1019         * NetworkProcess/cache/NetworkCache.h:
1020
1021 2017-04-06  Youenn Fablet  <youenn@apple.com>
1022
1023         WebRTC tests gardening
1024         https://bugs.webkit.org/show_bug.cgi?id=170508
1025
1026         Reviewed by Eric Carlson.
1027
1028         * Configurations/FeatureDefines.xcconfig:
1029
1030 2017-04-06  Antti Koivisto  <antti@apple.com>
1031
1032         Implement testing mode for disk cache
1033         https://bugs.webkit.org/show_bug.cgi?id=170547
1034
1035         Reviewed by Andreas Kling.
1036
1037         Disable read timeouts and cache shrinking in TestRunner to eliminate potential sources of randomness.
1038
1039         Cache directories are deleted by TestRunner so lack of shrinking does not consume the disk.
1040
1041         This is enabled by the existing WKContextUseTestingNetworkSession SPI.
1042
1043         * NetworkProcess/cache/NetworkCache.cpp:
1044         (WebKit::NetworkCache::Cache::initialize):
1045         * NetworkProcess/cache/NetworkCache.h:
1046         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1047         (WebKit::NetworkCache::Storage::open):
1048         (WebKit::NetworkCache::Storage::Storage):
1049         (WebKit::NetworkCache::Storage::dispatchReadOperation):
1050         (WebKit::NetworkCache::Storage::shrinkIfNeeded):
1051         * NetworkProcess/cache/NetworkCacheStorage.h:
1052         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1053         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
1054
1055 2017-04-06  Chris Dumez  <cdumez@apple.com>
1056
1057         [WK2] Add C private API to toggle invisibleAutoplayNotPermitted setting
1058         https://bugs.webkit.org/show_bug.cgi?id=170524
1059         <rdar://problem/31461472>
1060
1061         Reviewed by Eric Carlson.
1062
1063         Add C private API to toggle invisibleAutoplayNotPermitted setting.
1064
1065         * UIProcess/API/C/WKPreferences.cpp:
1066         (WKPreferencesSetInvisibleMediaAutoplayPermitted):
1067         (WKPreferencesGetInvisibleMediaAutoplayPermitted):
1068         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1069
1070 2017-04-06  Adrian Perez de Castro  <aperez@igalia.com>
1071
1072         [GTK] Fix build with MEDIA_CAPTURE enabled
1073         https://bugs.webkit.org/show_bug.cgi?id=170539
1074
1075         Reviewed by Carlos Garcia Campos.
1076
1077         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp:
1078         (webkit_dom_html_input_element_get_capture): Add missing namespace in usage of WebCore::MediaCaptureTypeNone.
1079
1080 2017-04-05  Brent Fulgham  <bfulgham@apple.com>
1081
1082         [WK2][iOS] Remove access to features not present on iOS 
1083         https://bugs.webkit.org/show_bug.cgi?id=170531
1084         <rdar://problem/31352258>
1085
1086         Reviewed by Alexey Proskuryakov.
1087
1088         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1089
1090 2017-04-05  Eric Carlson  <eric.carlson@apple.com>
1091
1092         [MediaStream] Host application should be able to mute and unmute media streams
1093         https://bugs.webkit.org/show_bug.cgi?id=170519
1094         <rdar://problem/31174326>
1095
1096         Reviewed by Youenn Fablet.
1097
1098         * UIProcess/API/C/WKPage.cpp:
1099         (WKPageGetMediaState): Support new media stream state flags.
1100         * UIProcess/API/C/WKPagePrivate.h:
1101         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Ditto.
1102         * UIProcess/Cocoa/UIDelegate.mm: Ditto.
1103
1104 2017-04-05  Brady Eidson  <beidson@apple.com>
1105
1106         Refactor so WebsiteDataStores always have a StorageManager.
1107         https://bugs.webkit.org/show_bug.cgi?id=170521
1108
1109         Reviewed by Geoff Garen.
1110
1111         This basically involves teaching StorageManager how to work without a LocalStorageDatabaseTracker,
1112         since there will never be ephemeral bits on disk to track.
1113         
1114         * UIProcess/Storage/StorageManager.cpp:
1115         (WebKit::StorageManager::StorageArea::openDatabaseAndImportItemsIfNeeded):
1116         (WebKit::StorageManager::createEphemeral):
1117         (WebKit::StorageManager::StorageManager):
1118         (WebKit::StorageManager::getLocalStorageOrigins):
1119         (WebKit::StorageManager::getLocalStorageOriginDetails):
1120         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigin):
1121         (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
1122         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
1123         * UIProcess/Storage/StorageManager.h:
1124         
1125         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1126         (WebKit::WebsiteDataStore::WebsiteDataStore):
1127
1128 2017-04-05  Brent Fulgham  <bfulgham@apple.com>
1129
1130         [WK2][iOS] Add entitlements to enable audio/video capture in WebProcess
1131         https://bugs.webkit.org/show_bug.cgi?id=170507
1132         <rdar://problem/31121248>
1133
1134         Reviewed by Youenn Fablet.
1135
1136         Add two entitlements that are required to access audio/video capture on iOS.
1137
1138         * Configurations/WebContent-iOS.entitlements:
1139
1140 2017-04-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1141
1142         Show a log message when an invalid message is received in non cocoa ports
1143         https://bugs.webkit.org/show_bug.cgi?id=170506
1144
1145         Reviewed by Michael Catanzaro.
1146
1147         We just crash, but without knowing the details about the message it's impossible to debug.
1148
1149         * Shared/ChildProcess.cpp:
1150         (WebKit::ChildProcess::didReceiveInvalidMessage):
1151
1152 2017-04-04  Carlos Garcia Campos  <cgarcia@igalia.com>
1153
1154         Move WebErrors from WebProcess to Shared and get rid of ErrorsGtk in WebCore
1155         https://bugs.webkit.org/show_bug.cgi?id=156974
1156
1157         Reviewed by Sam Weinig.
1158
1159         WebErrors are not only used by the frame loader client in the web process, but also by the network process. So,
1160         move them to Shared make most of the implementation cross-platform.
1161
1162         * CMakeLists.txt: Add new files to compilation.
1163         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1164         (WebKit::NetworkDataTaskSoup::download): Use WebErrors directly instead of platform methods that are no longer needed.
1165         (WebKit::NetworkDataTaskSoup::writeDownloadCallback): Ditto.
1166         (WebKit::NetworkDataTaskSoup::didFinishDownload): Ditto.
1167         (WebKit::NetworkDataTaskSoup::didFail): Ditto.
1168         * PlatformGTK.cmake: Add new files to compilation and remove DownloadSoupErrorsGtk.cpp
1169         * PlatformMac.cmake:
1170         * Shared/API/APIError.cpp: Add error domains used by glib based ports.
1171         (API::Error::webKitNetworkErrorDomain):
1172         (API::Error::webKitPolicyErrorDomain):
1173         (API::Error::webKitPluginErrorDomain):
1174         (API::Error::webKitDownloadErrorDomain):
1175         (API::Error::webKitPrintErrorDomain):
1176         * Shared/API/APIError.h:
1177         * Shared/Cocoa/WebErrorsCocoa.mm: Copied from Source/WebKit2/WebProcess/WebCoreSupport/WebErrors.h.
1178         (WebKit::createNSError):
1179         (WebKit::cancelledError):
1180         (WebKit::fileDoesNotExistError):
1181         * Shared/WebErrors.cpp: Copied from Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebErrorsGtk.cpp.
1182         (WebKit::blockedError):
1183         (WebKit::blockedByContentBlockerError):
1184         (WebKit::cannotShowURLError):
1185         (WebKit::interruptedForPolicyChangeError):
1186         (WebKit::blockedByContentFilterError):
1187         (WebKit::cannotShowMIMETypeError):
1188         (WebKit::pluginWillHandleLoadError):
1189         (WebKit::internalError):
1190         * Shared/WebErrors.h: Renamed from Source/WebKit2/WebProcess/WebCoreSupport/WebErrors.h.
1191         * Shared/glib/WebErrorsGlib.cpp: Renamed from Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebErrorsGtk.cpp.
1192         (WebKit::cancelledError):
1193         (WebKit::fileDoesNotExistError):
1194         * Shared/gtk/WebErrorsGtk.cpp: Copied from Source/WebKit2/NetworkProcess/Downloads/gtk/DownloadSoupErrorsGtk.cpp.
1195         (WebKit::printError):
1196         (WebKit::printerNotFoundError):
1197         (WebKit::invalidPageRangeToPrint):
1198         * Shared/soup/WebErrorsSoup.cpp: Renamed from Source/WebKit2/NetworkProcess/Downloads/gtk/DownloadSoupErrorsGtk.cpp.
1199         (WebKit::downloadNetworkError):
1200         (WebKit::downloadCancelledByUserError):
1201         (WebKit::downloadDestinationError):
1202         * UIProcess/API/gtk/WebKitDownload.cpp:
1203         * UIProcess/API/gtk/WebKitError.cpp:
1204         (webkit_network_error_quark):
1205         (webkit_policy_error_quark):
1206         (webkit_plugin_error_quark):
1207         (webkit_download_error_quark):
1208         (webkit_print_error_quark):
1209         * UIProcess/API/gtk/WebKitPrivate.cpp:
1210         (toWebKitError):
1211         (toWebCoreError):
1212         * WebKit2.xcodeproj/project.pbxproj:
1213         * WebProcess/WebCoreSupport/mac/WebErrorsMac.mm: Removed.
1214         * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
1215
1216 2017-04-04  Youenn Fablet  <youenn@apple.com>
1217
1218         [Mac] Add back web audio support for getUserMedia MediaStreamTrack
1219         https://bugs.webkit.org/show_bug.cgi?id=170482
1220
1221         Reviewed by Eric Carlson.
1222
1223         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
1224         (WebKit::UserMediaCaptureManager::Source::setStorage):
1225
1226 2017-04-04  Tim Horton  <timothy_horton@apple.com>
1227
1228         [Mac] -[WKWebView findMatchesForString:relativeToMatch:findOptions:maxResults:resultCollector:] invokes the resultCollector with didWrap = NO even when it wraps
1229         https://bugs.webkit.org/show_bug.cgi?id=165801
1230         <rdar://problem/29649535>
1231
1232         Reviewed by Wenson Hsieh.
1233
1234         Previously, when doing an incremental find that wrapped, we would 
1235         say that it did not, leading NSTextFinder to not provide its usual
1236         wrapping UI, and other clients of the NSTextFinderClient protocol to
1237         get confused by the lack of wrapping.
1238
1239         * UIProcess/WebPageProxy.cpp:
1240         (WebKit::WebPageProxy::didFindString):
1241         * UIProcess/WebPageProxy.h:
1242         * UIProcess/WebPageProxy.messages.in:
1243         * UIProcess/API/APIFindClient.h:
1244         (API::FindClient::didFindString):
1245         * UIProcess/API/C/WKPage.cpp:
1246         (WKPageSetPageFindClient):
1247         * UIProcess/Cocoa/FindClient.h:
1248         * UIProcess/Cocoa/FindClient.mm:
1249         (WebKit::FindClient::didFindString):
1250         * WebProcess/WebPage/FindController.cpp:
1251         (WebKit::FindController::updateFindUIAfterPageScroll):
1252         (WebKit::FindController::findString):
1253         * WebProcess/WebPage/FindController.h:
1254         Plumb DidWrap from FindController's call to findString back through
1255         the DidFindString message.
1256
1257         * UIProcess/mac/WKTextFinderClient.mm:
1258         (-[WKTextFinderClient didFindStringMatchesWithRects:didWrapAround:]):
1259         (-[WKTextFinderClient didFindStringMatchesWithRects:]): Deleted.
1260         Make use of the new DidWrap information to stop lying to NSTextFinder
1261         about whether a wrap actually occurred.
1262
1263 2017-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>
1264
1265         Data interaction should register type identifiers in order of priority
1266         https://bugs.webkit.org/show_bug.cgi?id=170428
1267         <rdar://problem/30633296>
1268
1269         Reviewed by Tim Horton.
1270
1271         Serialize PasteboardWebContent.dataInAttributedStringFormat when sending over IPC. Refer to WebCore ChangeLog
1272         for more details.
1273
1274         * Shared/WebCoreArgumentCoders.cpp:
1275         (IPC::ArgumentCoder<PasteboardWebContent>::encode):
1276         (IPC::ArgumentCoder<PasteboardWebContent>::decode):
1277         * UIProcess/API/Cocoa/WKWebView.mm:
1278
1279 2017-04-03  Joseph Pecoraro  <pecoraro@apple.com>
1280
1281         Remove no longer needed forward declarations
1282         https://bugs.webkit.org/show_bug.cgi?id=170415
1283
1284         Reviewed by Dan Bernstein.
1285
1286         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1287
1288 2017-04-03  Anders Carlsson  <andersca@apple.com>
1289
1290         Tweak ApplePaySession API
1291         https://bugs.webkit.org/show_bug.cgi?id=170409
1292         rdar://problem/31405459
1293
1294         Reviewed by Tim Horton.
1295
1296         Update for WebCore changes.
1297
1298         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1299         (WebKit::toNSError):
1300
1301 2017-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1302
1303         [SOUP] URI Fragment is lost after redirect
1304         https://bugs.webkit.org/show_bug.cgi?id=170058
1305
1306         Reviewed by Michael Catanzaro.
1307
1308         In case of redirection check if the current request has a fragment identifier and apply it to the redirection
1309         only when it doesn't have a fragment identifier yet.
1310
1311         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1312         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
1313         (WebKit::NetworkDataTaskSoup::createRequest):
1314         (WebKit::NetworkDataTaskSoup::continueHTTPRedirection):
1315         * NetworkProcess/soup/NetworkDataTaskSoup.h:
1316
1317 2017-04-03  Antti Koivisto  <antti@apple.com>
1318
1319         Mutex may be freed too late in NetworkCache::Storage::traverse
1320         https://bugs.webkit.org/show_bug.cgi?id=170400
1321         <rdar://problem/30515865>
1322
1323         Reviewed by Carlos Garcia Campos and Andreas Kling.
1324
1325         Fix a race.
1326
1327         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1328         (WebKit::NetworkCache::Storage::traverse):
1329
1330             Ensure the mutex is not accessed after we dispatch to the main thread.
1331             The main thread call deletes the owning TraverseOperation.
1332
1333 2017-04-01  Dan Bernstein  <mitz@apple.com>
1334
1335         [iOS] <input type=file> label should be specified using plural rules
1336         https://bugs.webkit.org/show_bug.cgi?id=170388
1337
1338         Reviewed by Alexey Proskuryakov.
1339
1340         * UIProcess/ios/forms/WKFileUploadPanel.mm:
1341         (-[WKFileUploadPanel _processMediaInfoDictionaries:atIndex:processedResults:processedImageCount:processedVideoCount:successBlock:failureBlock:]):
1342           Instead of calling -_displayStringForPhotos:videos:, use
1343           +[NSString localizedStringWithFormat:] with the new format string "%lu photo(s) and
1344           %lu video(s)" for which there are plural rules.
1345         (-[WKFileUploadPanel _displayStringForPhotos:videos:]): Deleted.
1346
1347 2017-04-01  Dan Bernstein  <mitz@apple.com>
1348
1349         [Xcode] In engineering builds, linker warns about libwebrtc.dylib’s install name being invalid
1350         https://bugs.webkit.org/show_bug.cgi?id=170385
1351
1352         Reviewed by Tim Horton.
1353
1354         * Configurations/WebKit.xcconfig: When WebKit is relocatable, tell the linker that it’s
1355           not going to be in the shared cache, even if its install name implies that it might be.
1356
1357 2017-03-31  Simon Fraser  <simon.fraser@apple.com>
1358
1359         Remove a logging statement left in by mistake.
1360
1361         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1362         (WebKit::WebFrameLoaderClient::restoreViewState):
1363
1364 2017-03-31  Wenson Hsieh  <wenson_hsieh@apple.com>
1365
1366         Address post-review feedback after r214692
1367         https://bugs.webkit.org/show_bug.cgi?id=170328
1368
1369         Reviewed by Dan Bernstein.
1370
1371         Clearing the selection when UIKit calls into WKContentView to set its selected text range to nil is a rule
1372         that should be applied when using a text interaction assistant, not just when using character granularity
1373         for selecting text.
1374
1375         * UIProcess/ios/WKContentViewInteraction.mm:
1376         (-[WKContentView setSelectedTextRange:]):
1377
1378 2017-03-31  Wenson Hsieh  <wenson_hsieh@apple.com>
1379
1380         [WK2] Tapping away to dismiss the selection does not update the selected DOM range using character granularity
1381         https://bugs.webkit.org/show_bug.cgi?id=170328
1382         <rdar://problem/30904558>
1383
1384         Reviewed by Tim Horton.
1385
1386         When UIKit clears the selection while in text interaction mode, it notifies its document view (i.e., the
1387         WKContentView) by setting its selected text range to nil. When character granularity selection is enabled, use
1388         this as a cue to notify the web process that the selection is being cleared out.
1389
1390         -setSelectedTextRange: is a noop in the general case because the web process acts as the source of truth for what
1391         the selection currently consists of, and notifies the UI process and UIKit via WKTextPosition and WKTextRange.
1392         However, in the case of character granularity selections, tapping away to clear the selection is handled by
1393         UIKit's text gesture recognizer cluster, which then informs the document (via -setSelectedTextRange:) that the
1394         selection should be cleared out.
1395
1396         Adds a new Layout test: editing/selection/character-granularity-selected-range-after-dismissing-selection.html.
1397
1398         * UIProcess/ios/WKContentViewInteraction.mm:
1399         (-[WKContentView setSelectedTextRange:]):
1400
1401 2017-03-31  Wenson Hsieh  <wenson_hsieh@apple.com>
1402
1403         [WK2] Tapping editable text inside of a range selection no longer changes the selection to a caret
1404         https://bugs.webkit.org/show_bug.cgi?id=170327
1405         <rdar://problem/31363816>
1406
1407         Reviewed by Tim Horton.
1408
1409         Currently, we're forcing all text interaction gestures to duck in lieu of data interaction gestures
1410         when we should only be doing so for gestures that begin a loupe. This prevents other gestures, such as
1411         single taps, from changing the selection when they should be allowed to.
1412
1413         Hooks into new UIKit SPI to make this tweak.
1414         Introduces a new LayoutTest: editing/selection/caret-after-tap-in-editable-selection.html.
1415
1416         * UIProcess/ios/WKContentViewInteraction.mm:
1417         (-[WKContentView pointIsInAssistedNode:]):
1418         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
1419
1420 2017-03-31  Tim Horton  <timothy_horton@apple.com>
1421
1422         Mail can get stuck underneath FindController::findStringMatches after searching in a long message
1423         https://bugs.webkit.org/show_bug.cgi?id=170326
1424         <rdar://problem/30330395>
1425
1426         Reviewed by Simon Fraser.
1427
1428         * UIProcess/mac/WKTextFinderClient.mm:
1429         (-[WKTextFinderClient findMatchesForString:relativeToMatch:findOptions:maxResults:resultCollector:]):
1430         Cap the number of find matches at 1000, the same maximum that Safari uses.
1431
1432 2017-03-31  Brady Eidson  <beidson@apple.com>
1433
1434         Clean up the "StorageType" enum.
1435         https://bugs.webkit.org/show_bug.cgi?id=170349
1436
1437         Reviewed by Tim Horton.
1438
1439         * WebProcess/Storage/StorageAreaMap.cpp:
1440         (WebKit::StorageAreaMap::StorageAreaMap):
1441         (WebKit::StorageAreaMap::dispatchStorageEvent):
1442         (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
1443         (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
1444         
1445         * WebProcess/Storage/StorageNamespaceImpl.cpp:
1446         (WebKit::StorageNamespaceImpl::createSessionStorageNamespace):
1447         (WebKit::StorageNamespaceImpl::createLocalStorageNamespace):
1448         (WebKit::StorageNamespaceImpl::createTransientLocalStorageNamespace):
1449
1450 2017-03-31  Tim Horton  <timothy_horton@apple.com>
1451
1452         Remove bundle checks for attachmentElementEnabled
1453         https://bugs.webkit.org/show_bug.cgi?id=170329
1454         <rdar://problem/25135244>
1455
1456         Reviewed by Simon Fraser.
1457
1458         * UIProcess/API/Cocoa/WKWebView.mm:
1459         (-[WKWebView _initializeWithConfiguration:]):
1460         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1461         (-[WKWebViewConfiguration init]):
1462         Remove bundle checks.
1463
1464 2017-03-29  Anders Carlsson  <andersca@apple.com>
1465
1466         Adopt PKCanMakePaymentsWithMerchantIdentifierAndDomainAndSourceApplication
1467         https://bugs.webkit.org/show_bug.cgi?id=170257
1468         rdar://problem/31289764
1469
1470         Reviewed by Beth Dakin.
1471
1472         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1473         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
1474
1475 2017-03-31  Csaba Osztrogonác  <ossy@webkit.org>
1476
1477         Mac cmake buildfix after r214403
1478         https://bugs.webkit.org/show_bug.cgi?id=170346
1479
1480         Unreviewed speculative buildfix.
1481
1482         * UIProcess/API/Cocoa/WKWebView.mm:
1483
1484 2017-03-31  Brady Eidson  <beidson@apple.com>
1485
1486         Remove erroneously committed changes from r214078
1487
1488         Unreviewed.
1489
1490         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1491         (WebKit::WebProcessPool::platformInitializeNetworkProcess): Whoops!
1492
1493 2017-03-31  Carlos Garcia Campos  <cgarcia@igalia.com>
1494
1495         Modern media controls should never be enabled in non cocoa ports
1496         https://bugs.webkit.org/show_bug.cgi?id=170338
1497
1498         Reviewed by Michael Catanzaro.
1499
1500         It's currently enabled, because it uses the default value for all other runtime features, but modern media
1501         controls are not a cross-platform feature. I think this is why media/video-click-dblckick-standalone.html
1502         started to fail in GTK+ port after r214426. I can't reprouduce the failure locally, so I can't confirm it,
1503         though.
1504
1505         * Shared/WebPreferencesDefinitions.h:
1506
1507 2017-03-30  Zan Dobersek  <zdobersek@igalia.com>
1508
1509         Unreviewed GTK+ build fix. List WebCore before JavaScriptCore as the
1510         two WebKit2 dependency libraries to avoid WTF directiories being
1511         listed for inclusion before WebCore directories at compile-time.
1512
1513         * CMakeLists.txt:
1514
1515 2017-03-30  Megan Gardner  <megan_gardner@apple.com>
1516
1517         Allow for extended color in snapshots
1518         https://bugs.webkit.org/show_bug.cgi?id=170314
1519         <rdar://problem/28676092> WKImageCreateCGImage should support WideGamut in WebKit2 on macOS
1520
1521         Reviewed by Simon Fraser.
1522
1523         Piping options through snapshots to allow for wide gamut support.
1524
1525         * Shared/API/c/WKImage.h:
1526         * Shared/API/c/WKSharedAPICast.h:
1527         (WebKit::snapshotOptionsFromImageOptions):
1528         * Shared/ImageOptions.h:
1529         (WebKit::snapshotOptionsToImageOptions):
1530         * Shared/WebImage.cpp:
1531         (WebKit::WebImage::create):
1532
1533 2017-03-30  Sam Weinig  <sam@webkit.org>
1534
1535         Expose the WKView SPI, _prepareForMoveToWindow:withCompletionHandler as WKWebView SPI
1536         <rdar://problem/31350588>
1537         https://bugs.webkit.org/show_bug.cgi?id=170315
1538
1539         Reviewed by Simon Fraser.
1540
1541         * UIProcess/API/Cocoa/WKWebView.mm:
1542         (-[WKWebView _prepareForMoveToWindow:completionHandler:]):
1543         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1544         Copy SPI to WKWebView. Remove 'with' prefix to match conventions.
1545
1546 2017-03-30  Wenson Hsieh  <wenson_hsieh@apple.com>
1547
1548         [WK2] Touches should not cancel when showing a custom action sheet while data interaction is active
1549         https://bugs.webkit.org/show_bug.cgi?id=170291
1550         <rdar://problem/31301388>
1551
1552         Reviewed by Tim Horton.
1553
1554         Currently, when presenting a custom popover, we will cancel all touches in the application. This makes data
1555         interaction when a custom popover is shown impossible -- to address this, we should only cancel touches when
1556         the view is not an active data interaction source.
1557
1558         New API test: DataInteractionTests.CustomActionSheetPopover.
1559
1560         * UIProcess/ios/WKContentViewInteraction.mm:
1561         (-[WKContentView actionSheetAssistant:showCustomSheetForElement:]):
1562
1563 2017-03-30  Youenn Fablet  <youenn@apple.com>
1564
1565         NetworkConnectionToWebProcess should stop web sockets when being destroyed
1566         https://bugs.webkit.org/show_bug.cgi?id=170286
1567
1568         Reviewed by Brady Eidson.
1569
1570         * NetworkProcess/NetworkSocketStream.cpp:
1571         (WebKit::NetworkSocketStream::~NetworkSocketStream): Stopping the socket handle if not done already.
1572         * NetworkProcess/NetworkSocketStream.h:
1573
1574 2017-03-29  Tim Horton  <timothy_horton@apple.com>
1575
1576         Remove unused PageClient::removeNavigationGestureSnapshot
1577         https://bugs.webkit.org/show_bug.cgi?id=170249
1578
1579         Reviewed by Beth Dakin.
1580
1581         * UIProcess/PageClient.h:
1582         * UIProcess/WebPageProxy.cpp:
1583         (WebKit::WebPageProxy::removeNavigationGestureSnapshot): Deleted.
1584         * UIProcess/WebPageProxy.h:
1585         * UIProcess/mac/PageClientImpl.h:
1586         * UIProcess/mac/PageClientImpl.mm:
1587         (WebKit::PageClientImpl::removeNavigationGestureSnapshot): Deleted.
1588
1589 2017-03-29  Antti Koivisto  <antti@apple.com>
1590
1591         Increment the last stable network cache version on Mac
1592         https://bugs.webkit.org/show_bug.cgi?id=170248
1593         <rdar://problem/31326040>
1594
1595         Reviewed by Chris Dumez.
1596
1597         Bump to the latest release.
1598
1599         * NetworkProcess/cache/NetworkCacheStorage.h:
1600
1601 2017-03-28  Timothy Horton  <timothy_horton@apple.com>
1602
1603         Stop overriding scroll view inset defaults
1604         https://bugs.webkit.org/show_bug.cgi?id=170221
1605         <rdar://problem/31260325>
1606
1607         Reviewed by Simon Fraser.
1608
1609         * Platform/spi/ios/UIKitSPI.h:
1610         * UIProcess/API/Cocoa/WKWebView.mm:
1611         (-[WKWebView _initializeWithConfiguration:]):
1612         The default behavior is sufficient for us.
1613
1614 2017-03-28  Timothy Horton  <timothy_horton@apple.com>
1615
1616         Safari crashes when attempting to close tab that is displaying PDF
1617         https://bugs.webkit.org/show_bug.cgi?id=170201
1618         <rdar://problem/31242019>
1619
1620         Reviewed by Wenson Hsieh.
1621
1622         * UIProcess/API/Cocoa/WKWebView.mm:
1623         (-[WKWebView _doAfterNextStablePresentationUpdate:]):
1624         Adopt BlockPtr to fix a leak.
1625
1626         (-[WKWebView _firePresentationUpdateForPendingStableStatePresentationCallbacks]):
1627         dispatch_async in the doAfterNextPresentationUpdate callback; since this
1628         recursively calls itself, in cases where doAfterNextPresentationUpdate
1629         returns synchronously (e.g. if the Web Process is missing), we would
1630         recurse infinitely.
1631
1632 2017-03-27  Youenn Fablet  <youenn@apple.com>
1633
1634         Remove WebPage::m_shouldDoICECandidateFiltering
1635         https://bugs.webkit.org/show_bug.cgi?id=170150
1636
1637         Reviewed by Sam Weinig.
1638
1639         It is redundant with RTCController::m_shouldFilterICECandidates.
1640         Manually tested on webrtc test samples.
1641         This code path is currently untested by rwt as we hook it to getUserMedia which is mocked in rwt.
1642         Additional testing will be added as a follow-up patch.
1643
1644         * WebProcess/WebPage/WebPage.cpp:
1645         (WebKit::WebPage::disableICECandidateFiltering):
1646         (WebKit::WebPage::enableICECandidateFiltering):
1647         * WebProcess/WebPage/WebPage.h:
1648
1649 2017-03-27  Wenson Hsieh  <wenson_hsieh@apple.com>
1650
1651         [WK2] UIKit assertion when rotating device after dismissing popover
1652         https://bugs.webkit.org/show_bug.cgi?id=170159
1653         <rdar://problem/31283829>
1654
1655         Reviewed by Tim Horton.
1656
1657         Ensure that when we are finished presenting a WKActionSheet, we unregister with the shared notifications center.
1658
1659         * UIProcess/ios/WKActionSheet.mm:
1660         (-[WKActionSheet dealloc]):
1661         (-[WKActionSheet _cleanup]):
1662         (-[WKActionSheet doneWithSheet:]):
1663
1664 2017-03-27  Andy Estes  <aestes@apple.com>
1665
1666         [iOS] Suppress page count recalc when setting a snapshot paper rect
1667         https://bugs.webkit.org/show_bug.cgi?id=170156
1668         <rdar://problem/30787872>
1669
1670         Reviewed by Tim Horton.
1671
1672         When _WKWebViewPrintFormatter computes a page count for snapshotting, it updates the paper
1673         rect, which triggers UIKit to ask for the page count again while we're in the middle of
1674         printing, putting us in a bad state.
1675
1676         Suppress page count recalc while setting the new paper rect, since we know this will not
1677         cause it to change.
1678
1679         * UIProcess/_WKWebViewPrintFormatter.mm:
1680         (-[_WKWebViewPrintFormatter _setSnapshotPaperRect:]): Temporarily set
1681         _suppressPageCountRecalc to YES before updating the paper rect.
1682         (-[_WKWebViewPrintFormatter _setNeedsRecalc]): Only call [super _setNeedsRecalc] if
1683         _suppressPageCountRecalc is NO.
1684         * UIProcess/_WKWebViewPrintFormatterInternal.h: Declared -_setNeedsRecalc.
1685
1686 2017-03-26  Wenson Hsieh  <wenson_hsieh@apple.com>
1687
1688         [WK2] Callout Bar should be dismissed during data interaction
1689         https://bugs.webkit.org/show_bug.cgi?id=170109
1690         <rdar://problem/31171570>
1691
1692         Reviewed by Tim Horton.
1693
1694         Minor tweak to get the callout bar to duck during data interaction. Import a new UIKit SPI header in WebKit2.
1695
1696         * Platform/spi/ios/UIKitSPI.h:
1697
1698 2017-03-27  Keith Rollin  <krollin@apple.com>
1699
1700         Update NetworkResourceLoader logging statement
1701         https://bugs.webkit.org/show_bug.cgi?id=170126
1702
1703         Reviewed by Alex Christensen.
1704
1705         NetworkResourceLoader contains a logging statement that prints, in
1706         part: "start: Retrieving resource from cache". This is misleading,
1707         since it's not necessarily the case that the resource will be loaded
1708         from the cache. What is actually happening at the point where that is
1709         logged is that the cache is being checked for the resource. It still
1710         remains to be seen if the resource will be found in it. To address
1711         this, change the logging to say "start: Checking cache for resource".
1712
1713         * NetworkProcess/NetworkResourceLoader.cpp:
1714         (WebKit::NetworkResourceLoader::start):
1715
1716 2017-03-27  Joseph Pecoraro  <pecoraro@apple.com>
1717
1718         Web Inspector: Saving files should not suggest the top level directory
1719         https://bugs.webkit.org/show_bug.cgi?id=170085
1720         <rdar://problem/30197794>
1721
1722         Reviewed by Matt Baker.
1723
1724         * UIProcess/mac/RemoteWebInspectorProxyMac.mm:
1725         (WebKit::RemoteWebInspectorProxy::platformSave):
1726         * UIProcess/mac/WebInspectorProxyMac.mm:
1727         (WebKit::WebInspectorProxy::platformSave):
1728         Don't set panel.directoryURL unless we have a good suggestion.
1729
1730 2017-03-27  Yongjun Zhang  <yongjun_zhang@apple.com>
1731
1732         Add delegate method to let an WebKit client provide a custom image preview controller.
1733         https://bugs.webkit.org/show_bug.cgi?id=170076
1734         rdar://problem/31153051
1735
1736         Add a new delegate method (_webView:previewViewControllerForImage:alternateURL:defaultActions:elementInfo:) to
1737         WKUIDelegatePrivate, an client can use this method to provide a custom image preview view controller if the image
1738         has alternated URL or custom image info.
1739
1740         Reviewed by Beth Dakin.
1741
1742         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Add delegate method _webView:previewViewControllerForImage:alternateURL:defaultActions:elementInfo:.
1743         * UIProcess/ios/WKContentViewInteraction.mm:
1744         (-[WKContentView _presentedViewControllerForPreviewItemController:]): If the image has alternated URL or custom info, try to use the client-provided
1745             preview view controller. Otherwise, use the default WKImagePreviewViewController.
1746
1747 2017-03-27  Anders Carlsson  <andersca@apple.com>
1748
1749         Fix uses of deprecated API
1750         https://bugs.webkit.org/show_bug.cgi?id=170138
1751         rdar://problem/28882449
1752
1753         Reviewed by Tim Horton.
1754
1755         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1756         (WebKit::toPKContactFields):
1757         (WebKit::toPKAddressField):
1758         (WebKit::toPKPaymentRequest):
1759         Don't use deprecated APIs.
1760
1761         (WebKit::toNSError):
1762         Don't try to insert nil in a dictionary.
1763
1764 2017-03-27  Alex Christensen  <achristensen@webkit.org>
1765
1766         Make WebSockets work in network process
1767         https://bugs.webkit.org/show_bug.cgi?id=169930
1768
1769         Reviewed by Youenn Fablet.
1770
1771         This adds WebSocketStream, which is a SocketStreamHandle that sends asynchronous 
1772         messages to a NetworkSocketStream in the NetworkProcess.  WebKit1 uses a SocketStreamHandleImpl
1773         still, but WebKit2 now has a SocketStreamHandleImpl in the NetworkProcess owned by the 
1774         NetworkSocketStream, which is a SocketStreamHandleClient that sends asynchronous messages back
1775         to the WebProcess.  WebSocketStream's implementation of SocketStreamHandle::platformSend is special
1776         because it stores the completion handler in a map and asynchronously reports to the caller whether
1777         it succeeded or not.  If the network processes crashes before the completion handlers are called,
1778         then they are called indicating failure and an error is reported, but that never happens, right?
1779
1780         * CMakeLists.txt:
1781         * DerivedSources.make:
1782         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1783         (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
1784         (WebKit::NetworkConnectionToWebProcess::createSocketStream):
1785         (WebKit::NetworkConnectionToWebProcess::destroySocketStream):
1786         * NetworkProcess/NetworkConnectionToWebProcess.h:
1787         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1788         * NetworkProcess/NetworkProcess.cpp:
1789         (WebKit::NetworkProcess::setAllowsAnySSLCertificateForWebSocket):
1790         * NetworkProcess/NetworkProcess.h:
1791         * NetworkProcess/NetworkProcess.messages.in:
1792         * NetworkProcess/NetworkSocketStream.cpp: Added.
1793         (WebKit::NetworkSocketStream::create):
1794         (WebKit::NetworkSocketStream::NetworkSocketStream):
1795         (WebKit::NetworkSocketStream::sendData):
1796         (WebKit::NetworkSocketStream::close):
1797         (WebKit::NetworkSocketStream::didOpenSocketStream):
1798         (WebKit::NetworkSocketStream::didCloseSocketStream):
1799         (WebKit::NetworkSocketStream::didReceiveSocketStreamData):
1800         (WebKit::NetworkSocketStream::didFailToReceiveSocketStreamData):
1801         (WebKit::NetworkSocketStream::didUpdateBufferedAmount):
1802         (WebKit::NetworkSocketStream::didFailSocketStream):
1803         (WebKit::NetworkSocketStream::messageSenderConnection):
1804         (WebKit::NetworkSocketStream::messageSenderDestinationID):
1805         * NetworkProcess/NetworkSocketStream.h: Added.
1806         * NetworkProcess/NetworkSocketStream.messages.in: Added.
1807         * UIProcess/API/C/WKContext.cpp:
1808         (WKContextSetAllowsAnySSLCertificateForWebSocketTesting):
1809         (WKContextTerminateNetworkProcess):
1810         * UIProcess/API/C/WKContextPrivate.h:
1811         * UIProcess/WebProcessPool.cpp:
1812         (WebKit::WebProcessPool::sendSyncToNetworkingProcess):
1813         (WebKit::WebProcessPool::setAllowsAnySSLCertificateForWebSocket):
1814         (WebKit::WebProcessPool::terminateNetworkProcess):
1815         * UIProcess/WebProcessPool.h:
1816         * WebKit2.xcodeproj/project.pbxproj:
1817         * WebProcess/Network/NetworkProcessConnection.cpp:
1818         (WebKit::NetworkProcessConnection::didReceiveMessage):
1819         * WebProcess/Network/WebSocketProvider.cpp:
1820         (WebKit::WebSocketProvider::createSocketStreamHandle):
1821         * WebProcess/Network/WebSocketStream.cpp: Added.
1822         (WebKit::globalWebSocketStreamMap):
1823         (WebKit::WebSocketStream::streamWithIdentifier):
1824         (WebKit::WebSocketStream::networkProcessCrashed):
1825         (WebKit::WebSocketStream::create):
1826         (WebKit::WebSocketStream::WebSocketStream):
1827         (WebKit::WebSocketStream::~WebSocketStream):
1828         (WebKit::WebSocketStream::messageSenderConnection):
1829         (WebKit::WebSocketStream::messageSenderDestinationID):
1830         (WebKit::WebSocketStream::platformSend):
1831         (WebKit::WebSocketStream::didSendData):
1832         (WebKit::WebSocketStream::platformClose):
1833         (WebKit::WebSocketStream::bufferedAmount):
1834         (WebKit::WebSocketStream::didOpenSocketStream):
1835         (WebKit::WebSocketStream::didCloseSocketStream):
1836         (WebKit::WebSocketStream::didReceiveSocketStreamData):
1837         (WebKit::WebSocketStream::didFailToReceiveSocketStreamData):
1838         (WebKit::WebSocketStream::didUpdateBufferedAmount):
1839         (WebKit::WebSocketStream::didFailSocketStream):
1840         * WebProcess/Network/WebSocketStream.h: Added.
1841         * WebProcess/Network/WebSocketStream.messages.in: Added.
1842         * WebProcess/WebProcess.cpp:
1843         (WebKit::WebProcess::networkProcessConnectionClosed):
1844
1845 2017-03-27  Adrian Perez de Castro  <aperez@igalia.com>
1846
1847         [GTK] NetscapePluginX11::m_windowID is unused/unneeded
1848         https://bugs.webkit.org/show_bug.cgi?id=170115
1849
1850         Reviewed by Michael Catanzaro.
1851
1852         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
1853         (WebKit::NetscapePluginX11::NetscapePluginX11):
1854         Remove the unneeded NetscapePluginX11::m_windowID member.
1855         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.h:
1856         Remove the unneeded NetscapePluginX11::m_windowID member.
1857
1858 2017-03-25  Andy Estes  <aestes@apple.com>
1859
1860         [iOS] Use snapshotting instead of printing to draw single-page PDFs
1861         https://bugs.webkit.org/show_bug.cgi?id=170103
1862         <rdar://problem/30542960>
1863
1864         Reviewed by Tim Horton.
1865
1866         * WebProcess/WebPage/WebPage.cpp:
1867         (WebKit::paintSnapshotAtSize): Moved the painting logic from WebPage::snapshotAtSize() to here.
1868         (WebKit::WebPage::snapshotAtSize): Changed to call paintSnapshotAtSize() with the
1869         WebImage's graphics context.
1870         (WebKit::WebPage::pdfSnapshotAtSize): Created a CGPDFGraphicsContext, passed it to
1871         paintSnapshotAtSize(), and returned the context's data.
1872         * WebProcess/WebPage/WebPage.h: Made snapshotAtSize() and snapshotNode() private, changed
1873         their return values from PassRefPtr to RefPtr, and declared pdfSnapshotAtSize().
1874         * WebProcess/WebPage/ios/WebPageIOS.mm:
1875         (WebKit::WebPage::computePagesForPrintingAndDrawToPDF): If snapshotting the first page,
1876         returned a page count of 1 and created a PDF using pdfSnapshotAtSize().
1877
1878 2017-03-25  John Wilander  <wilander@apple.com>
1879
1880         Re-enable the web process' keychain access to fix client certificate authentication
1881         https://bugs.webkit.org/show_bug.cgi?id=170074
1882         <rdar://problem/31095987>
1883
1884         Reviewed by Brent Fulgham.
1885
1886         This is a follow-up patch to
1887         https://trac.webkit.org/changeset/214389/webkit
1888         since according to Alexey Proskuryakov, resource
1889         loading has always required identical sandbox
1890         rules in WebContent and Networking processes.
1891
1892         * WebProcess/com.apple.WebProcess.sb.in:
1893             Reverted remaining change from
1894             https://trac.webkit.org/changeset/208702/webkit and
1895             https://trac.webkit.org/changeset/208707/webkit.
1896
1897 2017-03-24  Wenson Hsieh  <wenson_hsieh@apple.com>
1898
1899         [WK2] Add a UI delegate SPI hook to enable or disable navigation on drop
1900         https://bugs.webkit.org/show_bug.cgi?id=169168
1901         <rdar://problem/30688374>
1902
1903         Reviewed by Tim Horton.
1904
1905         Support customizing the set of allowed actions on drop in WebKit2 by introducing a new method to WKUIDelegatePrivate
1906         that returns a WKDragDestinationAction given platform dragging info. These flags are then used to initialize the
1907         DragData sent over to the web process, where they update DragController's view of the allowed destination actions.
1908
1909         Moving forward, the default action mask for WKWebViews will include everything except WKDragDestinationActionLoad,
1910         though for applciations linked on or before 10.12, we will still default to WKDragDestinationActionAny to mitigate
1911         any compatibility risk.
1912
1913         * Shared/API/Cocoa/WKDragDestinationAction.h:
1914
1915         Introduce WK2 client-facing versions of WebCore::DragDestinationAction flags.
1916
1917         * Shared/WebCoreArgumentCoders.cpp:
1918         (IPC::ArgumentCoder<DragData>::encode):
1919         (IPC::ArgumentCoder<DragData>::decode):
1920
1921         Serialize DragData's destination actions when sending DragData over IPC.
1922
1923         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1924         * UIProcess/API/Cocoa/WKWebView.mm:
1925         (-[WKWebView _web_dragDestinationActionForDraggingInfo:]):
1926
1927         For WKWebView, allow all drag destination actions except for loading (i.e. drop-to-navigate).
1928
1929         * UIProcess/API/mac/WKView.mm:
1930         (-[WKView _web_dragDestinationActionForDraggingInfo:]):
1931
1932         For WKView, allow all types of drag destination actions.
1933
1934         * UIProcess/Cocoa/VersionChecks.h:
1935         * UIProcess/Cocoa/WebViewImpl.h:
1936         * UIProcess/Cocoa/WebViewImpl.mm:
1937         (WebKit::WebViewImpl::draggingEntered):
1938         (WebKit::WebViewImpl::draggingUpdated):
1939         * WebKit2.xcodeproj/project.pbxproj:
1940         * WebProcess/WebCoreSupport/WebDragClient.cpp:
1941         (WebKit::WebDragClient::actionMaskForDrag):
1942         * WebProcess/WebCoreSupport/WebDragClient.h:
1943
1944 2017-03-24  Simon Fraser  <simon.fraser@apple.com>
1945
1946         [iOS WK2] Move from a pre-commit handler to dispatch_async for visible content rect updates
1947         https://bugs.webkit.org/show_bug.cgi?id=170091
1948         rdar://problem/30682584
1949
1950         Reviewed by Tim Horton.
1951         
1952         [CATransaction addCommitHandler:forPhase:] is sometimes not called when running inside another
1953         commit callback (rdar://problem/31253952), and we don't yet have a reliable way to detect this.
1954
1955         So dispatch_async() to postpone the call to [CATransaction addCommitHandler:forPhase:] to a known-
1956         good time.
1957
1958         * UIProcess/API/Cocoa/WKWebView.mm:
1959         (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]):
1960
1961 2017-03-24  John Wilander  <wilander@apple.com>
1962
1963         Re-enable the network process' keychain access to fix client certificate authentication
1964         https://bugs.webkit.org/show_bug.cgi?id=170074
1965         <rdar://problem/31095987>
1966
1967         Reviewed by Brent Fulgham.
1968
1969         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
1970             Reverted remaining change from
1971             https://trac.webkit.org/changeset/208702/webkit and
1972             https://trac.webkit.org/changeset/208707/webkit.
1973
1974 2017-03-24  Eric Carlson  <eric.carlson@apple.com>
1975
1976         [MediaStream] "ideal" constraints passed to getUserMedia should affect fitness score
1977         https://bugs.webkit.org/show_bug.cgi?id=170056
1978
1979         Reviewed by Youenn Fablet.
1980
1981         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1982         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): When
1983         short-circuiting the user prompt because the page is already authorized, return the first
1984         audio and/or video device because so the page gets the one with the best fitness distance.
1985
1986 2017-03-24  Simon Fraser  <simon.fraser@apple.com>
1987
1988         Make UI-side compositing on macOS a bit more usable
1989         https://bugs.webkit.org/show_bug.cgi?id=170073
1990
1991         Reviewed by Tim Horton.
1992         
1993         Mach port as layer contents doesn't work on macOS, so don't use it there.
1994
1995         Also remove two assertions that hit with UI-side compositing in MiniBrowser.
1996
1997         * UIProcess/DrawingAreaProxy.cpp:
1998         (WebKit::DrawingAreaProxy::createFence):
1999         * UIProcess/mac/PageClientImpl.mm:
2000         (WebKit::PageClientImpl::requestScroll):
2001         * UIProcess/mac/RemoteLayerTreeHost.mm:
2002         (WebKit::RemoteLayerTreeHost::updateLayerTree):
2003
2004 2017-03-24  Alex Christensen  <achristensen@webkit.org>
2005
2006         Fix assertions after r214358.
2007         https://bugs.webkit.org/show_bug.cgi?id=169167
2008
2009         * UIProcess/API/APIContentExtensionStore.cpp:
2010         (API::ContentExtensionStore::compileContentExtension):
2011         AtomicString::init must be called for the first time from the main thread.
2012         We were calling it for the first time from a non-main thread sometimes.
2013         Call it from the main thread before initiating compiling on another thread.
2014
2015 == Rolled over to ChangeLog-2017-03-23 ==