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