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