Add support for recognizing data interaction gestures in WebKit2
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2017-01-26  Wenson Hsieh  <wenson_hsieh@apple.com>
2
3         Add support for recognizing data interaction gestures in WebKit2
4         https://bugs.webkit.org/show_bug.cgi?id=167444
5
6         Reviewed by Beth Dakin.
7
8         Adds a new data interaction gesture recognizer, responsible for determining when to begin data interaction. This
9         is a new long press gesture recognizer that fires simultaneously with the existing long press gesture
10         recognizers (for performing long-press actions, and for showing the tap highlight).
11
12         Also tweaks logic for determining whether selection gesture recognizers should fire to account for data
13         interaction -- in particular, we don't want selection gesture recognizers to cause the current selection to
14         change while data interaction is possible. See -hasSelectablePositionAtPoint and -pointIsInAssistedNode for
15         more details.
16
17         * UIProcess/ios/PageClientImplIOS.mm:
18         (WebKit::PageClientImpl::didPerformDataInteractionControllerOperation):
19         (WebKit::PageClientImpl::startDataInteractionWithImage):
20         * UIProcess/ios/WKContentViewInteraction.h:
21         * UIProcess/ios/WKContentViewInteraction.mm:
22         (-[WKContentView _createAndConfigureLongPressGestureRecognizer]):
23         (-[WKContentView setupInteraction]):
24         (-[WKContentView cleanupInteraction]):
25         (-[WKContentView _removeDefaultGestureRecognizers]):
26         (-[WKContentView _addDefaultGestureRecognizers]):
27         (-[WKContentView resignFirstResponder]):
28         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
29         (-[WKContentView gestureRecognizerShouldBegin:]):
30         (-[WKContentView hasSelectablePositionAtPoint:]):
31         (-[WKContentView pointIsInDataInteractionContent:]):
32         (-[WKContentView pointIsInAssistedNode:]):
33
34 2017-01-26  Matt Rajca  <mrajca@apple.com>
35
36         Notify clients when the user plays media otherwise prevented from autoplaying
37         https://bugs.webkit.org/show_bug.cgi?id=167390
38
39         Reviewed by Alex Christensen.
40
41         * UIProcess/API/APIUIClient.h:
42         (API::UIClient::didPlayMediaPreventedFromPlayingWithoutUserGesture):
43         * UIProcess/API/C/WKPage.cpp:
44         (WKPageSetPageUIClient):
45         * UIProcess/API/C/WKPageUIClient.h:
46         * UIProcess/WebPageProxy.cpp:
47         (WebKit::WebPageProxy::didPlayMediaPreventedFromPlayingWithoutUserGesture):
48         * UIProcess/WebPageProxy.h:
49         * UIProcess/WebPageProxy.messages.in:
50         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
51         (WebKit::WebChromeClient::didPlayMediaPreventedFromPlayingWithoutUserGesture):
52         * WebProcess/WebCoreSupport/WebChromeClient.h:
53
54 2017-01-26  Anders Carlsson  <andersca@apple.com>
55
56         Don't use _CFBundleCreateUnique on Yosemite, it's not available there
57         https://bugs.webkit.org/show_bug.cgi?id=167459
58         rdar://problem/30181179
59
60         Reviewed by Beth Dakin.
61
62         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
63         (WebKit::NetscapePluginModule::getPluginInfo):
64
65 2017-01-26  Alex Christensen  <achristensen@webkit.org>
66
67         Add SPI for updating WebsitePolicies
68         https://bugs.webkit.org/show_bug.cgi?id=167040
69
70         Reviewed by Brady Eidson.
71         
72         In r209558 we added a way to send a WebsitePolicies structure to the WebProcess during navigation.
73         If the UIProcess wants to update these policies on a WKWebView while a page is open, we will
74         need to have SPI for doing so. This adds such SPI, but it's not hooked up to change functionality yet.
75
76         * UIProcess/API/C/WKPage.cpp:
77         (WKPageUpdateWebsitePolicies):
78         * UIProcess/API/C/WKPage.h:
79         * UIProcess/API/Cocoa/WKWebView.mm:
80         (-[WKWebView _updateWebsitePolicies:]):
81         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
82         * UIProcess/WebPageProxy.cpp:
83         (WebKit::WebPageProxy::updateWebsitePolicies):
84         * UIProcess/WebPageProxy.h:
85         * WebProcess/WebPage/WebPage.cpp:
86         (WebKit::WebPage::updateWebsitePolicies):
87         * WebProcess/WebPage/WebPage.h:
88         * WebProcess/WebPage/WebPage.messages.in:
89
90 2017-01-26  Carlos Garcia Campos  <cgarcia@igalia.com>
91
92         [Threaded Compositor] Update also the contents size when creating the threaded compositor
93         https://bugs.webkit.org/show_bug.cgi?id=167452
94
95         Reviewed by Žan Doberšek.
96
97         In r210954 we ensured that the threaded compositor and the viewport controller were created with the initial web
98         page size. If we don't update the contents size, the visible rectangle will be empty and tiles won't be created
99         until contentsSizeDidChange is called. It's even possible, when entering AC mode on demand, that we create the
100         layer tree host after the contents size changed, in which case nothing is rendered unless we resize the window.
101
102         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
103         (WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost):
104
105 2017-01-26  Csaba Osztrogonác  <ossy@webkit.org>
106
107         [Mac][cmake] Fix the build after r211160
108         https://bugs.webkit.org/show_bug.cgi?id=167451
109
110         Unreviewed buildfix.
111
112         * UIProcess/API/Cocoa/WKWebView.mm:
113
114 2017-01-25  Ryan Haddad  <ryanhaddad@apple.com>
115
116         Unreviewed, rolling out r211193.
117
118         This change broke internal builds.
119
120         Reverted changeset:
121
122         "Notify clients when the user plays media otherwise prevented
123         from autoplaying"
124         https://bugs.webkit.org/show_bug.cgi?id=167390
125         http://trac.webkit.org/changeset/211193
126
127 2017-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
128
129         Add infrastructure to support data interaction in WebKit2
130         https://bugs.webkit.org/show_bug.cgi?id=167443
131
132         Reviewed by Simon Fraser.
133
134         Adds plumbing for two new XPC messages: WebPageProxy::DidPerformDataInteractionControllerOperation and
135         WebPage::RequestStartDataInteraction. Additionally, adds a new field to InteractionInformationAtPosition that
136         indicates whether or not there is data to interact with at a given location.
137
138         This patch only adds infrastructure, and does not change any behavior.
139
140         * Shared/ios/InteractionInformationAtPosition.h:
141         * Shared/ios/InteractionInformationAtPosition.mm:
142         (WebKit::InteractionInformationAtPosition::encode):
143         (WebKit::InteractionInformationAtPosition::decode):
144         * UIProcess/PageClient.h:
145         * UIProcess/WebPageProxy.h:
146         * UIProcess/WebPageProxy.messages.in:
147         * UIProcess/ios/PageClientImplIOS.h:
148         * UIProcess/ios/PageClientImplIOS.mm:
149         (WebKit::PageClientImpl::didPerformDataInteractionControllerOperation):
150         (WebKit::PageClientImpl::startDataInteractionWithImage):
151         * UIProcess/ios/WebPageProxyIOS.mm:
152         (WebKit::WebPageProxy::didPerformDataInteractionControllerOperation):
153         (WebKit::requestStartDataInteraction):
154         * UIProcess/mac/PageClientImpl.h:
155         * UIProcess/mac/PageClientImpl.mm:
156         (WebKit::PageClientImpl::didPerformDataInteractionControllerOperation):
157         (WebKit::PageClientImpl::startDataInteractionWithImage):
158         * WebProcess/WebPage/WebPage.cpp:
159         * WebProcess/WebPage/WebPage.h:
160         * WebProcess/WebPage/WebPage.messages.in:
161         * WebProcess/WebPage/ios/WebPageIOS.mm:
162         (WebKit::WebPage::requestStartDataInteraction):
163         (WebKit::WebPage::getPositionInformation):
164
165 2017-01-25  Tim Horton  <timothy_horton@apple.com>
166
167         Stop inheriting from UIWebScrollView, just use UIScrollView
168         https://bugs.webkit.org/show_bug.cgi?id=167440
169         <rdar://problem/7729691>
170
171         Reviewed by Simon Fraser.
172
173         * UIProcess/API/Cocoa/WKWebView.mm:
174         (-[WKWebView scrollViewWillBeginDragging:]):
175         * UIProcess/ios/WKScrollView.h:
176         * UIProcess/ios/WKScrollView.mm:
177         (-[WKScrollView initWithFrame:]): Deleted.
178         (-[WKScrollView setDecelerationRate:]): Deleted.
179         Inherit directly from UIScrollView, no need for UIWebScrollView.
180         Set the few settings we care about directly.
181         This has the side effect of reducing the default rate of scroll deceleration.
182
183 2017-01-25  Matt Rajca  <mrajca@apple.com>
184
185         Notify clients when the user plays media otherwise prevented from autoplaying
186         https://bugs.webkit.org/show_bug.cgi?id=167390
187
188         Reviewed by Alex Christensen.
189
190         * UIProcess/API/APIUIClient.h:
191         (API::UIClient::didPlayMediaPreventedFromPlayingWithoutUserGesture):
192         * UIProcess/API/C/WKPage.cpp:
193         (WKPageSetPageUIClient):
194         * UIProcess/API/C/WKPageUIClient.h:
195         * UIProcess/WebPageProxy.cpp:
196         (WebKit::WebPageProxy::didPlayMediaPreventedFromPlayingWithoutUserGesture):
197         * UIProcess/WebPageProxy.h:
198         * UIProcess/WebPageProxy.messages.in:
199         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
200         (WebKit::WebChromeClient::didPlayMediaPreventedFromPlayingWithoutUserGesture):
201         * WebProcess/WebCoreSupport/WebChromeClient.h:
202
203 2017-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
204
205         Refactor drag and drop implementation on Mac
206         https://bugs.webkit.org/show_bug.cgi?id=167427
207
208         Reviewed by Enrica Casucci.
209
210         See WebCore ChangeLog for more details.
211
212         * Shared/WebCoreArgumentCoders.cpp:
213         (IPC::ArgumentCoder<DragData>::encode):
214         (IPC::ArgumentCoder<DragData>::decode):
215         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
216         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
217
218 2017-01-25  Andy Estes  <aestes@apple.com>
219
220         Use #pragma once in a few places
221         https://bugs.webkit.org/show_bug.cgi?id=167435
222
223         Reviewed by Alex Christensen.
224
225         * UIProcess/PageClient.h:
226         * UIProcess/ios/PageClientImplIOS.h:
227         * WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.h:
228
229 2017-01-25  Andy Estes  <aestes@apple.com>
230
231         [QuickLook] Display a WKPasswordView when a document is password-protected
232         https://bugs.webkit.org/show_bug.cgi?id=167407
233         <rdar://problem/28544527>
234
235         Reviewed by Alex Christensen.
236
237         * UIProcess/API/Cocoa/WKWebView.mm:
238         (-[WKWebView _hidePasswordView]): Added an early return if there is no _passwordView.
239         * UIProcess/PageClient.h: Declared requestPasswordForQuickLookDocument().
240         (WebKit::PageClient::didStartProvisionalLoadForMainFrame): Added an no-op base class
241         implementation.
242         (WebKit::PageClient::didFailProvisionalLoadForMainFrame): Ditto.
243         * UIProcess/WebPageProxy.cpp:
244         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame): Called
245         PageClient::didStartProvisionalLoadForMainFrame() if frame is the main frame.
246         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame): Ditto for
247         PageClient::didFailProvisionalLoadForMainFrame().
248         * UIProcess/WebPageProxy.h: Declared didRequestPasswordForQuickLookDocumentInMainFrame().
249         * UIProcess/WebPageProxy.messages.in: Added message
250         DidRequestPasswordForQuickLookDocumentInMainFrame.
251         * UIProcess/ios/PageClientImplIOS.h: Overrode requestPasswordForQuickLookDocument(),
252         didStartProvisionalLoadForMainFrame(), and didFailProvisionalLoadForMainFrame().
253         * UIProcess/ios/PageClientImplIOS.mm:
254         (WebKit::PageClientImpl::didStartProvisionalLoadForMainFrame): Called
255         -[WKWebView _hidePasswordView].
256         (WebKit::PageClientImpl::didFailProvisionalLoadForMainFrame): Ditto.
257         (WebKit::PageClientImpl::didCommitLoadForMainFrame): Ditto.
258         (WebKit::PageClientImpl::requestPasswordForQuickLookDocument): If there is already a
259         password view, assert that it is for the same fileName. Call
260         -[WKPasswordView showPasswordFailureAlert] and update the userDidEnterPassword block.
261         Otherwise, call -[WKWebView _showPasswordViewWithDocumentName:passwordHandler:].
262         * UIProcess/ios/WebPageProxyIOS.mm:
263         (WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame): Called
264         PageClient::requestPasswordForQuickLookDocument() with a completion handler that send
265         message WebPage::DidReceivePasswordForQuickLookDocument.
266         * WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.cpp:
267         (WebKit::passwordCallbacks): Stores a map of page IDs to completion handler functions.
268         (WebKit::WebQuickLookHandleClient::~WebQuickLookHandleClient): Removes the current page ID
269         from passwordCallbacks().
270         (WebKit::WebQuickLookHandleClient::didRequestPassword): Asserts there is no current function
271         for this page ID in passwordCallbacks(), adds completionHandler to passwordCallbacks(), and
272         sends message WebPageProxy::DidRequestPasswordForQuickLookDocumentInMainFrame.
273         (WebKit::WebQuickLookHandleClient::didReceivePassword): Asserts there is a function for this
274         page ID in passwordCallbacks(), takes the completionHandler from passwordCallbacks(), and
275         calls it with the received password.
276         * WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.h: Declared didReceivePassword()
277         and overrode supportsPasswordEntry() and didRequestPassword().
278         * WebProcess/WebPage/WebPage.h: Declared didReceivePasswordForQuickLookDocument().
279         * WebProcess/WebPage/WebPage.messages.in: Added message
280         DidReceivePasswordForQuickLookDocument.
281         * WebProcess/WebPage/ios/WebPageIOS.mm:
282         (WebKit::WebPage::didReceivePasswordForQuickLookDocument): Called
283         WebQuickLookHandleClient::didReceivePassword() with the received password and current page ID.
284
285 2017-01-25  Youenn Fablet  <youennf@gmail.com>
286
287         [WebRTC] Introduce libwebrtc abstraction for WK1/WK2 implementations
288         https://bugs.webkit.org/show_bug.cgi?id=167294
289
290         Reviewed by Alex Christensen.
291
292         * WebProcess/WebPage/WebPage.cpp:
293         (WebKit::m_userInterfaceLayoutDirection):
294
295 2017-01-25  Andy Estes  <aestes@apple.com>
296
297         [iOS] Move WKPDFView's password view to WKWebView
298         https://bugs.webkit.org/show_bug.cgi?id=167401
299
300         Reviewed by Tim Horton.
301
302         r210943 moved the PDF password view into the new class WKPasswordView but left it as a
303         subview of the WKPDFView. To show the password view for Web content, my original plan was to
304         teach WKContentView to host its own password view, but this turned out not to work. Since
305         QuickLook needs to unlock a document before determining its preview's MIME type, we have to
306         ask for a password during provisional navigation, but if the still-committed document is a
307         PDF then the WKContentView will not be in the view hierarchy.
308
309         To ensure password view visibility, this patch moves the ownership of WKPasswordView to
310         WKWebView and creates an internal API for showing and hiding it. When
311         -_showPasswordViewWithDocumentName:passwordHandler: is called, WKWebView inserts a new
312         WKPasswordView as a subview of the scroll view and hides the current content view. The
313         password view is removed and the current content view is unhidden by -_hidePasswordView.
314
315         This also fixes a bug in WKPDFView where a PDF document is laid out incorrectly if the view
316         size changes while the password view is displayed.
317
318         * UIProcess/API/Cocoa/WKWebView.mm: Declared _passwordView.
319         (-[WKWebView _processDidExit]): Hid the password view.
320         (-[WKWebView _didCommitLayerTree:]): Ignored if not showing the standard content view.
321         (-[WKWebView _restorePageScrollPosition:scrollOrigin:previousObscuredInset:scale:]): Ditto.
322         (-[WKWebView _restorePageStateToUnobscuredCenter:scale:]): Ditto.
323         (-[WKWebView usesStandardContentView]): Changed to return false if _passwordView is non-nil.
324         (-[WKWebView _updateContentRectsWithState:]): Updated _passwordView's frame with the current
325         bounds size.
326         (-[WKWebView _showPasswordViewWithDocumentName:passwordHandler:]): Created a WKPasswordView,
327         called -showInScrollView:, and hid _currentContentView.
328         (-[WKWebView _hidePasswordView]): Removed _passwordView from its superview, set
329         _passwordView to nil, and unhid _currentContentView.
330         (-[WKWebView _passwordView]): Returned _passwordView.
331         (-[WKWebView _beginAnimatedResizeWithUpdates:]): Called -usesStandardContentView instead of
332         checking for a non-nil _customContentView when deciding whether to do a non-animated resize.
333         * UIProcess/API/Cocoa/WKWebViewInternal.h:
334         * UIProcess/ios/WKPDFView.mm: Removed _passwordView.
335         (-[WKPDFView web_setMinimumSize:]): Set m_minimumSize and updated the frame size even when a
336         password view is displayed.
337         (-[WKPDFView _computePageAndDocumentFrames]): Removed password view code.
338         (-[WKPDFView _showPasswordEntryField]): Ditto.
339         (-[WKPDFView _passwordViewFrame]): Deleted.
340         * UIProcess/ios/WKPasswordView.h:
341         * UIProcess/ios/WKPasswordView.mm:
342         (-[WKPasswordView initWithFrame:documentName:]): Stored a copy of documentName in
343         _documentName.
344         (-[WKPasswordView documentName]): Added. Returns _documentName.
345         (-[WKPasswordView showInScrollView:]): Renamed from displayInContentView:. Started saving
346         zoomScale and contentSize.
347         (-[WKPasswordView hide]): Started restoring zoomeScale and contentSize.
348         (-[WKPasswordView showPasswordFailureAlert]): Renamed from -displayPasswordFailureAlert.
349         (-[WKPasswordView displayInContentView:]): Renamed to -showInScrollView:
350         (-[WKPasswordView displayPasswordFailureAlert]): Renamed to -showPasswordFailureAlert.
351
352 2017-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
353
354         Add support for named pasteboards, pasteboard strategies and platform pasteboards
355         https://bugs.webkit.org/show_bug.cgi?id=167404
356
357         Reviewed by Enrica Casucci.
358
359         Adds support for delivering the pasteboard name to the UI process when writing to or reading from the pasteboard.
360
361         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
362         (WebKit::WebPasteboardProxy::writeWebContentToPasteboard):
363         (WebKit::WebPasteboardProxy::writeImageToPasteboard):
364         (WebKit::WebPasteboardProxy::writeStringToPasteboard):
365         (WebKit::WebPasteboardProxy::readStringFromPasteboard):
366         (WebKit::WebPasteboardProxy::readURLFromPasteboard):
367         (WebKit::WebPasteboardProxy::readBufferFromPasteboard):
368         (WebKit::WebPasteboardProxy::getPasteboardItemsCount):
369         * UIProcess/WebPasteboardProxy.h:
370         * UIProcess/WebPasteboardProxy.messages.in:
371         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
372         (WebKit::WebPlatformStrategies::writeToPasteboard):
373         (WebKit::WebPlatformStrategies::getPasteboardItemsCount):
374         (WebKit::WebPlatformStrategies::readBufferFromPasteboard):
375         (WebKit::WebPlatformStrategies::readURLFromPasteboard):
376         (WebKit::WebPlatformStrategies::readStringFromPasteboard):
377         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
378
379 2017-01-25  Carlos Garcia Campos  <cgarcia@igalia.com>
380
381         [GTK] Icon Database should be in private browsing mode for ephemeral web views
382         https://bugs.webkit.org/show_bug.cgi?id=167414
383
384         Reviewed by Michael Catanzaro.
385
386         This is already done by WebProcessPool for the legacy private session setting, but only checking the setting and not
387         whether there are ephemeral web pages or not.
388
389         * UIProcess/API/gtk/WebKitWebContext.cpp:
390         (webkitWebContextEnableIconDatabasePrivateBrowsingIfNeeded): Enable icon database private browsing if there's
391         any ephemeral web view.
392         (webkitWebContextDisableIconDatabasePrivateBrowsingIfNeeded): Disable icon database private browsing if there
393         aren't ephemeral web views anymore.
394         (webkit_web_context_set_favicon_database_directory): Enable icon database private browsing if the web context is ephemeral.
395         (webkitWebContextCreatePageForWebView): Call webkitWebContextEnableIconDatabasePrivateBrowsingIfNeeded().
396         (webkitWebContextWebViewDestroyed): Call webkitWebContextDisableIconDatabasePrivateBrowsingIfNeeded().
397         * UIProcess/API/gtk/WebKitWebView.cpp:
398         (webkitWebViewDispose): Ensure webkitWebContextWebViewDestroyed is called only once.
399
400 2017-01-25  Carlos Garcia Campos  <cgarcia@igalia.com>
401
402         [GTK] UIProcess from WebKitGtk+ 2.15.x SIGSEGVs because of X Error BadDamage in WebKit::AcceleratedBackingStoreX11::update(WebKit::LayerTreeContext const&) () at Source/WebKit2/UIProcess/gtk/AcceleratedBackingStoreX11.cpp:145
403         https://bugs.webkit.org/show_bug.cgi?id=165656
404
405         Reviewed by Michael Catanzaro.
406
407         We are incorrectly handling BadDamage errors because the BadDamage value we pass to the XErrorTrapper is not
408         the actual error code used by X11. Since XDamage is an extension, it has its own errors and a base error
409         code. We need to use the base error code we get when calling XDamageQueryExtension to pass the right error code
410         to the XErrorTrapper.
411
412         * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
413         (WebKit::AcceleratedBackingStoreX11::create): Get also the damage base error.
414         (WebKit::xDamageErrorCode): Helper to get the actual error code.
415         (WebKit::AcceleratedBackingStoreX11::~AcceleratedBackingStoreX11): Use xDamageErrorCode().
416         (WebKit::AcceleratedBackingStoreX11::update): Ditto.
417
418 2017-01-25  Miguel Gomez  <magomez@igalia.com>
419
420         [GTK] The inspector is broken when AC support is disabled
421         https://bugs.webkit.org/show_bug.cgi?id=165237
422
423         Reviewed by Carlos Garcia Campos.
424
425         WebInspector must not use PageOverlays or GraphicsLayers when AC is not avaialable.
426
427         No new tests added.
428
429         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
430         (WebKit::WebInspectorClient::highlight):
431         (WebKit::WebInspectorClient::showPaintRect):
432
433 2017-01-25  Carlos Garcia Campos  <cgarcia@igalia.com>
434
435         [SOUP] Custom protocols don't work in private browsing mode
436         https://bugs.webkit.org/show_bug.cgi?id=167236
437
438         Reviewed by Sergio Villar Senin.
439
440         We only register them in the default session, they should be registered in all existing sessions, and also on
441         newly created ones.
442
443         * NetworkProcess/CustomProtocols/soup/CustomProtocolManagerSoup.cpp:
444         (WebKit::CustomProtocolManager::registerProtocolClass): Set the WEBKIT_TYPE_SOUP_REQUEST_GENERIC as type for
445         custom protocols.
446         (WebKit::CustomProtocolManager::registerScheme): Use g_type_class_peek instead of g_type_class_ref since we know
447         the class was already created in registerProtocolClass(). Setup custom protocols in all existing sessions.
448
449 2017-01-24  Carlos Garcia Campos  <cgarcia@igalia.com>
450
451         [GTK] Add API to create ephemeral web views and deprecate the private browsing setting
452         https://bugs.webkit.org/show_bug.cgi?id=167370
453
454         Reviewed by Michael Catanzaro.
455
456         Add API to create ephemeral WebKitWebView, WebKitWebsiteDataManager and WebKitWebContext.
457
458         * UIProcess/API/gtk/WebKitSettings.cpp:
459         (webKitSettingsSetProperty): Ignore deprecation warnings.
460         (webKitSettingsGetProperty): Ditto.
461         (webkit_settings_class_init): Mark WebKitSettings:enable-private-browsing as deprecated.
462         * UIProcess/API/gtk/WebKitSettings.h:
463         * UIProcess/API/gtk/WebKitWebContext.cpp:
464         (webkit_web_context_new_ephemeral): Create an ephemeral WebKitWebContext. This is just a convenient method to
465         create a WebKitWebContext with an ephemeral WebKitWebsiteDataManager without having to deal with the manager.
466         (webkit_web_context_is_ephemeral): Return whether the context is ephemeral.
467         (webkitWebContextCreatePageForWebView): Configure page with the web view WebKitWebsiteDataManager if it has one.
468         * UIProcess/API/gtk/WebKitWebContext.h:
469         * UIProcess/API/gtk/WebKitWebView.cpp:
470         (webkitWebViewConstructed): Check if the WebView is or should be ephemeral and create a non persistent website
471         data manager if it's an ephemeral web view in a non ephemeral web context.
472         (webkitWebViewSetProperty): Add setter for is-ephemeral property.
473         (webkitWebViewGetProperty): Add getter for is-ephemeral property.
474         (webkit_web_view_class_init): Add is-ephemeral property.
475         (webkitWebViewHandleAuthenticationChallenge): Check also whether web view is ephemeral.
476         (webkitWebViewGetWebsiteDataManager): Helper private to return the web view data manager.
477         (webkit_web_view_new_with_context): Also set is-ephemeral property depending on the context.
478         (webkit_web_view_is_ephemeral): Return whether the view is ephemeral.
479         * UIProcess/API/gtk/WebKitWebView.h:
480         * UIProcess/API/gtk/WebKitWebViewPrivate.h:
481         * UIProcess/API/gtk/WebKitWebsiteDataManager.cpp:
482         (webkitWebsiteDataManagerGetProperty): Add setter for is-ephemeral property.
483         (webkitWebsiteDataManagerSetProperty): Add getter for is-ephemeral property.
484         (webkit_website_data_manager_class_init): Add is-ephemeral property.
485         (webkit_website_data_manager_new_ephemeral): Create a new ephemeral WebKitWebsiteDataManager.
486         (webkit_website_data_manager_is_ephemeral): Return whether the website data manager is ephemeral.
487         (webkit_website_data_manager_get_base_data_directory): Return nullptr if manager is ephemeral.
488         (webkit_website_data_manager_get_base_cache_directory): Ditto.
489         (webkit_website_data_manager_get_local_storage_directory): Ditto.
490         (webkit_website_data_manager_get_disk_cache_directory): Ditto.
491         (webkit_website_data_manager_get_offline_application_cache_directory): Ditto.
492         (webkit_website_data_manager_get_indexeddb_directory): Ditto.
493         (webkit_website_data_manager_get_websql_directory): Ditto.
494         * UIProcess/API/gtk/WebKitWebsiteDataManager.h:
495         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols.
496
497 2017-01-24  Zalan Bujtas  <zalan@apple.com>
498
499         Add simple line layout toggle to MiniBrowser
500         https://bugs.webkit.org/show_bug.cgi?id=167405
501
502         Reviewed by Andreas Kling.
503
504         * UIProcess/API/Cocoa/WKPreferences.mm:
505         (-[WKPreferences _simpleLineLayoutEnabled]):
506         (-[WKPreferences _setSimpleLineLayoutEnabled:]):
507         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
508
509 2017-01-24  Joseph Pecoraro  <pecoraro@apple.com>
510
511         Fold USER_TIMING into WEB_TIMING and make it a RuntimeEnabledFeature
512         https://bugs.webkit.org/show_bug.cgi?id=167394
513
514         Reviewed by Ryosuke Niwa.
515
516         * Configurations/FeatureDefines.xcconfig:
517
518 2017-01-24  Simon Fraser  <simon.fraser@apple.com>
519
520         [iOS WK2] Avoid IOSurface readback for snapshot creation
521         https://bugs.webkit.org/show_bug.cgi?id=167397
522         rdar://problem/30174873
523
524         Reviewed by Tim Horton.
525
526         Use IOSurface::sinkIntoImage() for snapshots, to avoid GPU readback.
527
528         * UIProcess/API/Cocoa/WKWebView.mm:
529         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
530
531 2017-01-24  Tim Horton  <timothy_horton@apple.com>
532
533         Script gets touch events even after navigation swipe begins
534         https://bugs.webkit.org/show_bug.cgi?id=167383
535         <rdar://problem/22938927>
536
537         Reviewed by Simon Fraser.
538
539         * Platform/spi/ios/UIKitSPI.h:
540         * UIProcess/API/Cocoa/WKWebView.mm:
541         (-[WKWebView _isNavigationSwipeGestureRecognizer:]):
542         * UIProcess/API/Cocoa/WKWebViewInternal.h:
543         * UIProcess/Cocoa/ViewGestureController.h:
544         * UIProcess/ios/ViewGestureControllerIOS.mm:
545         (-[WKSwipeTransitionController isNavigationSwipeGestureRecognizer:]):
546         (WebKit::ViewGestureController::isNavigationSwipeGestureRecognizer):
547         * UIProcess/ios/WKContentViewInteraction.mm:
548         (-[WKContentView gestureRecognizer:shouldRequireFailureOfGestureRecognizer:]):
549         Require the navigation swipe gesture recognizer to fail before the
550         UIWebTouchEventsGestureRecognizer can recognize. This way, the page
551         doesn't get touch events during the swipe, which previously led to
552         e.g. carousels scrolling while swiping.
553
554 2017-01-24  Matt Rajca  <mrajca@apple.com>
555
556         Pass down website autoplay policies to media elements
557         https://bugs.webkit.org/show_bug.cgi?id=167355
558
559         Reviewed by Alex Christensen.
560
561         Autoplay policies can be specified at the global web view preferences level or on a per-page
562         basis during navigation. This patch ensures that policies specified on a per-page basis hold
563         precedence over global policies. If no policies are specified during navigation, global
564         policies are used. A WebsiteAutoplayPolicy::Default option has been added to let clients
565         explicitly specify web view defaults should be used.
566
567         * Shared/WebsitePolicies.h:
568         * UIProcess/API/C/WKWebsitePolicies.cpp:
569         (WKWebsitePoliciesGetAutoplayPolicy):
570         (WKWebsitePoliciesSetAutoplayPolicy):
571         * UIProcess/API/C/WKWebsitePolicies.h:
572         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
573         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
574         (-[_WKWebsitePolicies setAutoplayPolicy:]):
575         (-[_WKWebsitePolicies autoplayPolicy]):
576         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
577         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
578
579 2017-01-24  Nan Wang  <n_wang@apple.com>
580
581         AX: Speak Selection does not work in an iframe
582         https://bugs.webkit.org/show_bug.cgi?id=166794
583         <rdar://problem/29913013>
584
585         Reviewed by Chris Fleizach.
586
587         Making sure WebPage::getSelectionOrContentsAsString() is getting the
588         selection content in the right frame. 
589
590         * UIProcess/API/Cocoa/WKWebView.mm:
591         (-[WKWebView _accessibilityRetrieveSpeakSelectionContent]):
592         (-[WKWebView _accessibilityDidGetSpeakSelectionContent:]):
593         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
594         * UIProcess/ios/WKContentViewInteraction.h:
595         * UIProcess/ios/WKContentViewInteraction.mm:
596         (-[WKContentView accessibilityRetrieveSpeakSelectionContent]):
597         * WebProcess/WebPage/WebPage.cpp:
598         (WebKit::WebPage::getSelectionOrContentsAsString):
599
600 2017-01-24  Jer Noble  <jer.noble@apple.com>
601
602         Make _WKFullscreenDelegate available to users of the WebKit2 C-API.
603         https://bugs.webkit.org/show_bug.cgi?id=165255
604
605         Reviewed by Anders Carlsson.
606
607         Add a getter and setter to WKPagePrivate allowing clients to set/get the
608         _WKFullscreenDelegate associated with the page.
609
610         * UIProcess/API/C/mac/WKPagePrivateMac.h:
611         * UIProcess/API/C/mac/WKPagePrivateMac.mm:
612         (WKPageSetFullscreenDelegate):
613         (WKPageGetFullscreenDelegate):
614
615 2017-01-23  Anders Carlsson  <andersca@apple.com>
616
617         The Score Esports crashes on launch
618         https://bugs.webkit.org/show_bug.cgi?id=167338
619         rdar://problem/29948645
620
621         Reviewed by Dan Bernstein.
622
623         * Shared/Cocoa/WKObject.mm:
624         (+[WKObject conformsToProtocol:]):
625         Add a class method implementation in case an app ends up calling +[WKObject conformsToProtocol:] for some reason.
626
627 2017-01-24  Miguel Gomez  <magomez@igalia.com>
628
629         [Coordinated Graphics] Ensure that we're in AC mode before trying to create GraphicsLayers
630         https://bugs.webkit.org/show_bug.cgi?id=167365
631
632         Reviewed by Carlos Garcia Campos.
633
634         When entering AC on demand, the RenderLayerCompositor wants to create the root GraphicsLayer before the
635         AcceleratedDrawingArea is in AC mode. This means there's no LayerTreeHost to request the GraphicsLayerFactory,
636         so no layers are created. Ensure that we are in AC mode before requesting the GraphicsLayerFactory.
637
638         No behaviour change, no new tests.
639
640         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
641         (WebKit::AcceleratedDrawingArea::graphicsLayerFactory):
642
643 2017-01-23  Carlos Garcia Campos  <cgarcia@igalia.com>
644
645         [GTK] Add API to WebKitWebsiteDataManager to handle website data
646         https://bugs.webkit.org/show_bug.cgi?id=146589
647
648         Reviewed by Michael Catanzaro.
649
650         Add WebKitWebsiteData boxed type to wrap a WebsiteDataRecord and new methods to WebKitWebsiteDataManager to
651         fetch, remove and clear website data.
652
653         * PlatformGTK.cmake: Add new files to compilation.
654         * UIProcess/API/gtk/WebKitWebsiteData.cpp: Added.
655         (_WebKitWebsiteData::_WebKitWebsiteData):
656         (recordContainsSupportedDataTypes): Helper function to check if the WebsiteDataRecord contains any type exposed
657         by our API.
658         (toWebKitWebsiteDataTypes): Convert from WebKit::WebsiteDataType to the GTK+ public API types.
659         (webkitWebsiteDataCreate): Create a new WebKitWebsiteData for the given WebsiteDataRecord if it contains any
660         supported type.
661         (webkitWebsiteDataGetRecord): Returns the wrapped WebsiteDataRecord.
662         (webkit_website_data_ref):
663         (webkit_website_data_unref):
664         (webkit_website_data_get_name): Return the display name.
665         (webkit_website_data_get_types): Returns the mask of types.
666         (webkit_website_data_get_size): Returns the size for the given types.
667         * UIProcess/API/gtk/WebKitWebsiteData.h: Added.
668         * UIProcess/API/gtk/WebKitWebsiteDataManager.cpp:
669         (toWebsiteDataTypes): Convert from GTK+ public API types to WebKit::WebsiteDataType.
670         (webkit_website_data_manager_fetch): Fetch website data of the given types.
671         (webkit_website_data_manager_fetch_finish):
672         (webkit_website_data_manager_remove): Remove the website data of the given types for the given WebKitWebsiteData list.
673         (webkit_website_data_manager_remove_finish):
674         (webkit_website_data_manager_clear): Clear all website data of the given types modified since the given time span.
675         (webkit_website_data_manager_clear_finish):
676         * UIProcess/API/gtk/WebKitWebsiteDataManager.h:
677         * UIProcess/API/gtk/WebKitWebsiteDataPrivate.h: Added.
678         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols.
679         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add new section.
680         * UIProcess/API/gtk/webkit2.h: Inlcude WebKitWebsiteData.h
681
682 2017-01-23  Antti Koivisto  <antti@apple.com>
683
684         Maintain ordering when doing speculative loads
685         https://bugs.webkit.org/show_bug.cgi?id=167324
686
687         Forgot to implement a review comment.
688
689         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
690         (WebKit::NetworkCache::makeSubresourceInfoVector):
691
692         Allocated initial capacity and use uncheckedAppend.
693
694 2017-01-23  Commit Queue  <commit-queue@webkit.org>
695
696         Unreviewed, rolling out r211062.
697         https://bugs.webkit.org/show_bug.cgi?id=167354
698
699         broke API tests (Requested by alexchristensen on #webkit).
700
701         Reverted changeset:
702
703         "Pass down website autoplay policies to media elements"
704         https://bugs.webkit.org/show_bug.cgi?id=167132
705         http://trac.webkit.org/changeset/211062
706
707 2017-01-23  Antti Koivisto  <antti@apple.com>
708
709         Maintain ordering when doing speculative loads
710         https://bugs.webkit.org/show_bug.cgi?id=167324
711
712         Reviewed by Chris Dumez.
713
714         We currently randomize the ordering of speculative loads because they are serialized as a hash map.
715         It would be better to load in the same order as the requests were originally issued as that is
716         likely to match the order the document needs them.
717
718         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
719         (WebKit::NetworkCache::SpeculativeLoadManager::startSpeculativeRevalidation):
720         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
721         (WebKit::NetworkCache::SubresourceInfo::encode):
722         (WebKit::NetworkCache::SubresourceInfo::decode):
723
724             Include key into SubresourceInfo.
725
726         (WebKit::NetworkCache::makeSubresourcesVector):
727
728             Deduplicate the entries.
729
730         (WebKit::NetworkCache::SubresourcesEntry::SubresourcesEntry):
731         (WebKit::NetworkCache::SubresourcesEntry::updateSubresourceLoads):
732         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
733         (WebKit::NetworkCache::SubresourceInfo::SubresourceInfo):
734         (WebKit::NetworkCache::SubresourceInfo::key):
735         (WebKit::NetworkCache::SubresourceInfo::setTransient):
736         (WebKit::NetworkCache::SubresourcesEntry::subresources):
737
738             Keep the resources in a Vector instead of a HashMap to maintain order.
739
740 2017-01-23  Matt Rajca  <mrajca@apple.com>
741
742         Pass down website autoplay policies to media elements
743         https://bugs.webkit.org/show_bug.cgi?id=167132
744
745         Reviewed by Alex Christensen.
746
747         The playbackRequiresUserGesture APIs are already covered by tests. This patch adds API tests
748         for autoplay website policies.
749
750         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
751         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
752
753 2017-01-23  Joseph Pecoraro  <pecoraro@apple.com>
754
755         Web Inspector: Asserts seen opening and closing Remote Web Inspector windows
756         https://bugs.webkit.org/show_bug.cgi?id=167316
757         <rdar://problem/28891161>
758
759         Reviewed by Alexey Proskuryakov.
760
761         * UIProcess/RemoteWebInspectorProxy.cpp:
762         (WebKit::RemoteWebInspectorProxy::createFrontendPageAndWindow):
763         Assume read access, like the local web inspector, to Web Inspector resources.
764
765         * WebProcess/WebPage/RemoteWebInspectorUI.cpp:
766         (WebKit::RemoteWebInspectorUI::closeWindow):
767         Clear ourselves as the inspector frontend client when closing.
768
769 2017-01-20  Anders Carlsson  <andersca@apple.com>
770
771         When Safari reloads pages with Flash objects after Flash is installed, placeholders don't paint (but do work!)
772         https://bugs.webkit.org/show_bug.cgi?id=167268
773         rdar://problem/29857388
774
775         Reviewed by Sam Weinig.
776
777         * WebProcess/Plugins/WebPluginInfoProvider.h:
778         Make refreshPlugins() private.
779
780         * WebProcess/WebProcess.cpp:
781         (WebKit::WebProcess::refreshPlugins):
782         Call the newly added PluginInfoProvider::refresh().
783
784 2017-01-23  Antti Koivisto  <antti@apple.com>
785
786         Use priorities in speculative revalidation
787         https://bugs.webkit.org/show_bug.cgi?id=167314
788
789         Reviewed by Chris Dumez.
790
791         We currently do all speculative cache operations with 'Medium' priority
792         and network operations with 'Low'. We should use the actual request priorities instead.
793
794         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
795         (WebKit::NetworkCache::constructRevalidationRequest):
796
797             Use priority when constructing validation request.
798
799         (WebKit::NetworkCache::SpeculativeLoadManager::retrieveEntryFromStorage):
800
801             Use priority when retrieving from cache.
802
803         (WebKit::NetworkCache::SpeculativeLoadManager::preloadEntry):
804         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
805         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
806         (WebKit::NetworkCache::SubresourceInfo::encode):
807         (WebKit::NetworkCache::SubresourceInfo::decode):
808
809             Save and restore the priority.
810
811         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
812         (WebKit::NetworkCache::SubresourceInfo::SubresourceInfo):
813         (WebKit::NetworkCache::SubresourceInfo::priority):
814
815 2017-01-23  Jer Noble  <jer.noble@apple.com>
816
817         Video details does not apear and missing scrubber in Control Center
818         https://bugs.webkit.org/show_bug.cgi?id=167233
819
820         Reviewed by Alex Christensen.
821
822         Make requestActiveNowPlayingSessionInfo() and handleActiveNowPlayingSessionInfoResponse()
823         work in PLATFORM(IOS).
824
825         * UIProcess/API/Cocoa/WKWebView.mm:
826         (-[WKWebView _requestActiveNowPlayingSessionInfo]):
827         (-[WKWebView _handleActiveNowPlayingSessionInfoResponse:title:duration:elapsedTime:]):
828         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
829         * UIProcess/PageClient.h:
830         * UIProcess/WebPageProxy.cpp:
831         (WebKit::WebPageProxy::requestActiveNowPlayingSessionInfo):
832         (WebKit::WebPageProxy::handleActiveNowPlayingSessionInfoResponse):
833         * UIProcess/WebPageProxy.h:
834         * UIProcess/WebPageProxy.messages.in:
835         * UIProcess/ios/PageClientImplIOS.h:
836         * UIProcess/ios/PageClientImplIOS.mm:
837         (WebKit::PageClientImpl::handleActiveNowPlayingSessionInfoResponse):
838         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
839         (WebKit::WebPage::requestActiveNowPlayingSessionInfo):
840         * WebProcess/WebPage/WebPage.h:
841         * WebProcess/WebPage/WebPage.messages.in:
842         * WebProcess/WebPage/mac/WebPageMac.mm:
843         (WebKit::WebPage::requestActiveNowPlayingSessionInfo): Deleted.
844
845 2017-01-23  Chris Dumez  <cdumez@apple.com>
846
847         REGRESSION (r211033): ASSERTION FAILED: m_ptr in com.apple.WebCore: WTF::RefPtr<WebCore::Element>::operator* const + 70
848         https://bugs.webkit.org/show_bug.cgi?id=167308
849         <rdar://problem/30144964>
850
851         Unreviewed, do a partial revert of r211033 to fix assertion.
852
853         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
854         (WebKit::WebChromeClient::exitFullScreenForElement):
855         * WebProcess/WebCoreSupport/WebChromeClient.h:
856
857 2017-01-20  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
858
859         urlParserEnabled parameter is only encoded for COCOA ports
860         https://bugs.webkit.org/show_bug.cgi?id=167238
861
862         Reviewed by Alex Christensen.
863
864         This leads to URLParser being enabled on the UI process, since it is
865         the default, but disabled on the WebProcess, which is the default for
866         WebProcessCreationParameters, casuing asserts like on tests such as these
867         due to differences in parsing:
868
869         - fast/loader/redirect-to-invalid-url-using-javascript-calls-policy-delegate.html
870         - fast/loader/window-open-to-invalid-url-calls-policy-delegate.html
871         - http/tests/inspector/network/copy-as-curl.html
872
873         * Shared/WebProcessCreationParameters.cpp:
874         (WebKit::WebProcessCreationParameters::encode): encode urlParserEnabled
875         (WebKit::WebProcessCreationParameters::decode): decode urlParserEnabled
876
877 2017-01-20  Darin Adler  <darin@apple.com>
878
879         Remove PassRefPtr from "page" directory of WebCore, also deploy references
880         https://bugs.webkit.org/show_bug.cgi?id=167224
881
882         Reviewed by Chris Dumez.
883
884         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
885         (WebKit::RemoteScrollingTree::createScrollingTreeNode): Return a Ref
886         instead of PassRefPtr.
887         * UIProcess/Scrolling/RemoteScrollingTree.h: Updated for the above.
888
889         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
890         (WKBundlePageInstallPageOverlay): Pass a reference.
891         (WKBundlePageUninstallPageOverlay): Ditto.
892         (WKBundlePageInstallPageOverlayWithAnimation): Ditto.
893         (WKBundlePageUninstallPageOverlayWithAnimation): Ditto.
894         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
895         (WebKit::PDFPlugin::jsPDFDocPrint): Ditto.
896         * WebProcess/Plugins/PluginView.cpp:
897         (WebKit::PluginView::focusPluginElement): Ditto.
898         (WebKit::PluginView::setStatusbarText): Ditto.
899
900         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
901         (WebKit::WebChromeClient::elementDidFocus): Updated for changes to ChromeClient.
902         (WebKit::WebChromeClient::elementDidBlur): Ditto.
903         (WebKit::WebChromeClient::makeFirstResponder): Ditto.
904         (WebKit::WebChromeClient::createWindow): Ditto.
905         (WebKit::WebChromeClient::runBeforeUnloadConfirmPanel): Ditto.
906         (WebKit::WebChromeClient::runJavaScriptAlert): Ditto.
907         (WebKit::WebChromeClient::runJavaScriptConfirm): Ditto.
908         (WebKit::WebChromeClient::runJavaScriptPrompt): Ditto.
909         (WebKit::WebChromeClient::contentsSizeChanged): Ditto.
910         (WebKit::WebChromeClient::unavailablePluginButtonClicked): Ditto.
911         (WebKit::WebChromeClient::print): Ditto.
912         (WebKit::WebChromeClient::exceededDatabaseQuota): Ditto.
913         (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota): Ditto.
914         (WebKit::WebChromeClient::createColorChooser): Ditto.
915         (WebKit::WebChromeClient::createPopupMenu): Ditto.
916         (WebKit::WebChromeClient::createSearchPopupMenu): Ditto.
917         (WebKit::WebChromeClient::attachRootGraphicsLayer): Ditto.
918         (WebKit::WebChromeClient::attachViewOverlayGraphicsLayer): Ditto.
919         (WebKit::WebChromeClient::createScrollingCoordinator): Ditto.
920         (WebKit::WebChromeClient::supportsFullScreenForElement): Ditto.
921         (WebKit::WebChromeClient::enterFullScreenForElement): Ditto.
922         (WebKit::WebChromeClient::exitFullScreenForElement): Ditto.
923         (WebKit::WebChromeClient::didAddHeaderLayer): Ditto.
924         (WebKit::WebChromeClient::didAddFooterLayer): Ditto.
925         (WebKit::WebChromeClient::shouldUseTiledBackingForFrameView): Ditto.
926         * WebProcess/WebCoreSupport/WebChromeClient.h: Ditto.
927         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
928         (WebKit::WebChromeClient::elementDidRefocus): Ditto.
929         (WebKit::WebChromeClient::didReceiveMobileDocType): Ditto.
930         (WebKit::WebChromeClient::observedContentChange): Ditto.
931         (WebKit::WebChromeClient::clearContentChangeObservers): Ditto.
932         (WebKit::WebChromeClient::notifyRevealedSelectionByScrollingFrame): Ditto.
933
934         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
935         (WebKit::WebFrameLoaderClient::dispatchCreatePage): Pass reference.
936         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
937         (WebKit::WebInspectorClient::~WebInspectorClient): Ditto.
938         (WebKit::WebInspectorClient::hideHighlight): Ditto.
939         (WebKit::WebInspectorClient::showPaintRect): Ditto.
940         * WebProcess/WebPage/FindController.cpp:
941         (WebKit::FindController::updateFindUIAfterPageScroll): Ditto.
942         (WebKit::FindController::hideFindUI): Ditto.
943
944         * WebProcess/WebPage/WebFrame.cpp:
945         (WebKit::WebFrame::createWithCoreMainFrame): Return Ref instead of
946         PassRefPtr.
947         (WebKit::WebFrame::createSubframe): Ditto.
948         (WebKit::WebFrame::create): Ditto.
949         * WebProcess/WebPage/WebFrame.h: Updated for the above.
950
951         * WebProcess/WebPage/WebInspector.cpp:
952         (WebKit::WebInspector::openInNewTab): Pass reference.
953
954         * WebProcess/WebPage/ios/FindControllerIOS.mm:
955         (WebKit::FindController::updateFindIndicator): Use reference.
956         (WebKit::FindController::hideFindIndicator): Ditto.
957
958 2017-01-21  Carlos Garcia Campos  <cgarcia@igalia.com>
959
960         Unreviewed, rolling out r211012.
961
962         It caused a lot of crashes in the network process
963
964         Reverted changeset:
965
966         "[SOUP] Custom protocols don't work in private browsing mode"
967         https://bugs.webkit.org/show_bug.cgi?id=167236
968         http://trac.webkit.org/changeset/211012
969
970 2017-01-20  Joseph Pecoraro  <pecoraro@apple.com>
971
972         Remove never changing IndexedDB RuntimeEnabledFeature
973         https://bugs.webkit.org/show_bug.cgi?id=167278
974
975         Reviewed by Darin Adler.
976
977         * WebProcess/WebProcess.cpp:
978         (WebKit::m_resourceLoadStatisticsStorage):
979
980 2017-01-20  Carlos Garcia Campos  <cgarcia@igalia.com>
981
982         [SOUP] Custom protocols don't work in private browsing mode
983         https://bugs.webkit.org/show_bug.cgi?id=167236
984
985         Reviewed by Sergio Villar Senin.
986
987         We only register them in the default session.
988
989         * NetworkProcess/CustomProtocols/soup/CustomProtocolManagerSoup.cpp:
990         (WebKit::CustomProtocolManager::registerProtocolClass): Set the WEBKIT_TYPE_SOUP_REQUEST_GENERIC as type for
991         custom protocols, and setup custom protocols in all existing sessions.
992         (WebKit::CustomProtocolManager::registerScheme): Use g_type_class_peek instead of g_type_class_ref since we know
993         the class was already created in registerProtocolClass().
994
995 2017-01-20  Brady Eidson  <beidson@apple.com>
996
997         Require a button press on a gamepad for them to be exposed to the DOM.
998         <rdar://problem/28620919> and https://bugs.webkit.org/show_bug.cgi?id=167272
999
1000         Reviewed by Alex Christensen.
1001
1002         * UIProcess/Gamepad/UIGamepadProvider.cpp:
1003         (WebKit::UIGamepadProvider::gamepadSyncTimerFired):
1004         (WebKit::UIGamepadProvider::platformGamepadInputActivity):
1005         * UIProcess/Gamepad/UIGamepadProvider.h:
1006
1007         * UIProcess/WebPageProxy.cpp:
1008         (WebKit::WebPageProxy::gamepadActivity):
1009         * UIProcess/WebPageProxy.h:
1010
1011         * WebProcess/Gamepad/WebGamepadProvider.cpp:
1012         (WebKit::WebGamepadProvider::gamepadActivity):
1013         * WebProcess/Gamepad/WebGamepadProvider.h:
1014
1015         * WebProcess/WebPage/WebPage.cpp:
1016         (WebKit::WebPage::gamepadActivity):
1017         * WebProcess/WebPage/WebPage.h:
1018         * WebProcess/WebPage/WebPage.messages.in:
1019
1020 2017-01-20  Joseph Pecoraro  <pecoraro@apple.com>
1021
1022         Cleanup RuntimeEnabledFeatures
1023         https://bugs.webkit.org/show_bug.cgi?id=167228
1024
1025         Reviewed by Simon Fraser.
1026
1027         * WebProcess/WebProcess.cpp:
1028         (WebKit::m_resourceLoadStatisticsStorage):
1029
1030 2017-01-20  Joseph Pecoraro  <pecoraro@apple.com>
1031
1032         Remove outdated ENABLE(CSP_NEXT) build flag
1033         https://bugs.webkit.org/show_bug.cgi?id=167252
1034
1035         Reviewed by Brent Fulgham.
1036
1037         * Configurations/FeatureDefines.xcconfig:
1038
1039 2017-01-20  Alex Christensen  <achristensen@webkit.org>
1040
1041         Fix Mac CMake build.
1042
1043         * CMakeLists.txt:
1044         * PlatformMac.cmake:
1045
1046 2017-01-20  Antoine Quint  <graouts@apple.com>
1047
1048         Web Animations should be off by default and enabled as an experimental feature
1049         https://bugs.webkit.org/show_bug.cgi?id=167115
1050         <rdar://problem/30048963>
1051
1052         Reviewed by Joseph Pecoraro.
1053
1054         Promote, or relegate depending on how you see things, the Web Animations preference
1055         to an experimental feature.
1056
1057         * Shared/WebPreferencesDefinitions.h:
1058
1059 2017-01-20  Antoine Quint  <graouts@apple.com>
1060
1061         [Modern Media Controls] Turn modern media controls on by default
1062         https://bugs.webkit.org/show_bug.cgi?id=165668
1063
1064         Reviewed by Dean Jackson.
1065
1066         Use DEFAULT_EXPERIMENTAL_FEATURES_ENABLED as the default value for modern media controls, which is true.
1067
1068         * Shared/WebPreferencesDefinitions.h:
1069
1070 2017-01-20  Carlos Garcia Campos  <cgarcia@igalia.com>
1071
1072         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.15.3 release.
1073
1074         * gtk/NEWS: Add release notes for 2.15.3.
1075
1076 2017-01-19  Carlos Garcia Campos  <cgarcia@igalia.com>
1077
1078         [Threaded Compositor] Initialize the threaded compositor with the current size
1079         https://bugs.webkit.org/show_bug.cgi?id=167196
1080
1081         Reviewed by Žan Doberšek.
1082
1083         We are always creating the threaded compositor with an empty size and then a sizeDidChange always happen when
1084         the backing store state changes. This is always happening because the threaded compositor is created before the
1085         first backing store state, but if we wanted to create it later, for example to enter/leave AC mode on demand,
1086         the threaded compositor will not have the viewport size unless the window is resized, or sizeDidChange is called
1087         manually when entering AC mode. Creating the threaded compositor is sync and changing the size too, so it's
1088         better to do both things at the same time using the same sync operation.
1089
1090         * Shared/CoordinatedGraphics/SimpleViewportController.cpp:
1091         (WebKit::SimpleViewportController::SimpleViewportController): Pass an initial size to the constructor.
1092         * Shared/CoordinatedGraphics/SimpleViewportController.h:
1093         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1094         (WebKit::ThreadedCompositor::create): Add viewportSize and scaleFactor construction parameters,
1095         (WebKit::ThreadedCompositor::ThreadedCompositor): Ditto. Also mark as needs resize if the given size is not empty.
1096         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
1097         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
1098         (WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost): Initialize the threaded compositor
1099         with an initial viewport size and scale factor.
1100
1101 2017-01-19  Chris Dumez  <cdumez@apple.com>
1102
1103         iterable<> should be enabled on WK1
1104         https://bugs.webkit.org/show_bug.cgi?id=167221
1105         <rdar://problem/30108531>
1106
1107         Reviewed by Youenn Fablet.
1108
1109         * Shared/WebPreferencesDefinitions.h:
1110         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1111         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1112         * WebProcess/WebPage/WebPage.cpp:
1113         (WebKit::WebPage::updatePreferences):
1114
1115 2017-01-19  Alex Christensen  <achristensen@webkit.org>
1116
1117         Construct URLSearchParams from array or object
1118         https://bugs.webkit.org/show_bug.cgi?id=166973
1119
1120         Reviewed by Sam Weinig.
1121
1122         * NetworkProcess/capture/NetworkCaptureManager.cpp:
1123         (WebKit::NetworkCapture::Manager::fuzzyMatchURLs):
1124         Change std::pair's first/second to WTF::KeyValuePair's key/value.
1125
1126 2017-01-19  Andy Estes  <aestes@apple.com>
1127
1128         [iOS] Move the PDF password view into its own class for possible reuse
1129         https://bugs.webkit.org/show_bug.cgi?id=167192
1130
1131         Reviewed by Tim Horton.
1132
1133         * UIProcess/ios/WKPDFView.h: Stopped conforming to UIDocumentPasswordViewDelegate.
1134         * UIProcess/ios/WKPDFView.mm: Changed _passwordView to a WKPasswordView.
1135         (-[WKPDFView _passwordViewFrame]): Returns the frame to set on _passwordView.
1136         (-[WKPDFView _updatePasswordEntryField]): Removed.
1137         (-[WKPDFView _showPasswordEntryField]): Created a WKPasswordView, set a lambda on its
1138         userDidEnterPassword property to do the work previously done in -_tryToUnlockWithPassword:,
1139         and showed the password view.
1140         (-[WKPDFView _keyboardDidShow:]): Moved to WKPasswordView.
1141         (-[WKPDFView _hidePasswordEntryField]): Deleted. The userDidEnterPassword lambda now calls
1142         -[WKPasswordView hide] when the document is unlocked.
1143         (-[WKPDFView userDidEnterPassword:forPasswordView:]): Moved to WKPasswordView.
1144         (-[WKPDFView didBeginEditingPassword:inView:]): Ditto.
1145         (-[WKPDFView didEndEditingPassword:inView:]): Ditto.
1146         (-[WKPDFView _didFailToUnlock]): Ditto.
1147         (-[WKPDFView _tryToUnlockWithPassword:]): Moved into _passwordView's userDidEnterPassword lambda.
1148         * UIProcess/ios/WKPasswordView.h: Added.
1149         * UIProcess/ios/WKPasswordView.mm: Added.
1150         (-[WKPasswordView initWithFrame:documentName:]): Created a UIDocumentPasswordView with
1151         documentName, set self as its passwordDelegate, and added it as a subview.
1152         (-[WKPasswordView layoutSubviews]): Updated _scrollView's contentSize if we are displaying
1153         the view.
1154         (-[WKPasswordView displayInContentView:]): Saved the scroll view's previous minimum/maximum
1155         zoom scale and color, set new values for minimum/maximum zoom scale and color, and added
1156         self as a subview of contentView.
1157         (-[WKPasswordView hide]): Restored the saved minimum/maximum zoom scale and color on the
1158         scroll view and removed self from its superview.
1159         (-[WKPasswordView displayPasswordFailureAlert]): Displayed the alert previously shown by
1160         -[WKPDFView _didFailToUnlock].
1161         (-[WKPasswordView _keyboardDidShow:]): Moved from WKPDFView.
1162         (-[WKPasswordView userDidEnterPassword:forPasswordView:]): Retained self and called the
1163         _userDidEnterPassword block with the password.
1164         (-[WKPasswordView didBeginEditingPassword:inView:]): Moved from WKPDFView.
1165         (-[WKPasswordView didEndEditingPassword:inView:]): Ditto.
1166         * WebKit2.xcodeproj/project.pbxproj:
1167
1168 2017-01-19  Chris Dumez  <cdumez@apple.com>
1169
1170         Make sure HTML validation bubble gets dismissed when its associated element's frame gets detached
1171         https://bugs.webkit.org/show_bug.cgi?id=167215
1172         <rdar://problem/29885052>
1173
1174         Reviewed by Andreas Kling.
1175
1176         Make sure HTML validation bubble gets dismissed when its associated
1177         element's frame gets detached and that we do not crash.
1178
1179         * WebProcess/WebCoreSupport/WebValidationMessageClient.cpp:
1180         (WebKit::WebValidationMessageClient::documentDetached):
1181         * WebProcess/WebCoreSupport/WebValidationMessageClient.h:
1182
1183 2017-01-19  Chris Dumez  <cdumez@apple.com>
1184
1185         Implement per activity state CPU usage reporting using diagnostic logging
1186         https://bugs.webkit.org/show_bug.cgi?id=167163
1187         <rdar://problem/30058349>
1188
1189         Reviewed by Andreas Kling.
1190
1191         Implement per activity state CPU usage reporting using diagnostic logging.
1192
1193         * Platform/Logging.h:
1194         * UIProcess/PerActivityStateCPUUsageSampler.cpp: Added.
1195         (WebKit::PerActivityStateCPUUsageSampler::PerActivityStateCPUUsageSampler):
1196         (WebKit::PerActivityStateCPUUsageSampler::~PerActivityStateCPUUsageSampler):
1197         (WebKit::PerActivityStateCPUUsageSampler::reportWebContentCPUTime):
1198         (WebKit::loggingKeyForActivityState):
1199         (WebKit::loggingKeyForCPUUsage):
1200         (WebKit::PerActivityStateCPUUsageSampler::loggingTimerFired):
1201         (WebKit::PerActivityStateCPUUsageSampler::pageForLogging):
1202         * UIProcess/PerActivityStateCPUUsageSampler.h: Copied from Source/WebCore/page/ActivityState.h.
1203         * UIProcess/WebProcessPool.cpp:
1204         (WebKit::WebProcessPool::WebProcessPool):
1205         (WebKit::WebProcessPool::reportWebContentCPUTime):
1206         * UIProcess/WebProcessPool.h:
1207         * UIProcess/WebProcessPool.messages.in:
1208         * WebKit2.xcodeproj/project.pbxproj:
1209         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1210         (WebKit::WebChromeClient::reportProcessCPUTime):
1211         * WebProcess/WebCoreSupport/WebChromeClient.h:
1212
1213 2017-01-19  Dan Bernstein  <mitz@apple.com>
1214
1215         Build fix.
1216
1217         Rubber-stamped by Anders Carlsson.
1218
1219         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1220         (WebKit::toPKPaymentAuthorizationStatus): Suppressed deprecation warnings.
1221
1222 2017-01-19  Myles C. Maxfield  <mmaxfield@apple.com>
1223
1224         [Cocoa] Variation fonts are erroneously disabled on iOS
1225         https://bugs.webkit.org/show_bug.cgi?id=167172
1226
1227         Reviewed by Simon Fraser.
1228
1229         OpenSource builders don't seem to understand sdk=embedded*.
1230
1231         * Configurations/FeatureDefines.xcconfig:
1232
1233 2017-01-18  Anders Carlsson  <andersca@apple.com>
1234
1235         Install WebKit.apinotes with the public headers of WebKit framework
1236         https://bugs.webkit.org/show_bug.cgi?id=167182
1237         rdar://problem/29008989
1238
1239         Reviewed by Sam Weinig.
1240
1241         * Shared/API/Cocoa/WebKit.apinotes: Added.
1242         * WebKit2.xcodeproj/project.pbxproj:
1243
1244 2017-01-19  Brian Burg  <bburg@apple.com>
1245
1246         Web Inspector: move Mac-specific automation commands to a separate implementation file
1247         https://bugs.webkit.org/show_bug.cgi?id=163297
1248         <rdar://problem/28718990>
1249
1250         Reviewed by Timothy Hatcher.
1251
1252         Not all Automation commands are available on all platforms. Start splitting out
1253         command declarations and implementations based on the target platform.
1254
1255         * DerivedSources.make:
1256         Set an appropriate --platform so the correct backend interface is generated.
1257
1258         * UIProcess/Automation/Automation.json:
1259         Guard commands that should not be available on iOS:
1260             - resizeWindowOfBrowsingContext
1261             - moveWindowOfBrowsingContext
1262             - inspectBrowsingContext
1263
1264         * UIProcess/Automation/WebAutomationSession.cpp:
1265         (WebKit::WebAutomationSession::platformSimulateKeySequence): Deleted.
1266         - Move shared convenience macros to header file.
1267         - Move out Cocoa-only or Mac-only command implementations.
1268
1269         * UIProcess/Automation/WebAutomationSession.h:
1270         Rearrange some declarations and switch from USE(APPKIT) to PLATFORM(MAC).
1271
1272         * UIProcess/Automation/WebAutomationSessionMacros.h: Added.
1273
1274         * UIProcess/Automation/cocoa/WebAutomationSessionCocoa.mm: Added.
1275         (WebKit::WebAutomationSession::platformGetBase64EncodedPNGData):
1276         Moved from WebAutomationSessionCocoa.mm. Add iOS-specific header includes.
1277
1278         * UIProcess/Automation/mac/WebAutomationSessionMac.mm: Renamed from Source/WebKit2/UIProcess/Cocoa/WebAutomationSessionCocoa.mm.
1279         (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext):
1280         (WebKit::WebAutomationSession::moveWindowOfBrowsingContext):
1281         (WebKit::WebAutomationSession::inspectBrowsingContext):
1282         Move macOS platform command implementations to here. If other desktop ports want
1283         to use these commands, we can move them somewhere else later.
1284
1285         (WebKit::WebAutomationSession::sendSynthesizedEventsToPage):
1286         (WebKit::WebAutomationSession::markEventAsSynthesizedForAutomation):
1287         (WebKit::WebAutomationSession::wasEventSynthesizedForAutomation):
1288         Move out AppKit-specific event simulation code to here.
1289
1290         (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
1291         (WebKit::WebAutomationSession::platformSimulateKeyStroke):
1292         (WebKit::WebAutomationSession::platformSimulateKeySequence):
1293         Move out Mac platformFoo implementations to here.
1294
1295         * WebKit2.xcodeproj/project.pbxproj:
1296         - Added UIProcess/Automation/{mac,cocoa} groups.
1297         - Add new platform-specific implementation files.
1298
1299 2017-01-19  Carlos Garcia Campos  <cgarcia@igalia.com>
1300
1301         [GTK] Provide API to set proxy settings
1302         https://bugs.webkit.org/show_bug.cgi?id=128674
1303
1304         Reviewed by Michael Catanzaro.
1305
1306         Add new method webkit_web_context_set_network_proxy_settings() that allows to set proxy settings in a
1307         WebKitWebContext. It receives an enum WebKitNetworkProxyMode with modes Default, NoProxy and Custom, and an
1308         optional WebKitNetworkProxySettings that is used when mode is Custom. WebKitNetworkProxySettings is a simple
1309         boxed type that user can create to set proxy settins with a similar API to GSimpleProxyResolver.
1310
1311         * NetworkProcess/NetworkProcess.h:
1312         * NetworkProcess/NetworkProcess.messages.in: Add SetNetworkProxySettings message.
1313         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1314         (WebKit::NetworkProcessCreationParameters::encode): Encode proxy settings.
1315         (WebKit::NetworkProcessCreationParameters::decode): Decode proxy settings.
1316         * NetworkProcess/NetworkProcessCreationParameters.h:
1317         * NetworkProcess/efl/NetworkProcessMainEfl.cpp: Use SoupNetworkSession::setProxySettingsFromEnvironment().
1318         * NetworkProcess/soup/NetworkProcessSoup.cpp:
1319         (WebKit::NetworkProcess::platformInitializeNetworkProcess): Set proxy settings if provided by the user.
1320         (WebKit::NetworkProcess::setNetworkProxySettings): Set global proxy settings and setup the proxy for all
1321         existing contexts.
1322         * PlatformGTK.cmake: Add new files to compilation.
1323         * Shared/WebCoreArgumentCoders.h:
1324         * Shared/WebProcessCreationParameters.cpp:
1325         (WebKit::WebProcessCreationParameters::encode): Encode proxy settings.
1326         (WebKit::WebProcessCreationParameters::decode): Decode proxy settings.
1327         * Shared/WebProcessCreationParameters.h:
1328         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
1329         (IPC::ArgumentCoder<SoupNetworkProxySettings>::encode): Add encoder implementation for SoupNetworkProxySettings.
1330         (IPC::ArgumentCoder<SoupNetworkProxySettings>::decode): add decoder implementation for SoupNetworkProxySettings.
1331         * UIProcess/API/gtk/WebKitNetworkProxySettings.cpp: Added.
1332         (_WebKitNetworkProxySettings::_WebKitNetworkProxySettings):
1333         (webkitNetworkProxySettingsGetNetworkProxySettings):
1334         (webkit_network_proxy_settings_new): Create a new WebKitNetworkProxySettings with optional default proxy uri and
1335         ignore hosts list.
1336         (webkit_network_proxy_settings_copy):
1337         (webkit_network_proxy_settings_free):
1338         (webkit_network_proxy_settings_add_proxy): Add a proxy uri for a given uri scheme.
1339         * UIProcess/API/gtk/WebKitNetworkProxySettings.h: Added.
1340         * UIProcess/API/gtk/WebKitNetworkProxySettingsPrivate.h: Added.
1341         * UIProcess/API/gtk/WebKitWebContext.cpp:
1342         (webkit_web_context_set_network_proxy_settings): Set proxy settings.
1343         * UIProcess/API/gtk/WebKitWebContext.h:
1344         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols to the documentation.
1345         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add new section for WebKitNetworkProxySettings.
1346         * UIProcess/API/gtk/webkit2.h: Include WebKitNetworkProxySettings.h.
1347         * UIProcess/WebProcessPool.h: Add m_networkProxySettings and a setter for soup.
1348         * UIProcess/efl/WebProcessPoolEfl.cpp:
1349         (WebKit::WebProcessPool::platformInitializeWebProcess): Set m_networkProxySettings to parameters.
1350         * UIProcess/gtk/WebProcessPoolGtk.cpp:
1351         (WebKit::WebProcessPool::platformInitializeWebProcess): Ditto.
1352         * UIProcess/soup/WebProcessPoolSoup.cpp:
1353         (WebKit::WebProcessPool::platformInitializeNetworkProcess): Ditto.
1354         (WebKit::WebProcessPool::setNetworkProxySettings): Update m_networkProxySettings and notify all processes.
1355         * WebProcess/WebProcess.h:
1356         * WebProcess/WebProcess.messages.in: Add SetNetworkProxySettings message.
1357         * WebProcess/efl/WebProcessMainEfl.cpp: Use SoupNetworkSession::setProxySettingsFromEnvironment().
1358         * WebProcess/soup/WebProcessSoup.cpp:
1359         (WebKit::WebProcess::platformSetCacheModel): Remove comment that is no longer true.
1360         (WebKit::WebProcess::platformInitializeWebProcess): Set proxy settings if provided by the user.
1361         (WebKit::WebProcess::setNetworkProxySettings): Set global proxy settings and setup the proxy for all
1362         existing contexts.
1363
1364 2017-01-19  Carlos Garcia Campos  <cgarcia@igalia.com>
1365
1366         [GTK] Do not update the backing store state unnecessarily when page visibility changes
1367         https://bugs.webkit.org/show_bug.cgi?id=167195
1368
1369         Reviewed by Sergio Villar Senin.
1370
1371         I've noticed that we are receiving UpdateBackingStoreState messages in the web process even when size and scale
1372         factor didn't change. That's quite unfortunate because we do a lot of work unnecessarily and we tell the
1373         threaded compositor that the size changed. This is not only a problem because it's not true, but also because
1374         changing the size is a sync operation in the threaded compositor, so we block the compositing thread for
1375         nothing. This is happening because the WebPageProxy notifies the drawing area that the backing store is
1376         discardable when the page is not visible, and that always produces a new backing store state. In accelerating
1377         compositing mode we don't even have a backing store to discard, so we should check we have something to discard
1378         and also make sure we only generate a new backing store state if we really discarded the backing store.
1379
1380         * UIProcess/DrawingAreaProxyImpl.cpp:
1381         (WebKit::DrawingAreaProxyImpl::discardBackingStoreSoon):
1382         (WebKit::DrawingAreaProxyImpl::discardBackingStore):
1383
1384 2017-01-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
1385
1386         [iOS][WK2] Remove the WebView private configuration contentUpdateFrequency
1387         https://bugs.webkit.org/show_bug.cgi?id=167188
1388
1389         Reviewed by Simon Fraser.
1390
1391         This patch reverts r209294. This configuration is not needed anymore.
1392         The CADisplayLink::preferredFramesPerSecond for WK2 will be set to the
1393         default value always.
1394
1395         * UIProcess/API/APIPageConfiguration.h:
1396         (API::PageConfiguration::setAlwaysRunsAtForegroundPriority):
1397         (API::PageConfiguration::contentUpdateFrequency): Deleted.
1398         (API::PageConfiguration::setContentUpdateFrequency): Deleted.
1399         (): Deleted.
1400         * UIProcess/API/Cocoa/WKWebView.mm:
1401         (-[WKWebView _initializeWithConfiguration:]):
1402         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1403         (-[WKWebViewConfiguration init]):
1404         (-[WKWebViewConfiguration copyWithZone:]):
1405         (-[WKWebViewConfiguration _setAllowsInlineMediaPlaybackAfterFullscreen:]):
1406         (-[WKWebViewConfiguration _contentUpdateFrequency]): Deleted.
1407         (-[WKWebViewConfiguration _setContentUpdateFrequency:]): Deleted.
1408         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1409         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
1410         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
1411         (-[WKOneShotDisplayLinkHandler initWithDrawingAreaProxy:]):
1412         (WebKit::RemoteLayerTreeDrawingAreaProxy::contentUpdateFrequency): Deleted.
1413
1414 2017-01-18  Ryan Haddad  <ryanhaddad@apple.com>
1415
1416         Unreviewed, rolling out r210848.
1417
1418         This change introduced media-related LayoutTest failures and
1419         crashes on macOS.
1420
1421         Reverted changeset:
1422
1423         "[Modern Media Controls] Turn modern media controls on by
1424         default"
1425         https://bugs.webkit.org/show_bug.cgi?id=165668
1426         http://trac.webkit.org/changeset/210848
1427
1428 2017-01-18  Anders Carlsson  <andersca@apple.com>
1429
1430         Add instrumentation for when we fail to receive a message
1431         https://bugs.webkit.org/show_bug.cgi?id=167179
1432
1433         Reviewed by Alexey Proskuryakov.
1434
1435         This will help us diagnose what the error from mach_msg is.
1436
1437         * Platform/IPC/mac/ConnectionMac.mm:
1438         (IPC::readFromMachPort):
1439
1440 2017-01-18  Alex Christensen  <achristensen@webkit.org>
1441
1442         Fix CFURLConnection build on Mac
1443         https://bugs.webkit.org/show_bug.cgi?id=167168
1444
1445         Reviewed by Andy Estes.
1446
1447         * NetworkProcess/Downloads/mac/DownloadMac.mm:
1448         (WebKit::Download::resume):
1449         (WebKit::Download::platformDidFinish):
1450         (WebKit::Download::platformCancelNetworkLoad):
1451         (WebKit::Download::startNetworkLoadWithHandle):
1452         (WebKit::Download::startNetworkLoad):
1453         (WebKit::Download::platformInvalidate):
1454         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1455         (WebKit::NetworkDataTaskCocoa::allowsSpecificHTTPSCertificateForHost):
1456         (WebKit::serverTrustCredential):
1457         * Shared/Authentication/mac/AuthenticationManager.mac.mm:
1458         (WebKit::AuthenticationManager::tryUseCertificateInfoForChallenge):
1459         * config.h:
1460
1461 2017-01-18  Alex Christensen  <achristensen@webkit.org>
1462
1463         Modernize DelayedReply IPC code
1464         https://bugs.webkit.org/show_bug.cgi?id=167176
1465
1466         Reviewed by Brady Eidson.
1467
1468         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1469         (WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
1470         * NetworkProcess/NetworkConnectionToWebProcess.h:
1471         * Platform/IPC/HandleMessage.h:
1472         (IPC::callMemberFunctionImpl):
1473         (IPC::callMemberFunction):
1474         (IPC::handleMessageDelayed):
1475         * Scripts/webkit/messages.py:
1476         (message_to_struct_declaration):
1477         (generate_message_handler):
1478         * UIProcess/Databases/DatabaseProcessProxy.cpp:
1479         (WebKit::DatabaseProcessProxy::getDatabaseProcessConnection):
1480         * UIProcess/Databases/DatabaseProcessProxy.h:
1481         * UIProcess/Network/NetworkProcessProxy.cpp:
1482         (WebKit::NetworkProcessProxy::getNetworkProcessConnection):
1483         (WebKit::NetworkProcessProxy::networkProcessCrashedOrFailedToLaunch):
1484         * UIProcess/Network/NetworkProcessProxy.h:
1485         * UIProcess/Plugins/PluginProcessManager.cpp:
1486         (WebKit::PluginProcessManager::getPluginProcessConnection):
1487         * UIProcess/Plugins/PluginProcessManager.h:
1488         * UIProcess/Plugins/PluginProcessProxy.cpp:
1489         (WebKit::PluginProcessProxy::getPluginProcessConnection):
1490         * UIProcess/Plugins/PluginProcessProxy.h:
1491         * UIProcess/WebPageProxy.cpp:
1492         (WebKit::WebPageProxy::runJavaScriptAlert):
1493         (WebKit::WebPageProxy::runJavaScriptConfirm):
1494         * UIProcess/WebPageProxy.h:
1495         * UIProcess/WebProcessPool.cpp:
1496         (WebKit::WebProcessPool::getNetworkProcessConnection):
1497         (WebKit::WebProcessPool::getDatabaseProcessConnection):
1498         * UIProcess/WebProcessPool.h:
1499         * UIProcess/WebProcessProxy.cpp:
1500         (WebKit::WebProcessProxy::getPluginProcessConnection):
1501         (WebKit::WebProcessProxy::getNetworkProcessConnection):
1502         (WebKit::WebProcessProxy::getDatabaseProcessConnection):
1503         * UIProcess/WebProcessProxy.h:
1504
1505 2017-01-18  Alex Christensen  <achristensen@webkit.org>
1506
1507         Fix CMake build.
1508
1509         * PlatformMac.cmake:
1510
1511 2017-01-18  Megan Gardner  <megan_gardner@apple.com>
1512
1513         Ignore Connection Assertion if we are not using connection to send messages
1514         https://bugs.webkit.org/show_bug.cgi?id=167022
1515
1516         Reviewed by Darin Adler.
1517
1518         Ask the process about a particular connection rather that getting it and making the     
1519         comparison ourselves. 
1520
1521         * UIProcess/ChildProcessProxy.h:
1522         (WebKit::ChildProcessProxy::hasConnection):
1523         Check to see the the ProcessProxy has this particular connection. This get around the assert
1524         that we would run into when just requesting the connection directly.
1525         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
1526         (WebKit::WebPasteboardProxy::setPasteboardPathnamesForType):
1527         Use the new check instead of getting the raw connection.
1528
1529 2017-01-18  Andreas Kling  <akling@apple.com>
1530
1531         Document::securityOrigin() should return a reference.
1532         <https://webkit.org/b/167124>
1533
1534         Reviewed by Sam Weinig.
1535
1536         * UIProcess/Storage/StorageManager.cpp:
1537         (WebKit::StorageManager::createTransientLocalStorageMap):
1538         * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
1539         (WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation):
1540         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
1541         (WKBundleFrameCopySecurityOrigin):
1542         * WebProcess/Plugins/PluginView.cpp:
1543         (WebKit::PluginView::storageBlockingStateChanged):
1544         (WebKit::PluginView::performFrameLoadURLRequest):
1545         (WebKit::PluginView::isPrivateBrowsingEnabled):
1546         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
1547         (WebKit::WebPluginInfoProvider::getWebVisiblePluginInfo):
1548         * WebProcess/Storage/StorageAreaMap.cpp:
1549         (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
1550         (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
1551         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1552         (WebKit::WebChromeClient::exceededDatabaseQuota):
1553         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1554         (WebKit::WebFrameLoaderClient::didRunInsecureContent):
1555         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1556         * WebProcess/WebPage/WebFrame.cpp:
1557         (WebKit::WebFrame::allowsFollowingLink):
1558
1559 2017-01-18  Antoine Quint  <graouts@apple.com>
1560
1561         [Modern Media Controls] Turn modern media controls on by default
1562         https://bugs.webkit.org/show_bug.cgi?id=165668
1563
1564         Reviewed by Dean Jackson.
1565
1566         Use DEFAULT_EXPERIMENTAL_FEATURES_ENABLED as the default value for modern media controls, which is true.
1567
1568         * Shared/WebPreferencesDefinitions.h:
1569
1570 2017-01-15  Darin Adler  <darin@apple.com>
1571
1572         Remove PassRefPtr from "loader" directory of WebCore
1573         https://bugs.webkit.org/show_bug.cgi?id=167055
1574
1575         Reviewed by Alex Christensen.
1576
1577         * Shared/APIWebArchive.h: Use RefPtr&& instead of PassRefPtr.
1578         * Shared/APIWebArchive.mm:
1579         (API::WebArchive::create): Ditto.
1580         (API::WebArchive::WebArchive): Ditto.
1581         (API::WebArchive::subresources): Ditto.
1582         (API::WebArchive::subframeArchives): Ditto.
1583
1584         * Shared/TextCheckerState.h: Initialize data members so classes
1585         using this won't have to explicitly initalize them.
1586
1587         * UIProcess/WebIconDatabase.cpp:
1588         (WebKit::WebIconDatabase::setIconDataForIconURL): Pass a raw
1589         pointer to WebCore.
1590
1591         * UIProcess/WebPageProxy.h: Removed forward declaration of
1592         StringPairVector, not needed here.
1593
1594         * WebProcess/IconDatabase/WebIconDatabaseProxy.cpp:
1595         (WebKit::WebIconDatabaseProxy::WebIconDatabaseProxy): Take a reference.
1596         (WebKit::WebIconDatabaseProxy::retainIconForPageURL): Updated for reference.
1597         (WebKit::WebIconDatabaseProxy::releaseIconForPageURL): Ditto.
1598         (WebKit::WebIconDatabaseProxy::synchronousIconForPageURL): Ditto.
1599         (WebKit::WebIconDatabaseProxy::loadDecisionForIconURL): Ditto.
1600         (WebKit::WebIconDatabaseProxy::receivedIconLoadDecision): Ditto.
1601         (WebKit::WebIconDatabaseProxy::iconDataForIconURL): Ditto.
1602         (WebKit::WebIconDatabaseProxy::setIconURLForPageURL): Ditto.
1603         (WebKit::WebIconDatabaseProxy::setIconDataForIconURL): Ditto.
1604         * WebProcess/IconDatabase/WebIconDatabaseProxy.h: Updated for the above.
1605         Marked the class final, made most functions private and final.
1606
1607         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
1608         (WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction):
1609         Removed assertion that a pointer is non-null since that pointer is now a
1610         reference. Left use of PassRefPtr here for now.z
1611
1612         * WebProcess/Network/WebLoaderStrategy.cpp:
1613         (WebKit::WebLoaderStrategy::scheduleLoad): Updated since application cache
1614         host is now a reference rather thna a pointer.
1615         * WebProcess/Network/WebResourceLoader.cpp:
1616         (WebKit::WebResourceLoader::willSendRequest): Ditto.
1617         (WebKit::WebResourceLoader::didReceiveResponse): Ditto.
1618         (WebKit::WebResourceLoader::didFailResourceLoad): Ditto.
1619
1620         * WebProcess/Plugins/PluginView.cpp:
1621         (WebKit::buildHTTPHeaders): Got rid of unneeded use of String::format.
1622         (WebKit::PluginView::create): Take a reference instead of PassRefPtr.
1623         (WebKit::PluginView::PluginView): Ditto. Also moved much of the data
1624         member initialization to the class definition.
1625         (WebKit::PluginView::recreateAndInitialize): Take Ref&& instead of PassRefPtr.
1626         (WebKit::PluginView::manualLoadDidReceiveResponse): Updated for change to
1627         ManualStreamState enumeration.
1628         (WebKit::PluginView::manualLoadDidReceiveData): Ditto.
1629         (WebKit::PluginView::manualLoadDidFinishLoading Ditto.):
1630         (WebKit::PluginView::manualLoadDidFail): Ditto.
1631         (WebKit::PluginView::liveResourceData): Return RefPtr insead of PassRefPtr.
1632         (WebKit::PluginView::redeliverManualStream): Updated for ManualStreamState.
1633         * WebProcess/Plugins/PluginView.h: Updated for the above. Also changed
1634         ManualStreamState into an enum class.
1635
1636         * WebProcess/WebCoreSupport/WebChromeClient.cpp: Changed m_page to a reference.
1637         (WebKit::WebChromeClient::runOpenPanel): Take both arguments as references.
1638         * WebProcess/WebCoreSupport/WebChromeClient.h: Updated for the above.
1639
1640         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1641         (WebKit::WebEditorClient::registerUndoStep): Take reference instead of PassRefPtr.
1642         (WebKit::WebEditorClient::registerRedoStep): Ditto.
1643         * WebProcess/WebCoreSupport/WebEditorClient.h: Updated for the above
1644
1645         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1646         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
1647         Updated for change to FrameLoaderClient.
1648         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Ditto.
1649         (WebKit::WebFrameLoaderClient::dispatchWillSendSubmitEvent): Ditto.
1650         (WebKit::WebFrameLoaderClient::dispatchWillSubmitForm): Ditto.
1651         (WebKit::WebFrameLoaderClient::createFrame): Ditto.
1652         (WebKit::WebFrameLoaderClient::createPlugin): Ditto.
1653         (WebKit::WebFrameLoaderClient::recreatePlugin): Ditto.
1654         (WebKit::WebFrameLoaderClient::createJavaAppletWidget): Ditto.
1655         (WebKit::WebFrameLoaderClient::createNetworkingContext): Ditto.
1656         (WebKit::WebFrameLoaderClient::didRequestAutocomplete): Ditto.
1657         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: Updated for the above.
1658
1659         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
1660         (WebKit::WebChromeClient::didReceiveMobileDocType): Updated since m_page is a
1661         reference now.
1662         (WebKit::WebChromeClient::observedContentChange): Ditto.
1663         (WebKit::WebChromeClient::notifyRevealedSelectionByScrollingFrame): Ditto.
1664         (WebKit::WebChromeClient::didLayout): Ditto.
1665         (WebKit::WebChromeClient::didStartOverflowScroll): Ditto.
1666         (WebKit::WebChromeClient::didEndOverflowScroll): Ditto.
1667         (WebKit::WebChromeClient::hasStablePageScaleFactor): Ditto.
1668         (WebKit::WebChromeClient::showPlaybackTargetPicker): Ditto.
1669         (WebKit::WebChromeClient::eventThrottlingDelay): Ditto.
1670         (WebKit::WebChromeClient::deviceOrientation): Ditto.
1671
1672         * WebProcess/WebPage/WebPage.cpp:
1673         (WebKit::WebPage::WebPage): Pass reference.
1674         (WebKit::WebPage::createPlugin): Return RefPtr instead of PassRefPtr.
1675         (WebKit::WebPage::fromCorePage): Updated for change to WebChromeClient.
1676         (WebKit::WebPage::setHeaderPageBanner): Take pointer instead of PassRefPtr.
1677         (WebKit::WebPage::setFooterPageBanner): Ditto.
1678         (WebKit::WebPage::setActiveOpenPanelResultListener): Take Ref&& instead of
1679         PassRefPtr.
1680         (WebKit::WebPage::currentSelectionAsRange): Return RefPtr instead of PassRefPtr.
1681         (WebKit::WebPage::rangeFromEditingRange): Ditto.
1682         * WebProcess/WebPage/WebPage.h: Updated for the above.
1683
1684         * WebProcess/WebPage/efl/WebPageEfl.cpp:
1685         (WebKit::WebPage::cachedResponseDataForURL): Return RefPtr instead of PassRefPtr.
1686         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
1687         (WebKit::WebPage::cachedResponseDataForURL): Ditto.
1688         * WebProcess/WebPage/ios/WebPageIOS.mm:
1689         (WebKit::WebPage::cachedResponseDataForURL): Ditto.
1690         * WebProcess/WebPage/mac/WebPageMac.mm:
1691         (WebKit::WebPage::cachedResponseDataForURL): Ditto.
1692         (WebKit::WebPage::setTopOverhangImage): Take raw pointer instead of PassRefPtr.
1693         (WebKit::WebPage::setBottomOverhangImage): Ditto.
1694
1695         * WebProcess/WebProcess.cpp:
1696         (WebKit::WebProcess::WebProcess): Pass a reference. Move most initialization to
1697         the class definition.
1698         * WebProcess/WebProcess.h: Updaed for the above.
1699
1700 2017-01-17  Michael Catanzaro  <mcatanzaro@igalia.com>
1701
1702         Unreviewed, rolling out r210834
1703         https://bugs.webkit.org/show_bug.cgi?id=165668
1704
1705         It introduced dozens of test timeouts.
1706
1707         Reverted changeset:
1708         "[Modern Media Controls] Turn modern media controls on by default"
1709         https://bugs.webkit.org/show_bug.cgi?id=165668
1710         http://trac.webkit.org/changeset/210834
1711
1712 2017-01-17  Antti Koivisto  <antti@apple.com>
1713
1714         Persist derived data
1715         https://bugs.webkit.org/show_bug.cgi?id=167136
1716
1717         Reviewed by Andreas Kling.
1718
1719         Add a mechanism for storing arbitrary data into disk cache.
1720
1721         From WebCore level data can be stored using
1722
1723             loaderStrategy()->storeDerivedDataToCache(key, partition, type, data);
1724
1725         The data is keyed with the body hash of a network resource. It can be retrieved along
1726         with the resource by specifying the type in ResourceLoaderOptions. If a related data
1727         blob is found it will be deliver via CachedResource::didRetrieveDerivedDataFromCache()
1728         callback.
1729
1730         This patch adds the mechanism but doesn't yet use it for anything.
1731
1732         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1733         (WebKit::NetworkConnectionToWebProcess::storeDerivedDataToCache):
1734         * NetworkProcess/NetworkConnectionToWebProcess.h:
1735         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1736         * NetworkProcess/NetworkResourceLoadParameters.cpp:
1737         (WebKit::NetworkResourceLoadParameters::encode):
1738         (WebKit::NetworkResourceLoadParameters::decode):
1739         * NetworkProcess/NetworkResourceLoadParameters.h:
1740         * NetworkProcess/NetworkResourceLoader.cpp:
1741         (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
1742
1743             Look for related resources to return if needed.
1744
1745         (WebKit::NetworkResourceLoader::sendResultForCacheEntry):
1746         * NetworkProcess/NetworkResourceLoader.h:
1747         * NetworkProcess/cache/NetworkCache.cpp:
1748         (WebKit::NetworkCache::resourceType):
1749          (WebKit::NetworkCache::Cache::retrieveData):
1750         (WebKit::NetworkCache::Cache::storeData):
1751         (WebKit::NetworkCache::Cache::makeCacheKey): Deleted.
1752         * NetworkProcess/cache/NetworkCache.h:
1753         * NetworkProcess/cache/NetworkCacheEntry.cpp:
1754         (WebKit::NetworkCache::Entry::encodeAsStorageRecord):
1755         (WebKit::NetworkCache::Entry::decodeStorageRecord):
1756         * NetworkProcess/cache/NetworkCacheKey.cpp:
1757         (WebKit::NetworkCache::Key::Key):
1758         * NetworkProcess/cache/NetworkCacheKey.h:
1759         (WebKit::NetworkCache::DataKey::encode):
1760         (WebKit::NetworkCache::DataKey::decode):
1761         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1762         (WebKit::NetworkCache::Storage::readRecord):
1763         (WebKit::NetworkCache::Storage::traverse):
1764         * NetworkProcess/cache/NetworkCacheStorage.h:
1765
1766             Return body hash with the Record.
1767
1768         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
1769         (WebKit::NetworkCache::SubresourcesEntry::encodeAsStorageRecord):
1770         * Platform/IPC/ArgumentCoders.cpp:
1771         (IPC::ArgumentCoder<SHA1::Digest>::encode):
1772         (IPC::ArgumentCoder<SHA1::Digest>::decode):
1773         * Platform/IPC/ArgumentCoders.h:
1774         * WebProcess/Network/WebLoaderStrategy.cpp:
1775         (WebKit::WebLoaderStrategy::scheduleLoad):
1776         (WebKit::WebLoaderStrategy::storeDerivedDataToCache):
1777         * WebProcess/Network/WebLoaderStrategy.h:
1778         * WebProcess/Network/WebResourceLoader.cpp:
1779         (WebKit::WebResourceLoader::didRetrieveDerivedData):
1780         * WebProcess/Network/WebResourceLoader.h:
1781         * WebProcess/Network/WebResourceLoader.messages.in:
1782
1783 2017-01-17  Antoine Quint  <graouts@apple.com>
1784
1785         [Modern Media Controls] Turn modern media controls on by default
1786         https://bugs.webkit.org/show_bug.cgi?id=165668
1787
1788         Reviewed by Dean Jackson.
1789
1790         Use DEFAULT_EXPERIMENTAL_FEATURES_ENABLED as the default value for modern media controls, which is true.
1791
1792         * Shared/WebPreferencesDefinitions.h:
1793
1794 2017-01-17  Joseph Pecoraro  <pecoraro@apple.com>
1795
1796         ENABLE(USER_TIMING) Not Defined for Apple Windows or OS X Ports
1797         https://bugs.webkit.org/show_bug.cgi?id=116551
1798         <rdar://problem/13949830>
1799
1800         Reviewed by Alex Christensen.
1801
1802         * Configurations/FeatureDefines.xcconfig:
1803
1804 2017-01-17  Filip Pizlo  <fpizlo@apple.com>
1805
1806         JSCell::classInfo() shouldn't have a bunch of mitigations for being called during destruction
1807         https://bugs.webkit.org/show_bug.cgi?id=167066
1808
1809         Reviewed by Keith Miller and Michael Saboff.
1810         
1811         Just remove now-erroneous use of jsCast<>.
1812
1813         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
1814         (WebKit::NPRuntimeObjectMap::finalize):
1815
1816 2017-01-17  Joseph Pecoraro  <pecoraro@apple.com>
1817
1818         Remove unnecessary includes
1819         https://bugs.webkit.org/show_bug.cgi?id=167114
1820
1821         Reviewed by Alex Christensen.
1822
1823         * WebProcess/WebPage/ios/WebPageIOS.mm:
1824
1825 2017-01-17  Brady Eidson  <beidson@apple.com>
1826
1827         An update to one gamepad's values should only change that gamepad's modified timestamp.
1828         <rdar://problem/28620865> and https://bugs.webkit.org/show_bug.cgi?id=167139
1829
1830         Reviewed by Andy Estes.
1831
1832         Track the lastModifiedTime for a gamepad in the UI process, and pass it along to web processes.
1833
1834         * Shared/Gamepad/GamepadData.cpp:
1835         (WebKit::GamepadData::GamepadData):
1836         (WebKit::GamepadData::encode):
1837         (WebKit::GamepadData::decode):
1838         * Shared/Gamepad/GamepadData.h:
1839         (WebKit::GamepadData::lastUpdateTime):
1840
1841         * UIProcess/Gamepad/UIGamepad.cpp:
1842         (WebKit::UIGamepad::UIGamepad):
1843         (WebKit::UIGamepad::updateFromPlatformGamepad):
1844         (WebKit::UIGamepad::condensedGamepadData):
1845         (WebKit::UIGamepad::fullGamepadData):
1846         * UIProcess/Gamepad/UIGamepad.h:
1847
1848         * WebProcess/Gamepad/WebGamepad.cpp:
1849         (WebKit::WebGamepad::updateValues):
1850
1851 2017-01-17  Anders Carlsson  <andersca@apple.com>
1852
1853         It's not possible to perform a POST request with HTTPBody content in a WKWebView
1854         https://bugs.webkit.org/show_bug.cgi?id=167131
1855         rdar://problem/20464240
1856
1857         Reviewed by Beth Dakin.
1858
1859         Encode/decode the form data if necessary.
1860
1861         * Shared/LoadParameters.cpp:
1862         (WebKit::LoadParameters::encode):
1863         (WebKit::LoadParameters::decode):
1864
1865 2017-01-17  Joseph Pecoraro  <pecoraro@apple.com>
1866
1867         Crash when closing tab with debugger paused
1868         https://bugs.webkit.org/show_bug.cgi?id=161746
1869         <rdar://problem/15607819>
1870
1871         Reviewed by Brian Burg and Brent Fulgham.
1872
1873         * WebProcess/WebPage/WebPage.cpp:
1874         (WebKit::DeferredPageDestructor::createDeferredPageDestructor):
1875         (WebKit::DeferredPageDestructor::DeferredPageDestructor):
1876         (WebKit::DeferredPageDestructor::tryDestruction):
1877         (WebKit::WebPage::close):
1878         Defer destruction of the Page and WebPage if we are in a nested runloop.
1879         Also, proactively close all inspector frontends, including remote frontends.
1880
1881         * WebProcess/WebPage/ios/WebPageIOS.mm:
1882         (WebKit::WebPage::handleSyntheticClick):
1883         (WebKit::WebPage::completeSyntheticClick):
1884         Return early in some cases where a nested run loop may have closed
1885         the WebPage on us while handling JavaScript events.
1886
1887 2017-01-16  Joseph Pecoraro  <pecoraro@apple.com>
1888
1889         Remove the REQUEST_ANIMATION_FRAME flag
1890         https://bugs.webkit.org/show_bug.cgi?id=156980
1891         <rdar://problem/25906849>
1892
1893         Reviewed by Simon Fraser.
1894
1895         * Configurations/FeatureDefines.xcconfig:
1896         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1897         * WebProcess/WebCoreSupport/WebChromeClient.h:
1898         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
1899         (WebKit::CompositingCoordinator::syncDisplayState):
1900         (WebKit::CompositingCoordinator::nextAnimationServiceTime):
1901         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
1902         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
1903         (WebKit::CoordinatedLayerTreeHost::scheduleAnimation):
1904         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
1905         * WebProcess/WebPage/LayerTreeHost.h:
1906
1907 2017-01-16  Carlos Garcia Campos  <cgarcia@igalia.com>
1908
1909         [SOUP] Accept-language could be set twice in a row for the default context
1910         https://bugs.webkit.org/show_bug.cgi?id=167089
1911
1912         Reviewed by Žan Doberšek.
1913
1914         * NetworkProcess/CustomProtocols/soup/CustomProtocolManagerSoup.cpp:
1915         (WebKit::CustomProtocolManager::registerScheme): Use NetworkStorageSession::getOrCreateSoupNetworkSession().
1916         * NetworkProcess/efl/NetworkProcessMainEfl.cpp:
1917         * NetworkProcess/soup/NetworkProcessSoup.cpp:
1918         (WebKit::NetworkProcess::userPreferredLanguagesChanged): Only set the languages if NetworkStorageSession has a
1919         SoupNetworkSession.
1920         * NetworkProcess/soup/NetworkSessionSoup.cpp:
1921         (WebKit::NetworkSessionSoup::soupSession): Use NetworkStorageSession::getOrCreateSoupNetworkSession().
1922         * WebProcess/Cookies/soup/WebCookieManagerSoup.cpp:
1923         (WebKit::WebCookieManager::setCookiePersistentStorage): Ditto.
1924         * WebProcess/efl/WebProcessMainEfl.cpp:
1925
1926 2017-01-16  Carlos Garcia Campos  <cgarcia@igalia.com>
1927
1928         [SOUP] Fix handling of accept language property
1929         https://bugs.webkit.org/show_bug.cgi?id=166969
1930
1931         Reviewed by Michael Catanzaro.
1932
1933         * NetworkProcess/soup/NetworkProcessSoup.cpp:
1934         (WebKit::buildAcceptLanguages): Moved from WebCore.
1935         (WebKit::NetworkProcess::userPreferredLanguagesChanged): Build the accept language string from the vector and
1936         pass set it to SoupNetworkSession to be used for new sessions, and also to all other existing sessions.
1937
1938 2017-01-14  Tim Horton  <timothy_horton@apple.com>
1939
1940         Remove unused WKView initializer parameter
1941         https://bugs.webkit.org/show_bug.cgi?id=167046
1942
1943         Reviewed by Dan Bernstein.
1944
1945         * UIProcess/API/mac/WKView.mm:
1946         (-[WKView initWithFrame:processPool:configuration:]):
1947         (-[WKView initWithFrame:contextRef:pageGroupRef:relatedToPage:]):
1948         (-[WKView initWithFrame:configurationRef:]):
1949         (-[WKView initWithFrame:processPool:configuration:webView:]): Deleted.
1950         * UIProcess/API/mac/WKViewInternal.h:
1951         Ever since WKWebView stopped having WKView inside it, this parameter
1952         has never been used. Now, it only leads to confusion.
1953
1954 2017-01-13  Joseph Pecoraro  <pecoraro@apple.com>
1955
1956         Remove ENABLE(DETAILS_ELEMENT) guards
1957         https://bugs.webkit.org/show_bug.cgi?id=167042
1958
1959         Reviewed by Alex Christensen.
1960
1961         * Configurations/FeatureDefines.xcconfig:
1962
1963 2017-01-13  Brady Eidson  <beidson@apple.com>
1964
1965         Crash when visiting a webpage that uses Gamepads in a new WebProcess after a previous page has used gamepads..
1966         https://bugs.webkit.org/show_bug.cgi?id=167033
1967
1968         Reviewed by Alex Christensen.
1969
1970         * UIProcess/Gamepad/UIGamepadProvider.cpp:
1971         (WebKit::UIGamepadProvider::processPoolStartedUsingGamepads): Don't schedule a state update here.
1972         (WebKit::UIGamepadProvider::processPoolStoppedUsingGamepads): Ditto.
1973         * UIProcess/Gamepad/UIGamepadProvider.h:
1974         
1975         * UIProcess/WebProcessPool.cpp:
1976         (WebKit::WebProcessPool::startedUsingGamepads): Populate the WebProcess with initial gamepads.
1977
1978 2017-01-11  Darin Adler  <darin@apple.com>
1979
1980         Remove PassRefPtr from more of "platform"
1981         https://bugs.webkit.org/show_bug.cgi?id=166809
1982
1983         Reviewed by Sam Weinig.
1984
1985         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
1986         (IPC::ArgumentCoder<TextureMapperAnimation>::encode): Updated since timing function
1987         returns a raw pointer.
1988         (IPC::ArgumentCoder<TextureMapperAnimation>::decode): Updated since timing function
1989         setters now takes an rvalue reference.
1990
1991         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
1992         (WebKit::PDFPlugin::createScrollbar): Updated since addChild now takes a reference.
1993
1994 2017-01-13  Chris Dumez  <cdumez@apple.com>
1995
1996         [WK2] Add diagnostic logging to measure WebGL usage
1997         https://bugs.webkit.org/show_bug.cgi?id=166730
1998         <rdar://problem/29883469>
1999
2000         Reviewed by Alex Christensen.
2001
2002         Add diagnostic logging to measure high performance WebGL usage. We report
2003         at regular intervals in which WebGL state Safari is:
2004         - Inactive
2005         - ActiveInForegroundTab
2006         - ActiveInBackgroundTabOnly
2007
2008         This should give us an estimate of:
2009         - What % of the time is Safari using high performance graphics
2010         - What % of this time is only due to background tabs
2011
2012         * UIProcess/HighPerformanceGraphicsUsageSampler.cpp: Added.
2013         (WebKit::HighPerformanceGraphicsUsageSampler::HighPerformanceGraphicsUsageSampler):
2014         (WebKit::HighPerformanceGraphicsUsageSampler::timerFired):
2015         * UIProcess/HighPerformanceGraphicsUsageSampler.h: Copied from Source/WebCore/platform/graphics/GraphicsContext3DAttributes.h.
2016         * UIProcess/WebPageProxy.h:
2017         (WebKit::WebPageProxy::setIsUsingHighPerformanceWebGL):
2018         (WebKit::WebPageProxy::isUsingHighPerformanceWebGL):
2019         * UIProcess/WebPageProxy.messages.in:
2020         * UIProcess/WebProcessPool.cpp:
2021         (WebKit::m_highPerformanceGraphicsUsageSampler):
2022         * UIProcess/WebProcessPool.h:
2023         * WebKit2.xcodeproj/project.pbxproj:
2024         * WebProcess/WebPage/WebPage.cpp:
2025         (WebKit::m_userInterfaceLayoutDirection):
2026
2027 2017-01-13  Matt Rajca  <mrajca@apple.com>
2028
2029         Defer use of autoplay heuristics to clients
2030         https://bugs.webkit.org/show_bug.cgi?id=167010
2031
2032         Reviewed by Alex Christensen.
2033
2034         Switch the autoplay policy tristate to an on/off option since clients should run any
2035         heuristics and simply send their final decision to WebKit.
2036
2037         * Shared/WebsitePolicies.h:
2038         (WebKit::WebsitePolicies::encode):
2039         (WebKit::WebsitePolicies::decode):
2040         * UIProcess/API/APIWebsitePolicies.h:
2041         * UIProcess/API/C/WKWebsitePolicies.cpp:
2042         (WKWebsitePoliciesGetAutoplayEnabled):
2043         (WKWebsitePoliciesSetAutoplayEnabled):
2044         (WKWebsitePoliciesGetAutoplayPolicy): Replaced.
2045         (WKWebsitePoliciesSetAutoplayPolicy): Replaced.
2046         * UIProcess/API/C/WKWebsitePolicies.h:
2047         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
2048         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
2049         (-[_WKWebsitePolicies setAutoplayEnabled:]):
2050         (-[_WKWebsitePolicies autoplayEnabled]):
2051         (-[_WKWebsitePolicies setAutoplayPolicy:]): Replaced.
2052         (-[_WKWebsitePolicies autoplayPolicy]): Replaced.
2053
2054 2017-01-13  Carlos Garcia Campos  <cgarcia@igalia.com>
2055
2056         [SOUP] Simplify cookie storage handling
2057         https://bugs.webkit.org/show_bug.cgi?id=166967
2058
2059         Reviewed by Sergio Villar Senin.
2060
2061         Get the SoupSession from NetworkStorageSession::defaultStorageSession().
2062
2063         * NetworkProcess/CustomProtocols/soup/CustomProtocolManagerSoup.cpp:
2064         (WebKit::CustomProtocolManager::registerScheme): Get the SoupSession from NetworkStorageSession::defaultStorageSession().
2065         * NetworkProcess/efl/NetworkProcessMainEfl.cpp: Ditto.
2066         * NetworkProcess/soup/NetworkProcessSoup.cpp:
2067         (WebKit::NetworkProcess::userPreferredLanguagesChanged): Ditto.
2068         (WebKit::NetworkProcess::platformInitializeNetworkProcess): SoupNetworkSession::clearOldSoupCache is static.
2069         * WebProcess/Cookies/soup/WebCookieManagerSoup.cpp:
2070         (WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy): Use the cookie storage from NetworkStorageSession::defaultStorageSession().
2071         (WebKit::WebCookieManager::setCookiePersistentStorage): Ditto.
2072         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
2073         (WebKit::WebFrameNetworkingContext::setCookieAcceptPolicyForAllContexts): Ditto.
2074         * WebProcess/efl/WebProcessMainEfl.cpp:
2075
2076 2017-01-12  Carlos Garcia Campos  <cgarcia@igalia.com>
2077
2078         [SOUP] Do not use the legacy session ID in WebFrameNetworkingContext::storageSession()
2079         https://bugs.webkit.org/show_bug.cgi?id=166970
2080
2081         Reviewed by Sergio Villar Senin.
2082
2083         Get the session for the current page instead.
2084
2085         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
2086         (WebKit::WebFrameNetworkingContext::storageSession):
2087
2088 2017-01-12  Joseph Pecoraro  <pecoraro@apple.com>
2089
2090         Remove unnecessary includes of Page.h
2091         https://bugs.webkit.org/show_bug.cgi?id=166996
2092
2093         Reviewed by Yusuke Suzuki.
2094
2095         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
2096
2097 2017-01-12  Chris Dumez  <cdumez@apple.com>
2098
2099         Add KEYBOARD_KEY_ATTRIBUTE / KEYBOARD_CODE_ATTRIBUTE to FeatureDefines.xcconfig
2100         https://bugs.webkit.org/show_bug.cgi?id=166995
2101
2102         Reviewed by Jer Noble.
2103
2104         Add KEYBOARD_KEY_ATTRIBUTE / KEYBOARD_CODE_ATTRIBUTE to FeatureDefines.xcconfig
2105         as some people are having trouble building without it.
2106
2107         * Configurations/FeatureDefines.xcconfig:
2108         * Shared/WebKeyboardEvent.cpp:
2109         (WebKit::WebKeyboardEvent::WebKeyboardEvent):
2110
2111 2017-01-12  Chris Dumez  <cdumez@apple.com>
2112
2113         [iOS] HTML form validation popover sometimes does not go away
2114         https://bugs.webkit.org/show_bug.cgi?id=166990
2115         <rdar://problem/29985957>
2116
2117         Reviewed by Tim Horton.
2118
2119         Update code using ValidationBubble now that it is RefCounted.
2120
2121         * UIProcess/PageClient.h:
2122         * UIProcess/WebPageProxy.h:
2123         * UIProcess/ios/PageClientImplIOS.h:
2124         * UIProcess/ios/PageClientImplIOS.mm:
2125         (WebKit::PageClientImpl::createValidationBubble):
2126         * UIProcess/mac/PageClientImpl.h:
2127         * UIProcess/mac/PageClientImpl.mm:
2128         (WebKit::PageClientImpl::createValidationBubble):
2129
2130 2017-01-12  Enrica Casucci  <enrica@apple.com>
2131
2132         Do not allow selection of editable content when not editing.
2133         https://bugs.webkit.org/show_bug.cgi?id=166897
2134         <rdar://problem/29388806>
2135
2136         Reviewed by Tim Horton.
2137
2138         Test: fast/events/touch/ios/long-press-on-editable.html
2139
2140         When retrieving the position information, we should not consider
2141         as candidates for selection editable elements, since this is only
2142         used for non editable selections.
2143
2144         * WebProcess/WebPage/ios/WebPageIOS.mm:
2145         (WebKit::isAssistableElement): Moved within the file.
2146         (WebKit::WebPage::getPositionInformation):
2147
2148 2017-01-12  Megan Gardner  <megan_gardner@apple.com>
2149
2150         Double Check URLs on UI side before putting in pasteboard
2151         https://bugs.webkit.org/show_bug.cgi?id=166945
2152         <rdar://problem/11187315>
2153
2154         Reviewed by Tim Horton.
2155
2156         Check URLs sent from the web process before putting the on pasteboard.
2157
2158         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
2159         (WebKit::WebPasteboardProxy::setPasteboardPathnamesForType):
2160         Add a check to make sure the URLs we've received are valid and not compromising to the user's system.
2161
2162         * UIProcess/WebPasteboardProxy.cpp:
2163         (WebKit::WebPasteboardProxy::addWebProcessProxy):
2164         Keep track of the webProcesses associated with the pasteboard proxies specifically, so that we can
2165         use it to check the URLs before putting them on pasteboard.
2166         (WebKit::WebPasteboardProxy::removeWebProcessProxy):
2167         Remove dead webProcesses.
2168
2169         * UIProcess/WebPasteboardProxy.h:
2170         * UIProcess/WebPasteboardProxy.messages.in:
2171         Allow for the connection to be passed in, so that we can determine which webProcess we need to
2172         check the URLs of.
2173
2174         * UIProcess/WebProcessProxy.cpp:
2175         (WebKit::WebProcessProxy::~WebProcessProxy):
2176         Make sure to remove WebProcessProxys from the list stored in WebPasteboardProxy
2177
2178 2017-01-12  Chris Dumez  <cdumez@apple.com>
2179
2180         [iOS] Implement support for KeyboardEvent.code
2181         https://bugs.webkit.org/show_bug.cgi?id=166932
2182         <rdar://problem/29972518>
2183
2184         Reviewed by Darin Adler.
2185
2186         Make sure KeyboardEvent.code is properly initialized on
2187         iOS WK2.
2188
2189         * Shared/WebEvent.h:
2190         * Shared/WebKeyboardEvent.cpp:
2191         (WebKit::WebKeyboardEvent::WebKeyboardEvent):
2192         * Shared/ios/WebIOSEventFactory.mm:
2193         (WebIOSEventFactory::createWebKeyboardEvent):
2194
2195 2017-01-12  Andreas Kling  <akling@apple.com>
2196
2197         WebBackForwardListProxy should remove restored session history items from PageCache on close.
2198         <https://webkit.org/b/166972>
2199         <rdar://problem/28904157>
2200
2201         Reviewed by Brady Eidson.
2202
2203         Register history item ID's from the UIProcess with the associated-items map
2204         so that we can remove any PageCache entries associated with them immediately
2205         when closing a WebPage.
2206
2207         Otherwise they might not get removed until the next PageCache pruning happens.
2208         This patch is a speculative fix for what looks like it might be weirdness
2209         related to a PageCache entry outliving its originating Page.
2210
2211         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
2212         (WebKit::WebBackForwardListProxy::addItemFromUIProcess):
2213         * WebProcess/WebPage/WebBackForwardListProxy.h:
2214         * WebProcess/WebPage/WebPage.cpp:
2215         (WebKit::WebPage::restoreSessionInternal):
2216
2217 2017-01-12  Michael Catanzaro  <mcatanzaro@igalia.com>
2218
2219         [GTK] Correct license on WebKitSecurityOrigin headers
2220
2221         These ought to be LGPLv2+, because the rest of the GTK+ API is LPGLv2+.
2222
2223         * UIProcess/API/gtk/WebKitSecurityOrigin.cpp:
2224         * UIProcess/API/gtk/WebKitSecurityOrigin.h:
2225         * UIProcess/API/gtk/WebKitSecurityOriginPrivate.h:
2226
2227 2017-01-12  Eric Carlson  <eric.carlson@apple.com>
2228
2229         [MediaStream, Mac] Render media stream audio buffers
2230         https://bugs.webkit.org/show_bug.cgi?id=159836
2231         <rdar://problem/27380390>
2232
2233         Unreviewed, revert accidental change.
2234
2235         * WebProcess/com.apple.WebProcess.sb.in:
2236
2237 2017-01-11  Brady Eidson  <beidson@apple.com>
2238
2239         Add IconLoadingDelegate functionality to WKView.
2240         https://bugs.webkit.org/show_bug.cgi?id=166951
2241
2242         Reviewed by Tim Horton.
2243         
2244         * UIProcess/API/mac/WKView.mm:
2245         (-[WKView dealloc]):
2246         (-[WKView maybeInstallIconLoadingClient]): If the subclass implements the delegate method, install the
2247           icon loading client. Otherwise, maintain the normal IconDatabase loading behavior.
2248         (-[WKView initWithFrame:processPool:configuration:webView:]):
2249
2250 2017-01-11  Brent Fulgham  <bfulgham@apple.com>
2251
2252         [WK2][Cocoa] Avoid null dereference in FullScreen code.
2253         https://bugs.webkit.org/show_bug.cgi?id=166957
2254         <rdar://problem/27745004>
2255
2256         Reviewed by Eric Carlson.
2257
2258         * WebProcess/cocoa/WebVideoFullscreenManager.mm:
2259         (WebKit::WebVideoFullscreenManager::didSetupFullscreen): Use protected reference to 'this', and check for valid
2260         page before attempting to use it.
2261
2262 2017-01-11  Anders Carlsson  <andersca@apple.com>
2263
2264         navigator.plugins.refresh and WKContextRefreshPlugIns doesn't pick up changes to already-present plug-ins
2265         https://bugs.webkit.org/show_bug.cgi?id=166942
2266         rdar://problem/29839194
2267
2268         Reviewed by Sam Weinig.
2269
2270         Use _CFBundleCreateUnique so the resulting bundle won't be cached.
2271
2272         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
2273         (WebKit::NetscapePluginModule::getPluginInfo):
2274
2275 2017-01-11  Anders Carlsson  <andersca@apple.com>
2276
2277         REGRESSION: Crash in com.apple.WebKit: IPC::Connection::sendMessage(std::__1::unique_ptr<IPC::MachMessage, std::__1::default_delete<IPC::MachMessage> >) + 27
2278         https://bugs.webkit.org/show_bug.cgi?id=165854
2279         rdar://problem/29757269
2280
2281         Reviewed by Tim Horton.
2282
2283         * Platform/IPC/mac/ConnectionMac.mm:
2284         (IPC::Connection::sendMessage):
2285         Add assertion.
2286
2287         (IPC::Connection::initializeSendSource):
2288         Turns out the event handler can be called spuriously, so guard against that.
2289
2290 2017-01-11  Chris Dumez  <cdumez@apple.com>
2291
2292         [iOS][WK2] KeyboardEvent.key always returns an empty string
2293         https://bugs.webkit.org/show_bug.cgi?id=166918
2294         <rdar://problem/29861147>
2295
2296         Reviewed by Wenson Hsieh.
2297
2298         Make sure that KeyboardEvent.key gets properly initialized on iOS / WK2.
2299
2300         * Shared/WebEvent.h:
2301         * Shared/WebKeyboardEvent.cpp:
2302         (WebKit::WebKeyboardEvent::WebKeyboardEvent):
2303         * Shared/ios/WebIOSEventFactory.mm:
2304         (WebIOSEventFactory::createWebKeyboardEvent):
2305
2306 2017-01-10  Michael Catanzaro  <mcatanzaro@igalia.com>
2307
2308         [GTK] No way for applications to set notification permissions without waiting for permission request
2309         https://bugs.webkit.org/show_bug.cgi?id=163366
2310
2311         Reviewed by Carlos Garcia Campos.
2312
2313         Websites can check the Notification.permission DOM property to check if they have permission
2314         to show notifications *without triggering a permission request*. But the WebKitGTK+ API has
2315         no way to affirmatively indicate notifications are allowed without a permission request. The
2316         only way is via the permission request API, which is too late. It's a problem for Epiphany.
2317         For example, open the Riot Matrix client in a web app; you will immediately see an info bar
2318         informing the user that Riot does not have permission to send desktop notifications, even
2319         though Epiphany automatically grants notification permission in web app mode when requested.
2320         This problem is not exclusive to web apps; there is simply no way for notification
2321         permission to be set correctly prior to a permission request for it. Fix this by introducing
2322         a webkit_web_context_initialize_notification_permissions() API, and add a signal
2323         WebKitWebContext::initialize-notification-permissions to indicate when it should be called.
2324
2325         * UIProcess/API/gtk/WebKitNotificationProvider.cpp:
2326         (notificationPermissionsCallback):
2327         (WebKitNotificationProvider::create):
2328         (WebKitNotificationProvider::WebKitNotificationProvider):
2329         (WebKitNotificationProvider::notificationPermissions):
2330         (WebKitNotificationProvider::setNotificationPermissions):
2331         * UIProcess/API/gtk/WebKitNotificationProvider.h:
2332         * UIProcess/API/gtk/WebKitSecurityOrigin.cpp:
2333         (webkitSecurityOriginGetSecurityOrigin):
2334         * UIProcess/API/gtk/WebKitSecurityOriginPrivate.h:
2335         * UIProcess/API/gtk/WebKitWebContext.cpp:
2336         (webkitWebContextConstructed):
2337         (webkit_web_context_class_init):
2338         (addOriginToMap):
2339         (webkit_web_context_initialize_notification_permissions):
2340         (webkitWebContextInitializeNotificationPermissions):
2341         * UIProcess/API/gtk/WebKitWebContext.h:
2342         * UIProcess/API/gtk/WebKitWebContextPrivate.h:
2343         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
2344
2345 2017-01-10  Keith Rollin  <krollin@apple.com>
2346
2347         Record/replay: fix range used for fuzzy matching
2348         https://bugs.webkit.org/show_bug.cgi?id=166041
2349
2350         Reviewed by Darin Adler and Alex Christensen.
2351
2352         Because of two bugs, the attempt to determine the range of URLs to
2353         check as part of the process of fuzzy matching was failing. The intent
2354         was to find the range of URLs that started with the same
2355         <scheme://host:port> as a given URL. However, because of a reversed
2356         test, the upper end of the range ended up being the "end()" iterator
2357         of the entire collection of URLs. With that fixed, there was another
2358         bug due to one URL being given as <scheme://host:port> and the other
2359         given as <scheme://host:port/> (note the trailing slash). Both of
2360         these issues are now fixed.
2361
2362         * NetworkProcess/capture/NetworkCaptureManager.cpp:
2363         (WebKit::NetworkCapture::Manager::initialize):
2364         (WebKit::NetworkCapture::Manager::findBestFuzzyMatch):
2365         (WebKit::NetworkCapture::Manager::urlIdentifyingCommonDomain):
2366         * NetworkProcess/capture/NetworkCaptureManager.h:
2367         * NetworkProcess/capture/NetworkCaptureResource.cpp:
2368         (WebKit::NetworkCapture::Resource::url):
2369         (WebKit::NetworkCapture::Resource::urlIdentifyingCommonDomain):
2370         (WebKit::NetworkCapture::Resource::baseURL): Deleted.
2371         * NetworkProcess/capture/NetworkCaptureResource.h:
2372
2373 2017-01-10  Wenson Hsieh  <wenson_hsieh@apple.com>
2374
2375         Implement "proximity" scroll snapping
2376         https://bugs.webkit.org/show_bug.cgi?id=135994
2377         <rdar://problem/18162418>
2378
2379         Reviewed by Dean Jackson.
2380
2381         Adds boilerplate support for plumbing lists of snap offset ranges from the web process to the UI process
2382         alongside the list of snap offsets.
2383
2384         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
2385         (ArgumentCoder<ScrollingStateScrollingNode>::encode):
2386         (ArgumentCoder<ScrollingStateScrollingNode>::decode):
2387         * Shared/WebCoreArgumentCoders.cpp:
2388         (IPC::ArgumentCoder<ScrollOffsetRange<float>>::encode):
2389         (IPC::ArgumentCoder<ScrollOffsetRange<float>>::decode):
2390         * Shared/WebCoreArgumentCoders.h:
2391         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
2392         (-[WKOverflowScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]):
2393         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
2394
2395         Adjust mainframe proximity scroll snapping logic to not subtract out the top content inset when there is no
2396         active snap offset (i.e. when snapping rests in a snap offset range). Attempting to subtract out the top inset
2397         in this case caused the scroll offset to jump after ending a drag with no momentum in a snap offset range.
2398
2399         (WebKit::RemoteScrollingCoordinatorProxy::adjustTargetContentOffsetForSnapping):
2400         (WebKit::RemoteScrollingCoordinatorProxy::shouldSnapForMainFrameScrolling):
2401         (WebKit::RemoteScrollingCoordinatorProxy::closestSnapOffsetForMainFrameScrolling):
2402
2403 2017-01-10  Zan Dobersek  <zdobersek@igalia.com>
2404
2405         ThreadedCoordinatedLayerTreeHost::renderNextFrame() should short-cut to layer flushing
2406         https://bugs.webkit.org/show_bug.cgi?id=157614
2407
2408         Reviewed by Carlos Garcia Campos.
2409
2410         CoordinatedLayerTreeHost prevents any layer flushes while a previously-commited scene
2411         state is still being rendered on the composition thread. renderNextFrame() is called
2412         once that is complete, and a new layer flush is scheduled.
2413
2414         This change improves the whole ordeal by immediately performing the layer flush only if
2415         it was requested during the time we were waiting on the renderer (i.e. when the latest
2416         scene state was being composited), instead of scheduling it unconditionally.
2417         m_scheduledWhileWaitingForRenderer member variable is added to track that occurrence.
2418
2419         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
2420         (WebKit::CoordinatedLayerTreeHost::scheduleLayerFlush):
2421         (WebKit::CoordinatedLayerTreeHost::renderNextFrame):
2422         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
2423
2424 2017-01-09  Chris Dumez  <cdumez@apple.com>
2425
2426         [iOS] Drop VNodeTracker
2427         https://bugs.webkit.org/show_bug.cgi?id=166868
2428         <rdar://problem/29937587>
2429
2430         Reviewed by Andreas Kling.
2431
2432         * WebProcess/cocoa/WebProcessCocoa.mm:
2433         (WebKit::WebProcess::platformInitializeWebProcess):
2434
2435 2017-01-09  Enrica Casucci  <enrica@apple.com>
2436
2437         Selection animation flashing on editable content when zooming.
2438         https://bugs.webkit.org/show_bug.cgi?id=166863
2439         rdar://problem/29931470
2440
2441         Reviewed by Tim Horton.
2442
2443         Implementing _allowAnimatedUpdateSelectionRectView and returning NO,
2444         prevents the selection animation in UIKit.
2445
2446         * UIProcess/ios/WKContentViewInteraction.mm:
2447         (-[WKContentView _allowAnimatedUpdateSelectionRectViews]):
2448
2449 2017-01-06  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
2450
2451         [GTK] Should support key and code properties on keyboard events
2452         https://bugs.webkit.org/show_bug.cgi?id=166759
2453
2454         Reviewed by Carlos Garcia Campos.
2455
2456         * Shared/WebEvent.h:
2457         * Shared/WebKeyboardEvent.cpp:
2458         (WebKit::WebKeyboardEvent::WebKeyboardEvent): accept web key value and code on construction.
2459         * Shared/gtk/WebEventFactory.cpp:
2460         (WebKit::WebEventFactory::createWebKeyboardEvent): pass web key value and code on construction.
2461
2462 2017-01-08  Antti Koivisto  <antti@apple.com>
2463
2464         Move cache coders to WTF
2465         https://bugs.webkit.org/show_bug.cgi?id=166825
2466
2467         Rubber-stamped by Sam Weinig.
2468
2469         * NetworkProcess/cache/NetworkCache.h:
2470         * NetworkProcess/cache/NetworkCacheCoder.h: Removed.
2471         * NetworkProcess/cache/NetworkCacheCoders.cpp:
2472         (WebKit::NetworkCache::Coder<AtomicString>::encode): Deleted.
2473         (WebKit::NetworkCache::Coder<AtomicString>::decode): Deleted.
2474         (WebKit::NetworkCache::Coder<CString>::encode): Deleted.
2475         (WebKit::NetworkCache::Coder<CString>::decode): Deleted.
2476         (WebKit::NetworkCache::Coder<String>::encode): Deleted.
2477         (WebKit::NetworkCache::decodeStringText): Deleted.
2478         (WebKit::NetworkCache::Coder<String>::decode): Deleted.
2479         (WebKit::NetworkCache::Coder<SHA1::Digest>::encode): Deleted.
2480         (WebKit::NetworkCache::Coder<SHA1::Digest>::decode): Deleted.
2481         (WebKit::NetworkCache::Coder<WebCore::HTTPHeaderMap>::encode): Deleted.
2482         (WebKit::NetworkCache::Coder<WebCore::HTTPHeaderMap>::decode): Deleted.
2483         * NetworkProcess/cache/NetworkCacheCoders.h:
2484         (): Deleted.
2485         (WebKit::NetworkCache::Coder<std::optional<T>>::encode): Deleted.
2486         (WebKit::NetworkCache::Coder<std::optional<T>>::decode): Deleted.
2487         * NetworkProcess/cache/NetworkCacheCodersCocoa.cpp:
2488         (WebKit::NetworkCache::encodeCFData): Deleted.
2489         (WebKit::NetworkCache::decodeCFData): Deleted.
2490         (WebKit::NetworkCache::encodeSecTrustRef): Deleted.
2491         (WebKit::NetworkCache::decodeSecTrustRef): Deleted.
2492         (WebKit::NetworkCache::encodeCertificateChain): Deleted.
2493         (WebKit::NetworkCache::decodeCertificateChain): Deleted.
2494         (WebKit::NetworkCache::Coder<WebCore::CertificateInfo>::encode): Deleted.
2495         (WebKit::NetworkCache::Coder<WebCore::CertificateInfo>::decode): Deleted.
2496         * NetworkProcess/cache/NetworkCacheDecoder.cpp: Removed.
2497         * NetworkProcess/cache/NetworkCacheDecoder.h: Removed.
2498         * NetworkProcess/cache/NetworkCacheEncoder.cpp: Removed.
2499         * NetworkProcess/cache/NetworkCacheEncoder.h: Removed.
2500         * NetworkProcess/cache/NetworkCacheEntry.cpp:
2501         (WebKit::NetworkCache::Entry::encodeAsStorageRecord):
2502         (WebKit::NetworkCache::Entry::decodeStorageRecord):
2503         * NetworkProcess/cache/NetworkCacheKey.cpp:
2504         (WebKit::NetworkCache::Key::encode):
2505         (WebKit::NetworkCache::Key::decode):
2506         * NetworkProcess/cache/NetworkCacheKey.h:
2507         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2508         (WebKit::NetworkCache::decodeRecordMetaData):
2509         (WebKit::NetworkCache::encodeRecordMetaData):
2510         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
2511         (WebKit::NetworkCache::SubresourceInfo::encode):
2512         (WebKit::NetworkCache::SubresourceInfo::decode):
2513         (WebKit::NetworkCache::SubresourcesEntry::encodeAsStorageRecord):
2514         (WebKit::NetworkCache::SubresourcesEntry::decodeStorageRecord):
2515         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
2516         * UIProcess/API/APIUserContentExtensionStore.cpp:
2517         (API::encodeContentExtensionMetaData):
2518         (API::decodeContentExtensionMetaData):
2519         * WebKit2.xcodeproj/project.pbxproj:
2520
2521 2017-01-09  Tomas Popela  <tpopela@redhat.com>
2522
2523         [GTK] Replace WebKitWebSettings with WebKitSettings in documentation
2524         https://bugs.webkit.org/show_bug.cgi?id=166836
2525
2526         Reviewed by Carlos Garcia Campos.
2527
2528         Don't use WebKitWebSettings (it was a WebKit1 thing) in documentation,
2529         but replace it with WebKitSettings.
2530
2531         * UIProcess/API/gtk/WebKitSettings.cpp:
2532         (webkit_settings_class_init):
2533         * UIProcess/API/gtk/WebKitWebView.cpp:
2534
2535 2017-01-06  Darin Adler  <darin@apple.com>
2536
2537         Remove PassRefPtr use from "inspector", "platform/sql", and "platform/text"
2538         https://bugs.webkit.org/show_bug.cgi?id=166797
2539
2540         Reviewed by Alex Christensen.
2541
2542         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2543         (WebKit::WebEditorClient::requestCheckingOfString): Take a reference
2544         instead of a PassRefPtr.
2545         * WebProcess/WebCoreSupport/WebEditorClient.h: Updated for above change.
2546
2547 2017-01-07  Andy Estes  <aestes@apple.com>
2548
2549         [QuickLook] Consolidate usage of QuickLookHandle into SubresourceLoader
2550         https://bugs.webkit.org/show_bug.cgi?id=166713
2551
2552         Reviewed by Alex Christensen.
2553
2554         * WebProcess/Network/WebResourceLoader.cpp:
2555         (WebKit::WebResourceLoader::didReceiveResponse): Removed QuickLook code.
2556         (WebKit::WebResourceLoader::didReceiveData): Ditto.
2557         (WebKit::WebResourceLoader::didFinishResourceLoad): Ditto.
2558         (WebKit::WebResourceLoader::didFailResourceLoad): Ditto.
2559         (WebKit::WebResourceLoader::didReceiveResource): Ditto.
2560
2561 2017-01-06  Daniel Bates  <dabates@apple.com>
2562
2563         Attempt to fix the EFL build following <http://trac.webkit.org/changeset/210461>
2564         (https://bugs.webkit.org/show_bug.cgi?id=166781)
2565
2566         * UIProcess/API/C/WKWebsitePolicies.cpp:
2567         (WKWebsitePoliciesGetAutoplayPolicy): Invoke ASSERT_NOT_REACHED() and return kWKWebsiteAutoplayPolicyUseHeuristics
2568         if the specified policy is not covered by a switch case.
2569         (WKWebsitePoliciesSetAutoplayPolicy): Substituted "return" for "break" in each switch case and
2570         invoke ASSERT_NOT_REACHED() if the specified policy is not covered by a switch case.
2571
2572 2017-01-06  Matt Rajca  <mrajca@apple.com>
2573
2574         Add infrastructure for sending autoplay website policies to WebKit
2575         https://bugs.webkit.org/show_bug.cgi?id=166781
2576
2577         Reviewed by Alex Christensen.
2578
2579         * Shared/WebsitePolicies.h:
2580         (WebKit::WebsitePolicies::encode):
2581         (WebKit::WebsitePolicies::decode):
2582         * UIProcess/API/APIWebsitePolicies.h:
2583         * UIProcess/API/C/WKWebsitePolicies.cpp:
2584         (WKWebsitePoliciesGetAutoplayPolicy):
2585         (WKWebsitePoliciesSetAutoplayPolicy):
2586         * UIProcess/API/C/WKWebsitePolicies.h:
2587         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
2588         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
2589         (-[_WKWebsitePolicies setAutoplayPolicy:]):
2590         (-[_WKWebsitePolicies autoplayPolicy]):
2591
2592 2017-01-05  Carlos Garcia Campos  <cgarcia@igalia.com>
2593
2594         [SOUP] Network process crash in WebKit::CustomProtocolManagerImpl::didFailWithError
2595         https://bugs.webkit.org/show_bug.cgi?id=165082
2596
2597         Reviewed by Alex Christensen.
2598
2599         CustomProtocolManager uses a Workqueue to receive the IPC messages since r149194. Then we added the Soup
2600         implementation adopting that approach, but without making our implementation thread safe. The crash happens
2601         because the CustomProtocolManager implementation is used by two threads at the same time, the main thread
2602         because of a ping load (probably caused by an image load in the unload handler, I haven't been able to
2603         reproduce the crash) and the work queue thread. The reasons to make CustomProtocolManager use a WorkQueue
2604         are no longer valid because CustomProtocolManager is now only used in the network process and sync loads don't
2605         use any nested run loop, they are just an IPC sync message. So this patch makes CustomProtocolManager a normal
2606         message receiver again to ensure messages are handled in the main thread. It also adds the common implementation
2607         to a new CustomProtocolManager.cpp file shared by Cocoa and Soup based ports.
2608
2609         * CMakeLists.txt: Add CustomProtocolManager.cpp.
2610         * NetworkProcess/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm:
2611         (-[WKCustomProtocol initWithRequest:cachedResponse:client:]): Use new CustomProtocolManager API.
2612         (-[WKCustomProtocol startLoading]): Ditto.
2613         (-[WKCustomProtocol stopLoading]): Ditto.
2614         (WebKit::CustomProtocolManager::registerProtocolClass): Register the NSURLProtocol class when not using the
2615         network session.
2616         (WebKit::CustomProtocolManager::didFailWithError): removeCustomProtocol now receives an ID.
2617         (WebKit::CustomProtocolManager::didFinishLoading): Ditto.
2618         * NetworkProcess/CustomProtocols/CustomProtocolManager.cpp: Added.
2619         (WebKit::generateCustomProtocolID): Moved from CustomProtocolManagerCocoa.mm and CustomProtocolManagerSoup.cpp.
2620         (WebKit::CustomProtocolManager::supplementName): Ditto.
2621         (WebKit::CustomProtocolManager::CustomProtocolManager): Also removes the work queue initialization.
2622         (WebKit::CustomProtocolManager::initialize): Copied and modernized the loop.
2623         (WebKit::CustomProtocolManager::addCustomProtocol): Copied from CustomProtocolManagerCocoa.mm.
2624         (WebKit::CustomProtocolManager::removeCustomProtocol): Ditto.
2625         (WebKit::CustomProtocolManager::startLoading): Send the StartLoading message to the proxy.
2626         (WebKit::CustomProtocolManager::stopLoading): Send the StopLoading message to the proxy.
2627         * NetworkProcess/CustomProtocols/CustomProtocolManager.h:
2628         * NetworkProcess/CustomProtocols/soup/CustomProtocolManagerImpl.cpp: Removed.
2629         * NetworkProcess/CustomProtocols/soup/CustomProtocolManagerImpl.h: Removed.
2630         * NetworkProcess/CustomProtocols/soup/CustomProtocolManagerSoup.cpp: Moved the implementation from
2631         CustomProtocolManagerImpl and updated to the new CustomProtocolManager API.
2632         (WebKit::CustomProtocolManager::WebSoupRequestAsyncData::WebSoupRequestAsyncData):
2633         (WebKit::CustomProtocolManager::WebSoupRequestAsyncData::~WebSoupRequestAsyncData):
2634         (WebKit::CustomProtocolManager::registerProtocolClass):
2635         (WebKit::CustomProtocolManager::registerScheme):
2636         (WebKit::CustomProtocolManager::supportsScheme):
2637         (WebKit::CustomProtocolManager::didFailWithError):
2638         (WebKit::CustomProtocolManager::didLoadData):
2639         (WebKit::CustomProtocolManager::didReceiveResponse):
2640         (WebKit::CustomProtocolManager::didFinishLoading):
2641         (WebKit::CustomProtocolManager::wasRedirectedToRequest):
2642         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2643         (WebKit::globalCustomProtocolManager):
2644         (WebKit::NetworkSessionCocoa::defaultSession):
2645         CustomProtocolManager is no longer refcounted, so just pass a pointer.
2646         A static pointer has the same lifetime as the NetworkProcess object in the NetworkProcess,
2647         and in the WebProcess it will remain nullptr, just like it used to.
2648         * PlatformEfl.cmake:
2649         * PlatformGTK.cmake:
2650         * WebKit2.xcodeproj/project.pbxproj:
2651
2652 2017-01-05  Antti Koivisto  <antti@apple.com>
2653
2654         Use WTF::Function instead of std::function in network cache code
2655         https://bugs.webkit.org/show_bug.cgi?id=166721
2656
2657         Reviewed by Andreas Kling.
2658
2659         Use better move-only type. Fix some unnecessary function copies.
2660
2661         * NetworkProcess/cache/NetworkCache.cpp:
2662         (WebKit::NetworkCache::Cache::retrieve):
2663         (WebKit::NetworkCache::Cache::clear):
2664         * NetworkProcess/cache/NetworkCache.h:
2665         * NetworkProcess/cache/NetworkCacheData.h:
2666         * NetworkProcess/cache/NetworkCacheDataCocoa.mm:
2667         (WebKit::NetworkCache::Data::apply):
2668         * NetworkProcess/cache/NetworkCacheDataSoup.cpp:
2669         (WebKit::NetworkCache::Data::apply):
2670         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
2671         (WebKit::NetworkCache::traverseDirectory):
2672         * NetworkProcess/cache/NetworkCacheFileSystem.h:
2673         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
2674         (WebKit::NetworkCache::SpeculativeLoadManager::canRetrieve):
2675         (WebKit::NetworkCache::SpeculativeLoadManager::retrieve):
2676
2677             Split retrieve() to canRetrieve() and retrieve() functions.
2678             This avoids the need to copy the completion handler in the caller.
2679
2680         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
2681         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2682         (WebKit::NetworkCache::Storage::ReadOperation::ReadOperation):
2683         (WebKit::NetworkCache::Storage::traverse):
2684         (WebKit::NetworkCache::Storage::clear):
2685         * NetworkProcess/cache/NetworkCacheStorage.h:
2686
2687 2017-01-05  Enrica Casucci  <enrica@apple.com>
2688
2689         Unreviewed build fix after https://trac.webkit.org/changeset/210360
2690
2691         * UIProcess/Cocoa/WebViewImpl.mm:
2692         (WebKit::WebViewImpl::performDragOperation):
2693
2694 2017-01-05  Enrica Casucci  <enrica@apple.com>
2695
2696         Support File Promise during drag for macOS.
2697         https://bugs.webkit.org/show_bug.cgi?id=165204
2698         rdar://problem/19595567
2699
2700         Reviewed by Tim Horton.
2701
2702         Adds support for dropping a File Promise in a WKWebView.
2703         The implementation uses new File Promise API available in Sierra.
2704
2705         * Shared/WebCoreArgumentCoders.cpp:
2706         (IPC::ArgumentCoder<DragData>::encode):
2707         (IPC::ArgumentCoder<DragData>::decode):
2708         * Shared/mac/PasteboardTypes.mm:
2709         (WebKit::PasteboardTypes::forURL):
2710         * UIProcess/Cocoa/WebViewImpl.h:
2711         * UIProcess/Cocoa/WebViewImpl.mm:
2712         (WebKit::WebViewImpl::createSandboxExtensionsIfNeeded):
2713         (WebKit::WebViewImpl::performDragOperation):
2714         (WebKit::maybeCreateSandboxExtensionFromPasteboard): Deleted.
2715         (WebKit::createSandboxExtensionsForFileUpload): Deleted.
2716
2717 2017-01-05  Andreas Kling  <akling@apple.com>
2718
2719         Remove ChromeClient::needTouchEvents().
2720         <https://webkit.org/b/166723>
2721
2722         Rubber-stamped by Antti Koivisto.
2723
2724         * WebProcess/WebCoreSupport/WebChromeClient.h:
2725
2726 2017-01-04  Darin Adler  <darin@apple.com>
2727
2728         Remove PassRefPtr use from the "html" directory, other improvements
2729         https://bugs.webkit.org/show_bug.cgi?id=166635
2730
2731         Reviewed by Alex Christensen.
2732
2733         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2734         (WebKit::WebChromeClient::loadIconForFiles): Take a reference instead of a pointer.
2735         * WebProcess/WebCoreSupport/WebChromeClient.h: Ditto.
2736
2737 2017-01-04  Myles C. Maxfield  <mmaxfield@apple.com>
2738
2739         Remove runtime flag for variation fonts
2740         https://bugs.webkit.org/show_bug.cgi?id=164251
2741
2742         Reviewed by Dean Jackson.
2743
2744         * Shared/WebPreferencesDefinitions.h:
2745         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2746         (WebKit::registerUserDefaultsIfNeeded):
2747         * WebProcess/WebPage/WebPage.cpp:
2748         (WebKit::WebPage::updatePreferences):
2749
2750 2017-01-04  Ryan Haddad  <ryanhaddad@apple.com>
2751
2752         Unreviewed, rolling out r210287.
2753
2754         This change caused editing test failures on macOS.
2755
2756         Reverted changeset:
2757
2758         "Support File Promise during drag for macOS."
2759         https://bugs.webkit.org/show_bug.cgi?id=165204
2760         http://trac.webkit.org/changeset/210287
2761
2762 2017-01-04  Enrica Casucci  <enrica@apple.com>
2763
2764         Support File Promise during drag for macOS.
2765         https://bugs.webkit.org/show_bug.cgi?id=165204
2766         rdar://problem/19595567
2767
2768         Reviewed by Tim Horton.
2769
2770         Adds support for dropping a File Promise in a WKWebView.
2771         The implementation uses new File Promise API available in Sierra.
2772
2773         * Shared/WebCoreArgumentCoders.cpp:
2774         (IPC::ArgumentCoder<DragData>::encode):
2775         (IPC::ArgumentCoder<DragData>::decode):
2776         * Shared/mac/PasteboardTypes.mm:
2777         (WebKit::PasteboardTypes::forURL):
2778         * UIProcess/Cocoa/WebViewImpl.h:
2779         * UIProcess/Cocoa/WebViewImpl.mm:
2780         (WebKit::WebViewImpl::createSandboxExtensionsIfNeeded):
2781         (WebKit::WebViewImpl::performDragOperation):
2782         (WebKit::maybeCreateSandboxExtensionFromPasteboard): Deleted.
2783         (WebKit::createSandboxExtensionsForFileUpload): Deleted.
2784
2785 2017-01-04  Jeremy Jones  <jeremyj@apple.com>
2786
2787         Release pointer lock when page state is reset for any reason, not just for process exited.
2788         https://bugs.webkit.org/show_bug.cgi?id=166654
2789         <rdar://problem/29849769>
2790
2791         Reviewed by Tim Horton.
2792
2793         Pointer lock was not being released when the window is closed.
2794         Move the pointer lock to resetState() so it happens whenever the page is
2795         reset, not just when it is reset after process exit.
2796
2797         * UIProcess/WebPageProxy.cpp:
2798         (WebKit::WebPageProxy::resetState): Release here.
2799         (WebKit::WebPageProxy::resetStateAfterProcessExited): Don't release here.
2800
2801 2017-01-03  Tim Horton  <timothy_horton@apple.com>
2802
2803         NSSpellChecker's recordResponse isn't called for unseen automatic corrections
2804         https://bugs.webkit.org/show_bug.cgi?id=166450
2805         <rdar://problem/29447824>
2806
2807         Reviewed by Darin Adler.
2808
2809         * UIProcess/mac/CorrectionPanel.h:
2810         * UIProcess/mac/CorrectionPanel.mm:
2811         (WebKit::CorrectionPanel::recordAutocorrectionResponse):
2812         (WebKit::CorrectionPanel::handleAcceptedReplacement):
2813         Funnel all calls to recordResponse:toCorrection:forWord:language:inSpellDocumentWithTag:
2814         through recordAutocorrectionResponse, for debugging's sake.
2815         Drop the NSView parameter because we don't need it, just the tag.
2816
2817         * UIProcess/mac/PageClientImpl.mm:
2818         (WebKit::toCorrectionResponse):
2819         (WebKit::PageClientImpl::recordAutocorrectionResponse):
2820         Convert the new AutocorrectionResponseType value to its corresponding
2821         NSCorrectionResponse value.
2822
2823 2017-01-03  Daniel Bates  <dabates@apple.com>
2824
2825         Another attempt to fix the Apple Sierra Release 32-bit Build following <https://trac.webkit.org/changeset/210075>
2826         (https://bugs.webkit.org/show_bug.cgi?id=166367)
2827
2828         Guard more code in WebViewImpl::handleRequestedCandidates() inside HAVE(TOUCH_BAR).
2829         Remove unused local variable weakThis.
2830
2831         * UIProcess/Cocoa/WebViewImpl.mm:
2832         (WebKit::WebViewImpl::handleRequestedCandidates):
2833
2834 2017-01-03  Daniel Bates  <dabates@apple.com>
2835
2836         Attempt to fix the Apple Sierra Release 32-bit Build following <https://trac.webkit.org/changeset/210075>
2837         (https://bugs.webkit.org/show_bug.cgi?id=166367)
2838
2839         Add HAVE(TOUCH_BAR)-guard around code that messages candidateListTouchBarItem() as
2840         candidateListTouchBarItem() is only defined when building with Touch Bar support.
2841
2842         Also added an inline comment to help demarcate the code when building without Touch Bar
2843         support. We should look to clean up WebViewImpl.mm including extracting out the Touch
2844         Bar code to another file or better demarcating it so as to improve the hackability of
2845         this code and prevent breaking the build when building without Touch Bar support.
2846
2847         * UIProcess/Cocoa/WebViewImpl.mm:
2848         (WebKit::WebViewImpl::handleRequestedCandidates):
2849
2850 2017-01-03  Michael Catanzaro  <mcatanzaro@igalia.com> and Carlos Garcia Campos  <cgarcia@igalia.com>
2851
2852         [GTK] Expose WebKitSecurityOrigin API
2853         https://bugs.webkit.org/show_bug.cgi?id=166632
2854
2855         Reviewed by Carlos Garcia Campos.
2856
2857         This API will be useful to have for various purposes, such as setting initial notification
2858         permissions.
2859
2860         * PlatformGTK.cmake:
2861         * UIProcess/API/gtk/WebKitAutocleanups.h:
2862         * UIProcess/API/gtk/WebKitSecurityOrigin.cpp: Added.
2863         (_WebKitSecurityOrigin::_WebKitSecurityOrigin):
2864         (webkitSecurityOriginCreate):
2865         (webkit_security_origin_new):
2866         (webkit_security_origin_new_for_uri):
2867         (webkit_security_origin_ref):
2868         (webkit_security_origin_unref):
2869         (webkit_security_origin_get_protocol):
2870         (webkit_security_origin_get_host):
2871         (webkit_security_origin_get_port):
2872         (webkit_security_origin_is_opaque):
2873         (webkit_security_origin_to_string):
2874         * UIProcess/API/gtk/WebKitSecurityOrigin.h: Added.
2875         * UIProcess/API/gtk/WebKitSecurityOriginPrivate.h: Added.
2876         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
2877         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
2878         * UIProcess/API/gtk/webkit2.h:
2879
2880 2017-01-03  Carlos Garcia Campos  <cgarcia@igalia.com>
2881
2882         [SOUP] Load options allowStoredCredentials = DoNotAllowStoredCredentials with clientCredentialPolicy = MayAskClientForCredentials doesn't work
2883         https://bugs.webkit.org/show_bug.cgi?id=164471
2884
2885         Reviewed by Michael Catanzaro.
2886
2887         When DoNotAllowStoredCredentials is used we disable the SoupAuthManager feature for the message, but that
2888         disables all HTTP authentication, causing the load to always fail with Authorization required even when
2889         clientCredentialPolicy allows to ask the user for credentials. The problem is that even if we don't use the
2890         WebCore credentials for that request, libsoup will always use its internal cache of SoupAuth if we enable the
2891         SoupAuthManager feature. Libsoup 2.57.1 has new API to disable the use of cached credentials for a particular
2892         message, adding the new message flag SOUP_MESSAGE_DO_NOT_USE_AUTH_CACHE.
2893
2894         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
2895         (WebKit::NetworkDataTaskSoup::createRequest): Set SOUP_MESSAGE_DO_NOT_USE_AUTH_CACHE flag to disable cached
2896         credentials for the message if libsoup >= 2.57.1 is used.
2897
2898 2017-01-03  Carlos Garcia Campos  <cgarcia@igalia.com>
2899
2900         [GTK] HTTP auth layout tests are flaky
2901         https://bugs.webkit.org/show_bug.cgi?id=158919
2902
2903         Reviewed by Michael Catanzaro.
2904
2905         Implement NetworkSession::clearCredentials() for soup using the new libsoup API when available.
2906
2907         * NetworkProcess/soup/NetworkSessionSoup.cpp:
2908         (WebKit::NetworkSessionSoup::clearCredentials):
2909         * NetworkProcess/soup/NetworkSessionSoup.h:
2910
2911 2017-01-01  Jeff Miller  <jeffm@apple.com>
2912
2913         Update user-visible copyright strings to include 2017
2914         https://bugs.webkit.org/show_bug.cgi?id=166278
2915
2916         Reviewed by Dan Bernstein.
2917
2918         * DatabaseProcess/EntryPoint/mac/XPCService/DatabaseService/Info.plist:
2919         * Info.plist:
2920         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX-10.9-10.10.plist:
2921         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX.plist:
2922         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-iOS.plist:
2923         * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64-10.9-10.10.Info.plist:
2924         * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist:
2925         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX-10.9-10.10.plist:
2926         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist:
2927         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist:
2928
2929 2016-12-30  Darin Adler  <darin@apple.com>
2930
2931         Remove PassRefPtr use from the "dom" directory, related cleanup
2932         https://bugs.webkit.org/show_bug.cgi?id=166569
2933
2934         Reviewed by Alex Christensen.
2935
2936         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2937         (WebKit::WebFrameLoaderClient::dispatchDidReceiveTitle): Updated to use struct.
2938         (WebKit::WebFrameLoaderClient::updateGlobalHistory): Ditto.
2939         (WebKit::WebFrameLoaderClient::setTitle): Ditto.
2940
2941 2016-12-27  Alex Christensen  <achristensen@webkit.org>
2942
2943         reduce PassRefPtr use in WebKit2
2944         https://bugs.webkit.org/show_bug.cgi?id=166452
2945
2946         Reviewed by Yusuke Suzuki.
2947
2948         * Shared/API/c/cg/WKImageCG.cpp:
2949         (WKImageCreateCGImage):
2950         (WKImageCreateFromCGImage):
2951         * Shared/ShareableBitmap.cpp:
2952         (WebKit::ShareableBitmap::createHandle):
2953         * Shared/ShareableBitmap.h:
2954         * Shared/UserData.cpp:
2955         (WebKit::UserData::encode):
2956         (WebKit::UserData::decode):
2957         * Shared/WebImage.cpp:
2958         (WebKit::WebImage::create):
2959         (WebKit::WebImage::WebImage):
2960         * Shared/WebImage.h:
2961         (WebKit::WebImage::bitmap):
2962         * UIProcess/WebPageProxy.cpp:
2963         (WebKit::WebPageProxy::didGetImageForFindMatch):
2964         * UIProcess/mac/WKTextFinderClient.mm:
2965         (-[WKTextFinderClient didGetImageForMatchResult:]):
2966         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
2967         (WebKit::WebAutomationSessionProxy::takeScreenshot):
2968         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
2969         (-[WKWebProcessPlugInNodeHandle renderedImageWithOptions:]):
2970         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
2971         (WebKit::imageForRect):
2972         (WebKit::InjectedBundleNodeHandle::renderedImage):
2973         (WebKit::InjectedBundleNodeHandle::visibleRange):
2974         (WebKit::InjectedBundleNodeHandle::htmlTableCellElementCellAbove):
2975         (WebKit::InjectedBundleNodeHandle::documentFrame):
2976         (WebKit::InjectedBundleNodeHandle::htmlFrameElementContentFrame):
2977         (WebKit::InjectedBundleNodeHandle::htmlIFrameElementContentFrame):
2978         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
2979         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
2980         (WebKit::InjectedBundleRangeHandle::renderedImage):
2981         * WebProcess/WebPage/WebPage.cpp:
2982         (WebKit::WebPage::takeSnapshot):
2983         (WebKit::WebPage::snapshotAtSize):
2984         (WebKit::WebPage::snapshotNode):
2985         (WebKit::WebPage::drawRectToImage):
2986         * WebProcess/WebPage/ios/WebPageIOS.mm:
2987         (WebKit::WebPage::getPositionInformation):
2988         * WebProcess/WebPage/mac/WebPageMac.mm:
2989         (WebKit::WebPage::setTopOverhangImage):
2990         (WebKit::WebPage::setBottomOverhangImage):
2991
2992 2016-12-27  Emanuele Aina  <emanuele.aina@collabora.com>
2993
2994         Ensure NetworkProcess is ready before whitelisting TLS certificates
2995         https://bugs.webkit.org/show_bug.cgi?id=162962
2996
2997         Reviewed by Alex Christensen.
2998
2999         If the API user tries to whitelist TLS certificates before any web
3000         view has been created, the action will be ignored because the
3001         NetworkProcess hasn't been fired up yet.
3002
3003         For example, the snippet below using the GTK+ API does not work,
3004         unless the whitelisting is moved after the web view creation:
3005
3006           webkit_web_context_allow_tls_certificate_for_host(webkit_web_context_get_default(), crt, host);
3007           webView = webkit_web_view_new();
3008
3009         * UIProcess/WebProcessPool.cpp:
3010         (WebKit::WebProcessPool::allowSpecificHTTPSCertificateForHost): Ensure
3011         that the NetworkProcess has been already fired up when adding
3012         certificates, so they can be whitelisted before the first web view is
3013         instantiated.
3014
3015 2016-12-25  Yusuke Suzuki  <utatane.tea@gmail.com>
3016
3017         Propagate the source origin as much as possible
3018         https://bugs.webkit.org/show_bug.cgi?id=166348
3019
3020         Reviewed by Darin Adler.
3021
3022         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
3023         (WebKit::NPRuntimeObjectMap::evaluate):
3024
3025 2016-12-22  Andy Estes  <aestes@apple.com>
3026
3027         Reduce QuickLook.h include overhead
3028         https://bugs.webkit.org/show_bug.cgi?id=166454
3029
3030         Reviewed by Andreas Kling.
3031
3032         * WebProcess/Network/WebLoaderStrategy.cpp: Included QuickLook.h for QLPreviewProtocol().
3033         * WebProcess/Network/WebResourceLoader.cpp: Included QuickLook.h for QuickLookHandle.
3034         * WebProcess/Network/WebResourceLoader.h: Stopped including QuickLook.h.
3035
3036 2016-12-22  Tim Horton  <timothy_horton@apple.com>
3037
3038         Null deref under WebPageProxy::applicationDidFinishSnapshottingAfterEnteringBackground
3039         https://bugs.webkit.org/show_bug.cgi?id=166433
3040         <rdar://problem/29732407>
3041
3042         Reviewed by Daniel Bates.
3043
3044         * UIProcess/ios/WebPageProxyIOS.mm:
3045         (WebKit::WebPageProxy::applicationDidFinishSnapshottingAfterEnteringBackground):
3046         m_drawingArea can be null if the process is not valid.
3047
3048 2016-12-22  Andy Estes  <aestes@apple.com>
3049
3050         Make WebCore::EditorInsertAction an enum class
3051         https://bugs.webkit.org/show_bug.cgi?id=166424
3052
3053         Reviewed by Brent Fulgham.
3054
3055         * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
3056         (WebKit::toAPI):
3057         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
3058         (toWK):
3059
3060 2016-12-22  Zhuo Li  <zachli@apple.com>
3061
3062         [Cocoa] SPI for setloadsImagesAutomatically
3063         https://bugs.webkit.org/show_bug.cgi?id=166401
3064
3065         Reviewed by Darin Adler.
3066
3067         * UIProcess/API/Cocoa/WKPreferences.mm: Call the C API under the hood.
3068         (-[WKPreferences _loadsImagesAutomatically]):
3069         (-[WKPreferences _setLoadsImagesAutomatically:]):
3070
3071         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
3072         Add `_loadsImagesAutomatically` property.
3073
3074 2016-12-22  Eric Carlson  <eric.carlson@apple.com>
3075
3076         AVPlayerLayer isn't available on every system
3077         https://bugs.webkit.org/show_bug.cgi?id=166399
3078
3079         Reviewed by Jer Noble.
3080
3081         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm: Use SOFT_LINK_CLASS_OPTIONAL.
3082
3083 2016-12-22  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
3084
3085         MediaStream: ASSERTION FAILED: m_ids.size() == m_handles.size() in MediaDeviceSandboxExtensions
3086         https://bugs.webkit.org/show_bug.cgi?id=166328
3087
3088         Reviewed by Eric Carlson.
3089
3090         This assertion failure happens for ports with sandbox extensions disabled. SandboxExtension is empty and
3091         HandleArray:size() always returns 0. Disable creation of MediaDevicesSandboxExtension in UserMediaProcessManager
3092         when building without support of sandbox extension. Disable also WebPage::grantUserMediaDeviceSandboxExtensions
3093         and WebPage::revokeUserMediaDeviceSandboxExtensions which can be avoided when sandbox extension is empty.
3094
3095         * UIProcess/UserMediaProcessManager.cpp:
3096         (WebKit::UserMediaProcessManager::willCreateMediaStream):
3097         (WebKit::UserMediaProcessManager::endedCaptureSession):
3098         * WebProcess/WebPage/WebPage.cpp:
3099         * WebProcess/WebPage/WebPage.h:
3100         * WebProcess/WebPage/WebPage.messages.in:
3101
3102 2016-12-22  Alejandro G. Castro  <alex@igalia.com>
3103
3104         [WebRTC] Add support for runtime PeeConnection setting, required after r209757
3105         https://bugs.webkit.org/show_bug.cgi?id=166346
3106
3107         Reviewed by Carlos Garcia Campos.
3108
3109         After that commit we have to enable the peerConnection runtime
3110         flag if we want webrtc to work. We are not adding a new API for
3111         the moment to control the peerConnection feature.
3112
3113         * UIProcess/API/gtk/WebKitSettings.cpp:
3114         (webkit_settings_set_enable_media_stream): Use the mediaStream
3115         setting to control the peerConnection
3116
3117 2016-12-21  Brent Fulgham  <bfulgham@apple.com>
3118
3119         [Mac][WK2] Stop using file* rules in WebProcess sandbox profiles
3120         https://bugs.webkit.org/show_bug.cgi?id=165824
3121         <rdar://problem/14024823>
3122
3123         Reviewed by Alexey Proskuryakov
3124
3125         Switch from blanket 'file*' sandbox rules, to the specific 'file-read*' and 'file-write*' rules
3126         we actually need.
3127
3128         * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in:
3129         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
3130         * WebProcess/com.apple.WebProcess.sb.in:
3131
3132 2016-12-21  Beth Dakin  <bdakin@apple.com>
3133
3134         Holding down on candidates in the TouchBar should show panel on screen
3135         https://bugs.webkit.org/show_bug.cgi?id=166367
3136         -and corresponding-
3137         <rdar://problem/28479236>
3138
3139         Reviewed by Tim Horton.
3140
3141         The showCandidates() helper function is not needed. We can call the AppKit method 
3142         directly at the one call site.
3143         * UIProcess/Cocoa/WebViewImpl.h:
3144         * UIProcess/Cocoa/WebViewImpl.mm:
3145
3146         The panel should appear under the selection, so offset the selection rect.
3147         (WebKit::WebViewImpl::handleRequestedCandidates):
3148
3149         No more showCandidates() since we can call it directly. 
3150         (WebKit::WebViewImpl::showCandidates): Deleted.
3151
3152 2016-12-20  Taras Tsugrii  <ttsugrii@fb.com>
3153
3154         Fix undefined behavior caused by macro expansion producing 'defined'
3155         https://bugs.webkit.org/show_bug.cgi?id=166047
3156
3157         Reviewed by Darin Adler.
3158
3159         * Shared/API/Cocoa/WKFoundation.h:
3160
3161 2016-12-20  Brent Fulgham  <bfulgham@apple.com>
3162
3163         Address some style problems found by static analysis
3164         https://bugs.webkit.org/show_bug.cgi?id=165975
3165
3166         Reviewed by Alex Christensen.
3167
3168         Avoid passing large ANGLE data structures through the ANGLEWebKitBridge methods.
3169
3170         * Shared/WebBackForwardListItem.cpp:
3171         (WebKit::WebBackForwardListItem::create):
3172         (WebKit::WebBackForwardListItem::WebBackForwardListItem):
3173         * Shared/WebBackForwardListItem.h:
3174
3175 2016-12-20  Simon Fraser  <simon.fraser@apple.com>
3176
3177         [iOS WK2] Switching or closing a tab leads to all-white tab content if the status bar is double height
3178         https://bugs.webkit.org/show_bug.cgi?id=166286
3179         rdar://problem/29593525
3180
3181         Reviewed by Tim Horton.
3182
3183         A double-height status bar triggers view resize while snapshotting in the background,
3184         which also triggers calls to _endAnimatedResize on tab resume. However, it was possible
3185         for _endAnimatedResize to re-enter via synchronizeDynamicViewportUpdate()/didCommitLayerTree(),
3186         causing us to use a nil _resizeAnimationView for scale computations, thus setting a zero
3187         scale on the WKContentView.
3188
3189         Fix by checking _dynamicViewportUpdateMode again after the call to synchronizeDynamicViewportUpdate(),
3190         and do a belt-and-braces check for a nil _resizeAnimationView.
3191
3192         * UIProcess/API/Cocoa/WKWebView.mm:
3193         (-[WKWebView _endAnimatedResize]):
3194
3195 2016-12-20  Andy Estes  <aestes@apple.com>
3196
3197         [Cocoa] REGRESSION (r209558): Calling decisionHandler multiple times in webView:decidePolicyForNavigationAction:decisionHandler: leads to a crash
3198         https://bugs.webkit.org/show_bug.cgi?id=165992
3199         <rdar://problem/29693817>
3200
3201         Reviewed by Brady Eidson.
3202
3203         r209558 added additional move semantics to the decisionHandler block passed to
3204         -webView:decidePolicyForNavigationAction:decisionHandler:, resulting in a null pointer
3205         dereference in clients that call the decisionHandler block more than once.
3206
3207         None of the completion handlers we expose in the WebKit API are intended to be called more
3208         than once, and we ASSERT in CompletionHandlerCallChecker::didCallCompletionHandler() that
3209         this doesn't happen.
3210
3211         This change strenghtens that protection by returning immediately in completion handlers
3212         called more than once. And in programs linked on or after WebKit 603.1.17, an NSException is
3213         thrown if a completion handler is called a second time, like we do for completion handlers
3214         that are never called.
3215
3216         New API test: WebKit2.DuplicateCompletionHandlerCalls
3217
3218         * Shared/Cocoa/CompletionHandlerCallChecker.h: Declared completionHandlerHasBeenCalled().
3219         * Shared/Cocoa/CompletionHandlerCallChecker.mm:
3220         (WebKit::shouldThrowExceptionForDuplicateCompletionHandlerCall): Added. Returns true if the
3221         program is linked on or after
3222         LibraryVersion::FirstWithExceptionsForDuplicateCompletionHandlerCalls.
3223         (WebKit::CompletionHandlerCallChecker::completionHandlerHasBeenCalled): Added. Returns
3224         whether or not the completion handler has been called. If it has, and
3225         shouldThrowExceptionForDuplicateCompletionHandlerCall() returns true, throws an
3226         NSInternalInconsistencyException.
3227         * UIProcess/API/Cocoa/WKWebView.mm:
3228         (-[WKWebView _setInputDelegate:]): Added an early return if the completion handler has
3229         already been called.
3230         * UIProcess/Cocoa/NavigationState.mm:
3231         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction): Ditto.
3232         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse): Ditto.
3233         (WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge): Ditto.
3234         * UIProcess/Cocoa/UIDelegate.mm:
3235         (WebKit::UIDelegate::UIClient::runJavaScriptAlert): Ditto.
3236         (WebKit::UIDelegate::UIClient::runJavaScriptConfirm): Ditto.
3237         (WebKit::UIDelegate::UIClient::runJavaScriptPrompt): Ditto.
3238         (WebKit::UIDelegate::UIClient::exceededDatabaseQuota): Ditto.
3239         (WebKit::UIDelegate::UIClient::runOpenPanel): Ditto.
3240         (WebKit::UIDelegate::UIClient::reachedApplicationCacheOriginQuota): Ditto.
3241         * UIProcess/Cocoa/VersionChecks.h: Added
3242         FirstWithExceptionsForDuplicateCompletionHandlerCalls with the version number for 603.1.17.
3243
3244 2016-12-20  Dean Jackson  <dino@apple.com>
3245
3246         Remove INDIE_UI
3247         https://bugs.webkit.org/show_bug.cgi?id=165881
3248         <rdar://problem/29672532>
3249
3250         Reviewed by Simon Fraser.
3251
3252         The Indie UI work has been discontinued.
3253
3254         * Configurations/FeatureDefines.xcconfig:
3255
3256 2016-12-20  Wenson Hsieh  <wenson_hsieh@apple.com>
3257
3258         Implement the updated port/area-based Scroll Snap Module Level 1 Spec
3259         https://bugs.webkit.org/show_bug.cgi?id=165317
3260         <rdar://problem/29490956>
3261
3262         Reviewed by Dean Jackson.
3263
3264         Remove unused code for adopting scroll snapping in the PDF plugin.
3265
3266         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3267         (WebKit::PDFPlugin::didCalculateSizes):
3268
3269 2016-12-19  Yusuke Suzuki  <utatane.tea@gmail.com>
3270
3271         [ES6] Enable ES6 Modules
3272         https://bugs.webkit.org/show_bug.cgi?id=165849
3273
3274         Reviewed by Geoffrey Garen.
3275
3276         * Shared/WebPreferencesDefinitions.h:
3277         * UIProcess/API/C/WKPreferences.cpp:
3278         (WKPreferencesSetES6ModulesEnabled): Deleted.
3279         (WKPreferencesGetES6ModulesEnabled): Deleted.
3280         * UIProcess/API/C/WKPreferencesRefPrivate.h:
3281         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3282         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
3283         * WebProcess/WebPage/WebPage.cpp:
3284         (WebKit::WebPage::updatePreferences):
3285
3286 2016-12-19  Keith Rollin  <krollin@apple.com>
3287
3288         Fix unwanted deletion of record/replay files
3289         https://bugs.webkit.org/show_bug.cgi?id=166040
3290
3291         Reviewed by Alex Christensen.
3292
3293         As part of some refactoring, the objects that create the meta files
3294         that are part of the record/replay cache would get deleted. They were
3295         always getting opened in "write" mode", which would truncate the
3296         files. Fix this so that the files are opened in the right modes for
3297         record, replay, and neither.
3298
3299         * NetworkProcess/capture/NetworkCaptureManager.cpp:
3300         (WebKit::NetworkCapture::Manager::initialize):
3301
3302 2016-12-19  Gavin Barraclough  <barraclough@apple.com>
3303
3304         [CSS Parser] Enable CSS Deferred Parsing
3305         https://bugs.webkit.org/show_bug.cgi?id=165869
3306
3307         Unreviewed rollout – looks like this regressed performance.
3308
3309         * Shared/WebPreferencesDefinitions.h:
3310
3311 2016-12-19  Anders Carlsson  <andersca@apple.com>
3312
3313         REGRESSION: Crash in com.apple.WebKit:IPC::Connection::platformCanSendOutgoingMessages() const + 0
3314         https://bugs.webkit.org/show_bug.cgi?id=165817
3315         rdar://problem/29626731
3316
3317         Reviewed by Dan Bernstein.
3318
3319         If the receive right is invalidated before we send the message, the kernel won't be able to create a send right,
3320         and we'll crash due to mach_msg returning MACH_SEND_INVALID_RIGHT.
3321         
3322         Fix this by immediately creating a send right, and passing MACH_MSG_TYPE_MOVE_SEND to the attachment constructor.
3323
3324         * WebProcess/WebPage/WebInspector.cpp:
3325         (WebKit::WebInspector::openFrontendConnection):
3326
3327 2016-12-18  Simon Fraser  <simon.fraser@apple.com>
3328
3329         Expose a way for MiniBrowser to simulate header and footer banners
3330         https://bugs.webkit.org/show_bug.cgi?id=166005
3331
3332         Reviewed by Wenson Hsieh.
3333         
3334         Expose testing SPI that allows a client to simulate the presence of header
3335         and footer banners. These are simply plumbed through to set FrameView's
3336         m_headerHeight and m_footerHeight.
3337
3338         * UIProcess/API/Cocoa/WKWebView.mm:
3339         (-[WKWebView _setHeaderBannerHeightForTesting:]):
3340         (-[WKWebView _setFooterBannerHeightForTesting:]):
3341         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3342         * UIProcess/WebPageProxy.cpp:
3343         (WebKit::WebPageProxy::setHeaderBannerHeightForTesting):
3344         (WebKit::WebPageProxy::setFooterBannerHeightForTesting):
3345         * UIProcess/WebPageProxy.h:
3346         * WebProcess/WebPage/WebPage.cpp:
3347         (WebKit::WebPage::setHeaderBannerHeightForTesting):
3348         (WebKit::WebPage::setFooterBannerHeightForTesting):
3349         * WebProcess/WebPage/WebPage.h:
3350         * WebProcess/WebPage/WebPage.messages.in:
3351
3352 2016-12-16  Dave Hyatt  <hyatt@apple.com>
3353
3354         [CSS Values] Make separate wrapper classes for the deprecated CSS Values OM
3355         https://bugs.webkit.org/show_bug.cgi?id=165968
3356
3357         Reviewed by Andreas Kling.
3358
3359         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.cpp:
3360         (WebKit::kit):
3361         (WebKit::core):
3362         (WebKit::wrapCSSValue):
3363         (webkit_dom_css_value_constructor):
3364         (webkit_dom_css_value_get_css_text):
3365         (webkit_dom_css_value_set_css_text):
3366         (webkit_dom_css_value_get_css_value_type):
3367         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValuePrivate.h:
3368
3369 2016-12-17  Wenson Hsieh  <wenson_hsieh@apple.com>
3370
3371         Visual viewports: bottom fixed elements disappear behind the keyboard
3372         https://bugs.webkit.org/show_bug.cgi?id=165983
3373         <rdar://problem/29409852>
3374
3375         Reviewed by Simon Fraser.
3376
3377         Accounts for input view bounds in WebPageProxy::computeCustomFixedPositionRect. To do this, we introduce and
3378         pass unobscuredContentRectRespectingInputViewBounds along with the regular unobscuredContentRect (which does not
3379         respect the obscuring keyboard rect). This unobscuredContentRectRespectingInputViewBounds is then used when
3380         computing the origin of the updated layout viewport rect (and also, when we are _not_ below minimum scale),
3381         
3382         Additionally, the size is computed using the (unconstrained) unobscured rect. This is because we previously
3383         would use the document-constrained version of the unobscured rect, which caused the layout viewport to shrink
3384         when approaching the max scroll extents of the document while the keyboard is up, since the unobscured rect
3385         would spill out of the document rect. However, using this unconstrained rect's size also means that if the user
3386         rubber-bands out of the document rect, we would end up pushing the layout viewport rect out of the document,
3387         with no way of adjusting it back in without the user scrolling to push the layout viewport into back document
3388         bounds. To address this, we move the layout rect to be within document bounds after computing its size and
3389         location.
3390
3391         Added a new layout test: fast/visual-viewport/ios/fixed-element-on-bottom-with-keyboard.html, and also tweaked
3392         fixed-caret-position-after-scroll.html to cover these changes.
3393
3394         * Shared/VisibleContentRectUpdateInfo.cpp:
3395         (WebKit::operator<<):
3396         * Shared/VisibleContentRectUpdateInfo.h:
3397         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
3398         (WebKit::VisibleContentRectUpdateInfo::unobscuredContentRectRespectingInputViewBounds):
3399         * UIProcess/API/Cocoa/WKWebView.mm:
3400         (-[WKWebView _updateContentRectsWithState:]):
3401         (-[WKWebView _inputViewBounds]):
3402
3403         Returns the current bounds of the input view. For testing purposes.
3404
3405         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3406         * UIProcess/WebPageProxy.h:
3407         (WebKit::WebPageProxy::unobscuredContentRectRespectingInputViewBounds):
3408         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
3409         (WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect):
3410         * UIProcess/ios/WKContentView.h:
3411         * UIProcess/ios/WKContentView.mm:
3412         (-[WKContentView _computeUnobscuredContentRectRespectingInputViewBounds:unobscuredContentRect:inputViewBounds:scale:]):
3413
3414         Helper to compute the unobscured rect, accounting for the bounds of the current input view.
3415
3416         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
3417         (-[WKContentView _didCommitLayerTree:]):
3418         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): Deleted.
3419         * UIProcess/ios/WebPageProxyIOS.mm:
3420         (WebKit::WebPageProxy::computeCustomFixedPositionRect):
3421         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
3422         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
3423
3424 2016-12-16  Ryosuke Niwa  <rniwa@webkit.org>
3425
3426         Deleting a character converted from pinyin after an image causes a Safari crash
3427         https://bugs.webkit.org/show_bug.cgi?id=165839
3428
3429         Reviewed by Darin Adler.
3430
3431         The crash was caused by the payload of the IPC not being decoded correctly when the encoded attributed string
3432         contains a NSTextAttachment but send<> would still gladly send it to the UIProcess.
3433
3434