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