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