cf227a7e2ced69f47e0a62766916731c1ad76d72
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2016-11-28  Matthew Hanson  <matthew_hanson@apple.com>
2
3         Roll out r208589. rdar://problem/29277451
4
5 2016-11-28  Ryan Haddad  <ryanhaddad@apple.com>
6
7         Unreviewed, rolling out r209008.
8
9         This change appears to have caused two fast/mediastrem
10         LayoutTests to fail.
11
12         Reverted changeset:
13
14         "[MediaStream] Don't request user permission for a device if
15         it has already been granted in the current browsing context"
16         https://bugs.webkit.org/show_bug.cgi?id=164760
17         http://trac.webkit.org/changeset/209008
18
19 2016-11-28  Andrew Gold  <agold@apple.com>
20
21         Support for HTML Media Capture API
22         https://bugs.webkit.org/show_bug.cgi?id=43239
23
24         Reviewed by Tim Horton.
25
26         In order to enable media capture on iOS, we must first use the AVFoundation API to 
27         check/request capture permission from the user for Safari. Then, Safari must request
28         permission on behalf of the webpage to use the capture devices. Additionally, Safari
29         must present UI when the capture is taking place, so WebKit needs to notify the client
30         of a capture session beginning and ending. To do this, we added four methods to 
31         WKUIDelegatePrivate to request permission from the user, check for permissions, notify
32         that a capture session has begun, and notify that a capture session has ended. Additionally,
33         we added a private method to WKWebView that allows the client to stop a capture session.
34
35         * UIProcess/API/APIUIClient.h:
36         (API::UIClient::didBeginCaptureSession): Notifies the client of a capture session beginning.
37         (API::UIClient::didEndCaptureSession): Notifies the client of a capture session ending.
38
39         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Added new delegate methods to request permission,
40         check for permission, notify of a capture session beginning, and notify of a capture session
41         ending.
42
43         * UIProcess/API/Cocoa/WKWebView.mm:
44         (-[WKWebView _stopMediaCapture]): Cancels a media capture session.
45         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
46
47         * UIProcess/Cocoa/UIDelegate.h:
48         * UIProcess/Cocoa/UIDelegate.mm:
49         (WebKit::UIDelegate::setDelegate): Added the new delegate methods.
50         (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
51         First checks if the user has authorized the client application access capture devices,
52         then uses the WKUIDelegate to request permission for a site from the user.
53         (WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin): Checks the client
54         for permission to access capture devices.
55         (WebKit::UIDelegate::UIClient::didBeginCaptureSession): Notifies the client of a capture
56         session beginning.
57         (WebKit::UIDelegate::UIClient::didEndCaptureSession): Notifies the client of a capture
58         session ending.
59
60         * UIProcess/WebPageProxy.cpp:
61         (WebKit::WebPageProxy::isPlayingMediaDidChange): Calls UIDelegate method to notify the
62         client of a capture session beginning/ending.
63
64 2016-11-28  Eric Carlson  <eric.carlson@apple.com>
65
66         [MediaStream] Don't request user permission for a device if it has already been granted in the current browsing context
67         https://bugs.webkit.org/show_bug.cgi?id=164760
68         <rdar://problem/29261266>
69
70         Reviewed by Youenn Fablet.
71
72         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
73         (WebKit::FrameAuthorizationState::FrameAuthorizationState):
74         (WebKit::FrameAuthorizationState::hasPermissionToUseCaptureDevice):
75         (WebKit::FrameAuthorizationState::setHasPermissionToUseCaptureDevice):
76         (WebKit::FrameAuthorizationState::reset):
77         (WebKit::FrameAuthorizationState::securityOriginsAreEqual):
78         (WebKit::UserMediaPermissionRequestManagerProxy::stateForRequest):
79         (WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests):
80         (WebKit::UserMediaPermissionRequestManagerProxy::createRequest):
81         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied):
82         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
83         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
84         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
85         (WebKit::FrameAuthorizationState::~FrameAuthorizationState):
86         (WebKit::FrameAuthorizationState::frameID):
87         * UIProcess/UserMediaPermissionRequestProxy.cpp:
88         (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy):
89         * UIProcess/UserMediaPermissionRequestProxy.h:
90         (WebKit::UserMediaPermissionRequestProxy::create):
91         (WebKit::UserMediaPermissionRequestProxy::frameID):
92         (WebKit::UserMediaPermissionRequestProxy::userMediaDocumentSecurityOrigin):
93         (WebKit::UserMediaPermissionRequestProxy::topLevelDocumentSecurityOrigin):
94         * UIProcess/WebPageProxy.cpp:
95         (WebKit::WebPageProxy::didCommitLoadForFrame):
96         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
97         (WebKit::UserMediaPermissionRequestManager::removeMediaRequestFromMaps):
98
99 2016-11-27  Dean Jackson  <dino@apple.com>
100
101         Removed a WTFLogAlways I left in with a recent commit.
102
103         * UIProcess/Cocoa/WebViewImpl.mm:
104         (-[WKAccessibilitySettingsObserver _settingsDidChange:]):
105
106 2016-11-27  Csaba Osztrogonác  <ossy@webkit.org>
107
108         Fix unused-private-field build warning in WebKit2/Platform/SharedMemory.h
109         https://bugs.webkit.org/show_bug.cgi?id=165069
110
111         Reviewed by Darin Adler.
112
113         * Platform/SharedMemory.h:
114
115 2016-11-26  Simon Fraser  <simon.fraser@apple.com>
116
117         Fix the iOS build.
118
119         * WebProcess/WebPage/ios/WebPageIOS.mm:
120         (WebKit::WebPage::eventThrottlingDelay):
121
122 2016-11-26  Yusuke Suzuki  <utatane.tea@gmail.com>
123
124         [WTF] Import std::optional reference implementation as WTF::Optional
125         https://bugs.webkit.org/show_bug.cgi?id=164199
126
127         Reviewed by Saam Barati and Sam Weinig.
128
129         * NetworkProcess/NetworkDataTask.cpp:
130         (WebKit::NetworkDataTask::didReceiveResponse):
131         * NetworkProcess/NetworkLoad.h:
132         * NetworkProcess/cache/NetworkCache.cpp:
133         (WebKit::NetworkCache::responseHasExpired):
134         * NetworkProcess/cache/NetworkCacheCoders.h:
135         (WebKit::NetworkCache::Coder<std::optional<T>>::encode):
136         (WebKit::NetworkCache::Coder<std::optional<T>>::decode):
137         (WebKit::NetworkCache::Coder<Optional<T>>::encode): Deleted.
138         (WebKit::NetworkCache::Coder<Optional<T>>::decode): Deleted.
139         * NetworkProcess/cache/NetworkCacheData.cpp:
140         (WebKit::NetworkCache::readOrMakeSalt):
141         * NetworkProcess/cache/NetworkCacheData.h:
142         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
143         (WebKit::NetworkCache::SpeculativeLoadManager::PreloadedEntry::PreloadedEntry):
144         (WebKit::NetworkCache::SpeculativeLoadManager::PreloadedEntry::revalidationRequest):
145         (WebKit::NetworkCache::SpeculativeLoadManager::addPreloadedEntry):
146         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
147         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
148         (WebKit::NetworkCache::Statistics::recordNotUsingCacheForRequest):
149         (WebKit::NetworkCache::Statistics::recordRetrievalFailure):
150         (WebKit::NetworkCache::Statistics::queryWasEverRequested):
151         * NetworkProcess/cache/NetworkCacheStatistics.h:
152         * NetworkProcess/cache/NetworkCacheStorage.cpp:
153         (WebKit::NetworkCache::Storage::storeBodyAsBlob):
154         (WebKit::NetworkCache::Storage::encodeRecord):
155         (WebKit::NetworkCache::Storage::dispatchWriteOperation):
156         * NetworkProcess/cache/NetworkCacheStorage.h:
157         * Platform/IPC/ArgumentCoders.h:
158         (IPC::ArgumentCoder<std::optional<T>>::encode):
159         (IPC::ArgumentCoder<std::optional<T>>::decode):
160         (IPC::ArgumentCoder<WTF::Optional<T>>::encode): Deleted.
161         (IPC::ArgumentCoder<WTF::Optional<T>>::decode): Deleted.
162         * Platform/IPC/Connection.h:
163         (IPC::Connection::sendWithReply):
164         * Platform/SharedMemory.h:
165         * Platform/unix/SharedMemoryUnix.cpp:
166         (WebKit::SharedMemory::map):
167         * Scripts/webkit/messages.py:
168         (class_template_headers):
169         * Shared/API/APISecurityOrigin.h:
170         (API::SecurityOrigin::create):
171         * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
172         * Shared/API/c/WKSecurityOriginRef.cpp:
173         (WKSecurityOriginGetPort):
174         * Shared/SessionState.h:
175         * Shared/WebPageCreationParameters.h:
176         * Shared/mac/ObjCObjectGraph.mm:
177         (WebKit::typeFromObject):
178         * Shared/mac/SecItemShim.cpp:
179         (WebKit::sendSecItemRequest):
180         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
181         (WKKeyValueStorageManagerGetStorageDetailsByOrigin):
182         * UIProcess/API/Cocoa/WKSecurityOrigin.mm:
183         (-[WKSecurityOrigin port]):
184         * UIProcess/API/Cocoa/WKWebView.mm:
185         (-[WKWebView _didCommitLayerTree:]):
186         (-[WKWebView _navigationGestureDidEnd]):
187         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
188         (WebKit::toWebsiteDataType):
189         * UIProcess/API/efl/EwkView.cpp:
190         (EwkView::setCursor):
191         * UIProcess/API/mac/WKView.mm:
192         (toCoreScrollbarStyle):
193         (toAPIScrollbarStyle):
194         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
195         (WebKit::WebPaymentCoordinatorProxy::completeShippingMethodSelection):
196         (WebKit::WebPaymentCoordinatorProxy::completeShippingContactSelection):
197         (WebKit::WebPaymentCoordinatorProxy::completePaymentMethodSelection):
198         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
199         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in:
200         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
201         (WebKit::toPKPaymentSummaryItem):
202         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection):
203         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection):
204         (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection):
205         * UIProcess/Automation/WebAutomationSession.cpp:
206         (WebKit::WebAutomationSession::webFrameIDForHandle):
207         (WebKit::WebAutomationSession::switchToBrowsingContext):
208         (WebKit::WebAutomationSession::evaluateJavaScriptFunction):
209         (WebKit::WebAutomationSession::resolveChildFrameHandle):
210         (WebKit::WebAutomationSession::resolveParentFrameHandle):
211         (WebKit::WebAutomationSession::computeElementLayout):
212         * UIProcess/Automation/WebAutomationSession.h:
213         * UIProcess/Cocoa/WebViewImpl.h:
214         * UIProcess/Cocoa/WebViewImpl.mm:
215         (WebKit::WebViewImpl::updateViewExposedRect):
216         (WebKit::WebViewImpl::setOverlayScrollbarStyle):
217         (WebKit::WebViewImpl::overlayScrollbarStyle):
218         * UIProcess/DrawingAreaProxy.cpp:
219         (WebKit::DrawingAreaProxy::setViewExposedRect):
220         * UIProcess/DrawingAreaProxy.h:
221         (WebKit::DrawingAreaProxy::viewExposedRect):
222         * UIProcess/InspectorServer/WebSocketServerConnection.cpp:
223         (WebKit::WebSocketServerConnection::didReceiveSocketStreamData):
224         * UIProcess/InspectorServer/WebSocketServerConnection.h:
225         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
226         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
227         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
228         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
229         (WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll):
230         * UIProcess/Scrolling/RemoteScrollingTree.h:
231         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
232         (WebKit::fileCreationTime):
233         (WebKit::fileModificationTime):
234         * UIProcess/Storage/LocalStorageDatabaseTracker.h:
235         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
236         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
237         * UIProcess/WebBackForwardList.cpp:
238         (WebKit::WebBackForwardList::backForwardListState):
239         (WebKit::WebBackForwardList::restoreFromState):
240         * UIProcess/WebPageProxy.cpp:
241         (WebKit::WebPageProxy::didCommitLoadForFrame):
242         (WebKit::WebPageProxy::creationParameters):
243         (WebKit::WebPageProxy::setOverlayScrollbarStyle):
244         * UIProcess/WebPageProxy.h:
245         (WebKit::WebPageProxy::overlayScrollbarStyle):
246         * UIProcess/WebPageProxy.messages.in:
247         * UIProcess/WebsiteData/WebsiteDataRecord.h:
248         * UIProcess/efl/WebView.cpp:
249         (WebKit::WebView::transformFromScene):
250         * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
251         * UIProcess/gtk/WebPreferencesGtk.cpp:
252         (WebKit::WebPreferences::platformInitializeStore):
253         * UIProcess/ios/WKContentViewInteraction.mm:
254         (-[WKContentView _scrollOffsetForEvent:]):
255         (-[WKContentView _interpretKeyEvent:isCharEvent:]):
256         * UIProcess/mac/LegacySessionStateCoding.cpp:
257         (WebKit::encodeFormDataElement):
258         (WebKit::decodeFormDataElement):
259         (WebKit::decodeV1SessionHistory):
260         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
261         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
262         (WebKit::RemoteLayerTreeDrawingAreaProxy::setViewExposedRect):
263         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
264         (WebKit::WebPaymentCoordinator::completeShippingMethodSelection):
265         (WebKit::WebPaymentCoordinator::completeShippingContactSelection):
266         (WebKit::WebPaymentCoordinator::completePaymentMethodSelection):
267         * WebProcess/ApplePay/WebPaymentCoordinator.h:
268         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
269         (WKBundlePageSetEventThrottlingBehaviorOverride):
270         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
271         (WebKit::PDFPlugin::convertFromPDFViewToRootView):
272         (WebKit::PDFPlugin::convertFromPDFViewToScreen):
273         (WebKit::PDFPlugin::boundsOnScreen):
274         (WebKit::PDFPlugin::geometryDidChange):
275         * WebProcess/Plugins/PDF/PDFPlugin.mm:
276         (WebKit::PDFPlugin::geometryDidChange):
277         * WebProcess/Plugins/PluginView.cpp:
278         (WebKit::PluginView::performFrameLoadURLRequest):
279         (WebKit::PluginView::evaluate):
280         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
281         (WebKit::WebPluginInfoProvider::pluginLoadClientPolicyForHost):
282         * WebProcess/Plugins/WebPluginInfoProvider.h:
283         * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
284         (WebKit::RemoteScrollingCoordinator::scrollPositionChangedForNode):
285         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
286         (WebKit::toFormData):
287         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
288         (WebKit::WebChromeClient::preferredScrollbarOverlayStyle):
289         * WebProcess/WebCoreSupport/WebChromeClient.h:
290         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
291         (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
292         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
293         * WebProcess/WebPage/DrawingArea.h:
294         * WebProcess/WebPage/DrawingArea.messages.in:
295         * WebProcess/WebPage/WebFrame.cpp:
296         (WebKit::WebFrame::certificateInfo):
297         * WebProcess/WebPage/WebPage.cpp:
298         (WebKit::m_userInterfaceLayoutDirection):
299         (WebKit::WebPage::setScrollbarOverlayStyle):
300         * WebProcess/WebPage/WebPage.h:
301         (WebKit::WebPage::scrollbarOverlayStyle):
302         * WebProcess/WebPage/WebPage.messages.in:
303         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
304         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
305         (WebKit::RemoteLayerTreeDrawingArea::setViewExposedRect):
306         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
307         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
308         (WebKit::TiledCoreAnimationDrawingArea::setViewExposedRect):
309
310 2016-11-26  Sam Weinig  <sam@webkit.org>
311
312         Convert IntersectionObserver over to using RuntimeEnabledFeatures so it can be properly excluded from script
313         https://bugs.webkit.org/show_bug.cgi?id=164965
314
315         Reviewed by Simon Fraser.
316
317         * Shared/WebPreferencesDefinitions.h:
318         * UIProcess/API/C/WKPreferences.cpp:
319         (WKPreferencesSetIntersectionObserverEnabled):
320         (WKPreferencesGetIntersectionObserverEnabled):
321         * UIProcess/API/C/WKPreferencesRefPrivate.h:
322         * WebProcess/WebPage/WebPage.cpp:
323         (WebKit::WebPage::updatePreferences):
324         Add a preference, defaulting to off, for enabling IntersectionObserver.
325
326 2016-11-26  Simon Fraser  <simon.fraser@apple.com>
327
328         Migrate some layout timer-related code from std::chrono to Seconds and MonotonicTime
329         https://bugs.webkit.org/show_bug.cgi?id=164992
330
331         Reviewed by Darin Adler.
332         
333         No more ugly conversion from seconds to milliseconds.
334
335         * WebProcess/WebPage/WebPage.cpp:
336         (WebKit::WebPage::updatePreferences):
337         * WebProcess/WebPage/ios/WebPageIOS.mm:
338         (WebKit::WebPage::eventThrottlingDelay):
339
340 2016-11-25  Michael Catanzaro  <mcatanzaro@igalia.com>
341
342         [GTK] Follow-up fixes to r208974
343         https://bugs.webkit.org/show_bug.cgi?id=164771
344
345         Unreviewed, implement Carlos's review feedback.
346
347         * UIProcess/API/gtk/WebKitNotification.cpp:
348         (webkit_notification_get_tag):
349         * UIProcess/API/gtk/WebKitNotificationProvider.cpp:
350         (WebKitNotificationProvider::withdrawAnyPreviousNotificationMatchingTag):
351         (WebKitNotificationProvider::show):
352         * UIProcess/API/gtk/WebKitNotificationProvider.h:
353
354 2016-11-24  Michael Catanzaro  <mcatanzaro@igalia.com>
355
356         [GTK] Notifications API does not expose or respect the "tag" attribute
357         https://bugs.webkit.org/show_bug.cgi?id=164771
358
359         Reviewed by Gustavo Noronha Silva.
360
361         Expose a tag property on WebKitNotification. Ensure that any previous notification with the
362         same tag is closed when showing a new notification with that tag.
363
364         * UIProcess/API/gtk/WebKitNotification.cpp:
365         (webkit_notification_class_init):
366         (webkitNotificationCreate):
367         (webkit_notification_get_tag):
368         * UIProcess/API/gtk/WebKitNotification.h:
369         * UIProcess/API/gtk/WebKitNotificationProvider.cpp:
370         (WebKitNotificationProvider::withdrawAnyPreviousNotificationMatchingTag):
371         (WebKitNotificationProvider::show):
372         * UIProcess/API/gtk/WebKitNotificationProvider.h:
373         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
374
375 2016-11-22  Sergio Villar Senin  <svillar@igalia.com>
376
377         [GTK] Fix introspection warning
378         https://bugs.webkit.org/show_bug.cgi?id=165026
379
380         Reviewed by Michael Catanzaro.
381
382         This fixes an introspection annotation for a new API added in r208532.
383
384         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
385         (webkit_web_page_class_init):
386
387 2016-11-21  Carlos Garcia Campos  <cgarcia@igalia.com>
388
389         [SOUP] Simplify custom protocols handler implementation
390         https://bugs.webkit.org/show_bug.cgi?id=164922
391
392         Reviewed by Michael Catanzaro.
393
394         We are using too many classes for this and also the C API that is not needed, because both GTK+ and EFL have
395         their own APIs and this is not used by WTR at all.
396
397         * PlatformEfl.cmake: Remove files from compilation.
398         * PlatformGTK.cmake: Ditto.
399         * Shared/API/c/WKBase.h:
400         * Shared/API/c/soup/WKBaseSoup.h: Removed.
401         * UIProcess/API/APICustomProtocolManagerClient.h: Added.
402         (API::CustomProtocolManagerClient::~CustomProtocolManagerClient):
403         (API::CustomProtocolManagerClient::startLoading):
404         (API::CustomProtocolManagerClient::stopLoading):
405         (API::CustomProtocolManagerClient::invalidate):
406         * UIProcess/API/C/WKAPICast.h:
407         * UIProcess/API/C/soup/WKAPICastSoup.h: Removed.
408         * UIProcess/API/C/soup/WKContextSoup.h: Removed.
409         * UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.cpp: Removed.
410         * UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.h: Removed.
411         * UIProcess/API/C/soup/WKSoupRequestManager.h: Removed.
412         * UIProcess/API/efl/ewk_context.cpp: Remove unneeded include.
413         * UIProcess/API/efl/ewk_url_scheme_request.cpp: Use CustomProtocolManagerProxy instead of WKSoupCustomProtocolRequestManagerRef.
414         (EwkUrlSchemeRequest::EwkUrlSchemeRequest):
415         (EwkUrlSchemeRequest::finish):
416         (EwkUrlSchemeRequest::invalidate):
417         * UIProcess/API/efl/ewk_url_scheme_request_private.h:
418         (EwkUrlSchemeRequest::create):
419         (EwkUrlSchemeRequest::manager):
420         * UIProcess/API/gtk/WebKitCustomProtocolManagerClient.cpp: Added.
421         (attachCustomProtocolManagerClientToContext):
422         * UIProcess/API/gtk/WebKitCustomProtocolManagerClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitRequestManagerClient.h.
423         * UIProcess/API/gtk/WebKitPrivate.h:
424         * UIProcess/API/gtk/WebKitRequestManagerClient.cpp: Removed.
425         * UIProcess/API/gtk/WebKitRequestManagerClient.h: Removed.
426         * UIProcess/API/gtk/WebKitURISchemeRequest.cpp: Use CustomProtocolManagerProxy instead of WebSoupCustomProtocolRequestManager.
427         (webkitURISchemeRequestCreate):
428         (webkitURISchemeRequestCancel):
429         (webkitURISchemeRequestGetManager):
430         (webkitURISchemeRequestInvalidate):
431         (webkitURISchemeRequestReadCallback):
432         (webkit_uri_scheme_request_finish_error):
433         * UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h:
434         * UIProcess/API/gtk/WebKitWebContext.cpp:
435         (webkitWebContextConstructed):
436         (webkitWebContextDispose):
437         (webkit_web_context_register_uri_scheme):
438         (webkitWebContextStartLoadingCustomProtocol):
439         (webkitWebContextInvalidateCustomProtocolRequests):
440         * UIProcess/API/gtk/WebKitWebContextPrivate.h:
441         * UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.h:
442         * UIProcess/Network/CustomProtocols/mac/CustomProtocolManagerProxyMac.mm:
443         (WebKit::CustomProtocolManagerProxy::processDidClose):
444         * UIProcess/Network/CustomProtocols/soup/CustomProtocolManagerProxySoup.cpp:
445         (WebKit::CustomProtocolManagerProxy::processDidClose): Invalidate the client.
446         (WebKit::CustomProtocolManagerProxy::startLoading): Notify the client.
447         (WebKit::CustomProtocolManagerProxy::stopLoading): Ditto.
448         (WebKit::CustomProtocolManagerProxy::didReceiveResponse): Notify the network process.
449         (WebKit::CustomProtocolManagerProxy::didLoadData): Ditto.
450         (WebKit::CustomProtocolManagerProxy::didFailWithError): Ditto.
451         (WebKit::CustomProtocolManagerProxy::didFinishLoading): Ditto.
452         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.cpp: Removed.
453         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.h: Removed.
454         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.cpp: Removed.
455         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.h: Removed.
456         * UIProcess/Network/NetworkProcessProxy.cpp:
457         (WebKit::NetworkProcessProxy::didClose): Notify the CustomProtocolManagerProxy.
458         * UIProcess/WebProcessPool.cpp:
459         (WebKit::WebProcessPool::WebProcessPool): Initialize the CustomProtocolManagerClient and remove the all supplement.
460         (WebKit::WebProcessPool::setCustomProtocolManagerClient):
461         (WebKit::WebProcessPool::registerSchemeForCustomProtocol): In case of soup cache the given protocol.
462         (WebKit::WebProcessPool::unregisterSchemeForCustomProtocol): In case of soup delete the given protocol from the cache.
463         * UIProcess/WebProcessPool.h:
464         * UIProcess/efl/RequestManagerClientEfl.cpp: Do not use the C API, but API::CustomProtocolManagerClient.
465         (WebKit::RequestManagerClientEfl::RequestManagerClientEfl):
466         (WebKit::RequestManagerClientEfl::registerURLSchemeHandler):
467         * UIProcess/efl/RequestManagerClientEfl.h:
468         * UIProcess/efl/WebProcessPoolEfl.cpp:
469         * UIProcess/gtk/WebProcessPoolGtk.cpp:
470         * UIProcess/soup/WebProcessPoolSoup.cpp:
471         (WebKit::WebProcessPool::platformInitializeNetworkProcess): Use m_urlSchemesRegisteredForCustomProtocols to
472         build the list of custom protocols to send to the network process.
473
474 2016-11-21  Alex Christensen  <achristensen@webkit.org>
475
476         Fix Sierra CMake build after r208452
477         https://bugs.webkit.org/show_bug.cgi?id=164437
478
479         * UIProcess/Cocoa/WebViewImpl.mm:
480         (WebKit::WebViewImpl::updateMediaTouchBar):
481         I haven't enabled VIDEO_PRESENTATION_MODE in the CMake build yet.
482         It's needed for WebPlaybackSessionInterfaceMac to exist.
483
484 2016-11-21  Carlos Garcia Campos  <cgarcia@igalia.com>
485
486         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.15.2 release.
487
488         * gtk/NEWS: Add release notes for 2.15.2.
489
490 2016-11-21  Carlos Garcia Campos  <cgarcia@igalia.com>
491
492         Remove m_customProtocolManagerProxy from WebProcessProxy
493         https://bugs.webkit.org/show_bug.cgi?id=164908
494
495         Reviewed by Andreas Kling.
496
497         Since the network process is mandatory, the custom protocol manager proxy of WebProcessProxy is unused and can
498         be removed.
499
500         * UIProcess/WebProcessProxy.cpp:
501         (WebKit::WebProcessProxy::WebProcessProxy):
502         * UIProcess/WebProcessProxy.h:
503
504 2016-11-20  Zan Dobersek  <zdobersek@igalia.com>
505
506         [EncryptedMedia] Make EME API runtime-enabled
507         https://bugs.webkit.org/show_bug.cgi?id=164927
508
509         Reviewed by Jer Noble.
510
511         Add the new EncryptedMediaAPI preference. Set the same feature
512         flag on the shared RuntimeEnabledFeatures object to the
513         corresponding value that's stored in the WebPreferencesStore.
514
515         InjectedBundle::overrideBoolPreferenceForTestRunner() does the
516         same when the 'WebKitEncryptedMediaAPIEnabled' preference is
517         overridden in WKTR for testing purposes.
518
519         * Shared/WebPreferencesDefinitions.h:
520         * WebProcess/InjectedBundle/InjectedBundle.cpp:
521         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
522         * WebProcess/WebPage/WebPage.cpp:
523         (WebKit::WebPage::updatePreferences):
524
525 2016-11-19  Antti Koivisto  <antti@apple.com>
526
527         Salt network cache hashes
528         https://bugs.webkit.org/show_bug.cgi?id=164924
529
530         Reviewed by Alex Christensen.
531
532         To enhance privacy make cache content unidentifiable from file names alone.
533         This is done by generating a unique persistent salt for each cache instance.
534         It is used when computing hashes used in file names.
535
536         The patch also replaces plain text partition directory names with salted hashes.
537
538         * NetworkProcess/cache/NetworkCache.cpp:
539         (WebKit::NetworkCache::Cache::makeCacheKey):
540         (WebKit::NetworkCache::makeCacheKey): Deleted.
541         * NetworkProcess/cache/NetworkCache.h:
542
543             Increment cache version.
544
545         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
546         (WebKit::NetworkCache::BlobStorage::BlobStorage):
547         (WebKit::NetworkCache::BlobStorage::add):
548         (WebKit::NetworkCache::BlobStorage::get):
549
550             Use salt for blob content hash.
551
552         * NetworkProcess/cache/NetworkCacheBlobStorage.h:
553         * NetworkProcess/cache/NetworkCacheData.cpp:
554         (WebKit::NetworkCache::computeSHA1):
555
556             For simplicity all SHA1s are now salted.
557
558         (WebKit::NetworkCache::makeSalt):
559         (WebKit::NetworkCache::readOrMakeSalt):
560
561             Read salt if it exists, generate and persist it otherwise.
562
563         * NetworkProcess/cache/NetworkCacheData.h:
564         * NetworkProcess/cache/NetworkCacheKey.cpp:
565         (WebKit::NetworkCache::Key::Key):
566
567             Remove the "No partition" string and just empty.
568             That was only needed to have a directory name of some sort.
569
570         (WebKit::NetworkCache::Key::computeHash):
571
572             Use salt for key hash.
573
574         (WebKit::NetworkCache::Key::computePartitionHash):
575
576             Separate hash for partition.
577
578         * NetworkProcess/cache/NetworkCacheKey.h:
579         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
580         (WebKit::NetworkCache::makeSubresourcesKey):
581         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::saveToDiskIfReady):
582         (WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry):
583         * NetworkProcess/cache/NetworkCacheStorage.cpp:
584         (WebKit::NetworkCache::makeSaltFilePath):
585         (WebKit::NetworkCache::Storage::open):
586
587             Cache can't be opened if we can't read or persist a salt.
588
589         (WebKit::NetworkCache::traverseRecordsFiles):
590         (WebKit::NetworkCache::Storage::Storage):
591         (WebKit::NetworkCache::Storage::synchronize):
592         (WebKit::NetworkCache::Storage::recordDirectoryPathForKey):
593
594             Use the partition hash in the directory name instead of a plain text name.
595
596         (WebKit::NetworkCache::decodeRecordHeader):
597         (WebKit::NetworkCache::Storage::readRecord):
598         (WebKit::NetworkCache::Storage::encodeRecord):
599         (WebKit::NetworkCache::Storage::traverse):
600         (WebKit::NetworkCache::Storage::clear):
601         * NetworkProcess/cache/NetworkCacheStorage.h:
602         (WebKit::NetworkCache::Storage::salt):
603
604 2016-11-19  Simon Fraser  <simon.fraser@apple.com>
605
606         [iOS WK2] When zoomed in and panning on pages with fixed bars, parts of the bars are sometimes missing
607         https://bugs.webkit.org/show_bug.cgi?id=164855
608
609         Reviewed by Sam Weinig.
610
611         During UI-process panning and zooming, we send visible rect updates to the web process
612         with inStableState=false, and don't update GraphicsLayers until we get into a stable state.
613
614         This causes a problem where the web process has a stale notion of where the GraphicsLayers
615         for position:fixed elements are, but is then told to update tiling coverage with an up-to-date
616         visible rect. The existing "sync layer positions" path isn't useful to fix this, because it
617         breaks the relationship between the GraphicsLayer positions and their FixedPositionViewportConstraints
618         in the scrolling tree.
619
620         To address this, add the notion of an Optional<> approximatePosition on GraphicsLayers. This is used
621         only by the coverageRect computation code path, and is cleared by a setPosition(). ApproximatePositions
622         are pushed onto GraphicsLayers via the syncViewportConstrainedLayerPositions() code path (renamed to
623         reconcileViewportConstrainedLayerPositions).
624
625         Tested by scrollingcoordinator/ios/non-stable-viewport-scroll.html
626
627         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
628         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
629         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
630         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
631         (WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll):
632         * UIProcess/Scrolling/RemoteScrollingTree.h:
633         * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
634         (WebKit::RemoteScrollingCoordinator::scrollPositionChangedForNode):
635         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
636         (WebKit::CompositingCoordinator::flushPendingLayerChanges):
637         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
638         (WebKit::CoordinatedLayerTreeHost::didFlushRootLayer):
639         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
640         (WebKit::LayerTreeHostGtk::flushPendingLayerChanges):
641         * WebProcess/WebPage/ios/WebPageIOS.mm:
642         (WebKit::WebPage::updateVisibleContentRects): Always push the custom fixed position rect down, but send
643         ScrollingLayerPositionAction::SetApproximate if the state is not stable.
644         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
645         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
646         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
647         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
648
649 2016-11-18  Simon Fraser  <simon.fraser@apple.com>
650
651         Make it possible to test non-stable-state scrolling on iOS
652         https://bugs.webkit.org/show_bug.cgi?id=164905
653
654         Reviewed by Dan Bernstein.
655
656         Make it possible for an iOS layout test to force every visible rect update
657         from the UI process to the web process to be in a non-stable state. This emulates
658         what happens during panning and zooming interactions, and allows us to test the
659         scrolling and layer trees in these transient states.
660
661         This is done by adding a testing property on WKWebView, _stableStateOverride, whose
662         getters and setters are overridden in TestRunnerWKWebView. When non-nil, we _updateVisibleContentRectAfterScrollInView
663         consults the NSNumber's boolValue and uses it to override the stable state.
664
665         To facilitate this kind of testing, also add immediateScrollToOffset() and
666         immediateZoomToScale() to UIScriptController. Finally, add doAfterPresentationUpdate()
667         which provides a callback that fires after one trip to the web process and back.
668
669         * UIProcess/API/Cocoa/WKWebView.mm:
670         (-[WKWebView _updateVisibleContentRectAfterScrollInView:]):
671         (-[WKWebView _stableStateOverride]):
672         (-[WKWebView _setStableStateOverride:]):
673         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
674
675 2016-11-18  Simon Fraser  <simon.fraser@apple.com>
676
677         [iOS WK2] Eliminate a source of flakiness in layout tests by forcing WebPage into "responsive" mode for all tests, with an internals override
678         https://bugs.webkit.org/show_bug.cgi?id=164980
679
680         Reviewed by Chris Dumez.
681
682         WebPage::eventThrottlingDelay() uses a latency estimate based on the round-trip time from the UI process
683         to affect behavior, including whether scroll events are fired. This also affects the FrameView "scrolledByUser"
684         flag that impacts tile coverage.
685
686         During testing, latency falling above or below the 16ms threshold could affect behavior. Fix by forcing
687         WebPage into "responsive" mode while running tests, via InjectedBundlePage::prepare().
688
689         Add a nullable internals property so that a test can specify responsive, unresponsive or default behavior.
690
691         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
692         (WKBundlePageSetEventThrottlingBehaviorOverride):
693         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
694         * WebProcess/WebPage/ios/WebPageIOS.mm:
695         (WebKit::WebPage::eventThrottlingDelay):
696
697 2016-11-18  Simon Fraser  <simon.fraser@apple.com>
698
699         Remove use of std::chrono in WebPage and entrained code
700         https://bugs.webkit.org/show_bug.cgi?id=164967
701
702         Reviewed by Tim Horton.
703
704         Replace std::chrono with Seconds and Monotonic Time.
705
706         Use more C++11 initialization for WebPage data members.
707
708         * Shared/VisibleContentRectUpdateInfo.cpp:
709         (WebKit::operator<<):
710         * Shared/VisibleContentRectUpdateInfo.h:
711         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
712         (WebKit::VisibleContentRectUpdateInfo::timestamp):
713         * Shared/WebCoreArgumentCoders.cpp:
714         (IPC::ArgumentCoder<MonotonicTime>::encode):
715         (IPC::ArgumentCoder<MonotonicTime>::decode):
716         (IPC::ArgumentCoder<Seconds>::encode):
717         (IPC::ArgumentCoder<Seconds>::decode):
718         * Shared/WebCoreArgumentCoders.h:
719         * UIProcess/ios/WKContentView.mm:
720         (WebKit::HistoricalVelocityData::HistoricalVelocityData):
721         (WebKit::HistoricalVelocityData::velocityForNewData):
722         (WebKit::HistoricalVelocityData::append):
723         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
724         * WebProcess/WebCoreSupport/WebChromeClient.h:
725         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
726         (WebKit::WebChromeClient::eventThrottlingDelay):
727         * WebProcess/WebPage/ViewUpdateDispatcher.h:
728         * WebProcess/WebPage/WebPage.cpp:
729         (WebKit::WebPage::WebPage):
730         (WebKit::m_userActivityHysteresis):
731         (WebKit::WebPage::didFlushLayerTreeAtTime):
732         (WebKit::WebPage::didCommitLoad):
733         * WebProcess/WebPage/WebPage.h:
734         * WebProcess/WebPage/ios/WebPageIOS.mm:
735         (WebKit::WebPage::eventThrottlingDelay):
736         (WebKit::WebPage::updateVisibleContentRects):
737         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
738         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
739
740 2016-11-18  Dean Jackson  <dino@apple.com>
741
742         AX: "(inverted-colors)" media query only matches on page reload; should match on change
743         https://bugs.webkit.org/show_bug.cgi?id=163564
744         <rdar://problem/28807350>
745
746         Reviewed by Simon Fraser.
747
748         Listen for the appropriate notifications that accessibility settings
749         have changed. This is a single notification on macOS, which uses WebViewImpl,
750         and more fine-grained notifications on iOS, using WKWebView.
751
752         When we see the notification, send a message to the WebProcess which will
753         then tell the WebCore::Page.
754
755         * UIProcess/API/Cocoa/WKWebView.mm:
756         (-[WKWebView _initializeWithConfiguration:]):
757         (-[WKWebView _accessibilitySettingsDidChange:]):
758         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
759         * UIProcess/Cocoa/WebViewImpl.h:
760         * UIProcess/Cocoa/WebViewImpl.mm:
761         (-[WKAccessibilitySettingsObserver initWithImpl:]):
762         (-[WKAccessibilitySettingsObserver dealloc]):
763         (-[WKAccessibilitySettingsObserver _settingsDidChange:]):
764         (WebKit::WebViewImpl::WebViewImpl):
765         (WebKit::WebViewImpl::accessibilitySettingsDidChange):
766         * UIProcess/WebPageProxy.cpp:
767         (WebKit::WebPageProxy::accessibilitySettingsDidChange):
768         * UIProcess/WebPageProxy.h:
769         * WebProcess/WebPage/WebPage.cpp:
770         (WebKit::WebPage::accessibilitySettingsDidChange):
771         * WebProcess/WebPage/WebPage.h:
772         * WebProcess/WebPage/WebPage.messages.in:
773
774 2016-11-18  Jeremy Jones  <jeremyj@apple.com>
775
776         USE WK_MAC_TBA for version number in _webViewRequestPointerLock:(WKWebView *)webView WK_API_AVAILABLE(macosx(10.12))
777         https://bugs.webkit.org/show_bug.cgi?id=164962
778
779         Reviewed by Dean Jackson.
780
781         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
782
783 2016-11-18  Enrica Casucci  <enrica@apple.com>
784
785         Refactor drag and drop for WebKit2 to encode DragData message exchange.
786         https://bugs.webkit.org/show_bug.cgi?id=164945
787
788         Reviewed by Tim Horton.
789
790         * Shared/WebCoreArgumentCoders.cpp:
791         (IPC::ArgumentCoder<DragData>::encode):
792         (IPC::ArgumentCoder<DragData>::decode):
793         * Shared/WebCoreArgumentCoders.h:
794         * UIProcess/WebPageProxy.cpp:
795         (WebKit::WebPageProxy::performDragControllerAction):
796         * WebProcess/WebCoreSupport/WebDragClient.cpp:
797         (WebKit::WebDragClient::willPerformDragDestinationAction):
798         (WebKit::WebDragClient::actionMaskForDrag):
799         * WebProcess/WebCoreSupport/WebDragClient.h:
800         * WebProcess/WebPage/WebPage.cpp:
801         (WebKit::WebPage::performDragControllerAction):
802         * WebProcess/WebPage/WebPage.h:
803         * WebProcess/WebPage/WebPage.messages.in:
804
805 2016-11-18  Jeremy Jones  <jeremyj@apple.com>
806
807         Add runtime flag to enable pointer lock. Enable pointer lock feature for mac.
808         https://bugs.webkit.org/show_bug.cgi?id=163801
809
810         Reviewed by Simon Fraser.
811
812         Add SPI to notify client of pointer lock and for client to allow or deny.
813         Unlock pointer when view is not longer active.
814
815         * Configurations/FeatureDefines.xcconfig:
816         * Shared/WebPreferencesDefinitions.h:
817         * UIProcess/API/APIUIClient.h:
818         (API::UIClient::requestPointerLock):
819         (API::UIClient::didLosePointerLock):
820         * UIProcess/API/C/WKPage.cpp:
821         (WKPageSetPageUIClient):
822         (WKPageDidAllowPointerLock):
823         (WKPageDidDenyPointerLock):
824         * UIProcess/API/C/WKPagePrivate.h:
825         * UIProcess/API/C/WKPageUIClient.h:
826         * UIProcess/API/C/WKPreferences.cpp:
827         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
828         * UIProcess/Cocoa/UIDelegate.h:
829         * UIProcess/Cocoa/UIDelegate.mm:
830         (WebKit::UIDelegate::setDelegate):
831         (WebKit::UIDelegate::UIClient::requestPointerLock):
832         (WebKit::UIDelegate::UIClient::didLosePointerLock):
833         * UIProcess/WebPageProxy.cpp:
834         (WebKit::WebPageProxy::dispatchActivityStateChange):
835         (WebKit::WebPageProxy::resetStateAfterProcessExited):
836         (WebKit::WebPageProxy::requestPointerLock):
837         (WebKit::WebPageProxy::didAllowPointerLock):
838         (WebKit::WebPageProxy::didDenyPointerLock):
839         (WebKit::WebPageProxy::requestPointerUnlock):
840         * UIProcess/WebPageProxy.h:
841         * WebProcess/WebPage/WebPage.cpp:
842         (WebKit::WebPage::updatePreferences):
843
844 2016-11-17  Carlos Garcia Campos  <cgarcia@igalia.com>
845
846         Downloads started by context menu actions should also have a web view associated
847         https://bugs.webkit.org/show_bug.cgi?id=164364
848
849         Reviewed by Michael Catanzaro.
850
851         When a request is converted to a download WebPageProxy calls handleDownloadRequest() and clients handle that to
852         associate the web view to the download. When a download is started by a context menu action, WebPageProxy calls
853         WebProcessPool::download() with this as initiatingPage parameter, but clients are not notified in this case.
854
855         * UIProcess/API/gtk/WebKitDownload.cpp:
856         (webkitDownloadCreateForRequest): Deleted.
857         * UIProcess/API/gtk/WebKitDownloadPrivate.h:
858         * UIProcess/API/gtk/WebKitWebContext.cpp:
859         (webkitWebContextStartDownload): Use webkitWebContextGetOrCreateDownload() after WebProcessPool::download()
860         because the WebKitDownload could have already been created by the web view download handler at this point.
861         * UIProcess/API/gtk/WebKitWebView.cpp:
862         (webkit_web_view_download_uri): We no longer need to associate the web view to the download here.
863         * UIProcess/WebProcessPool.cpp:
864         (WebKit::WebProcessPool::download): If an initiatingPage has been passed, call handleDownloadRequest() to notify
865         the page client.
866
867 2016-11-17  Alex Christensen  <achristensen@webkit.org>
868
869         REGRESSION: API test _WKDownload.ConvertResponseToDownload is a flaky timeout
870         https://bugs.webkit.org/show_bug.cgi?id=164631
871
872         Reviewed by Carlos Garcia Campos.
873
874         * NetworkProcess/NetworkResourceLoader.cpp:
875         (WebKit::NetworkResourceLoader::convertToDownload):
876         I could reproduce the flaky failure 100% of the time when not using NETWORK_SESSION
877         by adding a usleep(1000000) in NetworkResourceLoader::convertToDownload.  m_networkLoad
878         was not being set to nullptr before it was being checked in NetworkResourceLoader::abort
879
880 2016-11-17  Alex Christensen  <achristensen@webkit.org>
881
882         Fix CMake build after r208865
883         https://bugs.webkit.org/show_bug.cgi?id=164894
884
885         * PlatformMac.cmake:
886         Add new files.
887
888 2016-11-17  Ryosuke Niwa  <rniwa@webkit.org>
889
890         WKBundleNodeHandleSetHTMLInputElementSpellcheckEnabled should keep text replacement enabled
891         https://bugs.webkit.org/show_bug.cgi?id=164857
892         <rdar://problem/27721742>
893
894         Reviewed by Wenson Hsieh.
895
896         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
897         (WebKit::InjectedBundleNodeHandle::setHTMLInputElementSpellcheckEnabled):
898
899 2016-11-17  John Wilander  <wilander@apple.com>
900
901         Resource load statistics: Cover further data records, count removed data records, and only fire handler when needed
902         https://bugs.webkit.org/show_bug.cgi?id=164659
903
904         Reviewed by Andy Estes.
905
906         * UIProcess/WebResourceLoadStatisticsStore.cpp:
907         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
908             Consistent naming with 'remove' rather than 'delete'.
909             Now removes localStorage, IndexDB, disk cache, and memory cache too.
910             Updates statistics with number of times it has removed data records.
911         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
912             No longer checks whether it has enough data since the classification rules
913             are absolute, not relative.
914         (WebKit::WebResourceLoadStatisticsStore::clearDataRecords): Deleted.
915         * UIProcess/WebResourceLoadStatisticsStore.h:
916             Consistent naming with 'remove' rather than 'delete'.
917
918 2016-11-17  Brady Eidson  <beidson@apple.com>
919
920         Add _WKIconLoadingDelegate SPI.
921         https://bugs.webkit.org/show_bug.cgi?id=164894
922
923         Reviewed by Alex Christensen.
924
925         With this client, WebCore will ask the FrameLoaderClient about each icon found in the <head>.
926
927         WebKit2 will then ask the embedding app - for each icon - if it wants that icon to load.
928
929         For icons the app decides to load, WebKit will pass the data to the app without storing locally.
930
931         * UIProcess/API/APIIconLoadingClient.h: Copied from Source/WebCore/html/LinkIconCollector.h.
932         (API::IconLoadingClient::~IconLoadingClient):
933         (API::IconLoadingClient::getLoadDecisionForIcon):
934
935         * UIProcess/API/Cocoa/WKWebView.mm:
936         (-[WKWebView _initializeWithConfiguration:]):
937         (-[WKWebView _iconLoadingDelegate]):
938         (-[WKWebView _setIconLoadingDelegate:]):
939         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
940
941         * UIProcess/API/Cocoa/_WKIconLoadingDelegate.h: Copied from Source/WebCore/html/LinkIconCollector.h.
942
943         * UIProcess/API/Cocoa/_WKLinkIconParameters.h: Copied from Source/WebCore/html/LinkIconCollector.h.
944         * UIProcess/API/Cocoa/_WKLinkIconParameters.mm: Copied from Source/WebCore/html/LinkIconCollector.h.
945         (-[_WKLinkIconParameters _initWithLinkIcon:]):
946         (-[_WKLinkIconParameters url]):
947         (-[_WKLinkIconParameters mimeType]):
948         (-[_WKLinkIconParameters size]):
949         (-[_WKLinkIconParameters iconType]):
950         * UIProcess/API/Cocoa/_WKLinkIconParametersInternal.h: Copied from Source/WebCore/html/LinkIconCollector.h.
951
952         * UIProcess/Cocoa/IconLoadingDelegate.h: Copied from Source/WebCore/html/LinkIconCollector.h.
953         * UIProcess/Cocoa/IconLoadingDelegate.mm: Added.
954         (WebKit::IconLoadingDelegate::IconLoadingDelegate):
955         (WebKit::IconLoadingDelegate::~IconLoadingDelegate):
956         (WebKit::IconLoadingDelegate::createIconLoadingClient):
957         (WebKit::IconLoadingDelegate::delegate):
958         (WebKit::IconLoadingDelegate::setDelegate):
959         (WebKit::IconLoadingDelegate::IconLoadingClient::IconLoadingClient):
960         (WebKit::IconLoadingDelegate::IconLoadingClient::~IconLoadingClient):
961         (WebKit::IconLoadingDelegate::IconLoadingClient::getLoadDecisionForIcon):
962
963         * UIProcess/WebPageProxy.cpp:
964         (WebKit::WebPageProxy::setIconLoadingClient):
965         (WebKit::WebPageProxy::getLoadDecisionForIcon):
966         (WebKit::WebPageProxy::finishedLoadingIcon):
967         * UIProcess/WebPageProxy.h:
968         (WebKit::WebPageProxy::iconLoadingClient):
969         * UIProcess/WebPageProxy.messages.in:
970
971         * WebKit2.xcodeproj/project.pbxproj:
972
973         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
974         (WebKit::WebFrameLoaderClient::useIconLoadingClient):
975         (WebKit::WebFrameLoaderClient::getLoadDecisionForIcon):
976         (WebKit::WebFrameLoaderClient::finishedLoadingIcon):
977         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
978         (WebKit::WebFrameLoaderClient::setUseIconLoadingClient):
979
980         * WebProcess/WebPage/WebPage.cpp:
981         (WebKit::WebPage::didGetLoadDecisionForIcon):
982         (WebKit::WebPage::setUseIconLoadingClient):
983         * WebProcess/WebPage/WebPage.h:
984         * WebProcess/WebPage/WebPage.messages.in:
985
986 2016-11-17  Saam Barati  <sbarati@apple.com>
987
988         Remove async/await compile time flag and enable tests
989         https://bugs.webkit.org/show_bug.cgi?id=164828
990         <rdar://problem/28639334>
991
992         Reviewed by Yusuke Suzuki.
993
994         * Configurations/FeatureDefines.xcconfig:
995
996 2016-11-17  Yusuke Suzuki  <utatane.tea@gmail.com>
997
998         [JSC] WTF::TemporaryChange with WTF::SetForScope
999         https://bugs.webkit.org/show_bug.cgi?id=164761
1000
1001         Reviewed by Saam Barati.
1002
1003         * PluginProcess/PluginControllerProxy.cpp:
1004         (WebKit::PluginControllerProxy::initialize):
1005         * PluginProcess/WebProcessConnection.cpp:
1006         (WebKit::WebProcessConnection::didReceiveMessage):
1007         (WebKit::WebProcessConnection::didReceiveSyncMessage):
1008         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
1009         (createEncodedObject):
1010         (decodeObject):
1011         * UIProcess/API/Cocoa/WKWebView.mm:
1012         (-[WKWebView _keyboardChangedWithInfo:adjustScrollView:]):
1013         * UIProcess/Cocoa/WebViewImpl.mm:
1014         (WebKit::WebViewImpl::updateTextTouchBar):
1015         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
1016         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateAfterChildren):
1017         * UIProcess/gtk/WebPasteboardProxyGtk.cpp:
1018         (WebKit::WebPasteboardProxy::writeToClipboard):
1019         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
1020         (WebKit::CompositingCoordinator::flushPendingLayerChanges):
1021         (WebKit::CompositingCoordinator::purgeBackingStores):
1022         * WebProcess/WebPage/WebPage.cpp:
1023         (WebKit::WebPage::mouseEvent):
1024         (WebKit::WebPage::keyEvent):
1025         (WebKit::WebPage::dispatchTouchEvent):
1026         (WebKit::WebPage::setInitialFocus):
1027         (WebKit::WebPage::insertTextAsync):
1028         * WebProcess/WebPage/ios/WebPageIOS.mm:
1029         (WebKit::WebPage::dynamicViewportSizeUpdate):
1030         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
1031         * WebProcess/WebPage/mac/WebPageMac.mm:
1032
1033 2016-11-16  Brent Fulgham  <bfulgham@apple.com>
1034
1035         Unreviewed build fix after r208589
1036
1037         The generated com.apple.WebKit.plugin-common.sb file was not getting copied into
1038         the Resources folder, so was not deployed with WebKit. We need to treat it like
1039         com.apple.WebProcess.sb and the other generated files.
1040
1041         * WebKit2.xcodeproj/project.pbxproj: Tell Xcode to include the generated file in
1042         the framework Resources.
1043
1044 2016-11-16  Yusuke Suzuki  <utatane.tea@gmail.com>
1045
1046         [ES6][WebCore] Change ES6_MODULES compile time flag to runtime flag
1047         https://bugs.webkit.org/show_bug.cgi?id=164827
1048
1049         Reviewed by Ryosuke Niwa.
1050
1051         * Configurations/FeatureDefines.xcconfig:
1052         * Shared/WebPreferencesDefinitions.h:
1053         Annotated ES6 Modules option with DEFAULT_EXPERIMENTAL_FEATURES_ENABLED.
1054         * UIProcess/API/C/WKPreferences.cpp:
1055         (WKPreferencesSetES6ModulesEnabled):
1056         (WKPreferencesGetES6ModulesEnabled):
1057         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1058         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1059         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1060         * WebProcess/WebPage/WebPage.cpp:
1061         (WebKit::WebPage::updatePreferences):
1062
1063 2016-11-16  Simon Fraser  <simon.fraser@apple.com>
1064
1065         Add logging support to VisibleContentRectUpdateInfo
1066         https://bugs.webkit.org/show_bug.cgi?id=164825
1067
1068         Reviewed by Zalan Bujtas.
1069
1070         Add TextStream output to VisibleContentRectUpdateInfo. Just piping it into a logging
1071         stream does single-line output, so also make a convenience dump() function that will
1072         product multiline output. Result look like:
1073
1074             (VisibleContentRectUpdateInfo
1075               (lastLayerTreeTransactionID 54)
1076               (exposedContentRect (523.44,1258.63) width=676.20 height=901.60)
1077               (unobscuredContentRect (523.44,1293.41) width=676.20 height=866.82)
1078               (unobscuredRectInScrollViewCoordinates (0,39.50) width=768 height=984.50)
1079               (customFixedPositionRect (219.64,935) width=980 height=1225)
1080               (obscuredInset width=0 height=39.50)
1081               (scale 1.14)
1082               (inStableState 0)
1083               (timestamp 736446.61)
1084               (verticalVelocity -11.36))
1085
1086         * Shared/VisibleContentRectUpdateInfo.cpp:
1087         (WebKit::VisibleContentRectUpdateInfo::dump):
1088         (WebKit::operator<<):
1089         * Shared/VisibleContentRectUpdateInfo.h:
1090         * UIProcess/ios/WKContentView.mm:
1091         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
1092
1093 2016-11-15  Simon Fraser  <simon.fraser@apple.com>
1094
1095         [iOS WK2] Scroll view scrolling and zooming animations can keep running across page loads
1096         https://bugs.webkit.org/show_bug.cgi?id=164810
1097
1098         Reviewed by Tim Horton.
1099         
1100         Scrolling and zooming animations can leak across page loads, which makes tests flakey,
1101         and is unexpected by users.
1102
1103         Tested by scrollingcoordinator/ios/sync-layer-positions-after-scroll.html followed by
1104         scrollingcoordinator/ios/ui-scrolling-tree.html
1105
1106         * UIProcess/API/Cocoa/WKWebView.mm:
1107         (-[WKWebView _didCommitLoadForMainFrame]):
1108
1109 2016-11-15  Jon Lee  <jonlee@apple.com>
1110
1111         Report active video and audio capture devices separately
1112         https://bugs.webkit.org/show_bug.cgi?id=164769
1113
1114         Reviewed by Eric Carlson.
1115
1116         Replace kWKMediaHasActiveCaptureDevice with kWKMediaHasActiveAudioCaptureDevice and
1117         kWKMediaHasActiveVideoCaptureDevice
1118
1119         * UIProcess/API/C/WKPage.cpp:
1120         (WKPageGetMediaState):
1121         * UIProcess/API/C/WKPagePrivate.h:
1122         * UIProcess/WebPageProxy.cpp:
1123         (WebKit::WebPageProxy::isPlayingMediaDidChange): Update the mask to include the two
1124         bits.
1125
1126 2016-11-14  Simon Fraser  <simon.fraser@apple.com>
1127
1128         [iOS WK2] Implement support for visual viewports
1129         https://bugs.webkit.org/show_bug.cgi?id=164765
1130
1131         Reviewed by Tim Horton.
1132
1133         Adopt the visual viewport scrolling model in iOS WK2.
1134
1135         Pass the parameters used for computing the layout viewport up to WK2 via RemoteLayerTreeTransaction.
1136         These are stored on WebPageProxy. When they change, _didCommitLayerTree triggers a -_updateVisibleContentRects.
1137         
1138         WebPageProxy::computeCustomFixedPositionRect() is the function that computes the "override" layout viewport.
1139         It starts with the baseLayoutViewportSize from the web process (which is based on the initial containing block
1140         size), then ensures that it's no smaller than the unobscured content rect, since it makes no sense for the
1141         layout viewport to be smaller than the visual viewport. The static FrameView::computeLayoutViewportOrigin()
1142         is then use to "push" the layout viewport around as the visual viewport changes.
1143
1144         * Shared/VisibleContentRectUpdateInfo.h:
1145         * Shared/WebCoreArgumentCoders.cpp: Encode LayoutSize and LayoutPoint.
1146         (IPC::ArgumentCoder<LayoutSize>::encode):
1147         (IPC::ArgumentCoder<LayoutSize>::decode):
1148         (IPC::ArgumentCoder<LayoutPoint>::encode):
1149         (IPC::ArgumentCoder<LayoutPoint>::decode):
1150         * Shared/WebCoreArgumentCoders.h:
1151         * Shared/mac/RemoteLayerTreeTransaction.h:
1152         (WebKit::RemoteLayerTreeTransaction::baseLayoutViewportSize):
1153         (WebKit::RemoteLayerTreeTransaction::setBaseLayoutViewportSize):
1154         (WebKit::RemoteLayerTreeTransaction::minStableLayoutViewportOrigin):
1155         (WebKit::RemoteLayerTreeTransaction::setMinStableLayoutViewportOrigin):
1156         (WebKit::RemoteLayerTreeTransaction::maxStableLayoutViewportOrigin):
1157         (WebKit::RemoteLayerTreeTransaction::setMaxStableLayoutViewportOrigin):
1158         * Shared/mac/RemoteLayerTreeTransaction.mm:
1159         (WebKit::RemoteLayerTreeTransaction::encode):
1160         (WebKit::RemoteLayerTreeTransaction::decode):
1161         (WebKit::RemoteLayerTreeTransaction::description):
1162         * UIProcess/API/Cocoa/WKWebView.mm:
1163         (-[WKWebView _didCommitLayerTree:]):
1164         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
1165         (WebKit::RemoteScrollingCoordinatorProxy::visualViewportEnabled): Accessor.
1166         * UIProcess/WebPageProxy.h:
1167         (WebKit::WebPageProxy::customFixedPositionRect):
1168         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
1169         (WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect):
1170         * UIProcess/ios/WKContentView.mm:
1171         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
1172         (-[WKContentView _didCommitLayerTree:]):
1173         * UIProcess/ios/WebPageProxyIOS.mm:
1174         (WebKit::WebPageProxy::computeCustomFixedPositionRect): When visual viewports are enabled, compute
1175         the layout viewport rect, taking the baseLayoutViewportSize and the current unobscured rect into account.
1176         (WebKit::WebPageProxy::updateLayoutViewportParameters):
1177         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
1178         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
1179         * WebProcess/WebPage/WebPage.cpp: Encode in the transaction the layout viewport parameters (with minor refactor).
1180         (WebKit::WebPage::willCommitLayerTree):
1181         * WebProcess/WebPage/ios/WebPageIOS.mm:
1182         (WebKit::WebPage::updateVisibleContentRects): This is where the web process receives the new override layout viewport
1183         from the web process (with some logging).
1184
1185 2016-11-15  Jon Lee  <jonlee@apple.com>
1186
1187         Remove HasMediaCaptureDevice
1188         https://bugs.webkit.org/show_bug.cgi?id=164767
1189         <rdar://problem/29263696>
1190
1191         Reviewed by Eric Carlson.
1192
1193         * UIProcess/API/C/WKPage.cpp: Remove kWKMediaHasCaptureDevice.
1194         (WKPageGetMediaState):
1195         * UIProcess/API/C/WKPagePrivate.h:
1196
1197 2016-11-15  Daniel Bates  <dabates@apple.com>
1198
1199         Disallow loads using HTTP 0.9 at the ResourceHandle/NetworkDataTask level
1200         https://bugs.webkit.org/show_bug.cgi?id=164662
1201         <rdar://problem/29268514>
1202
1203         Reviewed by Alex Christensen and Brady Eidson.
1204
1205         Make changes to NetworkDataTask similar to the changes made to ResourceHandle so as to
1206         disallow non-default port HTTP 0.9 loads when using the ENABLE(NETWORK_SESSION) networking
1207         code path in WebKit2.
1208
1209         * NetworkProcess/NetworkDataTask.cpp:
1210         (WebKit::NetworkDataTask::didReceiveResponse): Added. Fail the load if it is using HTTP 0.9.
1211         Otherwise notify the client that we received a response.
1212         * NetworkProcess/NetworkDataTask.h:
1213         * NetworkProcess/NetworkDataTaskBlob.cpp:
1214         (WebKit::NetworkDataTaskBlob::resume): Substitute dispatchDidReceiveResponse() for didReceiveResponse()
1215         as the latter has been renamed to the former.
1216         (WebKit::NetworkDataTaskBlob::getSizeForNext): Ditto.
1217         (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse): Renamed from didReceiveResponse().
1218         * NetworkProcess/NetworkDataTaskBlob.h:
1219         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
1220         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1221         (WebKit::NetworkDataTaskCocoa::didReceiveResponse): Deleted.
1222         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1223         (WebKit::NetworkDataTaskSoup::didSendRequest): Substitute dispatchDidReceiveResponse() for didReceiveResponse()
1224         as the latter has been renamed to the former.
1225         (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse): Renamed from didReceiveResponse(). Also
1226         remove the local variable response and inline its value into the call to ResourceHandle::didReceiveResponse()
1227         as this variable is used exactly once in this function and its name does not describe its purpose any more
1228         than its value.
1229         (WebKit::NetworkDataTaskSoup::didRequestNextPart): Substitute dispatchDidReceiveResponse() for didReceiveResponse()
1230         as the latter has been renamed to the former.
1231         * NetworkProcess/soup/NetworkDataTaskSoup.h:
1232
1233 2016-11-14  Alex Christensen  <achristensen@webkit.org>
1234
1235         Move SecurityOrigin::createFromDatabaseIdentifier to SecurityOriginData
1236         https://bugs.webkit.org/show_bug.cgi?id=164720
1237
1238         Reviewed by Brady Eidson.
1239
1240         * DatabaseProcess/DatabaseProcess.cpp:
1241         (WebKit::DatabaseProcess::indexedDatabaseOrigins):
1242         * DatabaseProcess/DatabaseProcess.h:
1243         * NetworkProcess/NetworkProcess.cpp:
1244         (WebKit::fetchDiskCacheEntries):
1245         * Shared/API/c/WKSecurityOriginRef.cpp:
1246         (WKSecurityOriginCreateFromDatabaseIdentifier):
1247         * Shared/WebsiteData/WebsiteData.cpp:
1248         (WebKit::WebsiteData::Entry::encode):
1249         (WebKit::WebsiteData::Entry::decode):
1250         * Shared/WebsiteData/WebsiteData.h:
1251         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
1252         (WKKeyValueStorageManagerGetStorageDetailsByOrigin):
1253         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
1254         (WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince):
1255         (WebKit::LocalStorageDatabaseTracker::origins):
1256         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1257         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
1258         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
1259         * UIProcess/WebPageProxy.cpp:
1260         (WebKit::WebPageProxy::exceededDatabaseQuota):
1261         (WebKit::WebPageProxy::reachedApplicationCacheOriginQuota):
1262         (WebKit::WebPageProxy::requestGeolocationPermissionForFrame):
1263         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1264         (WebKit::WebsiteDataStore::fetchData):
1265         (WebKit::WebsiteDataStore::removeData):
1266         (WebKit::WebsiteDataStore::mediaKeyOrigins):
1267         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
1268         (WKBundleSetDatabaseQuota):
1269         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
1270         (WebKit::WebMediaKeyStorageManager::getMediaKeyOrigins):
1271         * WebProcess/Storage/StorageAreaImpl.cpp:
1272         (WebKit::StorageAreaImpl::create):
1273         (WebKit::StorageAreaImpl::StorageAreaImpl):
1274         (WebKit::StorageAreaImpl::securityOrigin):
1275         * WebProcess/Storage/StorageAreaImpl.h:
1276         * WebProcess/Storage/StorageAreaMap.cpp:
1277         (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
1278         (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
1279         * WebProcess/Storage/StorageAreaMap.h:
1280         (WebKit::StorageAreaMap::securityOrigin):
1281         * WebProcess/Storage/StorageNamespaceImpl.cpp:
1282         (WebKit::StorageNamespaceImpl::didDestroyStorageAreaMap):
1283         (WebKit::StorageNamespaceImpl::storageArea):
1284         * WebProcess/Storage/StorageNamespaceImpl.h:
1285         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1286         (WebKit::WebChromeClient::exceededDatabaseQuota):
1287         * WebProcess/WebProcess.cpp:
1288         (WebKit::WebProcess::fetchWebsiteData):
1289
1290 2016-11-14  Brent Fulgham  <bfulgham@apple.com>
1291
1292         [Mac][iOS][WK2] Tighten permissions to change CapsLock delay
1293         https://bugs.webkit.org/show_bug.cgi?id=164725
1294         <rdar://problem/28970910>
1295
1296         Reviewed by Alexey Proskuryakov.
1297
1298         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: Limit access
1299         to the IOKit connection that actually needs it.
1300
1301 2016-11-14  Brent Fulgham  <bfulgham@apple.com>
1302
1303         Unreviewed sandbox fix after r208702
1304
1305         Correct version check to avoid breaking users in Safari Technology Preview
1306         or WebKit nightlies.
1307
1308         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
1309         * WebProcess/com.apple.WebProcess.sb.in:
1310
1311 2016-11-14  Pranjal Jumde  <pjumde@apple.com>
1312
1313         Keychain access in WebKit should be limited to a single process. Earlier this was blocked on the networking framework requiring direct access to keychain, this will be resolved in the upcoming version of macOS.
1314         https://bugs.webkit.org/show_bug.cgi?id=163710
1315         <rdar://problem/24357468>
1316
1317         Reviewed by Darin Adler.
1318
1319         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
1320         * WebProcess/com.apple.WebProcess.sb.in:
1321
1322 2016-11-13  Darin Adler  <darin@apple.com>
1323
1324         Remove many includes of ExceptionCode.h
1325         https://bugs.webkit.org/show_bug.cgi?id=164706
1326
1327         Reviewed by Alex Christensen.
1328
1329         * WebProcess/Storage/StorageAreaImpl.cpp: Removed include of ExceptionCode.h.
1330
1331 2016-11-13  Darin Adler  <darin@apple.com>
1332
1333         Fix exception handling in SQL database code, streamline and update code
1334         https://bugs.webkit.org/show_bug.cgi?id=164685
1335
1336         Reviewed by Sam Weinig.
1337
1338         * UIProcess/API/efl/ewk_database_manager.cpp:
1339         (EwkDatabaseManager::getDatabaseOrigins): Update for change to the
1340         DatabaseTracker::origins function.
1341         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1342         (WebKit::WebsiteDataStore::fetchData): Use DatabaseTracker.
1343         (WebKit::WebsiteDataStore::removeData): Ditto.
1344         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
1345         (WKBundleSetDatabaseQuota): Ditto.
1346         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1347         (WebKit::WebChromeClient::exceededDatabaseQuota): Ditto.
1348         * WebProcess/WebProcess.cpp:
1349         (WebKit::WebProcess::processWillSuspendImminently): Ditto.
1350
1351 2016-11-12  Simon Fraser  <simon.fraser@apple.com>
1352
1353         Add a way to get the UI-side scrolling tree as text via UIScriptController
1354         https://bugs.webkit.org/show_bug.cgi?id=164697
1355
1356         Reviewed by Zalan Bujtas.
1357
1358         Add a property to WKWebView to retrieve the scrolling tree as text, for testing.
1359         Expose it via the RemoteScrollingCoordinatorProxy.
1360
1361         * UIProcess/API/Cocoa/WKWebView.mm:
1362         (-[WKWebView _scrollingTreeAsText]):
1363         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1364         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
1365         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeAsText):
1366         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
1367
1368 2016-11-12  Daniel Bates  <dabates@apple.com>
1369
1370         Incorrect release log message emitted when waiting/not waiting for the WebProcess continue a load
1371         https://bugs.webkit.org/show_bug.cgi?id=164605
1372
1373         Reviewed by Darin Adler.
1374
1375         Currently we emit a release log message of the form "didReceiveResponse: Should wait for
1376         message from WebContent process ..." when we are not waiting for the WebProcess and emit
1377         a message of the form "didReceiveResponse: Should not wait for message from WebContent
1378         process" when we are waiting on the WebProcess. Invert these messages to reflect whether
1379         we are waiting for the WebProcess to send message NetworkResourceLoader::ContinueDidReceiveResponsewhether.
1380
1381         For the main resource NetworkResourceLoader::didReceiveResponse() returns ShouldContinueDidReceiveResponse::No
1382         because we are waiting for the WebProcess to send message NetworkResourceLoader::ContinueDidReceiveResponse
1383         to continue the load. For a subresource we do not need to wait for the WebProcess to allow the load to continue
1384         and hence NetworkResourceLoader::didReceiveResponse() returns ShouldContinueDidReceiveResponse::Yes.
1385
1386         * NetworkProcess/NetworkResourceLoader.cpp:
1387
1388 2016-11-12  Simon Fraser  <simon.fraser@apple.com>
1389
1390         [iOS WK2] Share some code with Mac for post-async-scroll state reconciliation
1391         https://bugs.webkit.org/show_bug.cgi?id=164694
1392
1393         Reviewed by Zalan Bujtas.
1394
1395         Rather than calling FrameView directly, call reconcileScrollingState() on the scrolling
1396         coordinator.
1397
1398         * WebProcess/WebPage/ios/WebPageIOS.mm:
1399         (WebKit::WebPage::updateVisibleContentRects):
1400
1401 2016-11-12  Brian Burg  <bburg@apple.com>
1402
1403         Web Automation: terminate the automation session if the web process crashes
1404         https://bugs.webkit.org/show_bug.cgi?id=164671
1405         <rdar://problem/29028964>
1406
1407         Reviewed by Joseph Pecoraro.
1408
1409         * UIProcess/Automation/WebAutomationSession.h:
1410         * UIProcess/Automation/WebAutomationSession.cpp:
1411         (WebKit::WebAutomationSession::disconnect):
1412         (WebKit::WebAutomationSession::terminate):
1413         Factor out code that disconnects the remote, unpairs, and notifies the client.
1414         Then, expose terminate() which can be called without a FrontendChannel.
1415         Calling this causes the _WKAutomationDelegate to clear the local-side session in the
1416         browser, and disconnecting from the remote will hang up the remote-side session.
1417
1418         * UIProcess/WebPageProxy.cpp:
1419         (WebKit::WebPageProxy::processDidCrash):
1420         Terminate the session.
1421
1422 2016-11-11  Alex Christensen  <achristensen@webkit.org>
1423
1424         Use SecurityOriginData as keys in StorageManager
1425         https://bugs.webkit.org/show_bug.cgi?id=159834
1426         <rdar://problem/27346948>
1427
1428         Reviewed by Brady Eidson.
1429
1430         * Platform/IPC/HandleMessage.h:
1431         (IPC::callMemberFunctionImpl):
1432         Add a missing std::forward so we can use this callMemberFunctionImpl with rvalues.
1433         * UIProcess/API/C/WKApplicationCacheManager.cpp:
1434         (WKApplicationCacheManagerGetApplicationCacheOrigins):
1435         (WKApplicationCacheManagerDeleteEntriesForOrigin):
1436         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
1437         (WKKeyValueStorageManagerGetKeyValueStorageOrigins):
1438         (WKKeyValueStorageManagerDeleteEntriesForOrigin):
1439         * UIProcess/API/C/WKResourceCacheManager.cpp:
1440         (WKResourceCacheManagerGetCacheOrigins):
1441         (WKResourceCacheManagerClearCacheForOrigin):
1442         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1443         (-[WKWebsiteDataStore _fetchDataRecordsOfTypes:withOptions:completionHandler:]):
1444         * UIProcess/Databases/DatabaseProcessProxy.cpp:
1445         (WebKit::DatabaseProcessProxy::deleteWebsiteDataForOrigins):
1446         * UIProcess/Databases/DatabaseProcessProxy.h:
1447         * UIProcess/Network/NetworkProcessProxy.cpp:
1448         (WebKit::NetworkProcessProxy::getNetworkProcessConnection):
1449         (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
1450         * UIProcess/Network/NetworkProcessProxy.h:
1451         * UIProcess/Storage/LocalStorageDatabase.cpp:
1452         (WebKit::LocalStorageDatabase::create):
1453         (WebKit::LocalStorageDatabase::LocalStorageDatabase):
1454         (WebKit::LocalStorageDatabase::openDatabase):
1455         (WebKit::LocalStorageDatabase::close):
1456         * UIProcess/Storage/LocalStorageDatabase.h:
1457         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
1458         (WebKit::LocalStorageDatabaseTracker::databasePath):
1459         (WebKit::LocalStorageDatabaseTracker::didOpenDatabaseWithOrigin):
1460         (WebKit::LocalStorageDatabaseTracker::deleteDatabaseWithOrigin):
1461         (WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince):
1462         (WebKit::LocalStorageDatabaseTracker::origins):
1463         * UIProcess/Storage/LocalStorageDatabaseTracker.h:
1464         * UIProcess/Storage/StorageManager.cpp:
1465         (WebKit::StorageManager::StorageArea::securityOrigin):
1466         (WebKit::StorageManager::TransientLocalStorageNamespace::getOrCreateStorageArea):
1467         (WebKit::StorageManager::TransientLocalStorageNamespace::origins):
1468         (WebKit::StorageManager::TransientLocalStorageNamespace::clearStorageAreasMatchingOrigin):
1469         (WebKit::StorageManager::StorageArea::StorageArea):
1470         (WebKit::StorageManager::StorageArea::clone):
1471         (WebKit::StorageManager::StorageArea::items):
1472         (WebKit::StorageManager::StorageArea::openDatabaseAndImportItemsIfNeeded):
1473         (WebKit::StorageManager::LocalStorageNamespace::didDestroyStorageArea):
1474         (WebKit::StorageManager::LocalStorageNamespace::clearStorageAreasMatchingOrigin):
1475         (WebKit::StorageManager::LocalStorageNamespace::clearAllStorageAreas):
1476         (WebKit::StorageManager::SessionStorageNamespace::origins):
1477         (WebKit::StorageManager::SessionStorageNamespace::clearStorageAreasMatchingOrigin):
1478         (WebKit::StorageManager::SessionStorageNamespace::cloneTo):
1479         (WebKit::StorageManager::getSessionStorageOrigins):
1480         (WebKit::StorageManager::deleteSessionStorageOrigins):
1481         (WebKit::StorageManager::deleteSessionStorageEntriesForOrigins):
1482         (WebKit::StorageManager::getLocalStorageOrigins):
1483         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigin):
1484         (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
1485         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
1486         (WebKit::StorageManager::createLocalStorageMap):
1487         (WebKit::StorageManager::createTransientLocalStorageMap):
1488         (WebKit::StorageManager::createSessionStorageMap):
1489         (WebKit::StorageManager::getOrCreateLocalStorageNamespace):
1490         (WebKit::StorageManager::getOrCreateTransientLocalStorageNamespace):
1491         (WebKit::StorageManager::StorageArea::create): Deleted.
1492         (WebKit::StorageManager::LocalStorageNamespace::getOrCreateStorageArea): Deleted.
1493         (WebKit::StorageManager::SessionStorageNamespace::getOrCreateStorageArea): Deleted.
1494         * UIProcess/Storage/StorageManager.h:
1495         * UIProcess/WebProcessProxy.cpp:
1496         (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins):
1497         * UIProcess/WebProcessProxy.h:
1498         * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
1499         (WebKit::WebsiteDataRecord::displayNameForOrigin):
1500         (WebKit::WebsiteDataRecord::add):
1501         * UIProcess/WebsiteData/WebsiteDataRecord.h:
1502         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1503         (WebKit::WebsiteDataStore::fetchData):
1504         (WebKit::WebsiteDataStore::removeData):
1505         (WebKit::WebsiteDataStore::mediaKeyOrigins):
1506         (WebKit::WebsiteDataStore::removeMediaKeys):
1507         * UIProcess/WebsiteData/WebsiteDataStore.h:
1508         Fewer SecurityOrigin uses in the UIProcess!  Hooray!
1509
1510 2016-11-11  Ryosuke Niwa  <rniwa@webkit.org>
1511
1512         Hovering over a slotted Text node clears hover state
1513         https://bugs.webkit.org/show_bug.cgi?id=164002
1514         <rdar://problem/29040471>
1515
1516         Reviewed by Simon Fraser.
1517
1518         * WebProcess/WebPage/WebPage.cpp:
1519         (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
1520         * WebProcess/WebPage/mac/WebPageMac.mm:
1521         (WebKit::WebPage::performImmediateActionHitTestAtLocation):
1522
1523 2016-11-11  Wenson Hsieh  <wenson_hsieh@apple.com>
1524
1525         [WK2] autocorrect and autocapitalize attributes do not work in contenteditable elements
1526         https://bugs.webkit.org/show_bug.cgi?id=164538
1527         <rdar://problem/8418711>
1528
1529         Reviewed by Ryosuke Niwa.
1530
1531         Consult HTMLElement::autocorrect() and HTMLElement::autocapitalizeType() when assembling the assisted node
1532         information for the currently assisted node.
1533
1534         * Shared/AssistedNodeInformation.h:
1535         * UIProcess/ios/WKContentViewInteraction.mm:
1536         (toUITextAutocapitalize):
1537         * WebProcess/WebPage/ios/WebPageIOS.mm:
1538         (WebKit::WebPage::getAssistedNodeInformation):
1539
1540 2016-11-11  Beth Dakin  <bdakin@apple.com>
1541
1542         Move to modern TouchBar methods
1543         https://bugs.webkit.org/show_bug.cgi?id=164655
1544         -and corresponding-
1545         rdar://problem/29226911
1546
1547         Reviewed by Wenson Hsieh.
1548
1549         customizationDefaultItemIdentifiers -> defaultItemIdentifiers
1550         itemIdentifiers -> defaultItemIdentifiers
1551         defaultItems -> templateItems
1552
1553         * UIProcess/Cocoa/WebViewImpl.mm:
1554         (WebKit::plainTextTouchBarDefaultItemIdentifiers):
1555         (WebKit::richTextTouchBarDefaultItemIdentifiers):
1556         (WebKit::WebViewImpl::setUpTextTouchBar):
1557         (WebKit::WebViewImpl::updateTextTouchBar):
1558         (WebKit::plainTextTouchBarCustomizationDefaultItemIdentifiers): Deleted.
1559         (WebKit::richTextTouchBarCustomizationDefaultItemIdentifiers): Deleted.
1560
1561 2016-11-11  Brent Fulgham  <bfulgham@apple.com>
1562
1563         Get rid of old sandbox rules for OS's we no longer support
1564         https://bugs.webkit.org/show_bug.cgi?id=164638
1565
1566         Reviewed by Simon Fraser.
1567
1568         Clean up the various sandbox profiles to get rid of rules that applied to operating system
1569         versions we no longer support, or were added in support of bugs that have long since been
1570         fixed.
1571
1572         This should introduce no change in behavior.
1573
1574         * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in:
1575         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
1576         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
1577         * Resources/PlugInSandboxProfiles/com.oracle.java.JavaAppletPlugin.sb:
1578         * WebProcess/com.apple.WebProcess.sb.in:
1579
1580 2016-11-11  Brady Eidson  <beidson@apple.com>
1581
1582         IndexedDB 2.0: "close pending flag" and firing blocked events all need fixing.
1583         https://bugs.webkit.org/show_bug.cgi?id=164641
1584
1585         Reviewed by Alex Christensen.
1586
1587         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
1588         (WebKit::WebIDBConnectionToClient::databaseConnectionPendingClose):
1589         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
1590         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
1591
1592         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
1593         (WebKit::WebIDBConnectionToServer::databaseConnectionPendingClose):
1594         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
1595
1596 2016-11-11  Eric Carlson  <eric.carlson@apple.com>
1597
1598         [MediaStream] defer resolution of getUserMedia promise made in a background tab
1599         https://bugs.webkit.org/show_bug.cgi?id=164643
1600         <rdar://problem/29048317>
1601
1602         Reviewed by Brady Eidson.
1603
1604         Do not ask for user for access to capture devices when the document does not
1605         allow media to play, wait until playback is allowed.
1606
1607         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
1608         (WebKit::UserMediaPermissionRequestManager::startUserMediaRequest):
1609         (WebKit::UserMediaPermissionRequestManager::sendUserMediaRequest):
1610         (WebKit::UserMediaPermissionRequestManager::mediaCanStart):
1611         (WebKit::UserMediaPermissionRequestManager::grantUserMediaDevicesSandboxExtension):
1612         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
1613         * WebProcess/Plugins/PluginView.cpp:
1614         (WebKit::PluginView::mediaCanStart):
1615         * WebProcess/Plugins/PluginView.h:
1616
1617 2016-11-11  Darin Adler  <darin@apple.com>
1618
1619         Move Node from ExceptionCode to ExceptionOr
1620         https://bugs.webkit.org/show_bug.cgi?id=164515
1621
1622         Reviewed by Sam Weinig.
1623
1624         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
1625         (webkit_dom_html_select_element_remove): Updated exception handling.
1626         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.cpp:
1627         (webkit_dom_node_insert_before): Ditto.
1628         (webkit_dom_node_replace_child): Ditto.
1629         (webkit_dom_node_remove_child): Ditto.
1630         (webkit_dom_node_append_child): Ditto.
1631         (webkit_dom_node_clone_node_with_error): Ditto.
1632         (webkit_dom_node_set_node_value): Ditto.
1633         (webkit_dom_node_set_text_content): Ditto.
1634         * WebProcess/InjectedBundle/API/mac/WKDOMNode.mm:
1635         (-[WKDOMNode insertNode:before:]): Ditto.
1636         (-[WKDOMNode appendChild:]): Ditto.
1637         (-[WKDOMNode removeChild:]): Ditto.
1638
1639         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
1640         (WebKit::PDFPlugin::PDFPlugin): Removed unneeded ASSERT_NO_EXCEPTION.
1641         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm:
1642         (WebKit::PDFPluginChoiceAnnotation::createAnnotationElement): Ditto.
1643
1644 2016-11-11  Megan Gardner  <megan_gardner@apple.com>
1645
1646         [Cocoa] Support wide gamut for Drag Image UI
1647         https://bugs.webkit.org/show_bug.cgi?id=164490
1648
1649         Reviewed by Tim Horton.
1650
1651         Fixed an error in the gating for the new wide gamut support in ShareableBitmap.
1652         We should always respect the flags straight out, and not make decisions later, it can lead to mismatched data and data storage.
1653         Added support for wide gamut in createCGImage.
1654
1655         * Shared/cg/ShareableBitmapCG.cpp:
1656         (WebKit::bitmapInfo):
1657         (WebKit::colorSpace):
1658         (WebKit::ShareableBitmap::createGraphicsContext):
1659         (WebKit::ShareableBitmap::createCGImage):
1660         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
1661         (WebKit::convertImageToBitmap):
1662         (WebKit::WebDragClient::startDrag):
1663
1664 2016-11-11  Beth Dakin  <bdakin@apple.com>
1665
1666         Get touch bar code building for open source builds
1667         https://bugs.webkit.org/show_bug.cgi?id=164610
1668
1669         Reviewed by Wenson Hsieh.
1670
1671         * config.h:
1672
1673 2016-11-10  Brent Fulgham  <bfulgham@apple.com>
1674
1675         Remove unused FontService from sandbox profile
1676         https://bugs.webkit.org/show_bug.cgi?id=164625
1677         <rdar://problem/26899976>
1678
1679         Reviewed by Alex Christensen.
1680
1681         Part of some general sandbox profile gardening.
1682
1683         Convert the Plugin process sandbox into 
1684
1685         * Configurations/WebKit.xcconfig: Add exclude for com.apple.WebKit.plugin-common.sb.in.
1686         * DerivedSources.make: Update to generate com.apple.WebKit.plugin-common.sb from .in file
1687         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: Copied from Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb.
1688         * Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb: Removed.
1689         * WebKit2.xcodeproj/project.pbxproj: Update for new .in file.
1690         * WebProcess/com.apple.WebProcess.sb.in: Remove com.apple.FontServer
1691         from macOS Sierra and newer.
1692
1693 2016-11-10  Eric Carlson  <eric.carlson@apple.com>
1694
1695         [MediaStream] apply constraints passed to getUserMedia()
1696         https://bugs.webkit.org/show_bug.cgi?id=164561
1697
1698         Reviewed by Youenn Fablet.
1699         <rdar://problem/29191384>
1700
1701         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1702         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
1703
1704 2016-11-10  Alex Christensen  <achristensen@webkit.org>
1705
1706         Move SecurityOrigin::databaseIdentifier() to SecurityOriginData
1707         https://bugs.webkit.org/show_bug.cgi?id=164573
1708
1709         Reviewed by Brady Eidson.
1710
1711         * Shared/API/c/WKSecurityOriginRef.cpp:
1712         (WKSecurityOriginCopyDatabaseIdentifier):
1713         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
1714         (WebKit::LocalStorageDatabaseTracker::databasePath):
1715         (WebKit::LocalStorageDatabaseTracker::didOpenDatabaseWithOrigin):
1716         (WebKit::LocalStorageDatabaseTracker::deleteDatabaseWithOrigin):
1717         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1718         (WebKit::WebsiteDataStore::removeMediaKeys):
1719         * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
1720         (WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation):
1721         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1722         (WKBundlePageCopyOriginsWithApplicationCache):
1723         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
1724         (WebKit::WebMediaKeyStorageManager::mediaKeyStorageDirectoryForOrigin):
1725         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
1726         (WebKit::UserMediaPermissionRequestManager::startUserMediaRequest):
1727         (WebKit::UserMediaPermissionRequestManager::enumerateMediaDevices):
1728         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1729         (WebKit::WebChromeClient::exceededDatabaseQuota):
1730         (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
1731
1732 2016-11-10  Alex Christensen  <achristensen@webkit.org>
1733
1734         Remove unused CFURLCACHE code
1735         https://bugs.webkit.org/show_bug.cgi?id=164551
1736
1737         Reviewed by Antti Koivisto.
1738
1739         WebKit2 doesn't use CFURLCache, but we still have some unused code that seems to use it.
1740
1741         * NetworkProcess/NetworkProcess.cpp:
1742         (WebKit::fetchDiskCacheEntries):
1743         (WebKit::clearDiskCacheEntries):
1744         * NetworkProcess/NetworkProcess.h:
1745         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1746         (WebKit::partitionName): Deleted.
1747         (WebKit::NetworkProcess::cfURLCacheOrigins): Deleted.
1748         (WebKit::NetworkProcess::clearCFURLCacheForOrigins): Deleted.
1749
1750 2016-11-10  Carlos Garcia Campos  <cgarcia@igalia.com>
1751
1752         [Linux] Memory process values shown by the WebMemorySampler in linux are wrong
1753         https://bugs.webkit.org/show_bug.cgi?id=164591
1754
1755         Reviewed by Michael Catanzaro.
1756
1757         It's parsing /proc/self/statm, and returning the values as if they were bytes, but they are number of pages, so
1758         to get the bytes we need to take the page size into account. In r208534 I added a method to get /proc/self/statm
1759         values in bytes to Platform layer, so we can simply use that instead.
1760
1761         * Shared/linux/WebMemorySamplerLinux.cpp:
1762         (WebKit::WebMemorySampler::sampleWebKit): Use currentProcessMemoryStatus() and update the descriptions to
1763         clarify that values are in bytes.
1764
1765 2016-10-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1766
1767         MemoryPressureHandler shouldn't know how to release WebCore memory
1768         https://bugs.webkit.org/show_bug.cgi?id=160497
1769
1770         Reviewed by Michael Catanzaro.
1771
1772         Set the low memory handler before installing the memory pressure handler.
1773
1774         * WebProcess/WebProcess.cpp:
1775         (WebKit::WebProcess::initializeWebProcess):
1776         * WebProcess/cocoa/WebProcessCocoa.mm:
1777         (WebKit::WebProcess::platformInitializeWebProcess):
1778
1779 2016-10-27  Sergio Villar Senin  <svillar@igalia.com>
1780
1781         [GTK] New API to notify about dynamically added forms
1782         https://bugs.webkit.org/show_bug.cgi?id=164050
1783
1784         Reviewed by Carlos Garcia Campos.
1785
1786         This new API exports the WebCore event didAssociateFormControls through the web extension
1787         mechanism. This will help clients (mainly web browsers) to implement robust auto filling
1788         mechanisms. It deals nicely with dynamically created forms (and form controls) as many JS
1789         frameworks do nowadays.
1790
1791         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp: Added a FormClient implementation of
1792         API::InjectedBundle::FormClient.
1793         (webkitWebPageFormControlsAssociated): Emit the new signal.
1794         (webkit_web_page_class_init): Added the new signal "forms-controls-associated".
1795         (webkitWebPageCreate): Set the WebPage as a FormClient.
1796
1797 2016-11-10  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1798
1799         [GTK] Allow to use WebMemorySampler feature.
1800         https://bugs.webkit.org/show_bug.cgi?id=164517
1801
1802         Reviewed by Carlos Garcia Campos.
1803
1804         Enable the WebMemorySampler with the environment variable WEBKIT_SAMPLE_MEMORY.
1805
1806         When enabled, it will dump the stats to /tmp each second.
1807
1808         * UIProcess/API/gtk/WebKitWebContext.cpp:
1809         (webkitWebContextConstructed):
1810
1811 2016-11-10  Philippe Normand  <pnormand@igalia.com>
1812
1813         [WK2][GTK][GStreamer] Build fails when -plugins-base and -core headers are not installed in the same directory
1814         https://bugs.webkit.org/show_bug.cgi?id=148894
1815
1816         Reviewed by Carlos Garcia Campos.
1817
1818         The pbutils (gst-plugins-base-utils) headers are needed in
1819         WebKit2/GTK for the permission request API related with the
1820         GStreamer codec installer. It builds fine in most cases without
1821         explicitely requiring the pbutils include directory path because
1822         usually all the GStreamer headers are installed in the same path,
1823         excepted for some distributions, like NixOS.
1824
1825         * PlatformGTK.cmake: The GStreamer pbutils include directory was
1826         missing in the header search path.
1827
1828 2016-11-09  Chris Dumez  <cdumez@apple.com>
1829
1830         [WK2][!NETWORK_SESSION] Add support for downloading file backed blobs
1831         https://bugs.webkit.org/show_bug.cgi?id=164522
1832
1833         Reviewed by Alex Christensen.
1834
1835         Add support for downloading file backed blobs for the non-NETWORK_SESSION
1836         code path of WebKit2, which is still use on pre-Sierra macOS.
1837
1838         * NetworkProcess/Downloads/Download.cpp:
1839         (WebKit::Download::~Download):
1840         * NetworkProcess/Downloads/Download.h:
1841         (WebKit::Download::setBlobFileReferences):
1842         * NetworkProcess/Downloads/DownloadManager.cpp:
1843         (WebKit::DownloadManager::startDownload):
1844         (WebKit::DownloadManager::convertNetworkLoadToDownload):
1845         * NetworkProcess/Downloads/DownloadManager.h:
1846         * NetworkProcess/NetworkResourceLoader.cpp:
1847         (WebKit::NetworkResourceLoader::convertToDownload):
1848
1849 2016-11-09  Chris Dumez  <cdumez@apple.com>
1850
1851         [WK2][NETWORK_SESSION] Add support for downloading file backed blobs
1852         https://bugs.webkit.org/show_bug.cgi?id=164458
1853         <rdar://problem/28905514>
1854
1855         Reviewed by Darin Adler.
1856
1857         Add support for downloading file backed blobs on WebKit2.
1858         It previously wasn't working because we weren't calling
1859         BlobDataFileReference::prepareForFileAccess() for each blob file before
1860         starting the download, similarly to what is done in NetworkResourceLoader's
1861         consumeSandboxExtensions().
1862
1863         * NetworkProcess/Downloads/DownloadManager.cpp:
1864         (WebKit::DownloadManager::startDownload):
1865         * NetworkProcess/Downloads/DownloadManager.h:
1866         (WebKit::DownloadManager::startDownload):
1867         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1868         (WebKit::NetworkConnectionToWebProcess::startDownload):
1869         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
1870         * NetworkProcess/NetworkDataTask.cpp:
1871         (WebKit::NetworkDataTask::create):
1872         * NetworkProcess/NetworkDataTask.h:
1873         * NetworkProcess/NetworkDataTaskBlob.cpp:
1874         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
1875         (WebKit::NetworkDataTaskBlob::~NetworkDataTaskBlob):
1876         (WebKit::NetworkDataTaskBlob::download):
1877         * NetworkProcess/NetworkDataTaskBlob.h:
1878         * NetworkProcess/NetworkLoad.cpp:
1879         (WebKit::NetworkLoad::NetworkLoad):
1880         * NetworkProcess/NetworkLoadParameters.h:
1881         * NetworkProcess/NetworkProcess.cpp:
1882         (WebKit::NetworkProcess::downloadRequest):
1883         * NetworkProcess/NetworkResourceLoader.cpp:
1884         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
1885         (WebKit::NetworkResourceLoader::startNetworkLoad):
1886         * NetworkProcess/PingLoad.h:
1887
1888 2016-11-09  Carlos Garcia Campos  <cgarcia@igalia.com>
1889
1890         NetworkSession: Network process crash when converting main resource to download
1891         https://bugs.webkit.org/show_bug.cgi?id=164220
1892
1893         Reviewed by Alex Christensen.
1894
1895         Right after the main resource load is converted to a download, the web process deletes the ResourceLoader which
1896         sends the RemoveLoadIdentifier to the network process and the load is aborted. Sometimes it happens that
1897         NetworkResourceLoader::abort() is called while the NetworkLoad is still deciding the destination of the
1898         download. In such case, NetworkResourceLoader::didConvertToDownload() has already been called, but not
1899         NetworkResourceLoader::didBecomeDownload(). In NetworkResourceLoader::abort() we already handle the case of
1900         having a NetworkLoad after NetworkResourceLoader::didConvertToDownload() has been called, to avoid canceling the
1901         load in such case, however cleanup() is always called unconditionally and the NetworkLoad is deleted before
1902         NetworkResourceLoader::didBecomeDownload() is called. When the NetworkLoad is destroyed the NetworkDataTask
1903         client becomes nullptr, leaving it in a state where both the client is nullptr and the download hasn't been
1904         created yet. That's not expected to happen and when the response completion handler is called in the
1905         NetworkDataTask it tries to use either the client or the download and it crashes.
1906         We need to cleanup and destroy the ResourceLoader as soon as it becomes a download, because that's the expected
1907         behavior, but at the same time we need to keep the NetworkLoad alive until the NetworkDataTask finishes to become
1908         a download. This patch creates a PendingDownload to take the ownership of the NetworkLoad, so that
1909         ResourceLoader can be cleaned up and destroyed. The DownloadManager now will handle the PendingDownload as if it
1910         was created by startDownload(), but ensuring it's deleted right before the final Download object is added to the
1911         downloads map. That way NetworkDataTask will always have a valid client until the final Download is created,
1912         first the ResourceLoader and then the PendingDownload. Since the DownloadManager is the owner of the
1913         PendingDownload we no longer need the didBecomeDownload() callback to delete the NetworkLoad, because the
1914         NetworkLoad will always be owned by the PendingDownload now that will be deleted by the DownloadManager.
1915
1916         * NetworkProcess/Downloads/DownloadManager.cpp:
1917         (WebKit::DownloadManager::dataTaskBecameDownloadTask): Change the ASSERT because at this point we should always
1918         have a PendingDownload, and then remove it from the map here before adding the final Download to the map.
1919         (WebKit::DownloadManager::convertNetworkLoadToDownload): This replaces convertHandleToDownload, but it also now
1920         used for the NetworkSession. It creates a PendingDownload for the given NetworkLoad.
1921         (WebKit::DownloadManager::continueDecidePendingDownloadDestination): Do not take the PendingDownload from the
1922         map here, just check it's present, because it will be removed from dataTaskBecameDownloadTask().
1923         (WebKit::DownloadManager::convertHandleToDownload): Deleted.
1924         * NetworkProcess/Downloads/DownloadManager.h:
1925         * NetworkProcess/Downloads/PendingDownload.cpp:
1926         (WebKit::PendingDownload::PendingDownload): Add a constructor that receives a NetworkLoad.
1927         * NetworkProcess/Downloads/PendingDownload.h:
1928         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1929         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload): Just ask the ResourceLoader to be
1930         converted to a download.
1931         * NetworkProcess/NetworkDataTask.h:
1932         * NetworkProcess/NetworkDataTaskBlob.cpp:
1933         (WebKit::NetworkDataTaskBlob::download): Do not call didBecomeDownload() and add an assert to ensure the client
1934         has already been removed right after the final Download object is created.
1935         * NetworkProcess/NetworkLoad.cpp:
1936         (WebKit::NetworkLoad::NetworkLoad): Use a pointer for the client instead of a reference because now we need to
1937         change the client when the load is converted to a download. We don't need to null check the client in any case
1938         because the member is only updated internally and always from a passed reference.
1939         (WebKit::NetworkLoad::sharedDidReceiveResponse):
1940         (WebKit::NetworkLoad::sharedWillSendRedirectedRequest):
1941         (WebKit::NetworkLoad::convertTaskToDownload): This now receives a PendingDownload. It updates the client and no
1942         longer sends DidStart, because the PendingDownload sends it now.
1943         (WebKit::NetworkLoad::didReceiveChallenge):
1944         (WebKit::NetworkLoad::didReceiveData):
1945         (WebKit::NetworkLoad::didCompleteWithError):
1946         (WebKit::NetworkLoad::didSendData):
1947         (WebKit::NetworkLoad::wasBlocked):
1948         (WebKit::NetworkLoad::cannotShowURL):
1949         (WebKit::NetworkLoad::didReceiveBuffer):
1950         (WebKit::NetworkLoad::didFinishLoading):
1951         (WebKit::NetworkLoad::didFail):
1952         (WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync):
1953         (WebKit::NetworkLoad::didBecomeDownload): Deleted.
1954         * NetworkProcess/NetworkLoad.h:
1955         * NetworkProcess/NetworkLoadClient.h: Remove didBecomeDownload().
1956         * NetworkProcess/NetworkResourceLoader.cpp:
1957         (WebKit::NetworkResourceLoader::convertToDownload): This replaces didBecomeDownload() and
1958         didConvertToDownload(). It transfers the NetworkLoad to the DownloadManager.
1959         (WebKit::NetworkResourceLoader::abort): We don't need to check if the load was converted to a download here,
1960         because m_networkLoad will always be null here in such case.
1961         (WebKit::NetworkResourceLoader::didBecomeDownload): Deleted
1962         (WebKit::NetworkResourceLoader::didConvertToDownload): Deleted
1963         * NetworkProcess/NetworkResourceLoader.h:
1964         * NetworkProcess/PingLoad.h: Remove didBecomeDownload().
1965         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h: Ditto.
1966         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: Ditto.
1967         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: Ditto.
1968         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1969         (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]): Do not call didBecomeDownload().
1970         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1971         (WebKit::NetworkDataTaskSoup::download): Do not call didBecomeDownload() and add an assert to ensure the client
1972         has already been removed right after the final Download object is created.
1973
1974 2016-11-09  Alex Christensen  <achristensen@webkit.org>
1975
1976         Unreviewed, rolling out r208438.
1977
1978         crashes
1979
1980         Reverted changeset:
1981
1982         "[WK2][NETWORK_SESSION] Add support for downloading file
1983         backed blobs"
1984         https://bugs.webkit.org/show_bug.cgi?id=164458
1985         http://trac.webkit.org/changeset/208438
1986
1987 2016-11-04  Brent Fulgham  <bfulgham@apple.com>
1988
1989         Local HTML should be blocked from localStorage access unless "Disable Local File Restrictions" is checked
1990         https://bugs.webkit.org/show_bug.cgi?id=155185
1991         <rdar://problem/11101440>
1992
1993         Reviewed by Brady Eidson.
1994
1995         Provide SPI to access the new quirk for localStorage. The quirk defaults to 'on'. When active, this
1996         quirk says that localStorage access should be granted, without needing to grant universal file access.
1997
1998         If the quirk is turned off, then localStorage is blocked unless the WebKit client explicitly
1999         grants universal file access.
2000         
2001         Tested by existing TestWebKitAPI tests and WebKit2.LocalStorageQuirkTest
2002
2003         * Shared/WebPreferencesDefinitions.h:
2004         * UIProcess/API/C/WKPreferences.cpp:
2005         (WKPreferencesSetNeedsLocalStorageQuirk): Added.
2006         (WKPreferencesGetNeedsLocalStorageQuirk): Added.
2007         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2008         * UIProcess/API/Cocoa/WKWebView.mm:
2009         (-[WKWebView _initializeWithConfiguration:]): Honor the new localStorage quirk.
2010         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2011         (-[WKWebViewConfiguration init]): Honor the new localStorage quirk flag.
2012         (-[WKWebViewConfiguration copyWithZone:]): Ditto.
2013         (-[WKWebViewConfiguration _needsLocalStorageQuirk]): Added.
2014         (-[WKWebViewConfiguration _setNeedsLocalStorageQuirk:]): Added.
2015         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2016         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
2017         (WKBundleSetNeedsLocalStorageQuirk): Added.
2018         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
2019         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2020         (WebKit::InjectedBundle::setNeedsLocalStorageQuirk): Added.
2021         * WebProcess/InjectedBundle/InjectedBundle.h:
2022         * WebProcess/WebPage/WebPage.cpp:
2023         (WebKit::WebPage::updatePreferences): Honor the new localStorage quirk flag.
2024
2025 2016-11-09  Simon Fraser  <simon.fraser@apple.com>
2026
2027         Implement visual-viewport based position:fixed handling for Mac async scrolling
2028         https://bugs.webkit.org/show_bug.cgi?id=164495
2029
2030         Reviewed by Tim Horton.
2031
2032         Educate the scrolling tree about visual and layout viewports. This is runtime-switchable,
2033         so we push the enable flag to via the root state node, then push the layout viewport,
2034         and the min/max scroll position that contstrain it, through frame state nodes.
2035
2036         When a scroll happens, we compute a new layout viewport when the visual viewport hits
2037         an edge, and push that down through setScrollLayerPosition() since it's used to position
2038         fixed and sticky layers.
2039
2040         The iOS code is made to compile, but not work yet.
2041
2042         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
2043         (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
2044         (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
2045         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
2046         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
2047         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
2048         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
2049         (WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll):
2050         * UIProcess/Scrolling/RemoteScrollingTree.h:
2051         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
2052         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
2053         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::setScrollLayerPosition):
2054         * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
2055         (WebKit::RemoteScrollingCoordinator::scrollPositionChangedForNode):
2056
2057 2016-11-09  Beth Dakin  <bdakin@apple.com>
2058
2059         More attempted build fix.
2060
2061         * UIProcess/Cocoa/WebViewImpl.mm:
2062
2063 2016-11-09  Alex Christensen  <achristensen@webkit.org>
2064
2065         Clean up Storage code
2066         https://bugs.webkit.org/show_bug.cgi?id=164562
2067
2068         Reviewed by Brady Eidson.
2069
2070         Use more Refs!
2071
2072         * NetworkProcess/CustomProtocols/CustomProtocolManager.h:
2073         * Platform/IPC/Connection.cpp:
2074         (IPC::Connection::addWorkQueueMessageReceiver):
2075         * Platform/IPC/Connection.h:
2076         * UIProcess/Storage/LocalStorageDatabase.cpp:
2077         (WebKit::LocalStorageDatabase::create):
2078         (WebKit::LocalStorageDatabase::LocalStorageDatabase):
2079         * UIProcess/Storage/LocalStorageDatabase.h:
2080         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
2081         (WebKit::LocalStorageDatabaseTracker::create):
2082         (WebKit::LocalStorageDatabaseTracker::LocalStorageDatabaseTracker):
2083         * UIProcess/Storage/LocalStorageDatabaseTracker.h:
2084         * UIProcess/Storage/StorageManager.cpp:
2085         (WebKit::StorageManager::StorageArea::openDatabaseAndImportItemsIfNeeded):
2086         (WebKit::StorageManager::StorageManager):
2087         * UIProcess/Storage/StorageManager.h:
2088         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2089         (WebKit::WebResourceLoadStatisticsStore::processWillOpenConnection):
2090         * UIProcess/mac/SecItemShimProxy.cpp:
2091         (WebKit::SecItemShimProxy::initializeConnection):
2092         * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
2093         (WebKit::PluginProcessConnectionManager::initializeConnection):
2094         * WebProcess/WebPage/EventDispatcher.cpp:
2095         (WebKit::EventDispatcher::initializeConnection):
2096         * WebProcess/WebPage/ViewUpdateDispatcher.cpp:
2097         (WebKit::ViewUpdateDispatcher::initializeConnection):
2098
2099 2016-11-09  Beth Dakin  <bdakin@apple.com>
2100
2101         Another attempted build fix.
2102
2103         * UIProcess/Cocoa/WebViewImpl.mm:
2104
2105 2016-11-09  Michael Catanzaro  <mcatanzaro@igalia.com>
2106
2107         Experimental features should not be enabled by default
2108         https://bugs.webkit.org/show_bug.cgi?id=164367
2109
2110         Reviewed by Darin Adler.
2111
2112         We have two classes of experimental features:
2113
2114         (1) Features that are unstable and should be off by default, except for the developers
2115             currently working on them. This is straightforward to handle; the default value should
2116             be false.
2117         (2) Features that are still not ready for end users, but are stable enough for testing. We
2118             want these features to be enabled in testing environments like the bots, MiniBrowser,
2119             Safari Tech Preview, and so forth, but not in stable release builds.
2120
2121         Implement this. It is better than having all experimental features on unconditionally, and
2122         expecting them to be disabled manually on release branches, which is not something we are
2123         keen to do. An exception is Cocoa ports, which to my knowledge do not currently have any
2124         concept of development builds. These ports seem happy to continue disabling features
2125         manually in release branches, and should continue to do so at least for now.
2126
2127         We also have features that we wish to enumerate at runtime, yet have enabled by default
2128         unconditionally. We do not currently have any infrastructure to support this and should not
2129         abuse the experimental status for this purpose; it requires future work. All settings can
2130         still be toggled at runtime by clients that know about them using the existing runtime
2131         features API.
2132
2133         Lastly, the custom elements feature is ready to be enabled by default, so it's no longer
2134         experimental and can graduate to the list of normal boolean features.
2135
2136         * Shared/WebPreferencesDefinitions.h:
2137
2138 2016-11-09  Beth Dakin  <bdakin@apple.com>
2139
2140         Build fix.
2141
2142         * UIProcess/Cocoa/WebViewImpl.mm:
2143
2144 2016-11-09  Brady Eidson  <beidson@apple.com>
2145
2146         IndexedDB 2.0: Encapsulate cursor iteration parameters for easy future expansion.
2147         https://bugs.webkit.org/show_bug.cgi?id=164504
2148
2149         Reviewed by Darin Adler.
2150
2151         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
2152         (WebKit::WebIDBConnectionToClient::iterateCursor):
2153         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
2154         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
2155
2156         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
2157         (WebKit::WebIDBConnectionToServer::iterateCursor):
2158         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
2159
2160 2016-11-09  Darin Adler  <darin@apple.com>
2161
2162         Move Range from ExceptionCode to ExceptionOr
2163         https://bugs.webkit.org/show_bug.cgi?id=164457
2164
2165         Reviewed by Alex Christensen.
2166
2167         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.cpp:
2168         (webkit_dom_range_set_start): Updated exception handling.
2169         (webkit_dom_range_set_end): Ditto.
2170         (webkit_dom_range_set_start_before): Ditto.
2171         (webkit_dom_range_set_start_after): Ditto.
2172         (webkit_dom_range_set_end_before): Ditto.
2173         (webkit_dom_range_set_end_after): Ditto.
2174         (webkit_dom_range_select_node): Ditto.
2175         (webkit_dom_range_select_node_contents): Ditto.
2176         (webkit_dom_range_compare_boundary_points): Ditto.
2177         (webkit_dom_range_delete_contents): Ditto.
2178         (webkit_dom_range_extract_contents): Ditto.
2179         (webkit_dom_range_clone_contents): Ditto.
2180         (webkit_dom_range_insert_node): Ditto.
2181         (webkit_dom_range_surround_contents): Ditto.
2182         (webkit_dom_range_create_contextual_fragment): Ditto.
2183         (webkit_dom_range_compare_node): Ditto.
2184         (webkit_dom_range_intersects_node): Ditto.
2185         (webkit_dom_range_compare_point): Ditto.
2186         (webkit_dom_range_is_point_in_range): Ditto.
2187         (webkit_dom_range_expand): Ditto.
2188         * WebProcess/InjectedBundle/API/mac/WKDOMRange.mm:
2189         (-[WKDOMRange setStart:offset:]): Ditto.
2190         (-[WKDOMRange setEnd:offset:]): Ditto.
2191         (-[WKDOMRange selectNode:]): Ditto.
2192         (-[WKDOMRange selectNodeContents:]): Ditto.
2193         * WebProcess/WebPage/WebFrame.cpp:
2194         (WebKit::WebFrame::contentsAsString): Ditto.
2195         * WebProcess/WebPage/ios/WebPageIOS.mm:
2196         (WebKit::WebPage::rangeForWebSelectionAtPosition): Ditto.
2197         (WebKit::WebPage::rangeForBlockAtPoint): Ditto.
2198         (WebKit::WebPage::selectWithGesture): Ditto.
2199         (WebKit::containsRange): Ditto.
2200         (WebKit::unionDOMRanges): Ditto.
2201         (WebKit::WebPage::switchToBlockSelectionAtPoint): Ditto.
2202         (WebKit::WebPage::getPositionInformation): Ditto.
2203
2204
2205 2016-11-09  Darin Adler  <darin@apple.com>
2206
2207         Move EventTarget from ExceptionCode to ExceptionOr
2208         https://bugs.webkit.org/show_bug.cgi?id=164465
2209
2210         Reviewed by Youenn Fablet.
2211
2212         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.cpp:
2213         (webkit_dom_attr_dispatch_event): Updated exception handling.
2214         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.cpp:
2215         (webkit_dom_cdata_section_dispatch_event): Ditto.
2216         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp:
2217         (webkit_dom_character_data_dispatch_event): Ditto.
2218         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.cpp:
2219         (webkit_dom_comment_dispatch_event): Ditto.
2220         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
2221         (webkit_dom_dom_window_dispatch_event): Ditto.
2222         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
2223         (webkit_dom_document_dispatch_event): Ditto.
2224         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp:
2225         (webkit_dom_document_fragment_dispatch_event): Ditto.
2226         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.cpp:
2227         (webkit_dom_document_type_dispatch_event): Ditto.
2228         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
2229         (webkit_dom_element_dispatch_event): Ditto.
2230         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.cpp:
2231         (webkit_dom_html_anchor_element_dispatch_event): Ditto.
2232         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.cpp:
2233         (webkit_dom_html_applet_element_dispatch_event): Ditto.
2234         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.cpp:
2235         (webkit_dom_html_area_element_dispatch_event): Ditto.
2236         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.cpp:
2237         (webkit_dom_html_br_element_dispatch_event): Ditto.
2238         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.cpp:
2239         (webkit_dom_html_base_element_dispatch_event): Ditto.
2240         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.cpp:
2241         (webkit_dom_html_body_element_dispatch_event): Ditto.
2242         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.cpp:
2243         (webkit_dom_html_button_element_dispatch_event): Ditto.
2244         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.cpp:
2245         (webkit_dom_html_canvas_element_dispatch_event): Ditto.
2246         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.cpp:
2247         (webkit_dom_html_d_list_element_dispatch_event): Ditto.
2248         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.cpp:
2249         (webkit_dom_html_directory_element_dispatch_event): Ditto.
2250         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.cpp:
2251         (webkit_dom_html_div_element_dispatch_event): Ditto.
2252         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.cpp:
2253         (webkit_dom_html_document_dispatch_event): Ditto.
2254         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp:
2255         (webkit_dom_html_element_dispatch_event): Ditto.
2256         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.cpp:
2257         (webkit_dom_html_embed_element_dispatch_event): Ditto.
2258         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.cpp:
2259         (webkit_dom_html_field_set_element_dispatch_event): Ditto.
2260         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.cpp:
2261         (webkit_dom_html_font_element_dispatch_event): Ditto.
2262         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.cpp:
2263         (webkit_dom_html_form_element_dispatch_event): Ditto.
2264         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.cpp:
2265         (webkit_dom_html_frame_element_dispatch_event): Ditto.
2266         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.cpp:
2267         (webkit_dom_html_frame_set_element_dispatch_event): Ditto.
2268         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.cpp:
2269         (webkit_dom_html_hr_element_dispatch_event): Ditto.
2270         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.cpp:
2271         (webkit_dom_html_heading_element_dispatch_event): Ditto.
2272         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.cpp:
2273         (webkit_dom_html_head_element_dispatch_event): Ditto.
2274         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.cpp:
2275         (webkit_dom_html_html_element_dispatch_event): Ditto.
2276         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.cpp:
2277         (webkit_dom_html_iframe_element_dispatch_event): Ditto.
2278         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.cpp:
2279         (webkit_dom_html_image_element_dispatch_event): Ditto.
2280         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
2281         (webkit_dom_html_input_element_dispatch_event): Ditto.
2282         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.cpp:
2283         (webkit_dom_html_li_element_dispatch_event): Ditto.
2284         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.cpp:
2285         (webkit_dom_html_label_element_dispatch_event): Ditto.
2286         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.cpp:
2287         (webkit_dom_html_legend_element_dispatch_event): Ditto.
2288         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.cpp:
2289         (webkit_dom_html_link_element_dispatch_event): Ditto.
2290         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.cpp:
2291         (webkit_dom_html_map_element_dispatch_event): Ditto.
2292         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.cpp:
2293         (webkit_dom_html_marquee_element_dispatch_event): Ditto.
2294         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.cpp:
2295         (webkit_dom_html_menu_element_dispatch_event): Ditto.
2296         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.cpp:
2297         (webkit_dom_html_meta_element_dispatch_event): Ditto.
2298         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.cpp:
2299         (webkit_dom_html_mod_element_dispatch_event): Ditto.
2300         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.cpp:
2301         (webkit_dom_html_o_list_element_dispatch_event): Ditto.
2302         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.cpp:
2303         (webkit_dom_html_object_element_dispatch_event): Ditto.
2304         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.cpp:
2305         (webkit_dom_html_opt_group_element_dispatch_event): Ditto.
2306         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.cpp:
2307         (webkit_dom_html_option_element_dispatch_event): Ditto.
2308         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.cpp:
2309         (webkit_dom_html_paragraph_element_dispatch_event): Ditto.
2310         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.cpp:
2311         (webkit_dom_html_param_element_dispatch_event): Ditto.
2312         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.cpp:
2313         (webkit_dom_html_pre_element_dispatch_event): Ditto.
2314         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.cpp:
2315         (webkit_dom_html_quote_element_dispatch_event): Ditto.
2316         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.cpp:
2317         (webkit_dom_html_script_element_dispatch_event): Ditto.
2318         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
2319         (webkit_dom_html_select_element_dispatch_event): Ditto.
2320         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.cpp:
2321         (webkit_dom_html_style_element_dispatch_event): Ditto.
2322         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.cpp:
2323         (webkit_dom_html_table_caption_element_dispatch_event): Ditto.
2324         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.cpp:
2325         (webkit_dom_html_table_cell_element_dispatch_event): Ditto.
2326         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.cpp:
2327         (webkit_dom_html_table_col_element_dispatch_event): Ditto.
2328         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.cpp:
2329         (webkit_dom_html_table_element_dispatch_event): Ditto.
2330         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.cpp:
2331         (webkit_dom_html_table_row_element_dispatch_event): Ditto.
2332         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.cpp:
2333         (webkit_dom_html_table_section_element_dispatch_event): Ditto.
2334         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.cpp:
2335         (webkit_dom_html_text_area_element_dispatch_event): Ditto.
2336         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.cpp:
2337         (webkit_dom_html_title_element_dispatch_event): Ditto.
2338         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.cpp:
2339         (webkit_dom_html_u_list_element_dispatch_event): Ditto.
2340         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.cpp:
2341         (webkit_dom_node_dispatch_event): Ditto.
2342         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.cpp:
2343         (webkit_dom_processing_instruction_dispatch_event): Ditto.
2344         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp:
2345         (webkit_dom_text_dispatch_event): Ditto.
2346
2347 2016-11-08  Dean Jackson  <dino@apple.com>
2348
2349         Rendering support for ExtendedColors
2350         https://bugs.webkit.org/show_bug.cgi?id=164443
2351         <rdar://problems/29123243>
2352
2353         Reviewed by Simon Fraser and Darin Adler.
2354
2355         Implement argument coders for Color.
2356
2357         * Shared/WebCoreArgumentCoders.cpp:
2358         (IPC::ArgumentCoder<Color>::encode):
2359         (IPC::ArgumentCoder<Color>::decode):
2360         * Shared/WebCoreArgumentCoders.h:
2361         * UIProcess/API/Cocoa/WKWebView.mm:
2362         (-[WKWebView _updateScrollViewBackground]):
2363
2364 2016-11-09  Beth Dakin  <bdakin@apple.com>
2365
2366         Build fix.
2367
2368         * UIProcess/Cocoa/WebViewImpl.mm:
2369         (WebKit::WebViewImpl::~WebViewImpl):
2370
2371 2016-11-09  Chris Dumez  <cdumez@apple.com>
2372
2373         [Mac] Stop using deprecated AppKit enumeration values
2374         https://bugs.webkit.org/show_bug.cgi?id=164494
2375
2376         Reviewed by Darin Adler.
2377
2378         Stop using deprecated AppKit enumeration values.
2379
2380         * Shared/mac/ChildProcessMac.mm:
2381         (WebKit::ChildProcess::stopNSAppRunLoop):
2382         * Shared/mac/WebEventFactory.mm:
2383         (WebKit::mouseButtonForEvent):
2384         (WebKit::mouseEventTypeForEvent):
2385         (WebKit::clickCountForEvent):
2386         (WebKit::globalPointForEvent):
2387         (WebKit::pointForEvent):
2388         (WebKit::textFromEvent):
2389         (WebKit::unmodifiedTextFromEvent):
2390         (WebKit::isKeypadEvent):
2391         (WebKit::isKeyUpEvent):
2392         (WebKit::WebEventFactory::createWebKeyboardEvent):
2393         * UIProcess/Cocoa/WebViewImpl.mm:
2394         (WebKit::WebViewImpl::becomeFirstResponder):
2395         (WebKit::WebViewImpl::updateContentInsetsIfAutomatic):
2396         (WebKit::WebViewImpl::viewDidMoveToWindow):
2397         (WebKit::WebViewImpl::postFakeMouseMovedEventForFlagsChangedEvent):
2398         (WebKit::WebViewImpl::createFullScreenWindow):
2399         (WebKit::WebViewImpl::sendToolTipMouseExited):
2400         (WebKit::WebViewImpl::sendToolTipMouseEntered):
2401         (WebKit::applicationFlagsForDrag):
2402         (WebKit::WebViewImpl::setLastMouseDownEvent):
2403         (WebKit::WebViewImpl::doneWithKeyEvent):
2404         (WebKit::WebViewImpl::collectKeyboardLayoutCommandsForEvent):
2405         (WebKit::WebViewImpl::performKeyEquivalent):
2406         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
2407         (WebKit::PluginProcessProxy::beginModal):
2408         * UIProcess/mac/WebContextMenuProxyMac.mm:
2409         (WebKit::WebContextMenuProxyMac::showContextMenuWithItems):
2410         * UIProcess/mac/WebInspectorProxyMac.mm:
2411         * UIProcess/mac/WebPopupMenuProxyMac.mm:
2412         (WebKit::WebPopupMenuProxyMac::populate):
2413         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
2414         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
2415         (WebKit::modifierFlagsFromWebEvent):
2416         (WebKit::getEventTypeFromWebEvent):
2417         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm:
2418         (WebKit::cssAlignmentValueForNSTextAlignment):
2419         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
2420         (WebKit::convertImageToBitmap):
2421
2422 2016-11-09  Beth Dakin  <bdakin@apple.com>
2423
2424         Support TouchBar in WebKit
2425         https://bugs.webkit.org/show_bug.cgi?id=164437
2426         -and corresponding-
2427         rdar://problem/28876524
2428
2429         Reviewed by Darin Adler.
2430
2431         * UIProcess/API/Cocoa/WKViewPrivate.h:
2432         * UIProcess/API/Cocoa/WKWebView.mm:
2433         (-[WKWebView makeTouchBar]):
2434         (-[WKWebView candidateListTouchBarItem]):
2435         (-[WKWebView _web_didAddMediaControlsManager:]):
2436         (-[WKWebView _web_didRemoveMediaControlsManager]):
2437         (-[WKWebView _interactWithMediaControlsForTesting]):
2438         (-[WKWebView _wantsMediaPlaybackControlsView]):
2439         (-[WKWebView _setWantsMediaPlaybackControlsView:]):
2440         (-[WKWebView _mediaPlaybackControlsView]):
2441         (-[WKWebView _addMediaPlaybackControlsView:]):
2442         (-[WKWebView _removeMediaPlaybackControlsView]):
2443         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2444         * UIProcess/API/mac/WKView.mm:
2445         (-[WKView makeTouchBar]):
2446         (-[WKView candidateListTouchBarItem]):
2447         (-[WKView _web_didAddMediaControlsManager:]):
2448         (-[WKView _web_didRemoveMediaControlsManager]):
2449         (-[WKView _wantsMediaPlaybackControlsView]):
2450         (-[WKView _setWantsMediaPlaybackControlsView:]):
2451         (-[WKView _mediaPlaybackControlsView]):
2452         (-[WKView _addMediaPlaybackControlsView:]):
2453         (-[WKView _removeMediaPlaybackControlsView]):
2454         * UIProcess/Cocoa/WebViewImpl.h:
2455         (WebKit::WebViewImpl::currentTouchBar):
2456         (WebKit::WebViewImpl::clientWantsMediaPlaybackControlsView):
2457         (WebKit::WebViewImpl::setClientWantsMediaPlaybackControlsView):
2458         (WebKit::WebViewImpl::setIsCustomizingTouchBar):
2459         * UIProcess/Cocoa/WebViewImpl.mm:
2460         (-[WKTextListTouchBarViewController initWithWebViewImpl:]):
2461         (-[WKTextListTouchBarViewController didDestroyView]):
2462         (-[WKTextListTouchBarViewController _selectList:]):
2463         (-[WKTextListTouchBarViewController setCurrentListType:]):
2464         (-[WKTextTouchBarItemController initWithWebViewImpl:]):
2465         (-[WKTextTouchBarItemController didDestroyView]):
2466         (-[WKTextTouchBarItemController touchBar:makeItemForIdentifier:]):
2467         (-[WKTextTouchBarItemController itemForIdentifier:]):
2468         (-[WKTextTouchBarItemController candidateListTouchBarItem:endSelectingCandidateAtIndex:]):
2469         (-[WKTextTouchBarItemController candidateListTouchBarItem:changedCandidateListVisibility:]):
2470         (-[WKTextTouchBarItemController textListTouchBarViewController]):
2471         (-[WKTextTouchBarItemController setTextIsBold:]):
2472         (-[WKTextTouchBarItemController setTextIsItalic:]):
2473         (-[WKTextTouchBarItemController setTextIsUnderlined:]):
2474         (-[WKTextTouchBarItemController _wkChangeTextStyle:]):
2475         (-[WKTextTouchBarItemController setCurrentTextAlignment:]):
2476         (-[WKTextTouchBarItemController _wkChangeTextAlignment:]):
2477         (-[WKTextTouchBarItemController textColor]):
2478         (-[WKTextTouchBarItemController setTextColor:]):
2479         (-[WKTextTouchBarItemController _wkChangeColor:]):
2480         (-[WKTextTouchBarItemController textListViewController]):
2481         (WebKit::WebViewImpl::makeTouchBar):
2482         (WebKit::WebViewImpl::candidateListTouchBarItem):
2483         (WebKit::WebViewImpl::mediaPlaybackControlsView):
2484         (WebKit::WebViewImpl::useMediaPlaybackControlsView):
2485         (WebKit::WebViewImpl::dismissTextTouchBarPopoverItemWithIdentifier):
2486         (WebKit::textTouchBarCustomizationAllowedIdentifiers):
2487         (WebKit::plainTextTouchBarCustomizationDefaultItemIdentifiers):
2488         (WebKit::richTextTouchBarCustomizationDefaultItemIdentifiers):
2489         (WebKit::touchBarDidExitCustomization):
2490         (WebKit::touchBarWillEnterCustomization):
2491         (WebKit::didChangeAutomaticTextCompletion):
2492         (WebKit::WebViewImpl::updateTouchBarAndRefreshTextBarIdentifiers):
2493         (WebKit::WebViewImpl::setUpTextTouchBar):
2494         (WebKit::WebViewImpl::isRichlyEditable):
2495         (WebKit::WebViewImpl::textTouchBar):
2496         (WebKit::WebViewImpl::updateTextTouchBar):
2497         (WebKit::WebViewImpl::updateMediaTouchBar):
2498         (WebKit::WebViewImpl::forceRequestCandidatesForTesting):
2499         (WebKit::WebViewImpl::updateTouchBar):
2500         (WebKit::WebViewImpl::shouldRequestCandidates):
2501         (WebKit::WebViewImpl::showCandidates):
2502         (WebKit::WebViewImpl::webViewImplAdditionsWillDestroyView):
2503         (WebKit::WebViewImpl::setEditableElementIsFocused):
2504         (WebKit::WebViewImpl::becomeFirstResponder):
2505         (WebKit::WebViewImpl::selectionDidChange):
2506         (WebKit::WebViewImpl::videoControlsManagerDidChange):
2507         (WebKit::WebViewImpl::updateWebViewImplAdditions): Deleted.
2508
2509 2016-11-09  Chris Dumez  <cdumez@apple.com>
2510
2511         [WK2][NETWORK_SESSION] Add support for downloading file backed blobs
2512         https://bugs.webkit.org/show_bug.cgi?id=164458
2513         <rdar://problem/28905514>
2514
2515         Reviewed by Darin Adler.
2516
2517         Add support for downloading file backed blobs on WebKit2.
2518         It previously wasn't working because we weren't calling
2519         BlobDataFileReference::prepareForFileAccess() for each blob file before
2520         starting the download, similarly to what is done in NetworkResourceLoader's
2521         consumeSandboxExtensions().
2522
2523         * NetworkProcess/Downloads/DownloadManager.cpp:
2524         (WebKit::DownloadManager::startDownload):
2525         * NetworkProcess/Downloads/DownloadManager.h:
2526         (WebKit::DownloadManager::startDownload):
2527         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2528         (WebKit::NetworkConnectionToWebProcess::startDownload):
2529         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
2530         * NetworkProcess/NetworkDataTask.cpp:
2531         (WebKit::NetworkDataTask::create):
2532         * NetworkProcess/NetworkDataTask.h:
2533         * NetworkProcess/NetworkDataTaskBlob.cpp:
2534         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
2535         (WebKit::NetworkDataTaskBlob::~NetworkDataTaskBlob):
2536         (WebKit::NetworkDataTaskBlob::download):
2537         * NetworkProcess/NetworkDataTaskBlob.h:
2538         * NetworkProcess/NetworkLoad.cpp:
2539         (WebKit::NetworkLoad::NetworkLoad):
2540         * NetworkProcess/NetworkLoadParameters.h:
2541         * NetworkProcess/NetworkProcess.cpp:
2542         (WebKit::NetworkProcess::downloadRequest):
2543         * NetworkProcess/NetworkResourceLoader.cpp:
2544         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
2545         (WebKit::NetworkResourceLoader::startNetworkLoad):
2546         * NetworkProcess/PingLoad.h:
2547
2548 2016-11-09  Chris Dumez  <cdumez@apple.com>
2549
2550         [WK2] Network cache speculative revalidation can cause loads to hang
2551         https://bugs.webkit.org/show_bug.cgi?id=164532
2552         <rdar://problem/28519331>
2553
2554         Reviewed by Alex Christensen.
2555
2556         Network cache speculative revalidation could cause loads to hang when HTTP
2557         authentication was involved because NetworkCacheSpeculativeLoad failed to
2558         call NetworkLoad::continueCanAuthenticateAgainstProtectionSpace() in its
2559         canAuthenticateAgainstProtectionSpaceAsync() callback.
2560
2561         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
2562         (WebKit::NetworkCache::SpeculativeLoad::canAuthenticateAgainstProtectionSpaceAsync):
2563         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
2564
2565 2016-11-09  Csaba Osztrogonác  <ossy@webkit.org>
2566
2567         URTBF after r208361.
2568
2569         * PlatformMac.cmake:
2570
2571 2016-11-09  Csaba Osztrogonác  <ossy@webkit.org>
2572
2573         Unreviewed typo fix after r160616 to fix the build on case sensitive file systems.
2574
2575         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2576
2577 2016-11-05  Carlos Garcia Campos  <cgarcia@igalia.com>
2578
2579         [SOUP] Layout test http/tests/misc/authentication-redirect-3/authentication-sent-to-redirect-same-origin-with-location-credentials.html fails
2580         https://bugs.webkit.org/show_bug.cgi?id=139358
2581
2582         Reviewed by Michael Catanzaro.
2583
2584         Stop putting the credentials in the URL unconditionally and ensure we only do that when provided by the URL
2585         itself. Libsoup has its own cache of SoupAuth, so we don't need to pass user/pass in the URL for every single
2586         request, libsoup will authenticate those automatically.
2587
2588         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
2589         (WebKit::NetworkDataTaskSoup::applyAuthenticationToRequest):
2590
2591 2016-11-04  Filip Pizlo  <fpizlo@apple.com>
2592
2593         WTF::ParkingLot should stop using std::chrono because std::chrono::duration casts are prone to overflows
2594         https://bugs.webkit.org/show_bug.cgi?id=152045
2595
2596         Reviewed by Andy Estes.
2597
2598         * Platform/IPC/Connection.cpp:
2599         (IPC::Connection::SyncMessageState::wait):
2600         (IPC::Connection::sendMessage):
2601         (IPC::Connection::timeoutRespectingIgnoreTimeoutsForTesting):
2602         (IPC::Connection::waitForMessage):
2603         (IPC::Connection::sendSyncMessage):
2604         (IPC::Connection::waitForSyncReply):
2605         * Platform/IPC/Connection.h:
2606         (IPC::Connection::sendSync):
2607         (IPC::Connection::waitForAndDispatchImmediately):
2608         * Platform/IPC/MessageSender.h:
2609         (IPC::MessageSender::sendSync):
2610         * UIProcess/ChildProcessProxy.h:
2611         (WebKit::ChildProcessProxy::sendSync):
2612         * UIProcess/Network/NetworkProcessProxy.cpp:
2613         (WebKit::NetworkProcessProxy::sendProcessWillSuspendImminently):
2614         * UIProcess/Storage/StorageManager.cpp:
2615         (WebKit::StorageManager::applicationWillTerminate):
2616         * UIProcess/WebProcessProxy.cpp:
2617         (WebKit::WebProcessProxy::sendProcessWillSuspendImminently):
2618         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2619         (WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate):
2620         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
2621         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2622         (-[WKOneShotDisplayLinkHandler displayLinkFired:]):
2623         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
2624         (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
2625         (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateActivityState):
2626         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
2627         (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState):
2628         * UIProcess/mac/WKImmediateActionController.mm:
2629         (-[WKImmediateActionController immediateActionRecognizerWillBeginAnimation:]):
2630         * UIProcess/mac/WebPageProxyMac.mm:
2631         (WebKit::WebPageProxy::stringSelectionForPasteboard):
2632         (WebKit::WebPageProxy::dataSelectionForPasteboard):
2633         (WebKit::WebPageProxy::readSelectionFromPasteboard):
2634         (WebKit::WebPageProxy::shouldDelayWindowOrderingForEvent):
2635         (WebKit::WebPageProxy::acceptsFirstMouse):
2636         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2637         (WebKit::WebChromeClient::runBeforeUnloadConfirmPanel):
2638         (WebKit::WebChromeClient::runJavaScriptAlert):
2639         (WebKit::WebChromeClient::runJavaScriptConfirm):
2640         (WebKit::WebChromeClient::runJavaScriptPrompt):
2641         (WebKit::WebChromeClient::print):
2642         (WebKit::WebChromeClient::exceededDatabaseQuota):
2643         (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
2644         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2645         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
2646         * WebProcess/WebPage/WebPage.cpp:
2647         (WebKit::WebPage::postSynchronousMessageForTesting):
2648
2649 2016-11-04  Wenson Hsieh  <wenson_hsieh@apple.com>
2650
2651         Safari does not emit composition end if blurred for dead key / Japanese IME
2652         https://bugs.webkit.org/show_bug.cgi?id=164369
2653         <rdar://problem/29050439>
2654
2655         Reviewed by Ryosuke Niwa.
2656
2657         Split WebPage::discardedComposition into two steps, where we first discard marked text and then update the
2658         editor state. This allows the codepath where we cancel the composition early (before setting the selection) to
2659         discard marked text without also forcing an editor state update at the same time. The editor state is later
2660         updated in WebPage::didChangeSelection.
2661
2662         * UIProcess/WebPageProxy.cpp:
2663         (WebKit::WebPageProxy::compositionWasCanceled):
2664         * UIProcess/WebPageProxy.h:
2665         * UIProcess/WebPageProxy.messages.in:
2666         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2667         (WebKit::WebEditorClient::canceledComposition):
2668         * WebProcess/WebCoreSupport/WebEditorClient.h:
2669         * WebProcess/WebPage/WebPage.cpp:
2670         (WebKit::WebPage::didChangeSelection):
2671         (WebKit::WebPage::discardedComposition):
2672         (WebKit::WebPage::canceledComposition):
2673         * WebProcess/WebPage/WebPage.h:
2674
2675 2016-11-04  Alex Christensen  <achristensen@webkit.org>
2676
2677         Unreviewed, rolling out r208293.
2678
2679         asserts in API tests.
2680
2681         Reverted changeset:
2682
2683         "NetworkSession: Network process crash when converting main
2684         resource to download"
2685         https://bugs.webkit.org/show_bug.cgi?id=164220
2686         http://trac.webkit.org/changeset/208293
2687
2688 2016-11-04  Said Abou-Hallawa  <sabouhallawa@apple.com>
2689
2690         Add a setting and preferences to enable/disable async image decoding
2691         https://bugs.webkit.org/show_bug.cgi?id=164417
2692
2693         Reviewed by Simon Fraser.
2694
2695         Hook up the asyncImageDecodingEnabled setting for WebKit2.
2696
2697         * Shared/WebPreferencesDefinitions.h:
2698         * UIProcess/API/Cocoa/WKPreferences.mm:
2699         (-[WKPreferences _asyncImageDecodingEnabled]):
2700         (-[WKPreferences _setAsyncImageDecodingEnabled:]):
2701         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2702         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2703         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2704         * WebProcess/WebPage/WebPage.cpp:
2705         (WebKit::WebPage::updatePreferences):
2706
2707 2016-11-04  Simon Fraser  <simon.fraser@apple.com>
2708
2709         Rename some ScrollingTree/Node-related functions to reduce the number of uses of "update"
2710         https://bugs.webkit.org/show_bug.cgi?id=164420
2711
2712         Reviewed by Tim Horton.
2713
2714         Rename:
2715             commitNewTreeState -> commitTreeState ("new" was redundant)
2716             updateBeforeChildren -> commitStateBeforeChildren
2717             updateAfterChildren -> commitStateAfterChildren
2718
2719
2720         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
2721         (WebKit::RemoteScrollingCoordinatorProxy::commitScrollingTreeState):
2722         (WebKit::RemoteScrollingCoordinatorProxy::updateScrollingTree): Deleted.
2723         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
2724         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
2725         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
2726         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateBeforeChildren):
2727         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateAfterChildren):
2728         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateBeforeChildren): Deleted.
2729         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren): Deleted.
2730         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2731         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
2732
2733 2016-11-04  Carlos Garcia Campos  <cgarcia@igalia.com>
2734
2735         NetworkSession: Add NetworkDataTask implementation for blobs
2736         https://bugs.webkit.org/show_bug.cgi?id=163939
2737
2738         Reviewed by Alex Christensen.
2739
2740         Add NetworkDataTaskBlob to handle blobs when using NetworkSession instead of using ResourceHandle. This patch
2741         adds more USE(NETWORK_SESSION) ifdefs to not use ResourceHandle in Downloads and NetworkLoad when NetworkSession
2742         is enabled.
2743
2744         * CMakeLists.txt: Add new files to compilation.
2745         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
2746         * NetworkProcess/Downloads/BlobDownloadClient.h:
2747         * NetworkProcess/Downloads/Download.cpp:
2748         (WebKit::Download::Download): Split the constructor again and remove the PlatformDownloadTaskRef
2749         definitions. Now Cocoa specific constructor receives a NSURLSessionDownloadTask and the general constructor
2750         reveices a NetworkDataTask and is used by Soup backend and blobs.
2751         (WebKit::Download::~Download):
2752         (WebKit::Download::start):
2753         (WebKit::Download::startWithHandle):
2754         (WebKit::Download::cancel):
2755         (WebKit::Download::didReceiveAuthenticationChallenge):
2756         (WebKit::Download::didReceiveData):
2757         (WebKit::Download::didFinish):
2758         (WebKit::Download::platformCancelNetworkLoad): Rename cancelNetworkLoad() as platformCancelNetworkLoad() since
2759         this is now used only by Cocoa platform to cancel the NSURLSessionDownloadTask.
2760         * NetworkProcess/Downloads/Download.h:
2761         (WebKit::Download::Download):
2762         (WebKit::Download::suggestedName):
2763         (WebKit::Download::request):
2764         * NetworkProcess/Downloads/DownloadManager.cpp:
2765         (WebKit::DownloadManager::startDownload): Remove blobs specific code when using NetworkSession.
2766         (WebKit::DownloadManager::continueDecidePendingDownloadDestination):
2767         * NetworkProcess/Downloads/DownloadManager.h:
2768         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
2769         (WebKit::Download::platformCancelNetworkLoad):
2770         * NetworkProcess/Downloads/soup/DownloadSoup.cpp: Removed.
2771         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2772         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload): Remove blobs specific code when
2773         using NetworkSession.
2774         * NetworkProcess/NetworkDataTask.cpp:
2775         (WebKit::NetworkDataTask::create): If request is a blob, create a NetworkDataTaskBlob.
2776         * NetworkProcess/NetworkDataTask.h: Add invalidateAndCancel pure virtual method.
2777         * NetworkProcess/NetworkDataTaskBlob.cpp: Added.
2778         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
2779         (WebKit::NetworkDataTaskBlob::~NetworkDataTaskBlob):
2780         (WebKit::NetworkDataTaskBlob::clearStream):
2781         (WebKit::NetworkDataTaskBlob::resume):
2782         (WebKit::NetworkDataTaskBlob::suspend):
2783         (WebKit::NetworkDataTaskBlob::cancel):
2784         (WebKit::NetworkDataTaskBlob::invalidateAndCancel):
2785         (WebKit::NetworkDataTaskBlob::getSizeForNext):
2786         (WebKit::NetworkDataTaskBlob::didGetSize):
2787         (WebKit::NetworkDataTaskBlob::seek):
2788         (WebKit::NetworkDataTaskBlob::didReceiveResponse):
2789         (WebKit::NetworkDataTaskBlob::read):
2790         (WebKit::NetworkDataTaskBlob::readData):
2791         (WebKit::NetworkDataTaskBlob::readFile):
2792         (WebKit::NetworkDataTaskBlob::didOpen):
2793         (WebKit::NetworkDataTaskBlob::didRead):
2794         (WebKit::NetworkDataTaskBlob::consumeData):
2795         (WebKit::NetworkDataTaskBlob::setPendingDownloadLocation):
2796         (WebKit::NetworkDataTaskBlob::suggestedFilename):
2797         (WebKit::NetworkDataTaskBlob::download):
2798         (WebKit::NetworkDataTaskBlob::writeDownload):
2799         (WebKit::NetworkDataTaskBlob::cleanDownloadFiles):
2800         (WebKit::NetworkDataTaskBlob::didFailDownload):
2801         (WebKit::NetworkDataTaskBlob::didFinishDownload):
2802         (WebKit::NetworkDataTaskBlob::didFail):
2803         (WebKit::NetworkDataTaskBlob::didFinish):
2804         * NetworkProcess/NetworkDataTaskBlob.h: Added.
2805         * NetworkProcess/NetworkLoad.cpp:
2806         (WebKit::NetworkLoad::NetworkLoad): Remove blobs specific code when using NetworkSession.
2807         (WebKit::NetworkLoad::~NetworkLoad):
2808         (WebKit::NetworkLoad::setDefersLoading):
2809         (WebKit::NetworkLoad::cancel):
2810         (WebKit::NetworkLoad::continueWillSendRequest):
2811         (WebKit::NetworkLoad::continueDidReceiveResponse):
2812         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
2813         (WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync):
2814         * NetworkProcess/NetworkLoad.h:
2815         * NetworkProcess/NetworkSession.cpp:
2816         (WebKit::NetworkSession::invalidateAndCancel): Moved from NetworkSessionSoup, since this is now used also by blobs.
2817         * NetworkProcess/NetworkSession.h:
2818         (WebKit::NetworkSession::registerNetworkDataTask): Ditto.
2819         (WebKit::NetworkSession::unregisterNetworkDataTask): Ditto.
2820         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: Add invalidateAndCancel() implementation that does nothing
2821         because in Cocoa all tasks are invalidated and canceled by the network session.
2822         * NetworkProcess/mac/NetworkLoadMac.mm:
2823         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
2824         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
2825         (WebKit::NetworkDataTaskSoup::~NetworkDataTaskSoup):
2826         (WebKit::NetworkDataTaskSoup::download):
2827         * NetworkProcess/soup/NetworkDataTaskSoup.h:
2828         * NetworkProcess/soup/NetworkSessionSoup.cpp:
2829         * NetworkProcess/soup/NetworkSessionSoup.h:
2830         * PlatformEfl.cmake: Remove DownloadSoup.cpp from compilation.
2831         * PlatformGTK.cmake: Ditto.
2832         * WebKit2.xcodeproj/project.pbxproj: Add new files to compilation.
2833
2834 2016-11-03  Simon Fraser  <simon.fraser@apple.com>
2835
2836         Give all the geometry classes a single-argument scale() function for consistency
2837         https://bugs.webkit.org/show_bug.cgi?id=164400
2838
2839         Reviewed by Zalan Bujtas.
2840         
2841         Use single-argument scale() functions.
2842
2843         * PluginProcess/PluginControllerProxy.cpp:
2844         (WebKit::PluginControllerProxy::paint):
2845         * Shared/mac/RemoteLayerBackingStore.mm:
2846         (WebKit::RemoteLayerBackingStore::drawInContext):
2847         * UIProcess/API/Cocoa/WKWebView.mm:
2848         (-[WKWebView _didCommitLayerTree:]):
2849         (-[WKWebView _takeViewSnapshot]):
2850         (-[WKWebView _scrollToContentScrollPosition:scrollOrigin:]):
2851         (-[WKWebView _scrollByContentOffset:]):
2852         (-[WKWebView _zoomToFocusRect:selectionRect:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
2853         * UIProcess/ios/WKContentView.mm:
2854         (-[WKContentView _didCommitLayerTree:]):
2855         * UIProcess/ios/WKContentViewInteraction.mm:
2856         (-[WKContentView _updateTapHighlight]):
2857         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2858         (WebKit::RemoteLayerTreeDrawingAreaProxy::indicatorLocation):
2859         (WebKit::RemoteLayerTreeDrawingAreaProxy::updateDebugIndicator):
2860         * UIProcess/mac/ViewGestureControllerMac.mm:
2861         (WebKit::ViewGestureController::scaledMagnificationOrigin):
2862         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
2863         (WebKit::InjectedBundleRangeHandle::renderedImage):
2864         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2865         (WebKit::NetscapePlugin::snapshot):
2866         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2867         (WebKit::PDFPlugin::scrollToPoint):
2868         * WebProcess/WebPage/WebFrame.cpp:
2869         (WebKit::WebFrame::createSelectionSnapshot):
2870         * WebProcess/WebPage/WebPage.cpp:
2871         (WebKit::WebPage::scalePageInViewCoordinates):
2872         (WebKit::WebPage::scaleView):
2873         (WebKit::WebPage::snapshotAtSize):
2874         (WebKit::WebPage::snapshotNode):
2875         (WebKit::WebPage::drawRectToImage):
2876         * WebProcess/WebPage/ios/WebPageIOS.mm:
2877         (WebKit::WebPage::restorePageState):
2878
2879 2016-11-03  Chris Dumez  <cdumez@apple.com>
2880
2881         [WK2][Cocoa] Implement user interface for HTML form validation
2882         https://bugs.webkit.org/show_bug.cgi?id=164143
2883         <rdar://problem/28944652>
2884
2885         Reviewed by Simon Fraser.
2886
2887         Implement the ValidationMessageClient in WebKit2 and have it display
2888         a ValidationBubble on Cocoa. ValidationBubble is implemented using
2889         native popovers on both Mac and iOS. As a result, Mac and iOS WK2
2890         now use native popover for HTML form validation instead of the old
2891         Shadow DOM based UI in WebCore.
2892
2893         The native popover shows at the bottom (or top) of the input and it
2894         disapears as soon as the user starts typing or interacts with the
2895         view (e.g. tap / scroll / zoom).
2896
2897         The feature is still disabled at runtime.
2898
2899         * UIProcess/API/Cocoa/WKWebView.mm:
2900         (-[WKWebView _initializeWithConfiguration:]):
2901         (-[WKWebView _keyboardWillShow:]):
2902         (-[WKWebView _keyboardDidShow:]):
2903         (-[WKWebView _contentsOfUserInterfaceItem:]):
2904         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2905         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
2906         * UIProcess/PageClient.h:
2907         * UIProcess/WebPageProxy.cpp:
2908         (WebKit::WebPageProxy::handleWheelEvent):
2909         (WebKit::WebPageProxy::setPageZoomFactor):
2910         (WebKit::WebPageProxy::setPageAndTextZoomFactors):
2911         (WebKit::WebPageProxy::pageDidScroll):
2912         (WebKit::WebPageProxy::resetState):
2913         (WebKit::WebPageProxy::hideValidationMessage):
2914         * UIProcess/WebPageProxy.h:
2915         (WebKit::WebPageProxy::validationBubble):
2916         (WebKit::WebPageProxy::setIsKeyboardAnimatingIn):
2917         * UIProcess/WebPageProxy.messages.in:
2918         * UIProcess/ios/PageClientImplIOS.h:
2919         * UIProcess/ios/PageClientImplIOS.mm:
2920         (WebKit::PageClientImpl::createValidationBubble):
2921         * UIProcess/ios/WKContentViewInteraction.mm:
2922         (-[WKContentView _willStartScrollingOrZooming]):
2923         (-[WKContentView scrollViewWillStartPanOrPinchGesture]):
2924         (-[WKContentView _didEndScrollingOrZooming]):
2925         * UIProcess/ios/WebPageProxyIOS.mm:
2926         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
2927         (WebKit::WebPageProxy::potentialTapAtPosition):
2928         (WebKit::WebPageProxy::showValidationMessage):
2929         (WebKit::WebPageProxy::setIsScrollingOrZooming):
2930         * UIProcess/mac/PageClientImpl.h:
2931         * UIProcess/mac/PageClientImpl.mm:
2932         (WebKit::PageClientImpl::createValidationBubble):
2933         * UIProcess/mac/WebPageProxyMac.mm:
2934         (WebKit::WebPageProxy::showValidationMessage):
2935         * WebKit2.xcodeproj/project.pbxproj:
2936         * WebProcess/WebCoreSupport/WebValidationMessageClient.cpp: Copied from Tools/DumpRenderTree/mac/UIScriptControllerMac.mm.
2937         (WebKit::WebValidationMessageClient::WebValidationMessageClient):
2938         (WebKit::WebValidationMessageClient::~WebValidationMessageClient):
2939         (WebKit::WebValidationMessageClient::showValidationMessage):
2940         (WebKit::WebValidationMessageClient::hideValidationMessage):
2941         (WebKit::WebValidationMessageClient::isValidationMessageVisible):
2942         * WebProcess/WebCoreSupport/WebValidationMessageClient.h: Copied from Tools/DumpRenderTree/mac/UIScriptControllerMac.mm.
2943         * WebProcess/WebPage/WebPage.cpp:
2944         (WebKit::m_userInterfaceLayoutDirection):
2945
2946 2016-11-03  Tim Horton  <timothy_horton@apple.com>
2947
2948         Printing to PDF should produce internal links when HTML has internal links
2949         https://bugs.webkit.org/show_bug.cgi?id=112081
2950         <rdar://problem/5955705>
2951
2952         Reviewed by Simon Fraser.
2953
2954         * UIProcess/mac/WKPrintingView.h:
2955         * UIProcess/mac/WKPrintingView.mm:
2956         (linkDestinationName):
2957         (-[WKPrintingView _drawPDFDocument:page:atPoint:]):
2958         Propagate link-to-destination annotations (and each page's destinations)
2959         into the printed PDF.
2960         Generate a unique destination name based on the page and position, because
2961         we have lost the fragment name information.
2962
2963         (-[WKPrintingView drawRect:]):
2964         Compute all of the destinations for every page, so that we can add them
2965         to the context as we paint the pages (we need the page CTM in order to add them).
2966
2967 2016-11-03  Alex Christensen  <achristensen@webkit.org>
2968
2969         Unreviewed, rolling out r208298.
2970         https://bugs.webkit.org/show_bug.cgi?id=163939
2971
2972         caused asan crashes
2973
2974         Reverted changeset:
2975
2976         "NetworkSession: Add NetworkDataTask implementation for blobs"
2977         https://bugs.webkit.org/show_bug.cgi?id=163939
2978         http://trac.webkit.org/changeset/208298
2979
2980 2016-11-03  Ryan Haddad  <ryanhaddad@apple.com>
2981
2982         Unreviewed, rolling out r208330.
2983
2984         This change appears to have caused two editing tests to fail
2985         on macOS.
2986
2987         Reverted changeset:
2988
2989         "Reduce PassRefPtr use in WebKit2"
2990         https://bugs.webkit.org/show_bug.cgi?id=164360
2991         http://trac.webkit.org/changeset/208330
2992
2993 2016-11-03  Dan Bernstein  <mitz@apple.com>
2994
2995         WKWebView’s _observedRenderingProgressEvents not restored after web process crash
2996         https://bugs.webkit.org/show_bug.cgi?id=164368
2997         <rdar://problem/29091954>
2998
2999         Reviewed by Anders Carlsson.
3000
3001         Test: TestWebKitAPI/Tests/WebKit2Cocoa/ObservedRenderingProgressEventsAfterCrash.mm.
3002
3003         * Shared/WebPageCreationParameters.cpp:
3004         (WebKit::WebPageCreationParameters::encode): Encode new observedLayoutMilestones member.
3005         (WebKit::WebPageCreationParameters::decode): Decode it.
3006         * Shared/WebPageCreationParameters.h: Declared new observedLayoutMilestones member variable.
3007
3008         * UIProcess/WebPageProxy.cpp:
3009         (WebKit::WebPageProxy::WebPageProxy): Removed initializer for
3010           m_wantsSessionRestorationRenderTreeSizeThresholdEvent.
3011         (WebKit::WebPageProxy::listenForLayoutMilestones): Update new m_observedLayoutMilestones
3012           member variable. Don’t update m_wantsSessionRestorationRenderTreeSizeThresholdEvent.
3013         (WebKit::WebPageProxy::creationParameters): Set the observedLayoutMilestones member in the
3014           creation parameters.
3015
3016         * UIProcess/WebPageProxy.h: Declared new member variable, deleted
3017           m_wantsSessionRestorationRenderTreeSizeThresholdEvent declaration.
3018
3019         * UIProcess/ios/WebPageProxyIOS.mm:
3020         (WebKit::WebPageProxy::didCommitLayerTree): Rather than using
3021           m_wantsSessionRestorationRenderTreeSizeThresholdEvent, use m_observedLayoutMilestones.
3022
3023         * WebProcess/WebPage/WebPage.cpp:
3024         (WebKit::WebPage::WebPage): Add the observed layout milestones from the creation parameters.
3025
3026 2016-11-02  Alex Christensen  <achristensen@webkit.org>
3027
3028         Reduce PassRefPtr use in WebKit2
3029         https://bugs.webkit.org/show_bug.cgi?id=164360
3030
3031         Reviewed by Tim Horton.
3032
3033         * Shared/API/APISecurityOrigin.h:
3034         (API::SecurityOrigin::SecurityOrigin):
3035         * Shared/API/APISerializedScriptValue.h:
3036         (API::SerializedScriptValue::create):
3037         (API::SerializedScriptValue::SerializedScriptValue):
3038         * Shared/API/c/WKSharedAPICast.h:
3039         (WebKit::ProxyingRefPtr::ProxyingRefPtr):
3040         (WebKit::toAPI):
3041         * Shared/APIWebArchive.h:
3042         * Shared/APIWebArchive.mm:
3043         (API::WebArchive::create):
3044         (API::WebArchive::WebArchive):
3045         * UIProcess/API/APIHitTestResult.cpp:
3046         (API::HitTestResult::create):
3047         * UIProcess/API/APIHitTestResult.h:
3048         * UIProcess/API/APIUIClient.h:
3049         (API::UIClient::createNewPage):
3050         * UIProcess/API/C/WKPage.cpp:
3051         (WebKit::RunBeforeUnloadConfirmPanelResultListener::create):
3052         (WebKit::RunBeforeUnloadConfirmPanelResultListener::RunBeforeUnloadConfirmPanelResultListener):
3053         (WebKit::RunJavaScriptAlertResultListener::create):
3054         (WebKit::RunJavaScriptAlertResultListener::RunJavaScriptAlertResultListener):
3055         (WebKit::RunJavaScriptConfirmResultListener::create):
3056         (WebKit::RunJavaScriptConfirmResultListener::RunJavaScriptConfirmResultListener):
3057         (WebKit::RunJavaScriptPromptResultListener::create):
3058         (WebKit::RunJavaScriptPromptResultListener::RunJavaScriptPromptResultListener):
3059         (WKPageSetPageUIClient):
3060         * UIProcess/API/Cocoa/WKWebView.mm:
3061         (-[WKWebView _takeViewSnapshot]):
3062         * UIProcess/API/Cocoa/WKWebViewInternal.h:
3063         * UIProcess/Cocoa/UIDelegate.h:
3064         * UIProcess/Cocoa/UIDelegate.mm:
3065         (WebKit::UIDelegate::UIClient::createNewPage):
3066         * UIProcess/ios/WKGeolocationProviderIOS.mm:
3067         (-[WKWebAllowDenyPolicyListener initWithPermissionRequestProxy:]):
3068         * UIProcess/mac/WKImmediateActionController.mm:
3069         (-[WKImmediateActionController _webHitTestResult]):
3070         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
3071         (contextMenuItems):
3072         (WKBundlePageCopyContextMenuItems):
3073         (WKBundlePageCopyContextMenuAtPointInWindow):
3074         * WebProcess/UserContent/WebUserContentController.cpp:
3075         (WebKit::WebUserMessageHandlerDescriptorProxy::create):
3076         * WebProcess/WebPage/WebUndoStep.cpp:
3077         (WebKit::WebUndoStep::create):
3078         * WebProcess/WebPage/WebUndoStep.h:
3079         (WebKit::WebUndoStep::WebUndoStep):
3080
3081 2016-11-01  Gavin Barraclough  <barraclough@apple.com>
3082
3083         Remove PageThrottler & all related code
3084         https://bugs.webkit.org/show_bug.cgi?id=164302
3085
3086         Reviewed by Ryosuke Niwa.
3087
3088         All relevant information now available from the ActivityState.
3089
3090         * PluginProcess/PluginProcess.cpp:
3091         (WebKit::PluginProcess::PluginProcess):
3092         (WebKit::PluginProcess::createWebProcessConnection):
3093         (WebKit::PluginProcess::audioHardwareDidBecomeActive): Deleted.
3094         (WebKit::PluginProcess::audioHardwareDidBecomeInactive): Deleted.
3095         * PluginProcess/PluginProcess.h:
3096         (): Deleted.
3097         * PluginProcess/WebProcessConnection.cpp:
3098         (WebKit::WebProcessConnection::audioHardwareDidBecomeActive): Deleted.
3099         (WebKit::WebProcessConnection::audioHardwareDidBecomeInactive): Deleted.
3100         * PluginProcess/WebProcessConnection.h:
3101         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
3102         (WebKit::NPRuntimeObjectMap::evaluate):
3103         * WebProcess/Plugins/Plugin.h:
3104         (WebKit::Plugin::audioHardwareActivity): Deleted.
3105         * WebProcess/Plugins/PluginProcessConnection.cpp:
3106         (WebKit::PluginProcessConnection::PluginProcessConnection):
3107         (WebKit::PluginProcessConnection::didReceiveMessage):
3108         (WebKit::PluginProcessConnection::audioHardwareDidBecomeActive): Deleted.
3109         (WebKit::PluginProcessConnection::audioHardwareDidBecomeInactive): Deleted.
3110         * WebProcess/Plugins/PluginProcessConnection.h:
3111         (WebKit::PluginProcessConnection::supportsAsynchronousPluginInitialization):
3112         (WebKit::PluginProcessConnection::audioHardwareActivity): Deleted.
3113         * WebProcess/Plugins/PluginProcessConnection.messages.in:
3114         * WebProcess/Plugins/PluginProxy.cpp:
3115         (WebKit::PluginProxy::audioHardwareActivity): Deleted.
3116         * WebProcess/Plugins/PluginProxy.h:
3117         * WebProcess/Plugins/PluginView.cpp:
3118         (WebKit::PluginView::audioHardwareActivity): Deleted.
3119         * WebProcess/Plugins/PluginView.h:
3120         * WebProcess/WebPage/WebPage.cpp:
3121
3122 2016-11-03  Dan Bernstein  <mitz@apple.com>
3123
3124         REGRESSION (r206247): Painting milestones can be delayed until the next layer flush
3125         https://bugs.webkit.org/show_bug.cgi?id=164340
3126         <rdar://problem/29074344>
3127
3128         Reviewed by Tim Horton.
3129
3130         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: Declared new helper function.
3131         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3132         (WebKit::TiledCoreAnimationDrawingArea::sendPendingNewlyReachedLayoutMilestones): Helper
3133           function that sends the message to the UI process and resets
3134           m_pendingNewlyReachedLayoutMilestones.
3135         (WebKit::TiledCoreAnimationDrawingArea::flushLayers): Wait until after the commit to get the
3136           pending milestones and send them to the UI process. This way we don’t miss milestones that
3137           fire during the commit.
3138
3139 2016-11-02  David Kilzer  <ddkilzer@apple.com>
3140
3141         Bug 164333: Add logging for "WebKit encountered an internal error" messages due to Network process crashes
3142         <https://webkit.org/b/164333>
3143         <rdar://problem/29072727>
3144
3145         Reviewed by Alex Christensen.
3146
3147         * WebProcess/WebProcess.cpp:
3148         (WebKit::WebProcess::logDiagnosticMessageForNetworkProcessCrash):
3149         Add private method to log diagnostic message.
3150         (WebKit::WebProcess::networkProcessConnectionClosed):
3151         Call logDiagnosticMessageForNetworkProcessCrash().
3152         * WebProcess/WebProcess.h:
3153         (WebKit::WebProcess::logDiagnosticMessageForNetworkProcessCrash):
3154         Declare new method.
3155
3156 2016-11-02  Alex Christensen  <achristensen@webkit.org>
3157
3158         Remove Battery Status API from the tree
3159         https://bugs.webkit.org/show_bug.cgi?id=164213
3160
3161         Reviewed by Sam Weinig.
3162
3163         * CMakeLists.txt:
3164         * PlatformEfl.cmake:
3165         * Shared/API/APIObject.h:
3166         * Shared/API/c/WKBase.h:
3167         * Shared/WebBatteryStatus.cpp: Removed.
3168         * Shared/WebBatteryStatus.h: Removed.
3169         * UIProcess/API/C/WKAPICast.h:
3170         * UIProcess/API/C/WKBatteryManager.cpp: Removed.
3171         * UIProcess/API/C/WKBatteryManager.h: Removed.
3172         * UIProcess/API/C/WKBatteryStatus.cpp: Removed.
3173         * UIProcess/API/C/WKBatteryStatus.h: Removed.
3174         * UIProcess/API/C/WKContext.cpp:
3175         (WKContextGetBatteryManager): Deleted.
3176         * UIProcess/API/C/WKContext.h:
3177         * UIProcess/API/efl/ewk_context.cpp:
3178         (EwkContext::EwkContext):
3179         * UIProcess/API/efl/ewk_context_private.h:
3180         * UIProcess/API/efl/ewk_main.cpp:
3181         (WebKit::EwkMain::initialize):
3182         (WebKit::EwkMain::finalize):
3183         (WebKit::EwkMain::shutdownInitializedEFLModules):
3184         * UIProcess/API/gtk/WebKitBatteryProvider.cpp: Removed.
3185         * UIProcess/API/gtk/WebKitBatteryProvider.h: Removed.
3186         * UIProcess/API/gtk/WebKitWebContext.cpp:
3187         (webkitWebContextConstructed):
3188         * UIProcess/WebBatteryManagerProxy.cpp: Removed.
3189         * UIProcess/WebBatteryManagerProxy.h: Removed.
3190         * UIProcess/WebBatteryManagerProxy.messages.in: Removed.
3191         * UIProcess/WebBatteryProvider.cpp: Removed.
3192         * UIProcess/WebBatteryProvider.h: Removed.
3193         * UIProcess/WebProcessPool.cpp:
3194         (WebKit::m_hiddenPageThrottlingTimer):
3195         * UIProcess/efl/BatteryProvider.cpp: Removed.
3196         * UIProcess/efl/BatteryProvider.h: Removed.
3197         * WebProcess/Battery: Removed.
3198         * WebProcess/Battery/WebBatteryManager.cpp: Removed.
3199         * WebProcess/Battery/WebBatteryManager.h: Removed.
3200         * WebProcess/Battery/WebBatteryManager.messages.in: Removed.
3201         * WebProcess/WebCoreSupport/WebBatteryClient.cpp: Removed.
3202         * WebProcess/WebCoreSupport/WebBatteryClient.h: Removed.
3203         * WebProcess/WebPage/WebPage.cpp:
3204         (WebKit::m_userInterfaceLayoutDirection):
3205         * WebProcess/WebProcess.cpp:
3206         (WebKit::m_resourceLoadStatisticsStorage):
3207
3208 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
3209
3210         NetworkSession: Add NetworkDataTask implementation for blobs
3211         https://bugs.webkit.org/show_bug.cgi?id=163939
3212
3213         Reviewed by Alex Christensen.
3214
3215         Add NetworkDataTaskBlob to handle blobs when using NetworkSession instead of using ResourceHandle. This patch
3216         adds more USE(NETWORK_SESSION) ifdefs to not use ResourceHandle in Downloads and NetworkLoad when NetworkSession
3217         is enabled.
3218
3219         * CMakeLists.txt: Add new files to compilation.
3220         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
3221         * NetworkProcess/Downloads/BlobDownloadClient.h:
3222         * NetworkProcess/Downloads/Download.cpp:
3223         (WebKit::Download::Download): Split the constructor again and remove the PlatformDownloadTaskRef
3224         definitions. Now Cocoa specific constructor receives a NSURLSessionDownloadTask and the general constructor
3225         reveices a NetworkDataTask and is used by Soup backend and blobs.
3226         (WebKit::Download::~Download):
3227         (WebKit::Download::start):
3228         (WebKit::Download::startWithHandle):
3229         (WebKit::Download::cancel):
3230         (WebKit::Download::didReceiveAuthenticationChallenge):
3231         (WebKit::Download::didReceiveData):
3232         (WebKit::Download::didFinish):
3233         (WebKit::Download::platformCancelNetworkLoad): Rename cancelNetworkLoad() as platformCancelNetworkLoad() since
3234         this is now used only by Cocoa platform to cancel the NSURLSessionDownloadTask.
3235         * NetworkProcess/Downloads/Download.h:
3236         (WebKit::Download::Download):
3237         (WebKit::Download::suggestedName):
3238         (WebKit::Download::request):
3239         * NetworkProcess/Downloads/DownloadManager.cpp:
3240         (WebKit::DownloadManager::startDownload): Remove blobs specific code when using NetworkSession.
3241         (WebKit::DownloadManager::continueDecidePendingDownloadDestination):
3242         * NetworkProcess/Downloads/DownloadManager.h:
3243         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
3244         (WebKit::Download::platformCancelNetworkLoad):
3245         * NetworkProcess/Downloads/soup/DownloadSoup.cpp: Removed.
3246         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3247         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload): Remove blobs specific code when
3248         using NetworkSession.
3249         * NetworkProcess/NetworkDataTask.cpp:
3250         (WebKit::NetworkDataTask::create): If request is a blob, create a NetworkDataTaskBlob.
3251         * NetworkProcess/NetworkDataTask.h: Add invalidateAndCancel pure virtual method.
3252         * NetworkProcess/NetworkDataTaskBlob.cpp: Added.
3253         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
3254         (WebKit::NetworkDataTaskBlob::~NetworkDataTaskBlob):
3255         (WebKit::NetworkDataTaskBlob::clearStream):
3256         (WebKit::NetworkDataTaskBlob::resume):
3257         (WebKit::NetworkDataTaskBlob::suspend):
3258         (WebKit::NetworkDataTaskBlob::cancel):
3259         (WebKit::NetworkDataTaskBlob::invalidateAndCancel):
3260         (WebKit::NetworkDataTaskBlob::getSizeForNext):
3261         (WebKit::NetworkDataTaskBlob::didGetSize):
3262         (WebKit::NetworkDataTaskBlob::seek):
3263         (WebKit::NetworkDataTaskBlob::didReceiveResponse):
3264         (WebKit::NetworkDataTaskBlob::read):
3265         (WebKit::NetworkDataTaskBlob::readData):
3266         (WebKit::NetworkDataTaskBlob::readFile):
3267         (WebKit::NetworkDataTaskBlob::didOpen):
3268         (WebKit::NetworkDataTaskBlob::didRead):
3269         (WebKit::NetworkDataTaskBlob::consumeData):
3270         (WebKit::NetworkDataTaskBlob::setPendingDownloadLocation):
3271         (WebKit::NetworkDataTaskBlob::suggestedFilename):
3272         (WebKit::NetworkDataTaskBlob::download):
3273         (WebKit::NetworkDataTaskBlob::writeDownload):
3274         (WebKit::NetworkDataTaskBlob::cleanDownloadFiles):
3275         (WebKit::NetworkDataTaskBlob::didFailDownload):
3276         (WebKit::NetworkDataTaskBlob::didFinishDownload):
3277         (WebKit::NetworkDataTaskBlob::didFail):
3278         (WebKit::NetworkDataTaskBlob::didFinish):
3279         * NetworkProcess/NetworkDataTaskBlob.h: Added.
3280         * NetworkProcess/NetworkLoad.cpp:
3281         (WebKit::NetworkLoad::NetworkLoad): Remove blobs specific code when using NetworkSession.
3282         (WebKit::NetworkLoad::~NetworkLoad):
3283         (WebKit::NetworkLoad::setDefersLoading):
3284         (WebKit::NetworkLoad::cancel):
3285         (WebKit::NetworkLoad::continueWillSendRequest):
3286         (WebKit::NetworkLoad::continueDidReceiveResponse):
3287         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
3288         (WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync):
3289         * NetworkProcess/NetworkLoad.h:
3290         * NetworkProcess/NetworkSession.cpp:
3291         (WebKit::NetworkSession::invalidateAndCancel): Moved from NetworkSessionSoup, since this is now used also by blobs.
3292         * NetworkProcess/NetworkSession.h:
3293         (WebKit::NetworkSession::registerNetworkDataTask): Ditto.
3294         (WebKit::NetworkSession::unregisterNetworkDataTask): Ditto.
3295         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: Add invalidateAndCancel() implementation that does nothing
3296         because in Cocoa all tasks are invalidated and canceled by the network session.
3297         * NetworkProcess/mac/NetworkLoadMac.mm:
3298         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
3299         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
3300         (WebKit::NetworkDataTaskSoup::~NetworkDataTaskSoup):
3301         (WebKit::NetworkDataTaskSoup::download):
3302         * NetworkProcess/soup/NetworkDataTaskSoup.h:
3303         * NetworkProcess/soup/NetworkSessionSoup.cpp:
3304         * NetworkProcess/soup/NetworkSessionSoup.h:
3305         * PlatformEfl.cmake: Remove DownloadSoup.cpp from compilation.
3306         * PlatformGTK.cmake: Ditto.
3307         * WebKit2.xcodeproj/project.pbxproj: Add new files to compilation.
3308
3309 2016-11-02  Andy Estes  <aestes@apple.com>
3310
3311         REGRESSION (r199558): File paths selected for upload are stored using the wrong string encoding
3312         https://bugs.webkit.org/show_bug.cgi?id=164311
3313         <rdar://problem/26995374>
3314
3315         Reviewed by Tim Horton.
3316
3317         -[NSURL fileSystemRepresentation] returns a char* in file system representation, which on
3318         iOS is UTF-8, but we were implicitly converting it to a String, which assumes a char* is
3319         Latin-1 encoded.
3320
3321         * UIProcess/ios/forms/WKFileUploadPanel.mm:
3322         (-[WKFileUploadPanel _chooseFiles:displayString:iconImage:]): Changed to use fromUTF8() to
3323         convert fileURL.fileSystemRepresentation to a String.
3324
3325 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
3326
3327         NetworkSession: Network process crash when converting main resource to download
3328         https://bugs.webkit.org/show_bug.cgi?id=164220
3329
3330         Reviewed by Alex Christensen.
3331
3332         Right after the main resource load is converted to a download, the web process deletes the ResourceLoader which
3333         sends the RemoveLoadIdentifier to the network process and the load is aborted. Sometimes it happens that
3334         NetworkResourceLoader::abort() is called while the NetworkLoad is still deciding the destination of the
3335         download. In such case, NetworkResourceLoader::didConvertToDownload() has already been called, but not
3336         NetworkResourceLoader::didBecomeDownload(). In NetworkResourceLoader::abort() we already handle the case of
3337         having a NetworkLoad after NetworkResourceLoader::didConvertToDownload() has been called, to avoid canceling the
3338         load in such case, however cleanup() is always called unconditionally and the NetworkLoad is deleted before
3339         NetworkResourceLoader::didBecomeDownload() is called. When the NetworkLoad is destroyed the NetworkDataTask
3340         client becomes nullptr, leaving it in a state where both the client is nullptr and the download hasn't been
3341         created yet. That's not expected to happen and when the response completion handler is called in the
3342         NetworkDataTask it tries to use either the client or the download and it crashes.
3343
3344         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3345         (WebKit::NetworkConnectionToWebProcess::removeLoadIdentifier): Update ASSERT, because abort doesn't cleanup the
3346         resource loader in case it's becoming a download.
3347         * NetworkProcess/NetworkResourceLoader.cpp:
3348         (WebKit::NetworkResourceLoader::didBecomeDownload): Call cleanup() instead of just deleting the network load.
3349         (WebKit::NetworkResourceLoader::isBecomingDownload): Helper method to check if the resource load was converted to a
3350         download, but didBecomeDownload() hasn't been called yet.
3351         (WebKit::NetworkResourceLoader::abort): If the resource load is becoming a download do not call cleanup()
3352         because it will be called by didBecomeDownload() later.
3353         * NetworkProcess/NetworkResourceLoader.h:
3354
3355 2016-11-02  David Kilzer  <ddkilzer@apple.com>
3356
3357         Add logging for "WebKit encountered an internal error" messages
3358         <https://webkit.org/b/164272>
3359         <rdar://problem/28546064>
3360
3361         Reviewed by Alex Christensen.
3362
3363         * NetworkProcess/NetworkResourceLoader.cpp:
3364         (WebKit::NetworkResourceLoader::startNetworkLoad):
3365         * WebProcess/Network/WebLoaderStrategy.cpp:
3366         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
3367         * WebProcess/Network/WebResourceLoader.cpp:
3368         (WebKit::WebResourceLoader::didReceiveResource):
3369         - Add logging for various internalError() events.
3370
3371 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
3372
3373         [GTK] BadDamage X Window System error in WebKit::AcceleratedBackingStoreX11::update when called from WebPageProxy::exitAcceleratedCompositingMode
3374         https://bugs.webkit.org/show_bug.cgi?id=164303
3375
3376         Reviewed by Michael Catanzaro.
3377
3378         This can happen if the web process exits before the UI process has cleaned up the accelerated surface. Trap
3379         BadDrawable and BadDamage X errors and ignore them, while still crashing for any other X error.
3380
3381         * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
3382         (WebKit::AcceleratedBackingStoreX11::~AcceleratedBackingStoreX11):
3383         (WebKit::AcceleratedBackingStoreX11::update):
3384
3385 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
3386
3387         [GTK] Remove FileSystem::filenameToString() and use FileSystem::stringFromFileSystemRepresentation() everywhere instead
3388         https://bugs.webkit.org/show_bug.cgi?id=164315
3389
3390         Reviewed by Michael Catanzaro.
3391
3392         * Shared/gtk/ProcessExecutablePathGtk.cpp:
3393         (WebKit::getExecutablePath):
3394         (WebKit::findWebKitProcess):
3395         * UIProcess/API/gtk/APIWebsiteDataStoreGtk.cpp:
3396         (API::WebsiteDataStore::defaultNetworkCacheDirectory):
3397         (API::WebsiteDataStore::cacheDirectoryFileSystemRepresentation):
3398         (API::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation):
3399         * UIProcess/API/gtk/WebKitWebContext.cpp:
3400         (webkitWebContextConstructed):
3401         (webkit_web_context_set_favicon_database_directory):
3402         (webkit_web_context_set_additional_plugins_directory):
3403         (webkit_web_context_set_disk_cache_directory):
3404         * UIProcess/API/gtk/WebKitWebsiteDataManager.cpp:
3405         (webkitWebsiteDataManagerGetDataStore):
3406         * UIProcess/Plugins/gtk/PluginInfoCache.cpp:
3407         (WebKit::PluginInfoCache::PluginInfoCache):
3408         * UIProcess/gtk/WebProcessPoolGtk.cpp:
3409         (WebKit::WebProcessPool::platformDefaultIconDatabasePath):
3410         * WebProcess/gtk/WebGtkExtensionManager.cpp:
3411         (WebKit::parseUserData):
3412
3413 2016-11-02  Romain Bellessort  <romain.bellessort@crf.canon.fr>
3414
3415         [Readable Streams API] Enable creation of ReadableByteStreamController
3416         https://bugs.webkit.org/show_bug.cgi?id=164014
3417
3418         Reviewed by Youenn Fablet.
3419
3420         Added flag for the byte stream part of Readable Streams API.
3421
3422         * Configurations/FeatureDefines.xcconfig:
3423
3424 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
3425
3426         PluginInfoStore::loadPluginsIfNecessary can still load plugins multiple times
3427         https://bugs.webkit.org/show_bug.cgi?id=164103
3428
3429         Reviewed by Michael Catanzaro.
3430
3431         Follow symlinks when scanning plugins to avoid duplicates.
3432
3433         * UIProcess/Plugins/gtk/PluginInfoCache.cpp: Bump the cache version to ensure duplicated plugins are removed
3434         from the cache.
3435         * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
3436         (WebKit::PluginInfoStore::pluginPathsInDirectory): Use realpath() to always return the actual file path.
3437
3438 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
3439
3440         [GTK] Plugin process crash in WebKit::NetscapePluginX11::visibilityDidChange with evince browser plugin
3441         https://bugs.webkit.org/show_bug.cgi?id=164204
3442
3443         Reviewed by Michael Catanzaro.
3444
3445         Check the platform plugin widget is embedded before trying to get its socket window.
3446
3447         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
3448         (WebKit::NetscapePluginX11::geometryDidChange):
3449         (WebKit::NetscapePluginX11::visibilityDidChange):
3450
3451 2016-11-01  Wenson Hsieh  <wenson_hsieh@apple.com>
3452
3453         Turn the Input Events runtime flag on by default
3454         https://bugs.webkit.org/show_bug.cgi?id=164297
3455
3456         Reviewed by Ryosuke Niwa.
3457
3458         * Shared/WebPreferencesDefinitions.h:
3459
3460 2016-11-01  Jaehun Lim  <ljaehun.lim@samsung.com>
3461
3462         Unreviewed, EFL build fix after r208225
3463
3464         Rename ViewState to ActivityState
3465
3466         * UIProcess/efl/WebView.cpp:
3467         (WebKit::WebView::setActive):
3468         (WebKit::WebView::setFocused):
3469         (WebKit::WebView::setVisible):
3470
3471 2016-11-01  Alex Christensen  <achristensen@webkit.org>
3472
3473         Fix CMake build.
3474
3475         * PlatformMac.cmake:
3476
3477 2016-11-01  Ryosuke Niwa  <rniwa@webkit.org>
3478
3479         Remove CUSTOM_ELEMENTS build flag
3480         https://bugs.webkit.org/show_bug.cgi?id=164267
3481
3482         Reviewed by Antti Koivisto.
3483
3484         Removed the build flag.
3485
3486         * Configurations/FeatureDefines.xcconfig:
3487         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3488         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
3489         * WebProcess/WebPage/WebPage.cpp:
3490         (WebKit::WebPage::updatePreferences):
3491
3492 2016-11-01  Eric Carlson  <eric.carlson@apple.com>
3493
3494         [MediaStream] restrict media capture secure connections
3495         https://bugs.webkit.org/show_bug.cgi?id=164234
3496         <rdar://problem/28944906>
3497
3498         Reviewed by Alex Christensen.
3499
3500         * Shared/WebPreferencesDefinitions.h:
3501    
3502         * UIProcess/API/C/WKPreferences.cpp:
3503         (WKPreferencesSetMediaCaptureRequiresSecureConnection):
3504         (WKPreferencesGetMediaCaptureRequiresSecureConnection):
3505         * UIProcess/API/C/WKPreferencesRefPrivate.h:
3506    
3507         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
3508         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Drive by
3509          fix: remove some unused parameters in a lambda call.
3510
3511         * WebProcess/WebPage/WebPage.cpp:
3512         (WebKit::WebPage::updatePreferences):
3513
3514 2016-11-01  Gavin Barraclough  <barraclough@apple.com>
3515
3516         Add IsAudible, IsLoading to ActivityState
3517         https://bugs.webkit.org/show_bug.cgi?id=164286
3518
3519         Reviewed by Geoff Garen.
3520
3521         By computing these values in the UIProcess and passing them to WebContent we can
3522         more closely unify iOS & macOS throttling, and remove the PageThrottler class.
3523
3524         * UIProcess/WebPageProxy.cpp:
3525         (WebKit::WebPageProxy::updateActivityState):
3526             - Added update for IsAudible, IsLoading flags.
3527         (WebKit::WebPageProxy::updateThrottleState):
3528             - Read IsAudible, IsLoading flags from ActivityState.
3529         (WebKit::WebPageProxy::setMuted):
3530             - call activityStateDidChange to trigger update.
3531         (WebKit::WebPageProxy::isPlayingMediaDidChange):
3532             - call activityStateDidChange to trigger update.
3533         * UIProcess/WebPageProxy.h:
3534         (WebKit::WebPageProxy::isLoadingChanged):
3535             - call activityStateDidChange to trigger update.
3536
3537 2016-10-31  Gavin Barraclough  <barraclough@apple.com>
3538
3539         Rename ViewState to ActivityState
3540         https://bugs.webkit.org/show_bug.cgi?id=164254
3541
3542         Reviewed by Andreas Kling.
3543
3544         We plan to add a couple more flags to ViewState that aren't directly related to the view
3545         itself - whether there is an ongoing page load, and whether whether there is audio playback.
3546         This will allow viewState (now activityState) to fully drive throttling decisions.
3547
3548         Renaming this bitfield accordingly.
3549
3550         * Shared/WebPageCreationParameters.cpp:
3551         (WebKit::WebPageCreationParameters::encode):
3552         (WebKit::WebPageCreationParameters::decode):
3553         * Shared/WebPageCreationParameters.h:
3554         * UIProcess/API/Cocoa/WKWebView.mm:
3555         (-[WKWebView didMoveToWindow]):
3556         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3557         (_WebKitWebViewBasePrivate::_WebKitWebViewBasePrivate):
3558         (_WebKitWebViewBasePrivate::updateActivityStateTimerFired):
3559         (webkitWebViewBaseScheduleUpdateActivityState):
3560         (toplevelWindowFocusInEvent):
3561         (toplevelWindowFocusOutEvent):
3562         (toplevelWindowStateEvent):
3563         (webkitWebViewBaseSetToplevelOnScreenWindow):
3564         (webkitWebViewBaseMap):
3565         (webkitWebViewBaseUnmap):
3566         (webkitWebViewBaseSetFocus):
3567         (webkitWebViewBaseIsInWindowActive):
3568         (webkitWebViewBaseIsFocused):
3569         (webkitWebViewBaseIsVisible):
3570         (webkitWebViewBaseIsInWindow):
3571         (_WebKitWebViewBasePrivate::updateViewStateTimerFired): Deleted.
3572         (webkitWebViewBaseScheduleUpdateViewState): Deleted.
3573         * UIProcess/Cocoa/WebViewImpl.mm:
3574         (WebKit::WebViewImpl::becomeFirstResponder):
3575         (WebKit::WebViewImpl::resignFirstResponder):
3576         (WebKit::WebViewImpl::windowDidOrderOffScreen):
3577         (WebKit::WebViewImpl::windowDidOrderOnScreen):
3578         (WebKit::WebViewImpl::windowDidBecomeKey):
3579         (WebKit::WebViewImpl::windowDidResignKey):
3580         (WebKit::WebViewImpl::windowDidMiniaturize):
3581         (WebKit::WebViewImpl::windowDidDeminiaturize):
3582         (WebKit::WebViewImpl::windowDidChangeOcclusionState):
3583         (WebKit::WebViewImpl::viewDidMoveToWindow):
3584         (WebKit::WebViewImpl::viewDidHide):
3585         (WebKit::WebViewImpl::viewDidUnhide):
3586         (WebKit::WebViewImpl::activeSpaceDidChange):
3587         (WebKit::WebViewImpl::endDeferringViewInWindowChanges):
3588         (WebKit::WebViewImpl::endDeferringViewInWindowChangesSync):
3589         (WebKit::WebViewImpl::prepareForMoveToWindow):
3590         * UIProcess/DrawingAreaProxy.h:
3591         (WebKit::DrawingAreaProxy::waitForDidUpdateActivityState):
3592         (WebKit::DrawingAreaProxy::waitForDidUpdateViewState): Deleted.
3593         * UIProcess/WebPageProxy.cpp:
3594         (WebKit::WebPageProxy::WebPageProxy):
3595         (WebKit::WebPageProxy::reattachToWebProcess):
3596         (WebKit::WebPageProxy::setSuppressVisibilityUpdates):
3597         (WebKit::WebPageProxy::updateActivityState):
3598         (WebKit::WebPageProxy::activityStateDidChange):
3599         (WebKit::WebPageProxy::dispatchActivityStateChange):
3600         (WebKit::WebPageProxy::updateThrottleState):
3601         (WebKit::WebPageProxy::waitForDidUpdateActivityState):
3602         (WebKit::WebPageProxy::creationParameters):
3603         (WebKit::WebPageProxy::installActivityStateChangeCompletionHandler):
3604         (WebKit::WebPageProxy::updateViewState): Deleted.
3605         (WebKit::WebPageProxy::viewStateDidChange): Deleted.
3606         (WebKit::WebPageProxy::dispatchViewStateChange): Deleted.
3607         (WebKit::WebPageProxy::waitForDidUpdateViewState): Deleted.
3608         (WebKit::WebPageProxy::installViewStateChangeCompletionHandler): Deleted.
3609         * UIProcess/WebPageProxy.h:
3610         (WebKit::WebPageProxy::isInWindow):
3611         (WebKit::WebPageProxy::didUpdateActivityState):
3612         (WebKit::WebPageProxy::isViewVisible):
3613         (WebKit::WebPageProxy::didUpdateViewState): Deleted.
3614         * UIProcess/WebPageProxy.messages.in:
3615         * UIProcess/WebProcessProxy.cpp:
3616         (WebKit::WebProcessProxy::windowServerConnectionStateChanged):
3617         * UIProcess/efl/WebView.cpp:
3618         * UIProcess/ios/WKContentView.mm:
3619         (-[WKContentView _applicationDidEnterBackground]):
3620         (-[WKContentView _applicationWillEnterForeground]):
3621         * UIProcess/ios/WKPDFView.mm:
3622         (-[WKPDFView _applicationDidEnterBackground]):
3623         (-[WKPDFView _applicationWillEnterForeground]):
3624         * UIProcess/ios/WebPageProxyIOS.mm:
3625         (WebKit::WebPageProxy::synchronizeDynamicViewportUpdate):
3626         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
3627         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
3628         (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
3629         (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateActivityState):
3630         (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateViewState): Deleted.
3631         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
3632         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
3633         (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState):
3634         (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateViewState): Deleted.
3635         * WebProcess/Plugins/PluginView.cpp:
3636         (WebKit::PluginView::activityStateDidChange):
3637         (WebKit::PluginView::viewStateDidChange): Deleted.
3638         * WebProcess/Plugins/PluginView.h:
3639         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
3640         (WebKit::AcceleratedDrawingArea::activityStateDidChange):
3641         (WebKit::AcceleratedDrawingArea::viewStateDidChange): Deleted.
3642         * WebProcess/WebPage/AcceleratedDrawingArea.h:
3643         * WebProcess/WebPage/DrawingArea.h:
3644         (WebKit::DrawingArea::activityStateDidChange):
3645         (WebKit::DrawingArea::viewStateDidChange): Deleted.
3646         * WebProcess/WebPage/WebPage.cpp:
3647         (WebKit::m_userInterfaceLayoutDirection):
3648         (WebKit::WebPage::reinitializeWebPage):
3649         (WebKit::WebPage::updateIsInWindow):
3650         (WebKit::WebPage::setActivityState):
3651         (WebKit::WebPage::setViewState): Deleted.
3652         * WebProcess/WebPage/WebPage.h:
3653         (WebKit::WebPage::isVisible):
3654         (WebKit::WebPage::isVisibleOrOccluded):
3655         * WebProcess/WebPage/WebPage.messages.in:
3656         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
3657         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
3658         (WebKit::RemoteLayerTreeDrawingArea::activityStateDidChange):
3659         (WebKit::RemoteLayerTreeDrawingArea::viewStateDidChange): Deleted.
3660         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
3661         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3662         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
3663         (WebKit::TiledCoreAnimationDrawingArea::activityStateDidChange):
3664         (WebKit::TiledCoreAnimationDrawingArea::didUpdateActivityStateTimerFired):
3665         (WebKit::TiledCoreAnimationDrawingArea::viewStateDidChange): Deleted.
3666         (WebKit::TiledCoreAnimationDrawingArea::didUpdateViewStateTimerFired): Deleted.
3667
3668 2016-10-31  Jaehun Lim  <ljaehun.lim@samsung.com>
3669
3670         Unreviewed, CMake build fix
3671
3672         Adds #include <WebCore/IDBGetAllRecordsData.h>
3673
3674         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
3675
3676 2016-10-31  Simon Fraser  <simon.fraser@apple.com>
3677
3678         Add basic visual/layout viewport support for fixed position layout
3679         https://bugs.webkit.org/show_bug.cgi?id=164261
3680
3681         Reviewed by Dean Jackson.
3682
3683         Don't make visualViewportEnabled an experimental feature, because I don't want it enabled
3684         by default in WebKitTestRunner (and therefore mismatching DumpRenderTree).
3685
3686         * Shared/WebPreferencesDefinitions.h:
3687
3688 2016-10-29  Filip Pizlo  <fpizlo@apple.com>
3689
3690         JSC should support SharedArrayBuffer
3691         https://bugs.webkit.org/show_bug.cgi?id=163986
3692
3693         Reviewed by Keith Miller.
3694         
3695         Adds some small things we need for SharedArrayBuffer.
3696
3697         * UIProcess/API/C/WKPreferencesRefPrivate.h:
3698         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
3699         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3700         (WebKit::InjectedBundle::createWebDataFromUint8Array):
3701
3702 2016-10-31  Brady Eidson  <beidson@apple.com>
3703
3704         IndexedDB 2.0: Support IDBObjectStore getAll/getAllKeys.
3705         <rdar://problem/28806934> and https://bugs.webkit.org/show_bug.cgi?id=164097
3706
3707         Reviewed by Darin Adler.
3708
3709         - Handle moving "Get All" requests to and from the DatabaseProcess.
3710         - Handle the additional task of creating/passing Sandbox Extensions for
3711           referenced files when necessary. 
3712           
3713         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
3714         (WebKit::WebIDBConnectionToClient::handleGetResult):
3715         (WebKit::WebIDBConnectionToClient::didGetAllRecords):
3716         (WebKit::WebIDBConnectionToClient::getAllRecords):
3717         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
3718         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
3719         
3720         * Shared/WebCoreArgumentCoders.h:
3721         
3722         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
3723         (WebKit::WebIDBConnectionToServer::getAllRecords):
3724         (WebKit::preregisterSandboxExtensionsIfNecessary):
3725         (WebKit::WebIDBConnectionToServer::didGetAllRecords):
3726         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
3727         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:
3728
3729 2016-10-31  Wenson Hsieh  <wenson_hsieh@apple.com>
3730
3731         [WK1] Candidate visibility should not update as a result of selection during a dictionary lookup
3732         https://bugs.webkit.org/show_bug.cgi?id=164236
3733         <rdar://problem/28747712>
3734
3735         Reviewed by Beth Dakin.
3736
3737         See WebCore ChangeLog for more detail. Removes m_isGettingDictionaryPopupInfo from the WebPage in favor of
3738         keeping track of the same state in Editor, so that both the WK1 and WK2 cases can share the same codepath.
3739
3740         * WebProcess/WebPage/WebPage.cpp:
3741         (WebKit::WebPage::didChangeSelection):
3742         * WebProcess/WebPage/WebPage.h:
3743         * WebProcess/WebPage/mac/WebPageMac.mm:
3744         (WebKit::WebPage::dictionaryPopupInfoForRange):
3745
3746 2016-10-31  Simon Fraser  <simon.fraser@apple.com>
3747
3748         Implement IntersectionObserver
3749         https://bugs.webkit.org/show_bug.cgi?id=159475
3750
3751         Reviewed by Ryosuke Niwa.
3752
3753         Add ENABLE_INTERSECTION_OBSERVER, enabled by default.
3754
3755         * Configurations/FeatureDefines.xcconfig:
3756
3757 2016-10-31  Ryan Haddad  <ryanhaddad@apple.com>
3758
3759         Unreviewed, rolling out r208154.
3760
3761         This change caused an assertion failure during API tests on
3762         macOS.
3763
3764         Reverted changeset:
3765
3766         "NetworkSession: Network process crash when converting main
3767         resource to download"
3768         https://bugs.webkit.org/show_bug.cgi?id=164220
3769         http://trac.webkit.org/changeset/208154
3770
3771 2016-10-28  Brent Fulgham  <bfulgham@apple.com>
3772
3773         Do a better job of protecting Frame objects in the context of JavaScript calls
3774         https://bugs.webkit.org/show_bug.cgi?id=164163
3775         <rdar://problem/28955249>
3776
3777         Reviewed by Darin Adler.
3778
3779         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
3780         (WebKit::InjectedBundleRangeHandle::renderedImage): Protected the Frame.
3781         * WebProcess/WebPage/WebPage.cpp:
3782         (WebKit::WebPage::insertTextAsync): Ditto.
3783         (WebKit::WebPage::setComposition): Ditto.
3784         * WebProcess/WebPage/mac/WebPageMac.mm:
3785         (WebKit::WebPage::insertDictatedTextAsync): Ditto.
3786
3787 2016-10-31  Carlos Garcia Campos  <cgarcia@igalia.com>
3788
3789         NetworkSession: Network process crash when converting main resource to download
3790         https://bugs.webkit.org/show_bug.cgi?id=164220
3791
3792         Reviewed by Alex Christensen.
3793
3794         Right after the main resource load is converted to a download, the web process deletes the ResourceLoader which
3795         sends the RemoveLoadIdentifier to the network process and the load is aborted. Sometimes it happens that
3796         NetworkResourceLoader::abort() is called while the NetworkLoad is still deciding the destination of the
3797         download. In such case, NetworkResourceLoader::didConvertToDownload() has already been called, but not
3798         NetworkResourceLoader::didBecomeDownload(). In NetworkResourceLoader::abort() we already handle the case of
3799         having a NetworkLoad after NetworkResourceLoader::didConvertToDownload() has been called, to avoid canceling the
3800         load in such case, however cleanup() is always called unconditionally and the NetworkLoad is deleted before
3801         NetworkResourceLoader::didBecomeDownload() is called. When the NetworkLoad is destroyed the NetworkDataTask
3802         client becomes nullptr, leaving it in a state where both the client is nullptr and the download hasn't been
3803         created yet. That's not expected to happen and when the response completion handler is called in the
3804         NetworkDataTask it tries to use either the client or the download and it crashes.
3805
3806         * NetworkProcess/NetworkResourceLoader.cpp:
3807         (WebKit::NetworkResourceLoader::didBecomeDownload): Call cleanup() instead of just deleting the network load.
3808         (WebKit::NetworkResourceLoader::abort): If we still have a network load that was converted to a download, do not
3809         call cleanup() because it will be called by didBecomeDownload() later.
3810
3811 2016-10-31  Darin Adler  <darin@apple.com>
3812
3813         Move ChildNode and ParentNode from ExceptionCode to Exception, add support for ExceptionOr<T&>
3814         https://bugs.webkit.org/show_bug.cgi?id=164214
3815
3816         Reviewed by Alex Christensen.
3817
3818         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
3819         (webkit_dom_document_query_selector): Updated exception handling.
3820         (webkit_dom_document_query_selector_all): Ditto.
3821         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp:
3822         (webkit_dom_document_fragment_query_selector): Ditto.
3823         (webkit_dom_document_fragment_query_selector_all): Ditto.
3824         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
3825         (webkit_dom_element_query_selector): Ditto.
3826         (webkit_dom_element_query_selector_all): Ditto.
3827
3828 2016-10-31  Darin Adler  <darin@apple.com>
3829
3830         Convert Document from ExceptionCode to Exception
3831         https://bugs.webkit.org/show_bug.cgi?id=164212
3832
3833         Reviewed by Alex Christensen.
3834
3835         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
3836         (webkit_dom_document_create_element): Updated exception handling.
3837         (webkit_dom_document_create_cdata_section): Ditto.
3838         (webkit_dom_document_create_processing_instruction): Ditto.
3839         (webkit_dom_document_create_attribute): Ditto.
3840         (webkit_dom_document_import_node): Ditto.
3841         (webkit_dom_document_create_element_ns): Ditto.
3842         (webkit_dom_document_create_attribute_ns): Ditto.
3843         (webkit_dom_document_adopt_node): Ditto.
3844         (webkit_dom_document_create_event): Ditto.
3845         (webkit_dom_document_set_xml_version): Ditto.
3846         (webkit_dom_document_get_cookie): Ditto.
3847         (webkit_dom_document_set_cookie): Ditto.
3848         (webkit_dom_document_set_body): Ditto.
3849         * WebProcess/InjectedBundle/API/mac/WKDOMDocument.mm:
3850         (-[WKDOMDocument createElement:]): Ditto.
3851
3852 2016-10-31  Wenson Hsieh  <wenson_hsieh@apple.com>
3853
3854         Holding down a key to choose an accented character should fire "insertReplacementText" input events
3855         https://bugs.webkit.org/show_bug.cgi?id=164209
3856         <rdar://problem/29019305>
3857
3858         Reviewed by Darin Adler.
3859
3860         When replacing text, call Editor::insertText with the correct TextEventInputType so that WebCore will know to
3861         use EditActionInsertReplacement when creating and applying the corresponding TypingCommand. Additional minor
3862         changes in order to support testing replacement text insertion.
3863
3864         * UIProcess/API/Cocoa/WKWebView.mm:
3865         (-[WKWebView _insertText:replacementRange:]):
3866         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3867         * WebProcess/WebPage/WebPage.cpp:
3868         (WebKit::WebPage::insertTextAsync):
3869
3870 2016-10-30  Darin Adler  <darin@apple.com>
3871
3872         Move Element, NamedNodeMap, and DOMStringMap from ExceptionCode to Exception
3873         https://bugs.webkit.org/show_bug.cgi?id=164206
3874
3875         Reviewed by Chris Dumez.
3876
3877         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.cpp:
3878         (webkit_dom_named_node_map_set_named_item): Updated exception handling.
3879         (webkit_dom_named_node_map_remove_named_item): Ditto.
3880         (webkit_dom_named_node_map_set_named_item_ns): Ditto.
3881         (webkit_dom_named_node_map_remove_named_item_ns): Ditto.
3882         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
3883         (webkit_dom_element_set_attribute): Ditto.
3884         (webkit_dom_element_set_attribute_node): Ditto.
3885         (webkit_dom_element_remove_attribute_node): Ditto.
3886         (webkit_dom_element_set_attribute_ns): Ditto.
3887         (webkit_dom_element_set_attribute_node_ns): Ditto.
3888         (webkit_dom_element_matches): Ditto.
3889         (webkit_dom_element_closest): Ditto.
3890         (webkit_dom_element_webkit_matches_selector): Ditto.
3891         (webkit_dom_element_insert_adjacent_element): Ditto.
3892         (webkit_dom_element_insert_adjacent_html): Ditto.
3893         (webkit_dom_element_insert_adjacent_text): Ditto.
3894         (webkit_dom_element_set_inner_html): Ditto.
3895         (webkit_dom_element_set_outer_html): Ditto.
3896         * WebProcess/InjectedBundle/API/mac/WKDOMElement.mm:
3897         (-[WKDOMElement setAttribute:value:]): Ditto.
3898
3899 2016-10-30  Yusuke Suzuki  <utatane.tea@gmail.com>
3900
3901         [DOM] Introduce WebCore::jsDynamicDowncast
3902         https://bugs.webkit.org/show_bug.cgi?id=164137
3903
3904         Reviewed by Darin Adler.
3905
3906         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
3907         (WebKit::WebAutomationSessionProxy::elementForNodeHandle):
3908
3909 2016-10-29  Darin Adler  <darin@apple.com>
3910
3911         Convert more of DOM from ExceptionCode to Exception
3912         https://bugs.webkit.org/show_bug.cgi?id=164173
3913
3914         Reviewed by Ryosuke Niwa.
3915
3916         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp:
3917         (webkit_dom_character_data_substring_data): Updated since this
3918         now uses ExceptionOr.
3919         (webkit_dom_character_data_insert_data): Ditto.
3920         (webkit_dom_character_data_delete_data): Ditto.
3921         (webkit_dom_character_data_replace_data): Ditto.
3922         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp:
3923         (webkit_dom_text_replace_whole_text): Ditto.
3924         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp:
3925         (webkit_dom_text_split_text): Ditto.
3926
3927 2016-10-28  Darin Adler  <darin@apple.com>
3928
3929         Move all classes in the HTML directory from ExceptionCode to Exception
3930         https://bugs.webkit.org/show_bug.cgi?id=163876
3931
3932         Reviewed by Sam Weinig.
3933
3934         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.cpp:
3935         (webkit_dom_dom_token_list_add): Updated exception handling.
3936         (webkit_dom_dom_token_list_remove): Ditto.
3937         (webkit_dom_dom_token_list_toggle): Ditto.
3938         (webkit_dom_dom_token_list_replace): Ditto.
3939         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
3940         (webkit_dom_element_remove): Ditto.
3941         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp:
3942         (webkit_dom_html_element_set_inner_text): Ditto.
3943         (webkit_dom_html_element_set_outer_text): Ditto.
3944         (webkit_dom_html_element_set_content_editable): Ditto.
3945         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
3946         (webkit_dom_html_input_element_set_max_length): Ditto.
3947         (webkit_dom_html_input_element_set_size): Ditto.
3948         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
3949         (webkit_dom_html_select_element_set_length): Ditto.
3950         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.cpp:
3951         (webkit_dom_html_table_element_insert_row): Ditto.
3952         (webkit_dom_html_table_element_delete_row): Ditto.
3953         (webkit_dom_html_table_element_set_caption): Ditto.
3954         (webkit_dom_html_table_element_set_t_head): Ditto.
3955         (webkit_dom_html_table_element_set_t_foot): Ditto.
3956         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.cpp:
3957         (webkit_dom_html_table_row_element_insert_cell): Ditto.
3958         (webkit_dom_html_table_row_element_delete_cell): Ditto.
3959         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.cpp:
3960         (webkit_dom_html_table_section_element_insert_row): Ditto.
3961         (webkit_dom_html_table_section_element_delete_row): Ditto.
3962
3963         * WebProcess/WebPage/WebPage.cpp:
3964         (WebKit::WebPage::editorState): Removed ASSERT_NO_EXCEPTION.
3965
3966         * WebProcess/WebPage/ios/WebPageIOS.mm:
3967         (WebKit::WebPage::setAssistedNodeValueAsNumber): Removed ASSERT_NO_EXCEPTION.
3968
3969         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
3970         (WebKit::WebPlaybackSessionManager::seekableRangesChanged