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