fdc589f0acb6bd0c3f24b81938a32e7e7dbb7478
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2017-05-18  Andy Estes  <aestes@apple.com>
2
3         Add "countryCode" to ApplePayErrorContactField
4         https://bugs.webkit.org/show_bug.cgi?id=172264
5         <rdar://problem/32004909>
6
7         Reviewed by Anders Carlsson.
8
9         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
10         (WebKit::toNSError):
11
12 2017-05-18  Commit Queue  <commit-queue@webkit.org>
13
14         Unreviewed, rolling out r217031, r217032, and r217037.
15         https://bugs.webkit.org/show_bug.cgi?id=172293
16
17         cause linking errors in Windows (Requested by yusukesuzuki on
18         #webkit).
19
20         Reverted changesets:
21
22         "[JSC][DFG][DOMJIT] Extend CheckDOM to CheckSubClass"
23         https://bugs.webkit.org/show_bug.cgi?id=172098
24         http://trac.webkit.org/changeset/217031
25
26         "Unreviewed, rebaseline for newly added ClassInfo"
27         https://bugs.webkit.org/show_bug.cgi?id=172098
28         http://trac.webkit.org/changeset/217032
29
30         "Unreviewed, fix debug and non-JIT build"
31         https://bugs.webkit.org/show_bug.cgi?id=172098
32         http://trac.webkit.org/changeset/217037
33
34 2017-05-18  Claudio Saavedra  <csaavedra@igalia.com>
35
36         [WPE] Unreviewed build fix
37
38         Add missing header after r217041.
39         * UIProcess/API/wpe/WPEView.cpp:
40
41 2017-05-18  Tim Horton  <timothy_horton@apple.com>
42
43         More WebKit2 header cleanup
44         https://bugs.webkit.org/show_bug.cgi?id=172214
45
46         Reviewed by Simon Fraser.
47
48         * Shared/WebFindOptions.h:
49         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
50         * UIProcess/Cocoa/WebViewImpl.mm:
51         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
52         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
53         * UIProcess/UserMediaPermissionRequestProxy.h:
54         * UIProcess/WebPageProxy.cpp:
55         (WebKit::WebPageProxy::setCompositionAsync):
56         * UIProcess/WebPageProxy.h:
57         * UIProcess/mac/PageClientImpl.mm:
58         * UIProcess/mac/ViewGestureControllerMac.mm:
59         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
60         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
61         * WebProcess/InjectedBundle/API/c/WKBundlePageEditorClient.h:
62         * WebProcess/InjectedBundle/API/c/WKBundlePageFullScreenClient.h:
63         * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.h:
64         * WebProcess/InjectedBundle/InjectedBundlePageFullScreenClient.h:
65         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
66         * WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.h:
67         * WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.h:
68         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
69         * WebProcess/Notifications/WebNotificationManager.cpp:
70         * WebProcess/Plugins/PDF/PDFPlugin.mm:
71         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
72         * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp:
73         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
74         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
75         * WebProcess/WebCoreSupport/WebGeolocationClient.cpp:
76         * WebProcess/WebCoreSupport/WebSearchPopupMenu.cpp:
77         * WebProcess/WebCoreSupport/WebValidationMessageClient.cpp:
78         * WebProcess/WebPage/WebPage.cpp:
79         (WebKit::WebPage::WebPage):
80         (WebKit::WebPage::setDeviceScaleFactor):
81         (WebKit::WebPage::centerSelectionInVisibleArea):
82         (WebKit::WebPage::findString):
83         (WebKit::WebPage::findStringMatches):
84         (WebKit::WebPage::getImageForFindMatch):
85         (WebKit::WebPage::selectFindMatch):
86         (WebKit::WebPage::hideFindUI):
87         (WebKit::WebPage::countStringMatches):
88         (WebKit::WebPage::didReceiveGeolocationPermissionDecision):
89         (WebKit::WebPage::mainFrameDidLayout):
90         (WebKit::WebPage::setCompositionAsync):
91         * WebProcess/WebPage/WebPage.h:
92         (WebKit::WebPage::findController):
93         (WebKit::WebPage::geolocationPermissionRequestManager):
94         * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp:
95         Many small changes added up to a few percent. Removing UserMediaRequest
96         from UserMediaPermissionRequestProxy, which is included into WebPageProxy.h,
97         was worth another ~10% because it got VM.h out of WebPageProxy.h (like the
98         previous patch did with WebPage.h). In total, in my measurement (WebKit2
99         clean debug build) this is a ~15% speedup.
100
101         We really should figure out how to make DOMPromise.h not bring in all of
102         JavaScriptCore (or how to use promises without including DOMPromise.h in headers).
103
104 2017-05-17  Chris Dumez  <cdumez@apple.com>
105
106         Fix unsafe lambda capture in ContentRuleListStore::lookupContentRuleList()
107         https://bugs.webkit.org/show_bug.cgi?id=172258
108
109         Reviewed by Brady Eidson.
110
111         Fix unsafe lambda capture in ContentRuleListStore::lookupContentRuleList(). The String
112         was moved instead of calling isolatedCopy(), even though we're passing the String to
113         another thread.
114
115         * UIProcess/API/APIContentRuleListStore.cpp:
116         (API::ContentRuleListStore::lookupContentRuleList):
117
118 2017-05-16  Yusuke Suzuki  <utatane.tea@gmail.com>
119
120         [JSC][DFG][DOMJIT] Extend CheckDOM to CheckSubClass
121         https://bugs.webkit.org/show_bug.cgi?id=172098
122
123         Reviewed by Saam Barati.
124
125         * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
126         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
127
128 2017-05-17  Ryan Haddad  <ryanhaddad@apple.com>
129
130         Unreviewed, rolling out r217014.
131
132         This change caused mac-wk2 LayoutTests to exit early due to
133         crashes.
134
135         Reverted changeset:
136
137         "Resource Load Statistics: Grandfather domains for existing
138         data records"
139         https://bugs.webkit.org/show_bug.cgi?id=172155
140         http://trac.webkit.org/changeset/217014
141
142 2017-05-17  John Wilander  <wilander@apple.com>
143
144         Resource Load Statistics: Grandfather domains for existing data records
145         https://bugs.webkit.org/show_bug.cgi?id=172155
146         <rdar://problem/24913532>
147
148         Reviewed by Alex Christensen.
149
150         When WebResourceLoadStatisticsStore starts fresh it needs
151         to scan existing website data records and 'grandfather' them to
152         allow ample time to capture user interaction.
153
154         * Shared/WebPreferencesDefinitions.h:
155         * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp:
156         (WKResourceLoadStatisticsManagerSetGrandfathered):
157         (WKResourceLoadStatisticsManagerIsGrandfathered):
158         (WKResourceLoadStatisticsManagerSetMinimumTimeBetweeenDataRecordsRemoval):
159         (WKResourceLoadStatisticsManagerSetGrandfatheringTime):
160             Functions for testing and configuration.
161         * UIProcess/API/C/WKResourceLoadStatisticsManager.h:
162         * UIProcess/Cocoa/WebResourceLoadStatisticsManagerCocoa.mm:
163         (WebKit::WebResourceLoadStatisticsManager::registerUserDefaultsIfNeeded):
164             Added grandfathering configuration.
165         * UIProcess/WebProcessProxy.cpp:
166         (WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebiteData):
167             New function to get all top privately controlled domains that
168             have website data.
169         * UIProcess/WebProcessProxy.h:
170         * UIProcess/WebResourceLoadStatisticsManager.cpp:
171         (WebKit::WebResourceLoadStatisticsManager::setGrandfathered):
172         (WebKit::WebResourceLoadStatisticsManager::isGrandfathered):
173         (WebKit::WebResourceLoadStatisticsManager::setMinimumTimeBetweeenDataRecordsRemoval):
174         (WebKit::WebResourceLoadStatisticsManager::setGrandfatheringTime):
175         (WebKit::WebResourceLoadStatisticsManager::resetToConsistentState):
176             Functions for testing and configuration.
177             WebResourceLoadStatisticsManager::setMinimumTimeBetweeenDataRecordsRemoval() changed
178             as a result of WebResourceLoadStatisticsStore::setMinimumTimeBetweeenDataRecordsRemoval()
179             moving to WebCore::ResourceLoadObserver::setMinimumTimeBetweeenDataRecordsRemoval().
180         * UIProcess/WebResourceLoadStatisticsManager.h:
181         * UIProcess/WebResourceLoadStatisticsStore.cpp:
182         (WebKit::initializeDataTypesToRemove):
183         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
184             Moved handling of pending removal into WebCore::ResourceLoadStatisticsStore since
185             that's where grandfathering happens.
186         (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver):
187             Moved registration of write persistent store callback and reading of Cocoa defaults to
188             WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver without parameters
189             so they are called for platforms without CFNETWORK_STORAGE_PARTITIONING.
190             Now includes registering WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData()
191             as handler for grandfathering since it involves reading of the website data store.
192         (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
193         (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded):
194         (WebKit::WebResourceLoadStatisticsStore::setMinimumTimeBetweeenDataRecordsRemoval): Deleted.
195             Now happens in WebCore::ResourceLoadObserver::setMinimumTimeBetweeenDataRecordsRemoval().
196         * UIProcess/WebResourceLoadStatisticsStore.h:
197         * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
198         (WebKit::WebsiteDataRecord::topPrivatelyControlledDomain):
199             New function to ask a WebsiteDataRecord for its top privately controlled domain.
200         * UIProcess/WebsiteData/WebsiteDataRecord.h:
201         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
202         (WebKit::WebsiteDataStore::topPrivatelyControlledDomainsWithWebsiteData):
203             New function to get all top privately controlled domains that
204             have website data.
205         * UIProcess/WebsiteData/WebsiteDataStore.h:
206
207 2017-05-17  Brent Fulgham  <bfulgham@apple.com>
208
209         [WK2][iOS] Allow access to additional IOHID user class
210         https://bugs.webkit.org/show_bug.cgi?id=172198
211         <rdar://problem/31967635>
212
213         Reviewed by Alex Christensen.
214
215         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
216
217 2017-05-17  Chris Dumez  <cdumez@apple.com>
218
219         Add more assertions in BackgroundProcessResponsivenessTimer
220         https://bugs.webkit.org/show_bug.cgi?id=172239
221
222         Reviewed by Andreas Kling.
223
224         Add more assertions in BackgroundProcessResponsivenessTimer to help figure out the
225         source of <rdar://problem/32251578>.
226
227         * UIProcess/BackgroundProcessResponsivenessTimer.cpp:
228         (WebKit::BackgroundProcessResponsivenessTimer::updateState):
229         (WebKit::BackgroundProcessResponsivenessTimer::scheduleNextResponsivenessCheck):
230
231 2017-05-17  Youenn Fablet  <youenn@apple.com>
232
233         No need to copy origin references in UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo
234         https://bugs.webkit.org/show_bug.cgi?id=172242
235
236         Reviewed by Eric Carlson.
237
238         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
239         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo):
240
241 2017-05-17  Youenn Fablet  <youenn@apple.com>
242
243         Move-related refactoring on UserMediaPermissionRequestProxy
244         https://bugs.webkit.org/show_bug.cgi?id=172195
245
246         Reviewed by Alex Christensen.
247
248         Moving vectors of strings instead of passing as const ref so that we do not copy them.
249
250         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
251         (WebKit::UserMediaPermissionRequestManagerProxy::createRequest):
252         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
253         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
254         * UIProcess/UserMediaPermissionRequestProxy.cpp:
255         (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy):
256         * UIProcess/UserMediaPermissionRequestProxy.h:
257         (WebKit::UserMediaPermissionRequestProxy::create):
258
259 2017-05-17  Andy Estes  <aestes@apple.com>
260
261         REGRESSION (r215480): PKPaymentAuthorizationStatusFailure sent to PassKit in completeShippingContactSelection() even when there are no errors
262         https://bugs.webkit.org/show_bug.cgi?id=172227
263         <rdar://problem/31978432>
264
265         Reviewed by Alexey Proskuryakov.
266
267         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
268         (WebKit::toPKPaymentAuthorizationStatus): If there is an update with no errors, we should
269         return PKPaymentAuthorizationStatusSuccess instead of PKPaymentAuthorizationStatusFailure.
270
271 2017-05-17  Matt Lewis  <jlewis3@apple.com>
272
273         Unreviewed, rolling out r216974.
274
275         Revision caused consistent timeouts on all platforms.
276
277         Reverted changeset:
278
279         "Add a RuntimeEnabledFeature for display: contents, defaulted
280         to false."
281         https://bugs.webkit.org/show_bug.cgi?id=171984
282         http://trac.webkit.org/changeset/216974
283
284 2017-05-17  Alex Christensen  <achristensen@webkit.org>
285
286         Interacting with WKHTTPCookieStores before creating WKWebViews and WKProcessPools should affect cookies used
287         https://bugs.webkit.org/show_bug.cgi?id=171987
288
289         Reviewed by Brady Eidson.
290
291         When putting cookies in a WKHTTPCookieStore that hasn't been associated with a WKProcessPool yet, there is no
292         NetworkProcess into which to put the cookies.  In such a case, we should store these cookies in the WebsiteDataStore
293         until there is a NetworkProcess.
294
295         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
296         (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession):
297         * NetworkProcess/NetworkProcess.cpp:
298         (WebKit::NetworkProcess::initializeNetworkProcess):
299         (WebKit::NetworkProcess::ensurePrivateBrowsingSession):
300         * NetworkProcess/NetworkProcess.h:
301         * NetworkProcess/NetworkProcess.messages.in:
302         * NetworkProcess/RemoteNetworkingContext.h:
303         * NetworkProcess/mac/RemoteNetworkingContext.mm:
304         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
305         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
306         * Shared/WebsiteDataStoreParameters.cpp:
307         (WebKit::WebsiteDataStoreParameters::~WebsiteDataStoreParameters):
308         (WebKit::WebsiteDataStoreParameters::encode):
309         (WebKit::WebsiteDataStoreParameters::decode):
310         (WebKit::WebsiteDataStoreParameters::WebsiteDataStoreParameters): Deleted.
311         * Shared/WebsiteDataStoreParameters.h:
312         * UIProcess/API/APIHTTPCookieStore.cpp:
313         (API::HTTPCookieStore::cookies):
314         (API::HTTPCookieStore::setCookie):
315         (API::HTTPCookieStore::deleteCookie):
316         * UIProcess/API/APIHTTPCookieStore.h:
317         * UIProcess/WebProcessPool.cpp:
318         (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
319         (WebKit::WebProcessPool::pageAddedToProcess):
320         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
321         (WebKit::WebsiteDataStore::parameters):
322         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
323         (WebKit::WebsiteDataStore::pendingCookies):
324         (WebKit::WebsiteDataStore::addPendingCookie):
325         (WebKit::WebsiteDataStore::removePendingCookie):
326         * UIProcess/WebsiteData/WebsiteDataStore.h:
327
328 2017-05-17  Emilio Cobos Álvarez  <ecobos@igalia.com>
329
330         Add a RuntimeEnabledFeature for display: contents, defaulted to false.
331         https://bugs.webkit.org/show_bug.cgi?id=171984
332
333         Reviewed by Antti Koivisto.
334
335         * Shared/WebPreferencesDefinitions.h:
336         * UIProcess/API/C/WKPreferences.cpp:
337         (WKPreferencesSetDisplayContentsEnabled):
338         (WKPreferencesGetDisplayContentsEnabled):
339         * UIProcess/API/C/WKPreferencesRefPrivate.h:
340         * WebProcess/WebPage/WebPage.cpp:
341         (WebKit::WebPage::updatePreferences):
342
343 2017-05-17  Carlos Garcia Campos  <cgarcia@igalia.com>
344
345         Unreviewed. Fix the build with MEDIA_STREAM disabled after r216952.
346
347         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
348         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
349         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
350
351 2017-05-17  Carlos Garcia Campos  <cgarcia@igalia.com>
352
353         [Threaded Compositor] SHOULD NEVER BE REACHED in WebKit::CompositingRunLoop::updateCompleted
354         https://bugs.webkit.org/show_bug.cgi?id=172167
355
356         Reviewed by Michael Catanzaro.
357
358         This is still happening, even after r216182, less often but still happens. There are two conditions in which
359         this can happen:
360
361          - Again in force repaint. r216182 fixed the case of force repaint called when update state is completed, but it
362            can also crash if update state is inProgress or PendingAfterCompletion when m_coordinateUpdateCompletionWithClient
363            is true.
364          - When the threaded compositor is invalidated right after renderLayerTree() starts, but before it finishes.
365
366         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
367         (WebKit::ThreadedCompositor::invalidate): Invalidate the refresh monitor right after stopping updates in the
368         compositing run loop to ensure no more updates are scheduled.
369         (WebKit::ThreadedCompositor::renderLayerTree): Check the scene is still active before calling sceneUpdateFinished().
370         (WebKit::ThreadedCompositor::updateSceneState): Do not update m_coordinateUpdateCompletionWithClient when in
371         force repaint.
372         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
373         (WebKit::ThreadedDisplayRefreshMonitor::dispatchDisplayRefreshCallback): Return early if the monitor has been invalidated.
374
375 2017-05-16  Sam Weinig  <sam@webkit.org>
376
377         Bring Notification.idl up to spec
378         https://bugs.webkit.org/show_bug.cgi?id=172156
379
380         Reviewed by Chris Dumez.
381
382         * Shared/WebCoreArgumentCoders.h:
383         * UIProcess/API/C/WKNotification.cpp:
384         (WKNotificationCopyDir):
385         * UIProcess/Notifications/WebNotification.cpp:
386         (WebKit::WebNotification::WebNotification):
387         * UIProcess/Notifications/WebNotification.h:
388         (WebKit::WebNotification::create):
389         (WebKit::WebNotification::dir):
390         * UIProcess/Notifications/WebNotificationManagerProxy.cpp:
391         (WebKit::WebNotificationManagerProxy::show):
392         * UIProcess/Notifications/WebNotificationManagerProxy.h:
393         * UIProcess/WebPageProxy.cpp:
394         (WebKit::WebPageProxy::showNotification):
395         * UIProcess/WebPageProxy.h:
396         * UIProcess/WebPageProxy.messages.in:
397         * WebProcess/Notifications/NotificationPermissionRequestManager.cpp:
398         (WebKit::NotificationPermissionRequestManager::startRequest):
399         (WebKit::NotificationPermissionRequestManager::permissionLevel):
400         (WebKit::NotificationPermissionRequestManager::didReceiveNotificationPermissionDecision):
401         * WebProcess/Notifications/WebNotificationManager.cpp:
402         (WebKit::WebNotificationManager::policyForOrigin):
403         (WebKit::WebNotificationManager::show):
404         * WebProcess/WebCoreSupport/WebNotificationClient.cpp:
405         (WebKit::WebNotificationClient::checkPermission):
406         * WebProcess/WebCoreSupport/WebNotificationClient.h:
407         Update for enum vs String usage.
408
409 2017-05-16  Youenn Fablet  <youenn@apple.com>
410
411         Modernize WebKit2 getUserMedia passing of parameters
412         https://bugs.webkit.org/show_bug.cgi?id=172161
413
414         Reviewed by Eric Carlson.
415
416         Passing SecurityOrigin as SecurityOriginData through IPC instead of Strings.
417         Making more use of Ref<> instead of RefPtr<>.
418
419         * UIProcess/UserMediaPermissionCheckProxy.cpp:
420         (WebKit::UserMediaPermissionCheckProxy::UserMediaPermissionCheckProxy):
421         (WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo):
422         * UIProcess/UserMediaPermissionCheckProxy.h:
423         (WebKit::UserMediaPermissionCheckProxy::create):
424         (WebKit::UserMediaPermissionCheckProxy::userMediaDocumentSecurityOrigin):
425         (WebKit::UserMediaPermissionCheckProxy::topLevelDocumentSecurityOrigin):
426         (WebKit::UserMediaPermissionCheckProxy::completionHandler):
427         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
428         (WebKit::FrameAuthorizationState::FrameAuthorizationState):
429         (WebKit::FrameAuthorizationState::ensureSecurityOriginsAreEqual):
430         (WebKit::UserMediaPermissionRequestManagerProxy::createRequest):
431         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
432         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo):
433         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
434         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
435         * UIProcess/UserMediaPermissionRequestProxy.cpp:
436         (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy):
437         * UIProcess/UserMediaPermissionRequestProxy.h:
438         (WebKit::UserMediaPermissionRequestProxy::create):
439         * UIProcess/WebPageProxy.cpp:
440         (WebKit::WebPageProxy::requestUserMediaPermissionForFrame):
441         (WebKit::WebPageProxy::enumerateMediaDevicesForFrame):
442         (WebKit::WebPageProxy::requestNotificationPermission):
443         * UIProcess/WebPageProxy.h:
444         * UIProcess/WebPageProxy.messages.in:
445         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
446         (WebKit::UserMediaPermissionRequestManager::sendUserMediaRequest):
447         (WebKit::UserMediaPermissionRequestManager::enumerateMediaDevices):
448
449 2017-05-16  David Kilzer  <ddkilzer@apple.com>
450
451         Unused lambdas in UserMediaPermissionRequestManagerProxy.cpp
452         <https://webkit.org/b/172179>
453
454         Reviewed by Eric Carlson.
455
456         Fixes unused lambda warnings found with newer clang:
457
458             Source/WebKit2/UIProcess/UserMediaPermissionRequestManagerProxy.cpp:309:46: error: lambda capture 'userMediaID' is not used [-Werror,-Wunused-lambda-capture]
459                 auto validateConstraintsHandler = [this, userMediaID, validHandler = WTFMove(validHandler), invalidHandler = WTFMove(invalidHandler), audioConstraints = WebCore::MediaConstraints(audioConstraints), videoConstraints = WebCore::MediaConstraints(videoConstraints)](String&& deviceIdentifierHashSalt) mutable {
460                                                          ^
461             Source/WebKit2/UIProcess/UserMediaPermissionRequestManagerProxy.cpp:318:41: error: lambda capture 'userMediaID' is not used [-Werror,-Wunused-lambda-capture]
462                 auto haveDeviceSaltHandler = [this, userMediaID, frameID, validateConstraintsHandler = WTFMove(validateConstraintsHandler)](uint64_t userMediaID, String&& deviceIdentifierHashSalt, bool originHasPersistentAccess) mutable {
463                                                     ^
464             Source/WebKit2/UIProcess/UserMediaPermissionRequestManagerProxy.cpp:318:54: error: lambda capture 'frameID' is not used [-Werror,-Wunused-lambda-capture]
465                 auto haveDeviceSaltHandler = [this, userMediaID, frameID, validateConstraintsHandler = WTFMove(validateConstraintsHandler)](uint64_t userMediaID, String&& deviceIdentifierHashSalt, bool originHasPersistentAccess) mutable {
466                                                                  ^
467             Source/WebKit2/UIProcess/UserMediaPermissionRequestManagerProxy.cpp:362:37: error: lambda capture 'userMediaID' is not used [-Werror,-Wunused-lambda-capture]
468                 auto completionHandler = [this, userMediaID](uint64_t userMediaID, String&& deviceIdentifierHashSalt, bool originHasPersistentAccess) {
469                                                 ^
470
471         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
472         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
473         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
474         - Remove unused lambdas.
475
476 2017-05-16  Brent Fulgham  <bfulgham@apple.com>
477
478         [WK2][macOS] Support Flash Player DRM features
479         https://bugs.webkit.org/show_bug.cgi?id=172157
480         <rdar://problem/31889297>
481
482         Reviewed by Dean Jackson.
483
484         Relax the IOKit whitelist to support DRM features needed by
485         some websites.
486
487         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
488
489 2017-05-16  Brent Fulgham  <bfulgham@apple.com>
490
491         [WK2][macOS] Adopt a whitelist for XPC services
492         https://bugs.webkit.org/show_bug.cgi?id=172151
493         <rdar://problem/31916325>
494
495         Reviewed by Alex Christensen.
496
497         * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in:
498         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
499         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
500         * WebProcess/com.apple.WebProcess.sb.in:
501
502 2017-05-16  Timothy Horton  <timothy_horton@apple.com>
503
504         Make it possible to adjust which edges are affected by safe area insets
505         https://bugs.webkit.org/show_bug.cgi?id=172149
506         <rdar://problem/31564729>
507
508         Reviewed by Beth Dakin.
509
510         * UIProcess/API/Cocoa/WKWebView.mm:
511         (-[WKWebView _initializeWithConfiguration:]):
512         (-[WKWebView _computedContentInset]):
513         (-[WKWebView _obscuredInsetEdgesAffectedBySafeArea]):
514         (-[WKWebView _setObscuredInsetEdgesAffectedBySafeArea:]):
515         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
516         Add SPI to adjust which edges are taken into account, and adjust the default.
517
518 2017-05-16  Zan Dobersek  <zdobersek@igalia.com>
519
520         [GLib] Use RunLoopSourcePriority::RunLoopDispatcher as the GSocketMonitor's GSource priority
521         https://bugs.webkit.org/show_bug.cgi?id=172160
522
523         Reviewed by Carlos Garcia Campos.
524
525         * Platform/IPC/glib/GSocketMonitor.cpp:
526         (IPC::GSocketMonitor::start): Explicitly set the priority for the GSocketMonitor's
527         GSource object to RunLoopSourcePriority::RunLoopDispatcher, equating it to the
528         priority that's used in RunLoop for dispatches of the queued functions.
529
530 2017-05-16  Zan Dobersek  <zdobersek@igalia.com>
531
532         [GLib] Name more GSource-based RunLoop::Timers
533         https://bugs.webkit.org/show_bug.cgi?id=172158
534
535         Reviewed by Carlos Garcia Campos.
536
537         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
538         (WebKit::CompositingRunLoop::CompositingRunLoop):
539         Specify 'CompositingRunLoop' as the name of this GSource-based RunLoop::Timer.
540         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
541         (WebKit::ThreadedDisplayRefreshMonitor::ThreadedDisplayRefreshMonitor):
542         Specify 'ThreadedDisplayRefreshMonitor' as the name of this GSource-based RunLoop::Timer.
543         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
544         (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
545         Specify 'CoordinatedLayerTreeHost' as the name of this GSource-based RunLoop::Timer.
546
547 2017-05-16  Carlos Garcia Campos  <cgarcia@igalia.com>
548
549         Unreviewed. Revert change committed by mistakle in r216922.
550
551         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
552         (WebKit::ThreadedCompositor::forceRepaint):
553
554 2017-05-16  Youenn Fablet  <youenn@apple.com>
555
556         Remove MediaConstraintsData and MediaConstraintsImpl
557         https://bugs.webkit.org/show_bug.cgi?id=172132
558
559         Reviewed by Eric Carlson.
560
561         Removing MediaConstraintsData and MediaConstraintsImpl allows simplifying the code.
562         Further simplified the code by making MediaConstraints no longer ref counted and now a struct.
563
564         * Scripts/webkit/messages.py:
565         (headers_for_type):
566         * Shared/WebCoreArgumentCoders.cpp:
567         (IPC::ArgumentCoder<MediaConstraints>::encode):
568         (IPC::ArgumentCoder<MediaConstraints>::decode):
569         (IPC::ArgumentCoder<MediaConstraintsData>::encode): Deleted.
570         (IPC::ArgumentCoder<MediaConstraintsData>::decode): Deleted.
571         * Shared/WebCoreArgumentCoders.h:
572         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
573         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
574         (WebKit::UserMediaCaptureManagerProxy::applyConstraints):
575         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
576         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
577         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
578         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
579         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
580         * UIProcess/WebPageProxy.cpp:
581         (WebKit::WebPageProxy::requestUserMediaPermissionForFrame):
582         * UIProcess/WebPageProxy.h:
583         * UIProcess/WebPageProxy.messages.in:
584         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
585         (WebKit::UserMediaPermissionRequestManager::sendUserMediaRequest):
586         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
587         (WebKit::UserMediaCaptureManager::applyConstraints):
588
589 2017-05-16  Michael Catanzaro  <mcatanzaro@igalia.com>
590
591         [SOUP] Remove LATEST_RECORD_VERSION from GnuTLS priority string
592         https://bugs.webkit.org/show_bug.cgi?id=172153
593
594         Based on discussion with Nikos in https://bugzilla.gnome.org/show_bug.cgi?id=782218, we
595         should remove LATEST_RECORD_VERSION from our GnuTLS priority string. This causes GnuTLS to
596         use the latest TLS record version (the record format is separate from the TLS protocol
597         version), which we needed a couple years ago (after dropping SSLv3) for maximum
598         compatibility with broken web servers. But it's not needed anymore, and is causing new
599         compatibility problems with other broken web servers, so let's get rid of it.
600
601         Reviewed by Carlos Garcia Campos.
602
603         * NetworkProcess/EntryPoint/unix/NetworkProcessMain.cpp:
604         (main):
605         * WebProcess/EntryPoint/unix/WebProcessMain.cpp:
606         (main):
607
608 2017-05-15  Andy Estes  <aestes@apple.com>
609
610         Make the application PID available to WebCore
611         https://bugs.webkit.org/show_bug.cgi?id=172133
612
613         Reviewed by Andreas Kling.
614
615         Added uiProcessPID to Web and Networking process creation parameters. The UI process
616         initializes these to getpid(), and the child processes call WebCore::setPresentingApplicationPID()
617         at initialization time.
618
619         This replaces presenterApplicationPid.
620
621         * NetworkProcess/NetworkProcess.cpp:
622         (WebKit::NetworkProcess::initializeNetworkProcess):
623         * NetworkProcess/NetworkProcessCreationParameters.cpp:
624         (WebKit::NetworkProcessCreationParameters::encode):
625         (WebKit::NetworkProcessCreationParameters::decode):
626         * NetworkProcess/NetworkProcessCreationParameters.h:
627         * Shared/WebProcessCreationParameters.cpp:
628         (WebKit::WebProcessCreationParameters::encode):
629         (WebKit::WebProcessCreationParameters::decode):
630         * Shared/WebProcessCreationParameters.h:
631         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
632         (WebKit::WebProcessPool::platformInitializeWebProcess):
633         * UIProcess/WebProcessPool.cpp:
634         (WebKit::WebProcessPool::ensureNetworkProcess):
635         (WebKit::WebProcessPool::createNewWebProcess):
636         * WebProcess/WebPage/mac/WebPageMac.mm:
637         (WebKit::WebPage::platformInitialize):
638         * WebProcess/WebProcess.cpp:
639         (WebKit::WebProcess::initializeWebProcess):
640         * WebProcess/WebProcess.h:
641         (WebKit::WebProcess::presenterApplicationPid): Deleted.
642         * WebProcess/cocoa/WebProcessCocoa.mm:
643         (WebKit::WebProcess::platformInitializeWebProcess):
644
645 2017-05-15  Said Abou-Hallawa  <sabouhallawa@apple.com>
646
647         Do not delete asynchronously decoded frames for large images if their clients are in the viewport
648         https://bugs.webkit.org/show_bug.cgi?id=170640
649
650         Reviewed by Simon Fraser.
651
652         Enable the async decoding for large images.
653
654         * WebProcess/WebPage/WebPage.cpp:
655         (WebKit::WebPage::updatePreferences):
656
657 2017-05-15  Youenn Fablet  <youenn@apple.com>
658
659         Simplify RealtimeMediaSource data production and state
660         https://bugs.webkit.org/show_bug.cgi?id=171999
661
662         Reviewed by Eric Carlson.
663
664         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
665         (WebKit::UserMediaCaptureManagerProxy::startProducingData):
666         (WebKit::UserMediaCaptureManagerProxy::stopProducingData):
667         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
668
669 2017-05-15  Brent Fulgham  <bfulgham@apple.com>
670
671         Correct typo (part of r216790).
672
673         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: The check-in missed part of a
674         regular expression needed to fix the audio playback.
675
676 2017-05-15  Jer Noble  <jer.noble@apple.com>
677
678         Add experimental setting to allow document gesture interaction to fulfill media playback gesture requirement
679         https://bugs.webkit.org/show_bug.cgi?id=172131
680
681         Reviewed by Eric Carlson.
682
683         * Shared/WebPreferencesDefinitions.h:
684         * UIProcess/API/C/WKPreferences.cpp:
685         (WKPreferencesSetMediaUserGestureInheritsFromDocument):
686         (WKPreferencesGetMediaUserGestureInheritsFromDocument):
687         * UIProcess/API/C/WKPreferencesRefPrivate.h:
688         * WebProcess/WebPage/WebPage.cpp:
689         (WebKit::WebPage::updatePreferences):
690
691 2017-05-15  Brent Fulgham  <bfulgham@apple.com>
692
693         [WK2][macOS][iOS] Allow Network process to access nsurlstoraged's top level domain data cache 
694         https://bugs.webkit.org/show_bug.cgi?id=172128
695         <rdar://problem/30871490>
696
697         Reviewed by Alex Christensen.
698
699         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
700         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
701
702 2017-05-15  David Kilzer  <ddkilzer@apple.com>
703
704         Update json.hpp to v2.1.1
705         <https://webkit.org/b/172085>
706         <rdar://problem/32180980>
707
708         Reviewed by Alex Christensen.
709
710         * NetworkProcess/capture/NetworkCaptureEvent.cpp:
711         - Define JSON_NOEXCEPTION as 1 to disable exceptions in
712           json.hpp.
713         (WebKit::NetworkCapture::JSONCoder<String>::encode):
714         (WebKit::NetworkCapture::JSONCoder<WebCore::SharedBuffer>::encode):
715         - Build std::string passing in length to avoid the need for a
716           custom basic_json() constructor, and for efficiency.
717
718         * NetworkProcess/capture/json.hpp:
719         - Update to v2.1.1 and remove customizations.
720
721 2017-05-15  Brent Fulgham  <bfulgham@apple.com>
722
723         Unreviewed build fix.
724
725         Debugging code was accidentally left in the Plugin sandbox profile.
726
727         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
728
729 2017-05-15  Gwang Yoon Hwang  <yoon@igalia.com>
730
731         [WPE] Unreviewed debug build fix
732         https://bugs.webkit.org/show_bug.cgi?id=172118
733
734         Unreviewed, remove a dead code accidentally committed in r215259.
735
736         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
737         Remove deprecated CompositingRunLoop::isCurrent.
738         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
739         (WebKit::ThreadedCompositor::frameComplete):
740
741 2017-05-14  Daewoong Jang  <daewoong.jang@navercorp.com>
742
743         [CoordinatedGraphics] Remove unused files and lines
744         https://bugs.webkit.org/show_bug.cgi?id=172080
745
746         Reviewed by Darin Adler.
747
748         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp: Removed.
749         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.h: Removed.
750         * Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp: Removed.
751         * Shared/CoordinatedGraphics/WebCoordinatedSurface.h: Removed.
752         * UIProcess/CoordinatedGraphics/WKCoordinatedSceneAPICast.h: Removed.
753         * UIProcess/WebPageProxy.h:
754         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
755         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.messages.in: Removed.
756
757 2017-05-14  Andreas Kling  <akling@apple.com>
758
759         Always reset the assisted node when the main frame commits a new load.
760         https://bugs.webkit.org/show_bug.cgi?id=172088
761
762         Reviewed by Antti Koivisto.
763
764         WebPage::m_assistedNode could extend the lifetime of the document it pointed into
765         if the main frame was navigated while the assisted node was in one of its subframes.
766         The life-supported document wouldn't be reachable from JavaScript but nevertheless
767         would consume memory and other resources.
768
769         This patch fixes the issue by always clearing WebPage::m_assistedNode when the main
770         frame commits a new load.
771
772         * WebProcess/WebPage/WebPage.cpp:
773         (WebKit::WebPage::resetAssistedNodeForFrame):
774
775 2017-05-14  Csaba Osztrogonác  <ossy@webkit.org>
776
777         Unreviewed Mac cmake buildfix after r216690, just for fun.
778
779         * PlatformMac.cmake:
780
781 2017-05-14  David Kilzer  <ddkilzer@apple.com>
782
783         Fix unused lambdas in WebKit2
784         <https://webkit.org/b/172090>
785
786         Reviewed by Chris Dumez.
787
788         Fixes unused lambda warnings found with newer clang.
789
790         * NetworkProcess/cache/NetworkCache.cpp:
791         (WebKit::NetworkCache::Cache::retrieve):
792         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
793         (WebKit::NetworkCache::Statistics::initialize):
794         - Use UNUSED_PARAM() to silence unused lambda warning since
795           'startTime' is used in Debug builds.
796
797         * NetworkProcess/capture/NetworkCaptureManager.cpp:
798         (WebKit::NetworkCapture::Manager::fuzzyMatchURLs):
799         - Remove unused 'this' from lambda capture.
800
801         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
802         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
803         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
804         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
805         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
806         - Use UNUSED_PARAM() to silence unused lambda warning since
807           'taskIdentifier' is used in Debug builds.
808
809         * UIProcess/WebResourceLoadStatisticsStore.cpp:
810         (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver):
811         (WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate):
812         - Remove unused 'this' from lambda captures.
813
814         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
815         (WebKit::WebsiteDataStore::fetchData):
816         - Remove unused 'fetchOptions' from lambda capture.
817         (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains):
818         - Remove unused 'this' from lambda capture.
819
820         * UIProcess/mac/ViewGestureControllerMac.mm:
821         (WebKit::ViewGestureController::forceRepaintIfNeeded):
822         - Remove unused 'this' from lambda capture.
823
824         * WebProcess/cocoa/WebVideoFullscreenManager.mm:
825         (WebKit::WebVideoFullscreenManager::didExitFullscreen):
826         - Remove unused 'this' from nested lambda captures.
827
828 2017-05-13  Eric Carlson  <eric.carlson@apple.com>
829
830         [MediaStream] deviceId constraint doesn't work with getUserMedia
831         https://bugs.webkit.org/show_bug.cgi?id=171877
832         <rdar://problem/31899730>
833
834         Reviewed by Jer Noble.
835
836         * Shared/WebCoreArgumentCoders.cpp:
837         (IPC::ArgumentCoder<MediaConstraintsData>::encode): Encode deviceIDHashSalt.
838         (IPC::ArgumentCoder<MediaConstraintsData>::decode): Decode deviceIDHashSalt.
839
840         * UIProcess/UserMediaPermissionCheckProxy.cpp:
841         (WebKit::UserMediaPermissionCheckProxy::UserMediaPermissionCheckProxy): Initialize
842         completion handler, frame ID, and security origins.
843         (WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo): Complete by calling
844         completion handler because we now sometimes request access info before calling gUM.
845         (WebKit::UserMediaPermissionCheckProxy::invalidate): Clear completion handler.
846         * UIProcess/UserMediaPermissionCheckProxy.h:
847
848         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
849         (WebKit::FrameAuthorizationState::FrameAuthorizationState): Take security origins, not
850         UserMediaPermissionRequestProxy, so it can be constructed with a UserMediaPermissionCheckProxy.
851         (WebKit::FrameAuthorizationState::ensureSecurityOriginsAreEqual): Ditto. Clear has salt
852         when origins don't match.
853         (WebKit::UserMediaPermissionRequestManagerProxy::stateForRequest): Templatize.
854         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied): Fix typo.
855         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Ditto.
856         Don't set state for empty UIDs. Pass hash salt to web process.
857         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
858         The device ID hash salt is now required to validate constraints, so get it first.
859         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo): Helper
860         method used to get the device ID hash salt.
861         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Restructure
862         to use getUserMediaPermissionInfo.
863         (WebKit::UserMediaPermissionRequestManagerProxy::didCompleteUserMediaPermissionCheck): Deleted.
864         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
865
866         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
867         (WebKit::UserMediaPermissionRequestManager::userMediaAccessWasGranted): Add device ID
868         hash salt parameter.
869         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
870
871         * WebProcess/WebPage/WebPage.cpp:
872         (WebKit::WebPage::userMediaAccessWasGranted): Ditto.
873         * WebProcess/WebPage/WebPage.h:
874         * WebProcess/WebPage/WebPage.messages.in:
875
876         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
877         (WebKit::UserMediaCaptureManager::createCaptureSource): Use new MediaConstraintsData 
878         constructor.
879
880 2017-05-13  Chris Dumez  <cdumez@apple.com>
881
882         Stop using RefPtr::release()
883         https://bugs.webkit.org/show_bug.cgi?id=172074
884
885         Reviewed by Geoffrey Garen.
886
887         * Platform/unix/SharedMemoryUnix.cpp:
888         (WebKit::SharedMemory::create):
889         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
890         (WebKit::CoordinatedGraphicsScene::createImageBacking):
891         * Shared/cairo/ShareableBitmapCairo.cpp:
892         (WebKit::ShareableBitmap::createCairoSurface):
893         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeFilter.cpp:
894         (WebKit::core):
895         * WebProcess/WebPage/WebPage.cpp:
896         (WebKit::WebPage::getContentsAsMHTMLData):
897
898 2017-05-12  Chris Dumez  <cdumez@apple.com>
899
900         Drop remaining uses of PassRefPtr in WebKit2/WebProcess
901         https://bugs.webkit.org/show_bug.cgi?id=172055
902
903         Reviewed by Alex Christensen.
904
905         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.mm:
906         (+[WKWebProcessPlugInScriptWorld normalWorld]):
907         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
908         (contextMenuItems):
909         * WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp:
910         (WKBundleScriptWorldNormalWorld):
911         * WebProcess/InjectedBundle/API/gtk/WebKitScriptWorld.cpp:
912         (webkitScriptWorldCreate):
913         * WebProcess/InjectedBundle/DOM/InjectedBundleCSSStyleDeclarationHandle.cpp:
914         (WebKit::InjectedBundleCSSStyleDeclarationHandle::getOrCreate):
915         * WebProcess/InjectedBundle/DOM/InjectedBundleCSSStyleDeclarationHandle.h:
916         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
917         (WebKit::InjectedBundleRangeHandle::getOrCreate):
918         (WebKit::InjectedBundleRangeHandle::create):
919         (WebKit::InjectedBundleRangeHandle::coreRange):
920         (WebKit::InjectedBundleRangeHandle::renderedImage):
921         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.h:
922         * WebProcess/InjectedBundle/InjectedBundle.cpp:
923         (WebKit::InjectedBundle::create):
924         (WebKit::InjectedBundle::createWebDataFromUint8Array):
925         * WebProcess/InjectedBundle/InjectedBundle.h:
926         * WebProcess/InjectedBundle/InjectedBundleBackForwardList.cpp:
927         (WebKit::InjectedBundleBackForwardList::itemAtIndex):
928         * WebProcess/InjectedBundle/InjectedBundleBackForwardList.h:
929         (WebKit::InjectedBundleBackForwardList::detach):
930         * WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.h:
931         (WebKit::InjectedBundleBackForwardListItem::create):
932         (WebKit::InjectedBundleBackForwardListItem::InjectedBundleBackForwardListItem):
933         * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp:
934         (WebKit::InjectedBundleHitTestResult::nodeHandle):
935         (WebKit::InjectedBundleHitTestResult::urlElementHandle):
936         * WebProcess/InjectedBundle/InjectedBundleHitTestResult.h:
937         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
938         (WebKit::InjectedBundleNavigationAction::create):
939         (WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction):
940         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.h:
941         * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp:
942         (WebKit::InjectedBundleScriptWorld::getOrCreate):
943         (WebKit::InjectedBundleScriptWorld::normalWorld):
944         * WebProcess/InjectedBundle/InjectedBundleScriptWorld.h:
945         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
946         (WebKit::NetscapePlugin::create):
947         (WebKit::NetscapePlugin::NetscapePlugin):
948         (WebKit::NetscapePlugin::supportsSnapshotting):
949         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
950         * WebProcess/Plugins/PDF/PDFPluginAnnotation.h:
951         * WebProcess/Plugins/PDF/PDFPluginAnnotation.mm:
952         (WebKit::PDFPluginAnnotation::create):
953         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.h:
954         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm:
955         (WebKit::PDFPluginChoiceAnnotation::createAnnotationElement):
956         * WebProcess/Plugins/PDF/PDFPluginPasswordField.h:
957         * WebProcess/Plugins/PDF/PDFPluginPasswordField.mm:
958         (WebKit::PDFPluginPasswordField::createAnnotationElement):
959         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.h:
960         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm:
961         (WebKit::PDFPluginTextAnnotation::createAnnotationElement):
962         * WebProcess/UserContent/WebUserContentController.cpp:
963         (WebKit::worldMap):
964         (WebKit::WebUserMessageHandlerDescriptorProxy::create):
965         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
966         (WebKit::convertImageToBitmap):
967         * WebProcess/WebPage/WebPage.cpp:
968         (WebKit::WebPage::addUserScript):
969         (WebKit::WebPage::addUserStyleSheet):
970         * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
971         (WebKit::WebPrintOperationGtk::create):
972         * WebProcess/WebPage/gtk/WebPrintOperationGtk.h:
973         * WebProcess/WebPage/ios/WebPageIOS.mm:
974         (WebKit::rangeForPosition):
975         (WebKit::rangeAtWordBoundaryForPosition):
976         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.h:
977
978 2017-05-12  Alex Christensen  <achristensen@webkit.org>
979
980         Rename WKContentExtension to WKContentRuleList
981         https://bugs.webkit.org/show_bug.cgi?id=172053
982         <rdar://problem/32141005>
983
984         Reviewed by Geoffrey Garen.
985
986         * Shared/API/APIObject.h:
987         * Shared/API/Cocoa/WebKit.h:
988         * Shared/API/c/WKDeprecatedFunctions.cpp:
989         (WKPageGroupAddUserContentFilter):
990         (WKPageGroupRemoveUserContentFilter):
991         * Shared/Cocoa/APIObject.mm:
992         (API::Object::newObject):
993         * Shared/WebCompiledContentExtension.cpp: Removed.
994         * Shared/WebCompiledContentExtension.h: Removed.
995         * Shared/WebCompiledContentExtensionData.cpp: Removed.
996         * Shared/WebCompiledContentExtensionData.h: Removed.
997         * Shared/WebCompiledContentRuleList.cpp: Copied from Source/WebKit2/Shared/WebCompiledContentExtension.cpp.
998         (WebKit::WebCompiledContentRuleList::create):
999         (WebKit::WebCompiledContentRuleList::WebCompiledContentRuleList):
1000         (WebKit::WebCompiledContentRuleList::~WebCompiledContentRuleList):
1001         (WebKit::WebCompiledContentRuleList::conditionsApplyOnlyToDomain):
1002         (WebKit::WebCompiledContentRuleList::filtersWithoutConditionsBytecode):
1003         (WebKit::WebCompiledContentRuleList::filtersWithoutConditionsBytecodeLength):
1004         (WebKit::WebCompiledContentRuleList::filtersWithConditionsBytecode):
1005         (WebKit::WebCompiledContentRuleList::filtersWithConditionsBytecodeLength):
1006         (WebKit::WebCompiledContentRuleList::topURLFiltersBytecode):
1007         (WebKit::WebCompiledContentRuleList::topURLFiltersBytecodeLength):
1008         (WebKit::WebCompiledContentRuleList::actions):
1009         (WebKit::WebCompiledContentRuleList::actionsLength):
1010         (WebKit::WebCompiledContentExtension::create): Deleted.
1011         (WebKit::WebCompiledContentExtension::WebCompiledContentExtension): Deleted.
1012         (WebKit::WebCompiledContentExtension::~WebCompiledContentExtension): Deleted.
1013         (WebKit::WebCompiledContentExtension::conditionsApplyOnlyToDomain): Deleted.
1014         (WebKit::WebCompiledContentExtension::filtersWithoutConditionsBytecode): Deleted.
1015         (WebKit::WebCompiledContentExtension::filtersWithoutConditionsBytecodeLength): Deleted.
1016         (WebKit::WebCompiledContentExtension::filtersWithConditionsBytecode): Deleted.
1017         (WebKit::WebCompiledContentExtension::filtersWithConditionsBytecodeLength): Deleted.
1018         (WebKit::WebCompiledContentExtension::topURLFiltersBytecode): Deleted.
1019         (WebKit::WebCompiledContentExtension::topURLFiltersBytecodeLength): Deleted.
1020         (WebKit::WebCompiledContentExtension::actions): Deleted.
1021         (WebKit::WebCompiledContentExtension::actionsLength): Deleted.
1022         * Shared/WebCompiledContentRuleList.h: Copied from Source/WebKit2/Shared/WebCompiledContentExtension.h.
1023         * Shared/WebCompiledContentRuleListData.cpp: Copied from Source/WebKit2/Shared/WebCompiledContentExtensionData.cpp.
1024         (WebKit::WebCompiledContentRuleListData::encode):
1025         (WebKit::WebCompiledContentRuleListData::decode):
1026         (WebKit::WebCompiledContentExtensionData::encode): Deleted.
1027         (WebKit::WebCompiledContentExtensionData::decode): Deleted.
1028         * Shared/WebCompiledContentRuleListData.h: Copied from Source/WebKit2/Shared/WebCompiledContentExtensionData.h.
1029         (WebKit::WebCompiledContentRuleListData::WebCompiledContentRuleListData):
1030         (WebKit::WebCompiledContentExtensionData::WebCompiledContentExtensionData): Deleted.
1031         * Shared/WebPageCreationParameters.cpp:
1032         (WebKit::WebPageCreationParameters::encode):
1033         (WebKit::WebPageCreationParameters::decode):
1034         * Shared/WebPageCreationParameters.h:
1035         * UIProcess/API/APIContentExtension.cpp: Removed.
1036         * UIProcess/API/APIContentExtension.h: Removed.
1037         * UIProcess/API/APIContentExtensionStore.cpp: Removed.
1038         * UIProcess/API/APIContentExtensionStore.h: Removed.
1039         * UIProcess/API/APIContentRuleList.cpp: Copied from Source/WebKit2/UIProcess/API/APIContentExtension.cpp.
1040         (API::ContentRuleList::ContentRuleList):
1041         (API::ContentRuleList::~ContentRuleList):
1042         (API::ContentExtension::ContentExtension): Deleted.
1043         (API::ContentExtension::~ContentExtension): Deleted.
1044         * UIProcess/API/APIContentRuleList.h: Copied from Source/WebKit2/UIProcess/API/APIContentExtension.h.
1045         * UIProcess/API/APIContentRuleListStore.cpp: Copied from Source/WebKit2/UIProcess/API/APIContentExtensionStore.cpp.
1046         (API::ContentRuleListStore::legacyDefaultStore):
1047         (API::ContentRuleListStore::nonLegacyDdefaultStore):
1048         (API::ContentRuleListStore::defaultStore):
1049         (API::ContentRuleListStore::storeWithPath):
1050         (API::ContentRuleListStore::ContentRuleListStore):
1051         (API::ContentRuleListStore::~ContentRuleListStore):
1052         (API::constructedPathPrefix):
1053         (API::ContentRuleListMetaData::fileSize):
1054         (API::encodeContentRuleListMetaData):
1055         (API::decodeContentRuleListMetaData):
1056         (API::openAndMapContentRuleList):
1057         (API::compiledToFile):
1058         (API::createExtension):
1059         (API::ContentRuleListStore::lookupContentRuleList):
1060         (API::ContentRuleListStore::getAvailableContentRuleListIdentifiers):
1061         (API::ContentRuleListStore::compileContentRuleList):
1062         (API::ContentRuleListStore::removeContentRuleList):
1063         (API::ContentRuleListStore::synchronousRemoveAllContentRuleLists):
1064         (API::ContentRuleListStore::invalidateContentRuleListVersion):
1065         (API::ContentRuleListStore::getContentRuleListSource):
1066         (API::contentRuleListStoreErrorCategory):
1067         (API::ContentExtensionStore::defaultStore): Deleted.
1068         (API::ContentExtensionStore::storeWithPath): Deleted.
1069         (API::ContentExtensionStore::ContentExtensionStore): Deleted.
1070         (API::ContentExtensionStore::~ContentExtensionStore): Deleted.
1071         (API::ContentExtensionMetaData::fileSize): Deleted.
1072         (API::encodeContentExtensionMetaData): Deleted.
1073         (API::decodeContentExtensionMetaData): Deleted.
1074         (API::openAndMapContentExtension): Deleted.
1075         (API::ContentExtensionStore::lookupContentExtension): Deleted.
1076         (API::ContentExtensionStore::getAvailableContentExtensionIdentifiers): Deleted.
1077         (API::ContentExtensionStore::compileContentExtension): Deleted.
1078         (API::ContentExtensionStore::removeContentExtension): Deleted.
1079         (API::ContentExtensionStore::synchronousRemoveAllContentExtensions): Deleted.
1080         (API::ContentExtensionStore::invalidateContentExtensionVersion): Deleted.
1081         (API::ContentExtensionStore::getContentExtensionSource): Deleted.
1082         (API::contentExtensionStoreErrorCategory): Deleted.
1083         * UIProcess/API/APIContentRuleListStore.h: Copied from Source/WebKit2/UIProcess/API/APIContentExtensionStore.h.
1084         (API::make_error_code):
1085         * UIProcess/API/C/WKAPICast.h:
1086         * UIProcess/API/C/WKPageGroup.cpp:
1087         * UIProcess/API/C/WKUserContentControllerRef.cpp:
1088         (WKUserContentControllerAddUserContentFilter):
1089         (WKUserContentControllerRemoveAllUserContentFilters):
1090         * UIProcess/API/C/WKUserContentExtensionStoreRef.cpp:
1091         (WKUserContentExtensionStoreGetTypeID):
1092         * UIProcess/API/Cocoa/APIUserContentExtensionStoreCocoa.mm:
1093         (API::ContentRuleListStore::defaultStorePath):
1094         (API::ContentExtensionStore::defaultStorePath): Deleted.
1095         * UIProcess/API/Cocoa/WKContentExtension.h: Removed.
1096         * UIProcess/API/Cocoa/WKContentExtension.mm: Removed.
1097         * UIProcess/API/Cocoa/WKContentExtensionInternal.h: Removed.
1098         * UIProcess/API/Cocoa/WKContentExtensionStore.h: Removed.
1099         * UIProcess/API/Cocoa/WKContentExtensionStore.mm: Removed.
1100         * UIProcess/API/Cocoa/WKContentExtensionStoreInternal.h: Removed.
1101         * UIProcess/API/Cocoa/WKContentExtensionStorePrivate.h: Removed.
1102         * UIProcess/API/Cocoa/WKContentRuleList.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKContentExtension.h.
1103         * UIProcess/API/Cocoa/WKContentRuleList.mm: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKContentExtension.mm.
1104         (-[WKContentRuleList dealloc]):
1105         (-[WKContentRuleList _apiObject]):
1106         (-[WKContentRuleList identifier]):
1107         (-[WKContentExtension dealloc]): Deleted.
1108         (-[WKContentExtension _apiObject]): Deleted.
1109         (-[WKContentExtension identifier]): Deleted.
1110         * UIProcess/API/Cocoa/WKContentRuleListInternal.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKContentExtensionInternal.h.
1111         (WebKit::wrapper):
1112         * UIProcess/API/Cocoa/WKContentRuleListStore.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKContentExtensionStore.h.
1113         * UIProcess/API/Cocoa/WKContentRuleListStore.mm: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKContentExtensionStore.mm.
1114         (toWKErrorCode):
1115         (-[WKContentRuleListStore dealloc]):
1116         (+[WKContentRuleListStore defaultStore]):
1117         (+[WKContentRuleListStore storeWithURL:]):
1118         (-[WKContentRuleListStore compileContentRuleListForIdentifier:encodedContentRuleList:completionHandler:]):
1119         (-[WKContentRuleListStore _compileContentRuleListForIdentifier:encodedContentRuleList:completionHandler:releasesArgument:]):
1120         (-[WKContentRuleListStore lookUpContentRuleListForIdentifier:completionHandler:]):
1121         (-[WKContentRuleListStore getAvailableContentRuleListIdentifiers:]):
1122         (-[WKContentRuleListStore removeContentRuleListForIdentifier:completionHandler:]):
1123         (-[WKContentRuleListStore _apiObject]):
1124         (-[WKContentRuleListStore _removeAllContentRuleLists]):
1125         (-[WKContentRuleListStore _invalidateContentRuleListVersionForIdentifier:]):
1126         (-[WKContentRuleListStore _getContentRuleListSourceForIdentifier:completionHandler:]):
1127         (-[WKContentRuleListStore _compileContentRuleListForIdentifier:encodedContentRuleList:completionHandler:]):
1128         (-[WKContentExtensionStore dealloc]): Deleted.
1129         (+[WKContentExtensionStore defaultStore]): Deleted.
1130         (+[WKContentExtensionStore storeWithURL:]): Deleted.
1131         (-[WKContentExtensionStore compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:]): Deleted.
1132         (-[WKContentExtensionStore _compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:releasesArgument:]): Deleted.
1133         (-[WKContentExtensionStore lookUpContentExtensionForIdentifier:completionHandler:]): Deleted.
1134         (-[WKContentExtensionStore getAvailableContentExtensionIdentifiers:]): Deleted.
1135         (-[WKContentExtensionStore removeContentExtensionForIdentifier:completionHandler:]): Deleted.
1136         (-[WKContentExtensionStore _apiObject]): Deleted.
1137         (-[WKContentExtensionStore _removeAllContentExtensions]): Deleted.
1138         (-[WKContentExtensionStore _invalidateContentExtensionVersionForIdentifier:]): Deleted.
1139         (-[WKContentExtensionStore _getContentExtensionSourceForIdentifier:completionHandler:]): Deleted.
1140         (-[WKContentExtensionStore _compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:]): Deleted.
1141         * UIProcess/API/Cocoa/WKContentRuleListStoreInternal.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKContentExtensionStoreInternal.h.
1142         (WebKit::wrapper):
1143         * UIProcess/API/Cocoa/WKContentRuleListStorePrivate.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKContentExtensionStorePrivate.h.
1144         * UIProcess/API/Cocoa/WKError.h:
1145         * UIProcess/API/Cocoa/WKError.mm:
1146         (localizedDescriptionForErrorCode):
1147         * UIProcess/API/Cocoa/WKUserContentController.h:
1148         * UIProcess/API/Cocoa/WKUserContentController.mm:
1149         (-[WKUserContentController addContentRuleList:]):
1150         (-[WKUserContentController removeContentRuleList:]):
1151         (-[WKUserContentController removeAllContentRuleLists]):
1152         (-[WKUserContentController _addUserContentFilter:]):
1153         (-[WKUserContentController _removeUserContentFilter:]):
1154         (-[WKUserContentController _removeAllUserContentFilters]):
1155         (-[WKUserContentController addContentExtension:]): Deleted.
1156         (-[WKUserContentController removeContentExtension:]): Deleted.
1157         (-[WKUserContentController removeAllContentExtensions]): Deleted.
1158         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm:
1159         (toUserContentRuleListStoreError):
1160         (+[_WKUserContentExtensionStore defaultStore]):
1161         (+[_WKUserContentExtensionStore storeWithURL:]):
1162         (-[_WKUserContentExtensionStore compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:]):
1163         (-[_WKUserContentExtensionStore lookupContentExtensionForIdentifier:completionHandler:]):
1164         (-[_WKUserContentExtensionStore removeContentExtensionForIdentifier:completionHandler:]):
1165         (-[_WKUserContentExtensionStore _apiObject]):
1166         (-[_WKUserContentExtensionStore _removeAllContentExtensions]):
1167         (-[_WKUserContentExtensionStore _invalidateContentExtensionVersionForIdentifier:]):
1168         (-[_WKUserContentExtensionStore _initWithWKContentRuleListStore:]):
1169         (toUserContentExtensionStoreError): Deleted.
1170         (-[_WKUserContentExtensionStore _initWithWKContentExtensionStore:]): Deleted.
1171         * UIProcess/API/Cocoa/_WKUserContentExtensionStoreInternal.h:
1172         * UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h:
1173         * UIProcess/API/Cocoa/_WKUserContentFilter.mm:
1174         (-[_WKUserContentFilter _apiObject]):
1175         (-[_WKUserContentFilter _initWithWKContentRuleList:]):
1176         (-[_WKUserContentFilter _initWithWKContentExtension:]): Deleted.
1177         * UIProcess/API/Cocoa/_WKUserContentFilterInternal.h:
1178         * UIProcess/API/Cocoa/_WKUserContentFilterPrivate.h:
1179         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
1180         (WebKit::WebUserContentControllerProxy::addProcess):
1181         (WebKit::WebUserContentControllerProxy::addContentRuleList):
1182         (WebKit::WebUserContentControllerProxy::removeContentRuleList):
1183         (WebKit::WebUserContentControllerProxy::removeAllContentRuleLists):
1184         (WebKit::WebUserContentControllerProxy::addContentExtension): Deleted.
1185         (WebKit::WebUserContentControllerProxy::removeContentExtension): Deleted.
1186         (WebKit::WebUserContentControllerProxy::removeAllContentExtensions): Deleted.
1187         * UIProcess/UserContent/WebUserContentControllerProxy.h:
1188         * UIProcess/WebPageGroup.cpp:
1189         * WebKit2.xcodeproj/project.pbxproj:
1190         * WebProcess/UserContent/WebUserContentController.cpp:
1191         (WebKit::WebUserContentController::addContentRuleLists):
1192         (WebKit::WebUserContentController::removeContentRuleList):
1193         (WebKit::WebUserContentController::removeAllContentRuleLists):
1194         (WebKit::WebUserContentController::addContentExtensions): Deleted.
1195         (WebKit::WebUserContentController::removeContentExtension): Deleted.
1196         (WebKit::WebUserContentController::removeAllContentExtensions): Deleted.
1197         * WebProcess/UserContent/WebUserContentController.h:
1198         * WebProcess/UserContent/WebUserContentController.messages.in:
1199         * WebProcess/WebPage/WebPage.cpp:
1200         (WebKit::m_backgroundCPULimit):
1201
1202 2017-05-12  Jeremy Jones  <jeremyj@apple.com>
1203
1204         Add objc version of WK2 UIPageClient setHasVideoInPictureInPicture and rename it to hasVideoInPictureInPictureDidChange.
1205         https://bugs.webkit.org/show_bug.cgi?id=172048
1206         rdar://problem/32163054
1207
1208         Reviewed by Simon Fraser.
1209
1210         Rename UIPageClient setHasVideoInPictureInPicture to hasVideoInPictureInPictureDidChange.
1211         Add missing _allowsPictureInPictureMediaPlayback property to WKPreferences.
1212         Add -hasVideoInPictureInPictureDidChange to UIDelegate.
1213
1214         * UIProcess/API/APIUIClient.h:
1215         (API::UIClient::hasVideoInPictureInPictureDidChange):
1216         * UIProcess/API/C/WKPage.cpp:
1217         (WKPageSetPageUIClient):
1218         * UIProcess/API/C/WKPageUIClient.h:
1219         * UIProcess/API/Cocoa/WKPreferences.mm:
1220         (-[WKPreferences _allowsPictureInPictureMediaPlayback]):
1221         (-[WKPreferences _setAllowsPictureInPictureMediaPlayback:]):
1222         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1223         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1224         * UIProcess/Cocoa/UIDelegate.h:
1225         * UIProcess/Cocoa/UIDelegate.mm:
1226         (WebKit::UIDelegate::setDelegate):
1227         (WebKit::UIDelegate::UIClient::hasVideoInPictureInPictureDidChange):
1228         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
1229         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID):
1230         (WebKit::WebVideoFullscreenManagerProxy::fullscreenModeChanged):
1231
1232 2017-05-12  David Quesada  <david_quesada@apple.com>
1233
1234         Add SPI for overriding WKWebView's clipping behavior for _visibleContentRect
1235         https://bugs.webkit.org/show_bug.cgi?id=172000
1236         rdar://problem/32144756
1237
1238         Reviewed by Simon Fraser.
1239
1240         Extract -[WKWebView _visibleContentRect]'s use of -_scroller to a new property
1241         _enclosingViewForExposedRectComputation, which is declared in the private
1242         header for subclasses to implement custom logic for determining the view to
1243         clip rendering to.
1244
1245         * UIProcess/API/Cocoa/WKWebView.mm:
1246         (-[WKWebView _enclosingViewForExposedRectComputation]):
1247         (-[WKWebView _visibleRectInEnclosingView:]):
1248         (-[WKWebView _visibleContentRect]):
1249         (-[WKWebView _visibleRectInEnclosingScrollView:]): Deleted.
1250         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1251
1252 2017-05-12  Chris Dumez  <cdumez@apple.com>
1253
1254         Stop using PassRefPtr under WebKit2/UIProcess
1255         https://bugs.webkit.org/show_bug.cgi?id=172029
1256
1257         Reviewed by Alex Christensen.
1258
1259         * UIProcess/API/Cocoa/WKWebView.mm:
1260         (-[WKWebView _takeViewSnapshot]):
1261         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1262         * UIProcess/API/gtk/PageClientImpl.cpp:
1263         (WebKit::PageClientImpl::registerEditCommand):
1264         * UIProcess/API/gtk/PageClientImpl.h:
1265         * UIProcess/API/gtk/WebKitFaviconDatabase.cpp:
1266         (getIconSurfaceSynchronously):
1267         * UIProcess/API/gtk/WebKitWebContext.cpp:
1268         * UIProcess/API/wpe/PageClientImpl.cpp:
1269         (WebKit::PageClientImpl::registerEditCommand):
1270         * UIProcess/API/wpe/PageClientImpl.h:
1271         * UIProcess/Cocoa/WebViewImpl.h:
1272         * UIProcess/Cocoa/WebViewImpl.mm:
1273         (WebKit::WebViewImpl::registerEditCommand):
1274         * UIProcess/DefaultUndoController.cpp:
1275         (WebKit::DefaultUndoController::registerEditCommand):
1276         * UIProcess/DefaultUndoController.h:
1277         * UIProcess/Downloads/DownloadProxy.cpp:
1278         (WebKit::DownloadProxy::create):
1279         * UIProcess/Downloads/DownloadProxy.h:
1280         * UIProcess/GeolocationPermissionRequestManagerProxy.cpp:
1281         (WebKit::GeolocationPermissionRequestManagerProxy::createRequest):
1282         * UIProcess/GeolocationPermissionRequestManagerProxy.h:
1283         * UIProcess/InspectorServer/HTTPRequest.cpp:
1284         (WebKit::HTTPRequest::parseHTTPRequestFromBuffer):
1285         * UIProcess/InspectorServer/HTTPRequest.h:
1286         * UIProcess/InspectorServer/WebInspectorServer.cpp:
1287         (WebKit::WebInspectorServer::didReceiveUnrecognizedHTTPRequest):
1288         (WebKit::WebInspectorServer::didReceiveWebSocketUpgradeHTTPRequest):
1289         (WebKit::WebInspectorServer::didEstablishWebSocketConnection):
1290         * UIProcess/InspectorServer/WebInspectorServer.h:
1291         * UIProcess/InspectorServer/WebSocketServerClient.h:
1292         (WebKit::WebSocketServerClient::didReceiveUnrecognizedHTTPRequest):
1293         (WebKit::WebSocketServerClient::didReceiveWebSocketUpgradeHTTPRequest):
1294         (WebKit::WebSocketServerClient::didEstablishWebSocketConnection):
1295         * UIProcess/InspectorServer/WebSocketServerConnection.cpp:
1296         (WebKit::WebSocketServerConnection::readHTTPMessage):
1297         (WebKit::WebSocketServerConnection::upgradeToWebSocketServerConnection):
1298         * UIProcess/InspectorServer/WebSocketServerConnection.h:
1299         * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp:
1300         (WebKit::NotificationPermissionRequestManagerProxy::createRequest):
1301         * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.h:
1302         * UIProcess/Notifications/WebNotificationProvider.cpp:
1303         (WebKit::WebNotificationProvider::notificationPermissions):
1304         * UIProcess/Notifications/WebNotificationProvider.h:
1305         * UIProcess/PageClient.h:
1306         * UIProcess/Storage/LocalStorageDatabase.cpp:
1307         * UIProcess/WebContextMenuListenerProxy.h:
1308         * UIProcess/WebCookieManagerProxy.h:
1309         * UIProcess/WebEditCommandProxy.cpp:
1310         (WebKit::WebEditCommandProxy::unapply):
1311         (WebKit::WebEditCommandProxy::reapply):
1312         * UIProcess/WebEditCommandProxy.h:
1313         * UIProcess/WebGrammarDetail.cpp:
1314         (WebKit::WebGrammarDetail::create):
1315         * UIProcess/WebGrammarDetail.h:
1316         * UIProcess/WebPageProxy.cpp:
1317         (WebKit::ExceededDatabaseQuotaRecords::createRecord):
1318         (WebKit::WebPageProxy::registerEditCommand):
1319         (WebKit::WebPageProxy::didReceiveAuthenticationChallengeProxy):
1320         (WebKit::WebPageProxy::exceededDatabaseQuota):
1321         (WebKit::WebPageProxy::reachedApplicationCacheOriginQuota):
1322         (WebKit::WebPageProxy::takeViewSnapshot):
1323         * UIProcess/WebPageProxy.h:
1324         * UIProcess/WebProcessPool.cpp:
1325         (WebKit::WebProcessPool::plugInAutoStartOriginHashes):
1326         * UIProcess/WebProcessPool.h:
1327         * UIProcess/WebProcessProxy.h:
1328         * UIProcess/ios/PageClientImplIOS.h:
1329         * UIProcess/ios/PageClientImplIOS.mm:
1330         (-[WKEditCommandObjC initWithWebEditCommandProxy:]):
1331         (WebKit::PageClientImpl::registerEditCommand):
1332         (WebKit::PageClientImpl::saveImageToLibrary):
1333         (WebKit::PageClientImpl::setDragImage):
1334         (WebKit::PageClientImpl::takeViewSnapshot):
1335         * UIProcess/ios/WKGeolocationProviderIOS.mm:
1336         (-[WKWebAllowDenyPolicyListener initWithPermissionRequestProxy:]):
1337         * UIProcess/ios/WebPageProxyIOS.mm:
1338         (WebKit::WebPageProxy::saveImageToLibrary):
1339         * UIProcess/mac/PageClientImpl.h:
1340         * UIProcess/mac/PageClientImpl.mm:
1341         (WebKit::PageClientImpl::registerEditCommand):
1342         (WebKit::PageClientImpl::setDragImage):
1343         (WebKit::PageClientImpl::setPromisedDataForImage):
1344         (WebKit::PageClientImpl::takeViewSnapshot):
1345         * UIProcess/mac/WKImmediateActionController.mm:
1346         (-[WKImmediateActionController _webHitTestResult]):
1347         * UIProcess/mac/WebPageProxyMac.mm:
1348         (WebKit::WebPageProxy::setDragImage):
1349         (WebKit::WebPageProxy::setPromisedDataForImage):
1350         * WebProcess/IconDatabase/WebIconDatabaseProxy.h:
1351
1352 2017-05-12  Jeremy Jones  <jeremyj@apple.com>
1353
1354         Add UIClient callback for when picture-in-picture is activated.
1355         https://bugs.webkit.org/show_bug.cgi?id=172023
1356
1357         Reviewed by Simon Fraser.
1358
1359         Add WKUIPageClientV10 with setHasVideoInPictureInPicture.
1360
1361         * UIProcess/API/APIUIClient.h:
1362         (API::UIClient::setHasVideoInPictureInPicture):
1363         * UIProcess/API/C/WKPage.cpp:
1364         (WKPageSetPageUIClient):
1365         * UIProcess/API/C/WKPageUIClient.h:
1366         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
1367         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID):
1368         (WebKit::WebVideoFullscreenManagerProxy::fullscreenModeChanged):
1369
1370 2017-05-12  Brent Fulgham  <bfulgham@apple.com>
1371
1372         REGRESSION(r213564): Flash audio playback failures
1373         https://bugs.webkit.org/show_bug.cgi?id=171876
1374         <rdar://problem/32082745>
1375
1376         Reviewed by Alexey Proskuryakov.
1377
1378         The IOKit property filters added in r213564 need to be expanded to support
1379         some Flash features.
1380
1381         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
1382
1383 2017-05-12  Brent Fulgham  <bfulgham@apple.com>
1384
1385         [WK2][macOS] Add a mach-lookup exception for 'com.apple.analyticsd'
1386         https://bugs.webkit.org/show_bug.cgi?id=172040
1387         <rdar://problem/31765514>
1388
1389         Reviewed by Alexey Proskuryakov.
1390
1391         * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in:
1392         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
1393         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
1394         * WebProcess/com.apple.WebProcess.sb.in:
1395
1396 2017-05-12  Simon Fraser  <simon.fraser@apple.com>
1397
1398         Add some logging for layer tree commits, and resize and orientation change events
1399         https://bugs.webkit.org/show_bug.cgi?id=172041
1400
1401         Reviewed by Tim Horton.
1402
1403         Add some logging that's useful during rotation investigations.
1404
1405         * UIProcess/API/Cocoa/WKWebView.mm:
1406         (-[WKWebView _didCommitLayerTree:]):
1407         * UIProcess/ios/WKContentView.mm:
1408         (-[WKContentView _didCommitLayerTree:]):
1409
1410 2017-05-12  Andy Estes  <aestes@apple.com>
1411
1412         [Cocoa] Stop setting a status on PKPaymentRequestShippingContactUpdate when there are errors
1413         https://bugs.webkit.org/show_bug.cgi?id=172036
1414         <rdar://problem/31587957>
1415
1416         Reviewed by Anders Carlsson.
1417
1418         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1419         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection):
1420
1421 2017-05-12  Chris Dumez  <cdumez@apple.com>
1422
1423         Stop using PassRefPtr under WebKit2/Shared
1424         https://bugs.webkit.org/show_bug.cgi?id=172017
1425
1426         Reviewed by Antti Koivisto.
1427
1428         * Shared/API/APIDictionary.cpp:
1429         (API::Dictionary::add):
1430         (API::Dictionary::set):
1431         * Shared/API/APIDictionary.h:
1432         * Shared/API/APISecurityOrigin.h:
1433         (API::SecurityOrigin::createFromString):
1434         (API::SecurityOrigin::create):
1435         (API::SecurityOrigin::securityOrigin):
1436         (API::SecurityOrigin::SecurityOrigin):
1437         * Shared/API/APISerializedScriptValue.h:
1438         (API::SerializedScriptValue::create):
1439         (API::SerializedScriptValue::SerializedScriptValue):
1440         * Shared/API/c/WKSharedAPICast.h:
1441         (WebKit::ProxyingRefPtr::ProxyingRefPtr):
1442         * Shared/APIWebArchiveResource.h:
1443         * Shared/APIWebArchiveResource.mm:
1444         (API::WebArchiveResource::create):
1445         (API::WebArchiveResource::WebArchiveResource):
1446         * Shared/AsyncRequest.h:
1447         (WebKit::AsyncRequestMap::add):
1448         * Shared/BlobDataFileReferenceWithSandboxExtension.cpp:
1449         (WebKit::BlobDataFileReferenceWithSandboxExtension::BlobDataFileReferenceWithSandboxExtension):
1450         * Shared/BlobDataFileReferenceWithSandboxExtension.h:
1451         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
1452         (WebKit::CoordinatedBackingStoreTile::setBackBuffer):
1453         (WebKit::CoordinatedBackingStore::updateTile):
1454         * Shared/CoordinatedGraphics/CoordinatedBackingStore.h:
1455         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1456         (WebKit::CoordinatedGraphicsScene::createUpdateAtlas):
1457         (WebKit::CoordinatedGraphicsScene::updateImageBacking):
1458         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
1459         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
1460         (WebKit::NetscapePluginModule::getOrCreate):
1461         * Shared/Plugins/Netscape/NetscapePluginModule.h:
1462         * Shared/VisitedLinkTable.cpp:
1463         (WebKit::VisitedLinkTable::setSharedMemory):
1464         * Shared/VisitedLinkTable.h:
1465         * Shared/WebBackForwardListItem.h:
1466         (WebKit::WebBackForwardListItem::setSnapshot):
1467         * Shared/WebContextMenuItem.cpp:
1468         (WebKit::WebContextMenuItem::create):
1469         * Shared/WebContextMenuItem.h:
1470         * Shared/WebGeolocationPosition.h:
1471         * Shared/WebRenderLayer.cpp:
1472         (WebKit::WebRenderLayer::create):
1473         (WebKit::WebRenderLayer::createArrayFromLayerList):
1474         (WebKit::WebRenderLayer::WebRenderLayer):
1475         * Shared/WebRenderLayer.h:
1476         * Shared/WebRenderObject.cpp:
1477         (WebKit::WebRenderObject::create):
1478         (WebKit::WebRenderObject::WebRenderObject):
1479         * Shared/WebRenderObject.h:
1480         * UIProcess/VisitedLinkStore.cpp:
1481         (WebKit::VisitedLinkStore::resizeTable):
1482         * WebProcess/WebPage/VisitedLinkTableController.cpp:
1483         (WebKit::VisitedLinkTableController::setVisitedLinkTable):
1484
1485 2017-05-11  Brady Eidson  <beidson@apple.com>
1486
1487         [WKWebsiteDataStore removeDataOfTypes:...] doesn't work for IndexedDB if the data store has a custom IDB path.
1488         <rdar://problem/30612463> and https://bugs.webkit.org/show_bug.cgi?id=171994
1489
1490         Reviewed by Andy Estes.
1491         Informal review by Maureen Daum.
1492
1493         * DatabaseProcess/DatabaseProcess.cpp:
1494         (WebKit::DatabaseProcess::deleteWebsiteData): Instead of accessing the m_idbServers set directly, make
1495           the method call that creates the server on demand.
1496         (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins): Ditto.
1497
1498         * UIProcess/WebProcessPool.cpp:
1499         (WebKit::WebProcessPool::ensureDatabaseProcessAndWebsiteDataStore): Not only create the DatabaseProcess if necessary,
1500           but also notify it about the passed-in WebsiteDataStore.
1501         (WebKit::WebProcessPool::getDatabaseProcessConnection):
1502         (WebKit::WebProcessPool::ensureDatabaseProcess): Deleted.
1503         * UIProcess/WebProcessPool.h:
1504         (WebKit::WebProcessPool::sendToDatabaseProcessRelaunchingIfNecessary):
1505
1506         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1507         (WebKit::WebsiteDataStore::fetchData):
1508         (WebKit::WebsiteDataStore::removeData):
1509         (WebKit::WebsiteDataStore::databaseProcessParameters):
1510
1511 2017-05-11  Dean Jackson  <dino@apple.com>
1512
1513         Modern Media Controls shouldn't be an experimental feature
1514         https://bugs.webkit.org/show_bug.cgi?id=172004
1515         <rdar://problem/32146522>
1516
1517         Reviewed by Simon Fraser.
1518
1519         This is either always on or always off, so shouldn't
1520         show up in an Experimental Features menu.
1521
1522         * Shared/WebPreferencesDefinitions.h: Move ModernMediaControlsEnabled
1523         to a normal preference.
1524
1525 2017-05-11  Tim Horton  <timothy_horton@apple.com>
1526
1527         Mail spins launching spell checker when typing
1528         https://bugs.webkit.org/show_bug.cgi?id=171986
1529         <rdar://problem/26305327>
1530
1531         Reviewed by Beth Dakin.
1532
1533         * UIProcess/API/Cocoa/WKWebView.mm:
1534         (-[WKWebView _setEditable:]):
1535         * UIProcess/Cocoa/WebViewImpl.h:
1536         * UIProcess/Cocoa/WebViewImpl.mm:
1537         (WebKit::WebViewImpl::didBecomeEditable):
1538         (WebKit::WebViewImpl::startObservingFontPanel): Deleted.
1539         Asynchronously pre-warm the spell checker when a WKWebView becomes editable.
1540
1541 2017-05-11  Chris Dumez  <cdumez@apple.com>
1542
1543         Stop using PassRefPtr in platform/graphics
1544         https://bugs.webkit.org/show_bug.cgi?id=171977
1545
1546         Reviewed by Alex Christensen.
1547
1548         Build fix.
1549
1550         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1551         (WebKit::CoordinatedGraphicsScene::createBackingStoreIfNeeded):
1552         (WebKit::CoordinatedGraphicsScene::removeBackingStoreIfNeeded):
1553         * Shared/WebCoreArgumentCoders.cpp:
1554         (IPC::ArgumentCoder<Cursor>::decode):
1555         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
1556         (WebKit::CompositingCoordinator::createImageBackingIfNeeded):
1557         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
1558         * WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp:
1559         (WebKit::GraphicsLayerCARemote::createPlatformCALayer):
1560         (WebKit::GraphicsLayerCARemote::createPlatformCAAnimation):
1561         * WebProcess/WebPage/mac/GraphicsLayerCARemote.h:
1562         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.h:
1563         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
1564         (WebKit::PlatformCAAnimationRemote::copy):
1565
1566 2017-05-11  Tim Horton  <timothy_horton@apple.com>
1567
1568         Data loss when saving a PDF form where only radio buttons/checkboxes were modified
1569         https://bugs.webkit.org/show_bug.cgi?id=171991
1570         <rdar://problem/32115945>
1571
1572         Reviewed by Andy Estes.
1573
1574         * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h:
1575         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1576         (-[WKPDFLayerControllerDelegate didChangeAnnotationState]):
1577         Mark the PDF as dirty (so we re-encode it when asked to save) if annotations
1578         that only PDFKit knows about change.
1579
1580 2017-05-11  Joseph Pecoraro  <pecoraro@apple.com>
1581
1582         Remove Vibration API
1583         https://bugs.webkit.org/show_bug.cgi?id=171766
1584
1585         Rubber-stamped by Alexey Proskuryakov.
1586
1587         * CMakeLists.txt:
1588         * Shared/API/APIObject.h:
1589         * Shared/API/c/WKBase.h:
1590         * UIProcess/API/C/WKAPICast.h:
1591         * UIProcess/API/C/WKPage.cpp:
1592         (WKPageGetVibration): Deleted.
1593         * UIProcess/API/C/WKPage.h:
1594         * UIProcess/API/C/WKVibration.cpp: Removed.
1595         * UIProcess/API/C/WKVibration.h: Removed.
1596         * UIProcess/WebPageProxy.cpp:
1597         (WebKit::m_weakPtrFactory):
1598         (WebKit::WebPageProxy::resetState):
1599         * UIProcess/WebPageProxy.h:
1600         (WebKit::WebPageProxy::vibration): Deleted.
1601         * UIProcess/WebVibrationProvider.cpp: Removed.
1602         * UIProcess/WebVibrationProvider.h: Removed.
1603         * UIProcess/WebVibrationProxy.cpp: Removed.
1604         * UIProcess/WebVibrationProxy.h: Removed.
1605         * UIProcess/WebVibrationProxy.messages.in: Removed.
1606         * WebProcess/WebCoreSupport/WebVibrationClient.cpp: Removed.
1607         * WebProcess/WebCoreSupport/WebVibrationClient.h: Removed.
1608         * WebProcess/WebPage/WebPage.cpp:
1609
1610 2017-05-11  Andy Estes  <aestes@apple.com>
1611
1612         Fix a spelling mistake in ApplePayErrorCode
1613         https://bugs.webkit.org/show_bug.cgi?id=171981
1614         <rdar://problem/32136567>
1615
1616         Reviewed by Beth Dakin.
1617
1618         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1619         (WebKit::toPKPaymentErrorCode):
1620         (WebKit::toPKPaymentAuthorizationStatus):
1621
1622 2017-05-11  John Wilander  <wilander@apple.com>
1623
1624         Resource Load Statistics: Enable configuration through preferences
1625         https://bugs.webkit.org/show_bug.cgi?id=171949
1626         <rdar://problem/31894518>
1627
1628         Reviewed by Alex Christensen.
1629
1630         * Shared/WebPreferencesDefinitions.h:
1631             Added ResourceLoadStatisticsTimeToLiveUserInteraction,
1632             ResourceLoadStatisticsTimeToLiveCookiePartitionFree, and
1633             ResourceLoadStatisticsReducedTimestampResolution.
1634         * UIProcess/Cocoa/WebResourceLoadStatisticsManagerCocoa.mm: Added.
1635         (WebKit::WebResourceLoadStatisticsManager::registerUserDefaultsIfNeeded):
1636         * UIProcess/WebResourceLoadStatisticsManager.h:
1637         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1638         (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver):
1639             Now calls WebResourceLoadStatisticsManager::registerUserDefaultsIfNeeded().
1640         * WebKit2.xcodeproj/project.pbxproj:
1641
1642 2017-05-11  Claudio Saavedra  <csaavedra@igalia.com>
1643
1644         [GTK] Remove notifications guards from GTK API layer
1645         https://bugs.webkit.org/show_bug.cgi?id=170014
1646
1647         Reviewed by Michael Catanzaro.
1648
1649         ENABLE_NOTIFICATIONS in the GTK port is a private option and
1650         disabling it is unsupported, hence remove its guards from the GTK API
1651         layer.
1652
1653         * UIProcess/API/gtk/WebKitWebContext.cpp:
1654         (webkitWebContextConstructed):
1655
1656 2017-05-11  Carlos Garcia Campos  <cgarcia@igalia.com>
1657
1658         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.17.2 release.
1659
1660         * gtk/NEWS: Add release notes for 2.17.2.
1661
1662 2017-05-11  Claudio Saavedra  <csaavedra@igalia.com>
1663
1664         [GTK] JavaScript prompt uses title of page to be loaded rather than title of current page
1665         https://bugs.webkit.org/show_bug.cgi?id=152690
1666
1667         Reviewed by Michael Catanzaro.
1668
1669         webkit_web_view_get_uri() returns the page to be loaded, use
1670         internal api for this.
1671         * UIProcess/API/gtk/WebKitWebView.cpp:
1672         (webkitWebViewCreateJavaScriptDialog):
1673
1674 2017-05-10  Tim Horton  <timothy_horton@apple.com>
1675
1676         Null deref in WebPage::dictionaryPopupInfoForRange
1677         https://bugs.webkit.org/show_bug.cgi?id=171959
1678         <rdar://problem/20886282>
1679
1680         Reviewed by Beth Dakin.
1681
1682         * WebProcess/WebPage/mac/WebPageMac.mm:
1683         (WebKit::WebPage::dictionaryPopupInfoForRange):
1684         Speculative fix for non-reproducible crash when the startContainer of
1685         the range is in an anonymous node.
1686
1687 2017-05-09  Sam Weinig  <sam@webkit.org>
1688
1689         Remove support for legacy Notifications
1690         https://bugs.webkit.org/show_bug.cgi?id=171487
1691
1692         Reviewed by Jon Lee.
1693
1694         * Configurations/FeatureDefines.xcconfig:
1695         * Shared/WebProcessCreationParameters.cpp:
1696         * Shared/WebProcessCreationParameters.h:
1697         * UIProcess/WebProcessPool.cpp:
1698         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1699         * WebProcess/Notifications/NotificationPermissionRequestManager.cpp:
1700         * WebProcess/Notifications/NotificationPermissionRequestManager.h:
1701         * WebProcess/Notifications/WebNotificationManager.cpp:
1702         * WebProcess/Notifications/WebNotificationManager.h:
1703         * WebProcess/WebCoreSupport/WebNotificationClient.cpp:
1704         * WebProcess/WebCoreSupport/WebNotificationClient.h:
1705         * WebProcess/WebPage/WebPage.cpp:
1706         * WebProcess/WebProcess.cpp:
1707         Remove legacy notification specific code.
1708
1709 2017-05-10  Tim Horton  <timothy_horton@apple.com>
1710
1711         Add an experimental feature flag for viewport-fit
1712         https://bugs.webkit.org/show_bug.cgi?id=171948
1713         <rdar://problem/31995518>
1714
1715         Reviewed by Simon Fraser.
1716
1717         * Shared/WebPreferencesDefinitions.h:
1718         * WebProcess/WebPage/WebPage.cpp:
1719         (WebKit::WebPage::updatePreferences):
1720         Add an experimental feature flag.
1721
1722 2017-05-10  Alex Christensen  <achristensen@webkit.org>
1723
1724         Include headers in WebKit.h
1725         https://bugs.webkit.org/show_bug.cgi?id=171943
1726
1727         Reviewed by Dan Bernstein.
1728
1729         * Shared/API/Cocoa/WebKit.h:
1730
1731 2017-05-10  Timothy Horton  <timothy_horton@apple.com>
1732
1733         Disable block selection for dynamic selection granularity
1734         https://bugs.webkit.org/show_bug.cgi?id=171908
1735         <rdar://problem/32098024>
1736
1737         Reviewed by Enrica Casucci.
1738
1739         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1740         (-[WKWebViewConfiguration init]):
1741         (-[WKWebViewConfiguration copyWithZone:]):
1742         (-[WKWebViewConfiguration _allowsBlockSelection]):
1743         (-[WKWebViewConfiguration _setAllowsBlockSelection:]):
1744         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1745         Add a private configuration parameter to re-enable block selection.
1746
1747         * Shared/WebPageCreationParameters.cpp:
1748         (WebKit::WebPageCreationParameters::encode):
1749         (WebKit::WebPageCreationParameters::decode):
1750         * Shared/WebPageCreationParameters.h:
1751         * UIProcess/API/Cocoa/WKWebView.mm:
1752         (-[WKWebView _allowsBlockSelection]):
1753         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1754         * UIProcess/Cocoa/VersionChecks.h:
1755         * UIProcess/PageClient.h:
1756         * UIProcess/WebPageProxy.cpp:
1757         (WebKit::WebPageProxy::creationParameters):
1758         * UIProcess/ios/PageClientImplIOS.h:
1759         * UIProcess/ios/PageClientImplIOS.mm:
1760         (WebKit::PageClientImpl::allowsBlockSelection):
1761         * WebProcess/WebPage/WebPage.cpp:
1762         * WebProcess/WebPage/WebPage.h:
1763         Plumb allowsBlockSelection through from WKWebViewConfiguration to WebPage.
1764
1765         * UIProcess/ios/WKContentViewInteraction.mm:
1766         (-[WKContentView setupInteraction]):
1767         (-[WKContentView useSelectionAssistantWithGranularity:]):
1768         (-[WKContentView _startAssistingKeyboard]):
1769         (-[WKContentView _stopAssistingKeyboard]):
1770         (toUIWebSelectionMode): Deleted.
1771         (-[WKContentView useSelectionAssistantWithMode:]): Deleted.
1772         Stop needlessly converting to UIWebSelectionMode.
1773         
1774         * WebProcess/WebPage/ios/WebPageIOS.mm:
1775         (WebKit::WebPage::shouldSwitchToBlockModeForHandle):
1776         Don't switch to block selection unless allowsBlockSelection is set.
1777
1778 2017-05-10  Tim Horton  <timothy_horton@apple.com>
1779
1780         Add an experimental feature flag for constant properties
1781         https://bugs.webkit.org/show_bug.cgi?id=171913
1782         <rdar://problem/31995518>
1783
1784         Reviewed by Ryosuke Niwa.
1785
1786         * Shared/WebPreferencesDefinitions.h:
1787         * WebProcess/WebPage/WebPage.cpp:
1788         (WebKit::WebPage::updatePreferences):
1789         Add an experimental feature flag.
1790
1791 2017-05-09  Dean Jackson  <dino@apple.com>
1792
1793         Disable WebGL2 by default
1794         https://bugs.webkit.org/show_bug.cgi?id=171894
1795         <rdar://problem/32089917>
1796
1797         Reviewed by Tim Horton.
1798
1799         Some WASM and WebGL2 content is failing because it
1800         detects our WebGL2RenderingContext, but doesn't realise
1801         that we don't implement enough of it to be useful.
1802
1803         * Shared/WebPreferencesDefinitions.h:
1804
1805 2017-05-10  Matt Lewis  <jlewis3@apple.com>
1806
1807         Unreviewed, rolling out r216563.
1808
1809         Revision caused 2 api failures
1810
1811         Reverted changeset:
1812
1813         "[MediaStream] deviceId constraint doesn't work with
1814         getUserMedia"
1815         https://bugs.webkit.org/show_bug.cgi?id=171877
1816         http://trac.webkit.org/changeset/216563
1817
1818 2017-05-10  Claudio Saavedra  <csaavedra@igalia.com>
1819
1820         [GTK] HTTP authentication dialog should focus on first input field
1821         https://bugs.webkit.org/show_bug.cgi?id=151349
1822
1823         Reviewed by Michael Catanzaro.
1824
1825         Setting focus on a widget before it's mapped does nothing. Move
1826         the call to the right place.
1827
1828         * UIProcess/API/gtk/WebKitAuthenticationDialog.cpp:
1829         (webkitAuthenticationDialogInitialize):
1830         (webkitAuthenticationDialogMap):
1831
1832 2017-05-10  Michael Catanzaro  <mcatanzaro@igalia.com>
1833
1834         [GTK] -Wmissing-field-initializers triggered by RemoteInspectorServer.cpp:128
1835         https://bugs.webkit.org/show_bug.cgi?id=171273
1836
1837         Reviewed by Carlos Garcia Campos.
1838
1839         * UIProcess/glib/RemoteInspectorClient.cpp:
1840         (WebKit::RemoteInspectorClient::RemoteInspectorClient):
1841
1842 2017-05-09  Eric Carlson  <eric.carlson@apple.com>
1843
1844         [MediaStream] deviceId constraint doesn't work with getUserMedia
1845         https://bugs.webkit.org/show_bug.cgi?id=171877
1846         <rdar://problem/31899730>
1847
1848         Reviewed by Jer Noble.
1849
1850         * Shared/WebCoreArgumentCoders.cpp:
1851         (IPC::ArgumentCoder<MediaConstraintsData>::encode): Encode deviceIDHashSalt.
1852         (IPC::ArgumentCoder<MediaConstraintsData>::decode): Decode deviceIDHashSalt.
1853
1854         * UIProcess/UserMediaPermissionCheckProxy.cpp:
1855         (WebKit::UserMediaPermissionCheckProxy::UserMediaPermissionCheckProxy): Initialize
1856         completion handler, frame ID, and security origins.
1857         (WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo): Complete by calling
1858         completion handler because we now sometimes request access info before calling gUM.
1859         (WebKit::UserMediaPermissionCheckProxy::invalidate): Clear completion handler.
1860         * UIProcess/UserMediaPermissionCheckProxy.h:
1861
1862         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1863         (WebKit::FrameAuthorizationState::FrameAuthorizationState): Take security origins, not
1864         UserMediaPermissionRequestProxy, so it can be constructed with a UserMediaPermissionCheckProxy.
1865         (WebKit::FrameAuthorizationState::ensureSecurityOriginsAreEqual): Ditto. Clear has salt
1866         when origins don't match.
1867         (WebKit::UserMediaPermissionRequestManagerProxy::stateForRequest): Templatize.
1868         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied): Fix typo.
1869         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Ditto.
1870         Don't set state for empty UIDs. Pass hash salt to web process.
1871         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
1872         The device ID hash salt is now required to validate constraints, so get it first.
1873         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo): Helper
1874         method used to get the device ID hash salt.
1875         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Restructure
1876         to use getUserMediaPermissionInfo.
1877         (WebKit::UserMediaPermissionRequestManagerProxy::didCompleteUserMediaPermissionCheck): Deleted.
1878         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
1879
1880         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
1881         (WebKit::UserMediaPermissionRequestManager::userMediaAccessWasGranted): Add device ID
1882         hash salt parameter.
1883         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
1884
1885         * WebProcess/WebPage/WebPage.cpp:
1886         (WebKit::WebPage::userMediaAccessWasGranted): Ditto.
1887         * WebProcess/WebPage/WebPage.h:
1888         * WebProcess/WebPage/WebPage.messages.in:
1889
1890         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
1891         (WebKit::UserMediaCaptureManager::createCaptureSource): Use new MediaConstraintsData 
1892         constructor.
1893
1894 2017-05-09  Alex Christensen  <achristensen@webkit.org>
1895
1896         Buffer media in NetworkProcess to reduce IPC overhead
1897         https://bugs.webkit.org/show_bug.cgi?id=171834
1898         <rdar://problem/31485485>
1899
1900         Reviewed by Jer Noble.
1901
1902         I have measured a significant CPU usage reduction when buffering media data in the NetworkProcess,
1903         especially on arm64 processors.  Buffering data in the NetworkProcess introduces no additional data
1904         copies after r215686, and it reduces the number of messages sent from the NetworkProcess to the WebProcess,
1905         each of which must also be forwarded to mediaserverd by AVFoundation.  This reduces the number of messages
1906         from thousands per second to a maximum of 20 per second.  This adds 1/20 second additional latency in
1907         media loading, which will probably not be noticed by most users.  This also adds the possibility of large
1908         allocations when decoding IPC messages in the WebProcess, and if that becomes the source of crashes we can
1909         add a maximum buffered amount in addition to a maximum buffered time, but we are likely not to receive
1910         so much data in 1/20 second to have problems allocating the buffer.
1911
1912         * WebProcess/Network/WebLoaderStrategy.cpp:
1913         (WebKit::maximumBufferingTime):
1914         Buffer data in the NetworkProcess for up to 50ms before sending it to the WebProcess in one message.
1915         This value is used in NetworkResourceLoader::didReceiveBuffer to append to m_bufferedData instead of
1916         sending the small chunks immediately.
1917
1918 2017-05-09  Commit Queue  <commit-queue@webkit.org>
1919
1920         Unreviewed, rolling out r216545.
1921         https://bugs.webkit.org/show_bug.cgi?id=171889
1922
1923         Caused a test failure (Requested by eric_carlson on #webkit).
1924
1925         Reverted changeset:
1926
1927         "[MediaStream] deviceId constraint doesn't work with
1928         getUserMedia"
1929         https://bugs.webkit.org/show_bug.cgi?id=171877
1930         http://trac.webkit.org/changeset/216545
1931
1932 2017-05-09  Eric Carlson  <eric.carlson@apple.com>
1933
1934         [MediaStream] deviceId constraint doesn't work with getUserMedia
1935         https://bugs.webkit.org/show_bug.cgi?id=171877
1936         <rdar://problem/31899730>
1937
1938         Reviewed by Jer Noble.
1939
1940         * Shared/WebCoreArgumentCoders.cpp:
1941         (IPC::ArgumentCoder<MediaConstraintsData>::encode): Encode deviceIDHashSalt.
1942         (IPC::ArgumentCoder<MediaConstraintsData>::decode): Decode deviceIDHashSalt.
1943
1944         * UIProcess/UserMediaPermissionCheckProxy.cpp:
1945         (WebKit::UserMediaPermissionCheckProxy::UserMediaPermissionCheckProxy): Initialize
1946         completion handler, frame ID, and security origins.
1947         (WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo): Complete by calling
1948         completion handler because we now sometimes request access info before calling gUM.
1949         (WebKit::UserMediaPermissionCheckProxy::invalidate): Clear completion handler.
1950         * UIProcess/UserMediaPermissionCheckProxy.h:
1951
1952         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1953         (WebKit::FrameAuthorizationState::FrameAuthorizationState): Take security origins, not
1954         UserMediaPermissionRequestProxy, so it can be constructed with a UserMediaPermissionCheckProxy.
1955         (WebKit::FrameAuthorizationState::ensureSecurityOriginsAreEqual): Ditto. Clear has salt
1956         when origins don't match.
1957         (WebKit::UserMediaPermissionRequestManagerProxy::stateForRequest): Templatize.
1958         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied): Fix typo.
1959         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Ditto.
1960         Don't set state for empty UIDs. Pass hash salt to web process.
1961         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
1962         The device ID hash salt is now required to validate constraints, so get it first.
1963         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo): Helper
1964         method used to get the device ID hash salt.
1965         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Restructure
1966         to use getUserMediaPermissionInfo.
1967         (WebKit::UserMediaPermissionRequestManagerProxy::didCompleteUserMediaPermissionCheck): Deleted.
1968         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
1969
1970         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
1971         (WebKit::UserMediaPermissionRequestManager::userMediaAccessWasGranted): Add device ID
1972         hash salt parameter.
1973         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
1974
1975         * WebProcess/WebPage/WebPage.cpp:
1976         (WebKit::WebPage::userMediaAccessWasGranted): Ditto.
1977         * WebProcess/WebPage/WebPage.h:
1978         * WebProcess/WebPage/WebPage.messages.in:
1979
1980         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
1981         (WebKit::UserMediaCaptureManager::createCaptureSource): Use new MediaConstraintsData 
1982         constructor.
1983
1984 2017-05-10  Dean Jackson  <dino@apple.com>
1985
1986         Restrict SVG filters to accessible security origins
1987         https://bugs.webkit.org/show_bug.cgi?id=118689
1988         <rdar://problem/27362159>
1989
1990         Reviewed by Brent Fulgham.
1991
1992         Update parameter lists.
1993
1994         * WebProcess/Plugins/PluginView.cpp:
1995         (WebKit::PluginView::paint):
1996         * WebProcess/Plugins/PluginView.h:
1997
1998 2017-05-09  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
1999
2000         [Coordinated Graphics] Debug Visuals don't hide
2001         https://bugs.webkit.org/show_bug.cgi?id=162704
2002
2003         Reviewed by Žan Doberšek.
2004
2005         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
2006         (IPC::ArgumentCoder<CoordinatedGraphicsLayerState>::encode):
2007         (IPC::ArgumentCoder<CoordinatedGraphicsLayerState>::decode):
2008         (IPC::ArgumentCoder<DebugVisuals>::encode):
2009         (IPC::ArgumentCoder<DebugVisuals>::decode):
2010         The encoder and decoder for DebugVisuals have been added.
2011
2012         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.h:
2013         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
2014         (WebKit::CoordinatedGraphicsScene::setLayerState):
2015         Update the debug visuals of a layer according to the DebugVisuals information
2016         if the debugVisualsChanged flag is set to true.
2017
2018 2017-05-09  Zan Dobersek  <zdobersek@igalia.com>
2019
2020         Upstream the WPE port
2021         https://bugs.webkit.org/show_bug.cgi?id=171110
2022
2023         Reviewed by Alex Christensen.
2024
2025         webkit-dev thread:
2026         https://lists.webkit.org/pipermail/webkit-dev/2017-April/028923.html
2027
2028         Existing files changed to properly use PLATFORM(WPE) build guards or other
2029         WPE-specific additions (e.g. pasteboard support).
2030         In-file changes removed from this ChangeLog entry for brevity.
2031
2032         * Platform/IPC/glib/GSocketMonitor.cpp:
2033         * PlatformWPE.cmake: Added.
2034         * Scripts/generate-forwarding-headers.pl:
2035         * Shared/API/c/WKBase.h:
2036         * Shared/API/c/wpe/WKBaseWPE.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
2037         * Shared/API/c/wpe/WebKit.h: Added.
2038         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
2039         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
2040         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
2041         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
2042         * Shared/DrawingAreaInfo.h:
2043         * Shared/NativeWebKeyboardEvent.h:
2044         * Shared/NativeWebMouseEvent.h:
2045         * Shared/NativeWebTouchEvent.h:
2046         * Shared/NativeWebWheelEvent.h:
2047         * Shared/WebCoreArgumentCoders.cpp:
2048         * Shared/WebCoreArgumentCoders.h:
2049         * Shared/WebPreferencesDefinitions.h:
2050         * Shared/wpe/NativeWebKeyboardEventWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
2051         * Shared/wpe/NativeWebMouseEventWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
2052         * Shared/wpe/NativeWebTouchEventWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
2053         * Shared/wpe/NativeWebWheelEventWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
2054         * Shared/wpe/ProcessExecutablePathWPE.cpp: Added.
2055         * Shared/wpe/WebEventFactory.cpp: Added.
2056         * Shared/wpe/WebEventFactory.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
2057         * UIProcess/API/C/WKAPICast.h:
2058         * UIProcess/API/C/wpe/WKAPICastWPE.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
2059         * UIProcess/API/C/wpe/WKView.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
2060         * UIProcess/API/C/wpe/WKView.h: Copied from Source/WebKit2/Shared/NativeWebWheelEvent.h.
2061         * UIProcess/API/wpe/CompositingManagerProxy.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
2062         * UIProcess/API/wpe/CompositingManagerProxy.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
2063         * UIProcess/API/wpe/CompositingManagerProxy.messages.in: Added.
2064         * UIProcess/API/wpe/DrawingAreaProxyWPE.cpp: Added.
2065         * UIProcess/API/wpe/DrawingAreaProxyWPE.h: Copied from Source/WebKit2/Shared/NativeWebWheelEvent.h.
2066         * UIProcess/API/wpe/PageClientImpl.cpp: Added.
2067         * UIProcess/API/wpe/PageClientImpl.h: Added.
2068         * UIProcess/API/wpe/ScrollGestureController.cpp: Added.
2069         * UIProcess/API/wpe/ScrollGestureController.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
2070         * UIProcess/API/wpe/WPEView.cpp: Added.
2071         * UIProcess/API/wpe/WPEView.h: Added.
2072         * UIProcess/API/wpe/WPEViewClient.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
2073         * UIProcess/API/wpe/WPEViewClient.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
2074         * UIProcess/API/wpe/WebKit2InspectorGResourceBundle.xml: Added.
2075         * UIProcess/ChildProcessProxy.cpp:
2076         * UIProcess/Launcher/ProcessLauncher.h:
2077         * UIProcess/Launcher/wpe/ProcessLauncherWPE.cpp: Added.
2078         * UIProcess/WebInspectorProxy.h:
2079         * UIProcess/WebPasteboardProxy.h:
2080         * UIProcess/WebPasteboardProxy.messages.in:
2081         * UIProcess/WebProcessPool.cpp:
2082         * UIProcess/wpe/TextCheckerWPE.cpp: Added.
2083         * UIProcess/wpe/WebInspectorProxyWPE.cpp: Added.
2084         * UIProcess/wpe/WebPageProxyWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
2085         * UIProcess/wpe/WebPasteboardProxyWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
2086         * UIProcess/wpe/WebPreferencesWPE.cpp: Copied from Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h.
2087         * UIProcess/wpe/WebProcessPoolWPE.cpp: Added.
2088         * WebKit2.xcodeproj/project.pbxproj:
2089         * WebKit2Prefix.h:
2090         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2091         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2092         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
2093         * WebProcess/WebCoreSupport/wpe/WebContextMenuClientWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
2094         * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp: Added.
2095         * WebProcess/WebCoreSupport/wpe/WebPopupMenuWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
2096         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
2097         * WebProcess/WebPage/DrawingArea.cpp:
2098         * WebProcess/WebPage/WebPage.cpp:
2099         * WebProcess/WebPage/WebPage.h:
2100         * WebProcess/WebPage/wpe/CompositingManager.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
2101         * WebProcess/WebPage/wpe/CompositingManager.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
2102         * WebProcess/WebPage/wpe/DrawingAreaWPE.cpp: Added.
2103         * WebProcess/WebPage/wpe/DrawingAreaWPE.h: Added.
2104         * WebProcess/WebPage/wpe/WebInspectorUIWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
2105         * WebProcess/WebPage/wpe/WebInspectorWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
2106         * WebProcess/WebPage/wpe/WebPageWPE.cpp: Copied from Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h.
2107         * WebProcess/wpe/WebProcessMainWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
2108         * wpe/wpe-webkit.pc.in: Added.
2109
2110 2017-05-09  Carlos Garcia Campos  <cgarcia@igalia.com>
2111
2112         [GTK] Building Webkit2Gtk without OpenGL fails.
2113         https://bugs.webkit.org/show_bug.cgi?id=170959
2114
2115         Reviewed by Žan Doberšek.
2116
2117         * UIProcess/gtk/HardwareAccelerationManager.cpp:
2118         (WebKit::HardwareAccelerationManager::HardwareAccelerationManager):
2119
2120 2017-05-08  Youenn Fablet  <youenn@apple.com>
2121
2122         Follow-up to bug 171710: use more references and reject if either audio or video source creation is failing
2123         https://bugs.webkit.org/show_bug.cgi?id=171824
2124
2125         Reviewed by Alex Christensen.
2126
2127         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
2128         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
2129
2130 2017-05-08  Brent Fulgham  <bfulgham@apple.com>
2131
2132         REGRESSION(r213564): Flash video playback failures
2133         https://bugs.webkit.org/show_bug.cgi?id=171840
2134         <rdar://problem/32041569>
2135
2136         Reviewed by Alexey Proskuryakov.
2137
2138         The sandbox restrictions added in r213564 to prevent access to unused iokit properties
2139         blocked some items needed for Flash video playback. This change relaxes the sandbox
2140         to allow this software to run properly.
2141
2142         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
2143
2144 2017-05-08  Alex Christensen  <achristensen@webkit.org>
2145
2146         Reduce PassRefPtr use in WebKit2
2147         https://bugs.webkit.org/show_bug.cgi?id=171831
2148
2149         Reviewed by Chris Dumez.
2150
2151         * UIProcess/API/C/WKPageGroup.cpp:
2152         (WKPageGroupCreateWithIdentifier):
2153         * UIProcess/GenericCallback.h:
2154         (WebKit::GenericCallback::create):
2155         (WebKit::CallbackMap::put):
2156         * UIProcess/StatisticsRequest.cpp:
2157         (WebKit::StatisticsRequest::StatisticsRequest):
2158         * UIProcess/StatisticsRequest.h:
2159         (WebKit::StatisticsRequest::create):
2160         * UIProcess/TextChecker.h:
2161         * UIProcess/TextCheckerCompletion.cpp:
2162         (WebKit::TextCheckerCompletion::create):
2163         * UIProcess/TextCheckerCompletion.h:
2164         * UIProcess/WebColorPicker.h:
2165         (WebKit::WebColorPicker::create):
2166         * UIProcess/WebConnectionToWebProcess.cpp:
2167         (WebKit::WebConnectionToWebProcess::create):
2168         * UIProcess/WebConnectionToWebProcess.h:
2169         * UIProcess/WebContextInjectedBundleClient.cpp:
2170         (WebKit::WebContextInjectedBundleClient::getInjectedBundleInitializationUserData):
2171         * UIProcess/WebContextInjectedBundleClient.h:
2172         * UIProcess/WebContextMenuListenerProxy.h:
2173         (WebKit::WebContextMenuListenerProxy::create):
2174         * UIProcess/WebCookieManagerProxy.cpp:
2175         (WebKit::WebCookieManagerProxy::create):
2176         * UIProcess/WebCookieManagerProxy.h:
2177         * UIProcess/WebEditCommandProxy.h:
2178         (WebKit::WebEditCommandProxy::create):
2179         * UIProcess/WebFormSubmissionListenerProxy.h:
2180         (WebKit::WebFormSubmissionListenerProxy::create):
2181         * UIProcess/WebFrameListenerProxy.h:
2182         * UIProcess/WebFrameProxy.h:
2183         (WebKit::WebFrameProxy::create):
2184         * UIProcess/WebFullScreenManagerProxy.cpp:
2185         (WebKit::WebFullScreenManagerProxy::create):
2186         * UIProcess/WebFullScreenManagerProxy.h:
2187         * UIProcess/WebGeolocationManagerProxy.cpp:
2188         (WebKit::WebGeolocationManagerProxy::create):
2189         * UIProcess/WebGeolocationManagerProxy.h:
2190         * UIProcess/WebIconDatabase.cpp:
2191         (WebKit::WebIconDatabase::create):
2192         (WebKit::WebIconDatabase::iconDataForPageURL):
2193         * UIProcess/WebIconDatabase.h:
2194         * UIProcess/WebMediaSessionFocusManager.cpp:
2195         (WebKit::WebMediaSessionFocusManager::create):
2196         * UIProcess/WebMediaSessionFocusManager.h:
2197         * UIProcess/WebOpenPanelResultListenerProxy.h:
2198         (WebKit::WebOpenPanelResultListenerProxy::create):
2199         * UIProcess/WebPageGroup.cpp:
2200         (WebKit::WebPageGroup::create):
2201         * UIProcess/WebPageGroup.h:
2202         * UIProcess/WebPageProxy.cpp:
2203         (WebKit::WebPageProxy::forceRepaint):
2204         (WebKit::WebPageProxy::computePagesForPrinting):
2205         (WebKit::WebPageProxy::drawRectToImage):
2206         (WebKit::WebPageProxy::drawPagesToPDF):
2207         (WebKit::WebPageProxy::drawPagesForPrinting):
2208         (WebKit::WebPageProxy::callAfterNextPresentationUpdate):
2209         * UIProcess/WebPageProxy.h:
2210         * UIProcess/ios/TextCheckerIOS.mm:
2211         (WebKit::TextChecker::requestCheckingOfString):
2212         * UIProcess/mac/TextCheckerMac.mm:
2213         (WebKit::TextChecker::requestCheckingOfString):
2214         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
2215         * UIProcess/mac/WKFullScreenWindowController.mm:
2216         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
2217         * UIProcess/mac/WKPrintingView.mm:
2218         (-[WKPrintingView _preparePDFDataForPrintingOnSecondaryThread]):
2219         (-[WKPrintingView _drawPreview:]):
2220         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2221         (WebKit::NetscapePlugin::loadURL):
2222         (WebKit::NetscapePlugin::manualStreamDidReceiveResponse):
2223         * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
2224         (WebKit::NetscapePluginStream::NetscapePluginStream):
2225         * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
2226         (WebKit::NetscapePluginStream::create):
2227         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
2228         (WebKit::toFormData):
2229
2230 2017-05-08  Youenn Fablet  <youenn@apple.com>
2231
2232         Add support for reading and writing settings from UIProcess audio capture
2233         https://bugs.webkit.org/show_bug.cgi?id=171633
2234
2235         Reviewed by Eric Carlson.
2236
2237         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
2238         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
2239         (WebKit::UserMediaCaptureManagerProxy::applyConstraints):
2240         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
2241         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
2242         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
2243         (WebKit::UserMediaCaptureManager::Source::setSettings):
2244         (WebKit::UserMediaCaptureManager::Source::applyConstraintsSucceeded):
2245         (WebKit::UserMediaCaptureManager::Source::applyConstraintsFailed):
2246         (WebKit::UserMediaCaptureManager::createCaptureSource):
2247         (WebKit::UserMediaCaptureManager::sourceSettingsChanged):
2248         (WebKit::UserMediaCaptureManager::applyConstraints):
2249         (WebKit::UserMediaCaptureManager::applyConstraintsSucceeded):
2250         (WebKit::UserMediaCaptureManager::applyConstraintsFailed):
2251         (WebKit::UserMediaCaptureManager::Source::setMuted): Deleted.
2252         (WebKit::UserMediaCaptureManager::Source::setEnabled): Deleted.
2253         * WebProcess/cocoa/UserMediaCaptureManager.h:
2254         * WebProcess/cocoa/UserMediaCaptureManager.messages.in:
2255
2256 2017-05-08  Alex Christensen  <achristensen@webkit.org>
2257
2258         Reduce PassRefPtr use
2259         https://bugs.webkit.org/show_bug.cgi?id=171809
2260
2261         Reviewed by Chris Dumez.
2262
2263         * PluginProcess/PluginControllerProxy.cpp:
2264         (WebKit::PluginControllerProxy::setInitializationReply):
2265         * PluginProcess/PluginControllerProxy.h:
2266         * PluginProcess/WebProcessConnection.cpp:
2267         (WebKit::WebProcessConnection::destroyPlugin):
2268         (WebKit::WebProcessConnection::createPlugin):
2269         * PluginProcess/WebProcessConnection.h:
2270         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2271         (WebKit::WebChromeClient::runOpenPanel):
2272         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2273         (WebKit::WebEditorClient::registerUndoStep):
2274         * WebProcess/WebPage/VisitedLinkTableController.cpp:
2275         (WebKit::VisitedLinkTableController::getOrCreate):
2276         * WebProcess/WebPage/VisitedLinkTableController.h:
2277         * WebProcess/WebPage/WebFrame.cpp:
2278         (WebKit::WebFrame::hitTest):
2279         (WebKit::WebFrame::createSelectionSnapshot):
2280         * WebProcess/WebPage/WebFrame.h:
2281         * WebProcess/WebPage/WebOpenPanelResultListener.cpp:
2282         (WebKit::WebOpenPanelResultListener::create):
2283         (WebKit::WebOpenPanelResultListener::WebOpenPanelResultListener):
2284         * WebProcess/WebPage/WebOpenPanelResultListener.h:
2285         * WebProcess/WebPage/WebPage.cpp:
2286         (WebKit::WebPage::unapplyEditCommand):
2287         (WebKit::WebPage::reapplyEditCommand):
2288         * WebProcess/WebPage/WebPageGroupProxy.cpp:
2289         (WebKit::WebPageGroupProxy::create):
2290         * WebProcess/WebPage/WebPageGroupProxy.h:
2291         * WebProcess/WebPage/WebUndoStep.cpp:
2292         (WebKit::WebUndoStep::create):
2293         * WebProcess/WebPage/WebUndoStep.h:
2294         (WebKit::WebUndoStep::step):
2295         (WebKit::WebUndoStep::WebUndoStep):
2296         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
2297         (WebKit::PlatformCALayerRemote::create):
2298         (WebKit::PlatformCALayerRemote::clone):
2299         (WebKit::PlatformCALayerRemote::animationForKey):
2300         (WebKit::PlatformCALayerRemote::createCompatibleLayer):
2301         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
2302         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h:
2303         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
2304         (WebKit::PlatformCALayerRemoteCustom::create):
2305         (WebKit::PlatformCALayerRemoteCustom::clone):
2306
2307 2017-05-08  Jer Noble  <jer.noble@apple.com>
2308
2309         [Mac] Audio capture fails when shouldCaptureAudioInUIProcess is set.
2310         https://bugs.webkit.org/show_bug.cgi?id=171710
2311
2312         Reviewed by Eric Carlson.
2313
2314         RealtimeMediaSourceCenterMac's setUseAVFoundationAudioCapture() is now accessed via a singleton.
2315
2316         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2317         (WebKit::UserMediaPermissionRequestManagerProxy::syncWithWebCorePrefs):
2318
2319 2017-05-08  Andy Estes  <aestes@apple.com>
2320
2321         [macOS] com.macromedia.Flash Player ESR.plugin.sb is installed outside of PlugInSandboxProfiles
2322         https://bugs.webkit.org/show_bug.cgi?id=171774
2323
2324         Reviewed by Dan Bernstein.
2325
2326         * WebKit2.xcodeproj/project.pbxproj:
2327
2328 2017-05-08  Youenn Fablet  <youenn@apple.com>
2329
2330         Clean UserMediaCaptureManager::capabilities return value
2331         https://bugs.webkit.org/show_bug.cgi?id=171808
2332
2333         Reviewed by Eric Carlson.
2334
2335         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
2336         (WebKit::UserMediaCaptureManager::capabilities):
2337         * WebProcess/cocoa/UserMediaCaptureManager.h:
2338
2339 2017-05-08  Chris Dumez  <cdumez@apple.com>
2340
2341         Move 'style' from Element to HTMLElement / SVGElement and make it settable
2342         https://bugs.webkit.org/show_bug.cgi?id=171795
2343
2344         Reviewed by Alex Christensen.
2345
2346         Build fix.
2347
2348         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2349         (WebKit::WebEditorClient::shouldApplyStyle):
2350
2351 2017-05-07  Simon Fraser  <simon.fraser@apple.com>
2352
2353         [iOS] REGRESSION (r209409): getBoundingClientRect is wrong for fixed-position elements in resize/orientationchange
2354         https://bugs.webkit.org/show_bug.cgi?id=171140
2355         rdar://problem/31765167
2356
2357         Reviewed by Sam Weinig.
2358
2359         WebPage::dynamicViewportSizeUpdate() is called during rotation, and does a layout which needs to have
2360         an up-to-date layout viewport, since the layout viewport state is detectable in orientationchange and
2361         resize events via fetching the client rect of fixed elements. Normally we send in the layout viewport
2362         from the UI process, but in this case we need to compute one in the web process. So factor code
2363         into FrameView to do the computation, called from both places.
2364
2365         * UIProcess/WebPageProxy.h:
2366         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
2367         (WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect):
2368         * UIProcess/ios/WKContentView.mm:
2369         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
2370         * UIProcess/ios/WebPageProxyIOS.mm:
2371         (WebKit::WebPageProxy::computeCustomFixedPositionRect):
2372         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2373         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
2374         * WebProcess/WebPage/ios/WebPageIOS.mm:
2375         (WebKit::WebPage::dynamicViewportSizeUpdate):
2376
2377 2017-05-07  Youenn Fablet  <youenn@apple.com>
2378
2379         [MediaStream] r216197 caused some webrtc tests to fail
2380         https://bugs.webkit.org/show_bug.cgi?id=171728
2381
2382         Reviewed by Eric Carlson.
2383
2384         * UIProcess/UserMediaProcessManager.cpp:
2385         (WebKit::UserMediaProcessManager::willEnableMediaStreamInPage): Removing muting streams of the page requesting
2386         additional capture streams. This is now done in the WebProcess.
2387
2388 2017-05-07  Tim Horton  <timothy_horton@apple.com>
2389
2390         Clean up some WebProcessProxy, WebPage, and message handler includes
2391         https://bugs.webkit.org/show_bug.cgi?id=171791
2392
2393         Reviewed by Sam Weinig.
2394
2395         This is worth another ~10% off WebKit2 clean build time on Mac.
2396         This time, the most impactful change is the removal of
2397         UserMediaPermissionRequestManager.h from WebPage.h, which completely
2398         eradicates JSC's VM.h (which is enormous) from WebPage.h (at least on Mac).
2399
2400         * Scripts/webkit/messages.py:
2401         (headers_for_type):
2402         Stop specializing CompositionUnderline now that it has its own file.
2403
2404         * Shared/API/c/WKDeprecatedFunctions.cpp:
2405         * Shared/WebCoreArgumentCoders.cpp:
2406         * UIProcess/API/Cocoa/WKBrowsingContextGroup.mm:
2407         * UIProcess/Gamepad/UIGamepadProvider.cpp:
2408         * UIProcess/HiddenPageThrottlingAutoIncreasesCounter.h: Added.
2409         * UIProcess/HighPerformanceGraphicsUsageSampler.cpp:
2410         * UIProcess/Network/NetworkProcessProxy.cpp:
2411         * UIProcess/PerActivityStateCPUUsageSampler.cpp:
2412         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
2413         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2414         (WebKit::toWebCore):
2415         * UIProcess/VisibleWebPageCounter.h: Added.
2416         * UIProcess/VisitedLinkStore.h:
2417         * UIProcess/WebPageGroup.h:
2418         * UIProcess/WebPageProxy.h:
2419         * UIProcess/WebProcessLifetimeTracker.cpp:
2420         * UIProcess/WebProcessPool.h:
2421         * UIProcess/WebProcessProxy.h:
2422         Remove WebPageProxy and forward-declare a whole bunch of things.
2423
2424         * WebKit2.xcodeproj/project.pbxproj:
2425         * WebProcess/WebCoreSupport/WebUserMediaClient.cpp:
2426         * WebProcess/WebPage/WebPage.cpp:
2427         (WebKit::WebPage::userMediaAccessWasGranted):
2428         (WebKit::WebPage::userMediaAccessWasDenied):
2429         (WebKit::WebPage::didCompleteMediaDeviceEnumeration):
2430         (WebKit::WebPage::grantUserMediaDeviceSandboxExtensions):
2431         (WebKit::WebPage::revokeUserMediaDeviceSandboxExtensions):
2432         * WebProcess/WebPage/WebPage.h:
2433         (WebKit::WebPage::userMediaPermissionRequestManager):
2434         * WebProcess/WebPage/ios/FindControllerIOS.mm:
2435         * WebProcess/WebPage/ios/WebPageIOS.mm:
2436         * WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
2437         (WebKit::RemoteLayerTreeContext::deviceScaleFactor): Deleted.
2438         (WebKit::RemoteLayerTreeContext::layerHostingMode): Deleted.
2439         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
2440         (WebKit::RemoteLayerTreeContext::deviceScaleFactor):
2441         (WebKit::RemoteLayerTreeContext::layerHostingMode):
2442
2443 2017-05-06  Chris Dumez  <cdumez@apple.com>
2444
2445         Align our IDL files with the latest DOM specification
2446         https://bugs.webkit.org/show_bug.cgi?id=171777
2447
2448         Reviewed by Sam Weinig.
2449
2450         GTK build fix.
2451
2452         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
2453         (webkit_dom_document_get_ready_state):
2454
2455 2017-05-06  Tim Horton  <timothy_horton@apple.com>
2456
2457         Reduce the number of includes in WebPage.h and WebProcess.h
2458         https://bugs.webkit.org/show_bug.cgi?id=171779
2459
2460         Reviewed by Sam Weinig.
2461
2462         * WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h:
2463         * WebProcess/Network/NetworkProcessConnection.cpp:
2464         * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
2465         * WebProcess/Network/webrtc/LibWebRTCResolver.cpp:
2466         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
2467         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
2468         * WebProcess/WebPage/FindController.cpp:
2469         * WebProcess/WebPage/WebFrame.cpp:
2470         * WebProcess/WebPage/WebPage.cpp:
2471         (WebKit::WebPage::disableEnumeratingAllNetworkInterfaces):
2472         (WebKit::WebPage::enableEnumeratingAllNetworkInterfaces):
2473         (WebKit::WebPage::didReceivePolicyDecision):
2474         * WebProcess/WebPage/WebPage.h:
2475         (WebKit::WebPage::disableEnumeratingAllNetworkInterfaces): Deleted.
2476         (WebKit::WebPage::enableEnumeratingAllNetworkInterfaces): Deleted.
2477         * WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
2478         * WebProcess/WebProcess.cpp:
2479         * WebProcess/WebProcess.h:
2480         In my measurement, this improves WebKit2 debug clean build time by
2481         ~10% for Mac and ~5% for iOS. The most valuable change is the one to
2482         remove LibWebRTC headers..
2483
2484 2017-05-06  Alexey Proskuryakov  <ap@apple.com>
2485
2486         REGRESSION (r216294): The new test fails on WebKit1
2487         https://bugs.webkit.org/show_bug.cgi?id=171780
2488
2489         Rolling back https://trac.webkit.org/r216294, https://trac.webkit.org/r216296,
2490         https://trac.webkit.org/216299, https://trac.webkit.org/216330
2491
2492         * WebProcess/Plugins/PluginView.cpp:
2493         (WebKit::PluginView::paint):
2494         * WebProcess/Plugins/PluginView.h:
2495
2496 2017-05-06  Simon Fraser  <simon.fraser@apple.com>
2497
2498         [iOS WK2] Make rotation tests more reliable
2499         https://bugs.webkit.org/show_bug.cgi?id=171778
2500
2501         Reviewed by Tim Horton.
2502
2503         Switching between "safari-style" rotation and normal rotation left state on the WKWebView
2504         that would cause later viewport-sensitive tests to fail. The WKWebView would be left
2505         with override layout parameters, and an override orientation, and these caused viewport
2506         size to leak into later tests, and WebCore orientation to not get reset correctly.
2507
2508         Also, WKWebView was unregistering for UIWindowDidRotateNotification notifications when
2509         an override orientation was set, and would never re-register, causing lost orientationchanged
2510         events.
2511
2512         Fix by exposing WKWebView SPI to clear the various bits of overide state. Also don't unregister
2513         from the UIWindowDidRotateNotification notification; it's already ignored anyway if it fires.
2514
2515         Also wait for a visible content rect update after resizing the WKWebVeiw between tests, to make sure
2516         the WebProcess is caught up before proceeding with the test.
2517
2518         * UIProcess/API/Cocoa/WKWebView.mm:
2519         (-[WKWebView _setInterfaceOrientationOverride:]):
2520         (-[WKWebView _clearInterfaceOrientationOverride]):
2521         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
2522         (-[WKWebView _clearOverrideLayoutParameters]):
2523         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2524
2525 2017-05-06  Konstantin Tokarev  <annulen@yandex.ru>
2526
2527         Remove unused lambda capture
2528         https://bugs.webkit.org/show_bug.cgi?id=171772
2529
2530         Reviewed by Yusuke Suzuki.
2531
2532         * DatabaseProcess/DatabaseProcess.cpp:
2533         (WebKit::DatabaseProcess::fetchWebsiteData):
2534
2535 2017-05-06  David Kilzer  <ddkilzer@apple.com>
2536
2537         messages_unittest.py should support a [-r|--reset-results] switch
2538         <https://webkit.org/b/171627>
2539
2540         Reviewed by Daniel Bates.
2541
2542         This change adds support for a [-r|--reset-results] switch when
2543         running messages_unittest.py to make it easy to update the
2544         expected file results.
2545
2546         This also cleans up a lot of duplicate code in
2547         messages_unittest.py by extracting common code into new methods
2548         and by pushing code down into methods where it's actually used.
2549
2550         * Scripts/webkit/LegacyMessageReceiver-expected.cpp:
2551         * Scripts/webkit/LegacyMessages-expected.h:
2552         * Scripts/webkit/MessageReceiver-expected.cpp:
2553         * Scripts/webkit/MessageReceiverSuperclass-expected.cpp:
2554         * Scripts/webkit/Messages-expected.h:
2555         * Scripts/webkit/MessagesSuperclass-expected.h:
2556         - Update expected files using the new --reset-results switch.
2557
2558         * Scripts/webkit/messages_unittest.py:
2559         - Remove what appears to be a debugging print statement.
2560         - Replace the code that reads in expected files with variables
2561           that contain the expected file names.  The code to read in the
2562           contents moved into
2563           GeneratedFileContentsTest.assertGeneratedFileContentsEqual().
2564         (ParsingTest.check_message):
2565         - Drive-by fix to change "!= None" to "is not None".
2566         (GeneratedFileContentsTest.assertGeneratedFileContentsEqual):
2567         - Add support for [-r|--reset-results] switch here.  This will
2568           write out updated expected file contents when the switch is
2569           used.
2570         - Push down most of the global code that reads in file contents
2571           into this method.
2572         - Change use of split('\n') into splitlines(False).
2573         (GeneratedFileContentsTest.assertHeaderEqual): Add.
2574         - Extracts common code from test_receiver_headers().
2575         (GeneratedFileContentsTest.assertImplementationEqual): Add.
2576         - Extracts common code from test_receiver_implementations().
2577         (HeaderTest):
2578         (HeaderTest.test_receiver_headers):
2579         - Rename from HeaderTest.test_header().
2580         - Simplify by calling assertHeaderEqual().
2581         (ReceiverImplementationTest):
2582         (ReceiverImplementationTest.test_receiver_implementations):
2583         - Rename from
2584           ReceiverImplementationTest.test_receiver_implementation().
2585         - Simplify by calling assertImplementationEqual().
2586         (add_reset_results_to_unittest_help): Add.
2587         - Inserts help text for [-r|--reset-results] switch.
2588         (parse_sys_argv): Add.
2589         - Parses [-r|--reset-results] switch, and then removes it from
2590           sys.argv.  We do this instead of using argparse so that the
2591           original help for the unittest module is still shown when
2592           using --help.
2593
2594 2017-05-05  Timothy Horton  <timothy_horton@apple.com>
2595
2596         [Mac] Adjust cursor position for dragged link (and stop it from moving based on how fast you are dragging)
2597         https://bugs.webkit.org/show_bug.cgi?id=171764
2598         <rdar://problem/32005865>
2599
2600         Reviewed by Simon Fraser.
2601
2602         * UIProcess/Cocoa/WebViewImpl.mm:
2603         (WebKit::WebViewImpl::dragImageForView):
2604         Always use the last mouse down event to originate the drag; this was a 2004 hack
2605         to work around a seemingly-fixed macOS bug that somehow propagated into WebKit2.
2606         With WebKit2, this would cause trouble because currentEvent could move on
2607         during the bounce to the Web Content process and back, causing the delta between
2608         clientPoint and the mouse point to be dependent on timing, and thus causing the
2609         link to sit at timing-dependent distance from the cursor, instead of exactly
2610         where dragOffsetForLinkDragImage placed it.
2611
2612 2017-05-05  Brady Eidson  <beidson@apple.com>
2613
2614         API test WebKit2.WebsiteDataStoreCustomPaths is failing on ios-simulator.
2615         <rdar://problem/31977294> and https://bugs.webkit.org/show_bug.cgi?id=171513
2616
2617         Reviewed by Andy Estes.
2618
2619         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2620         (WebKit::NetworkProcess::syncAllCookies):
2621
2622 2017-05-05  Dean Jackson  <dino@apple.com>
2623
2624         Restrict SVG filters to accessible security origins
2625         https://bugs.webkit.org/show_bug.cgi?id=118689
2626         <rdar://problem/27362159>
2627
2628         Reviewed by Brent Fulgham.
2629
2630         Update parameter lists.
2631
2632         * WebProcess/Plugins/PluginView.cpp:
2633         (WebKit::PluginView::paint):
2634         * WebProcess/Plugins/PluginView.h:
2635
2636 2017-05-05  Beth Dakin  <bdakin@apple.com>
2637
2638         Ensure NSColorPickerTouchBarItem only uses sRGB colors
2639         https://bugs.webkit.org/show_bug.cgi?id=171758
2640         -and corresponding-
2641         rdar://problem/28314183
2642
2643         Reviewed by Tim Horton.
2644
2645         * UIProcess/Cocoa/WebViewImpl.mm:
2646         (-[WKTextTouchBarItemController itemForIdentifier:]):
2647
2648 2017-05-05  Brent Fulgham  <bfulgham@apple.com>
2649
2650         [WK2][iOS][macOS] Expand sandbox to access vm.footprint_suspend 
2651         https://bugs.webkit.org/show_bug.cgi?id=171749
2652         <rdar://problem/32019494>
2653
2654         Reviewed by Geoffrey Garen.
2655
2656         The 'sysctl' whitelist needs to be extended to support an additional VM-related feature.
2657
2658         * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in:
2659         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
2660         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
2661         * Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb:
2662         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
2663         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2664         * WebProcess/com.apple.WebProcess.sb.in:
2665
2666 2017-05-05  John Wilander  <wilander@apple.com>
2667
2668         Resource Load Statistics: Don't cover in-memory and disk caches during website data removal
2669         https://bugs.webkit.org/show_bug.cgi?id=171741
2670         <rdar://problem/32020691>
2671
2672         Reviewed by Brent Fulgham.
2673
2674         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2675         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
2676             No longer removes WebsiteDataType::DiskCache or WebsiteDataType::MemoryCache.
2677
2678 2017-05-05  Brian Burg  <bburg@apple.com>
2679
2680         CrashTracer: [USER] com.apple.WebKit.WebContent.Development at com.apple.WebCore: WebCore::commonVMSlow + 57
2681         https://bugs.webkit.org/show_bug.cgi?id=171669
2682         <rdar://problem/31967684>
2683
2684         Reviewed by Mark Lam.
2685
2686         safaridriver's AutomaticInspection capability causes us to call WebInspectorProxy::connect()
2687         underneath the Automation.inspectBrowsingContext command. This fires a NeedDebuggerBreak
2688         interrupt for the web content's VM, but this is racy because the web content process may
2689         not yet be fully initialized when this interrupt is handled.
2690
2691         To work around this, just don't deliver any interrupts if the VM singleton is still null.
2692         This is a reliable signal that the web content process is not fully initialized yet. Not delivering
2693         is harmless; the interrupt only exists to break out of infinite loops in JS code, but there
2694         could not be any such infinite loop yet if the web content process is not fully initialized.
2695
2696         * WebProcess/WebPage/WebInspectorInterruptDispatcher.cpp:
2697         (WebKit::WebInspectorInterruptDispatcher::notifyNeedDebuggerBreak):
2698
2699 2017-05-05  Brian Burg  <bburg@apple.com>
2700
2701         Web Automation: cookie-related commands don't work correctly
2702         https://bugs.webkit.org/show_bug.cgi?id=171713
2703         <rdar://problem/29829930>
2704
2705         Reviewed by Alexey Proskuryakov.
2706
2707         Commands that use WebCookieManager directly should complete when
2708         the manager's completion handler is called. Otherwise, this will race
2709         with subsequent accesses to cookies via the web process (document.cookie).
2710
2711         Also, these commands need to use the active browsing context's session ID.
2712         They currently use the process pool's storage session, which is wrong
2713         since we specially configure automation instances with an ephemeral store.
2714
2715         * UIProcess/Automation/WebAutomationSession.cpp:
2716         (WebKit::WebAutomationSession::addSingleCookie):
2717         (WebKit::WebAutomationSession::deleteAllCookies):
2718
2719 2017-05-05  Chris Dumez  <cdumez@apple.com>
2720
2721         Rename webProcessDidCrashWithReason callback to webProcessDidTerminate and stop calling webProcessDidCrash for client terminations
2722         https://bugs.webkit.org/show_bug.cgi?id=171624
2723
2724         Reviewed by Dan Bernstein.
2725
2726         Follow-up fixes after r216129 based on feedback I have received:
2727         - Rename webProcessDidCrashWithReason callback function to webProcessDidTerminate given that this is called
2728           for non-crashes (e.g. terminations requested by the client).
2729         - Rename WKProcessCrashReason / ProcessCrashReason to WKProcessTerminationReason / ProcessTerminationReason
2730           for consistency with the new naming.
2731         - Stop calling processDidCrash / webProcessDidCrash for terminations requested by the client, to maintain
2732           pre-r216129 behavior. Those are not crashes (The client used an API such as WKPageTerminateProcess()).
2733           webProcessDidTerminate will still be called though.
2734         - Fix a bug where - for terminations due to resource limits - WebPageProxy::processDidCrash() was getting
2735           called twice: First by WebProcessProxy::requestTermination() with reason "RequestedByClient" then a
2736           second time by WebProcessProxy::terminateProcessDueToResourceLimits() with the proper reason.
2737
2738         * Shared/ProcessTerminationReason.h: Renamed from Source/WebKit2/Shared/ProcessCrashReason.h.
2739         * UIProcess/API/APINavigationClient.h:
2740         (API::NavigationClient::processDidTerminate):
2741         * UIProcess/API/C/WKAPICast.h:
2742         (WebKit::toAPI):
2743         * UIProcess/API/C/WKPage.cpp:
2744         (WKPageTerminate):
2745         (WKPageSetPageNavigationClient):
2746         * UIProcess/API/C/WKPageNavigationClient.h:
2747         * UIProcess/API/C/WKProcessTerminationReason.h: Renamed from Source/WebKit2/UIProcess/API/C/WKProcessCrashReason.h.
2748         * UIProcess/API/Cocoa/WKWebView.mm:
2749         (-[WKWebView _killWebContentProcessAndResetState]):
2750         * UIProcess/Cocoa/NavigationState.h:
2751         * UIProcess/Cocoa/NavigationState.mm:
2752         (WebKit::NavigationState::NavigationClient::processDidTerminate):
2753         * UIProcess/WebPageProxy.cpp:
2754         (WebKit::WebPageProxy::processDidTerminate):
2755         * UIProcess/WebPageProxy.h:
2756         * UIProcess/WebProcessProxy.cpp:
2757         (WebKit::WebProcessProxy::didClose):
2758         (WebKit::WebProcessProxy::requestTermination):
2759         (WebKit::WebProcessProxy::logDiagnosticMessageForResourceLimitTermination):
2760         (WebKit::WebProcessProxy::didExceedActiveMemoryLimit):
2761         (WebKit::WebProcessProxy::didExceedInactiveMemoryLimit):
2762         (WebKit::WebProcessProxy::didExceedBackgroundCPULimit):
2763         * UIProcess/WebProcessProxy.h:
2764         * WebKit2.xcodeproj/project.pbxproj:
2765
2766 2017-05-05  Derek Schuff  <dschuff@chromium.org>
2767
2768         Mac cmake buildfix after r216037
2769         https://bugs.webkit.org/show_bug.cgi?id=171558
2770
2771         Reviewed by JF Bastien.
2772
2773         * PlatformMac.cmake:
2774
2775 2017-05-05  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2776
2777         [GTK] Enable runtime flag for MediaDevices with enable-media-stream property.
2778         https://bugs.webkit.org/show_bug.cgi?id=171730
2779
2780         Reviewed by Michael Catanzaro.
2781
2782         After r215939 the MediaDevices runtime setting has to be enabled
2783         also to use MediaStream / WebRTC.
2784
2785         Enable it as part of the enable-media-stream property of the
2786         WebKitGTK+ API.
2787
2788         * UIProcess/API/gtk/WebKitSettings.cpp:
2789         (webkit_settings_set_enable_media_stream):
2790
2791 2017-05-05  Carlos Garcia Campos  <cgarcia@igalia.com>
2792
2793         [GTK] Assertion failure in Inspector::RemoteInspector::setRemoteInspectorClient when disposing WebKitWebContext
2794         https://bugs.webkit.org/show_bug.cgi?id=171644
2795
2796         Reviewed by Michael Catanzaro.
2797
2798         Ensure that it's not possible to enable automation in more than one WebKitWebContext at the same time. Instead
2799         of creating the AutomationClient unconditionally when the context is constructed, it's now created only when
2800         automation is enabled, and deleted if it's disabled.
2801
2802         * UIProcess/API/gtk/WebKitWebContext.cpp:
2803         (webkitWebContextConstructed):
2804         (webkit_web_context_is_automation_allowed):
2805         (webkit_web_context_set_automation_allowed):
2806         * UIProcess/Cocoa/AutomationClient.mm:
2807         (WebKit::AutomationClient::AutomationClient):
2808         (WebKit::AutomationClient::~AutomationClient):
2809
2810 2017-05-04  Commit Queue  <commit-queue@webkit.org>
2811
2812         Unreviewed, rolling out r216206.
2813         https://bugs.webkit.org/show_bug.cgi?id=171714
2814
2815         Multiple LayoutTests crashing in Document::page() (Requested
2816         by ap on #webkit).
2817
2818         Reverted changeset:
2819
2820         "Remove support for legacy Notifications"
2821         https://bugs.webkit.org/show_bug.cgi?id=171487
2822         http://trac.webkit.org/changeset/216206
2823
2824 2017-05-04  Mark Lam  <mark.lam@apple.com>
2825
2826         NeverDestroyed<String>(ASCIILiteral(...)) is not thread safe.
2827         https://bugs.webkit.org/show_bug.cgi?id=171586
2828         <rdar://problem/31873190>
2829
2830         Reviewed by Yusuke Suzuki.
2831
2832         * Shared/API/APIError.cpp:
2833         (API::Error::webKitErrorDomain):
2834         (API::Error::webKitNetworkErrorDomain):
2835         (API::Error::webKitPolicyErrorDomain):
2836         (API::Error::webKitPluginErrorDomain):
2837         (API::Error::webKitDownloadErrorDomain):
2838         (API::Error::webKitPrintErrorDomain):
2839         * Shared/WebPreferencesKeys.cpp:
2840         * UIProcess/WebPageProxy.cpp:
2841         (WebKit::WebPageProxy::executeEditCommand):
2842         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2843         (WebKit::WebEditorClient::didBeginEditing):
2844         (WebKit::WebEditorClient::respondToChangedContents):
2845         (WebKit::WebEditorClient::respondToChangedSelection):
2846         (WebKit::WebEditorClient::didEndEditing):
2847
2848 2017-05-04  Jeremy Jones  <jeremyj@apple.com>
2849
2850         Add mute to WebPlaybackSessionModel.
2851         https://bugs.webkit.org/show_bug.cgi?id=171592
2852         rdar://problem/31814074
2853
2854         Reviewed by Jer Noble.
2855
2856         Plumb through muted.
2857
2858         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h:
2859         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in:
2860         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm:
2861         (WebKit::WebPlaybackSessionModelContext::toggleMuted):
2862         (WebKit::WebPlaybackSessionModelContext::setMuted):
2863         (WebKit::WebPlaybackSessionManagerProxy::setMuted):
2864         (WebKit::WebPlaybackSessionManagerProxy::toggleMuted):
2865         * WebProcess/cocoa/WebPlaybackSessionManager.h:
2866         * WebProcess/cocoa/WebPlaybackSessionManager.messages.in:
2867         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
2868         (WebKit::WebPlaybackSessionInterfaceContext::mutedChanged):
2869         (WebKit::WebPlaybackSessionManager::mutedChanged):
2870         (WebKit::WebPlaybackSessionManager::toggleMuted):
2871
2872 2017-05-04  Wenson Hsieh  <wenson_hsieh@apple.com>
2873
2874         [WK2] Image action sheets sometimes do not dismiss when beginning data interaction
2875         https://bugs.webkit.org/show_bug.cgi?id=171687
2876         <rdar://problem/31996534>
2877
2878         Reviewed by Beth Dakin.
2879
2880         When presenting an image sheet using WKActionSheetAssistant, we may present the popover asynchronously. In this
2881         case, even if -cleanupSheet is invoked after -showImageSheet, the popover will still be presented. To fix this,
2882         add a flag, _hasPendingActionSheet, that is set to true when an image action sheet will be presented in the
2883         future.
2884
2885         In cleanupSheet, we revert this flag to NO, and in the sheet presentation block, we first check to see if there
2886         is a pending action sheet. If there is not, then simply do not invoke the image sheet presentation block.
2887
2888         * UIProcess/ios/WKActionSheetAssistant.mm:
2889         (-[WKActionSheetAssistant showImageSheet]):
2890         (-[WKActionSheetAssistant cleanupSheet]):
2891
2892 2017-05-04  Wenson Hsieh  <wenson_hsieh@apple.com>
2893
2894         [WK2] Add support for keeping the selection in a focused editable element when dragging begins
2895         https://bugs.webkit.org/show_bug.cgi?id=171585
2896         <rdar://problem/31544320>
2897
2898         Reviewed by Beth Dakin and Zalan Bujtas.
2899
2900         Minor adjustments and refactoring in WebKit2. See WebCore ChangeLog for more details.
2901
2902         * UIProcess/WebPageProxy.cpp:
2903         (WebKit::WebPageProxy::startDrag):
2904         (WebKit::WebPageProxy::didStartDrag):
2905
2906         Factor out code in WebPageProxy that sends a WebPage::DidStartDrag message to the web process into a separate
2907         helper, and tweak the places where we directly send this IPC message to the web process to instead call this
2908         helper.
2909
2910         * UIProcess/WebPageProxy.h:
2911         * UIProcess/mac/WebPageProxyMac.mm:
2912         (WebKit::WebPageProxy::setDragImage):
2913         * WebProcess/WebPage/WebPage.cpp:
2914         (WebKit::WebPage::didStartDrag):
2915         (WebKit::WebPage::dragCancelled):
2916
2917         Clear out state in the web process and call out to the EventHandler to handle drag cancellation and the drag
2918         start response from the UI process.
2919
2920         * WebProcess/WebPage/WebPage.h:
2921         (WebKit::WebPage::didStartDrag): Deleted.
2922         (WebKit::WebPage::dragCancelled): Deleted.
2923
2924 2017-05-04  Sam Weinig  <sam@webkit.org>
2925
2926         Remove support for legacy Notifications
2927         https://bugs.webkit.org/show_bug.cgi?id=171487
2928
2929         Reviewed by Jon Lee.
2930
2931         * Configurations/FeatureDefines.xcconfig:
2932         * Shared/WebProcessCreationParameters.cpp:
2933         * Shared/WebProcessCreationParameters.h:
2934         * UIProcess/WebProcessPool.cpp:
2935         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2936         * WebProcess/Notifications/NotificationPermissionRequestManager.cpp:
2937         * WebProcess/Notifications/NotificationPermissionRequestManager.h:
2938         * WebProcess/Notifications/WebNotificationManager.cpp:
2939         * WebProcess/Notifications/WebNotificationManager.h:
2940         * WebProcess/WebCoreSupport/WebNotificationClient.cpp:
2941         * WebProcess/WebCoreSupport/WebNotificationClient.h:
2942         * WebProcess/WebPage/WebPage.cpp:
2943         * WebProcess/WebProcess.cpp:
2944         Remove legacy notification specific code.
2945
2946 2017-05-04  Eric Carlson  <eric.carlson@apple.com>
2947
2948         [MediaStream] Allow host application to enable/disable media capture
2949         https://bugs.webkit.org/show_bug.cgi?id=171292
2950         <rdar://problem/31821492>
2951
2952         Reviewed by Jer Noble.
2953
2954         * UIProcess/API/C/WKPage.cpp:
2955         (WKPageSetMediaCaptureEnabled): New.
2956         (WKPageGetMediaCaptureEnabled): New.
2957         * UIProcess/API/C/WKPagePrivate.h:
2958
2959         * UIProcess/API/Cocoa/WKWebView.mm:
2960         (-[WKWebView _setMediaCaptureEnabled:]): New.
2961         (-[WKWebView _mediaCaptureEnabled]): New.
2962         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2963
2964         * UIProcess/Cocoa/UIDelegate.mm:
2965         (WebKit::UIDelegate::setDelegate): Initialize webViewRequestUserMediaAuthorizationForDevicesURLMainFrameURLDecisionHandler
2966         and webViewCheckUserMediaPermissionForURLMainFrameURLFrameIdentifierDecisionHandler on macOS
2967         and iOS.
2968
2969         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2970         (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy):
2971         Initialize the rejection timer.
2972         (WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):
2973         Call invalidatePendingRequests.
2974         (WebKit::UserMediaPermissionRequestManagerProxy::invalidatePendingRequests): Invalidate all
2975         pending requests.
2976         (WebKit::UserMediaPermissionRequestManagerProxy::stopCapture): New.
2977         (WebKit::UserMediaPermissionRequestManagerProxy::rejectionTimerFired): Reject a promise and
2978         schedule the timer if there are any others pending.
2979         (WebKit::UserMediaPermissionRequestManagerProxy::scheduleNextRejection): 
2980         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Don't
2981         prompt the user if capture is disabled.
2982         (WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests): Deleted.
2983         (WebKit::UserMediaPermissionRequestManagerProxy::clearCachedState): Deleted.
2984         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
2985
2986         * UIProcess/UserMediaProcessManager.cpp:
2987         (WebKit::UserMediaProcessManager::willEnableMediaStreamInPage): Stop capture in the current
2988         page on iOS.
2989         (WebKit::UserMediaProcessManager::setCaptureEnabled):
2990         * UIProcess/UserMediaProcessManager.h:
2991
2992         * UIProcess/WebPageProxy.cpp:
2993         (WebKit::WebPageProxy::setMediaCaptureEnabled):
2994
2995         * UIProcess/WebPageProxy.h:
2996         (WebKit::WebPageProxy::mediaCaptureEnabled):
2997
2998         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
2999         (WebKit::UserMediaPermissionRequestManager::cancelPendingRequests): New, cancel all pending
3000         requests.
3001         (WebKit::UserMediaPermissionRequestManager::cancelUserMediaRequest): Deny the request.
3002         (WebKit::UserMediaPermissionRequestManager::cancelMediaDevicesEnumeration):
3003         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
3004
3005         * WebProcess/WebPage/WebPage.cpp:
3006         (WebKit::WebPage::stopMediaCapture):
3007         * WebProcess/WebPage/WebPage.h:
3008         * WebProcess/WebPage/WebPage.messages.in:
3009
3010 2017-05-04  Konstantin Tokarev  <annulen@yandex.ru>
3011
3012         Fix compilation with ICU 59.1
3013         https://bugs.webkit.org/show_bug.cgi?id=171612
3014
3015         Reviewed by Mark Lam.
3016
3017         ICU 59.1 has broken source compatibility. Now it defines UChar as
3018         char16_t, which does not allow automatic type conversion from unsigned
3019         short in C++ code.
3020
3021         * Shared/API/c/WKString.cpp:
3022         (WKStringGetCharacters):
3023
3024 2017-05-04  Dan Bernstein  <mitz@apple.com>
3025
3026         [Cocoa] -[WKWebsiteDataStore httpCookieStore] is declared in the main @interface but implemented in a category
3027         https://bugs.webkit.org/show_bug.cgi?id=171657
3028
3029         Reviewed by Sam Weinig.
3030
3031         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3032         (-[WKWebsiteDataStore httpCookieStore]): Moved from the WKPrivate category into the main
3033           @implementation block.
3034
3035 2017-05-04  Andy Estes  <aestes@apple.com>
3036
3037         [Cocoa] Add an optional width parameter to -[WKWebProcessPlugInNodeHandle renderedImageWithOptions:]
3038         https://bugs.webkit.org/show_bug.cgi?id=171646
3039         <rdar://problem/30306321>
3040
3041         Reviewed by Tim Horton.
3042
3043         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h:
3044         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
3045         (-[WKWebProcessPlugInNodeHandle renderedImageWithOptions:]): Called
3046         -renderedImageWithOptions:width: with a nil width.
3047         (-[WKWebProcessPlugInNodeHandle renderedImageWithOptions:width:]): Passed an optional width
3048         to InjectedBundleNodeHandle::renderedImage().
3049         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
3050         (WebKit::imageForRect): If a width is specified, create an image graphics context at that
3051         width, preserving the aspect ratio of paintingRect.
3052         (WebKit::InjectedBundleNodeHandle::renderedImage):
3053         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
3054
3055 2017-05-04  Commit Queue  <commit-queue@webkit.org>
3056
3057         Unreviewed, rolling out r216172.
3058         https://bugs.webkit.org/show_bug.cgi?id=171654
3059
3060         FTBFS for iOS due to missing WebPageProxy::stopMediaCapture()
3061         implementation. (Requested by ddkilzer on #webkit).
3062
3063         Reverted changeset:
3064
3065         "[MediaStream] Allow host application to enable/disable media
3066         capture"
3067         https://bugs.webkit.org/show_bug.cgi?id=171292
3068         http://trac.webkit.org/changeset/216172
3069
3070 2017-05-04  Carlos Garcia Campos  <cgarcia@igalia.com>
3071
3072         [Threaded Compositor] SHOULD NEVER BE REACHED in WebKit::CompositingRunLoop::updateCompleted
3073         https://bugs.webkit.org/show_bug.cgi?id=171336
3074
3075         Reviewed by Michael Catanzaro.
3076
3077         We are assuming that all calls to ThreadedCompositor::renderLayerTree() happen because of an scheduled update,
3078         but that's not true in the case of ThreadedCompositor::forceRepaint(). In that case we never want to call
3079         CompositingRunLoop::updateCompleted().
3080
3081         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
3082         (WebKit::ThreadedCompositor::forceRepaint):
3083         (WebKit::ThreadedCompositor::sceneUpdateFinished):
3084         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
3085
3086 2017-05-04  David Kilzer  <ddkilzer@apple.com>
3087
3088         check-webkit-style exits with an error while parsing Source/WebKit2/Scripts/webkit/ directory: KeyError: 'st'
3089         <https://bugs.webkit.org/show_bug.cgi?id=171510>
3090
3091         Reviewed by Daniel Bates.
3092
3093         The problem was that 'import parser' was ambiguous since there
3094         is a built-in parser module that comes with Python.  Changing
3095         'import parser' to 'from webkit import parser' fixed the error
3096         in check-webkit-style (and pylint) by forcing it to load the
3097         local 'parser' module, but then running messages_unittest.py
3098         directly would fail because .../Source/WebKit2/Scripts was not
3099         in the module search path by default.  This is fixed by using
3100         sys.path.append() to add .../Source/WebKit2/Scripts to the
3101         module search path based on the path to messages_unittest.py.
3102
3103         As an added bonus, this patch also fixes all webkit-style issues
3104         in Source/WebKit2/Scripts/webkit/*.py files.
3105
3106         * Scripts/webkit/messages.py:
3107         - Separate local module imports from built-in modules for
3108           consistency.
3109         - Fix whitespace issues for check-webkit-style, and remove stray
3110           semi-colon.
3111         * Scripts/webkit/messages_unittest.py:
3112         - Update sys.path to find the 'webkit' module based on the path
3113           to messages_unittest.py.  This makes 'from webkit import ...'
3114           statements work when running messages_unittest.py directly.
3115         - Change 'messages' and 'parser' modules to use
3116           'from webkit import ...' format for consistency.
3117         - Fix whitespace issues for check-webkit-style.
3118         * Scripts/webkit/model.py:
3119         - Fix whitespace issue for check-webkit-style.
3120         * Scripts/webkit/parser.py:
3121         - Fix whitespace issue for check-webkit-style.
3122
3123 2017-05-03  Eric Carlson  <eric.carlson@apple.com>
3124
3125         [MediaStream] Allow host application to enable/disable media capture
3126         https://bugs.webkit.org/show_bug.cgi?id=171292
3127         <rdar://problem/31821492>
3128
3129         Reviewed by Jer Noble.
3130
3131         * UIProcess/API/C/WKPage.cpp:
3132         (WKPageSetMediaCaptureEnabled): New.
3133         (WKPageGetMediaCaptureEnabled): New.
3134         * UIProcess/API/C/WKPagePrivate.h:
3135
3136         * UIProcess/API/Cocoa/WKWebView.mm:
3137         (-[WKWebView _setMediaCaptureEnabled:]): New.
3138         (-[WKWebView _mediaCaptureEnabled]): New.
3139         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3140
3141         * UIProcess/Cocoa/UIDelegate.mm:
3142         (WebKit::UIDelegate::setDelegate): Initialize webViewRequestUserMediaAuthorizationForDevicesURLMainFrameURLDecisionHandler
3143         and webViewCheckUserMediaPermissionForURLMainFrameURLFrameIdentifierDecisionHandler on macOS
3144         and iOS.
3145
3146         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
3147         (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy):
3148         Initialize the rejection timer.
3149         (WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):
3150         Call invalidatePendingRequests.
3151         (WebKit::UserMediaPermissionRequestManagerProxy::invalidatePendingRequests): Invalidate all
3152         pending requests.
3153         (WebKit::UserMediaPermissionRequestManagerProxy::stopCapture): New.
3154         (WebKit::UserMediaPermissionRequestManagerProxy::rejectionTimerFired): Reject a promise and
3155         schedule the timer if there are any others pending.
3156         (WebKit::UserMediaPermissionRequestManagerProxy::scheduleNextRejection): 
3157         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Don't
3158         prompt the user if capture is disabled.
3159         (WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests): Deleted.
3160         (WebKit::UserMediaPermissionRequestManagerProxy::clearCachedState): Deleted.
3161         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
3162
3163         * UIProcess/UserMediaProcessManager.cpp:
3164         (WebKit::UserMediaProcessManager::willEnableMediaStreamInPage): Stop capture in the current
3165         page on iOS.
3166         (WebKit::UserMediaProcessManager::setCaptureEnabled):
3167         * UIProcess/UserMediaProcessManager.h:
3168
3169         * UIProcess/WebPageProxy.cpp:
3170         (WebKit::WebPageProxy::setMediaCaptureEnabled):
3171
3172         * UIProcess/WebPageProxy.h:
3173         (WebKit::WebPageProxy::mediaCaptureEnabled):
3174
3175         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
3176         (WebKit::UserMediaPermissionRequestManager::cancelPendingRequests): New, cancel all pending
3177         requests.
3178         (WebKit::UserMediaPermissionRequestManager::cancelUserMediaRequest): Deny the request.
3179         (WebKit::UserMediaPermissionRequestManager::cancelMediaDevicesEnumeration):
3180         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
3181
3182         * WebProcess/WebPage/WebPage.cpp:
3183         (WebKit::WebPage::stopMediaCapture):
3184         * WebProcess/WebPage/WebPage.h:
3185         * WebProcess/WebPage/WebPage.messages.in:
3186
3187 2017-05-03  John Wilander  <wilander@apple.com>
3188
3189         Resource Load Statistics: Remove all statistics for modifiedSince website data removals
3190         https://bugs.webkit.org/show_bug.cgi?id=171584
3191         <rdar://problem/24702576>
3192
3193         Reviewed by Brent Fulgham.
3194
3195         These are all test infrastructure changes.
3196
3197         * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp:
3198         (WKResourceLoadStatisticsManagerClearInMemoryAndPersistentStoreModifiedSinceHours):
3199         * UIProcess/API/C/WKResourceLoadStatisticsManager.h:
3200         * UIProcess/WebResourceLoadStatisticsManager.cpp:
3201         (WebKit::WebResourceLoadStatisticsManager::clearInMemoryAndPersistentStoreModifiedSinceHours):
3202         * UIProcess/WebResourceLoadStatisticsManager.h:
3203
3204 2017-05-03  Timothy Horton  <timothy_horton@apple.com>
3205
3206         Maintain interaction information imageURL as a URL, not a string
3207         https://bugs.webkit.org/show_bug.cgi?id=171639
3208
3209         Reviewed by Sam Weinig.
3210
3211         * Shared/ios/InteractionInformationAtPosition.h:
3212         * UIProcess/ios/WKContentViewInteraction.mm:
3213         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
3214         (-[WKContentView _previewItemController:commitPreview:]):
3215         * WebProcess/WebPage/ios/WebPageIOS.mm:
3216         (WebKit::WebPage::getPositionInformation):
3217
3218 2017-05-03  Commit Queue  <commit-queue@webkit.org>
3219
3220         Unreviewed, rolling out r216160 and r216161.
3221         https://bugs.webkit.org/show_bug.cgi?id=171640
3222
3223         These changes broke the iOS build. (Requested by mlewis13 on
3224         #webkit).
3225
3226         Reverted changesets:
3227
3228         "[MediaStream] Allow host application to enable/disable media
3229         capture"
3230         https://bugs.webkit.org/show_bug.cgi?id=171292
3231         http://trac.webkit.org/changeset/216160
3232
3233         "[MediaStream] Allow host application to enable/disable media
3234         capture"
3235         https://bugs.webkit.org/show_bug.cgi?id=171292
3236         http://trac.webkit.org/changeset/216161
3237
3238 2017-05-03  Eric Carlson  <eric.carlson@apple.com>
3239
3240         [MediaStream] Allow host application to enable/disable media capture
3241         https://bugs.webkit.org/show_bug.cgi?id=171292
3242         <rdar://problem/31821492>
3243
3244         Unreviewed build fix.
3245
3246         * UIProcess/WebPageProxy.cpp:
3247         (WebKit::WebPageProxy::clearUserMediaState):
3248         * UIProcess/WebPageProxy.h:
3249
3250 2017-05-03  Eric Carlson  <eric.carlson@apple.com>
3251
3252         [MediaStream] Allow host application to enable/disable media capture
3253         https://bugs.webkit.org/show_bug.cgi?id=171292
3254         <rdar://problem/31821492>
3255
3256         Reviewed by Jer Noble.
3257
3258         * UIProcess/API/C/WKPage.cpp:
3259         (WKPageSetMediaCaptureEnabled): New.
3260         (WKPageGetMediaCaptureEnabled): New.
3261         (WKPageClearUserMediaState): Deleted, unused.
3262         * UIProcess/API/C/WKPagePrivate.h:
3263
3264         * UIProcess/API/Cocoa/WKWebView.mm:
3265         (-[WKWebView _setMediaCaptureEnabled:]): New.
3266         (-[WKWebView _mediaCaptureEnabled]): New.
3267         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3268
3269         * UIProcess/Cocoa/UIDelegate.mm:
3270         (WebKit::UIDelegate::setDelegate): Initialize webViewRequestUserMediaAuthorizationForDevicesURLMainFrameURLDecisionHandler
3271         and webViewCheckUserMediaPermissionForURLMainFrameURLFrameIdentifierDecisionHandler on macOS
3272         and iOS.
3273
3274         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
3275         (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy):
3276         Initialize the rejection timer.
3277         (WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):
3278         Call invalidatePendingRequests.
3279         (WebKit::UserMediaPermissionRequestManagerProxy::invalidatePendingRequests): Invalidate all
3280         pending requests.
3281         (WebKit::UserMediaPermissionRequestManagerProxy::stopCapture): New.
3282         (WebKit::UserMediaPermissionRequestManagerProxy::rejectionTimerFired): Reject a promise and
3283         schedule the timer if there are any others pending.
3284         (WebKit::UserMediaPermissionRequestManagerProxy::scheduleNextRejection): 
3285         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Don't
3286         prompt the user if capture is disabled.
3287         (WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests): Deleted.
3288         (WebKit::UserMediaPermissionRequestManagerProxy::clearCachedState): Deleted.
3289         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
3290
3291         * UIProcess/UserMediaProcessManager.cpp:
3292         (WebKit::UserMediaProcessManager::willEnableMediaStreamInPage): Stop capture in the current
3293         page on iOS.
3294         (WebKit::UserMediaProcessManager::setCaptureEnabled):
3295         * UIProcess/UserMediaProcessManager.h:
3296
3297         * UIProcess/WebPageProxy.cpp:
3298         (WebKit::WebPageProxy::setMediaCaptureEnabled):
3299         (WebKit::WebPageProxy::clearUserMediaState): Deleted.
3300
3301         * UIProcess/WebPageProxy.h:
3302         (WebKit::WebPageProxy::mediaCaptureEnabled):
3303
3304         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
3305         (WebKit::UserMediaPermissionRequestManager::cancelPendingRequests): New, cancel all pending
3306         requests.
3307         (WebKit::UserMediaPermissionRequestManager::cancelUserMediaRequest): Deny the request.
3308         (WebKit::UserMediaPermissionRequestManager::cancelMediaDevicesEnumeration):
3309         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
3310
3311         * WebProcess/WebPage/WebPage.cpp:
3312         (WebKit::WebPage::stopMediaCapture):
3313         * WebProcess/WebPage/WebPage.h:
3314         * WebProcess/WebPage/WebPage.messages.in:
3315
3316 2017-05-03  Tim Horton  <timothy_horton@apple.com>
3317
3318         Maintain interaction information URL as a URL, not a string
3319         https://bugs.webkit.org/show_bug.cgi?id=171623
3320
3321         Reviewed by Simon Fraser.
3322
3323         * Shared/ios/InteractionInformationAtPosition.h:
3324         * UIProcess/ios/WKContentViewInteraction.mm:
3325         (-[WKContentView _showAttachmentSheet]):
3326         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
3327         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
3328         * UIProcess/ios/WKPDFView.mm:
3329         (-[WKPDFView annotation:isBeingPressedAtPoint:controller:]):
3330         (-[WKPDFView actionSheetAssistant:performAction:]):
3331         * WebProcess/WebPage/ios/WebPageIOS.mm:
3332         (WebKit::WebPage::getPositionInformation):
3333
3334 2017-05-03  Simon Fraser  <simon.fraser@apple.com>
3335
3336         Have WKWebView call _updateVisibleContentRects for the current transaction if possible, rather than always delaying
3337         https://bugs.webkit.org/show_bug.cgi?id=171619
3338         
3339         Also fixes webkit.org/b/170153 and webkit.org/b/170195
3340
3341         Reviewed by Tim Horton.
3342
3343         In r214391 we started adding the pre-commit handler in a dispatch_async() to ensure that
3344         the handler would always run, since we couldn't reliably test the phase of the current
3345         transaction. Now that problem has been solved (rdar://problem/31253952) we can go back to
3346         checking the transaction phase on newer iOS versions. If we're too late for the current transaction
3347         we still need to dispatch_async() to get into the next one.
3348
3349         * UIProcess/API/Cocoa/WKWebView.mm:
3350         (-[WKWebView _addUpdateVisibleContentRectPreCommitHandler]):
3351         (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]):
3352
3353 2017-05-03  Chris Dumez  <cdumez@apple.com>
3354
3355         REGRESSION (r216129): ASSERTION FAILED: m_process->state() == WebProcessProxy::State::Terminated
3356         https://bugs.webkit.org/show_bug.cgi?id=171616
3357
3358         Reviewed by Brady Eidson.
3359
3360         Stop calling resetStateAfterProcessExited() in WebPageProxy::terminateProcess() as the call to
3361         WebProcessProxy::requestTermination() already causes WebPageProxy::processDidCrash() to be called
3362         after r216129. WebPageProxy::processDidCrash() already takes care of calling
3363         resetStateAfterProcessExited().
3364
3365         * UIProcess/WebPageProxy.cpp:
3366         (WebKit::WebPageProxy::terminateProcess):
3367
3368 2017-05-03  Brady Eidson  <beidson@apple.com>
3369
3370         Handle KVO updating of the "hasOnlySecureContent" before a page results in an HTTP auth challenge.
3371         https://bugs.webkit.org/show_bug.cgi?id=171607
3372
3373         Reviewed by Andy Estes.
3374         
3375         To test this fix we'd need the combination of an HTTPD inside API tests, so no test for now.
3376
3377         * UIProcess/PageLoadState.cpp:
3378         (WebKit::PageLoadState::hasOnlySecureContent): If the state is provisional, check the provisional URL instead.
3379
3380 2017-05-03  Chris Dumez  <cdumez@apple.com>
3381
3382         [WK2] Extend processDidCrash delegate to let the client know the reason for the crash
3383         https://bugs.webkit.org/show_bug.cgi?id=171565
3384         <rdar://problem/31204417>
3385
3386         Reviewed by Sam Weinig.
3387
3388         Extend processDidCrash delegate to let the client know the reason for the crash. This
3389         is needed by some clients to distinguish actual crashes from terminations due to
3390         resource limits.
3391
3392         * Shared/ProcessCrashReason.h: Added.
3393         * UIProcess/API/APINavigationClient.h:
3394         (API::NavigationClient::processDidCrash):
3395         * UIProcess/API/C/WKAPICast.h:
3396         (WebKit::toAPI):
3397         * UIProcess/API/C/WKPage.cpp:
3398         (WKPageSetPageNavigationClient):
3399         * UIProcess/API/C/WKPageNavigationClient.h:
3400         * UIProcess/API/C/WKProcessCrashReason.h: Added.
3401         * UIProcess/Cocoa/NavigationState.h:
3402         * UIProcess/Cocoa/NavigationState.mm:
3403         (WebKit::NavigationState::NavigationClient::processDidCrash):
3404         * UIProcess/WebPageProxy.cpp:
3405         (WebKit::WebPageProxy::processDidCrash):
3406         * UIProcess/WebPageProxy.h:
3407         * UIProcess/WebProcessProxy.cpp:
3408         (WebKit::WebProcessProxy::didClose):
3409         (WebKit::WebProcessProxy::requestTermination):
3410         (WebKit::diagnosticLoggingKeyForTerminationReason):
3411         (WebKit::toProcessCrashReason):
3412         (WebKit::WebProcessProxy::terminateProcessDueToResourceLimits):
3413         (WebKit::WebProcessProxy::didExceedActiveMemoryLimit):
3414         (WebKit::WebProcessProxy::didExceedInactiveMemoryLimit):
3415         (WebKit::WebProcessProxy::didExceedBackgroundCPULimit):
3416         * UIProcess/WebProcessProxy.h:
3417         * WebKit2.xcodeproj/project.pbxproj:
3418
3419 2017-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>
3420
3421         [GTK] Add GTK+ implementation of WebAutomationSession
3422         https://bugs.webkit.org/show_bug.cgi?id=171431
3423
3424         Reviewed by Michael Catanzaro.
3425
3426         Add platform dependent methods for GTK+ to synthesize events.
3427
3428         * PlatformGTK.cmake:
3429         * UIProcess/API/gtk/WebKitUIClient.cpp: Always resize the window for web views controlled by automation.
3430         * UIProcess/Automation/WebAutomationSession.cpp:
3431         (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext):
3432         (WebKit::WebAutomationSession::moveWindowOfBrowsingContext):
3433         (WebKit::WebAutomationSession::performMouseInteraction):
3434         (WebKit::WebAutomationSession::performKeyboardInteractions):
3435         * UIProcess/Automation/WebAutomationSession.h:
3436         * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp: Added.
3437         (WebKit::modifiersToEventState):
3438         (WebKit::mouseButtonToGdkButton):
3439         (WebKit::doMouseEvent):
3440         (WebKit::doMotionEvent):
3441         (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
3442         (WebKit::doKeyStrokeEvent):
3443         (WebKit::keyCodeForVirtualKey):
3444         (WebKit::WebAutomationSession::platformSimulateKeyStroke):
3445         (WebKit::WebAutomationSession::platformSimulateKeySequence):
3446         (WebKit::WebAutomationSession::platformGetBase64EncodedPNGData):
3447
3448 2017-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>
3449
3450         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.17.1 release.
3451
3452         * gtk/NEWS: Add release notes for 2.17.1.
3453
3454 2017-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>
3455
3456         [Soup] Add request headers to network load metrics
3457         https://bugs.webkit.org/show_bug.cgi?id=171545
3458
3459         Reviewed by Sergio Villar Senin.
3460
3461         This will make the headers to appear in the web inspector.
3462
3463         Fixes: http/tests/inspector/network/resource-request-headers.html
3464
3465         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
3466         (WebKit::NetworkDataTaskSoup::didGetHeaders):
3467
3468 2017-05-02  Simon Fraser  <simon.fraser@apple.com>
3469
3470         Dynamically added position:fixed element is in the wrong place
3471         https://bugs.webkit.org/show_bug.cgi?id=170280
3472         rdar://problem/31374008
3473
3474         Reviewed by Tim Horton.
3475
3476         Layers for position:fixed elements have their positions reconciled after scrolls
3477         via AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions() and GraphicsLayerCA::syncPosition(),
3478         which updates the GraphicsLayer's position, but does not push it to the PlatformCALayer.
3479
3480         This bug was a case where a position:fixed element gained a fixed ancestor, so had a GraphicsLayerCA whose
3481         position had been updated via syncPosition() in the past. A subsequent layout updated the GraphicsLayerCA position,
3482         but to a value that was the same as its pre-sync position, so the PlatformCALayerRemote's position didn't change,
3483         but there was no signal to the UI process to restore the layer's pre-scrolled position.
3484
3485         Fix by avoiding the early return in PlatformCALayerRemote::setPosition(), to ensure that GraphicsLayerCA
3486         geometry updates in the web process always send new positions to the UI process.
3487
3488         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
3489         (WebKit::PlatformCALayerRemote::setPosition):
3490
3491 2017-05-02  Gwang Yoon Hwang  <yoon@igalia.com>
3492
3493         [GTK] Drop coordinated surfaces from the compositing thread as soon as possible
3494         https://bugs.webkit.org/show_bug.cgi?id=171544
3495
3496         Reviewed by Žan Doberšek.
3497
3498         Released coordinated surface from the main thread didn't be freed until
3499         next commit message because the deletion of coordinated surfaces is
3500         considered as a part of scene state.  We need to release corresponding
3501         surfaces whenever the compositing coordinator drops update atlases to
3502         reduce memory usages.
3503
3504         No new tests, only an optimization.
3505
3506         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
3507         Remove atlasesToRemove from the GraphicsState. it is not a commit
3508         state anymore.
3509         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
3510         (WebKit::CoordinatedGraphicsScene::syncUpdateAtlases):
3511         (WebKit::CoordinatedGraphicsScene::releaseUpdateAtlases):
3512         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
3513         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
3514         (WebKit::CompositingCoordinator::releaseAtlases): Pass the list of
3515         released update atlases to the compositing thread right after cleaning
3516         up deactivated update atlases.
3517         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
3518         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
3519         (WebKit::CompositingCoordinator::clearPendingStateChanges):
3520         (WebKit::CompositingCoordinator::removeUpdateAtlas):
3521         (WebKit::CompositingCoordinator::releaseAtlases):
3522         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
3523         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
3524         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
3525         (WebKit::ThreadedCoordinatedLayerTreeHost::releaseUpdateAtlases):
3526         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
3527
3528 2017-05-02  Timothy Horton  <timothy_horton@apple.com>
3529
3530         Inform clients when viewport-fit state changes, so they can recompute insets
3531         https://bugs.webkit.org/show_bug.cgi?id=171573
3532         <rdar://problem/31947614>
3533
3534         Reviewed by Simon Fraser.
3535
3536         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3537         * UIProcess/API/Cocoa/WKWebView.mm:
3538         (-[WKWebView _didChangeAvoidsUnsafeArea]):
3539         * UIProcess/API/Cocoa/WKWebViewInternal.h:
3540         * UIProcess/ios/PageClientImplIOS.mm:
3541         (WebKit::PageClientImpl::didChangeAvoidsUnsafeArea):
3542         For clients who use setObscuredInsets/setUnobscuredSafeAreaInsets
3543         themselves, we need to let them know when the current state of
3544         viewport-fit changes so that they can recompute the insets.
3545
3546 2017-05-02  Gwang Yoon Hwang  <yoon@igalia.com>
3547
3548         [GTK] Recycle textures while handling tiles
3549         https://bugs.webkit.org/show_bug.cgi?id=171541
3550
3551         Reviewed by Žan Doberšek.
3552
3553         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
3554         (WebKit::CoordinatedBackingStoreTile::swapBuffers):
3555         Whenever we create new tiles or delete tiles, CoordGfx creates and
3556         deletes textures accordingly.  We should avoid this kind of heavy
3557         operations whenever possible.  This patch modifies to use the texture
3558         pool to reduce texture allocations.  Also this patch reduces number of
3559         resetting textures, which is also expensive operation.
3560         * Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp:
3561         (WebKit::WebCoordinatedSurface::copyToTexture):
3562         Modified to pass BitmapTexture as a reference.
3563         * Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.cpp:
3564         (WebKit::ThreadSafeCoordinatedSurface::copyToTexture): Ditto.
3565
3566 2017-05-02  David Kilzer  <ddkilzer@apple.com>
3567
3568         Stop using strcpy() in WebProcess::registerWithStateDumper() in WebProcessCocoa.mm
3569         <https://webkit.org/b/171520>
3570
3571         Reviewed by Chris Dumez.
3572
3573         * WebProcess/cocoa/WebProcessCocoa.mm:
3574         (WebKit::WebProcess::registerWithStateDumper): Switch from
3575         strcpy() to strlcpy(), removing comment in the process.
3576
3577 2017-05-02  Andrew Gold  <agold@apple.com>
3578
3579         MediaDevices is not enabled for MobileSafari
3580         https://bugs.webkit.org/show_bug.cgi?id=171433
3581         <rdar://problem/31923178>
3582
3583         Reviewed by Youenn Fablet.
3584
3585         Added the Cocoa API for toggling this feature and removed API for toggling
3586         MediaStreamEnabled since it will always be on.
3587
3588         * UIProcess/API/Cocoa/WKPreferences.mm:
3589         (-[WKPreferences _mediaDevicesEnabled]):
3590         (-[WKPreferences _setMediaDevicesEnabled:]):
3591         (-[WKPreferences _mediaStreamEnabled]): Deleted.
3592         (-[WKPreferences _setMediaStreamEnabled:]): Deleted.
3593         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
3594
3595 2017-05-02  Andy Estes  <aestes@apple.com>
3596
3597         REGRESSION (r213036): Crash in -[WKContentView _webTouchEventsRecognized:] when a touch event arrives after a WebPageProxy has been invalidated
3598         https://bugs.webkit.org/show_bug.cgi?id=171539
3599         <rdar://problem/31614982>
3600
3601         Reviewed by Tim Horton.
3602
3603         Prior to r213036, the layer tree transaction at last touch start was tracked by
3604         WebPageProxy::handleTouchEventSynchronously(), which would ask the drawing area proxy for
3605         its most recent transaction ID after ensuring that the WebPageProxy was valid.
3606
3607         r213036 moved the tracking up to -[WKContentView _webTouchEventsRecognized:], but failed to
3608         check if _page was valid before asking for its drawing area proxy's last transaction ID; the
3609         drawing area proxy is set to null on WebPageProxy invalidation.
3610
3611         * UIProcess/ios/WKContentViewInteraction.mm:
3612         (-[WKContentView _webTouchEventsRecognized:]): Added an early return if _page isn't valid.
3613
3614 2017-05-02  Carlos Garcia Campos  <cgarcia@igalia.com>
3615
3616         Web Automation: generate resizeWindowOfBrowsingContext and moveWindowOfBrowsingContext for all platforms
3617         https://bugs.webkit.org/show_bug.cgi?id=171107
3618
3619         Reviewed by Brian Burg.
3620
3621         The implementation is actually cross-platform, so it could be moved from WebAutomationSessionMac.mm to
3622         WebAutomationSession.cpp and simply return a NotImplemented error for iOS. This will allow to use these methods
3623         in other platforms.
3624
3625         * UIProcess/Automation/Automation.json:
3626         * UIProcess/Automation/WebAutomationSession.cpp:
3627         (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext):
3628         (WebKit::WebAutomationSession::moveWindowOfBrowsingContext):
3629         * UIProcess/Automation/WebAutomationSession.h:
3630         * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
3631         (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext): Deleted.
3632         (WebKit::WebAutomationSession::moveWindowOfBrowsingContext): Deleted.
3633
3634 2017-05-01  Chris Dumez  <cdumez@apple.com>
3635
3636         Use RELEASE_LOG_ERROR() to do process termination logging
3637         https://bugs.webkit.org/show_bug.cgi?id=171521
3638
3639         Reviewed by Andreas Kling.
3640
3641         Use RELEASE_LOG_ERROR() to do process termination logging instead of RELEASE_LOG().
3642         This makes the issue more visible in Console.
3643
3644         * UIProcess/WebProcessProxy.cpp:
3645         (WebKit::WebProcessProxy::didExceedActiveMemoryLimit):
3646         (WebKit::WebProcessProxy::didExceedInactiveMemoryLimit):
3647         (WebKit::WebProcessProxy::didExceedBackgroundCPULimit):
3648
3649 2017-05-01  Brady Eidson  <beidson@apple.com>
3650
3651         Only try to get sandbox extension handle for IndexedDB directory if it is set.
3652         rdar://problem/31925828 and https://bugs.webkit.org/show_bug.cgi?id=171522
3653
3654         Reviewed by Andy Estes.
3655
3656         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3657         (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
3658
3659 2017-05-01  Timothy Horton  <timothy_horton@apple.com>
3660
3661         Expose viewport-fit instead of clip-to-safe-area
3662         https://bugs.webkit.org/show_bug.cgi?id=171503
3663         <rdar://problem/31918249>
3664
3665         Reviewed by Simon Fraser.
3666
3667         * Shared/VisibleContentRectUpdateInfo.cpp:
3668         (WebKit::VisibleContentRectUpdateInfo::encode):
3669         (WebKit::VisibleContentRectUpdateInfo::decode):
3670         (WebKit::operator<<):
3671         * Shared/VisibleContentRectUpdateInfo.h:
3672         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
3673         (WebKit::VisibleContentRectUpdateInfo::unobscuredSafeAreaInsets):
3674         (WebKit::operator==):
3675         Plumb the safe area insets down from the UI process to the Web Content
3676         process inside the visible content rect update, alongside the obscured
3677         insets.
3678
3679         * Shared/mac/RemoteLayerTreeTransaction.h:
3680         (WebKit::RemoteLayerTreeTransaction::avoidsUnsafeArea):
3681         (WebKit::RemoteLayerTreeTransaction::setAvoidsUnsafeArea):
3682         * Shared/mac/RemoteLayerTreeTransaction.mm:
3683         (WebKit::RemoteLayerTreeTransaction::encode):
3684         (WebKit::RemoteLayerTreeTransaction::decode):
3685         (WebKit::RemoteLayerTreeTransaction::description):
3686         * UIProcess/PageClient.h:
3687         * UIProcess/ios/PageClientImplIOS.h:
3688         * UIProcess/ios/PageClientImplIOS.mm:
3689         (WebKit::PageClientImpl::didChangeAvoidsUnsafeArea):
3690         (WebKit::PageClientImpl::didChangeClipToSafeArea): Deleted.
3691         * UIProcess/ios/WebPageProxyIOS.mm:
3692         (WebKit::WebPageProxy::didCommitLayerTree):
3693         * UIProcess/mac/PageClientImpl.h:
3694         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3695         (WebKit::WebChromeClient::didChangeClipToSafeArea): Deleted.
3696         * WebProcess/WebCoreSupport/WebChromeClient.h:
3697         * WebProcess/WebPage/WebPage.cpp:
3698         (WebKit::WebPage::willCommitLayerTree):
3699         * WebProcess/WebPage/ios/WebPageIOS.mm:
3700         (WebKit::WebPage::viewportConfigurationChanged):
3701         (WebKit::WebPage::updateVisibleContentRects):
3702         * UIProcess/WebPageProxy.cpp:
3703         (WebKit::WebPageProxy::resetState):
3704         (WebKit::WebPageProxy::setAvoidsUnsafeArea):
3705         (WebKit::WebPageProxy::setClipToSafeArea): Deleted.
3706         * UIProcess/WebPageProxy.h:
3707         (WebKit::WebPageProxy::avoidsUnsafeArea):
3708         (WebKit::WebPageProxy::clipToSafeArea): Deleted.
3709         * UIProcess/WebPageProxy.messages.in:
3710         Plumb the effective value of viewport-fit (whether or not to avoid
3711         the safe area for layout purposes) from the Web Content process
3712         to the UI process inside the layer tree transaction.
3713         Also, remove clip-to-safe-area plumbing.
3714
3715         * UIProcess/API/Cocoa/WKWebView.mm:
3716         (-[WKWebView _initializeWithConfiguration:]):
3717         (-[WKWebView _computedContentInset]):
3718         (-[WKWebView _computedUnobscuredSafeAreaInset]):
3719         (-[WKWebView _updateVisibleContentRects]):
3720         (-[WKWebView _updateScrollViewInsetAdjustmentBehavior]):
3721         (-[WKWebView _safeAreaShouldAffectObscuredInsets]):
3722         (-[WKWebView _unobscuredSafeAreaInsets]):
3723         (-[WKWebView _setUnobscuredSafeAreaInsets:]):
3724         (-[WKWebView _contentMayDrawInObscuredInsets]): Deleted.
3725         * UIProcess/API/Cocoa/WKWebViewInternal.h:
3726         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3727         Make use of the effective value of viewport-fit to decide whether to
3728         take the safe area into account when computing the obscured insets,
3729         and expose this to clients (in the case that they need to know
3730         because they push their own obscured insets down). Also expose a 
3731         safe area inset setter for that case as well.
3732
3733         * UIProcess/ios/WKContentView.h:
3734         * UIProcess/ios/WKContentView.mm:
3735         (-[WKContentView updateFixedClippingView:]):
3736         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
3737         Remove a piece of the clip-to-safe-area implementation, and plumb
3738         safe area insets into the visible content rect update info.
3739
3740         * UIProcess/ios/WKScrollView.h:
3741         * UIProcess/ios/WKScrollView.mm:
3742         (-[WKScrollView initWithFrame:]):
3743         (-[WKScrollView _contentInsetAdjustmentBehaviorWasExternallyOverridden]):
3744         (-[WKScrollView _setContentInsetAdjustmentBehavior:]):
3745         (-[WKScrollView _setContentInsetAdjustmentBehaviorInternal:]):
3746         Keep track of whether the client has ever touched the content inset adjustment
3747         behavior; if they have, we won't manage it ourselves.
3748
3749 2017-05-01  Brady Eidson  <beidson@apple.com>
3750
3751         Update names in WKURLSchemeHandler/WKURLSchemeHandlerTask APIs.
3752         <rdar://problem/31824838> and https://bugs.webkit.org/show_bug.cgi?id=171508
3753
3754         Reviewed by Andy Estes.
3755
3756         This patch:
3757         - Renames WKURLSchemeHandlerTask to WKURLSchemeTask
3758         - Renames the method "startTask" to "startURLSchemeTask"
3759         - Renames the method "stopTask" to "stopURLSchemeTask"
3760
3761         To those effects it's basically a global replace.
3762
3763         * Shared/API/APIObject.h:
3764         * Shared/Cocoa/APIObject.mm:
3765         (API::Object::newObject):
3766         * UIProcess/API/APIURLSchemeTask.cpp: Renamed from Source/WebKit2/UIProcess/API/APIURLSchemeHandlerTask.cpp.
3767         (API::URLSchemeTask::create):
3768         (API::URLSchemeTask::URLSchemeTask):
3769         * UIProcess/API/APIURLSchemeTask.h: Renamed from Source/WebKit2/UIProcess/API/APIURLSchemeHandlerTask.h.
3770         * UIProcess/API/Cocoa/WKURLSchemeHandler.h:
3771         * UIProcess/API/Cocoa/WKURLSchemeTask.h: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeHandlerTask.h.
3772         * UIProcess/API/Cocoa/WKURLSchemeTask.mm: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeHandlerTask.mm.
3773         (raiseExceptionIfNecessary):
3774         (-[WKURLSchemeTaskImpl request]):
3775         (-[WKURLSchemeTaskImpl didReceiveResponse:]):
3776         (-[WKURLSchemeTaskImpl didReceiveData:]):
3777         (-[WKURLSchemeTaskImpl didFinish]):
3778         (-[WKURLSchemeTaskImpl didFailWithError:]):
3779         (-[WKURLSchemeTaskImpl _apiObject]):
3780         * UIProcess/API/Cocoa/WKURLSchemeTaskInternal.h: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeHandlerTaskInternal.h.
3781         (WebKit::wrapper):
3782         * UIProcess/Cocoa/WebURLSchemeHandlerCocoa.h:
3783         * UIProcess/Cocoa/WebURLSchemeHandlerCocoa.mm:
3784         (WebKit::WebURLSchemeHandlerCocoa::platformStartTask):
3785         (WebKit::WebURLSchemeHandlerCocoa::platformStopTask):
3786         * UIProcess/WebPageProxy.cpp:
3787         (WebKit::WebPageProxy::startURLSchemeTask):
3788         (WebKit::WebPageProxy::stopURLSchemeTask):
3789         (WebKit::WebPageProxy::startURLSchemeHandlerTask): Deleted.
3790         (WebKit::WebPageProxy::stopURLSchemeHandlerTask): Deleted.
3791         * UIProcess/WebPageProxy.h:
3792         * UIProcess/WebPageProxy.messages.in:
3793         * UIProcess/WebURLSchemeHandler.cpp:
3794         (WebKit::WebURLSchemeHandler::startTask):
3795         * UIProcess/WebURLSchemeHandler.h:
3796         * UIProcess/WebURLSchemeTask.cpp: Renamed from Source/WebKit2/UIProcess/WebURLSchemeHandlerTask.cpp.
3797         (WebKit::WebURLSchemeTask::create):
3798         (WebKit::WebURLSchemeTask::WebURLSchemeTask):
3799         (WebKit::WebURLSchemeTask::didReceiveResponse):
3800         (WebKit::WebURLSchemeTask::didReceiveData):
3801         (WebKit::WebURLSchemeTask::didComplete):
3802         (WebKit::WebURLSchemeTask::pageDestroyed):
3803         (WebKit::WebURLSchemeTask::stop):
3804         * UIProcess/WebURLSchemeTask.h: Renamed from Source/WebKit2/UIProcess/WebURLSchemeHandlerTask.h.
3805         (WebKit::WebURLSchemeTask::identifier):
3806         (WebKit::WebURLSchemeTask::request):
3807         * WebKit2.xcodeproj/project.pbxproj:
3808         * WebProcess/Network/WebLoaderStrategy.cpp:
3809         (WebKit::WebLoaderStrategy::addURLSchemeTaskProxy):
3810         (WebKit::WebLoaderStrategy::removeURLSchemeTaskProxy):
3811         (WebKit::WebLoaderStrategy::remove):
3812         (WebKit::WebLoaderStrategy::addURLSchemeHandlerTaskProxy): Deleted.
3813         (WebKit::WebLoaderStrategy::removeURLSchemeHandlerTaskProxy): Deleted.
3814         * WebProcess/Network/WebLoaderStrategy.h:
3815         * WebProcess/WebPage/WebPage.cpp:
3816         (WebKit::WebPage::urlSchemeTaskDidReceiveResponse):
3817         (WebKit::WebPage::urlSchemeTaskDidReceiveData):
3818         (WebKit::WebPage::urlSchemeTaskDidComplete):
3819         (WebKit::WebPage::urlSchemeHandlerTaskDidReceiveResponse): Deleted.
3820         (WebKit::WebPage::urlSchemeHandlerTaskDidReceiveData): Deleted.
3821         (WebKit::WebPage::urlSchemeHandlerTaskDidComplete): Deleted.
3822         * WebProcess/WebPage/WebPage.h:
3823         * WebProcess/WebPage/WebPage.messages.in:
3824         * WebProcess/WebPage/WebURLSchemeHandlerProxy.cpp:
3825         (WebKit::WebURLSchemeHandlerProxy::startNewTask):
3826         (WebKit::WebURLSchemeHandlerProxy::taskDidComplete):
3827         (WebKit::WebURLSchemeHandlerProxy::taskDidStopLoading):
3828         * WebProcess/WebPage/WebURLSchemeHandlerProxy.h:
3829         * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/WebURLSchemeHandlerTaskProxy.cpp.
3830         (WebKit::WebURLSchemeTaskProxy::WebURLSchemeTaskProxy):
3831         (WebKit::WebURLSchemeTaskProxy::startLoading):
3832         (WebKit::WebURLSchemeTaskProxy::stopLoading):
3833         (WebKit::WebURLSchemeTaskProxy::didReceiveResponse):
3834         (WebKit::WebURLSchemeTaskProxy::didReceiveData):
3835         (WebKit::WebURLSchemeTaskProxy::didComplete):
3836         (WebKit::WebURLSchemeTaskProxy::hasLoader):
3837         * WebProcess/WebPage/WebURLSchemeTaskProxy.h: Renamed from Source/WebKit2/WebProcess/WebPage/WebURLSchemeHandlerTaskProxy.h.
3838         (WebKit::WebURLSchemeTaskProxy::request):
3839         (WebKit::WebURLSchemeTaskProxy::identifier):
3840
3841 2017-05-01  Chris Dumez  <cdumez@apple.com>
3842
3843         Tweak how long we allow a process to go over its background CPU limit
3844         https://bugs.webkit.org/show_bug.cgi?id=170460
3845         <rdar://problem/31433141>
3846
3847         Reviewed by Geoffrey Garen.
3848
3849         Tweak how long we allow a process to go over its background CPU limit. We now use 8 minutes
3850         intervals (instead of previously 15). This is less conservative and aligned with our memory
3851         kills.
3852
3853         * WebProcess/cocoa/WebProcessCocoa.mm:
3854
3855 2017-05-01  Beth Dakin  <bdakin@apple.com>
3856
3857         On-screen panel for candidate bar is in the wrong place when the caret is at the 
3858         start of a paragraph
3859         https://bugs.webkit.org/show_bug.cgi?id=171453
3860         -and corresponding-
3861         rdar://problem/29779764
3862
3863         Reviewed by Tim Horton.
3864
3865         This bug only happens when the caret is at the beginning of the paragraph, and it 
3866         is because Range::absoluteTextQuads() returns no quads in this case. I think it 
3867         might be correct that absoluteTextQuads() returns no quads in this case, so this 
3868         patch fixes the bug at the call site by using absoluteCaretBounds() in this case.
3869
3870         SPI for testing.
3871         * UIProcess/API/Cocoa/WKWebView.mm:
3872         (-[WKWebView _candidateRect]):
3873         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3874
3875         Bug fix.
3876         * WebProcess/WebPage/mac/WebPageMac.mm:
3877         (WebKit::WebPage::platformEditorState):
3878
3879 2017-05-01  Carlos Garcia Campos  <cgarcia@igalia.com>
3880
3881         [GTK] Add automation session API
3882         https://bugs.webkit.org/show_bug.cgi?id=171428
3883
3884         Reviewed by Carlos Alberto Lopez Perez.
3885
3886         Add new API to allow WebKitGTK+ to be controlled by automation. By default it's disabled, applications have to
3887         explicitly call webkit_web_context_set_automation_allowed() to enabled it. When a new automation session is
3888         requested, the signal WebKitWebContext::automation-started is emitted with a newly created
3889         WebKitAutomationSession, similar to how WebKitWebContext::download-started works. The user should connect to it
3890         have access to the WebKitAutomationSession and connect it its signals. When a new web view is requested to be
3891         created in a WebKitAutomationSession, the signal WebKitAutomationSession::create-web-view is emitted. The user
3892         should connect to it and return a WebKitWebView. The web views used for automation are special ones and need to
3893         be created with the new WebKitWebView:is-controlled-by-automation construct property enabled, otherwise we will
3894         refuse to create the requested browsing context.
3895
3896         * PlatformGTK.cmake:
3897         * UIProcess/API/gtk/WebKitAutomationSession.cpp: Added.
3898         (webkitAutomationSessionSetProperty):
3899         (webkitAutomationSessionConstructed):
3900         (webkit_automation_session_class_init):
3901         (webkitAutomationSessionCreate):
3902         (webkitAutomationSessionGetSession):
3903         (webkit_automation_session_get_id):
3904         * UIProcess/API/gtk/WebKitAutomationSession.h: Added.
3905         * UIProcess/API/gtk/WebKitAutomationSessionPrivate.h: Added.
3906         * UIProcess/API/gtk/WebKitWebContext.cpp:
3907         (webkitWebContextConstructed):
3908         (webkit_web_context_class_init):
3909         (webkit_web_context_is_automation_allowed):
3910         (webkit_web_context_set_automation_allowed):
3911         (webkitWebContextCreatePageForWebView):
3912         * UIProcess/API/gtk/WebKitWebContext.h:
3913         * UIProcess/API/gtk/WebKitWebView.cpp:
3914         (webkitWebViewConstructed):
3915         (webkitWebViewSetProperty):
3916         (webkitWebViewGetProperty):
3917         (webkit_web_view_class_init):
3918         (webkit_web_view_is_controlled_by_automation):
3919         * UIProcess/API/gtk/WebKitWebView.h:
3920         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
3921         * UIProcess/API/gtk/docs/webkit2gtk-4.0.types:
3922         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
3923         * UIProcess/API/gtk/webkit2.h:
3924
3925 2017-05-01  Carlos Garcia Campos  <cgarcia@igalia.com>
3926
3927         Unreviewed. Fix GTK+ debug build after r216002.
3928
3929         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp:
3930         (WebKit::wrapClientRectList):
3931
3932 2017-04-30  Chris Dumez  <cdumez@apple.com>
3933
3934         Drop support for legacy ClientRect / ClientRectList
3935         https://bugs.webkit.org/show_bug.cgi?id=171418
3936
3937         Reviewed by Sam Weinig.
3938
3939         GTK build fix.
3940
3941         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.cpp:
3942         (WebKit::kit):
3943         (WebKit::core):
3944         (WebKit::wrapClientRect):
3945         (webkit_dom_client_rect_constructed):
3946         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp:
3947         (ClientRectList::create):
3948         (ClientRectList::items):
3949         (ClientRectList::ClientRectList):
3950         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectListPrivate.h:
3951         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectPrivate.h:
3952         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
3953         (webkit_dom_element_get_bounding_client_rect):
3954         (webkit_dom_element_get_client_rects):
3955
3956 2017-04-30  Brady Eidson  <beidson@apple.com>
3957
3958         More fixing after r215991
3959         https://bugs.webkit.org/show_bug.cgi?id=171483
3960
3961         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3962         (WebKit::NetworkProcess::syncAllCookies):
3963
3964 2017-04-30  Brady Eidson  <beidson@apple.com>
3965
3966         Fix r215991
3967         https://bugs.webkit.org/show_bug.cgi?id=171483
3968
3969         Unreviewed.
3970
3971         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3972         (WebKit::NetworkProcess::syncAllCookies):
3973
3974 2017-04-30  Dan Bernstein  <mitz@apple.com>
3975
3976         [Cocoa] Replaces uses of [get…() alloc] with alloc…Instance()
3977         https://bugs.webkit.org/show_bug.cgi?id=171485
3978
3979         Reviewed by Geoffrey Garen.
3980
3981         * Platform/mac/MenuUtilities.mm:
3982         (WebKit::menuItemForTelephoneNumber):
3983         (WebKit::menuForTelephoneNumber):
3984
3985 2017-04-30  Brady Eidson  <beidson@apple.com>
3986
3987         Updates to _WKWebsiteDataStoreConfiguration cookie storage location SPI.
3988         <rdar://problem/31906397> and https://bugs.webkit.org/show_bug.cgi?id=171483
3989
3990         Reviewed by Geoff Garen (and kind of Andy Estes).
3991         
3992         Updates include:
3993         -Taking a file path as the config argument instead of a directory.
3994         -Proper sandbox extension handling.
3995         -Proper and thorough API test.
3996
3997         * NetworkProcess/NetworkProcess.cpp:
3998         (WebKit::NetworkProcess::syncAllCookies):
3999         * NetworkProcess/NetworkProcess.h:
4000         * NetworkProcess/NetworkProcess.messages.in:
4001
4002         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
4003         (WebKit::NetworkProcess::syncAllCookies):
4004