matchRegistration does not need to go to StorageProcess if no service worker is regis...
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2017-11-13  Youenn Fablet  <youenn@apple.com>
2
3         matchRegistration does not need to go to StorageProcess if no service worker is registered
4         https://bugs.webkit.org/show_bug.cgi?id=179480
5
6         Reviewed by Chris Dumez.
7
8         Removed origin store handling from StorageProcess since it is now handled within SWServer.
9         Updated clearing of web site data accordingly.
10         Optimized matchRegistration by looking at the origin store before doing any IPC.
11         Do IPC to the StorageProcess if the origin store is not yet initialized on the WebProcess.
12
13         * StorageProcess/ServiceWorker/WebSWOriginStore.h:
14         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
15         (WebKit::WebSWServerConnection::resolveRegistrationJobInClient):
16         (WebKit::WebSWServerConnection::resolveUnregistrationJobInClient):
17         * StorageProcess/StorageProcess.cpp:
18         (WebKit::StorageProcess::deleteWebsiteData):
19         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
20         (WebKit::StorageProcess::swServerForSession):
21         (WebKit::StorageProcess::swOriginStoreForSession):
22         (WebKit::StorageProcess::registerSWServerConnection):
23         (WebKit::StorageProcess::unregisterSWServerConnection):
24         (WebKit::StorageProcess::ensureSWOriginStoreForSession): Deleted.
25         (WebKit::StorageProcess::swOriginStoreForSession const): Deleted.
26         * StorageProcess/StorageProcess.h:
27         * StorageProcess/ServiceWorker/WebSWOriginStore.cpp:
28         (WebKit::WebSWOriginStore::addToStore):
29         (WebKit::WebSWOriginStore::removeFromStore):
30         (WebKit::WebSWOriginStore::clearStore):
31         (WebKit::WebSWOriginStore::add): Deleted.
32         (WebKit::WebSWOriginStore::remove): Deleted.
33         (WebKit::WebSWOriginStore::clear): Deleted.
34         * StorageProcess/ServiceWorker/WebSWOriginStore.h:
35         * WebProcess/Storage/WebSWClientConnection.cpp:
36         (WebKit::WebSWClientConnection::matchRegistration):
37
38 2017-11-13  Alex Christensen  <achristensen@webkit.org>
39
40         Merge NetworkProcess::EnsurePrivateBrowsingSession and NetworkProcess::AddWebsiteDataStore into one message type
41         https://bugs.webkit.org/show_bug.cgi?id=178751
42
43         Reviewed by Brady Eidson.
44
45         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
46         (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession):
47         * NetworkProcess/NetworkProcess.cpp:
48         (WebKit::NetworkProcess::initializeNetworkProcess):
49         (WebKit::NetworkProcess::ensurePrivateBrowsingSession): Deleted.
50         * NetworkProcess/NetworkProcess.h:
51         * NetworkProcess/NetworkProcess.messages.in:
52         * NetworkProcess/RemoteNetworkingContext.h:
53         * NetworkProcess/mac/RemoteNetworkingContext.mm:
54         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
55         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession): Deleted.
56         * Shared/WebsiteDataStoreParameters.cpp:
57         (WebKit::WebsiteDataStoreParameters::legacyPrivateSessionParameters):
58         * Shared/WebsiteDataStoreParameters.h:
59         * UIProcess/WebProcessPool.cpp:
60         (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
61         (WebKit::WebProcessPool::createNewWebProcess):
62         (WebKit::WebProcessPool::pageAddedToProcess):
63         * WebProcess/InjectedBundle/InjectedBundle.cpp:
64         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
65         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
66         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
67         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
68         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession): Deleted.
69         * WebProcess/WebPage/WebPage.cpp:
70         (WebKit::WebPage::setSessionID):
71         * WebProcess/WebProcess.cpp:
72         (WebKit::WebProcess::ensurePrivateBrowsingSession): Deleted.
73         * WebProcess/WebProcess.h:
74         * WebProcess/WebProcess.messages.in:
75
76 2017-11-13  Alex Christensen  <achristensen@webkit.org>
77
78         Add logs to debug content extension test failures
79         https://bugs.webkit.org/show_bug.cgi?id=179624
80
81         Reviewed by Chris Dumez.
82
83         * UIProcess/API/APIContentRuleListStore.cpp:
84         (API::compiledToFile):
85         Right now I'm seeing this log:
86         "Rule list compilation failed: Unspecified error during compile."
87         I need more information to debug what is failing on the bots.
88
89 2017-11-07  Brian Burg  <bburg@apple.com>
90
91         Web Automation: inViewCenterPoint should not include topContentInset when computed in viewport coordinates
92         https://bugs.webkit.org/show_bug.cgi?id=179129
93         <rdar://problem/35297038>
94
95         Reviewed by Simon Fraser.
96
97         When computing the in view center point per W3C specification, the top content inset
98         is inadvertently added back in when converting to the root view coordinate system.
99
100         This patch reworks the protocol command so that it explicitly requests a coordinate
101         system, with options for "Page" (root / contents), "LayoutViewport", and "VisualViewport".
102         The latter is not implemented in this patch, since it is intended for use on iOS someday.
103
104         * UIProcess/Automation/Automation.json:
105         Change usesViewport to CoordinateSystem.
106         Add a new coordinate system enum type and use it.
107         Fix relevant comments for Automation.computElementLayout.
108
109         * UIProcess/Automation/WebAutomationSession.h:
110         * UIProcess/Automation/WebAutomationSession.cpp:
111         (WebKit::protocolStringToCoordinateSystem):
112         (WebKit::WebAutomationSession::computeElementLayout):
113         Parse the requested coordinate system and send it in the message to the web process.
114
115         * WebKit.xcodeproj/project.pbxproj:
116         * WebProcess/Automation/WebAutomationSessionProxy.messages.in:
117         * WebProcess/Automation/WebAutomationSessionProxy.h:
118         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
119         (WebKit::WebAutomationSessionProxy::computeElementLayout):
120         Rework the implementation. Get the element bounds and in-view center point in
121         client coordinates and convert back to root view coordinates for CoordinateSystem::Page.
122
123 2017-11-08  Keith Miller  <keith_miller@apple.com>
124
125         Async iteration should only fetch the next method once and add feature flag
126         https://bugs.webkit.org/show_bug.cgi?id=179451
127
128         Reviewed by Geoffrey Garen.
129
130         Add feature flag for Async iteration.
131
132         * Configurations/FeatureDefines.xcconfig:
133
134 2017-11-13  Mark Lam  <mark.lam@apple.com>
135
136         Add more overflow check book-keeping for MarkedArgumentBuffer.
137         https://bugs.webkit.org/show_bug.cgi?id=179634
138         <rdar://problem/35492517>
139
140         Reviewed by Saam Barati.
141
142         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
143         (WebKit::NPJSObject::construct):
144         (WebKit::NPJSObject::invoke):
145
146 2017-11-13  Timothy Horton  <timothy_horton@apple.com>
147
148         Address some post-landing review comments from r224728
149         https://bugs.webkit.org/show_bug.cgi?id=179576
150
151         * Platform/IPC/mac/MachMessage.h:
152         (IPC::MachMessage::setMessageReceiverName):
153         (IPC::MachMessage::setMessageName):
154         More moving!
155
156 2017-11-13  Tim Horton  <timothy_horton@apple.com>
157
158         Occasional MobileSafari crash under -[WKPDFView web_setMinimumSize:]
159         https://bugs.webkit.org/show_bug.cgi?id=179628
160         <rdar://problem/34773037>
161
162         Reviewed by Simon Fraser.
163
164         * UIProcess/ios/WKPDFView.mm:
165         (-[WKPDFView _computePageAndDocumentFrames]):
166         Similar to r223444, avoid propagating null CGRects into the view hierarchy.
167         In this case, the null rect comes from applying margins to a rect that is 
168         smaller than the margins. We could check for that specifically, but a
169         more-general check for a null rect seems reasonable.
170
171 2017-11-13  Tim Horton  <timothy_horton@apple.com>
172
173         Use the real mach type instead of reinterpret_casting in MachMessage
174         https://bugs.webkit.org/show_bug.cgi?id=179629
175
176         Reviewed by Dan Bernstein.
177
178         * Platform/IPC/mac/MachMessage.cpp:
179         (IPC::MachMessage::header):
180         * Platform/IPC/mac/MachMessage.h:
181         Just use mach_msg_header_t proper, and avoid the reinterpret_cast.
182         This also corrects the alignment of the struct on platforms where
183         alignof(mach_msg_header_t) != alignof(uint8_t).
184
185 2017-11-13  Gabriel Ivascu  <givascu@igalia.com>
186
187         [GTK] Automatically adjust font size when gtk-xft-dpi changes
188         https://bugs.webkit.org/show_bug.cgi?id=142673
189
190         Reviewed by Michael Catanzaro.
191
192         * UIProcess/API/glib/WebKitSettings.cpp:
193         (webKitSettingsDispose):
194         (webKitSettingsConstructed):
195         (webkit_settings_class_init):
196
197 2017-11-13  Chris Dumez  <cdumez@apple.com>
198
199         Implement "Service Worker Has No Pending Events" / "Update Service Worker Extended Events Set" algorithms
200         https://bugs.webkit.org/show_bug.cgi?id=179618
201
202         Reviewed by Brady Eidson.
203
204         * StorageProcess/StorageProcess.cpp:
205         (WebKit::StorageProcess::setServiceWorkerHasPendingEvents):
206         * StorageProcess/StorageProcess.h:
207         * StorageProcess/StorageProcess.messages.in:
208         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
209         (WebKit::WebSWContextManagerConnection::setServiceWorkerHasPendingEvents):
210         * WebProcess/Storage/WebSWContextManagerConnection.h:
211
212 2017-11-13  Wenson Hsieh  <wenson_hsieh@apple.com>
213
214         [Attachment Support] Implement SPI for clients to request data for a given attachment
215         https://bugs.webkit.org/show_bug.cgi?id=179586
216         <rdar://problem/35355720>
217
218         Reviewed by Darin Adler.
219
220         Adds support in WebKit for fetching data for a given attachment element. See WebCore/ChangeLog for more details.
221         Most of the changes here are boilerplate plumbing of -requestAttachmentData through the client layers.
222
223         Test coverage by augmenting existing API tests in WKAttachmentTests, and adding 3 new tests.
224
225         * UIProcess/API/APIAttachment.cpp:
226         (API::Attachment::requestData):
227         * UIProcess/API/APIAttachment.h:
228         * UIProcess/API/Cocoa/_WKAttachment.h:
229         * UIProcess/API/Cocoa/_WKAttachment.mm:
230         (-[_WKAttachment requestData:]):
231         * UIProcess/WebPageProxy.cpp:
232         (WebKit::WebPageProxy::sharedBufferCallback):
233
234         Add a new IPC callback helper type, SharedBufferCallback. This is similar to the existing DataCallback, but
235         instead of deserializing to an API::Data, we convert to a SharedBuffer instead. Additionally,
236         SharedBufferCallback is able to draw a distinction between null data and empty data. This allows -requestData:
237         to distinguish between cases where (for instance) the data for a given attachment is an empty blob, and when
238         the attachment doesn't exist at all.
239
240         (WebKit::WebPageProxy::dataCallback):
241         (WebKit::WebPageProxy::insertAttachment):
242         (WebKit::WebPage::invokeSharedBufferCallback):
243         (WebKit::WebPageProxy::requestAttachmentData):
244         * UIProcess/WebPageProxy.h:
245         * UIProcess/WebPageProxy.messages.in:
246         * WebProcess/WebPage/WebPage.cpp:
247         (WebKit::WebPage::requestAttachmentData):
248         * WebProcess/WebPage/WebPage.h:
249         * WebProcess/WebPage/WebPage.messages.in:
250
251 2017-11-12  Darin Adler  <darin@apple.com>
252
253         More is<> and downcast<>, less static_cast<>
254         https://bugs.webkit.org/show_bug.cgi?id=179600
255
256         Reviewed by Chris Dumez.
257
258         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivate.cpp:
259         (WebKit::wrap): Use is/downcast.
260         * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
261         (WebKit::WebEditorClient::handleKeyboardEvent): Ditto.
262         * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp:
263         (WebKit::WebEditorClient::handleKeyboardEvent): Ditto.
264         * WebProcess/WebPage/WebPage.cpp:
265         (WebKit::WebPage::handleEditingKeyboardEvent): Ditto.
266         * WebProcess/WebPage/mac/WebPageMac.mm:
267         (WebKit::frameForEvent): Ditto.
268
269 2017-11-12  Gabriel Ivascu  <givascu@igalia.com>
270
271         [GTK] Add functionality to handle font sizes in points
272         https://bugs.webkit.org/show_bug.cgi?id=179285
273
274         Reviewed by Carlos Garcia Campos and Michael Catanzaro.
275
276         * UIProcess/API/glib/WebKitSettings.cpp:
277         (webkit_settings_class_init):
278         (webkit_settings_font_size_to_points):
279         (webkit_settings_font_size_to_pixels):
280         * UIProcess/API/gtk/WebKitSettings.h:
281         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
282
283 2017-11-11  Tim Horton  <timothy_horton@apple.com>
284
285         Increase the alignment requirement of WKObject's wrapped C++ object
286         https://bugs.webkit.org/show_bug.cgi?id=179518
287
288         Reviewed by Dan Bernstein.
289
290         * Shared/API/APIObject.h:
291         * Shared/Cocoa/APIObject.mm:
292         (API::allocateWKObject):
293         (API::Object::fromWKObjectExtraSpace):
294         (API::Object::newObject):
295         * Shared/Cocoa/WKObject.mm:
296         (-[WKObject dealloc]):
297         (-[WKObject _apiObject]):
298         * UIProcess/API/Cocoa/WKConnection.mm:
299         (-[WKConnection dealloc]):
300         (-[WKConnection _apiObject]):
301         (-[WKConnection _connection]):
302         Increase the alignment of the C++ object stored inside WKObject's extra space
303         to 8-bytes, for platforms where some types require greater-than-pointer alignment.
304         To achieve this, increase the size of the extra-space allocation by the difference
305         between 8 bytes and pointer-alignment, and then align within that.
306
307 2017-11-11  Tim Horton  <timothy_horton@apple.com>
308
309         Avoid composing the message + recipient name for crash logs until a failure actually occurs
310         https://bugs.webkit.org/show_bug.cgi?id=179576
311
312         Reviewed by Dan Bernstein.
313
314         * Platform/IPC/mac/ConnectionMac.mm:
315         (IPC::Connection::sendMessage):
316         (IPC::Connection::sendOutgoingMessage):
317         * Platform/IPC/mac/MachMessage.h:
318         (IPC::MachMessage::messageReceiverName const):
319         (IPC::MachMessage::setMessageReceiverName):
320         (IPC::MachMessage::messageName const):
321         (IPC::MachMessage::setMessageName):
322         Store the message name and receiver name separately on MachMessage,
323         only composing them into a string if the message is unhandled. This
324         makes the time spent composing the string in sendOutgoingMessage
325         completely disappear. In absolute terms, it wasn't huge, but if you
326         do enough IPC it starts to add up.
327
328 2017-11-10  Chris Dumez  <cdumez@apple.com>
329
330         [Service Workers] Implement "Try Activate" / "Activate" algorithms
331         https://bugs.webkit.org/show_bug.cgi?id=179436
332
333         Reviewed by Brady Eidson.
334
335         Implement proper "Try Activate" / "Activate" algorithms as per:
336         - https://w3c.github.io/ServiceWorker/#try-activate-algorithm
337         - https://w3c.github.io/ServiceWorker/#activation-algorithm
338
339         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
340         (WebKit::WebSWServerConnection::fireActivateEvent):
341         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
342         * StorageProcess/StorageProcess.cpp:
343         (WebKit::StorageProcess::didFinishServiceWorkerActivation):
344         * StorageProcess/StorageProcess.h:
345         * StorageProcess/StorageProcess.messages.in:
346         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
347         (WebKit::WebSWContextManagerConnection::fireActivateEvent):
348         (WebKit::WebSWContextManagerConnection::didFinishActivation):
349         * WebProcess/Storage/WebSWContextManagerConnection.h:
350         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
351
352 2017-11-10  John Wilander  <wilander@apple.com>
353
354         Ignore HSTS for partitioned, cross-origin subresource requests
355         https://bugs.webkit.org/show_bug.cgi?id=178993
356         <rdar://problem/34962462>
357
358         Reviewed by Brent Fulgham.
359
360         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
361         (downgradeRequest):
362             Convenience function to downgrade a request if
363             CFNetwork as already upgraded it during
364             canonicalization. This allows the rest of 
365             WebKit's processing to function, such as UIR
366             and mixed content blocking.
367         (updateIgnoreStrictTransportSecuritySettingIfNecessary):
368             Adds and removed the ignore request accordingly.
369         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
370             Now asks CFNetwork to ignore HSTS on resource loads we
371             partition cookies for.
372         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
373             Now asks CFNetwork to ignore HSTS on resource loads we
374             partition cookies for.
375
376 2017-11-10  Alex Christensen  <achristensen@webkit.org>
377
378         _WKThumbnailView initialization with WKWebView needs to call correct initWithFrame
379         https://bugs.webkit.org/show_bug.cgi?id=179537
380         <rdar://problem/35275219>
381
382         Reviewed by Darin Adler.
383
384         I introduced this in r223439 and made an ObjC mistake.  This is what I get for adding SPI with no tests.
385         I fixed this by making the existing WKView/_WKThumbnailView API tests work with WKWebView.
386
387         * UIProcess/API/Cocoa/_WKThumbnailView.mm:
388         (-[_WKThumbnailView initWithFrame:fromWKWebView:]):
389
390 2017-11-10  Carlos Garcia Campos  <cgarcia@igalia.com>
391
392         [GTK][WPE] Switch to use API::NavigationClient
393         https://bugs.webkit.org/show_bug.cgi?id=178720
394
395         Reviewed by Alex Christensen.
396
397         Replace WebKitLoaderClient and WebKitPolicyClient with WebKitNavigationClient that implements
398         API::NavigationClient.
399
400         * PlatformGTK.cmake:
401         * PlatformWPE.cmake:
402         * UIProcess/API/APINavigationAction.h: Add new constructor that receives a target frame name instead of a target
403         frame info.
404         * UIProcess/API/APINavigationClient.h:
405         (API::NavigationClient::didDisplayInsecureContent): Added.
406         (API::NavigationClient::didRunInsecureContent): Added.
407         (API::NavigationClient::decidePolicyForNavigationResponse): Change NavigationResponse parameter to be a
408         Ref<NavigationResponse>&& instead of a NavigationResponse&.
409         * UIProcess/API/C/WKPage.cpp:
410         (WKPageSetPageNavigationClient): Update NavigationResponse parameter.
411         * UIProcess/API/glib/WebKitBackForwardList.cpp:
412         (webkitBackForwardListChanged):
413         * UIProcess/API/glib/WebKitBackForwardListPrivate.h:
414         * UIProcess/API/glib/WebKitNavigationAction.cpp:
415         (webkitNavigationActionCreate): Wrap the given API::NavigationAction.
416         (webkit_navigation_action_get_navigation_type): Use the wrapped API::NavigationAction.
417         (webkit_navigation_action_get_mouse_button): Ditto.
418         (webkit_navigation_action_get_modifiers): Ditto.
419         (webkit_navigation_action_get_request): Ditto.
420         (webkit_navigation_action_is_user_gesture): Ditto.
421         (webkit_navigation_action_is_redirect): Ditto.
422         * UIProcess/API/glib/WebKitNavigationActionPrivate.h:
423         (_WebKitNavigationAction::_WebKitNavigationAction):
424         * UIProcess/API/glib/WebKitNavigationClient.cpp: Renamed from Source/WebKit/UIProcess/API/glib/WebKitLoaderClient.cpp.
425         (NavigationClient::NavigationClient):
426         (attachNavigationClientToView):
427         * UIProcess/API/glib/WebKitNavigationClient.h: Renamed from Source/WebKit/UIProcess/API/glib/WebKitLoaderClient.h.
428         * UIProcess/API/glib/WebKitNavigationPolicyDecision.cpp:
429         (webkit_navigation_policy_decision_get_frame_name): Add FIXME.
430         (webkitNavigationPolicyDecisionCreate): Get the target frame name from the API::NavigationAction.
431         * UIProcess/API/glib/WebKitNavigationPolicyDecisionPrivate.h:
432         * UIProcess/API/glib/WebKitPolicyClient.cpp: Removed.
433         * UIProcess/API/glib/WebKitPolicyClient.h: Removed.
434         * UIProcess/API/glib/WebKitPolicyDecision.cpp:
435         (webkitPolicyDecisionSetListener): Remove the madePolicyDecision boolean member, we can null-check the listener instead.
436         (webkit_policy_decision_use): Ensure listener is nullptr after being invoked to prevent the decision from being made
437         more than once.
438         (webkit_policy_decision_ignore): Ditto.
439         (webkit_policy_decision_download): Ditto.
440         * UIProcess/API/glib/WebKitPolicyDecisionPrivate.h:
441         * UIProcess/API/glib/WebKitResponsePolicyDecision.cpp:
442         (webkit_response_policy_decision_get_request): Use the wrapped API::NavigationResponse.
443         (webkit_response_policy_decision_get_response): Ditto.
444         (webkit_response_policy_decision_is_mime_type_supported): Ditto.
445         (webkitResponsePolicyDecisionCreate): Wrap the given API::NavigationResponse.
446         * UIProcess/API/glib/WebKitResponsePolicyDecisionPrivate.h:
447         * UIProcess/API/glib/WebKitUIClient.cpp:
448         (UIClient::createNewPage): Create the WebKitNavigationAction from a new API::NavigationAction.
449         * UIProcess/API/glib/WebKitWebView.cpp:
450         (webkitWebViewConstructed): Attach navigation client.
451         * UIProcess/Cocoa/NavigationState.h: Update API::NavigationResponse parameter of decidePolicyForNavigationResponse.
452         * UIProcess/Cocoa/NavigationState.mm:
453         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):
454         * UIProcess/WebPageProxy.cpp:
455         (WebKit::WebPageProxy::didDisplayInsecureContentForFrame): Notify the navigation client if it's used.
456         (WebKit::WebPageProxy::didRunInsecureContentForFrame): Ditto.
457         (WebKit::WebPageProxy::decidePolicyForNewWindowAction): Use the new API::NavigationAction constructor to pass
458         the target frame name, instead of a null target frame info.
459         (WebKit::WebPageProxy::decidePolicyForResponse): Move the API::NavigationResponse.
460
461 2017-11-09  Chris Dumez  <cdumez@apple.com>
462
463         Unreviewed, rolling out r224661.
464
465         Broke build on several internal Mac/iOS bots
466
467         Reverted changeset:
468
469         "Ignore HSTS for partitioned, cross-origin subresource
470         requests"
471         https://bugs.webkit.org/show_bug.cgi?id=178993
472         https://trac.webkit.org/changeset/224661
473
474 2017-11-09  Chris Dumez  <cdumez@apple.com>
475
476         ServiceWorkerRegistration objects may get recycled for different SWServerRegistration objects
477         https://bugs.webkit.org/show_bug.cgi?id=179517
478
479         Reviewed by Brady Eidson.
480
481         * Scripts/webkit/messages.py:
482         (forward_declarations_and_headers):
483         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
484         (WebKit::WebSWServerConnection::updateRegistrationStateInClient):
485         (WebKit::WebSWServerConnection::fireUpdateFoundEvent):
486         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
487         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
488         * WebProcess/Storage/WebSWClientConnection.cpp:
489         (WebKit::WebSWClientConnection::addServiceWorkerRegistrationInServer):
490         (WebKit::WebSWClientConnection::removeServiceWorkerRegistrationInServer):
491         * WebProcess/Storage/WebSWClientConnection.h:
492         * WebProcess/Storage/WebSWClientConnection.messages.in:
493
494 2017-11-09  John Wilander  <wilander@apple.com>
495
496         Ignore HSTS for partitioned, cross-origin subresource requests
497         https://bugs.webkit.org/show_bug.cgi?id=178993
498         <rdar://problem/34962462>
499
500         Reviewed by Brent Fulgham.
501
502         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
503         (downgradeRequest):
504             Convenience function to downgrade a request if
505             CFNetwork as already upgraded it during
506             canonicalization. This allows the rest of 
507             WebKit's processing to function, such as UIR
508             and mixed content blocking.
509         (updateIgnoreStrictTransportSecuritySettingIfNecessary):
510             Adds and removed the ignore request accordingly.
511         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
512             Now asks CFNetwork to ignore HSTS on resource loads we
513             partition cookies for.
514         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
515             Now asks CFNetwork to ignore HSTS on resource loads we
516             partition cookies for.
517
518 2017-11-09  Chris Dumez  <cdumez@apple.com>
519
520         Implement real post 'install' event steps of the Install algorithm (steps 14+)
521         https://bugs.webkit.org/show_bug.cgi?id=179401
522
523         Reviewed by Brady Eidson.
524
525         Implement step 14+ of Install algorithm, as per:
526         - https://w3c.github.io/ServiceWorker/#installation-algorithm
527
528         * Scripts/webkit/messages.py:
529         (headers_for_type):
530         * Shared/WebCoreArgumentCoders.h:
531         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
532         (WebKit::WebSWServerConnection::resolveRegistrationJobInClient):
533         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
534         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
535         * WebProcess/Storage/WebSWClientConnection.cpp:
536         (WebKit::WebSWClientConnection::didResolveRegistrationPromise):
537         * WebProcess/Storage/WebSWClientConnection.h:
538         * WebProcess/Storage/WebSWClientConnection.messages.in:
539
540 2017-11-09  Megan Gardner  <megan_gardner@apple.com>
541
542         Clean out unused selection items from UIKitSPI
543         https://bugs.webkit.org/show_bug.cgi?id=179459
544
545         Reviewed by Tim Horton.
546
547         Many of these should have been removed from previous commits, but they were missed.
548         None of these enums or methods are being used by WebKit anymore, and removing them will keep things
549         clean and allow UIKit to remove things that are not used at all by anyone anymore.
550
551         * Platform/spi/ios/UIKitSPI.h:
552
553 2017-11-09  Christopher Reid  <chris.reid@sony.com>
554
555         Use enum classes within FileSystem
556         https://bugs.webkit.org/show_bug.cgi?id=175172
557
558         Reviewed by Darin Adler.
559
560         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
561         * NetworkProcess/NetworkDataTaskBlob.cpp:
562         * NetworkProcess/cache/NetworkCache.cpp:
563         * NetworkProcess/capture/NetworkCaptureManager.cpp:
564         * NetworkProcess/capture/NetworkCaptureRecorder.cpp:
565         * Shared/WebMemorySampler.cpp:
566         * UIProcess/API/APIContentRuleListStore.cpp:
567         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
568
569 2017-11-09  Youenn Fablet  <youenn@apple.com>
570
571         ServiceWorkerClientFetch should create not null ResourceError
572         https://bugs.webkit.org/show_bug.cgi?id=179485
573
574         Reviewed by Darin Adler.
575
576         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
577         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
578
579 2017-11-09  Andy Estes  <aestes@apple.com>
580
581         [iOS] Adopt UIPreviewDataAttachmentListIsContentManaged
582         https://bugs.webkit.org/show_bug.cgi?id=179458
583         <rdar://problem/35034691>
584
585         Reviewed by Dan Bernstein.
586
587         * Platform/spi/ios/UIKitSPI.h:
588         * UIProcess/ios/WKContentViewInteraction.mm:
589         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
590
591 2017-11-08  Joseph Pecoraro  <pecoraro@apple.com>
592
593         Include a more complete block signature in public headers to avoid potential -Wstrict-prototypes warnings
594         https://bugs.webkit.org/show_bug.cgi?id=179466
595
596         Reviewed by Dan Bernstein.
597
598         * UIProcess/API/Cocoa/WKHTTPCookieStore.h:
599         * UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
600         (-[WKHTTPCookieStore setCookie:completionHandler:]):
601         (-[WKHTTPCookieStore deleteCookie:completionHandler:]):
602
603 2017-11-08  Jeremy Jones  <jeremyj@apple.com>
604
605         Make WKFullScreenWidnowController more robust against modification by the embedding app.
606         https://bugs.webkit.org/show_bug.cgi?id=179413
607         rdar://problem/35408061
608
609         Reviewed by Darin Adler.
610
611         Present fullscreen UViewController in a separate UIWindow to prevent interaction with the embedding app's
612         UIViewController hierarchy.
613
614         Immediately tear down the fullscreen interface if the embedding app removes the WKWebView from the fullscreen window.
615         This prevents the fullscreen interface from getting into an invalid state.
616
617         Preserve scrollView.zoomScale because it is not effectively preserved by the more indirect _viewScale.
618
619         Use a custom root view controller to allow hiding of the status bar.
620
621         Remove the no-longer-necessary dispatch_after calls during enter and exit fullscreen.
622
623         * UIProcess/API/Cocoa/WKWebView.mm:
624         (-[WKWebView removeFromSuperview]):
625         * UIProcess/ios/WKFullScreenWindowControllerIOS.h:
626         * UIProcess/ios/WKFullScreenWindowControllerIOS.mm:
627         (WebKit::WKWebViewState::applyTo):
628         (WebKit::WKWebViewState::store):
629         (-[_WKFullScreenViewController loadView]):
630         (-[_WKFullscreenRootViewController prefersStatusBarHidden]):
631         (-[WKFullScreenWindowController enterFullScreen]):
632         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
633         (-[WKFullScreenWindowController completedExitFullScreen]):
634         (-[WKFullScreenWindowController exitFullscreenImmediately]):
635         (-[WKFullScreenWindowController close]):
636         (-[WKFullScreenWindowController webViewDidRemoveFromSuperviewWhileInFullscreen]):
637         (-[_WKFullScreenViewController viewDidDisappear:]): Deleted.
638
639 2017-11-08  Jeremy Jones  <jeremyj@apple.com>
640
641         HTMLMediaElement should not use element fullscreen on iOS
642         https://bugs.webkit.org/show_bug.cgi?id=179418
643         rdar://problem/35409277
644
645         Reviewed by Eric Carlson.
646
647         Add ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN to determine if HTMLMediaElement should use element full screen or not.
648
649         * Configurations/FeatureDefines.xcconfig:
650
651 2017-11-08  Wenson Hsieh  <wenson_hsieh@apple.com>
652
653         [Attachment Support] Implement delegate hooks for attachment element insertion and removal
654         https://bugs.webkit.org/show_bug.cgi?id=179016
655         <rdar://problem/35250890>
656
657         Reviewed by Tim Horton.
658
659         See WebCore/ChangeLog for more details.
660
661         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
662         * UIProcess/API/Cocoa/WKWebView.mm:
663         (-[WKWebView _didInsertAttachment:]):
664         (-[WKWebView _didRemoveAttachment:]):
665         * UIProcess/API/Cocoa/WKWebViewInternal.h:
666         * UIProcess/Cocoa/PageClientImplCocoa.h:
667         * UIProcess/Cocoa/PageClientImplCocoa.mm:
668         (WebKit::PageClientImplCocoa::didInsertAttachment):
669         (WebKit::PageClientImplCocoa::didRemoveAttachment):
670         * UIProcess/PageClient.h:
671         (WebKit::PageClient::didInsertAttachment):
672         (WebKit::PageClient::didRemoveAttachment):
673         * UIProcess/WebPageProxy.cpp:
674         (WebKit::WebPageProxy::didInsertAttachment):
675         (WebKit::WebPageProxy::didRemoveAttachment):
676         * UIProcess/WebPageProxy.h:
677         * UIProcess/WebPageProxy.messages.in:
678         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
679         (WebKit::WebEditorClient::didInsertAttachment):
680         (WebKit::WebEditorClient::didRemoveAttachment):
681         * WebProcess/WebCoreSupport/WebEditorClient.h:
682
683 2017-11-08  Carlos Garcia Campos  <cgarcia@igalia.com>
684
685         REGRESSION(r223773): [GTK] WebKitWebInspector bring-to-front signal is emitted right after open-window
686         https://bugs.webkit.org/show_bug.cgi?id=179365
687
688         Reviewed by Michael Catanzaro.
689
690         In the GTK+ API, open-window already implies presenting the window to bring it to the front, so it's not
691         expected that bring-to-front is emitted on open. This is happening since r223773 that moved common code from
692         platform specific inspector files to the main file, but in the case of open the mac implementation was not
693         exactly the same as the GTK+ one. This broke /webkit2/WebKitWebInspector/default and
694         /webkit2/WebKitWebInspector/manual-attach-detach.
695
696         * UIProcess/WebInspectorProxy.cpp:
697         (WebKit::WebInspectorProxy::open): Set m_isOpening for the scope of the function.
698         * UIProcess/WebInspectorProxy.h: Add m_isOpening.
699         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
700         (WebKit::WebInspectorProxy::platformBringToFront): Return early if m_isOpening is true.
701
702 2017-11-07  Carlos Garcia Campos  <cgarcia@igalia.com>
703
704         REGRESSION(r224179): [GTK] Several WebViewEditor tests are failing since r224179
705         https://bugs.webkit.org/show_bug.cgi?id=179366
706
707         Reviewed by Michael Catanzaro.
708
709         In r224179, webkit_web_view_can_execute_editing_command() was optimized to use the sync path for commands
710         supported by the WebViewEditorState, but the state requires a redraw to be up to date. We can't know if
711         WebViewEditorState is in sync, when webkit_web_view_can_execute_editing_command() is called, so we always need
712         to ask the web process.
713
714         * UIProcess/API/glib/WebKitWebView.cpp:
715         (webkit_web_view_can_execute_editing_command):
716
717 2017-11-07  Carlos Garcia Campos  <cgarcia@igalia.com>
718
719         [GTK][WPE] Build inspector resources using copy-user-interface-resources.pl script
720         https://bugs.webkit.org/show_bug.cgi?id=179317
721
722         Reviewed by Michael Catanzaro.
723
724         This is the script used by Apple and it has several advantages:
725
726           - It allows to combine and minify most of the js and css files, which improves performance and binary size.
727           - It removes the debug resources and assertions in production builds.
728           - It allows to remove the test resources in production builds.
729
730         The patch also moves the common cmake code to generate the resources to a new file InspectorGResources.cmake included
731         by GTK+ and WPE platform cmake files.
732
733         * InspectorGResources.cmake: Added.
734         * PlatformGTK.cmake:
735         * PlatformWPE.cmake:
736
737 2017-11-07  Jeremy Jones  <jeremyj@apple.com>
738
739         Add downcast support for FullscreenClient.
740         https://bugs.webkit.org/show_bug.cgi?id=178824
741
742         Reviewed by Simon Fraser.
743
744         Add SPECIALIZE_TYPE_TRAITS macros for API::FullscreenClient and WebKit::Fullscreen client so 
745         downcasts can be done safely.
746
747         * UIProcess/API/APIFullscreenClient.h:
748         (API::FullscreenClient::isType const):
749         * UIProcess/API/C/mac/WKPagePrivateMac.mm:
750         (WKPageSetFullscreenDelegate):
751         (WKPageGetFullscreenDelegate):
752         * UIProcess/API/Cocoa/WKWebView.mm:
753         (-[WKWebView _setFullscreenDelegate:]):
754         (-[WKWebView _fullscreenDelegate]):
755         * UIProcess/Cocoa/FullscreenClient.h:
756         (isType):
757         * UIProcess/Cocoa/FullscreenClient.mm:
758
759 2017-11-07  Brady Eidson  <beidson@apple.com>
760
761         Implement "UpdateWorkerState" and use it
762         https://bugs.webkit.org/show_bug.cgi?id=179318
763
764         Reviewed by Chris Dumez.
765
766         * Scripts/webkit/messages.py:
767         (headers_for_type):
768         * Shared/WebCoreArgumentCoders.h:
769  
770        * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
771         (WebKit::WebSWServerConnection::updateWorkerStateInClient):
772         (WebKit::WebSWServerConnection::installServiceWorkerContext):
773         (WebKit::WebSWServerConnection::setContextConnection):
774         (WebKit::WebSWServerConnection::updateServiceWorkerContext): Deleted.
775         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
776
777         * WebProcess/Storage/WebSWClientConnection.messages.in:
778
779         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
780         (WebKit::WebSWContextManagerConnection::installServiceWorker):
781         (WebKit::WebSWContextManagerConnection::updateServiceWorker): Deleted.
782         * WebProcess/Storage/WebSWContextManagerConnection.h:
783         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
784
785 2017-11-07  Commit Queue  <commit-queue@webkit.org>
786
787         Unreviewed, rolling out r224512 and r224521.
788         https://bugs.webkit.org/show_bug.cgi?id=179388
789
790         An API test added with this change is failing an assertion on
791         the bots. (Requested by ryanhaddad on #webkit).
792
793         Reverted changesets:
794
795         "[Attachment Support] Implement delegate hooks for attachment
796         element insertion and removal"
797         https://bugs.webkit.org/show_bug.cgi?id=179016
798         https://trac.webkit.org/changeset/224512
799
800         "Remove stray logging from a newly added API test"
801         https://trac.webkit.org/changeset/224521
802
803 2017-11-07  Chris Dumez  <cdumez@apple.com>
804
805         [Service Workers] Add support for "install" event
806         https://bugs.webkit.org/show_bug.cgi?id=179338
807
808         Reviewed by Youenn Fablet.
809
810         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
811         (WebKit::WebSWServerConnection::firePostInstallEvents):
812         (WebKit::WebSWServerConnection::fireInstallEvent):
813         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
814         * StorageProcess/StorageProcess.cpp:
815         (WebKit::StorageProcess::didFinishServiceWorkerInstall):
816         * StorageProcess/StorageProcess.h:
817         * StorageProcess/StorageProcess.messages.in:
818         * WebProcess/Storage/WebSWClientConnection.messages.in:
819         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
820         (WebKit::WebSWContextManagerConnection::fireInstallEvent):
821         (WebKit::WebSWContextManagerConnection::didFinishInstall):
822         * WebProcess/Storage/WebSWContextManagerConnection.h:
823         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
824
825 2017-11-07  Youenn Fablet  <youenn@apple.com>
826
827         Support the case of fetch events that are not responded
828         https://bugs.webkit.org/show_bug.cgi?id=179336
829
830         Reviewed by Chris Dumez.
831
832         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
833         (WebKit::WebServiceWorkerFetchTaskClient::didNotHandle):
834         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:
835
836 2017-11-06  Alex Christensen  <achristensen@webkit.org>
837
838         Make ResourceLoader::willSendRequestInternal asynchronous
839         https://bugs.webkit.org/show_bug.cgi?id=179251
840
841         Reviewed by Andy Estes.
842
843         * WebProcess/Network/WebLoaderStrategy.cpp:
844         (WebKit::WebLoaderStrategy::loadResource):
845         (WebKit::WebLoaderStrategy::schedulePluginStreamLoad):
846         * WebProcess/Network/WebLoaderStrategy.h:
847         * WebProcess/Plugins/PluginView.cpp:
848         (WebKit::PluginView::Stream::start):
849
850 2017-11-06  Wenson Hsieh  <wenson_hsieh@apple.com>
851
852         [Attachment Support] Implement delegate hooks for attachment element insertion and removal
853         https://bugs.webkit.org/show_bug.cgi?id=179016
854         <rdar://problem/35250890>
855
856         Reviewed by Tim Horton.
857
858         Adds boilerplate plumbing to WebEditorClient, WebPage, and the usual machinery in the UI process to notify
859         WebKit2 clients when attachment elements have been inserted or removed from the document. See the WebCore
860         ChangeLog for more details about the implementation, or the Tools ChangeLog for more information about new API
861         tests.
862
863         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
864         * UIProcess/API/Cocoa/WKWebView.mm:
865         (-[WKWebView _didInsertAttachment:]):
866         (-[WKWebView _didRemoveAttachment:]):
867         * UIProcess/API/Cocoa/WKWebViewInternal.h:
868         * UIProcess/Cocoa/PageClientImplCocoa.h:
869         * UIProcess/Cocoa/PageClientImplCocoa.mm:
870         (WebKit::PageClientImplCocoa::didInsertAttachment):
871         (WebKit::PageClientImplCocoa::didRemoveAttachment):
872         * UIProcess/PageClient.h:
873         (WebKit::PageClient::didInsertAttachment):
874         (WebKit::PageClient::didRemoveAttachment):
875         * UIProcess/WebPageProxy.cpp:
876         (WebKit::WebPageProxy::didInsertAttachment):
877         (WebKit::WebPageProxy::didRemoveAttachment):
878         * UIProcess/WebPageProxy.h:
879         * UIProcess/WebPageProxy.messages.in:
880         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
881         (WebKit::WebEditorClient::didInsertAttachment):
882         (WebKit::WebEditorClient::didRemoveAttachment):
883         * WebProcess/WebCoreSupport/WebEditorClient.h:
884
885 2017-11-06  Jeremy Jones  <jeremyj@apple.com>
886
887         iOS element fullscreen should use a UIGestureRecognizer to detect user interaction.
888         https://bugs.webkit.org/show_bug.cgi?id=179029
889         rdar://problem/35307882
890
891         Reviewed by Simon Fraser.
892
893         Replace _WKTapDelegatingView with a UILongPressGestureRecognizer. When set with a duration of 0, it effectively
894         recognizes UITouchBegin events.
895
896         * UIProcess/ios/WKFullScreenWindowControllerIOS.mm:
897         (-[_WKFullScreenViewController loadView]):
898         (-[_WKFullScreenViewController gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
899         (-[_WKTapDelegatingView setTarget:action:]): Deleted.
900         (-[_WKTapDelegatingView hitTest:withEvent:]): Deleted.
901
902 2017-11-06  Chris Dumez  <cdumez@apple.com>
903
904         [Service Workers] Add proper implementation for 'updatefound' event
905         https://bugs.webkit.org/show_bug.cgi?id=179302
906
907         Reviewed by Brady Eidson.
908
909         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
910         (WebKit::WebSWServerConnection::fireUpdateFoundEvent):
911         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
912         * WebProcess/Storage/WebSWClientConnection.messages.in:
913
914 2017-11-06  Christopher Reid  <chris.reid@sony.com>
915
916         Use enum classes within FileSystem
917         https://bugs.webkit.org/show_bug.cgi?id=175172
918
919         Reviewed by Myles C. Maxfield.
920
921         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
922         * NetworkProcess/NetworkDataTaskBlob.cpp:
923         * NetworkProcess/cache/NetworkCache.cpp:
924         * NetworkProcess/capture/NetworkCaptureManager.cpp:
925         * NetworkProcess/capture/NetworkCaptureRecorder.cpp:
926         * Shared/WebMemorySampler.cpp:
927         * UIProcess/API/APIContentRuleListStore.cpp:
928         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
929
930 2017-11-06  Michael Catanzaro  <mcatanzaro@igalia.com>
931
932         [WPE] Properly use SYSTEM_INCLUDE_DIRECTORIES for WebKit build target
933         https://bugs.webkit.org/show_bug.cgi?id=179097
934
935         Reviewed by Žan Doberšek.
936
937         * PlatformWPE.cmake:
938
939 2017-11-05  Yusuke Suzuki  <utatane.tea@gmail.com>
940
941         JIT call inline caches should cache calls to objects with getCallData/getConstructData traps
942         https://bugs.webkit.org/show_bug.cgi?id=144458
943
944         Reviewed by Saam Barati.
945
946         * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
947         (WebKit::JSNPMethod::JSNPMethod):
948         (WebKit::JSNPMethod::getCallData): Deleted.
949         * WebProcess/Plugins/Netscape/JSNPMethod.h:
950         (WebKit::JSNPMethod::createStructure):
951
952 2017-11-04  Chris Dumez  <cdumez@apple.com>
953
954         REGRESSION(r223718): Leaking WebProcessPool after reconfiguration
955         https://bugs.webkit.org/show_bug.cgi?id=179123
956         <rdar://problem/35294685>
957
958         Reviewed by Geoff Garen.
959
960         Make sure we destroy the ServiceWorker WebProcess once all other WebProcesses
961         go away at there is no use keeping it running at this point. Also, this prevents
962         leaking the WebProcessPool since the WebProcessProxy holds a strong reference
963         to the WebProcessPool.
964
965         * UIProcess/WebProcessPool.cpp:
966         (WebKit::WebProcessPool::disconnectProcess):
967
968 2017-11-01  Darin Adler  <darin@apple.com>
969
970         Simplify event dispatch code and make it a bit more consistent
971         https://bugs.webkit.org/show_bug.cgi?id=178991
972
973         Reviewed by Chris Dumez.
974
975         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.cpp:
976         (webkit_dom_event_get_src_element): Call target instead of srcElement.
977
978 2017-11-04  Aishwarya Nirmal  <anirmal@apple.com>
979
980         [Touch Bar Web API] Add support for menuitem tag
981         https://bugs.webkit.org/show_bug.cgi?id=179020
982
983         Reviewed by Ryosuke Niwa.
984
985         Adds in the MenuItemElementEnabled flag so that the menu item element is a runtime-
986         enabled feature. It has a default value of false.
987
988         * Shared/WebPreferences.yaml:
989         * UIProcess/API/C/WKPreferences.cpp:
990         (WKPreferencesSetMenuItemElementEnabled):
991         (WKPreferencesGetMenuItemElementEnabled):
992         * UIProcess/API/C/WKPreferencesRefPrivate.h:
993
994 2017-11-03  Chris Dumez  <cdumez@apple.com>
995
996         Unreviewed, rolling out r224438.
997
998         Has caused assertions on the bots
999
1000         Reverted changeset:
1001
1002         "REGRESSION(r223718): Leaking WebProcessPool after
1003         reconfiguration"
1004         https://bugs.webkit.org/show_bug.cgi?id=179123
1005         https://trac.webkit.org/changeset/224438
1006
1007 2017-11-03  Youenn Fablet  <youenn@apple.com>
1008
1009         Requests handled by Service Worker should not go through preflighting
1010         https://bugs.webkit.org/show_bug.cgi?id=179250
1011
1012         Reviewed by Alex Christensen.
1013
1014         * WebProcess/Network/WebLoaderStrategy.cpp:
1015         (WebKit::WebLoaderStrategy::scheduleLoad):
1016         * WebProcess/Storage/WebSWClientConnection.cpp:
1017         (WebKit::WebSWClientConnection::startFetch):
1018         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
1019         (WebKit::shouldHandleFetch):
1020
1021 2017-11-03  Chris Dumez  <cdumez@apple.com>
1022
1023         REGRESSION(r223718): Leaking WebProcessPool after reconfiguration
1024         https://bugs.webkit.org/show_bug.cgi?id=179123
1025         <rdar://problem/35294685>
1026
1027         Reviewed by Geoffrey Garen.
1028
1029         Make sure we destroy the ServiceWorker WebProcess once all other WebProcesses
1030         go away at there is no use keeping it running at this point. Also, this prevents
1031         leaking the WebProcessPool since the WebProcessProxy holds a strong reference
1032         to the WebProcessPool.
1033
1034         * UIProcess/WebProcessPool.cpp:
1035         (WebKit::WebProcessPool::disconnectProcess):
1036
1037 2017-11-03  Youenn Fablet  <youenn@apple.com>
1038
1039         Implement Service Worker Matching Registration algorithm
1040         https://bugs.webkit.org/show_bug.cgi?id=178882
1041
1042         Reviewed by Chris Dumez.
1043
1044         Added IPC plumbery for matchRegistration request and response.
1045         Added some limited clearing of workers and registrations.
1046
1047         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1048         (WebKit::WebSWServerConnection::matchRegistration):
1049         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1050         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
1051         * StorageProcess/StorageProcess.cpp:
1052         (WebKit::StorageProcess::deleteWebsiteData):
1053         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
1054         * WebProcess/Storage/WebSWClientConnection.cpp:
1055         (WebKit::WebSWClientConnection::didMatchRegistration):
1056         (WebKit::WebSWClientConnection::matchRegistration):
1057         * WebProcess/Storage/WebSWClientConnection.h:
1058         * WebProcess/Storage/WebSWClientConnection.messages.in:
1059         * WebProcess/Storage/WebServiceWorkerProvider.h:
1060
1061 2017-11-03  Jeremy Jones  <jeremyj@apple.com>
1062
1063         Element fullscreen should use FloatRects instead of IntRects in beganEnterFullScreenWithInitialFrame
1064         https://bugs.webkit.org/show_bug.cgi?id=179033
1065         rdar://problem/35309279
1066         
1067         Reviewed by Darin Adler.
1068
1069         Screen coordinates are floats, so use NSRect instead of IntRect on Mac.
1070
1071         * UIProcess/mac/WKFullScreenWindowController.h:
1072         * UIProcess/mac/WKFullScreenWindowController.mm:
1073         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
1074         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
1075
1076 2017-11-03  Chris Dumez  <cdumez@apple.com>
1077
1078         Use a single identifier type to identify Service Workers
1079         https://bugs.webkit.org/show_bug.cgi?id=179192
1080
1081         Reviewed by Brady Eidson.
1082
1083         Use a single identifier type to identify Service Workers. We had both a String
1084         identifier and a uint64_t identifier for each service worker. We now consistently
1085         use a ServiceWorkerIdentifier which is a strongly typed identifier backed by a
1086         uint64_t.
1087
1088         * Scripts/webkit/messages.py:
1089         (forward_declarations_and_headers):
1090         (forward_declarations_and_headers.templates):
1091         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1092         (WebKit::WebSWServerConnection::startFetch):
1093         (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope):
1094         (WebKit::WebSWServerConnection::postMessageToServiceWorkerClient):
1095         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1096         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
1097         * StorageProcess/StorageProcess.cpp:
1098         (WebKit::StorageProcess::serviceWorkerContextFailedToStart):
1099         (WebKit::StorageProcess::serviceWorkerContextStarted):
1100         (WebKit::StorageProcess::postMessageToServiceWorkerClient):
1101         * StorageProcess/StorageProcess.h:
1102         * StorageProcess/StorageProcess.messages.in:
1103         * WebProcess/Storage/WebSWClientConnection.cpp:
1104         (WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope):
1105         (WebKit::WebSWClientConnection::postMessageToServiceWorkerClient):
1106         * WebProcess/Storage/WebSWClientConnection.h:
1107         * WebProcess/Storage/WebSWClientConnection.messages.in:
1108         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1109         (WebKit::WebSWContextManagerConnection::updateServiceWorker):
1110         (WebKit::WebSWContextManagerConnection::serviceWorkerStartedWithMessage):
1111         (WebKit::WebSWContextManagerConnection::startFetch):
1112         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerGlobalScope):
1113         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerClient):
1114         * WebProcess/Storage/WebSWContextManagerConnection.h:
1115         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
1116
1117 2017-11-03  Antti Koivisto  <antti@apple.com>
1118
1119         Enable display:contents by default as experimental feature
1120         https://bugs.webkit.org/show_bug.cgi?id=179239
1121         <rdar://problem/35334612>
1122
1123         Reviewed by Darin Adler.
1124
1125         We pass most of the WPT tests. What remains is mostly flexbox related edge cases.
1126
1127         * Shared/WebPreferences.yaml:
1128
1129 2017-11-03  Frederic Wang  <fwang@igalia.com>
1130
1131         Use WK_IOS_TBA instead of WK_MAC_TBA to indicate availability of private functions on iOS
1132         https://bugs.webkit.org/show_bug.cgi?id=179238
1133
1134         Reviewed by Darin Adler.
1135
1136         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1137         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
1138
1139 2017-11-02  Maciej Stachowiak  <mjs@apple.com>
1140
1141         Don't try to guess plugin MIME type from a file extension in a URL (no observable effect)
1142         https://bugs.webkit.org/show_bug.cgi?id=178333
1143
1144         Reviewed by Darin Adler.
1145
1146         * WebProcess/Plugins/PluginView.cpp:
1147         (WebKit::PluginView::pluginDidReceiveUserInteraction): loadedMIMEType --> serviceType
1148         * WebProcess/WebPage/WebPage.cpp:
1149         (WebKit::WebPage::determinePrimarySnapshottedPlugIn): ditto
1150
1151 2017-11-02  Brady Eidson  <beidson@apple.com>
1152
1153         SW: Implement "Update Registration State" algorithm (unused for now)
1154         https://bugs.webkit.org/show_bug.cgi?id=179186
1155
1156         Reviewed by Chris Dumez.
1157
1158         * Scripts/webkit/messages.py:
1159         (headers_for_type):
1160
1161         * Shared/WebCoreArgumentCoders.h:
1162
1163         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1164         (WebKit::WebSWServerConnection::updateRegistrationStateInClient):
1165         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1166         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
1167
1168         * WebProcess/Storage/WebSWClientConnection.cpp:
1169         (WebKit::WebSWClientConnection::addServiceWorkerRegistrationInServer):
1170         (WebKit::WebSWClientConnection::removeServiceWorkerRegistrationInServer):
1171         * WebProcess/Storage/WebSWClientConnection.h:
1172         * WebProcess/Storage/WebSWClientConnection.messages.in:
1173
1174 2017-11-02  Alex Christensen  <achristensen@webkit.org>
1175
1176         Use CompletionHandlers for redirects
1177         https://bugs.webkit.org/show_bug.cgi?id=179163
1178
1179         Reviewed by Tim Horton.
1180
1181         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
1182         (WebKit::BlobDownloadClient::willSendRequestAsync):
1183         * NetworkProcess/Downloads/BlobDownloadClient.h:
1184         * NetworkProcess/NetworkDataTask.h:
1185         * NetworkProcess/NetworkLoad.cpp:
1186         (WebKit::NetworkLoad::~NetworkLoad):
1187         (WebKit::NetworkLoad::continueWillSendRequest):
1188         (WebKit::NetworkLoad::willSendRequestAsync):
1189         * NetworkProcess/NetworkLoad.h:
1190         * NetworkProcess/NetworkLoadClient.h:
1191         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1192         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
1193         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
1194         * UIProcess/API/APIDownloadClient.h:
1195         (API::DownloadClient::willSendRequest):
1196         * UIProcess/API/C/WKContext.cpp:
1197         (WKContextSetDownloadClient):
1198         * UIProcess/Cocoa/DownloadClient.h:
1199         * UIProcess/Cocoa/DownloadClient.mm:
1200         (WebKit::DownloadClient::willSendRequest):
1201         * WebProcess/Network/WebResourceLoader.cpp:
1202         (WebKit::WebResourceLoader::willSendRequest):
1203         * WebProcess/Plugins/PluginView.cpp:
1204         (WebKit::PluginView::Stream::~Stream):
1205         (WebKit::PluginView::Stream::continueLoad):
1206         (WebKit::PluginView::Stream::willSendRequest):
1207         * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp:
1208
1209 2017-11-02  Christopher Reid  <chris.reid@sony.com>
1210
1211         Add a FileSystem namespace to FileSystem.cpp
1212         https://bugs.webkit.org/show_bug.cgi?id=179063
1213
1214         Reviewed by Darin Adler.
1215
1216         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
1217         * NetworkProcess/Downloads/BlobDownloadClient.h:
1218         * NetworkProcess/NetworkDataTaskBlob.cpp:
1219         * NetworkProcess/NetworkDataTaskBlob.h:
1220         * NetworkProcess/NetworkProcess.cpp:
1221         * NetworkProcess/cache/CacheStorageEngine.cpp:
1222         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
1223         * NetworkProcess/cache/NetworkCache.cpp:
1224         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
1225         * NetworkProcess/cache/NetworkCacheData.cpp:
1226         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
1227         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
1228         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
1229         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
1230         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1231         * NetworkProcess/capture/NetworkCaptureManager.cpp:
1232         * NetworkProcess/capture/NetworkCaptureManager.h:
1233         * NetworkProcess/capture/NetworkCaptureRecorder.cpp:
1234         * NetworkProcess/capture/NetworkCaptureResource.h:
1235         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1236         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1237         * NetworkProcess/soup/NetworkProcessSoup.cpp:
1238         * Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp:
1239         * Shared/Plugins/unix/PluginSearchPath.cpp:
1240         * Shared/WebMemorySampler.cpp:
1241         * Shared/WebMemorySampler.h:
1242         * Shared/gtk/ProcessExecutablePathGtk.cpp:
1243         * Shared/ios/ChildProcessIOS.mm:
1244         * Shared/mac/ChildProcessMac.mm:
1245         * Shared/mac/SandboxExtensionMac.mm:
1246         * Shared/wpe/ProcessExecutablePathWPE.cpp:
1247         * StorageProcess/StorageProcess.cpp:
1248         * UIProcess/API/APIContentRuleListStore.cpp:
1249         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
1250         * UIProcess/API/glib/IconDatabase.cpp:
1251         * UIProcess/API/glib/WebKitFaviconDatabase.cpp:
1252         * UIProcess/API/glib/WebKitFileChooserRequest.cpp:
1253         * UIProcess/API/glib/WebKitWebContext.cpp:
1254         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
1255         * UIProcess/Automation/WebAutomationSession.cpp:
1256         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1257         * UIProcess/Cocoa/WebViewImpl.mm:
1258         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
1259         * UIProcess/Plugins/gtk/PluginInfoCache.cpp:
1260         * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
1261         * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
1262         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
1263         * UIProcess/WebStorage/LocalStorageDatabase.cpp:
1264         * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
1265         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
1266         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1267         * UIProcess/gtk/WebProcessPoolGtk.cpp:
1268         * UIProcess/mac/WebPageProxyMac.mm:
1269         * UIProcess/wpe/WebProcessPoolWPE.cpp:
1270         * WebProcess/InjectedBundle/API/glib/WebKitExtensionManager.cpp:
1271         * WebProcess/InjectedBundle/glib/InjectedBundleGlib.cpp:
1272         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
1273         * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
1274         * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
1275         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
1276
1277 2017-11-02  Joseph Pecoraro  <pecoraro@apple.com>
1278
1279         Make ServiceWorker a Remote Inspector debuggable target
1280         https://bugs.webkit.org/show_bug.cgi?id=179043
1281         <rdar://problem/34126008>
1282
1283         Reviewed by Brian Burg.
1284
1285         * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.h:
1286         * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm:
1287         (debuggableTypeString):
1288         Provide a way to start a Remote Web Inspector frontend for a ServiceWorker target type.
1289
1290 2017-11-02  Ryan Haddad  <ryanhaddad@apple.com>
1291
1292         Unreviewed, rolling out r224353.
1293
1294         Breaks internal builds.
1295
1296         Reverted changeset:
1297
1298         "Ignore HSTS for partitioned, cross-origin subresource
1299         requests"
1300         https://bugs.webkit.org/show_bug.cgi?id=178993
1301         https://trac.webkit.org/changeset/224353
1302
1303 2017-11-02  John Wilander  <wilander@apple.com>
1304
1305         Ignore HSTS for partitioned, cross-origin subresource requests
1306         https://bugs.webkit.org/show_bug.cgi?id=178993
1307         <rdar://problem/34962462>
1308
1309         Reviewed by Brent Fulgham and Alex Christensen.
1310
1311         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1312         (downgradeRequest):
1313             Convenience function to downgrade a request if
1314             CFNetwork as already upgraded it during
1315             canonicalization. This allows the rest of 
1316             WebKit's processing to function, such as UIR
1317             and mixed content blocking.
1318         (updateIgnoreStrictTransportSecuritySettingIfNecessary):
1319             Adds and removed the ignore request accordingly.
1320         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
1321             Now asks CFNetwork to ignore HSTS on resource loads we
1322             partition cookies for.
1323         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
1324             Now asks CFNetwork to ignore HSTS on resource loads we
1325             partition cookies for.
1326
1327 2017-11-02  Yousuke Kimoto  <yousuke.kimoto@sony.com>
1328
1329         [WinCairo] Add IPC files for wincairo webkit
1330         https://bugs.webkit.org/show_bug.cgi?id=177919
1331
1332         Reviewed by Alex Christensen.
1333
1334         * Platform/IPC/Attachment.cpp:
1335         * Platform/IPC/Attachment.h:
1336         (IPC::Attachment::Attachment):
1337         (IPC::Attachment::handle):
1338         * Platform/IPC/Connection.h:
1339         (IPC::Connection::identifierIsNull):
1340         (IPC::Connection::sendWithReply):
1341         * Platform/IPC/win/AttachmentWin.cpp: Added.
1342         (IPC::Attachment::encode const):
1343         (IPC::getDuplicatedHandle):
1344         (IPC::Attachment::decode):
1345         * Platform/IPC/win/ConnectionWin.cpp: Added.
1346         (IPC::Connection::createServerAndClientIdentifiers):
1347         (IPC::Connection::platformInitialize):
1348         (IPC::Connection::platformInvalidate):
1349         (IPC::Connection::readEventHandler):
1350         (IPC::Connection::writeEventHandler):
1351         (IPC::Connection::open):
1352         (IPC::Connection::platformCanSendOutgoingMessages const):
1353         (IPC::Connection::sendOutgoingMessage):
1354         (IPC::Connection::willSendSyncMessage):
1355         (IPC::Connection::didReceiveSyncReply):
1356         * PlatformWin.cmake:
1357
1358 2017-11-02  Megan Gardner  <megan_gardner@apple.com>
1359
1360         Early out selection update when data is not present
1361         https://bugs.webkit.org/show_bug.cgi?id=179084
1362
1363         Reviewed by Ryosuke Niwa.
1364
1365         We should early out of a selection update when we do not have the data that is necessary to make that
1366         update. This mostly helps avoid debug asserts, but will be helpful with the selection changes that are
1367         ongoing.
1368
1369         * UIProcess/ios/WKContentViewInteraction.mm:
1370         (-[WKContentView _updateChangedSelection:]):
1371
1372 2017-11-02  Eric Carlson  <eric.carlson@apple.com>
1373
1374         [MediaStream] audioTrack.label is always empty on macOS
1375         https://bugs.webkit.org/show_bug.cgi?id=179175
1376         <rdar://problem/35315438>
1377
1378         Reviewed by Youenn Fablet.
1379
1380         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
1381         (WebKit::UserMediaCaptureManager::createCaptureSource): Pass settings.label to Source constructor.
1382
1383 2017-11-02  Frederic Wang  <fwang@igalia.com>
1384
1385         Add references to bug 179167 in FIXME comments
1386         https://bugs.webkit.org/show_bug.cgi?id=179168
1387
1388         Reviewed by Daniel Bates.
1389
1390         * Configurations/FeatureDefines.xcconfig:
1391
1392 2017-11-01  Jeremy Jones  <jeremyj@apple.com>
1393
1394         Implement WKFullscreenWindowController for iOS.
1395         https://bugs.webkit.org/show_bug.cgi?id=178924
1396         rdar://problem/34697120
1397
1398         Reviewed by Simon Fraser.
1399
1400         Plumb relevant calls through WKWebView and PageClientImplIOS.
1401
1402         This forms the base implementation for element fullscreen. This will animate an element into fullscreen and back to inline.
1403         It does this by replacing the WKWebView with a placeholder image and presenting the WKWebView with a fullscreen view controller.
1404         This also attempts to preserve UI state of the WKWebView when it is placed back inline.
1405
1406         To enable _WKFullscreenDelegate for iOS, this adds an iOS version of the delegate methods that passes WKWebView instead of NSView.
1407         The iOS version of these functions are renamed to be more specific and disambiguate them from the video fullscreen delegate methods.
1408
1409         This also adds an image asset for the done button.
1410
1411         * Configurations/FeatureDefines.xcconfig:
1412         * UIProcess/API/Cocoa/WKWebView.mm:
1413         (-[WKWebView hasFullScreenWindowController]):
1414         (-[WKWebView fullScreenWindowController]):
1415         (-[WKWebView closeFullScreenWindowController]):
1416         (-[WKWebView fullScreenPlaceholderView]):
1417         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1418         * UIProcess/API/Cocoa/_WKFullscreenDelegate.h:
1419         * UIProcess/Cocoa/FullscreenClient.h:
1420         * UIProcess/Cocoa/FullscreenClient.mm:
1421         (WebKit::FullscreenClient::FullscreenClient):
1422         (WebKit::FullscreenClient::setDelegate):
1423         (WebKit::FullscreenClient::willEnterFullscreen):
1424         (WebKit::FullscreenClient::didEnterFullscreen):
1425         (WebKit::FullscreenClient::willExitFullscreen):
1426         (WebKit::FullscreenClient::didExitFullscreen):
1427         * UIProcess/ios/PageClientImplIOS.mm:
1428         (WebKit::PageClientImpl::closeFullScreenManager):
1429         (WebKit::PageClientImpl::isFullScreen):
1430         (WebKit::PageClientImpl::enterFullScreen):
1431         (WebKit::PageClientImpl::exitFullScreen):
1432         (WebKit::PageClientImpl::beganEnterFullScreen):
1433         (WebKit::PageClientImpl::beganExitFullScreen):
1434         * UIProcess/ios/WKContentView.mm:
1435         * UIProcess/ios/WKFullScreenWindowControllerIOS.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKFullscreenDelegate.h.
1436         * UIProcess/ios/WKFullScreenWindowControllerIOS.mm: Added.
1437         (WebKit::replaceViewWithView):
1438         (WebKit::WKWebViewState::applyTo):
1439         (WebKit::WKWebViewState::store):
1440         (-[_WKTapDelgatingView setTarget:action:]):
1441         (-[_WKTapDelgatingView hitTest:withEvent:]):
1442         (-[_WKFullScreenViewController dealloc]):
1443         (-[_WKFullScreenViewController viewWillTransitionToSize:withTransitionCoordinator:]):
1444         (+[_WKFullScreenViewController configureView:withBackgroundFillOfColor:opacity:filter:]):
1445         (-[_WKFullScreenViewController _updateTransparencyOfVisualEffectView:]):
1446         (-[_WKFullScreenViewController createVisualEffectViewWithFrame:]):
1447         (-[_WKFullScreenViewController loadView]):
1448         (-[_WKFullScreenViewController viewWillAppear:]):
1449         (-[_WKFullScreenViewController viewDidDisappear:]):
1450         (-[_WKFullScreenViewController cancelAction:]):
1451         (-[_WKFullScreenViewController hideCancelButton]):
1452         (-[_WKFullScreenViewController showCancelButton]):
1453         (-[_WKFullScreenViewController setTarget:action:]):
1454         (-[_WKFullScreenViewController prefersStatusBarHidden]):
1455         (-[WKFullscreenAnimationController transitionDuration:]):
1456         (-[WKFullscreenAnimationController animateTransition:]):
1457         (-[WKFullscreenAnimationController animationEnded:]):
1458         (-[WKFullScreenWindowController initWithWebView:page:]):
1459         (-[WKFullScreenWindowController dealloc]):
1460         (-[WKFullScreenWindowController isFullScreen]):
1461         (-[WKFullScreenWindowController webViewPlaceholder]):
1462         (-[WKFullScreenWindowController enterFullScreen]):
1463         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
1464         (-[WKFullScreenWindowController completedEnterFullScreen]):
1465         (-[WKFullScreenWindowController exitFullScreen]):
1466         (-[WKFullScreenWindowController requestExitFullScreen]):
1467         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
1468         (-[WKFullScreenWindowController completedExitFullScreen]):
1469         (-[WKFullScreenWindowController close]):
1470         (-[WKFullScreenWindowController _manager]):
1471         (-[WKFullScreenWindowController animationControllerForPresentedController:presentingController:sourceController:]):
1472         (-[WKFullScreenWindowController animationControllerForDismissedController:]):
1473         * WebKit.xcassets/Contents.json: Added.
1474         * WebKit.xcassets/Done.imageset/Contents.json: Added.
1475         * WebKit.xcassets/Done.imageset/Done.pdf: Added.
1476         * WebKit.xcodeproj/project.pbxproj:
1477         * WebProcess/FullScreen/WebFullScreenManager.cpp:
1478         (WebKit::WebFullScreenManager::willEnterFullScreen):
1479         (WebKit::WebFullScreenManager::willExitFullScreen):
1480
1481 2017-11-01  Daniel Bates  <dabates@apple.com>
1482
1483         XMLHttpRequest should not sniff content encoding
1484         https://bugs.webkit.org/show_bug.cgi?id=175597
1485         <rdar://problem/34912624>
1486
1487         Reviewed by Alex Christensen.
1488
1489         Fixes an issue where the body of an HTTP response with headers "Content-Type: application/octet-stream" and
1490         "Content-Encoding: gzip" associated with an XHR request to a .gz file would not be automatically gzipped
1491         decompressed. Specifically, such a response would be treated analogous to a response with headers
1492         "Content-Type: application/gzip" and "Content-Encoding: identity". This behavior does not conform to the
1493         behavior of the Content-Encoding header as defined in the HTTP 1.1 and later specs. Moreover this behavior
1494         breaks the Epic Zen Garden demo: <https://s3.amazonaws.com/mozilla-games/ZenGarden/EpicZenGarden.html>.
1495
1496         On macOS 10.13.2 opt out of content encoding sniffing when making an XHR request. We likely can
1497         selectively opt out of content encoding sniffing for other network requests. This will be done
1498         in subsequent commits to make it straightforward to identify site breakage (if any).
1499
1500         * NetworkProcess/Downloads/Download.cpp:
1501         (WebKit::Download::start): Enable content encoding sniff to match existing behavior.
1502         (WebKit::Download::startWithHandle): Ditto.
1503         * NetworkProcess/NetworkDataTask.cpp:
1504         (WebKit::NetworkDataTask::create): Pass through the content encoding sniffing policy.
1505         * NetworkProcess/NetworkLoad.cpp:
1506         (WebKit::NetworkLoad::NetworkLoad): Ditto.
1507         * NetworkProcess/NetworkLoadParameters.h:
1508         * NetworkProcess/NetworkResourceLoadParameters.cpp:
1509         (WebKit::NetworkResourceLoadParameters::encode const): Encode content encoding sniffing policy.
1510         (WebKit::NetworkResourceLoadParameters::decode): Decode content encoding sniffing policy.
1511         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
1512         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad): Enable content encoding sniff to match existing
1513         behavior. We should look to disable content encoding sniffing in a subsequent change.
1514         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
1515         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1516         (WebKit::applySniffingPoliciesAndBindRequestToInferfaceIfNeeded): Added helper function
1517         to apply sniffing policies and bind request to interface, if applicable.
1518         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): Modified to take the content encoding sniffing
1519         policy. Calls applySniffingPoliciesAndBindRequestToInferfaceIfNeeded() to apply this policy. Also use
1520         convenience function URL::isLocalFile() to determine if the URL is a file URL.
1521         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1522         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup): Pass through the content encoding sniffing policy.
1523         * NetworkProcess/soup/NetworkDataTaskSoup.h:
1524         * WebProcess/Network/WebLoaderStrategy.cpp:
1525         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): Pass through the content encoding sniffing policy.
1526         (WebKit::WebLoaderStrategy::loadResourceSynchronously): Enable content encoding sniff to match existing
1527         behavior.
1528
1529 2017-11-01  Brady Eidson  <beidson@apple.com>
1530
1531         Plumbing for handling SW scripts failing to evaluate
1532         https://bugs.webkit.org/show_bug.cgi?id=178926
1533
1534         Reviewed by Chris Dumez.
1535
1536         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1537         (WebKit::WebSWServerConnection::updateServiceWorkerContext):
1538         (WebKit::WebSWServerConnection::setContextConnection):
1539         (WebKit::WebSWServerConnection::startServiceWorkerContext): Deleted.
1540         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1541
1542         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1543         (WebKit::WebSWContextManagerConnection::updateServiceWorker):
1544         (WebKit::WebSWContextManagerConnection::serviceWorkerStartedWithMessage):
1545         (WebKit::WebSWContextManagerConnection::startServiceWorker): Deleted.
1546         * WebProcess/Storage/WebSWContextManagerConnection.h:
1547         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
1548
1549 2017-11-01  Frederic Wang  <fwang@igalia.com>
1550
1551         Make iOS Find UI reveal matches in scrollable elements
1552         https://bugs.webkit.org/show_bug.cgi?id=178789
1553
1554         Reviewed by Tim Horton.
1555
1556         * WebProcess/WebPage/ios/FindControllerIOS.mm:
1557         (WebKit::FindController::didFindString): Reveal selection up to the main frame. The main frame
1558         is handled by the SmartMagnificationController.
1559
1560 2017-11-01  Michael Catanzaro  <mcatanzaro@igalia.com>
1561
1562         REGRESSION(r224192): [WPE] Fix WebEventFactory::createWebWheelEvent
1563         https://bugs.webkit.org/show_bug.cgi?id=179098
1564
1565         Reviewed by Sam Weinig.
1566
1567         * Shared/wpe/WebEventFactory.cpp:
1568         (WebKit::WebEventFactory::createWebWheelEvent):
1569
1570 2017-10-31  Tim Horton  <timothy_horton@apple.com>
1571
1572         Clean up some drag and drop feature flags
1573         https://bugs.webkit.org/show_bug.cgi?id=179082
1574
1575         Reviewed by Simon Fraser.
1576
1577         * Configurations/FeatureDefines.xcconfig:
1578
1579 2017-10-31  Wenson Hsieh  <wenson_hsieh@apple.com>
1580
1581         Followup to r224238: API::Attachment should generate a _WKAttachment ObjC wrapper
1582         https://bugs.webkit.org/show_bug.cgi?id=179080
1583
1584         Reviewed by Tim Horton.
1585
1586         Fixes a failing API test. The new Attachment object type added in r224238 was not actually being handled in
1587         Object::newObject, so a plain WKObject Objective C wrapper was being created; fix this by allocating a new
1588         _WKAttachment object for Type::Attachment.
1589
1590         * Shared/Cocoa/APIObject.mm:
1591         (API::Object::newObject):
1592
1593 2017-10-31  Tim Horton  <timothy_horton@apple.com>
1594
1595         Fix up some content filtering feature flags
1596         https://bugs.webkit.org/show_bug.cgi?id=179079
1597
1598         Reviewed by Simon Fraser.
1599
1600         * Configurations/FeatureDefines.xcconfig:
1601
1602 2017-10-31  Youenn Fablet  <youenn@apple.com>
1603
1604         rwt should allow service worker to load localhost HTTPS resources with any certificate
1605         https://bugs.webkit.org/show_bug.cgi?id=179018
1606
1607         Reviewed by Chris Dumez.
1608
1609         Allowing ServiceWorkerProcessProxy to handle authentication challenge.
1610         Temporarily adding a boolean flag through WebProcessPool to lower the SSL certificate verifications for service workers.
1611         This allows reducing flakiness in our layout tests for rwt.
1612         Future work should be done to expose a correct API for the application level to handle authentication challenges properly.
1613
1614         * UIProcess/API/C/WKContext.cpp:
1615         (WKContextSetAllowsAnySSLCertificateForServiceWorkerTesting):
1616         * UIProcess/API/C/WKContextPrivate.h:
1617         * UIProcess/API/Cocoa/WKProcessPool.mm:
1618         (-[WKProcessPool _setAllowsAnySSLCertificateForServiceWorker:]):
1619         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1620         * UIProcess/Network/NetworkProcessProxy.cpp:
1621         (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
1622         (WebKit::NetworkProcessProxy::canAuthenticateAgainstProtectionSpace):
1623         * UIProcess/ServiceWorkerProcessProxy.cpp:
1624         (WebKit::ServiceWorkerProcessProxy::didReceiveAuthenticationChallenge):
1625         * UIProcess/ServiceWorkerProcessProxy.h:
1626         * UIProcess/WebProcessPool.h:
1627
1628 2017-10-31  Joseph Pecoraro  <pecoraro@apple.com>
1629
1630         Web Inspector: UIProcess ASSERT in ~RemoteWebInspectorProxy when InspectorProcess crashes
1631         https://bugs.webkit.org/show_bug.cgi?id=179044
1632
1633         Reviewed by Alex Christensen.
1634
1635         * UIProcess/RemoteWebInspectorProxy.cpp:
1636         (WebKit::RemoteWebInspectorProxy::frontendDidClose):
1637         Add a protector to keep the proxy alive for the duration of this method.
1638
1639 2017-10-31  Youenn Fablet  <youenn@apple.com>
1640
1641         Crash in:  com.apple.WebKit: WebKit::CacheStorage::Caches::initializeSize(WTF::Function<void (std::optional<WebCore::DOMCacheEngine::Error>&&)>&&) + 30 (CacheStorageEngineCaches.cpp:163)
1642         https://bugs.webkit.org/show_bug.cgi?id=179037
1643
1644         Reviewed by Chris Dumez.
1645
1646         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
1647         (WebKit::CacheStorage::Caches::initializeSize): the storage backend may be cleared when clearing caches by the UI Process.
1648         Returning early in that case. A web application will typically fail to open a cache in this case.
1649         On retry, the cache should be opened.
1650
1651 2017-10-31  Wenson Hsieh  <wenson_hsieh@apple.com>
1652
1653         [Attachment Support] Implement WKWebView SPI for inserting attachment elements
1654         https://bugs.webkit.org/show_bug.cgi?id=179013
1655         <rdar://problem/35249668>
1656
1657         Reviewed by Tim Horton.
1658
1659         Adds native SPI to insert attachment elements given a filename, an optional MIME type, and a data blob. See
1660         change-by-change comments below for more detail. Covered by a new API test.
1661
1662         * PlatformMac.cmake:
1663         * Shared/API/APIObject.h:
1664         * Shared/API/Cocoa/WebKitPrivate.h:
1665         * UIProcess/API/APIAttachment.cpp: Copied from Source/WebKit/Shared/API/Cocoa/WebKitPrivate.h.
1666         (API::Attachment::create):
1667         (API::Attachment::Attachment):
1668         (API::Attachment::~Attachment):
1669
1670         Introduce API::Attachment, which represents a platform-agnostic Attachment.
1671
1672         * UIProcess/API/APIAttachment.h: Copied from Source/WebKit/Shared/API/Cocoa/WebKitPrivate.h.
1673         * UIProcess/API/Cocoa/WKWebView.mm:
1674         (-[WKWebView _insertAttachmentWithFilename:contentType:data:options:completion:]):
1675
1676         Adds support for inserting a new attachment element. Calls out to WebPageProxy to insert the attachment from the
1677         given data blob, and creates a new API-object-backed _WKAttachment.
1678
1679         (-[WKWebView _executeEditCommand:argument:completion:]):
1680
1681         Support passing in a nil completion block.
1682
1683         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1684         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1685         * UIProcess/API/Cocoa/_WKAttachment.h: Copied from Source/WebKit/Shared/API/Cocoa/WebKitPrivate.h.
1686         * UIProcess/API/Cocoa/_WKAttachment.mm: Copied from Source/WebCore/html/HTMLAttachmentElement.h.
1687
1688         Introduces _WKAttachment, an Objective C wrapper around the API::Attachment.
1689
1690         (-[_WKAttachment _apiObject]):
1691         (-[_WKAttachment isEqual:]):
1692         (-[_WKAttachment uniqueIdentifier]):
1693         (-[_WKAttachment hash]):
1694
1695         Add _WKAttachment, a WebKit SPI object that wraps an attachment element unique identifier. Also, allow
1696         _WKAttachment to be used as a hashable NSDictionary key.
1697
1698         (-[_WKAttachment description]):
1699         * UIProcess/API/Cocoa/_WKAttachmentInternal.h: Copied from Source/WebKit/Shared/API/Cocoa/WebKitPrivate.h.
1700         (API::wrapper):
1701         * UIProcess/WebPageProxy.cpp:
1702         (WebKit::WebPageProxy::insertAttachment):
1703
1704         Implement IPC support for inserting an attachment.
1705
1706         * UIProcess/WebPageProxy.h:
1707         * WebKit.xcodeproj/project.pbxproj:
1708         * WebProcess/WebPage/WebPage.cpp:
1709         (WebKit::WebPage::insertAttachment):
1710         * WebProcess/WebPage/WebPage.h:
1711         * WebProcess/WebPage/WebPage.messages.in:
1712
1713 2017-10-31  Alex Christensen  <achristensen@webkit.org>
1714
1715         Fix custom header field setting with reloads and asynchronous navigation action policy decisions
1716         https://bugs.webkit.org/show_bug.cgi?id=179064
1717
1718         Reviewed by Tim Horton.
1719
1720         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1721         (WebKit::WebFrameLoaderClient::applyToDocumentLoader):
1722         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1723         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1724         * WebProcess/WebPage/WebFrame.cpp:
1725         (WebKit::WebFrame::didReceivePolicyDecision):
1726         * WebProcess/WebPage/WebFrame.h:
1727         * WebProcess/WebPage/WebPage.cpp:
1728         (WebKit::WebPage::didReceivePolicyDecision):
1729
1730 2017-10-31  Carlos Garcia Campos  <cgarcia@igalia.com>
1731
1732         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.19.1 release.
1733
1734         * gtk/NEWS: Add release notes for 2.19.1.
1735
1736 2017-10-31  Carlos Garcia Campos  <cgarcia@igalia.com>
1737
1738         Unreviewed. Fix GTK+ make distcheck.
1739
1740         Include WebCore/TextEncodingRegistry.h to ensure the forwarding header is generated.
1741
1742         * UIProcess/API/glib/WebKitSettings.cpp:
1743
1744 2017-10-31  Commit Queue  <commit-queue@webkit.org>
1745
1746         Unreviewed, rolling out r223884.
1747         https://bugs.webkit.org/show_bug.cgi?id=179055
1748
1749         It broke GTK+ make distcheck (Requested by KaL on #webkit).
1750
1751         Reverted changeset:
1752
1753         "[GTK][WPE] generate-forwarding-headers.pl should also scan
1754         derived sources in WebKit framework"
1755         https://bugs.webkit.org/show_bug.cgi?id=178579
1756         https://trac.webkit.org/changeset/223884
1757
1758 2017-10-30  Fujii Hironori  <Hironori.Fujii@sony.com>
1759
1760         Use LazyNeverDestroyed instead of DEFINE_GLOBAL for XMLNames, HTMLNames, MathMLNames and SVGNames
1761         https://bugs.webkit.org/show_bug.cgi?id=175118
1762
1763         Reviewed by Alex Christensen.
1764
1765         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPrivate.cpp:
1766         (WebKit::wrap):
1767
1768 2017-10-27  Megan Gardner  <megan_gardner@apple.com>
1769
1770         Correctly determine affinity when inserting text via Keyboard Suggestions
1771         https://bugs.webkit.org/show_bug.cgi?id=178969
1772
1773         Reviewed by Ryosuke Niwa.
1774
1775         Use the logic of VisiblePosition to correctly determine cursor affinity. We were
1776         defaulting to upstream, but that in incorrect and resulted in hitting asserts that
1777         we should not. This should give us the correct affinity in all cases.
1778
1779         * WebProcess/WebPage/ios/WebPageIOS.mm:
1780         (WebKit::WebPage::syncApplyAutocorrection):
1781
1782 2017-10-30  Commit Queue  <commit-queue@webkit.org>
1783
1784         Unreviewed, rolling out r224078.
1785         https://bugs.webkit.org/show_bug.cgi?id=179026
1786
1787         MotionMark regression (Requested by shallawa on #webkit).
1788
1789         Reverted changeset:
1790
1791         "When navigating back to a page, compositing layers may not
1792         use accelerated drawing"
1793         https://bugs.webkit.org/show_bug.cgi?id=178749
1794         https://trac.webkit.org/changeset/224078
1795
1796 2017-10-30  Sam Weinig  <sam@webkit.org>
1797
1798         [Setting] Only expose experimental features that are compiled in
1799         https://bugs.webkit.org/show_bug.cgi?id=179023
1800
1801         Reviewed by Tim Horton.
1802
1803         * Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb:
1804         
1805             Update template to conditionally expose experimental features based on their
1806             'condition' option in WebPreferences.yaml
1807
1808 2017-10-30  Michael Catanzaro  <mcatanzaro@igalia.com>
1809
1810         [WPE] Fix build warnings
1811         https://bugs.webkit.org/show_bug.cgi?id=178899
1812
1813         Reviewed by Carlos Alberto Lopez Perez.
1814
1815         * PlatformWPE.cmake:
1816
1817 2017-10-30  Sam Weinig  <sam@webkit.org>
1818
1819         [Settings] Replace macro driven experimental features code with generated code
1820         https://bugs.webkit.org/show_bug.cgi?id=178994
1821
1822         Reviewed by Simon Fraser.
1823
1824         As a first step toward allowing experimental features to vary based on compile
1825         time flags, replace the macro driven implementation of the WebPreferences part
1826         of experimental features, with one generated from a template file.
1827
1828         * CMakeLists.txt:
1829         * DerivedSources.make:
1830         * Scripts/GeneratePreferences.rb:
1831         * WebKit.xcodeproj/project.pbxproj:
1832
1833             Generate the new template.
1834         
1835         * Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb: Added.
1836         * UIProcess/WebPreferences.cpp:
1837         (WebKit::createExperimentalFeaturesVector): Deleted.
1838         (WebKit::WebPreferences::experimentalFeatures): Deleted.
1839         (WebKit::WebPreferences::isEnabledForFeature const): Deleted.
1840         (WebKit::WebPreferences::setEnabledForFeature): Deleted.
1841         (WebKit::WebPreferences::enableAllExperimentalFeatures): Deleted.
1842         
1843             Replace macro implementation with template generated one.
1844
1845 2017-10-30  Michael Catanzaro  <mcatanzaro@igalia.com>
1846
1847         [WPE] Build more files under WebCore as unified sources and get rid of WebCorePlatformWPE build target
1848         https://bugs.webkit.org/show_bug.cgi?id=178964
1849
1850         Reviewed by Carlos Alberto Lopez Perez.
1851
1852         * PlatformWPE.cmake:
1853
1854 2017-10-30  Michael Catanzaro  <mcatanzaro@igalia.com>
1855
1856         [WPE][GTK] Expose availability of certain editing commands in WebKitEditorState
1857         https://bugs.webkit.org/show_bug.cgi?id=168219
1858
1859         Reviewed by Ryosuke Niwa.
1860
1861         Expose canCut, canCopy, canPaste, canUndo, and canRedo in EditorState::PostLayouData.
1862
1863         Add corresponding new WPE/GTK API.
1864
1865         Remove allowsCopy from WebKitTestResultData. It's unused, does not work correctly in all
1866         circumstances, and irritates Ryosuke.
1867
1868         Also, remove a bunch of #ifs guarding post layout data, since it's now used on all ports.
1869
1870         * Shared/EditorState.cpp:
1871         (WebKit::EditorState::encode const):
1872         (WebKit::EditorState::decode):
1873         (WebKit::EditorState::PostLayoutData::encode const):
1874         (WebKit::EditorState::PostLayoutData::decode):
1875         * Shared/EditorState.h:
1876         (WebKit::EditorState::postLayoutData const const):
1877         * Shared/WebHitTestResultData.cpp:
1878         (WebKit::WebHitTestResultData::WebHitTestResultData):
1879         (WebKit::WebHitTestResultData::encode const):
1880         (WebKit::WebHitTestResultData::decode):
1881         * Shared/WebHitTestResultData.h:
1882         * UIProcess/API/APIHitTestResult.h:
1883         (API::HitTestResult::allowsCopy const): Deleted.
1884         * UIProcess/API/glib/WebKitEditorState.cpp:
1885         (webkitEditorStateChanged):
1886         (webkit_editor_state_is_cut_available):
1887         (webkit_editor_state_is_copy_available):
1888         (webkit_editor_state_is_paste_available):
1889         (webkit_editor_state_is_undo_available):
1890         (webkit_editor_state_is_redo_available):
1891         * UIProcess/API/glib/WebKitWebView.cpp:
1892         (webkit_web_view_can_execute_editing_command):
1893         * UIProcess/API/gtk/WebKitEditorState.h:
1894         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
1895         * UIProcess/API/wpe/WebKitEditorState.h:
1896         * WebProcess/WebPage/WebPage.cpp:
1897         (WebKit::WebPage::editorState const):
1898         * WebProcess/WebPage/mac/WebPageMac.mm:
1899         (WebKit::WebPage::performImmediateActionHitTestAtLocation):
1900
1901 2017-10-27  Sam Weinig  <sam@webkit.org>
1902
1903         [Settings] Generate more of the WebKit preferences code
1904         https://bugs.webkit.org/show_bug.cgi?id=178945
1905
1906         Reviewed by Chris Dumez.
1907
1908         Generate WebPreferencesKeys.{h,cpp} and WebPreferencesStoreDefaultsMap.cpp
1909
1910         * CMakeLists.txt:
1911         * DerivedSources.make:
1912         * WebKit.xcodeproj/project.pbxproj:
1913         * Scripts/GeneratePreferences.rb:
1914         
1915             Generate new files.
1916         
1917         * Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb:
1918         
1919             Update include.
1920         
1921         * Scripts/PreferencesTemplates/WebPreferencesKeys.cpp.erb: Added.
1922         * Scripts/PreferencesTemplates/WebPreferencesKeys.h.erb: Added.
1923         * Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb: Added.
1924
1925             Add template files for new generated files.
1926
1927         * Shared/WebPreferencesDefaultValues.h: Copied from Source/WebKit/Shared/WebPreferencesDefinitionsBase.h.
1928         * Shared/WebPreferencesDefinitionsBase.h:
1929         
1930             Renamed WebPreferencesDefinitionsBase.h to WebPreferencesDefaultValues.h to better indicate what it is.
1931         
1932         * Shared/WebPreferencesKeys.cpp: Removed.
1933         * Shared/WebPreferencesKeys.h: Removed.
1934         
1935             Replaced with generated versions.
1936
1937         * Shared/WebPreferencesStore.cpp:
1938         (WebKit::defaults): Deleted.
1939         * Shared/WebPreferencesStore.h:
1940         
1941             Replace macro driven defaults map with generated WebPreferencesStoreDefaultsMap.cpp.
1942
1943 2017-10-28  Chris Dumez  <cdumez@apple.com>
1944
1945         self.ExtendableEvent / Client / Clients / WindowClient do not exist in a Service Worker
1946         https://bugs.webkit.org/show_bug.cgi?id=178976
1947
1948         Reviewed by Sam Weinig.
1949
1950         Actually enable the Service Worker RuntimeEnabledFeature in the Service Worker
1951         WebProcess.
1952
1953         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1954         (WebKit::WebSWContextManagerConnection::updatePreferences):
1955
1956 2017-10-28  Joseph Pecoraro  <pecoraro@apple.com>
1957
1958         Make postprocess-framework-headers.sh a little easier to read
1959         https://bugs.webkit.org/show_bug.cgi?id=178971
1960
1961         Reviewed by Sam Weinig.
1962
1963         * mac/postprocess-framework-headers.sh:
1964
1965 2017-10-27  Daniel Bates  <dabates@apple.com>
1966
1967         Attempt to fix the Apple El Capitan build following <https://trac.webkit.org/changeset/224134>
1968         (https://bugs.webkit.org/show_bug.cgi?id=178919)
1969
1970         Move definition of NetworkLoad::isAllowedToAskUserForCredentials() outside of USE(NETWORK_SESSION)-guarded section.
1971
1972         * NetworkProcess/NetworkLoad.cpp:
1973         (WebKit::NetworkLoad::isAllowedToAskUserForCredentials const):
1974
1975 2017-10-27  Daniel Bates  <dabates@apple.com>
1976
1977         Only allow non-mixed content protected subresources to ask for credentials
1978         https://bugs.webkit.org/show_bug.cgi?id=178919
1979         <rdar://problem/35015245>
1980
1981         Reviewed by Alex Christensen.
1982
1983         Only allow non-mixed content protected subresources to ask for credentials. It is not meaningful
1984         to allow protected mixed-content subresources to ask for credentials.
1985
1986         * NetworkProcess/Downloads/PendingDownload.cpp:
1987         (WebKit::PendingDownload::PendingDownload): Initialize m_isAllowedToAskUserForCredentials based on
1988         the specified resource load parameters or NetworkLoad object.
1989         * NetworkProcess/Downloads/PendingDownload.h: Add override for NetworkLoadClient::isAllowedToAskUserForCredentials().
1990         * NetworkProcess/NetworkLoad.cpp:
1991         (WebKit::NetworkLoad::isAllowedToAskUserForCredentials const): Added.
1992         (WebKit::NetworkLoad::completeAuthenticationChallenge): Ask NetworkLoadClient whether the load is
1993         allowed to prompt for credentials.
1994         (WebKit::NetworkLoad::didReceiveAuthenticationChallenge): Ditto.
1995         * NetworkProcess/NetworkLoad.h:
1996         * NetworkProcess/NetworkLoadClient.h:
1997         * NetworkProcess/NetworkResourceLoader.cpp:
1998         (WebKit::NetworkResourceLoader::NetworkResourceLoader): Initialize m_isAllowedToAskUserForCredentials
1999         based on the specified resource load parameters.
2000         (WebKit::NetworkResourceLoader::willSendRedirectedRequest): We do not support prompting for credentials
2001         for synchronous loads.
2002         (WebKit::NetworkResourceLoader::continueWillSendRequest): Modified to take an argument as to whether the
2003         load is allowed to ask the user for credentials and updates state.
2004         * NetworkProcess/NetworkResourceLoader.h:
2005         * NetworkProcess/NetworkResourceLoader.messages.in: Modified message ContinueWillSendRequest to take a
2006         boolean as to whether the load is allowed to ask the user for credentials.
2007         * NetworkProcess/PreconnectTask.h: Override NetworkLoadClient::isAllowedToAskUserForCredentials()
2008         such that we never ask for credentials. This matches our current behavior.
2009         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h: Ditto.
2010         * WebProcess/Network/WebResourceLoader.cpp:
2011         (WebKit::WebResourceLoader::willSendRequest): Query ResourceLoader as to whether the load is allowed to
2012         ask the user for credentials and pass this state to NetworkResourceLoader.
2013
2014 2017-10-27  Adrian Perez de Castro  <aperez@igalia.com>
2015
2016         [GTK][CMake] Incorrect conditional check when adding build dir to GIR runtime library path
2017         https://bugs.webkit.org/show_bug.cgi?id=178936
2018
2019         Reviewed by Michael Catanzaro.
2020
2021         * PlatformGTK.cmake: Fix spelling of variable used in conditional.
2022
2023 2017-10-27  Chris Dumez  <cdumez@apple.com>
2024
2025         Add initial support for serviceWorkerClient.postMessage()
2026         https://bugs.webkit.org/show_bug.cgi?id=178794
2027
2028         Reviewed by Youenn Fablet.
2029
2030         Add initial support for serviceWorkerClient.postMessage():
2031         - https://w3c.github.io/ServiceWorker/#client-postmessage
2032
2033         It is now possible to do bi-directional communication with a service worker
2034         via postMessage().
2035
2036         * Shared/WebCoreArgumentCoders.cpp:
2037         (IPC::ArgumentCoder<ServiceWorkerClientIdentifier>::encode):
2038         (IPC::ArgumentCoder<ServiceWorkerClientIdentifier>::decode):
2039         * Shared/WebCoreArgumentCoders.h:
2040         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2041         (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope):
2042         (WebKit::WebSWServerConnection::postMessageToServiceWorkerClient):
2043         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2044         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
2045         * StorageProcess/StorageProcess.cpp:
2046         (WebKit::StorageProcess::postMessageToServiceWorkerClient):
2047         * StorageProcess/StorageProcess.h:
2048         * StorageProcess/StorageProcess.messages.in:
2049         * WebProcess/Storage/WebSWClientConnection.cpp:
2050         (WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope):
2051         (WebKit::WebSWClientConnection::postMessageToServiceWorkerClient):
2052         * WebProcess/Storage/WebSWClientConnection.h:
2053         * WebProcess/Storage/WebSWClientConnection.messages.in:
2054         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2055         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerGlobalScope):
2056         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerClient):
2057         * WebProcess/Storage/WebSWContextManagerConnection.h:
2058         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
2059
2060 2017-10-27  David Kilzer  <ddkilzer@apple.com>
2061
2062         REGRESSION (r224077): DeprecatedGlobalSettings::setAVKitEnabled() not protected by HAVE(AVKIT)
2063
2064         Unreviewed build fix.
2065
2066         * WebProcess/WebPage/WebPage.cpp:
2067         (WebKit::WebPage::updatePreferences): Fix build.
2068
2069 2017-10-26  Jeremy Jones  <jeremyj@apple.com>
2070
2071         Implement seek tolerance methods in WebAVPlayerController.
2072         https://bugs.webkit.org/show_bug.cgi?id=178838
2073         rdar://problem/33781777
2074
2075         Reviewed by Eric Carlson.
2076
2077         This implementes additional methods on WebAVPlayerController that allows AVKit more control over seeking.
2078
2079         * UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
2080         * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
2081         (WebKit::PlaybackSessionModelContext::seekToTime):
2082         (WebKit::PlaybackSessionManagerProxy::seekToTime):
2083         * WebProcess/cocoa/PlaybackSessionManager.h:
2084         * WebProcess/cocoa/PlaybackSessionManager.messages.in:
2085         * WebProcess/cocoa/PlaybackSessionManager.mm:
2086         (WebKit::PlaybackSessionManager::seekToTime):
2087
2088 2017-10-26  Brian Burg  <bburg@apple.com>
2089
2090         Web Automation: denying user permission for getUserMedia doesn't work
2091         https://bugs.webkit.org/show_bug.cgi?id=178895
2092
2093         Reviewed by Youenn Fablet.
2094
2095         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2096         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
2097         The ordering of special cases is incorrect. Safari configures its automation views to
2098         allow mock devices and never prompt for them. These checks were before the check for
2099         the automation session's getUserMedia permission. Switch these checks.
2100
2101         Also change the deny reason so that subsequent requests are also denied. This matches
2102         behavior when a user denies a permission request on a real dialog. With this change,
2103         the DOM error changes from SecurityError to NotAllowedError, which makes more sense.
2104
2105 2017-10-26  Michael Catanzaro  <mcatanzaro@igalia.com>
2106
2107         Unreviewed, fix GCC warning spam after r224077
2108         https://bugs.webkit.org/show_bug.cgi?id=178823
2109
2110         Need to leave a blank line at the bottom of the file.
2111
2112         * Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb:
2113
2114 2017-10-25  Simon Fraser  <simon.fraser@apple.com>
2115
2116         When navigating back to a page, compositing layers may not use accelerated drawing
2117         https://bugs.webkit.org/show_bug.cgi?id=178749
2118         rdar://problem/35158946
2119
2120         Reviewed by Dean Jackson.
2121
2122         Avoid assertions when a test enables accelerated drawing (which we can't support
2123         in the iOS simulator).
2124
2125         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
2126         (WebKit::RemoteLayerBackingStore::ensureBackingStore):
2127
2128 2017-10-26  Sam Weinig  <sam@webkit.org>
2129
2130         [Settings] Generate the bulk of WebPage::updatePreferences(...)
2131         https://bugs.webkit.org/show_bug.cgi?id=178823
2132
2133         Reviewed by Tim Horton.
2134
2135         * CMakeLists.txt:
2136         * DerivedSources.make:
2137         * WebKit.xcodeproj/project.pbxproj:
2138
2139             Add new file generation.
2140
2141         * Scripts/GeneratePreferences.rb:
2142         
2143             Replace 'webkitOnly' boolean option with a new 'webcoreBinding' option.
2144             'webcoreBinding' supports the following values:
2145                 - none (same as webkit only)
2146                 - custom (means that you do bind to a webcore concept, but currently it must
2147                   be done in a custom manner)
2148                 - DeprecatedGlobalSettings (binds to a DeprecatedGlobalSettings setting)
2149                 - RuntimeEnabledFeatures (binds to a RuntimeEnabledFeatures setting)
2150             If 'webcoreBinding' is not provided, the preference binds to WebCore Setting
2151             of either the same name or the override name provided by the new 'webcoreName'
2152             option (we should try to remove the need for 'webcoreName' by unifying with 
2153             WebCore on preference/setting naming).
2154             
2155             A 'condition' option was also added to indicate that the preference is only available
2156             when that macro condition is true.
2157             
2158             Since we are generating most of WebPage::updatePreferences, we can simplify the
2159             macros in WebPreferencesDefinitions.h to only have normal/debug/experimental variants
2160             and remove the need for per-type macros, which were only used in WebPage::updatePreferences.
2161         
2162         * Scripts/PreferencesTemplates/WebPageUpdatePreferences.cpp.erb: Added.
2163         
2164             Generates bindings from WebPreferences to WebCore::Settings/DeprecatedGlobalSettings/RuntimeEnabledFeatures.
2165             Does not generate a binding if the 'webcoreBinding' option is set to either 'none' or 'custom'.
2166         
2167         * Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb:
2168     
2169             Simplify down to just normal/debug/experimental macros.
2170         
2171         * Shared/WebPreferences.yaml:
2172         
2173             Annotate perferences with new optional 'webcoreBinding', 'webcoreName', and 'condition'
2174             options.
2175         
2176         * WebProcess/WebPage/WebPage.cpp:
2177         (WebKit::WebPage::updatePreferences):
2178         
2179             Replace a ton of hand written preference to settings bindings with a call to updatePreferencesGenerated().
2180         
2181         * WebProcess/WebPage/WebPage.h:
2182         
2183             Add declaration of updatePreferencesGenerated, remove platformPreferencesDidChange.
2184
2185         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
2186         (WebKit::WebPage::platformPreferencesDidChange): Deleted.
2187         * WebProcess/WebPage/ios/WebPageIOS.mm:
2188         (WebKit::WebPage::platformPreferencesDidChange): Deleted.
2189         * WebProcess/WebPage/mac/WebPageMac.mm:
2190         (WebKit::WebPage::platformPreferencesDidChange): Deleted.
2191         * WebProcess/WebPage/win/WebPageWin.cpp:
2192         (WebKit::WebPage::platformPreferencesDidChange): Deleted.
2193         * WebProcess/WebPage/wpe/WebPageWPE.cpp:
2194         (WebKit::WebPage::platformPreferencesDidChange): Deleted.
2195         
2196             Remove all the empty platformPreferencesDidChange functions.
2197
2198 2017-10-26  Alex Christensen  <achristensen@webkit.org>
2199
2200         Move WKWebViewConfiguration validation to WKWebView construction
2201         https://bugs.webkit.org/show_bug.cgi?id=178840
2202
2203         Reviewed by Tim Horton.
2204         
2205         I'm trying to remove WKWebViewConfigurationInternal methods so I can make WKWebViewConfiguration
2206         a wrapper around an APIObject like all the other API objects.  A small step towards making this easier
2207         is to remove the unnecessary method _validate and move its logic to its one callsite.  I added an API test
2208         that ensures no change in behavior.
2209
2210         * UIProcess/API/Cocoa/WKWebView.mm:
2211         (-[WKWebView _initializeWithConfiguration:]):
2212         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2213         (-[WKWebViewConfiguration _validate]): Deleted.
2214         * UIProcess/API/Cocoa/WKWebViewConfigurationInternal.h:
2215
2216 2017-10-26  Megan Gardner  <megan_gardner@apple.com>
2217
2218         Remove unneeded block selection calculation code
2219         https://bugs.webkit.org/show_bug.cgi?id=178889
2220
2221         Reviewed by Tim Horton.
2222
2223         Removing more block selection code. Much of this should have been removed
2224         before, as the only things that were using these functions were removed in the
2225         last patch. Also remove the code decided if you should move to block mode or not,
2226         as the answer now is always NO.
2227
2228         * WebProcess/WebPage/WebPage.h:
2229         * WebProcess/WebPage/ios/WebPageIOS.mm:
2230         (WebKit::WebPage::updateSelectionWithTouches):
2231         (WebKit::WebPage::rangeForBlockAtPoint): Deleted.
2232         (WebKit::distanceBetweenRectsForPosition): Deleted.
2233         (WebKit::rectsEssentiallyTheSame): Deleted.
2234         (WebKit::unionDOMRanges): Deleted.
2235         (WebKit::computeEdgeCenter): Deleted.
2236         (WebKit::WebPage::expandedRangeFromHandle): Deleted.
2237         (WebKit::WebPage::contractedRangeFromHandle): Deleted.
2238         (WebKit::WebPage::computeExpandAndShrinkThresholdsForHandle): Deleted.
2239         (WebKit::WebPage::switchToBlockSelectionAtPoint): Deleted.
2240         (WebKit::WebPage::shouldSwitchToBlockModeForHandle): Deleted.
2241
2242 2017-10-26  Jeremy Jones  <jeremyj@apple.com>
2243
2244         Call setFullscreenClient on iOS.
2245         https://bugs.webkit.org/show_bug.cgi?id=178089
2246
2247         Reviewed by Simon Fraser.
2248
2249         This was only being set for MacOS.
2250
2251         * UIProcess/ios/WKContentView.mm:
2252         (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
2253
2254 2017-10-26  Eric Carlson  <eric.carlson@apple.com>
2255
2256         NowPlayingInfo should contain a unique identifier
2257         https://bugs.webkit.org/show_bug.cgi?id=178872
2258
2259         Reviewed by Jer Noble.
2260
2261         * UIProcess/API/Cocoa/WKWebView.mm:
2262         (-[WKWebView _requestActiveNowPlayingSessionInfo:]): Take a completion handler.
2263         (-[WKWebView _requestActiveNowPlayingSessionInfo]): Deleted.
2264         (-[WKWebView _handleActiveNowPlayingSessionInfoResponse:title:duration:elapsedTime:]): Deleted.
2265         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2266         * UIProcess/PageClient.h:
2267
2268         * UIProcess/WebPageProxy.cpp:
2269         (WebKit::WebPageProxy::requestActiveNowPlayingSessionInfo): Ditto.
2270         (WebKit::WebPageProxy::nowPlayingInfoCallback): Lookup and call completion handler.
2271         (WebKit::WebPageProxy::handleActiveNowPlayingSessionInfoResponse const): Deleted.
2272         * UIProcess/WebPageProxy.h:
2273         * UIProcess/WebPageProxy.messages.in:
2274
2275         * UIProcess/ios/PageClientImplIOS.h:
2276         * UIProcess/ios/PageClientImplIOS.mm:
2277         (WebKit::PageClientImpl::handleActiveNowPlayingSessionInfoResponse): Deleted.
2278
2279         * UIProcess/mac/PageClientImplMac.h:
2280         * UIProcess/mac/PageClientImplMac.mm:
2281         (WebKit::PageClientImpl::handleActiveNowPlayingSessionInfoResponse): Deleted.
2282
2283         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
2284         (WebKit::WebPage::requestActiveNowPlayingSessionInfo): Take callback ID. Pass unique ID.
2285         * WebProcess/WebPage/WebPage.h:
2286         * WebProcess/WebPage/WebPage.messages.in:
2287
2288 2017-10-26  Andy Estes  <aestes@apple.com>
2289
2290         [Payment Request] Enable Payment Request whenever Apple Pay is enabled
2291         https://bugs.webkit.org/show_bug.cgi?id=178880
2292
2293         Reviewed by Tim Horton.
2294
2295         * Shared/WebPreferences.yaml:
2296         * UIProcess/API/C/WKPreferences.cpp:
2297         (WKPreferencesSetPaymentRequestEnabled): Deleted.
2298         (WKPreferencesGetPaymentRequestEnabled): Deleted.
2299         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2300         * WebProcess/WebPage/WebPage.cpp:
2301         (WebKit::WebPage::updatePreferences):
2302
2303 2017-10-26  Chris Dumez  <cdumez@apple.com>
2304
2305         Bring back SWContextManager abstraction in WebCore
2306         https://bugs.webkit.org/show_bug.cgi?id=178876
2307
2308         Reviewed by Geoffrey Garen.
2309
2310         Bring back SWContextManager abstraction in WebCore. It was killed in <https://trac.webkit.org/changeset/223718> but
2311         is actually useful when the ServiceWorker wants to message the storage process.
2312
2313         * CMakeLists.txt:
2314         * DerivedSources.make:
2315         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2316         (WebKit::WebSWServerConnection::startServiceWorkerContext):
2317         (WebKit::WebSWServerConnection::startFetch):
2318         (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope):
2319         * WebKit.xcodeproj/project.pbxproj:
2320         * WebProcess/Storage/WebSWContextManagerConnection.cpp: Renamed from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.cpp.
2321         (WebKit::WebSWContextManagerConnection::WebSWContextManagerConnection):
2322         (WebKit::WebSWContextManagerConnection::updatePreferences):
2323         (WebKit::WebSWContextManagerConnection::startServiceWorker):
2324         (WebKit::WebSWContextManagerConnection::startFetch):
2325         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerGlobalScope):
2326         * WebProcess/Storage/WebSWContextManagerConnection.h: Renamed from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.h.
2327         * WebProcess/Storage/WebSWContextManagerConnection.messages.in: Renamed from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.messages.in.
2328         * WebProcess/WebProcess.cpp:
2329         (WebKit::WebProcess::didReceiveMessage):
2330         (WebKit::WebProcess::getWorkerContextConnection):
2331         * WebProcess/WebProcess.h:
2332
2333 2017-10-26  Alexey Proskuryakov  <ap@apple.com>
2334
2335         Remove deprecated WebKit symbols
2336         https://bugs.webkit.org/show_bug.cgi?id=178875
2337         rdar://problem/31139070
2338
2339         Reviewed by Dan Bernstein.
2340
2341         * PlatformMac.cmake:
2342         * Shared/API/c/WKDeprecatedFunctions.cpp:
2343         (WKContextSetProcessModel):
2344         (WKPageGroupCopyIdentifier): Deleted.
2345         (WKPageGroupAddUserContentFilter): Deleted.
2346         (WKPageGroupRemoveUserContentFilter): Deleted.
2347         * UIProcess/API/C/WKPageGroup.h:
2348         * UIProcess/API/Cocoa/_WKVisitedLinkProvider.mm: Removed.
2349         * UIProcess/API/Cocoa/_WKVisitedLinkStore.h:
2350         * WebKit.xcodeproj/project.pbxproj:
2351
2352 2017-10-26  Ryan Haddad  <ryanhaddad@apple.com>
2353
2354         Unreviewed, rolling out r223984.
2355
2356         Caused LayoutTest assertion failures.
2357
2358         Reverted changeset:
2359
2360         "When navigating back to a page, compositing layers may not
2361         use accelerated drawing"
2362         https://bugs.webkit.org/show_bug.cgi?id=178749
2363         https://trac.webkit.org/changeset/223984
2364
2365 2017-10-26  Megan Gardner  <megan_gardner@apple.com>
2366
2367         Remove code to update block selection
2368         https://bugs.webkit.org/show_bug.cgi?id=178843
2369
2370         Reviewed by Tim Horton.
2371
2372         Removes code for updating block selection, which has been disabled.
2373         This code is being slowly pruned to avoid regressions and accidental removal of code that is being used.
2374
2375         * Platform/spi/ios/UIKitSPI.h:
2376         * UIProcess/PageClient.h:
2377         * UIProcess/WebPageProxy.h:
2378         * UIProcess/WebPageProxy.messages.in:
2379         * UIProcess/ios/PageClientImplIOS.h:
2380         * UIProcess/ios/PageClientImplIOS.mm:
2381         (WebKit::PageClientImpl::didUpdateBlockSelectionWithTouch): Deleted.
2382         * UIProcess/ios/WKContentViewInteraction.h:
2383         * UIProcess/ios/WKContentViewInteraction.mm:
2384         (toSelectionHandlePosition): Deleted.
2385         (-[WKContentView _didUpdateBlockSelectionWithTouch:withFlags:growThreshold:shrinkThreshold:]): Deleted.
2386         (-[WKContentView changeBlockSelectionWithTouchAt:withSelectionTouch:forHandle:]): Deleted.
2387         * UIProcess/ios/WebPageProxyIOS.mm:
2388         (WebKit::WebPageProxy::updateBlockSelectionWithTouch): Deleted.
2389         (WebKit::WebPageProxy::didUpdateBlockSelectionWithTouch): Deleted.
2390         * WebProcess/WebPage/WebPage.h:
2391         * WebProcess/WebPage/WebPage.messages.in:
2392         * WebProcess/WebPage/ios/WebPageIOS.mm:
2393         (WebKit::shouldExpand): Deleted.
2394         (WebKit::WebPage::changeBlockSelection): Deleted.
2395         (WebKit::WebPage::updateBlockSelectionWithTouch): Deleted.
2396
2397 2017-10-26  Ryan Haddad  <ryanhaddad@apple.com>
2398
2399         Unreviewed, rolling out r223994.
2400
2401         The LayoutTest for this change is failing.
2402
2403         Reverted changeset:
2404
2405         "Add service worker handle fetch support for all subresource
2406         requests"
2407         https://bugs.webkit.org/show_bug.cgi?id=178769
2408         https://trac.webkit.org/changeset/223994
2409
2410 2017-10-26  Ryan Haddad  <ryanhaddad@apple.com>
2411
2412         Unreviewed, rolling out r223908.
2413
2414         Causes LayoutTest crashes with newer SDKs.
2415
2416         Reverted changeset:
2417
2418         "Adopt new secure coding APIs"
2419         https://bugs.webkit.org/show_bug.cgi?id=178484
2420         https://trac.webkit.org/changeset/223908
2421
2422 2017-10-26  Christopher Reid  <chris.reid@sony.com>
2423
2424         Remove scopeguard from platform
2425         https://bugs.webkit.org/show_bug.cgi?id=178681
2426
2427         Reviewed by Brady Eidson.
2428
2429         * Shared/mac/ChildProcessMac.mm:
2430
2431 2017-10-25  Per Arne Vollan  <pvollan@apple.com>
2432
2433         Network process crash under WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge.
2434         https://bugs.webkit.org/show_bug.cgi?id=160234
2435         rdar://problem/30675510
2436
2437         Reviewed by Geoffrey Garen.
2438
2439         An exception is raised because we call the method rejectProtectionSpaceAndContinueWithChallenge on the CFNetwork
2440         challenge sender, which does not implement this optional method. The methods on the authentication challenge
2441         sender are deprecated when network session is used, so we should not call them in that case.
2442
2443         * Shared/Authentication/AuthenticationManager.cpp:
2444         (WebKit::AuthenticationManager::useCredentialForSingleChallenge):
2445         (WebKit::AuthenticationManager::continueWithoutCredentialForSingleChallenge):
2446         (WebKit::AuthenticationManager::cancelSingleChallenge):
2447         (WebKit::AuthenticationManager::performDefaultHandlingForSingleChallenge):
2448         (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge):
2449         * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
2450         (WebKit::AuthenticationManager::receivedCredential):
2451         (WebKit::AuthenticationManager::receivedRequestToContinueWithoutCredential):
2452         (WebKit::AuthenticationManager::receivedCancellation):
2453         (WebKit::AuthenticationManager::receivedRequestToPerformDefaultHandling):
2454         (WebKit::AuthenticationManager::receivedChallengeRejection):
2455         * Shared/Authentication/soup/AuthenticationManagerSoup.cpp:
2456
2457 2017-10-25  Youenn Fablet  <youenn@apple.com>
2458
2459         Move DNS resolution outside of NetworkRTCProvider
2460         https://bugs.webkit.org/show_bug.cgi?id=178796
2461
2462         Reviewed by Geoffrey Garen.
2463
2464        Tested through manual testing on external STUN servers.
2465        Moving NetworkRTCProvider::Resolver into NetworkRTCResolver.
2466        Updating the implementation to use a completion handler.
2467
2468         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
2469         (WebKit::NetworkRTCProvider::createResolver):
2470         * NetworkProcess/webrtc/NetworkRTCProvider.h:
2471         * NetworkProcess/webrtc/NetworkRTCResolver.cpp:
2472         (WebKit::NetworkRTCResolver::NetworkRTCResolver):
2473         (WebKit::NetworkRTCResolver::~NetworkRTCResolver):
2474         (WebKit::NetworkRTCResolver::start):
2475         (WebKit::NetworkRTCResolver::stop):
2476         (WebKit::NetworkRTCResolver::completed):
2477         (WebKit::NetworkRTCProvider::Resolver::~Resolver): Deleted.
2478         (WebKit::NetworkRTCProvider::stop): Deleted.
2479         (WebKit::NetworkRTCProvider::resolutionCompleted): Deleted.
2480         * NetworkProcess/webrtc/NetworkRTCResolver.h:
2481         * WebKit.xcodeproj/project.pbxproj:
2482
2483 2017-10-25  Eric Carlson  <eric.carlson@apple.com>
2484
2485         [MediaStream] Clear cached gUM prompt state
2486         https://bugs.webkit.org/show_bug.cgi?id=178754
2487         <rdar://problem/32742356>
2488
2489         Reviewed by Youenn Fablet.
2490
2491         * Shared/WebPreferences.yaml: Define new settings.
2492
2493         * Shared/WebPreferencesDefinitionsBase.h: New default values.
2494
2495         * UIProcess/API/C/WKPreferences.cpp:
2496         (WKPreferencesSetInactiveMediaCaptureSteamRepromptIntervalInMinutes): New.
2497         (WKPreferencesGetInactiveMediaCaptureSteamRepromptIntervalInMinutes): Ditto.
2498         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2499
2500         * UIProcess/API/Cocoa/WKPreferences.mm:
2501         (-[WKPreferences _inactiveMediaCaptureSteamRepromptIntervalInMinutes]): Ditto.
2502         (-[WKPreferences _setInactiveMediaCaptureSteamRepromptIntervalInMinutes:]): Ditto.
2503         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2504
2505         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2506         (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy): Initialize
2507         the timer.
2508         (WebKit::UserMediaPermissionRequestManagerProxy::createRequest): Remove unneeded namespace.
2509         (WebKit::toWebCore): Remove unneeded breaks.
2510         (WebKit::UserMediaPermissionRequestManagerProxy::searchForGrantedRequest const): Remove unneeded namespace.
2511         (WebKit::UserMediaPermissionRequestManagerProxy::wasRequestDenied): Ditto.
2512         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Ditto.
2513         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo): Ditto.
2514         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Ditto.
2515         (WebKit::UserMediaPermissionRequestManagerProxy::syncWithWebCorePrefs const): Ditto.
2516         (WebKit::UserMediaPermissionRequestManagerProxy::captureStateChanged): Set the watchdog timer
2517         to the correct interval based on capture state.
2518         (WebKit::UserMediaPermissionRequestManagerProxy::watchdogTimerFired): Clear cached state.
2519         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
2520
2521 2017-10-25  Simon Fraser  <simon.fraser@apple.com>
2522
2523         When navigating back to a page, compositing layers may not use accelerated drawing
2524         https://bugs.webkit.org/show_bug.cgi?id=178749
2525         rdar://problem/35158946
2526
2527         Reviewed by Dean Jackson.
2528
2529         Avoid assertions when a test enables accelerated drawing (which we can't support
2530         in the iOS simulator).
2531
2532         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
2533         (WebKit::RemoteLayerBackingStore::ensureBackingStore):
2534
2535 2017-10-25  Youenn Fablet  <youenn@apple.com>
2536
2537         Enable ServiceWorker to fetch resources
2538         https://bugs.webkit.org/show_bug.cgi?id=178673
2539
2540         Reviewed by Brady Eidson.
2541
2542         ServiceWorkerContextManager makes use of the new ServiceWorkerThreadProxy.
2543         It creates the necessary environment for the thread to make use of network loads, web sockets and cache storage.
2544         Fetch is functional with these changes.
2545
2546         ServiceWorkerProcessProxy is introduced as a UIProcess proxy to the service worker process.
2547         This process proxy is responsible to give the pageID used by all service worker thread instances for network loads.
2548         ServiceWorkerContextManager is responsible to give a unique frameID for all service worker threads.
2549         This is necessary as these two ids are currently needed for any network load.
2550
2551         ServiceWorkerThreadProxy creates its own FrameLoaderClient which is now used to get pageID, frameID and sessionID.
2552
2553         * UIProcess/ServiceWorkerProcessProxy.cpp: Added.
2554         (WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
2555         (WebKit::m_serviceWorkerPageID):
2556         (WebKit::ServiceWorkerProcessProxy::~ServiceWorkerProcessProxy):
2557         (WebKit::ServiceWorkerProcessProxy::start):
2558         * UIProcess/ServiceWorkerProcessProxy.h: Added.
2559         * UIProcess/WebProcessPool.cpp:
2560         (WebKit::WebProcessPool::getWorkerContextProcessConnection):
2561         (WebKit::WebProcessPool::createNewWebProcess):
2562         (WebKit::WebProcessPool::initializeNewWebProcess):
2563         (WebKit::WebProcessPool::disconnectProcess):
2564         (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
2565         (WebKit::WebProcessPool::createWebPage):
2566         * UIProcess/WebProcessPool.h:
2567         * UIProcess/WebProcessProxy.cpp:
2568         (WebKit::WebProcessProxy::generatePageID):
2569         * UIProcess/WebProcessProxy.h:
2570         * WebKit.xcodeproj/project.pbxproj:
2571         * WebProcess/Network/WebLoaderStrategy.cpp:
2572         (WebKit::WebLoaderStrategy::scheduleLoad):
2573         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
2574         (WebKit::WebLoaderStrategy::startPingLoad):
2575         * WebProcess/Network/WebLoaderStrategy.h:
2576         * WebProcess/Storage/ServiceWorkerContextManager.cpp:
2577         (WebKit::ServiceWorkerContextManager::ServiceWorkerContextManager):
2578         (WebKit::ServiceWorkerContextManager::startServiceWorker):
2579         (WebKit::ServiceWorkerContextManager::startFetch):
2580         * WebProcess/Storage/ServiceWorkerContextManager.h:
2581         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2582         (WebKit::WebFrameLoaderClient::pageID const):
2583         (WebKit::WebFrameLoaderClient::frameID const):
2584         (WebKit::WebFrameLoaderClient::sessionID const):
2585         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2586         * WebProcess/WebProcess.cpp:
2587         (WebKit::WebProcess::getWorkerContextConnection):
2588         * WebProcess/WebProcess.h:
2589         * WebProcess/WebProcess.messages.in:
2590
2591 2017-10-25  Yousuke Kimoto  <yousuke.kimoto@sony.com>
2592
2593         [WinCairo] Add WebKit platform files for wincairo webkit
2594         https://bugs.webkit.org/show_bug.cgi?id=178000
2595
2596         Reviewed by Alex Christensen.
2597
2598         * Platform/Module.h:
2599         * Platform/SharedMemory.h:
2600         (WebKit::SharedMemory::handle const):
2601         * Platform/win/LoggingWin.cpp: Added. It is based on Source/WebCore/platform/win/LoggingWin.cpp
2602         (WebKit::logLevelString):
2603         * Platform/win/ModuleWin.cpp: Added.
2604         (WebKit::Module::load):
2605         (WebKit::Module::unload):
2606         (WebKit::Module::platformFunctionPointer const):
2607         * Platform/win/SharedMemoryWin.cpp: Added.
2608         (WebKit::SharedMemory::Handle::Handle):
2609         (WebKit::SharedMemory::Handle::~Handle):
2610         (WebKit::SharedMemory::Handle::isNull const):
2611         (WebKit::SharedMemory::Handle::encode const):
2612         (WebKit::SharedMemory::Handle::clear):
2613         (WebKit::getDuplicatedHandle):
2614         (WebKit::SharedMemory::Handle::decode):
2615         (WebKit::protectAttribute):
2616         (WebKit::SharedMemory::allocate):
2617         (WebKit::SharedMemory::create):
2618         (WebKit::accessRights):
2619         (WebKit::SharedMemory::map):
2620         (WebKit::SharedMemory::adopt):
2621         (WebKit::SharedMemory::~SharedMemory):
2622         (WebKit::SharedMemory::createHandle):
2623         (WebKit::SharedMemory::systemPageSize):
2624         * PlatformWin.cmake:
2625
2626 2017-10-25  Chris Dumez  <cdumez@apple.com>
2627
2628         Add support for unregistering a service worker
2629         https://bugs.webkit.org/show_bug.cgi?id=178735
2630
2631         Reviewed by Brady Eidson.
2632
2633         Add support for unregistering a service worker:
2634         - https://w3c.github.io/ServiceWorker/#navigator-service-worker-unregister
2635
2636         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2637         (WebKit::WebSWServerConnection::resolveRegistrationJobInClient):
2638         (WebKit::WebSWServerConnection::resolveUnregistrationJobInClient):
2639         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2640         * WebProcess/Storage/WebSWClientConnection.messages.in:
2641
2642 2017-10-25  Chris Dumez  <cdumez@apple.com>
2643
2644         Make SharedStringHashTable less error prone
2645         https://bugs.webkit.org/show_bug.cgi?id=178764
2646
2647         Reviewed by Youenn Fablet.
2648
2649         SharedStringHashTable is backed by SharedMemory and this SharedMemory
2650         may be readonly (and is when used in the WebContent process). As a result,
2651         some of the operations on SharedStringHashTable that write to this shared
2652         memory will crash if called and the SharedMemory is readonly.
2653
2654         To make this less error prone, introduce a new SharedStringHashTableReadOnly
2655         base class for SharedStringHashTable and only keep the operations that
2656         write to the shared memory on SharedStringHashTableReadOnly (namely, add() /
2657         remove() / clear(). Update VisitedLinkTableController and WebSWOriginTable
2658         to use SharedStringHashTableReadOnly since they are instantiated in the
2659         WebContent process and use readonly shared memory.
2660
2661         * Shared/SharedStringHashTable.cpp:
2662         (WebKit::SharedStringHashTableReadOnly::SharedStringHashTableReadOnly):
2663         (WebKit::SharedStringHashTableReadOnly::~SharedStringHashTableReadOnly):
2664         (WebKit::SharedStringHashTableReadOnly::setSharedMemory):
2665         (WebKit::doubleHash):
2666         (WebKit::SharedStringHashTableReadOnly::contains const):
2667         (WebKit::SharedStringHashTableReadOnly::findSlot const):
2668         (WebKit::SharedStringHashTable::SharedStringHashTable):
2669         (WebKit::SharedStringHashTable::~SharedStringHashTable):
2670         (WebKit::SharedStringHashTable::add):
2671         (WebKit::SharedStringHashTable::remove):
2672         (WebKit::SharedStringHashTable::clear):
2673         * Shared/SharedStringHashTable.h:
2674         * WebProcess/Storage/WebSWOriginTable.h:
2675         * WebProcess/WebPage/VisitedLinkTableController.cpp:
2676         (WebKit::VisitedLinkTableController::removeAllVisitedLinks):
2677         * WebProcess/WebPage/VisitedLinkTableController.h:
2678
2679 2017-10-25  Adrian Perez de Castro  <aperez@igalia.com>
2680
2681         [WPE] Remove GLib API functions which use Cairo
2682         https://bugs.webkit.org/show_bug.cgi?id=178205
2683
2684         Reviewed by Michael Catanzaro.
2685
2686         Add PLATFORM(GTK) guards for the parts of of the GLib API which use cairo_surface_t (web
2687         page snapshots and favicons), and remove the affected function prototypes from public API
2688         headers. This way, the WPE version of the API is not tied to Cairo.
2689
2690         * PlatformWPE.cmake:
2691         * UIProcess/API/glib/WebKitFaviconDatabase.cpp:
2692         * UIProcess/API/glib/WebKitFaviconDatabasePrivate.h:
2693         * UIProcess/API/glib/WebKitInjectedBundleClient.cpp:
2694         * UIProcess/API/glib/WebKitWebView.cpp:
2695         (webkitWebViewConstructed):
2696         (webkitWebViewGetProperty):
2697         (webkitWebViewDispose):
2698         (webkit_web_view_class_init):
2699         (webkitWebViewLoadChanged):
2700         * UIProcess/API/glib/WebKitWebViewPrivate.h:
2701         * UIProcess/API/wpe/WebKitFaviconDatabase.h:
2702         * UIProcess/API/wpe/WebKitWebView.h:
2703         * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
2704         (webkitWebPageDidReceiveMessage):
2705
2706 2017-10-25  Zan Dobersek  <zdobersek@igalia.com>
2707
2708         Make SERVICE_WORKER feature buildable on GTK, WPE
2709         https://bugs.webkit.org/show_bug.cgi?id=178574
2710
2711         Reviewed by Carlos Garcia Campos.
2712
2713         * CMakeLists.txt: Add missing files to the build.
2714         * StorageProcess/StorageProcess.cpp:
2715         (WebKit::StorageProcess::didGetWorkerContextProcessConnection):
2716         IPC::Attachment object should be accessed through an rvalue reference,
2717         making it mutable and enabling releasing the file descriptor.
2718         * StorageProcess/StorageProcess.h: Adjust the method signature.
2719         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
2720         Explicitly include the ResourceError header from WebCore (using a forwarding header).
2721         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
2722         Include the CachedResource header from WebCore (again using a forwarding header).
2723         * WebProcess/Storage/WebServiceWorkerProvider.h: Forward-declare the WebCore::CachedResource type.
2724
2725 2017-10-24  Youenn Fablet  <youenn@apple.com>
2726
2727         ServiceWorkerClientFetch should return an error that is not null in case of failure
2728         https://bugs.webkit.org/show_bug.cgi?id=178761
2729
2730         Reviewed by Geoffrey Garen.
2731
2732         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
2733         (WebKit::ServiceWorkerClientFetch::didFail): Generating a General error.
2734
2735 2017-10-24  Youenn Fablet  <youenn@apple.com>
2736
2737         Enable service worker to use cache storage api
2738         https://bugs.webkit.org/show_bug.cgi?id=178684
2739
2740         Reviewed by Brady Eidson.
2741
2742         Passing the WebPreferences store of the default page group of the WebProcessPool to its ServiceWorker process.
2743         ServiceWorkerContextManager then uses it to initialize the preferences accordingly.
2744         Patch is covered by new test which is using cache api previously disabled and now enabled through the store.
2745
2746         Made use of the new ServiceWorkerThreadProxy in ServiceWorkerContextManager to enable a cache storage connection.
2747         Fixed the default size of quota in WebsiteDataStore.
2748
2749         * UIProcess/WebProcessPool.cpp:
2750         (WebKit::WebProcessPool::getWorkerContextProcessConnection):
2751         * UIProcess/WebsiteData/WebsiteDataStore.h:
2752         * WebProcess/Storage/ServiceWorkerContextManager.cpp:
2753         (WebKit::ServiceWorkerContextManager::ServiceWorkerContextManager):
2754         (WebKit::ServiceWorkerContextManager::updatePreferences):
2755         (WebKit::ServiceWorkerContextManager::startServiceWorker):
2756         (WebKit::ServiceWorkerContextManager::startFetch):
2757         * WebProcess/Storage/ServiceWorkerContextManager.h:
2758         (WebKit::ServiceWorkerContextManager::ServiceWorkerContextManager): Deleted.
2759         * WebProcess/WebProcess.cpp:
2760         (WebKit::WebProcess::getWorkerContextConnection):
2761         * WebProcess/WebProcess.h:
2762         * WebProcess/WebProcess.messages.in:
2763
2764 2017-10-24  Alex Christensen  <achristensen@webkit.org>
2765
2766         Selecting and right-clicking URL-like strings with IDNA-disallowed characters in host or authority causes rendering engine crash
2767         https://bugs.webkit.org/show_bug.cgi?id=174267
2768
2769         Reviewed by Tim Horton.
2770
2771         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2772         (WKBundlePageCanHandleRequest):
2773
2774 2017-10-24  Chris Dumez  <cdumez@apple.com>
2775
2776         Add initial implementation for serviceWorker.postMessage()
2777         https://bugs.webkit.org/show_bug.cgi?id=178534
2778
2779         Reviewed by Youenn Fablet.
2780
2781         Add initial implementation for serviceWorker.postMessage():
2782         - https://w3c.github.io/ServiceWorker/#service-worker-postmessage
2783
2784         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2785         (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope):
2786         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2787         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
2788         * WebProcess/Storage/ServiceWorkerContextManager.cpp:
2789         (WebKit::ServiceWorkerContextManager::postMessageToServiceWorkerGlobalScope):
2790         * WebProcess/Storage/ServiceWorkerContextManager.h:
2791         * WebProcess/Storage/ServiceWorkerContextManager.messages.in:
2792         * WebProcess/Storage/WebSWClientConnection.cpp:
2793         (WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope):
2794         * WebProcess/Storage/WebSWClientConnection.h:
2795
2796 2017-10-24  Brent Fulgham  <bfulgham@apple.com>
2797
2798         Adopt new secure coding APIs
2799         https://bugs.webkit.org/show_bug.cgi?id=178484
2800         <rdar://problem/34837193>
2801
2802         Reviewed by Tim Horton.
2803
2804         Switch to new NSKeyed[Un]Archiver methods that active and use
2805         NSSecureCoding by default.
2806
2807         * Platform/ios/AccessibilityIOS.mm:
2808         (WebKit::newAccessibilityRemoteToken): Use secure-by-default API.
2809         * Shared/Cocoa/DataDetectionResult.mm:
2810         (WebKit::DataDetectionResult::encode const): Ditto.
2811         (WebKit::DataDetectionResult::decode): Ditto.
2812         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
2813         (IPC::ArgumentCoder<WebCore::Payment>::encode): Ditto.
2814         (IPC::ArgumentCoder<WebCore::Payment>::decode): Ditto.
2815         (IPC::ArgumentCoder<WebCore::PaymentContact>::encode): Ditto.
2816         (IPC::ArgumentCoder<WebCore::PaymentContact>::decode): Ditto.
2817         (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::encode): Ditto.
2818         (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::decode): Ditto.
2819         (IPC::ArgumentCoder<WebCore::PaymentMethod>::encode): Ditto.
2820         (IPC::ArgumentCoder<WebCore::PaymentMethod>::decode): Ditto.
2821         * Shared/ios/InteractionInformationAtPosition.mm:
2822         (WebKit::InteractionInformationAtPosition::encode const): Ditto.
2823         (WebKit::InteractionInformationAtPosition::decode): Ditto.
2824         * Shared/mac/WebCoreArgumentCodersMac.mm:
2825         (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData): Ditto.
2826         (IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData): Ditto.
2827         (IPC::ArgumentCoder<Credential>::encodePlatformData): Ditto.
2828         (IPC::ArgumentCoder<Credential>::decodePlatformData): Ditto.
2829         (IPC::ArgumentCoder<ContentFilterUnblockHandler>::encode): Ditto.
2830         (IPC::ArgumentCoder<ContentFilterUnblockHandler>::decode): Ditto.
2831         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::encodePlatformData): Ditto.
2832         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::decodePlatformData): Ditto.
2833         * Shared/mac/WebHitTestResultData.mm:
2834         (WebKit::WebHitTestResultData::platformEncode const): Ditto.
2835         (WebKit::WebHitTestResultData::platformDecode): Ditto.
2836         * UIProcess/API/Cocoa/WKProcessPool.mm:
2837         (-[WKProcessPool _setObject:forBundleParameter:]): Ditto.
2838         (-[WKProcessPool _setObjectsForBundleParametersWithDictionary:]): Ditto.
2839         * UIProcess/API/Cocoa/WKWebView.mm:
2840         (-[WKWebView _setInputDelegate:]): Ditto.
2841         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2842         (WebKit::WebProcessPool::platformInitializeWebProcess): Ditto.
2843         * UIProcess/ios/PageClientImplIOS.mm:
2844         (WebKit::PageClientImpl::startAssistingNode): Ditto.
2845         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2846         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Ditto.
2847         * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
2848         (WebKit::InjectedBundle::initialize): Ditto.
2849         (WebKit::InjectedBundle::setBundleParameter): Ditto.
2850         (WebKit::InjectedBundle::setBundleParameters): Ditto.
2851
2852 2017-10-24  Sam Weinig  <sam@webkit.org>
2853
2854         [Settings] Add initial support for generating preferences related code
2855         https://bugs.webkit.org/show_bug.cgi?id=178656
2856
2857         Reviewed by Dean Jackson.
2858
2859         As a first step towards getting off the macros in WebPreferencesDefinitions.h
2860         and reducing the overhead of adding a preference, this change generates adds
2861         WebPreferences.yaml where preference changes will go, and generates much of
2862         WebPreferencesDefinitions.h from it (all the custom defaults moved to 
2863         WebPreferencesDefinitionsBase.h). Subsequent changes will remove the need for 
2864         the macros in WebPreferencesDefinitions.h entirely.
2865
2866         * CMakeLists.txt:
2867         * DerivedSources.make:
2868         * WebKit.xcodeproj/project.pbxproj:
2869         
2870             Add new files / rules to generate WebPreferencesDefinitions.h.
2871         
2872         * Scripts/GeneratePreferences.rb: Added.
2873         * Scripts/PreferencesTemplates: Added.
2874         * Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb: Added.
2875         
2876             Add scripts and template to generate WebPreferencesDefinitions.h from
2877             WebPreferences.yaml.
2878
2879         * Shared/WebPreferences.yaml: Added.
2880         
2881             Configuration file for preferences.
2882         
2883         * Shared/WebPreferencesDefinitions.h: Removed.
2884         * Shared/WebPreferencesDefinitionsBase.h: Copied from Source/WebKit/Shared/WebPreferencesDefinitions.h.
2885         
2886             Moved custom defaults to new WebPreferencesDefinitionsBase.h. Removed the need for 
2887             FOR_EACH_WEBKIT_STRING_PREFERENCE by using custom defaults for the font family values.
2888
2889 2017-10-24  Matt Lewis  <jlewis3@apple.com>
2890
2891         Unreviewed, rolling out r223889.
2892
2893         This caused multiple crashes on all platforms
2894
2895         Reverted changeset:
2896
2897         "Adopt new secure coding APIs"
2898         https://bugs.webkit.org/show_bug.cgi?id=178484
2899         https://trac.webkit.org/changeset/223889
2900
2901 2017-10-24  Youenn Fablet  <youenn@apple.com>
2902
2903         ASSERTION FAILED: !m_serviceWorkerManager in WebProcess::getWorkerContextConnection() on API tests
2904         https://bugs.webkit.org/show_bug.cgi?id=178586
2905         <rdar://problem/35115902>
2906
2907         Reviewed by Brady Eidson.
2908
2909        Covered by API tests no longer crashing.
2910
2911         * UIProcess/WebProcessPool.cpp:
2912         (WebKit::WebProcessPool::getWorkerContextProcessConnection): Sending a worker context process connection message only at creation of the service worker process.
2913
2914 2017-10-24  Brent Fulgham  <bfulgham@apple.com>
2915
2916         Adopt new secure coding APIs
2917         https://bugs.webkit.org/show_bug.cgi?id=178484
2918         <rdar://problem/34837193>
2919
2920         Reviewed by Tim Horton.
2921
2922         Switch to new NSKeyed[Un]Archiver methods that active and use
2923         NSSecureCoding by default.
2924
2925         * Platform/ios/AccessibilityIOS.mm:
2926         (WebKit::newAccessibilityRemoteToken): Use secure-by-default API.
2927         * Shared/Cocoa/DataDetectionResult.mm:
2928         (WebKit::DataDetectionResult::encode const): Ditto.
2929         (WebKit::DataDetectionResult::decode): Ditto.
2930         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
2931         (IPC::ArgumentCoder<WebCore::Payment>::encode): Ditto.
2932         (IPC::ArgumentCoder<WebCore::Payment>::decode): Ditto.
2933         (IPC::ArgumentCoder<WebCore::PaymentContact>::encode): Ditto.
2934         (IPC::ArgumentCoder<WebCore::PaymentContact>::decode): Ditto.
2935         (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::encode): Ditto.
2936         (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::decode): Ditto.
2937         (IPC::ArgumentCoder<WebCore::PaymentMethod>::encode): Ditto.
2938         (IPC::ArgumentCoder<WebCore::PaymentMethod>::decode): Ditto.
2939         * Shared/ios/InteractionInformationAtPosition.mm:
2940         (WebKit::InteractionInformationAtPosition::encode const): Ditto.
2941         (WebKit::InteractionInformationAtPosition::decode): Ditto.
2942         * Shared/mac/WebCoreArgumentCodersMac.mm:
2943         (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData): Ditto.
2944         (IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData): Ditto.
2945         (IPC::ArgumentCoder<Credential>::encodePlatformData): Ditto.
2946         (IPC::ArgumentCoder<Credential>::decodePlatformData): Ditto.
2947         (IPC::ArgumentCoder<ContentFilterUnblockHandler>::encode): Ditto.
2948         (IPC::ArgumentCoder<ContentFilterUnblockHandler>::decode): Ditto.
2949         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::encodePlatformData): Ditto.
2950         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::decodePlatformData): Ditto.
2951         * Shared/mac/WebHitTestResultData.mm:
2952         (WebKit::WebHitTestResultData::platformEncode const): Ditto.
2953         (WebKit::WebHitTestResultData::platformDecode): Ditto.
2954         * UIProcess/API/Cocoa/WKProcessPool.mm:
2955         (-[WKProcessPool _setObject:forBundleParameter:]): Ditto.
2956         (-[WKProcessPool _setObjectsForBundleParametersWithDictionary:]): Ditto.
2957         * UIProcess/API/Cocoa/WKWebView.mm:
2958         (-[WKWebView _setInputDelegate:]): Ditto.
2959         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2960         (WebKit::WebProcessPool::platformInitializeWebProcess): Ditto.
2961         * UIProcess/ios/PageClientImplIOS.mm:
2962         (WebKit::PageClientImpl::startAssistingNode): Ditto.
2963         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2964         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Ditto.
2965         * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
2966         (WebKit::InjectedBundle::initialize): Ditto.
2967         (WebKit::InjectedBundle::setBundleParameter): Ditto.
2968         (WebKit::InjectedBundle::setBundleParameters): Ditto.
2969
2970 2017-10-24  Zan Dobersek  <zdobersek@igalia.com>
2971
2972         [GTK][WPE] generate-forwarding-headers.pl should also scan derived sources in WebKit framework
2973         https://bugs.webkit.org/show_bug.cgi?id=178579
2974
2975         Reviewed by Carlos Garcia Campos.
2976
2977         * PlatformGTK.cmake: When generating forwarding headers, derived sources
2978         should be scanned as well. The DERIVED_SOURCES_WEBKIT_DIR value has to
2979         be passed as an include path to the generate-forward-headers.pl script
2980         to achieve that. This target then also has to depend on all the derived
2981         source files to be generated before this can be performed.
2982         * PlatformWPE.cmake: Ditto.
2983
2984 2017-10-23  Brian Burg  <bburg@apple.com>
2985
2986         [Cocoa] Web Automation: add SPI to tell whether the automation session is currently simulating user interactions
2987         https://bugs.webkit.org/show_bug.cgi?id=178616
2988
2989         Reviewed by Joseph Pecoraro.
2990
2991         This is needed to disambiguate whether an action (such as selectAll:) came from
2992         a user clicking on "Edit > Select All" in a menu or whether it was produced by
2993         simulating the keystrokes to produce the chord for "Command + a". Some clients,
2994         such as Safari, would allow the latter but not the former during automation.
2995
2996         * UIProcess/API/Cocoa/_WKAutomationSession.h:
2997         * UIProcess/API/Cocoa/_WKAutomationSession.mm:
2998         (-[_WKAutomationSession isSimulatingUserInteraction]):
2999         Add new SPI property that's backed by the same WebAutomationSession method.
3000
3001         * UIProcess/Automation/WebAutomationSession.h:
3002         * UIProcess/Automation/WebAutomationSession.cpp:
3003         (WebKit::WebAutomationSession::keyboardEventsFlushedForPage):
3004         (WebKit::WebAutomationSession::performMouseInteraction):
3005         (WebKit::WebAutomationSession::performKeyboardInteractions):
3006         Set m_simulatingUserInteraction prior to sending the synthesized events. It will
3007         be cleared when keyboardEventsFlushedForPage() is called by WebPageProxy.
3008
3009         * UIProcess/WebPageProxy.cpp:
3010         (WebKit::WebPageProxy::didReceiveEvent):
3011         Notify the automation session that the key event queue was flushed *after* giving
3012         delegates a chance to do something with the key event. This is necessary so that
3013         any actions that are created from the NSEvent by the delegates are handled prior
3014         to the automation session finishing its keyboard interaction command.
3015
3016 2017-10-23  Brian Burg  <bburg@apple.com>
3017
3018         [Mac] Web Automation: key modifiers for synthesized NSEvents are incorrect
3019         https://bugs.webkit.org/show_bug.cgi?id=178615
3020
3021         Reviewed by Joseph Pecoraro.
3022
3023         In both PLATFORM(MAC) platform methods for simulating keyboard interactions,
3024         we errantly relied on +[NSEvent modifierFlags] to get the current state of
3025         sticky modifiers when creating synthesized events. This is incorrect for two reasons:
3026         modifierFlags is never updated when simulating a sequence of events (because
3027         all the events are synthesized before any are delivered); and the NSEvent class
3028         method only reflects the modifier state of the primary physical keyboard, which
3029         is not affected by synthesized NSEvents that happen to have modifier flags.
3030
3031         Instead, just keep our own m_currentModifiers state in the session and compute
3032         the necessary NSEventModifierFlags to put on each synthesized event. This aligns
3033         the implementation with the treatment of sticky keys in the iOS and GTK platform methods.
3034
3035         * UIProcess/Automation/WebAutomationSession.h: Every port gets this variable now.
3036         * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
3037         (WebKit::WebAutomationSession::platformSimulateKeyStroke):
3038         (WebKit::WebAutomationSession::platformSimulateKeySequence):
3039         Use and update m_currentModifiers.
3040
3041 2017-10-23  Alex Christensen  <achristensen@webkit.org>
3042
3043         Fix ASAN test after r222824
3044         https://bugs.webkit.org/show_bug.cgi?id=178688
3045         <rdar://problem/35104706>
3046
3047         Reviewed by Tim Horton.
3048
3049         * UIProcess/WebBackForwardList.cpp:
3050         (WebKit::WebBackForwardList::clear):
3051         Resizing a list of Ref<T> after we've WTFMoved all the elements doesn't make ASAN happy.
3052
3053 2017-10-23  Tim Horton  <timothy_horton@apple.com>
3054
3055         Stop using _UIApplicationUsesLegacyUI()
3056         https://bugs.webkit.org/show_bug.cgi?id=178680
3057         <rdar://problem/35131949>
3058
3059         Reviewed by Dan Bernstein.
3060
3061         * Platform/spi/ios/UIKitSPI.h:
3062         * UIProcess/ios/forms/WKFormSelectPopover.mm:
3063         (-[WKSelectTableViewController tableView:cellForRowAtIndexPath:]):
3064         (-[WKSelectPopover initWithView:hasGroups:]):
3065         Resolve _UIApplicationUsesLegacyUI to false and simplify.
3066
3067 2017-10-23  Ryan Haddad  <ryanhaddad@apple.com>
3068
3069         Unreviewed, suppress deprecation warnings to fix the build.
3070         <rdar://problem/35131949>
3071
3072         * UIProcess/ios/forms/WKFormSelectPopover.mm:
3073         (-[WKSelectTableViewController tableView:cellForRowAtIndexPath:]):
3074         (-[WKSelectPopover initWithView:hasGroups:]):
3075
3076 2017-10-23  Youenn Fablet  <youenn@apple.com>
3077
3078         TestController should clear all fetch caches when resetting its state
3079         https://bugs.webkit.org/show_bug.cgi?id=178486
3080         <rdar://problem/35066305>
3081
3082         Reviewed by Chris Dumez.
3083
3084         Adding a new DidNotHandle message to disambiguate with the DidFail fetch case.
3085         With DidNotHandle, the loading should go the network process.
3086         With DidFail, the loading should return a network error.
3087
3088         On receiving an order to start a fetch, ServiceWorkerThread will dispatch a fetch event.
3089         The client of this event will retrieve the response and return it to the WebProcess through IPC.
3090
3091         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3092         (WebKit::WebSWServerConnection::didNotHandleFetch):
3093         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
3094         * StorageProcess/StorageProcess.cpp:
3095         (WebKit::StorageProcess::didNotHandleFetch):
3096         * StorageProcess/StorageProcess.h:
3097         * StorageProcess/StorageProcess.messages.in:
3098         * WebKit.xcodeproj/project.pbxproj:
3099         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
3100         (WebKit::ServiceWorkerClientFetch::didFail):
3101         (WebKit::ServiceWorkerClientFetch::didNotHandle):
3102         * WebProcess/Storage/ServiceWorkerClientFetch.h:
3103         * WebProcess/Storage/ServiceWorkerClientFetch.messages.in:
3104         * WebProcess/Storage/ServiceWorkerContextManager.cpp:
3105         (WebKit::ServiceWorkerContextManager::startFetch):
3106         * WebProcess/Storage/ServiceWorkerContextManager.h:
3107         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp: Added.
3108         (WebKit::WebServiceWorkerFetchTaskClient::~WebServiceWorkerFetchTaskClient):
3109         (WebKit::WebServiceWorkerFetchTaskClient::WebServiceWorkerFetchTaskClient):
3110         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveResponse):
3111         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveData):
3112         (WebKit::WebServiceWorkerFetchTaskClient::didFail):
3113         (WebKit::WebServiceWorkerFetchTaskClient::didFinish):
3114         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h: Added.
3115         * WebProcess/WebProcess.cpp:
3116         (WebKit::WebProcess::startFetchInServiceWorker):
3117         * WebProcess/WebProcess.h:
3118
3119 2017-10-22  Wenson Hsieh  <wenson_hsieh@apple.com>
3120
3121         [iOS] WebProcess::initializeWebProcess spends ~150ms spinning up AVSystemController on some devices
3122         https://bugs.webkit.org/show_bug.cgi?id=178640
3123         <rdar://problem/35113105>
3124
3125         Reviewed by Youenn Fablet.
3126
3127         In r213933, we added a mechanism to allow the web process to drive media capture, by setting an attribute on the
3128         shared AVSystemController. This requires us to fault in the Celestial framework, which is a slight performance
3129         hit on some hardware. Instead of doing this at the start of every web process launch, we can just do this work
3130         lazily, the first time the web process requests permissions for user media access.
3131
3132         * WebProcess/WebCoreSupport/WebUserMediaClient.cpp:
3133         (WebKit::WebUserMediaClient::requestUserMediaAccess):
3134         * WebProcess/WebPage/WebPage.cpp:
3135         (WebKit::WebPage::prepareToSendUserMediaPermissionRequest):
3136         * WebProcess/WebPage/WebPage.h:
3137         * WebProcess/WebPage/ios/WebPageIOS.mm:
3138         (WebKit::WebPage::prepareToSendUserMediaPermissionRequest):
3139         * WebProcess/cocoa/WebProcessCocoa.mm:
3140         (WebKit::WebProcess::platformInitializeWebProcess):
3141
3142 2017-10-21  Michael Catanzaro  <mcatanzaro@igalia.com>
3143
3144         Unreviewed, silence a -Wunused-but-set-variable warning
3145
3146         * WebProcess/WebPage/EventDispatcher.cpp:
3147         (WebKit::EventDispatcher::wheelEvent):
3148
3149 2017-10-20  Alex Christensen  <achristensen@webkit.org>
3150
3151         Add FIXME comment after r223803
3152         https://bugs.webkit.org/show_bug.cgi?id=178418
3153
3154         * UIProcess/WebProcessPool.cpp:
3155         (WebKit::WebProcessPool::ensureNetworkProcess):
3156         We need some work to better support customized persistent data stores.  Add a comment indicating such.
3157
3158 2017-10-20  Alex Christensen  <achristensen@webkit.org>
3159
3160         Fix API tests after r223791.
3161         https://bugs.webkit.org/show_bug.cgi?id=178418
3162
3163         * UIProcess/WebProcessPool.cpp:
3164         (WebKit::WebProcessPool::ensureNetworkProcess):
3165         Whatever NetworkSessionInitializationParameters we send with the NetworkProcess initialization message,
3166         that's the default session.  This is needed for WebKit.WebsiteDataStoreCustomPaths.
3167         (WebKit::WebProcessPool::createNewWebProcess):
3168         Don't change behavior or NetworkProcess initialization like I did in r223791.
3169
3170 2017-10-20  Alex Christensen  <achristensen@webkit.org>
3171
3172         Fix download tests on El Capitan after r223730
3173         https://bugs.webkit.org/show_bug.cgi?id=178547
3174
3175         * UIProcess/Downloads/DownloadProxy.cpp:
3176         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilename):
3177         Revert to original behavior.  This uses suggestedFilename, which may have come from places like
3178         the download attribute, instead of always using the filename from CFNetwork.
3179
3180 2017-10-20  Alex Christensen  <achristensen@webkit.org>
3181
3182         Expose _boundInterfaceIdentifier and _allowsCellularAccess to WKWebsiteDataStorePrivate
3183         https://bugs.webkit.org/show_bug.cgi?id=178418
3184         <rdar://problem/29599569>
3185
3186         Reviewed by Tim Horton.
3187         
3188         In r213747 I introduced allowsCellularAccess to _WKProcessPoolConfiguration because there
3189         was no way to add parameters to the default (and other) NetworkSession constructors.  Since
3190         clients have not adopted this SPI, we can introduce such a way in NetworkSessionCreationParameters
3191         and move the SPI to WKWebsiteDataStore, which is where it and other NetworkSession properties
3192         ought to be instead of making them WKProcessPool global.
3193
3194         We also need to expose access to NSURLRequest.boundInterfaceIdentifier.  Instead of serializing and
3195         deserializing that property for each NSURLRequest and then having subresources mysteriously jump back
3196         to having no bound interface identifiers, I'm adding this to WKWebsiteDataStore, too, to make it a
3197         session networking property.
3198         
3199         I manually verified that these properties are being set properly with a custom test app and added logs.
3200         Unfortunately, these properties don't do anything under circumstances anywhere close to what we test.
3201         The architecture change of having NetworkSessionCreationParameters is verified to not have a change in
3202         behavior by existing tests, such as any test that uses TestProtocol (which we should eventually remove).
3203
3204         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3205         (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession):
3206         * NetworkProcess/NetworkProcess.cpp:
3207         (WebKit::NetworkProcess::NetworkProcess):
3208         (WebKit::NetworkProcess::initializeNetworkProcess):
3209         (WebKit::NetworkProcess::clearCachedCredentials):
3210         * NetworkProcess/NetworkProcessCreationParameters.cpp:
3211         (WebKit::NetworkProcessCreationParameters::encode const):
3212         (WebKit::NetworkProcessCreationParameters::decode):
3213         * NetworkProcess/NetworkProcessCreationParameters.h:
3214         * NetworkProcess/NetworkSession.cpp:
3215         (WebKit::NetworkSession::create):
3216         (WebKit::NetworkSession::defaultSession): Deleted.
3217         * NetworkProcess/NetworkSession.h:
3218         * NetworkProcess/NetworkSessionCreationParameters.h: Added.
3219         (WebKit::NetworkSessionCreationParameters::encode const):
3220         (WebKit::NetworkSessionCreationParameters::decode):
3221         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
3222         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
3223         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3224         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
3225         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3226         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
3227         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
3228         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3229         (WebKit::NetworkSessionCocoa::setSourceApplicationSecondaryIdentifier):
3230         (WebKit::NetworkSessionCocoa::create):
3231         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
3232         (WebKit::NetworkSessionCocoa::setLegacyCustomProtocolManager): Deleted.
3233         (WebKit::NetworkSessionCocoa::setAllowsCellularAccess): Deleted.
3234         (WebKit::NetworkSessionCocoa::defaultSession): Deleted.
3235         * NetworkProcess/mac/RemoteNetworkingContext.mm:
3236         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
3237         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
3238         * Shared/SessionTracker.cpp:
3239         (WebKit::SessionTracker::networkSession):
3240         (WebKit::SessionTracker::setSession):
3241         * Shared/WebsiteDataStoreParameters.cpp:
3242         (WebKit::WebsiteDataStoreParameters::encode const):
3243         (WebKit::WebsiteDataStoreParameters::decode):
3244         * Shared/WebsiteDataStoreParameters.h:
3245         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3246         (API::ProcessPoolConfiguration::copy):
3247         * UIProcess/API/APIProcessPoolConfiguration.h:
3248         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3249         (-[WKWebsiteDataStore _setBoundInterfaceIdentifier:]):
3250         (-[WKWebsiteDataStore _boundInterfaceIdentifier]):
3251         (-[WKWebsiteDataStore _setAllowsCellularAccess:]):
3252         (-[WKWebsiteDataStore _allowsCellularAccess]):
3253         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
3254         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
3255         (-[_WKProcessPoolConfiguration allowsCellularAccess]):
3256         (-[_WKProcessPoolConfiguration setAllowsCellularAccess:]):
3257         * UIProcess/WebProcessPool.cpp:
3258         (WebKit::WebProcessPool::ensureNetworkProcess):
3259         (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
3260         * UIProcess/WebsiteData/WebsiteDataStore.h:
3261         (WebKit::WebsiteDataStore::setBoundInterfaceIdentifier):
3262         (WebKit::WebsiteDataStore::boundInterfaceIdentifier):
3263         (WebKit::WebsiteDataStore::setAllowsCellularAccess):
3264         (WebKit::WebsiteDataStore::allowsCellularAccess):
3265         * WebKit.xcodeproj/project.pbxproj:
3266         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3267         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
3268         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
3269         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
3270         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
3271         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
3272         * WebProcess/WebProcess.cpp:
3273         (WebKit::WebProcess::ensurePrivateBrowsingSession):
3274         (WebKit::WebProcess::clearCachedCredentials):
3275
3276 2017-10-20  Alex Christensen  <achristensen@webkit.org>
3277
3278         Add ObjC SPI to _WKDownloadDelegate missing from WKContextDownloadClient
3279         https://bugs.webkit.org/show_bug.cgi?id=178566
3280         <rdar://problem/23041906>
3281
3282         Reviewed by Brady Eidson.
3283
3284         * UIProcess/API/Cocoa/_WKDownloadDelegate.h:
3285         * UIProcess/Cocoa/DownloadClient.h:
3286         * UIProcess/Cocoa/DownloadClient.mm:
3287         (WebKit::DownloadClient::DownloadClient):
3288         (WebKit::DownloadClient::didReceiveAuthenticationChallenge):
3289         (WebKit::DownloadClient::shouldDecodeSourceDataOfMIMEType):
3290         (WebKit::DownloadClient::didCreateDestination):
3291         (WebKit::DownloadClient::processDidCrash):
3292
3293 2017-10-20  Youenn Fablet  <youenn@apple.com>
3294
3295         ResourceResponse should have a ServiceWorker source
3296         https://bugs.webkit.org/show_bug.cgi?id=178593
3297
3298         Reviewed by Alex Christensen.
3299
3300         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
3301         (WebKit::ServiceWorkerClientFetch::didReceiveResponse): setting response source to ServiceWorker.
3302         * WebProcess/Storage/ServiceWorkerClientFetch.h:
3303
3304 2017-10-20  Antoine Quint  <graouts@apple.com>
3305
3306         [Web Animations] Provide basic timeline and animation interfaces
3307         https://bugs.webkit.org/show_bug.cgi?id=178526
3308
3309         Reviewed by Dean Jackson.
3310
3311         Remove the WEB_ANIMATIONS compile-time flag.
3312
3313         * Configurations/FeatureDefines.xcconfig:
3314         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3315         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
3316         (WebKit::InjectedBundle::setWebAnimationsEnabled):
3317         * WebProcess/WebPage/WebPage.cpp:
3318         (WebKit::WebPage::updatePreferences):
3319
3320 2017-10-02  Brian Burg  <bburg@apple.com>
3321
3322         Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView
3323         https://bugs.webkit.org/show_bug.cgi?id=177661
3324         <rdar://problem/34740286>
3325
3326         Reviewed by Joseph Pecoraro.
3327
3328         Move setup and delegates of the inspector frontend page into implementations of
3329         WebInspectorProxy::platformCreateFrontendPage. The Mac implementation
3330         will be subsumed by WKInspectorViewController, while the GTK implementation
3331         is inherited from the cross-platform version that uses C API. Eventually the
3332         GTK version should use GTK API rather than the soon to be deprecated C API.
3333
3334         * UIProcess/WebInspectorProxy.cpp:
3335         (WebKit::WebInspectorProxy::createFrontendPage):
3336         (WebKit::webProcessDidCrash): Deleted.
3337         (WebKit::decidePolicyForNavigationAction): Deleted.
3338         (WebKit::getContextMenuFromProposedMenu): Deleted.
3339         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
3340         (WebKit::exceededDatabaseQuota):
3341         (WebKit::webProcessDidCrash):
3342         (WebKit::decidePolicyForNavigationAction):
3343         (WebKit::getContextMenuFromProposedMenu):
3344         (WebKit::WebInspectorProxy::platformCreateFrontendPage):
3345         * UIProcess/mac/WebInspectorProxyMac.mm:
3346         (WebKit::exceededDatabaseQuota):
3347         (WebKit::webProcessDidCrash):
3348         (WebKit::decidePolicyForNavigationAction):
3349         (WebKit::getContextMenuFromProposedMenu):
3350         (WebKit::WebInspectorProxy::platformCreateFrontendPage):
3351
3352 2017-10-02  Brian Burg  <bburg@apple.com>
3353
3354         Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView
3355         https://bugs.webkit.org/show_bug.cgi?id=177661
3356         <rdar://problem/34740286>
3357
3358         Reviewed by Joseph Pecoraro.
3359
3360         Adopt WKInspectorViewController in WebInspectorProxyMac to set up the
3361         frontend's web view.
3362
3363         * UIProcess/WebInspectorProxy.cpp:
3364         (WebKit::WebInspectorProxy::invalidate):
3365         (WebKit::WebInspectorProxy::close):
3366         (WebKit::WebInspectorProxy::didClose):
3367         (WebKit::WebInspectorProxy::closeFrontendPageAndWindow):
3368         Make closeFrontendPageAndWindow into the method that does work.
3369         Only use didClose() as the IPC message entry point.
3370
3371         * UIProcess/WebInspectorProxy.h:
3372         (WebKit::WebInspectorProxy::isUnderTest const): Make public.
3373
3374         * UIProcess/mac/WKInspectorViewController.h:
3375         * UIProcess/mac/WKInspectorViewController.mm:
3376         (+[WKInspectorViewController viewIsInspectorWebView:]):
3377         Abstract away the -isInstanceOfClass: check for WKInspectorWKWebView.
3378         Clients shouldn't need to know whether we use a subclass or what its name is.
3379
3380         * UIProcess/mac/WebInspectorProxyMac.mm:
3381         (-[WKWebInspectorProxyObjCAdapter inspectorViewControllerInspectorDidCrash:]):
3382         (-[WKWebInspectorProxyObjCAdapter inspectorViewControllerInspectorIsUnderTest:]):
3383         Hook up view controller delegates.
3384
3385         (WebKit::WebInspectorProxy::platformCreateFrontendPage):
3386         (WebKit::WebInspectorProxy::platformCreateFrontendWindow):
3387         (WebKit::WebInspectorProxy::closeFrontendPage):
3388         New implementation based on the view controller.
3389
3390         (WebKit::WebInspectorProxy::platformBringToFront):
3391         (WebKit::WebInspectorProxy::platformIsFront):
3392         (WebKit::WebInspectorProxy::platformCanAttach):
3393         (WebKit::WebInspectorProxy::inspectedViewFrameDidChange):
3394         (WebKit::WebInspectorProxy::platformAttach):
3395         (WebKit::WebInspectorProxy::platformDetach):
3396         (WebKit::WebInspectorProxy::platformStartWindowDrag):
3397         Adjust to get the WKWebView out of the view controller for code that needs
3398         to do something with the NSView, such as get/set the frame.
3399
3400         (WebKit::WebInspectorProxy::createFrontendConfiguration): Deleted.
3401         (WebKit::exceededDatabaseQuota): Deleted.
3402         (WebKit::webProcessDidCrash): Deleted.
3403         (WebKit::decidePolicyForNavigationAction): Deleted.
3404         (WebKit::getContextMenuFromProposedMenu): Deleted.
3405
3406 2017-10-02  Brian Burg  <bburg@apple.com>
3407
3408         Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView
3409         https://bugs.webkit.org/show_bug.cgi?id=177661
3410         <rdar://problem/34740286>
3411
3412         Reviewed by Joseph Pecoraro.
3413
3414         Introduce new platform methods to open and close the frontend page and window.
3415         This matches how RemoteWebInspectorProxy divides work up into platform methods.
3416         Move existing code from platformDidClose, platformOpen, and other methods into
3417         the new platform methods. Move some identical platform code into WebInspectorProxy.cpp.
3418
3419         * UIProcess/WebInspectorProxy.h:
3420         * UIProcess/WebInspectorProxy.cpp:
3421         (WebKit::WebInspectorProxy::connect):
3422         (WebKit::WebInspectorProxy::showConsole):
3423         (WebKit::WebInspectorProxy::showResources):
3424         (WebKit::WebInspectorProxy::showTimelines):
3425         (WebKit::WebInspectorProxy::showMainResourceForFrame):
3426         (WebKit::WebInspectorProxy::createFrontendPage):
3427         (WebKit::WebInspectorProxy::createInspectorPage):
3428         (WebKit::WebInspectorProxy::open):
3429         (WebKit::WebInspectorProxy::didClose):
3430         (WebKit::WebInspectorProxy::eagerlyCreateInspectorPage): Renamed.
3431
3432         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
3433         (WebKit::WebInspectorProxy::updateInspectorWindowTitle const):
3434         (WebKit::WebInspectorProxy::platformCreateFrontendPage):
3435         Do everything necessary to set up the frontend page WebView.
3436
3437         (WebKit::WebInspectorProxy::platformCreateFrontendWindow):
3438         Do everything necessary to set up the detached NSWindow for the frontend.
3439
3440         (WebKit::WebInspectorProxy::platformCloseFrontendPageAndWindow):
3441         (WebKit::WebInspectorProxy::platformDetach):
3442         (WebKit::WebInspectorProxy::platformCreateInspectorPage): Deleted.
3443         (WebKit::WebInspectorProxy::createInspectorWindow): Deleted.
3444         (WebKit::WebInspectorProxy::platformOpen): Deleted.
3445         (WebKit::WebInspectorProxy::platformDidClose): Deleted.
3446
3447         * UIProcess/mac/WebInspectorProxyMac.mm:
3448         (WebKit::WebInspectorProxy::updateInspectorWindowTitle const):
3449         (WebKit::WebInspectorProxy::platformCreateFrontendPage): Added.
3450         Do everything necessary to set up the frontend page WebView.
3451
3452         (WebKit::WebInspectorProxy::platformCreateFrontendWindow): Added.
3453         Do everything necessary to set up the detached NSWindow for the frontend.
3454
3455         (WebKit::WebInspectorProxy::closeFrontendPage):
3456         (WebKit::WebInspectorProxy::closeFrontendAfterInactivityTimerFired):
3457         (WebKit::WebInspectorProxy::platformCloseFrontendPageAndWindow):
3458         (WebKit::WebInspectorProxy::platformDidCloseForCrash):
3459         (WebKit::WebInspectorProxy::platformInvalidate):
3460         (WebKit::WebInspectorProxy::platformBringToFront): Carry through renamings.
3461
3462         (WebKit::WebInspectorProxy::platformDetach):
3463         Defer to the general open() method to create a window if needed and bring it to front.
3464
3465         (WebKit::WebInspectorProxy::platformCanAttach): Move this below open/close code.
3466
3467         (WebKit::WebInspectorProxy::closeFrontend): Deleted.
3468         (WebKit::WebInspectorProxy::createInspectorWindow): Deleted.
3469         (WebKit::WebInspectorProxy::platformCreateInspectorPage): Deleted.
3470         (WebKit::WebInspectorProxy::platformOpen): Deleted.
3471         (WebKit::WebInspectorProxy::platformDidClose): Deleted.
3472         Defer to the general open() method to create a window if needed and bring it to front.
3473
3474         * UIProcess/wpe/WebInspectorProxyWPE.cpp:
3475         (WebKit::WebInspectorProxy::platformCreateFrontendPage):
3476         (WebKit::WebInspectorProxy::platformCreateFrontendWindow):
3477         (WebKit::WebInspectorProxy::platformCloseFrontendPageAndWindow):
3478         (WebKit::WebInspectorProxy::platformCreateInspectorPage): Deleted.
3479         (WebKit::WebInspectorProxy::createInspectorWindow): Deleted.
3480         (WebKit::WebInspectorProxy::platformOpen): Deleted.
3481         (WebKit::WebInspectorProxy::platformDidClose): Deleted.
3482         Update stubs.
3483
3484 2017-10-02  Brian Burg  <bburg@apple.com>
3485
3486         Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView
3487         https://bugs.webkit.org/show_bug.cgi?id=177661
3488         <rdar://problem/34740286>
3489
3490         Reviewed by Joseph Pecoraro.
3491
3492         This patch refactors some Cocoa code pathas.
3493         Rename the timer that closes the WebView so it's more obvious what it is for.
3494         Extract the common code to close the frontend window so its not implemented by
3495         the timer callback.
3496
3497         In later patches, this will be extracted further into platform methods to open/close
3498         the frontend and window, like how it is for RemoteWebInspectorProxy.
3499
3500         * UIProcess/WebInspectorProxy.cpp:
3501         (WebKit::WebInspectorProxy::WebInspectorProxy):
3502         * UIProcess/WebInspectorProxy.h:
3503         * UIProcess/mac/WebInspectorProxyMac.mm:
3504         (WebKit::WebInspectorProxy::closeFrontendAfterInactivityTimerFired):
3505         (WebKit::WebInspectorProxy::closeFrontend):
3506         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
3507         (WebKit::WebInspectorProxy::platformDidClose):
3508         (WebKit::WebInspectorProxy::platformDidCloseForCrash):
3509         (WebKit::WebInspectorProxy::platformInvalidate):
3510         (WebKit::WebInspectorProxy::closeTimerFired): Deleted.
3511
3512 2017-09-30  Brian Burg  <bburg@apple.com>
3513
3514         Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView
3515         https://bugs.webkit.org/show_bug.cgi?id=177661
3516         <rdar://problem/34740286>
3517
3518         Reviewed by Joseph Pecoraro.
3519
3520         Modernize the ObjC adapter and related code a bit before it is hooked
3521         into WKInspectorViewController.
3522
3523         * UIProcess/API/C/mac/WKInspectorPrivateMac.h: No need for the
3524         ivar to be declared here, move to @implementation.
3525
3526         * UIProcess/WebInspectorProxy.h: Simplify the name to match modern convention.
3527
3528         * UIProcess/mac/WebInspectorProxyMac.mm:
3529         (-[WKWebInspectorProxyObjCAdapter inspectorRef]):
3530         (-[WKWebInspectorProxyObjCAdapter initWithWebInspectorProxy:]):
3531         (-[WKWebInspectorProxyObjCAdapter invalidate]):
3532         (-[WKWebInspectorProxyObjCAdapter windowDidMove:]):
3533         (-[WKWebInspectorProxyObjCAdapter windowDidResize:]):
3534         (-[WKWebInspectorProxyObjCAdapter windowWillClose:]):
3535         (-[WKWebInspectorProxyObjCAdapter windowDidEnterFullScreen:]):
3536         (-[WKWebInspectorProxyObjCAdapter windowDidExitFullScreen:]):
3537         (-[WKWebInspectorProxyObjCAdapter inspectedViewFrameDidChange:]):
3538         Remove unnecessary casts to and from void*.
3539
3540         (WebKit::WebInspectorProxy::attachmentViewDidChange):
3541         (WebKit::WebInspectorProxy::setInspectorWindowFrame):
3542         (WebKit::WebInspectorProxy::closeTimerFired):
3543         (WebKit::WebInspectorProxy::createInspectorWindow):
3544         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
3545         Fix uses of member variable m_objCAdapter.
3546
3547         (-[WKWebInspectorProxyObjCAdapter close]): Deleted.
3548         Rename this to invalidate to match modern convention. In this context,
3549         'close' might trick someone into thinking that this closes a window/page.
3550
3551 2017-09-30  Brian Burg  <bburg@apple.com>
3552
3553         Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView
3554         https://bugs.webkit.org/show_bug.cgi?id=177661
3555         <rdar://problem/34740286>
3556
3557         Reviewed by Joseph Pecoraro.
3558
3559         Move code that sets up and controls the inspector WebView into WKInspectorViewController.
3560         This will be shared between RemoteWebInspectorProxy and WebInspectorProxy eventually,
3561         but for now just pull out code from RemoteWebInspectorProxy. The next patch will move
3562         over WebInspectorProxy.
3563
3564         WKInspectorViewController uses the ObjC API for setting up the WKWebView's delegates.
3565         Previously, a WKWebView was used but the delegates were set up using the C API. In
3566         a few cases it uses delegate methods to ask the owning [Remote]WebInspectorProxy some
3567         things. In general, WKInspectorViewController doesn't dig into any internals of
3568         WebPageProxy or WebInspectorProxy; that is delegated to the client.
3569
3570         * UIProcess/RemoteWebInspectorProxy.h:
3571         (WebKit::RemoteWebInspectorProxy::isUnderTest const): Add a method stub for now.
3572         We might want to enable tests for a _WKRemoteWebInspectorViewController-based UI
3573         in the future, and WebInspectorProxy has the same method. Add this and connect it
3574         to the view controller delegate method.
3575
3576         (WebKit::RemoteWebInspectorProxy::webView const):
3577         This returns a plain WKWebView type now.
3578
3579         * UIProcess/mac/RemoteWebInspectorProxyMac.mm:
3580         (-[WKRemoteWebInspectorProxyObjCAdapter inspectorViewControllerInspectorDidCrash:]):
3581         (-[WKRemoteWebInspectorProxyObjCAdapter inspectorViewControllerInspectorIsUnderTest:]):
3582         (-[WKRemoteWebInspectorProxyObjCAdapter webViewWebContentProcessDidTerminate:]): Deleted.
3583         (-[WKRemoteWebInspectorProxyObjCAdapter webView:decidePolicyForNavigationAction:decisionHandler:]): Deleted.
3584         Make the ObjCAdapter forward view controller delegate calls to the C++ class.
3585         It no longer needs to be the delegate of the WebView, as the view controller handles that.
3586
3587         (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
3588         Clean up and move WKWebView setup code into the view controller.
3589
3590         (WebKit::RemoteWebInspectorProxy::platformCloseFrontendPageAndWindow):
3591         The m_inspectorPage is closed by the caller before calling this method, so we don't need to do it here.
3592
3593         (WebKit::RemoteWebInspectorProxy::platformBringToFront):
3594         (WebKit::RemoteWebInspectorProxy::platformSave):
3595         (WebKit::RemoteWebInspectorProxy::platformAppend):
3596         (WebKit::RemoteWebInspectorProxy::platformStartWindowDrag):
3597         Use webView() instead of m_webView.
3598
3599         * UIProcess/mac/WKInspectorViewController.h: Added.
3600         * UIProcess/mac/WKInspectorViewController.mm: Added.
3601         (-[WKInspectorWKWebView tag]):
3602         (-[WKInspectorViewController initWithInspectedPage:]):
3603         (-[WKInspectorViewController dealloc]):
3604         (-[WKInspectorViewController delegate]):
3605         (-[WKInspectorViewController webView]):
3606         (-[WKInspectorViewController setDelegate:]):
3607         (-[WKInspectorViewController configuration]):
3608         (-[WKInspectorViewController _webView:getWindowFrameWithCompletionHandler:]):
3609         (-[WKInspectorViewController _webView:setWindowFrame:]):
3610         (-[WKInspectorViewController webView:runOpenPanelWithParameters:initiatedByFrame:completionHandler:]):
3611         (-[WKInspectorViewController _webView:decideDatabaseQuotaForSecurityOrigin:currentQuota:currentOriginUsage:currentDatabaseUsage:expectedUsage:decisionHandler:]):
3612         (-[WKInspectorViewController webViewWebContentProcessDidTerminate:]):
3613         (-[WKInspectorViewController webView:decidePolicyForNavigationAction:decisionHandler:]):
3614         Move code from RemoteWebInspectorProxyMac into here.
3615
3616         * UIProcess/mac/WebInspectorProxyMac.mm:
3617         (WebKit::WebInspectorProxy::createFrontendWindow):
3618         Remove commented out code left over from the last time that this method got moved around.
3619
3620         * WebKit.xcodeproj/project.pbxproj:
3621         Add new class.
3622
3623 2017-10-20  Zan Dobersek  <zdobersek@igalia.com>
3624
3625         [WK2] Drop 'CoordinatedGraphics' as a platform prefix from generate-forwarding-headers.pl
3626         https://bugs.webkit.org/show_bug.cgi?id=178575
3627
3628         Reviewed by Carlos Garcia Campos.
3629
3630         * Scripts/generate-forwarding-headers.pl: Remove CoordinatedGraphics as
3631         a supported platform prefix. No one invokes the script with this
3632         argument anymore.
3633
3634 2017-10-19  Alex Christensen  <achristensen@webkit.org>
3635
3636         Introduce completionHandler-based SPI for _WKDownloadDelegate.decideDestinationWithSuggestedFilename
3637         https://bugs.webkit.org/show_bug.cgi?id=178560
3638
3639         Reviewed by Tim Horton.
3640
3641         * UIProcess/API/Cocoa/_WKDownloadDelegate.h:
3642         * UIProcess/Cocoa/DownloadClient.h:
3643         * UIProcess/Cocoa/DownloadClient.mm:
3644         (WebKit::DownloadClient::DownloadClient):
3645         (WebKit::DownloadClient::didStart):
3646         (WebKit::DownloadClient::didReceiveResponse):
3647         (WebKit::DownloadClient::didReceiveData):
3648         (WebKit::DownloadClient::decideDestinationWithSuggestedFilename):
3649         (WebKit::DownloadClient::didFinish):
3650         (WebKit::DownloadClient::didFail):
3651         (WebKit::DownloadClient::didCancel):
3652         (WebKit::DownloadClient::willSendRequest):
3653
3654 2017-10-19  Chris Dumez  <cdumez@apple.com>
3655
3656         ServiceWorkerContextManager should be an IPC::MessageReceiver
3657         https://bugs.webkit.org/show_bug.cgi?id=178552
3658
3659         Reviewed by Youenn Fablet.
3660
3661         ServiceWorkerContextManager should be an IPC::MessageReceiver, to avoid putting too many
3662         ServiceWorker related methods on WebProcess class.
3663
3664         * DerivedSources.make:
3665         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3666         (WebKit::WebSWServerConnection::startServiceWorkerContext):
3667         (WebKit::WebSWServerConnection::startFetch):
3668         * WebKit.xcodeproj/project.pbxproj:
3669         * WebProcess/Storage/ServiceWorkerContextManager.cpp:
3670         (WebKit::ServiceWorkerContextManager::startFetchInServiceWorker):
3671         (WebKit::ServiceWorkerContextManager::startFetch): Deleted.
3672         * WebProcess/Storage/ServiceWorkerContextManager.h:
3673         * WebProcess/Storage/ServiceWorkerContextManager.messages.in: Added.
3674         * WebProcess/WebProcess.cpp:
3675         (WebKit::WebProcess::didReceiveMessage):
3676         (WebKit::WebProcess::getWorkerContextConnection):
3677         (WebKit::WebProcess::startServiceWorkerContext): Deleted.
3678         (WebKit::WebProcess::startFetchInServiceWorker): Deleted.
3679         * WebProcess/WebProcess.h:
3680         * WebProcess/WebProcess.messages.in:
3681
3682 2017-10-19  Alex Christensen  <achristensen@webkit.org>
3683
3684         Modernize authentication challenge handling in WebKit
3685         https://bugs.webkit.org/show_bug.cgi?id=178555
3686
3687         Reviewed by Tim Horton.
3688
3689         * UIProcess/API/APILoaderClient.h:
3690         (API::LoaderClient::didReceiveAuthenticationChallengeInFrame):
3691         * UIProcess/API/APINavigationClient.h:
3692         (API::NavigationClient::didReceiveAuthenticationChallenge):
3693         * UIProcess/API/C/WKPage.cpp:
3694         (WKPageSetPageLoaderClient):
3695         (WKPageSetPageNavigationClient):
3696         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
3697         * UIProcess/Cocoa/NavigationState.h:
3698         * UIProcess/Cocoa/NavigationState.mm:
3699         (WebKit::NavigationState::NavigationClient::canAuthenticateAgainstProtectionSpace):
3700         (WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge):
3701         * UIProcess/WebPageProxy.cpp:
3702         (WebKit::WebPageProxy::didReceiveAuthenticationChallengeProxy):
3703
3704 2017-10-19  Alex Christensen  <achristensen@webkit.org>
3705
3706         Modernize API::DownloadClient
3707         https://bugs.webkit.org/show_bug.cgi?id=178547
3708
3709         Reviewed by Andy Estes.
3710
3711         Use more C++ references instead of pointers because they're never null.
3712
3713         Remove canAuthenticateAgainstProtectionSpace because there are no implementations
3714         except the default implementation which always returns true and we don't intend to
3715         add this to the SPI because that's just a legacy call anyways from when NSURLConnection
3716         hadn't fully evolved, and we're moving away from NSURLConnection, especially in our API design.
3717
3718         Separate the NetworkSession-only and pre-NetworkSession-only callbacks.  All the synchronous
3719         IPC messages are only used in the pre-NetworkSession code, so once we remove it we can remove them!
3720
3721         Make API::DownloadClient calls that NetworkSession uses use a completion handler so we will be able to
3722         design an asynchronous API.
3723
3724         * NetworkProcess/Downloads/DownloadManager.cpp:
3725         (WebKit::DownloadManager::continueCanAuthenticateAgainstProtectionSpace): Deleted.
3726         * NetworkProcess/Downloads/DownloadManager.h:
3727         * NetworkProcess/Downloads/PendingDownload.cpp:
3728         (WebKit::PendingDownload::canAuthenticateAgainstProtectionSpaceAsync):
3729         (WebKit::PendingDownload::continueCanAuthenticateAgainstProtectionSpace): Deleted.
3730         * NetworkProcess/Downloads/PendingDownload.h:
3731         * NetworkProcess/NetworkProcess.cpp:
3732         (WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpaceDownload): Deleted.
3733         * NetworkProcess/NetworkProcess.h:
3734         * NetworkProcess/NetworkProcess.messages.in:
3735         * UIProcess/API/APIDownloadClient.h:
3736         (API::DownloadClient::didStart):
3737         (API::DownloadClient::didReceiveAuthenticationChallenge):
3738         (API::DownloadClient::didReceiveResponse):
3739         (API::DownloadClient::didReceiveData):
3740         (API::DownloadClient::shouldDecodeSourceDataOfMIMEType):
3741         (API::DownloadClient::decideDestinationWithSuggestedFilename):
3742         (API::DownloadClient::didCreateDestination):
3743         (API::DownloadClient::didFinish):
3744         (API::DownloadClient::didFail):
3745         (API::DownloadClient::didCancel):
3746         (API::DownloadClient::processDidCrash):
3747         (API::DownloadClient::willSendRequest):
3748         (API::DownloadClient::canAuthenticateAgainstProtectionSpace): Deleted.
3749         * UIProcess/API/C/WKContext.cpp:
3750         (WKContextSetDownloadClient):
3751         * UIProcess/API/glib/WebKitDownloadClient.cpp:
3752         * UIProcess/Cocoa/DownloadClient.h:
3753         * UIProcess/Cocoa/DownloadClient.mm:
3754         (WebKit::DownloadClient::didStart):
3755         (WebKit::DownloadClient::didReceiveResponse):
3756         (WebKit::DownloadClient::didReceiveData):
3757         (WebKit::DownloadClient::decideDestinationWithSuggestedFilename):
3758         (WebKit::DownloadClient::didFinish):
3759         (WebKit::DownloadClient::didFail):
3760         (WebKit::DownloadClient::didCancel):
3761         (WebKit::DownloadClient::willSendRequest):
3762         * UIProcess/Downloads/DownloadProxy.cpp:
3763         (WebKit::DownloadProxy::processDidClose):
3764         (WebKit::DownloadProxy::didStart):
3765         (WebKit::DownloadProxy::didReceiveAuthenticationChallenge):
3766         (WebKit::DownloadProxy::willSendRequest):
3767         (WebKit::DownloadProxy::didReceiveResponse):
3768         (WebKit::DownloadProxy::didReceiveData):
3769         (WebKit::DownloadProxy::shouldDecodeSourceDataOfMIMEType):
3770         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync):
3771         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilename):
3772         (WebKit::DownloadProxy::didCreateDestination):
3773         (WebKit::DownloadProxy::didFinish):
3774         (WebKit::DownloadProxy::didFail):
3775         (WebKit::DownloadProxy::didCancel):
3776         (WebKit::DownloadProxy::canAuthenticateAgainstProtectionSpace): Deleted.
3777         * UIProcess/Downloads/DownloadProxy.h:
3778         * UIProcess/Downloads/DownloadProxy.messages.in:
3779
3780 2017-10-19  Nan Wang  <n_wang@apple.com>
3781
3782         AX: Provide a way for Accessibility to cache the selection while retrieving rects for speak selection
3783         https://bugs.webkit.org/show_bug.cgi?id=176247
3784         <rdar://problem/34217143>
3785
3786         Reviewed by Ryosuke Niwa.
3787
3788         When getting the rects for highlighting the spoken text within a selection range on iOS, we can get a
3789         list of totally wrong rects if the user changed the selection to some other text. This is because the
3790         calculation is based on the current selection range. Therefore, we need to provide a way for accessibility
3791         codepath to store the selection during a speaking session.
3792
3793         * UIProcess/API/Cocoa/WKWebView.mm:
3794         (-[WKWebView _accessibilityStoreSelection]):
3795         (-[WKWebView _accessibilityClearSelection]):
3796         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3797         * UIProcess/WebPageProxy.h:
3798         * UIProcess/ios/WKContentViewInteraction.h:
3799         * UIProcess/ios/WKContentViewInteraction.mm:
3800         (-[WKContentView _accessibilityStoreSelection]):
3801         (-[WKContentView _accessibilityClearSelection]):
3802         * UIProcess/ios/WebPageProxyIOS.mm:
3803         (WebKit::WebPageProxy::storeSelectionForAccessibility):
3804         * WebProcess/WebPage/WebPage.h:
3805         * WebProcess/WebPage/WebPage.messages.in:
3806         * WebProcess/WebPage/ios/WebPageIOS.mm:
3807         (WebKit::WebPage::getRectsForGranularityWithSelectionOffset):
3808         (WebKit::WebPage::storeSelectionForAccessibility):
3809         (WebKit::WebPage::getRectsAtSelectionOffsetWithText):
3810
3811 2017-10-19  Sam Weinig  <sam@webkit.org>
3812
3813         [Settings] Move global settings into their own file
3814         https://bugs.webkit.org/show_bug.cgi?id=178512
3815
3816         Reviewed by Darin Adler.
3817
3818         Moves all global settigns out of SettingsBase and into the new DeprecatedGlobalSettings.
3819
3820         * NetworkProcess/NetworkProcess.cpp:
3821         (WebKit::NetworkProcess::setAllowsAnySSLCertificateForWebSocket):
3822         * Shared/WebPreferencesDefinitions.h:
3823         * Shared/WebPreferencesStore.cpp:
3824         * WebProcess/WebPage/WebPage.cpp:
3825         (WebKit::m_cpuLimit):
3826         (WebKit::WebPage::updatePreferences):
3827         * WebProcess/WebProcess.cpp:
3828         (WebKit::WebProcess::setResourceLoadStatisticsEnabled):
3829         * WebProcess/cocoa/VideoFullscreenManager.mm:
3830         (WebKit::VideoFullscreenManager::supportsVideoFullscreen const):
3831
3832 2017-10-19  Andy Estes  <aestes@apple.com>
3833
3834         [iOS] Conditionally rename DatabaseProcess to StorageProcess when building for iOS devices
3835         https://bugs.webkit.org/show_bug.cgi?id=178181
3836         <rdar://problem/33660282>
3837
3838         Reviewed by Dan Bernstein.
3839
3840         * Configurations/BaseTarget.xcconfig:
3841         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
3842         (WebKit::serviceName):
3843         * WebKit.xcodeproj/project.pbxproj:
3844
3845 2017-10-19  Youenn Fablet  <youenn@apple.com>
3846
3847         Add preliminary support for ServiceWorker Handle Fetch
3848         https://bugs.webkit.org/show_bug.cgi?id=178475
3849         <rdar://problem/35066424>
3850
3851         Reviewed by Chris Dumez.
3852
3853         Relanding now that underlying issue is fixed in https://bugs.webkit.org/show_bug.cgi?id=178527.
3854
3855         Preliminary support of Handle Fetch algorithm and integration with fetch spec.
3856         Adding ServiceWorkerClientFetch as the class responsible to do the load through ServiceWorker.
3857         It is similar to WebResourceLoader that do the load through NetworkProcess.
3858         In case ServiceWorkerClientFetch is not able to load through ServiceWorker,
3859         it will fallback to WebResourceLoader through a fallback callback.
3860
3861         Loading through Service Worker is done currently if:
3862         - There is a service worker registered for that origin
3863         - Request is a subresource
3864         - service workers mode is all
3865         There will be cases where the service worker will not do the loading, for instance when fetch event handler is not set.
3866         Future work should try to reduce the cases where the IPC dance is done unnecessarily.
3867
3868         ServiceWorkerClientFetch is responsible to adapt the ServiceWorker response to ResourceLoader.
3869         In particular, it is calling ResourceLoader error callback if response is of type error.
3870         It should call ResourceLoader redirection callback if response is a redirection response.
3871         This will be done as a follow-up.
3872
3873         Implementing the IPC communication dedicated to fetch between WebProcess and ServiceWorker through StorageProcess.
3874         In the future, WebProcess should create a direct IPC communication to the ServiceWorker process.
3875
3876         Moved SWContextManager from WebCore to WebKit and renamed it to ServiceWorkerContextManager.
3877         This class is moved to WebKit as it will have to handle IPC and having a separation will add some unnecessary boilerplate.
3878
3879         * CMakeLists.txt:
3880         * DerivedSources.make:
3881         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3882         (WebKit::WebSWServerConnection::startFetch):
3883         (WebKit::WebSWServerConnection::didReceiveFetchResponse):
3884         (WebKit::WebSWServerConnection::didReceiveFetchData):
3885         (WebKit::WebSWServerConnection::didFinishFetch):
3886         (WebKit::WebSWServerConnection::didFailFetch):
3887         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
3888         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
3889         * StorageProcess/StorageProcess.cpp:
3890         (WebKit::StorageProcess::didFailFetch):
3891         (WebKit::StorageProcess::didReceiveFetchResponse):
3892         (WebKit::StorageProcess::didReceiveFetchData):
3893         (WebKit::StorageProcess::didFinishFetch):
3894         * StorageProcess/StorageProcess.h:
3895         * StorageProcess/StorageProcess.messages.in:
3896         * WebKit.xcodeproj/project.pbxproj:
3897         * WebProcess/Network/WebLoaderStrategy.cpp:
3898         (WebKit::WebLoaderStrategy::scheduleLoad):
3899         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
3900         (WebKit::WebLoaderStrategy::remove):
3901         * WebProcess/Network/WebLoaderStrategy.h:
3902         * WebProcess/Storage/ServiceWorkerClientFetch.cpp: Added.
3903         (WebKit::ServiceWorkerClientFetch::ServiceWorkerClientFetch):
3904         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
3905         (WebKit::ServiceWorkerClientFetch::didReceiveData):
3906         (WebKit::ServiceWorkerClientFetch::didFinish):
3907         (WebKit::ServiceWorkerClientFetch::didFail):
3908         (WebKit::ServiceWorkerClientFetch::cancel):
3909         * WebProcess/Storage/ServiceWorkerClientFetch.h: Copied from Source/WebKit/WebProcess/Storage/WebSWClientConnection.h.
3910         * WebProcess/Storage/ServiceWorkerClientFetch.messages.in: Copied from Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.messages.in.
3911         * WebProcess/Storage/ServiceWorkerContextManager.cpp: Added.
3912         (WebKit::ServiceWorkerContextManager::startServiceWorkerContext):
3913         (WebKit::ServiceWorkerContextManager::startFetch):
3914         * WebProcess/Storage/ServiceWorkerContextManager.h: Renamed from Source/WebCore/workers/service/context/SWContextManager.h.
3915         (WebKit::ServiceWorkerContextManager::ServiceWorkerContextManager):
3916         * WebProcess/Storage/WebSWClientConnection.cpp:
3917         (WebKit::WebSWClientConnection::startFetch):
3918         * WebProcess/Storage/WebSWClientConnection.h:
3919         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
3920         (WebKit::shouldHandleFetch):
3921         (WebKit::WebServiceWorkerProvider::handleFetch):
3922         (WebKit::WebServiceWorkerProvider::cancelFetch):
3923         (WebKit::WebServiceWorkerProvider::fetchFinished):
3924         (WebKit::WebServiceWorkerProvider::didReceiveServiceWorkerClientFetchMessage):
3925         * WebProcess/Storage/WebServiceWorkerProvider.h:
3926         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
3927         (WebKit::WebToStorageProcessConnection::didReceiveMessage):
3928         * WebProcess/WebProcess.cpp:
3929         (WebKit::WebProcess::getWorkerContextConnection):
3930         (WebKit::WebProcess::startServiceWorkerContext):
3931         (WebKit::WebProcess::startFetchInServiceWorker):
3932         * WebProcess/WebProcess.h:
3933         * WebProcess/WebProcess.messages.in:
3934
3935 2017-10-19  Youenn Fablet  <youenn@apple.com>
3936
3937         Service Worker process should not be selected to open WebView on it
3938         https://bugs.webkit.org/show_bug.cgi?id=178527
3939
3940         Reviewed by Chris Dumez.
3941
3942         Selection of process to open a page will no longer use an existing web process if it is the service worker process.
3943
3944         * UIProcess/WebProcessPool.cpp:
3945         (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
3946
3947 2017-10-19  Tim Horton  <timothy_horton@apple.com>
3948
3949         Display link bringup can block the main thread for ~150ms during WKWebView init
3950         https://bugs.webkit.org/show_bug.cgi?id=178524
3951
3952         Reviewed by Dean Jackson.
3953
3954         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
3955         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
3956         (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
3957         (WebKit::RemoteLayerTreeDrawingAreaProxy::displayLinkHandler):
3958         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
3959         (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
3960         Lazily initialize the display link at first use.
3961
3962 2017-10-19  Tim Horton  <timothy_horton@apple.com>
3963
3964         Expand r209943 to suppress paste during provisional navigation as well
3965         https://bugs.webkit.org/show_bug.cgi?id=178429
3966         <rdar://problem/33952830>
3967
3968         Reviewed by Dean Jackson.
3969
3970         * Shared/WebPreferencesDefinitions.h:
3971         * UIProcess/API/C/WKPreferences.cpp:
3972         (WKPreferencesSetShouldSuppressKeyboardInputDuringProvisionalNavigation):
3973         (WKPreferencesGetShouldSuppressKeyboardInputDuringProvisionalNavigation):
3974         * UIProcess/API/Cocoa/WKPreferences.mm:
3975         (-[WKPreferences _shouldSuppressKeyboardInputDuringProvisionalNavigation]):
3976         (-[WKPreferences _setShouldSuppressKeyboardInputDuringProvisionalNavigation:]):
3977         * WebProcess/WebPage/WebPage.cpp:
3978         (WebKit::WebPage::updatePreferences):
3979         Adjust to the changed preference name, except at the SPI level.
3980
3981 2017-10-19  Youenn Fablet  <youenn@apple.com>
3982
3983         Add API to clean CacheStorage data
3984         https://bugs.webkit.org/show_bug.cgi?id=178034
3985
3986         Unreviewed.
3987
3988         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h: Using WK_IOS_TBA instead of WK_MAC_TBA for iOS.
3989
3990 2017-10-19  Chris Dumez  <cdumez@apple.com>
3991
3992         Unreviewed build fix after r223692.
3993
3994         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3995
3996 2017-10-19  Chris Dumez  <cdumez@apple.com>
3997
3998         Unreviewed, revert r223650 as it caused crashes on the bots.
3999
4000         * CMakeLists.txt:
4001         * DerivedSources.make:
4002         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
4003         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
4004         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
4005         * StorageProcess/StorageProcess.cpp:
4006         * StorageProcess/StorageProcess.h:
4007         * StorageProcess/StorageProcess.messages.in:
4008         * WebKit.xcodeproj/project.pbxproj:
4009         * WebProcess/Network/WebLoaderStrategy.cpp:
4010         (WebKit::WebLoaderStrategy::scheduleLoad):
4011         (WebKit::WebLoaderStrategy::remove):