Remove ENABLE_CSS_REGIONS
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2017-10-02  Michael Catanzaro  <mcatanzaro@igalia.com>
2
3         Remove ENABLE_CSS_REGIONS
4         https://bugs.webkit.org/show_bug.cgi?id=177689
5
6         Reviewed by Darin Adler.
7
8         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp:
9         (webkit_dom_element_get_webkit_region_overset):
10         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.h:
11         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
12         (webkit_dom_element_get_webkit_region_overset): Deleted.
13         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.h:
14
15 2017-09-30  Darin Adler  <darin@apple.com>
16
17         Have IPC::Connection::Client objects consistently invalidate the connection when destroyed
18         https://bugs.webkit.org/show_bug.cgi?id=177708
19
20         Reviewed by Anders Carlsson.
21
22         I ran into an intermittent crash when running regression tests. It looked like a connection
23         client was being called after it was destroyed. I did an audit of the all the connection
24         clients to make sure they all invalidate their connection before they are destroyed.
25
26         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
27         (WebKit::NetworkConnectionToWebProcess::~NetworkConnectionToWebProcess): Invalidate the
28         connection since this object opened the connection. There is no obvious
29         guarantee that the connection will already be invalid when this is destroyed.
30         * StorageProcess/StorageToWebProcessConnection.cpp:
31         (WebKit::StorageToWebProcessConnection::~StorageToWebProcessConnection): Ditto.
32         * UIProcess/Plugins/PluginProcessProxy.cpp:
33         (WebKit::PluginProcessProxy::~PluginProcessProxy): Ditto.
34         * WebProcess/Network/NetworkProcessConnection.cpp:
35         (WebKit::NetworkProcessConnection::~NetworkProcessConnection): Ditto.
36         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
37         (WebKit::WebToStorageProcessConnection::~WebToStorageProcessConnection): Ditto.
38
39         * StorageProcess/StorageToWebProcessConnection.h: Derive privately rather than publicly
40         from IPC::Connection::Client because we can, and this means we don't have to study quite
41         as much code to understand how this is used as a connection client.
42         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h: Ditto.
43         * WebProcess/Storage/WebToStorageProcessConnection.h: Ditto.
44         * WebProcess/WebPage/WebInspector.h: Ditto.
45         * WebProcess/WebPage/WebInspectorUI.h: Ditto.
46
47         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
48         (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer): Added a comment about a
49         reference cycle cycle leading to a leak that I believe exists here.
50
51 2017-09-29  Alex Christensen  <achristensen@webkit.org>
52
53         REGRESSION: ASSERTION FAILED: m_provisionalURL.isEmpty() in WebKit::FrameLoadState::didStartProvisionalLoad
54         https://bugs.webkit.org/show_bug.cgi?id=177491
55
56         Reviewed by Andy Estes.
57
58         * WebProcess/WebPage/WebFrame.cpp:
59         (WebKit::WebFrame::setUpWillSubmitFormListener):
60         (WebKit::WebFrame::continueWillSubmitForm):
61         (WebKit::WebFrame::invalidatePolicyListener):
62         Speculative fix for a flaky assertion.
63         Restore the clearing of the policy listeners we used to have when form submission was treated as a policy.
64
65 2017-09-29  Chris Dumez  <cdumez@apple.com>
66
67         http/tests/preconnect/link-rel-preconnect-https.html is flaky
68         https://bugs.webkit.org/show_bug.cgi?id=177673
69
70         Reviewed by Alex Christensen.
71
72         Update PreconnectTask to query the client when a certificate needs to be
73         validated. This allows WebKitTestRunner to ignore invalid certificates
74         and this causes http/tests/preconnect/link-rel-preconnect-https.html
75         to pass consistently.
76
77         To avoid duplicating code, PreconnectTask now uses NetworkLoad internally
78         instead of using a NetworkDataTask directly.
79
80         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
81         (WebKit::NetworkConnectionToWebProcess::preconnectTo):
82         * NetworkProcess/NetworkConnectionToWebProcess.h:
83         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
84         * NetworkProcess/NetworkLoad.h:
85         * NetworkProcess/NetworkProcess.cpp:
86         (WebKit::generateCanAuthenticateIdentifier):
87         (WebKit::NetworkProcess::canAuthenticateAgainstProtectionSpace):
88         (WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpace):
89         (WebKit::NetworkProcess::preconnectTo):
90         * NetworkProcess/NetworkProcess.h:
91         * NetworkProcess/NetworkResourceLoadParameters.cpp:
92         (WebKit::NetworkResourceLoadParameters::encode const):
93         (WebKit::NetworkResourceLoadParameters::decode):
94         * NetworkProcess/PreconnectTask.cpp:
95         (WebKit::PreconnectTask::PreconnectTask):
96         (WebKit::PreconnectTask::~PreconnectTask):
97         (WebKit::PreconnectTask::willSendRedirectedRequest):
98         (WebKit::PreconnectTask::didReceiveResponse):
99         (WebKit::PreconnectTask::didReceiveBuffer):
100         (WebKit::PreconnectTask::didFinishLoading):
101         (WebKit::PreconnectTask::didFailLoading):
102         (WebKit::PreconnectTask::didSendData):
103         (WebKit::PreconnectTask::canAuthenticateAgainstProtectionSpaceAsync):
104         (WebKit::PreconnectTask::continueCanAuthenticateAgainstProtectionSpace):
105         (WebKit::PreconnectTask::frameID const):
106         (WebKit::PreconnectTask::pageID const):
107         * NetworkProcess/PreconnectTask.h:
108         * WebProcess/Network/WebLoaderStrategy.cpp:
109         (WebKit::WebLoaderStrategy::preconnectTo):
110         * WebProcess/Network/WebLoaderStrategy.h:
111
112 2017-09-29  Alex Christensen  <achristensen@webkit.org>
113
114         Expose WebPreferences::webGLEnabled through WKPreferences
115         https://bugs.webkit.org/show_bug.cgi?id=177692
116         <rdar://problem/24110556>
117
118         Reviewed by Andy Estes.
119
120         * UIProcess/API/Cocoa/WKPreferences.mm:
121         (-[WKPreferences _setWebGLEnabled:]):
122         (-[WKPreferences _webGLEnabled]):
123         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
124
125 2017-09-29  Chris Dumez  <cdumez@apple.com>
126
127         [WK2][NETWORK_SESSION] Move some authentication-related code to avoid duplication
128         https://bugs.webkit.org/show_bug.cgi?id=177667
129
130         Reviewed by Alex Christensen.
131
132         Move some authentication-related code to avoid duplication.
133         This is a preparation code supporting Download authentication
134         as Download uses a NSURLSessionDownloadTask and not a
135         NetworkDataTask.
136
137         * NetworkProcess/NetworkDataTask.h:
138         (WebKit::NetworkDataTask::setSuggestedFilename):
139         * NetworkProcess/NetworkLoad.cpp:
140         (WebKit::NetworkLoad::didReceiveChallenge):
141         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
142         * NetworkProcess/NetworkSession.cpp:
143         (WebKit::NetworkSession::allowsSpecificHTTPSCertificateForHost):
144         * NetworkProcess/NetworkSession.h:
145         * NetworkProcess/PreconnectTask.cpp:
146         (WebKit::PreconnectTask::didReceiveChallenge):
147         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
148         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
149         (WebKit::NetworkDataTaskCocoa::didReceiveChallenge):
150         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
151         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
152         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
153         (WebKit::certificatesMatch):
154         (WebKit::NetworkSessionCocoa::allowsSpecificHTTPSCertificateForHost):
155
156 2017-09-29  Alex Christensen  <achristensen@webkit.org>
157
158         Fix WKWebViewConfigurationPrivate after r222663
159         https://bugs.webkit.org/show_bug.cgi?id=177644
160
161         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
162         (-[WKWebViewConfiguration init]):
163         (-[WKWebViewConfiguration copyWithZone:]):
164         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
165
166 2017-09-29  Chris Dumez  <cdumez@apple.com>
167
168         Split some logic out of VisitedLinkStore and make it reusable
169         https://bugs.webkit.org/show_bug.cgi?id=177575
170
171         Reviewed by Alex Christensen.
172
173         Split some logic out of VisitedLinkStore and make it reusable for other purposes than
174         visited links and from other processes than the UIProcess.
175
176         The plan is to reuse the new SharedStringHashStore for Service Worker registration
177         on StorageProcess side and querying on WebContent process side.
178
179         * CMakeLists.txt:
180         * Shared/SharedStringHashStore.cpp: Added.
181         (WebKit::nextPowerOf2):
182         (WebKit::tableSizeForKeyCount):
183         (WebKit::SharedStringHashStore::SharedStringHashStore):
184         (WebKit::SharedStringHashStore::createSharedMemoryHandle):
185         (WebKit::SharedStringHashStore::add):
186         (WebKit::SharedStringHashStore::clear):
187         (WebKit::SharedStringHashStore::resizeTable):
188         (WebKit::SharedStringHashStore::pendingSharedStringHashesTimerFired):
189         * Shared/SharedStringHashStore.h: Copied from Source/WebKit/WebProcess/WebPage/VisitedLinkTableController.h.
190         (WebKit::SharedStringHashStore::Client::~Client):
191         (WebKit::SharedStringHashStore::isEmpty const):
192         * Shared/SharedStringHashTable.cpp: Renamed from Source/WebKit/Shared/VisitedLinkTable.cpp.
193         (WebKit::SharedStringHashTable::SharedStringHashTable):
194         (WebKit::SharedStringHashTable::~SharedStringHashTable):
195         (WebKit::SharedStringHashTable::setSharedMemory):
196         (WebKit::SharedStringHashTable::add):
197         (WebKit::SharedStringHashTable::contains const):
198         (WebKit::SharedStringHashTable::clear):
199         * Shared/SharedStringHashTable.h: Renamed from Source/WebKit/Shared/VisitedLinkTable.h.
200         * UIProcess/API/C/WKContext.cpp:
201         (WKContextAddVisitedLink):
202         * UIProcess/API/Cocoa/_WKVisitedLinkStore.mm:
203         (-[_WKVisitedLinkStore addVisitedLinkWithURL:]):
204         * UIProcess/VisitedLinkStore.cpp:
205         (WebKit::VisitedLinkStore::VisitedLinkStore):
206         (WebKit::VisitedLinkStore::addProcess):
207         (WebKit::VisitedLinkStore::addVisitedLinkHash):
208         (WebKit::VisitedLinkStore::removeAll):
209         (WebKit::VisitedLinkStore::addVisitedLinkHashFromPage):
210         (WebKit::VisitedLinkStore::sendStoreHandleToProcess):
211         (WebKit::VisitedLinkStore::didInvalidateSharedMemory):
212         (WebKit::VisitedLinkStore::didAddSharedStringHashes):
213         * UIProcess/VisitedLinkStore.h:
214         * UIProcess/WebProcessPool.cpp:
215         * UIProcess/WebProcessPool.h:
216         * UIProcess/WebProcessProxy.h:
217         * WebKit.xcodeproj/project.pbxproj:
218         * WebProcess/WebPage/VisitedLinkTableController.cpp:
219         (WebKit::VisitedLinkTableController::isLinkVisited):
220         (WebKit::VisitedLinkTableController::addVisitedLink):
221         (WebKit::VisitedLinkTableController::visitedLinkStateChanged):
222         * WebProcess/WebPage/VisitedLinkTableController.h:
223         * WebProcess/WebPage/VisitedLinkTableController.messages.in:
224
225 2017-09-28  Alex Christensen  <achristensen@webkit.org>
226
227         Add WKWebViewConfiguration SPI equivalent to WKPageConfigurationSetBackgroundCPULimit
228         https://bugs.webkit.org/show_bug.cgi?id=177644
229         <rdar://problem/34338698>
230
231         Reviewed by Geoffrey Garen.
232
233         WKPageConfigurationSetBackgroundCPULimit is a setter of a std::optional<double> with no accessor.
234         It's never set to 0 in practice, so I guess the ObjC equivalent is a double that is zero or nonzero.
235
236         * UIProcess/API/Cocoa/WKWebView.mm:
237         (-[WKWebView _initializeWithConfiguration:]):
238         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
239         (-[WKWebViewConfiguration _setCPULimit:]):
240         (-[WKWebViewConfiguration _cpuLimit]):
241         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
242
243 2017-09-28  Ryosuke Niwa  <rniwa@webkit.org>
244
245         Image pasting is not working on tineye.com / gmail.com / GitHub.com due to lack of support for DataTransfer.items
246         https://bugs.webkit.org/show_bug.cgi?id=170449
247         <rdar://problem/31432525>
248
249         Reviewed by Wenson Hsieh.
250
251         Add sandbox extensions for files in the pasteboard to make copying & pasting image files work.
252         This is what we do for drag & drop but we should consider adding a mechanism to rekoke the extension in the future.
253
254         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
255         (WebKit::WebPasteboardProxy::getPasteboardPathnamesForType): Add sandbox extensions to the pasted files.
256         * UIProcess/WebPasteboardProxy.h:
257         * UIProcess/WebPasteboardProxy.messages.in:
258         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
259         (WebKit::WebPlatformStrategies::getPathnamesForType): Consume the sandbox tokens sent by the UI process permanently
260         since WebCore will now create File objects for these pasted files.
261
262 2017-09-29  Wenson Hsieh  <wenson_hsieh@apple.com>
263
264         [iOS WK2] Implement -[WKContentView hasText] for compatibility with the UITextInput protocol
265         https://bugs.webkit.org/show_bug.cgi?id=177662
266         <rdar://problem/33410373>
267
268         Reviewed by Tim Horton.
269
270         Implements -[WKContentView hasText] by propagating a flag through post-layout editor state.
271
272         * Shared/EditorState.cpp:
273         (WebKit::EditorState::PostLayoutData::encode const):
274         (WebKit::EditorState::PostLayoutData::decode):
275         * Shared/EditorState.h:
276
277         Add a new flag to EditorState indicating whether or not the current editable root containing the selection has
278         any plain text. Add IPC support for this new flag.
279
280         * UIProcess/ios/WKContentViewInteraction.mm:
281         (-[WKContentView hasText]):
282         * WebProcess/WebPage/ios/WebPageIOS.mm:
283         (WebKit::computeEditableRootHasContentAndPlainText):
284
285         Add a new helper to compute whether or not the editable root has any content, and any plain text. This
286         is used as the last cached value for -hasText on WKContentView that we will deliver to UIKit. Some important
287         things to note here:
288         - If post layout data already indicates that we have selected some plain text, or that there is a plain text
289           character near the selection, just set the flags to true and bail, since the editable root necessarily has
290           content that is plain text.
291         - If hasContent is false, don't even bother computing hasPlainText, because it must also be false.
292         - Otherwise, use hasAnyPlainText to compute the value of hasPlainText, which is a faster variant of plainText.
293         These optimizations help us avoid doing extra work at all when running Speedometer, apart from checking the
294         values of a few PostLayoutData flags. This also fixes the value of hasContent, which was previously always false
295         if we had a range selection rather than a caret selection even when the editable root has content, because the
296         logic to compute the value of hasContent only existed in the branch where we have a caret selection.
297
298         (WebKit::WebPage::platformEditorState const):
299
300 2017-09-28  Timothy Horton  <timothy_horton@apple.com>
301
302         Fix the macOS CMake build
303
304         * CMakeLists.txt:
305
306 2017-09-28  Timothy Horton  <timothy_horton@apple.com>
307
308         Revise deployment target macros from r222620
309
310         Rubber-stamped by Wenson Hsieh.
311
312         * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h:
313         * WebProcess/Plugins/PDF/PDFPlugin.mm:
314         (WebKit::PDFPlugin::pdfDocumentDidLoad):
315
316 2017-09-28  Aishwarya Nirmal  <anirmal@apple.com>
317
318         Request for PDF URL targets for specific pages, sections, etc.
319         https://bugs.webkit.org/show_bug.cgi?id=177582
320         <rdar://problem/5692679>
321
322         Reviewed by Tim Horton.
323         
324         This change sets the URL fragment for scroll anchoring in PDFs.
325
326         * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h:
327         * WebProcess/Plugins/PDF/PDFPlugin.mm:
328         (WebKit::PDFPlugin::pdfDocumentDidLoad):
329
330 2017-09-28  Ross Kirsling  <ross.kirsling@sony.com>
331
332         [PAL] Move HysteresisActivity into PAL
333         https://bugs.webkit.org/show_bug.cgi?id=177516
334
335         Reviewed by Alex Christensen.
336
337         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
338         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::PendingFrameLoad):
339         * Shared/WebSQLiteDatabaseTracker.cpp:
340         (WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker):
341         (WebKit::WebSQLiteDatabaseTracker::hysteresisUpdated):
342         * Shared/WebSQLiteDatabaseTracker.h:
343         * WebProcess/WebPage/WebPage.cpp:
344         (WebKit::m_pageScrolledHysteresis):
345         (WebKit::m_userActivityHysteresis):
346         (WebKit::WebPage::updateUserActivity):
347         * WebProcess/WebPage/WebPage.h:
348         * WebProcess/WebProcess.cpp:
349         (WebKit::WebProcess::WebProcess):
350         * WebProcess/WebProcess.h:
351
352 2017-09-28  Chris Dumez  <cdumez@apple.com>
353
354         Add support for <link rel=preconnect>
355         https://bugs.webkit.org/show_bug.cgi?id=177474
356         <rdar://problem/33141380>
357
358         Reviewed by Alex Christensen.
359
360         Add support for <link rel=preconnect>:
361         - https://w3c.github.io/resource-hints/#preconnect
362
363         Also add corresponding native private API.
364
365         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
366         (WebKit::NetworkConnectionToWebProcess::preconnectTo):
367         (WebKit::NetworkConnectionToWebProcess::didFinishPreconnection):
368         * NetworkProcess/NetworkConnectionToWebProcess.h:
369         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
370         * NetworkProcess/NetworkDataTask.cpp:
371         (WebKit::NetworkDataTask::create):
372         * NetworkProcess/NetworkLoadParameters.h:
373         * NetworkProcess/NetworkProcess.cpp:
374         (WebKit::NetworkProcess::preconnectTo):
375         * NetworkProcess/NetworkProcess.h:
376         * NetworkProcess/NetworkProcess.messages.in:
377         * NetworkProcess/PreconnectTask.cpp: Added.
378         (WebKit::PreconnectTask::PreconnectTask):
379         (WebKit::PreconnectTask::~PreconnectTask):
380         (WebKit::PreconnectTask::willPerformHTTPRedirection):
381         (WebKit::PreconnectTask::didReceiveChallenge):
382         (WebKit::PreconnectTask::didReceiveResponseNetworkSession):
383         (WebKit::PreconnectTask::didReceiveData):
384         (WebKit::PreconnectTask::didCompleteWithError):
385         (WebKit::PreconnectTask::didSendData):
386         (WebKit::PreconnectTask::wasBlocked):
387         (WebKit::PreconnectTask::cannotShowURL):
388         (WebKit::PreconnectTask::didFinish):
389         * NetworkProcess/PreconnectTask.h: Copied from Source/WebKit/NetworkProcess/NetworkLoadParameters.h.
390         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
391         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
392         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
393         * Shared/WebCoreArgumentCoders.h:
394         * Shared/WebPreferencesDefinitions.h:
395         * UIProcess/API/C/WKContext.cpp:
396         (WKContextPreconnectToServer):
397         * UIProcess/API/C/WKContextPrivate.h:
398         * UIProcess/API/Cocoa/WKProcessPool.mm:
399         (-[WKProcessPool _preconnectToServer:]):
400         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
401         * UIProcess/WebProcessPool.cpp:
402         (WebKit::WebProcessPool::preconnectToServer):
403         * UIProcess/WebProcessPool.h:
404         * WebKit.xcodeproj/project.pbxproj:
405         * WebProcess/Network/NetworkProcessConnection.cpp:
406         (WebKit::NetworkProcessConnection::didFinishPreconnection):
407         * WebProcess/Network/NetworkProcessConnection.h:
408         * WebProcess/Network/NetworkProcessConnection.messages.in:
409         * WebProcess/Network/WebLoaderStrategy.cpp:
410         (WebKit::WebLoaderStrategy::networkProcessCrashed):
411         (WebKit::generateLoadIdentifier):
412         (WebKit::WebLoaderStrategy::startPingLoad):
413         (WebKit::WebLoaderStrategy::preconnectTo):
414         (WebKit::WebLoaderStrategy::didFinishPreconnection):
415         * WebProcess/Network/WebLoaderStrategy.h:
416         * WebProcess/WebPage/WebPage.cpp:
417         (WebKit::WebPage::updatePreferences):
418         * config.h:
419
420 2017-09-28  Zan Dobersek  <zdobersek@igalia.com>
421
422         [Cairo] Remove the cairo_glyph_t complexity from GlyphBuffer
423         https://bugs.webkit.org/show_bug.cgi?id=177598
424
425         Reviewed by Carlos Garcia Campos.
426
427         * Shared/API/c/cairo/WKImageCairo.cpp: Explicitly include the <cairo.h>
428         header here now that it's not included in GlyphBuffer.h.
429         * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp: Ditto.
430
431 2017-09-27  Alex Christensen  <achristensen@webkit.org>
432
433         Add WKContentRuleList notify action type
434         https://bugs.webkit.org/show_bug.cgi?id=177013
435         <rdar://problem/31073936>
436
437         Reviewed by Darin Adler.
438
439         * NetworkProcess/PingLoad.cpp:
440         (WebKit::PingLoad::processContentExtensionRulesForLoad):
441         * UIProcess/API/APINavigationClient.h:
442         (API::NavigationClient::contentRuleListNotification):
443         * UIProcess/API/C/WKPage.cpp:
444         (WKPageSetPageNavigationClient):
445         * UIProcess/API/C/WKPageNavigationClient.h:
446         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
447         * UIProcess/Cocoa/NavigationState.h:
448         * UIProcess/Cocoa/NavigationState.mm:
449         (WebKit::NavigationState::setNavigationDelegate):
450         (WebKit::NavigationState::NavigationClient::contentRuleListNotification):
451         * UIProcess/WebPageProxy.cpp:
452         (WebKit::WebPageProxy::contentRuleListNotification):
453         * UIProcess/WebPageProxy.h:
454         * UIProcess/WebPageProxy.messages.in:
455         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
456         (WebKit::WebChromeClient::contentRuleListNotification):
457         * WebProcess/WebCoreSupport/WebChromeClient.h:
458
459 2017-09-27  Wenson Hsieh  <wenson_hsieh@apple.com>
460
461         Drag event DataTransfer has unexpected types "dyn.ah62d4..."
462         https://bugs.webkit.org/show_bug.cgi?id=172526
463         <rdar://problem/32396081>
464
465         Reviewed by Ryosuke Niwa.
466
467         Add boilerplate plumbing and encoder/decoder support for new pasteboard codepaths. See WebCore ChangeLog for
468         more details.
469
470         * Scripts/webkit/messages.py:
471         (headers_for_type):
472         * Shared/WebCoreArgumentCoders.cpp:
473         (IPC::ArgumentCoder<PasteboardCustomData>::encode):
474         (IPC::ArgumentCoder<PasteboardCustomData>::decode):
475
476         Add encoder/decoder support for PasteboardCustomData.
477
478         (IPC::ArgumentCoder<PasteboardWebContent>::encode):
479         (IPC::ArgumentCoder<PasteboardWebContent>::decode):
480
481         Encode and decode dataInHTMLFormat.
482
483         * Shared/WebCoreArgumentCoders.h:
484         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
485         (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
486         (WebKit::WebPasteboardProxy::writeCustomData):
487         * UIProcess/WebPasteboardProxy.cpp:
488         (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
489         (WebKit::WebPasteboardProxy::writeCustomData):
490         * UIProcess/WebPasteboardProxy.h:
491         * UIProcess/WebPasteboardProxy.messages.in:
492         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
493         (WebKit::WebPlatformStrategies::typesSafeForDOMToReadAndWrite):
494         (WebKit::WebPlatformStrategies::writeCustomData):
495         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
496
497 2017-09-27  Alex Christensen  <achristensen@webkit.org>
498
499         Allow modern decoding of std::optional<T>
500         https://bugs.webkit.org/show_bug.cgi?id=177519
501
502         Reviewed by Tim Horton.
503
504         * Platform/IPC/ArgumentCoders.h:
505         (IPC::ArgumentCoder<std::optional<T>>::decode):
506         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
507         (IPC::ArgumentCoder<WebCore::PaymentAuthorizationResult>::decode):
508         (IPC::ArgumentCoder<WebCore::PaymentError>::decode):
509         (IPC::ArgumentCoder<WebCore::PaymentMethodUpdate>::decode):
510         (IPC::ArgumentCoder<WebCore::ShippingContactUpdate>::decode):
511         (IPC::ArgumentCoder<WebCore::ShippingMethodUpdate>::decode):
512         * Shared/WebCoreArgumentCoders.cpp:
513         (IPC::ArgumentCoder<IntPoint>::decode):
514         (IPC::ArgumentCoder<IntSize>::decode):
515         * Shared/WebCoreArgumentCoders.h:
516         * Shared/WebPageCreationParameters.cpp:
517         (WebKit::WebPageCreationParameters::decode):
518
519 2017-09-27  Commit Queue  <commit-queue@webkit.org>
520
521         Unreviewed, rolling out r222541.
522         https://bugs.webkit.org/show_bug.cgi?id=177580
523
524         WebCore isn't ready for the asynchronousness this was going to
525         enable (Requested by alexchristensen on #webkit).
526
527         Reverted changeset:
528
529         "Pass a completion handler instead of a
530         WebFramePolicyListenerProxy during policy decisions"
531         https://bugs.webkit.org/show_bug.cgi?id=177509
532         http://trac.webkit.org/changeset/222541
533
534 2017-09-27  Tina Liu  <iting_liu@apple.com>
535
536         Expose setShouldSuppressFirstResponderChanges() as WKView SPI
537         https://bugs.webkit.org/show_bug.cgi?id=177513
538         <rdar://problem/34669220>
539
540         Reviewed by Wenson Hsieh.
541
542         We already have setShouldSuppressFirstResponderChanges() SPI on WKWebView; Expose it on
543         WKView as well for clients using legacy WebKit.
544
545         * UIProcess/API/Cocoa/WKViewPrivate.h:
546         * UIProcess/API/mac/WKView.mm:
547         (-[WKView _setShouldSuppressFirstResponderChanges:]):
548
549 2017-09-27  Chris Dumez  <cdumez@apple.com>
550
551         Have PingLoad take a CompletionHandler
552         https://bugs.webkit.org/show_bug.cgi?id=177549
553
554         Reviewed by Youenn Fablet.
555
556         Have PingLoad take a CompletionHandler instead of relying on it calling on method on the
557         NetworkConnectionToWebProcess when it is done.
558
559         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
560         (WebKit::NetworkConnectionToWebProcess::loadPing):
561         * NetworkProcess/PingLoad.cpp:
562         (WebKit::PingLoad::PingLoad):
563         (WebKit::PingLoad::didFinish):
564         * NetworkProcess/PingLoad.h:
565
566 2017-09-26  Alex Christensen  <achristensen@webkit.org>
567
568         Pass a completion handler instead of a WebFramePolicyListenerProxy during policy decisions
569         https://bugs.webkit.org/show_bug.cgi?id=177509
570
571         Reviewed by Tim Horton.
572
573         This makes WebFramePolicyListenerProxy just a wrapper around a WTF::Function which is only needed for the C and glib APIs.
574         This is a step towards making WebPageProxy::DecidePolicyForResponseSync and WebPageProxy::DecidePolicyForNavigationAction asynchronous.
575
576         This patch has no change in behavior.
577
578         * CMakeLists.txt:
579         * UIProcess/API/APINavigationClient.h:
580         (API::NavigationClient::decidePolicyForNavigationAction):
581         (API::NavigationClient::decidePolicyForNavigationResponse):
582         * UIProcess/API/APIPolicyClient.h:
583         (API::PolicyClient::decidePolicyForNavigationAction):
584         (API::PolicyClient::decidePolicyForNewWindowAction):
585         (API::PolicyClient::decidePolicyForResponse):
586         * UIProcess/API/C/WKFramePolicyListener.cpp:
587         (WKFramePolicyListenerUseWithPolicies):
588         * UIProcess/API/C/WKPage.cpp:
589         (WKPageSetPagePolicyClient):
590         (WKPageSetPageNavigationClient):
591         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
592         * UIProcess/API/glib/WebKitPolicyClient.cpp:
593         * UIProcess/Automation/WebAutomationSession.cpp:
594         * UIProcess/Cocoa/NavigationState.h:
595         * UIProcess/Cocoa/NavigationState.mm:
596         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
597         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):
598         * UIProcess/Cocoa/WebViewImpl.mm:
599         * UIProcess/RemoteWebInspectorProxy.cpp:
600         * UIProcess/WebFormSubmissionListenerProxy.h:
601         * UIProcess/WebFrameListenerProxy.cpp: Removed.
602         * UIProcess/WebFrameListenerProxy.h: Removed.
603         * UIProcess/WebFramePolicyListenerProxy.cpp:
604         (WebKit::WebFramePolicyListenerProxy::WebFramePolicyListenerProxy):
605         (WebKit::WebFramePolicyListenerProxy::~WebFramePolicyListenerProxy):
606         (WebKit::WebFramePolicyListenerProxy::create):
607         (WebKit::WebFramePolicyListenerProxy::use):
608         (WebKit::WebFramePolicyListenerProxy::download):
609         (WebKit::WebFramePolicyListenerProxy::ignore):
610         * UIProcess/WebFramePolicyListenerProxy.h:
611         (WebKit::WebFramePolicyListenerProxy::create): Deleted.
612         (): Deleted.
613         (WebKit::WebFramePolicyListenerProxy::operator new): Deleted.
614         * UIProcess/WebFrameProxy.cpp:
615         (WebKit::WebFrameProxy::webProcessWillShutDown):
616         (WebKit::WebFrameProxy::receivedPolicyDecision): Deleted.
617         (WebKit::WebFrameProxy::setUpPolicyListenerProxy): Deleted.
618         * UIProcess/WebFrameProxy.h:
619         * UIProcess/WebInspectorProxy.cpp:
620         * UIProcess/WebPageProxy.cpp:
621         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
622         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
623         (WebKit::WebPageProxy::decidePolicyForResponseSync):
624         (WebKit::WebPageProxy::receivedPolicyDecision): Deleted.
625         (WebKit::WebPageProxy::decidePolicyForResponse): Deleted.
626         * UIProcess/WebPageProxy.h:
627         * UIProcess/mac/ViewGestureControllerMac.mm:
628         * WebKit.xcodeproj/project.pbxproj:
629
630 2017-09-26  Brian Burg  <bburg@apple.com>
631
632         Web Automation: overflow:hidden elements with no children are mistakenly reported as not visible
633         https://bugs.webkit.org/show_bug.cgi?id=177514
634         <rdar://problem/31936291>
635
636         Reviewed by Joseph Pecoraro.
637
638         * UIProcess/Automation/atoms/ElementDisplayed.js:
639         (isShown.isElementSubtreeHiddenByOverflow):
640         Array.prototype.every returns true when passed an empty list, so we need
641         to check for the case where the element has no children and return 'false'.
642
643 2017-09-26  Youenn Fablet  <youenn@apple.com>
644
645         [Cocoa] Add a modern WKPreferences switch to disable WebRTC
646         https://bugs.webkit.org/show_bug.cgi?id=176638
647         <rdar://problem/34335158>
648
649         Reviewed by Alex Christensen.
650
651         * UIProcess/API/Cocoa/WKPreferences.mm:
652         (-[WKPreferences _peerConnectionEnabled]):
653         (-[WKPreferences _setPeerConnectionEnabled:]):
654         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
655
656 2017-09-26  Brent Fulgham  <bfulgham@apple.com>
657
658         Harden our access to the vector of URL schemes.
659         https://bugs.webkit.org/show_bug.cgi?id=177470
660         <rdar://problem/33881522>
661
662         Reviewed by Chris Dumez.
663
664         Instead of asserting, use MESSAGE_CHECK so that we actually refuse to access an invalid iterator.
665
666         * UIProcess/WebPageProxy.cpp:
667         (WebKit::WebPageProxy::startURLSchemeTask):
668         (WebKit::WebPageProxy::stopURLSchemeTask):
669
670 2017-09-26  Jer Noble  <jer.noble@apple.com>
671
672         Thrown ObjC exception when right clicking on <img> containing mp4 link
673         https://bugs.webkit.org/show_bug.cgi?id=177370
674
675         Reviewed by Darin Adler.
676
677         Creating a NSImage from mp4 data will fail and return nil; do a nil-check before attempting
678         to put the results into a NSMutableArray.
679
680         * UIProcess/mac/WebContextMenuProxyMac.mm:
681         (WebKit::WebContextMenuProxyMac::createShareMenuItem):
682
683 2017-09-26  Brian Burg  <bburg@apple.com>
684
685         Web Automation: add commands to get and set user permissions for pages in an automation session
686         https://bugs.webkit.org/show_bug.cgi?id=177405
687         <rdar://problem/34493846>
688
689         Reviewed by Joseph Pecoraro.
690
691         To test some Web APIs via WebDriver, it needs to be possible to simulate a user accepting or
692         denying requests for elevated permissions, such as getUserMedia() or geolocation.
693
694         This patch adds a generic way for a test to configure the automation session's
695         simulated user action that will happen every time a specific permission is requested.
696         A test can set a "session permission", trigger the permission request via Web API,
697         and then verify that the page behaves correctly when the user accepted or denied the request.
698
699         A proposal will follow shortly to expose this functionality via a new REST API endpoint.
700
701         * UIProcess/Automation/Automation.json: Add get/set commands.
702
703         * UIProcess/Automation/WebAutomationSession.cpp:
704         (WebKit::WebAutomationSession::getSessionPermissions):
705         (WebKit::WebAutomationSession::setSessionPermissions):
706         For now, store the permission value in a member of the session. The getUserMedia
707         permission only needs a bool, but there is no reason we couldn't use more complicated
708         values for permissions (i.e., strings, numbers, arrays, objects) someday.
709
710         (WebKit::WebAutomationSession::shouldAllowGetUserMediaForPage const):
711         Expose the specific decision to be taken based on whether the request is allowed or denied.
712
713         * UIProcess/Automation/WebAutomationSession.h:
714         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
715         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
716         If the page is under automation, then simulate the user action according to the
717         current values of permissions set for the session.
718
719 2017-09-25  Alex Christensen  <achristensen@webkit.org>
720
721         Make PolicyAction an encodable enum class
722         https://bugs.webkit.org/show_bug.cgi?id=177480
723
724         Reviewed by Antti Koivisto.
725
726         * NetworkProcess/Downloads/DownloadManager.cpp:
727         (WebKit::DownloadManager::continueDecidePendingDownloadDestination):
728         (WebKit::DownloadManager::cancelDownload):
729         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
730         (WebKit::NetworkCORSPreflightChecker::didReceiveResponseNetworkSession):
731         * NetworkProcess/NetworkDataTask.cpp:
732         (WebKit::NetworkDataTask::didReceiveResponse):
733         * NetworkProcess/NetworkDataTaskBlob.cpp:
734         (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse):
735         * NetworkProcess/NetworkLoad.cpp:
736         (WebKit::NetworkLoad::~NetworkLoad):
737         (WebKit::NetworkLoad::continueDidReceiveResponse):
738         (WebKit::NetworkLoad::notifyDidReceiveResponse):
739         * NetworkProcess/PingLoad.cpp:
740         (WebKit::PingLoad::didReceiveResponseNetworkSession):
741         * NetworkProcess/capture/NetworkDataTaskReplay.cpp:
742         (WebKit::NetworkCapture::NetworkDataTaskReplay::didReceiveResponse):
743         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
744         (toNSURLSessionResponseDisposition):
745         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
746         (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse):
747         * Scripts/webkit/messages.py:
748         (headers_for_type):
749         * UIProcess/WebFormSubmissionListenerProxy.h:
750         * UIProcess/WebFrameListenerProxy.h:
751         (WebKit::WebFrameListenerProxy::navigation): Deleted.
752         * UIProcess/WebFramePolicyListenerProxy.cpp:
753         (WebKit::WebFramePolicyListenerProxy::use):
754         (WebKit::WebFramePolicyListenerProxy::download):
755         (WebKit::WebFramePolicyListenerProxy::ignore):
756         * UIProcess/WebPageProxy.cpp:
757         (WebKit::WebPageProxy::receivedPolicyDecision):
758         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
759         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
760         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
761         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
762         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
763         * WebProcess/WebPage/WebFrame.cpp:
764         (WebKit::WebFrame::invalidatePolicyListener):
765         * WebProcess/WebPage/WebPage.cpp:
766         (WebKit::WebPage::didReceivePolicyDecision):
767         * WebProcess/WebPage/WebPage.h:
768         * WebProcess/WebPage/WebPage.messages.in:
769
770 2017-09-25  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
771
772         [WinCairo] Share default value of font family preferences among non-cocoa builds
773         https://bugs.webkit.org/show_bug.cgi?id=177479
774
775         Reviewed by Yusuke Suzuki.
776
777         * Shared/WebPreferencesDefinitions.h:
778
779 2017-09-25  Frederik Riedel  <riedel@apple.com>
780
781         Expose way to set values of classified form controls as {Legacy WebKit, WebKit} SPI
782         https://bugs.webkit.org/show_bug.cgi?id=174394
783         <rdar://problem/33183504>
784
785         Reviewed by Ryosuke Niwa.
786
787         * Platform/spi/ios/UIKitSPI.h:
788         * Shared/AssistedNodeInformation.cpp:
789         (WebKit::AssistedNodeInformation::encode const):
790         Encodes additional node information, including if the node is part of a login screen.
791         (WebKit::AssistedNodeInformation::decode):
792         Decodes the additional assisted node information.
793         * Shared/AssistedNodeInformation.h:
794         * UIProcess/WebPageProxy.h:
795         * UIProcess/ios/WKContentView.mm:
796         (-[WKContentView acceptsAutofilledLoginCredentials]):
797         Determines if the WKContentView shows a login screen.
798         (-[WKContentView representingPageUrl]):
799         Returns the URL of the currently displayed web page.
800         * UIProcess/ios/WKContentViewInteraction.mm:
801         (-[WKContentView insertTextSuggestion:]):
802         Inserts the login credentials into the Web View.
803         * UIProcess/ios/WebPageProxyIOS.mm:
804         (WebKit::WebPageProxy::startAssistingNode):
805         Transfer the additional assistednode information (acceptsAutofilledLoginCredentials and representingPageUrl).
806         (WebKit::WebPageProxy::acceptsAutofilledLoginCredentials):
807         Returns if the Web View shows a login screen.
808         (WebKit::WebPageProxy::representingPageUrl):
809         Returns the Web View's URL.
810         (WebKit::WebPageProxy::autofillLoginCredentials):
811         Insert the credentials into the Web View.
812         * WebProcess/WebPage/WebPage.h:
813         * WebProcess/WebPage/WebPage.messages.in:
814         * WebProcess/WebPage/ios/WebPageIOS.mm:
815         (WebKit::WebPage::getAssistedNodeInformation): Transports the information if the currently
816         highlighted node accepts autofilled login credentials.
817         (WebKit::WebPage::autofillLoginCredentials): Fills the login credentials into the
818         WebPage.
819
820 2017-09-25  Youenn Fablet  <youenn@apple.com>
821
822         WebRTC video does not resume receiving when switching back to Safari 11 on iOS
823         https://bugs.webkit.org/show_bug.cgi?id=175472
824         <rdar://problem/33860863>
825
826         Reviewed by Darin Adler.
827
828         Notifying LibWebRTC of backgrounding/foregrouding.
829
830         * WebProcess/WebPage/ios/WebPageIOS.mm:
831         (WebKit::WebPage::applicationDidEnterBackground):
832         (WebKit::WebPage::applicationWillEnterForeground):
833
834 2017-09-25  Sam Weinig  <sam@webkit.org>
835
836         Remove unused EditorClient functions
837         https://bugs.webkit.org/show_bug.cgi?id=177463
838
839         Reviewed by Alex Christensen.
840
841         Remove unused EditorClient functions.
842
843         * WebProcess/WebCoreSupport/WebEditorClient.h:
844         * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
845         (WebKit::WebEditorClient::canonicalizeURL): Deleted.
846         (WebKit::WebEditorClient::canonicalizeURLString): Deleted.
847         (WebKit::WebEditorClient::writeDataToPasteboard): Deleted.
848         (WebKit::WebEditorClient::supportedPasteboardTypesForCurrentSelection): Deleted.
849         (WebKit::WebEditorClient::readDataFromPasteboard): Deleted.
850         (WebKit::WebEditorClient::pasteboardChangeCount): Deleted.
851         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
852         (WebKit::WebEditorClient::canonicalizeURL): Deleted.
853         (WebKit::WebEditorClient::canonicalizeURLString): Deleted.
854
855 2017-09-25  Alex Christensen  <achristensen@webkit.org>
856
857         Make Attribute an enum class
858         https://bugs.webkit.org/show_bug.cgi?id=177414
859
860         Reviewed by Yusuke Suzuki.
861
862         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
863         (WebKit::JSNPObject::getOwnPropertySlot):
864
865 2017-09-25  Alex Christensen  <achristensen@webkit.org>
866
867         Stop using PolicyCallback
868         https://bugs.webkit.org/show_bug.cgi?id=176088
869
870         Reviewed by Andy Estes.
871
872         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
873         * WebProcess/WebPage/WebFrame.cpp:
874         (WebKit::WebFrame::invalidatePolicyListener):
875         * WebProcess/WebPage/WebFrame.h:
876         * WebProcess/WebPage/WebInspector.cpp:
877
878 2017-09-25  Chris Dumez  <cdumez@apple.com>
879
880         [WK2] Add API to query if a download was user-initiated
881         https://bugs.webkit.org/show_bug.cgi?id=177435
882         <rdar://problem/34498422>
883
884         Reviewed by Alex Christensen.
885
886         Add C and Cocoa private API to query if a download was user-initiated.
887
888         For clarity, we now construct navigation object for subframe loads
889         as well (we used to do so only for main frame loads). This allows us
890         to store the user-intiated flag and the redirect chain on the navigation
891         object instead of the WebFrameProxy.
892
893         * UIProcess/API/APINavigation.cpp:
894         (API::Navigation::Navigation):
895         (API::Navigation::appendRedirectionURL):
896         * UIProcess/API/APINavigation.h:
897         (API::Navigation::takeRedirectChain):
898         (API::Navigation::setWasUserInitiated):
899         (API::Navigation::wasUserInitiated const):
900         * UIProcess/API/C/WKDownload.cpp:
901         (WKDownloadGetWasUserInitiated):
902         * UIProcess/API/C/WKDownload.h:
903         * UIProcess/API/Cocoa/_WKDownload.h:
904         * UIProcess/API/Cocoa/_WKDownload.mm:
905         (-[_WKDownload wasUserInitiated]):
906         * UIProcess/Downloads/DownloadProxy.h:
907         (WebKit::DownloadProxy::setWasUserInitiated):
908         (WebKit::DownloadProxy::wasUserInitiated const):
909         * UIProcess/WebFrameProxy.cpp:
910         (WebKit::WebFrameProxy::didStartProvisionalLoad):
911         (WebKit::WebFrameProxy::didReceiveServerRedirectForProvisionalLoad):
912         (WebKit::WebFrameProxy::didFailProvisionalLoad):
913         (WebKit::WebFrameProxy::didFinishLoad):
914         (WebKit::WebFrameProxy::didFailLoad):
915         * UIProcess/WebFrameProxy.h:
916         (WebKit::WebFrameProxy::title const):
917         * UIProcess/WebPageProxy.cpp:
918         (WebKit::WebPageProxy::receivedPolicyDecision):
919         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
920         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
921         (WebKit::WebPageProxy::decidePolicyForResponse):
922         (WebKit::WebPageProxy::decidePolicyForResponseSync):
923         * UIProcess/WebPageProxy.h:
924         * UIProcess/WebPageProxy.messages.in:
925         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
926         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
927
928 2017-09-25  Chris Dumez  <cdumez@apple.com>
929
930         Make StoredCredentials an enum class and rename its header
931         https://bugs.webkit.org/show_bug.cgi?id=177455
932
933         Reviewed by Youenn Fablet.
934
935         Make StoredCredentials an enum class and rename its header for clarity. This was error-prone because 0 meant
936         "allow" and and 1 meant "do not allow". It was trivial to convert it to a boolean by mistake and get the
937         opposite behavior.
938
939         * NetworkProcess/Downloads/DownloadManager.cpp:
940         (WebKit::DownloadManager::startDownload):
941         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
942         (WebKit::NetworkCORSPreflightChecker::didCompleteWithError):
943         * NetworkProcess/NetworkCORSPreflightChecker.h:
944         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
945         (WebKit::NetworkConnectionToWebProcess::loadPing):
946         * NetworkProcess/NetworkDataTask.cpp:
947         (WebKit::NetworkDataTask::create):
948         (WebKit::NetworkDataTask::NetworkDataTask):
949         * NetworkProcess/NetworkDataTask.h:
950         * NetworkProcess/NetworkDataTaskBlob.cpp:
951         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
952         * NetworkProcess/NetworkLoad.cpp:
953         (WebKit::NetworkLoad::shouldUseCredentialStorage):
954         * NetworkProcess/NetworkLoadParameters.h:
955         * NetworkProcess/NetworkResourceLoadParameters.cpp:
956         (WebKit::NetworkResourceLoadParameters::encode const):
957         (WebKit::NetworkResourceLoadParameters::decode):
958         * NetworkProcess/PingLoad.cpp:
959         (WebKit::PingLoad::willPerformHTTPRedirection):
960         (WebKit::PingLoad::makeCrossOriginAccessRequest):
961         (WebKit::PingLoad::makeSimpleCrossOriginAccessRequest):
962         (WebKit::PingLoad::makeCrossOriginAccessRequestWithPreflight):
963         (WebKit::PingLoad::preflightSuccess):
964         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
965         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
966         * NetworkProcess/capture/NetworkDataTaskReplay.cpp:
967         (WebKit::NetworkCapture::NetworkDataTaskReplay::NetworkDataTaskReplay):
968         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
969         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
970         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
971         (WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa):
972         (WebKit::NetworkDataTaskCocoa::tryPasswordBasedAuthentication):
973         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
974         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
975         (-[WKNetworkSessionDelegate existingTask:]):
976         (WebKit::NetworkSessionCocoa::dataTaskForIdentifier):
977         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
978         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
979         (WebKit::NetworkDataTaskSoup::createRequest):
980         (WebKit::NetworkDataTaskSoup::authenticate):
981         (WebKit::NetworkDataTaskSoup::continueAuthenticate):
982         (WebKit::NetworkDataTaskSoup::continueHTTPRedirection):
983         * NetworkProcess/soup/NetworkDataTaskSoup.h:
984         * WebProcess/Network/WebLoaderStrategy.cpp:
985         (WebKit::WebLoaderStrategy::scheduleLoad):
986         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
987         (WebKit::WebLoaderStrategy::startPingLoad):
988         * WebProcess/Network/WebLoaderStrategy.h:
989
990 2017-09-25  Sam Weinig  <sam@webkit.org>
991
992         Remove unnecessary userVisibleString EditorClient function
993         https://bugs.webkit.org/show_bug.cgi?id=177456
994
995         Reviewed by Dan Bernstein.
996
997         * WebProcess/WebCoreSupport/WebEditorClient.h:
998         * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
999         (WebKit::WebEditorClient::userVisibleString): Deleted.
1000         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
1001         (WebKit::WebEditorClient::userVisibleString): Deleted.
1002
1003             Remove userVisibleString client function.
1004
1005 2017-09-25  Commit Queue  <commit-queue@webkit.org>
1006
1007         Unreviewed, rolling out r222455.
1008         https://bugs.webkit.org/show_bug.cgi?id=177460
1009
1010         broke iOS build (Requested by alexchristensen on #webkit).
1011
1012         Reverted changeset:
1013
1014         "Add WKContentRuleList notify action type"
1015         https://bugs.webkit.org/show_bug.cgi?id=177013
1016         http://trac.webkit.org/changeset/222455
1017
1018 2017-09-25  Alex Christensen  <achristensen@webkit.org>
1019
1020         Separate form submission from PolicyChecker infrastructure
1021         https://bugs.webkit.org/show_bug.cgi?id=177396
1022
1023         Reviewed by Geoffrey Garen.
1024
1025         * UIProcess/API/APIFormClient.h:
1026         (API::FormClient::willSubmitForm):
1027         * UIProcess/API/Cocoa/WKWebView.mm:
1028         (-[WKWebView _setInputDelegate:]):
1029         * UIProcess/WebFormClient.cpp:
1030         (WebKit::WebFormClient::willSubmitForm):
1031         * UIProcess/WebFormClient.h:
1032         * UIProcess/WebFormSubmissionListenerProxy.cpp:
1033         (WebKit::WebFormSubmissionListenerProxy::continueSubmission):
1034         (WebKit::WebFormSubmissionListenerProxy::WebFormSubmissionListenerProxy): Deleted.
1035         * UIProcess/WebFormSubmissionListenerProxy.h:
1036         (WebKit::WebFormSubmissionListenerProxy::create):
1037         (WebKit::WebFormSubmissionListenerProxy::WebFormSubmissionListenerProxy):
1038         (): Deleted.
1039         (WebKit::WebFormSubmissionListenerProxy::operator new): Deleted.
1040         * UIProcess/WebFrameProxy.cpp:
1041         (WebKit::WebFrameProxy::setUpFormSubmissionListenerProxy): Deleted.
1042         * UIProcess/WebFrameProxy.h:
1043         * UIProcess/WebPageProxy.cpp:
1044         (WebKit::WebPageProxy::willSubmitForm):
1045         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1046         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
1047         (WebKit::WebFrameLoaderClient::dispatchWillSubmitForm):
1048         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1049         * WebProcess/WebPage/WebFrame.cpp:
1050         (WebKit::WebFrame::setUpWillSubmitFormListener):
1051         (WebKit::WebFrame::continueWillSubmitForm):
1052         * WebProcess/WebPage/WebFrame.h:
1053         * WebProcess/WebPage/WebPage.cpp:
1054         (WebKit::WebPage::continueWillSubmitForm):
1055         * WebProcess/WebPage/WebPage.h:
1056         * WebProcess/WebPage/WebPage.messages.in:
1057
1058 2017-09-25  Alex Christensen  <achristensen@webkit.org>
1059
1060         Add WKContentRuleList notify action type
1061         https://bugs.webkit.org/show_bug.cgi?id=177013
1062         <rdar://problem/31073936>
1063
1064         Reviewed by Darin Adler.
1065
1066         * NetworkProcess/PingLoad.cpp:
1067         (WebKit::PingLoad::processContentExtensionRulesForLoad):
1068         * UIProcess/API/APINavigationClient.h:
1069         (API::NavigationClient::contentRuleListNotification):
1070         * UIProcess/API/C/WKPage.cpp:
1071         (WKPageSetPageNavigationClient):
1072         * UIProcess/API/C/WKPageNavigationClient.h:
1073         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
1074         * UIProcess/Cocoa/NavigationState.h:
1075         * UIProcess/Cocoa/NavigationState.mm:
1076         (WebKit::NavigationState::setNavigationDelegate):
1077         (WebKit::NavigationState::NavigationClient::contentRuleListNotification):
1078         * UIProcess/WebPageProxy.cpp:
1079         (WebKit::WebPageProxy::contentRuleListNotification):
1080         * UIProcess/WebPageProxy.h:
1081         * UIProcess/WebPageProxy.messages.in:
1082         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1083         (WebKit::WebChromeClient::contentRuleListNotification):
1084         * WebProcess/WebCoreSupport/WebChromeClient.h:
1085
1086 2017-09-25  Timothy Horton  <timothy_horton@apple.com>
1087
1088         Make progress on getting Mac CMake building again
1089         https://bugs.webkit.org/show_bug.cgi?id=177443
1090
1091         Unreviewed, just "fixing" the build.
1092
1093         * PlatformMac.cmake:
1094         Add some missing files and include paths.
1095
1096 2017-09-24  Michael Catanzaro  <mcatanzaro@igalia.com>
1097
1098         Viewport fit is no longer experimental
1099         https://bugs.webkit.org/show_bug.cgi?id=177417
1100
1101         Reviewed by Darin Adler.
1102
1103         * Shared/WebPreferencesDefinitions.h:
1104
1105 2017-09-24  Michael Catanzaro  <mcatanzaro@igalia.com>
1106
1107         [GTK] Unreviewed, move webkit_hit_test_result_context_is_scrollbar in documentation
1108
1109         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
1110
1111 2017-09-24  Michael Catanzaro  <mcatanzaro@igalia.com>
1112
1113         Alphabetize experimental features list
1114         https://bugs.webkit.org/show_bug.cgi?id=177374
1115
1116         Reviewed by Darin Adler.
1117
1118         * Shared/WebPreferencesDefinitions.h:
1119
1120 2017-09-24  Zan Dobersek  <zdobersek@igalia.com>
1121
1122         [WebKit] Changing EME setting through InjectedBundle should update WebPreferencesStore
1123         https://bugs.webkit.org/show_bug.cgi?id=177312
1124
1125         Reviewed by Carlos Garcia Campos.
1126
1127         When enabling EME through the InjectedBundle for testing purposes, it's
1128         only enabled in RuntimeEnabledFeatures, but not in WebPreferencesStore.
1129         This causes failures on imported W3C tests that cover EME persistent
1130         state licenses and perform parts of that test in a new window, where
1131         the original RuntimeEnabledFeatures state doesn't have any effect.
1132
1133         To avoid those failures, when enabling EME feature for testing purposes
1134         through InjectedBundle, the feature should also be enabled in the
1135         WebPreferencesStore.
1136
1137         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1138         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1139
1140 2017-09-22  Zalan Bujtas  <zalan@apple.com>
1141
1142         WeakPtrFactory should populate m_ref lazily.
1143         https://bugs.webkit.org/show_bug.cgi?id=177375
1144
1145         Reviewed by Geoffrey Garen.
1146
1147         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
1148         (WebKit::WebPaymentCoordinatorProxy::WebPaymentCoordinatorProxy):
1149         (WebKit::WebPaymentCoordinatorProxy::canMakePaymentsWithActiveCard):
1150         (WebKit::WebPaymentCoordinatorProxy::openPaymentSetup):
1151         * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
1152         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
1153         * UIProcess/ApplicationStateTracker.mm:
1154         (WebKit::ApplicationStateTracker::ApplicationStateTracker):
1155         * UIProcess/Cocoa/WebViewImpl.h:
1156         (WebKit::WebViewImpl::createWeakPtr):
1157         * UIProcess/Cocoa/WebViewImpl.mm:
1158         (WebKit::WebViewImpl::WebViewImpl):
1159         * UIProcess/Launcher/ProcessLauncher.cpp:
1160         (WebKit::ProcessLauncher::ProcessLauncher):
1161         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1162         (WebKit::ProcessLauncher::launchProcess):
1163         * UIProcess/ProcessAssertion.h:
1164         (WebKit::ProcessAssertion::createWeakPtr):
1165         * UIProcess/WebPageProxy.cpp:
1166         (WebKit::m_configurationPreferenceValues):
1167         (WebKit::m_weakPtrFactory): Deleted.
1168         * UIProcess/WebPageProxy.h:
1169         (WebKit::WebPageProxy::createWeakPtr const):
1170         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
1171         (WebKit::RemoteLayerTreeDrawingArea::createWeakPtr):
1172         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
1173         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
1174
1175 2017-09-22  John Wilander  <wilander@apple.com>
1176
1177         Re-enable configuration.HTTPCookieStorage on session without credentials
1178         https://bugs.webkit.org/show_bug.cgi?id=177393
1179
1180         This patch rolls back the crucial change to the network session
1181         without credentials that landed in r221632:
1182         <http://trac.webkit.org/changeset/221632>
1183
1184         Reviewed by Brent Fulgham.
1185
1186         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1187         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1188             Commented out the disabled cookie jar and added a FIXME
1189             referring to https://bugs.webkit.org/show_bug.cgi?id=177394.
1190
1191 2017-09-22  Chris Dumez  <cdumez@apple.com>
1192
1193         Enable File and Directory Entries API at runtime
1194         https://bugs.webkit.org/show_bug.cgi?id=176616
1195         <rdar://problem/34330942>
1196
1197         Reviewed by Geoffrey Garen.
1198
1199         Enable File and Directory Entries API at runtime on Mac/WebKit2,
1200         now that DataTransfer.items is enabled there.
1201
1202         * Shared/WebPreferencesDefinitions.h:
1203
1204 2017-09-22  Matt Lewis  <jlewis3@apple.com>
1205
1206         Unreviewed, rolling out r222394.
1207
1208         This broke the Windows Debug Build.
1209
1210         Reverted changeset:
1211
1212         "Remove build-webkit's notion of feature flags having a
1213         default value"
1214         https://bugs.webkit.org/show_bug.cgi?id=177338
1215         http://trac.webkit.org/changeset/222394
1216
1217 2017-09-22  John Wilander  <wilander@apple.com>
1218
1219         Non-prevalent resources should be allowed access to existing cookies in a third-party context
1220         https://bugs.webkit.org/show_bug.cgi?id=177336
1221         <rdar://problem/34578257>
1222
1223         Reviewed by Brent Fulgham.
1224
1225         This patch restructures what is communicated to the network process,
1226         from two vectors - with user interaction and without user interaction -
1227         to three vectors - to partition, to block, to neither partition nor block.
1228         The previous two vectors did not allow proper categorization into which
1229         domains should be partitioned, blocked, or left alone. That was the cause
1230         of the regression where non-prevalent third-party domains erroneously had
1231         their cookies blocked when they should fall back to the old behavior of
1232         access but no new cookies allowed to be set.
1233
1234         * NetworkProcess/NetworkProcess.cpp:
1235         (WebKit::NetworkProcess::updatePrevalentDomainsToPartitionOrBlockCookies):
1236         (WebKit::NetworkProcess::updatePrevalentDomainsWithAndWithoutInteraction): Deleted.
1237         * NetworkProcess/NetworkProcess.h:
1238         * NetworkProcess/NetworkProcess.messages.in:
1239         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1240         (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:]):
1241         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1242         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
1243         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
1244         (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains):
1245         (WebKit::WebResourceLoadStatisticsStore::clearInMemory):
1246         (WebKit::WebResourceLoadStatisticsStore::shouldPartitionCookies const):
1247         (WebKit::WebResourceLoadStatisticsStore::shouldBlockCookies const):
1248         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
1249         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
1250         (WebKit::WebResourceLoadStatisticsStore::clearPartitioningStateForDomains):
1251         (WebKit::WebResourceLoadStatisticsStore::resetCookiePartitioningState):
1252         * UIProcess/WebResourceLoadStatisticsStore.h:
1253         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1254         (WebKit::WebsiteDataStore::updatePrevalentDomainsToPartitionOrBlockCookies):
1255         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
1256         (WebKit::WebsiteDataStore::updatePrevalentDomainsWithAndWithoutInteraction): Deleted.
1257         * UIProcess/WebsiteData/WebsiteDataStore.h:
1258
1259 2017-09-22  Tim Horton <timothy_horton@apple.com> and Michael Catanzaro <mcatanzaro@igalia.com>
1260
1261         Remove build-webkit's notion of feature flags having a default value
1262         https://bugs.webkit.org/show_bug.cgi?id=177338
1263
1264         Reviewed by Alex Christensen.
1265
1266         Use ENABLE_EXPERIMENTAL_FEATURES instead of ENABLE_DEVELOPER_MODE to enable runtime
1267         experimental features.
1268
1269         * Shared/WebPreferencesDefinitions.h:
1270
1271 2017-09-22  Chris Dumez  <cdumez@apple.com>
1272
1273         Use high resolution timestamp for event time
1274         https://bugs.webkit.org/show_bug.cgi?id=154246
1275         <rdar://problem/34333304>
1276
1277         Reviewed by Ryosuke Niwa.
1278
1279         Use WallTime / MonotonicTime instead of double type for clarity.
1280
1281         * Shared/WebCoreArgumentCoders.cpp:
1282         (IPC::ArgumentCoder<WallTime>::encode):
1283         (IPC::ArgumentCoder<WallTime>::decode):
1284         * Shared/WebCoreArgumentCoders.h:
1285         * Shared/WebEvent.cpp:
1286         (WebKit::WebEvent::WebEvent):
1287         * Shared/WebEvent.h:
1288         (WebKit::WebEvent::timestamp const):
1289         (WebKit::WebTouchEvent::WebTouchEvent):
1290         * Shared/WebKeyboardEvent.cpp:
1291         (WebKit::WebKeyboardEvent::WebKeyboardEvent):
1292         * Shared/WebMouseEvent.cpp:
1293         (WebKit::WebMouseEvent::WebMouseEvent):
1294         * Shared/WebTouchEvent.cpp:
1295         (WebKit::WebTouchEvent::WebTouchEvent):
1296         * Shared/WebWheelEvent.cpp:
1297         (WebKit::WebWheelEvent::WebWheelEvent):
1298         * Shared/gtk/WebEventFactory.cpp:
1299         (WebKit::WebEventFactory::createWebMouseEvent):
1300         (WebKit::WebEventFactory::createWebWheelEvent):
1301         (WebKit::WebEventFactory::createWebKeyboardEvent):
1302         (WebKit::WebEventFactory::createWebTouchEvent):
1303         * Shared/ios/NativeWebTouchEventIOS.mm:
1304         (WebKit::NativeWebTouchEvent::NativeWebTouchEvent):
1305         * Shared/ios/WebIOSEventFactory.mm:
1306         (WebIOSEventFactory::createWebKeyboardEvent):
1307         * Shared/mac/NativeWebGestureEventMac.mm:
1308         (WebKit::NativeWebGestureEvent::NativeWebGestureEvent):
1309         * Shared/mac/WebEventFactory.mm:
1310         (WebKit::WebEventFactory::createWebMouseEvent):
1311         (WebKit::WebEventFactory::createWebWheelEvent):
1312         (WebKit::WebEventFactory::createWebKeyboardEvent):
1313         * Shared/mac/WebGestureEvent.h:
1314         (WebKit::WebGestureEvent::WebGestureEvent):
1315         * Shared/wpe/WebEventFactory.cpp:
1316         (WebKit::WebEventFactory::createWebKeyboardEvent):
1317         (WebKit::WebEventFactory::createWebMouseEvent):
1318         (WebKit::WebEventFactory::createWebWheelEvent):
1319         (WebKit::WebEventFactory::createWebTouchEvent):
1320         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1321         (WKBundlePageSimulateMouseDown):
1322         (WKBundlePageSimulateMouseUp):
1323         (WKBundlePageSimulateMouseMotion):
1324         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1325         (WebKit::PDFPlugin::showContextMenuAtPoint):
1326         * WebProcess/Plugins/PluginView.cpp:
1327         (WebKit::PluginView::createWebEvent const):
1328         * WebProcess/WebPage/WebPage.cpp:
1329         (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick):
1330         (WebKit::WebPage::contextMenuAtPointInWindow):
1331         (WebKit::WebPage::dragEnded):
1332         (WebKit::WebPage::simulateMouseDown):
1333         (WebKit::WebPage::simulateMouseUp):
1334         (WebKit::WebPage::simulateMouseMotion):
1335         * WebProcess/WebPage/WebPage.h:
1336         * WebProcess/WebPage/ios/WebPageIOS.mm:
1337         (WebKit::WebPage::handleSyntheticClick):
1338         (WebKit::WebPage::completeSyntheticClick):
1339         (WebKit::WebPage::requestAdditionalItemsForDragSession):
1340         (WebKit::WebPage::inspectorNodeSearchMovedToPosition):
1341
1342 2017-09-22  Fujii Hironori  <Hironori.Fujii@sony.com>
1343
1344         [GTK] Web Inspector: Can't load three.js
1345         https://bugs.webkit.org/show_bug.cgi?id=177340
1346
1347         Reviewed by Carlos Garcia Campos.
1348
1349         * PlatformGTK.cmake: Add JS files of three.js to InspectorFiles variable.
1350         * PlatformWPE.cmake: Ditto.
1351
1352 2017-09-21  Ryosuke Niwa  <rniwa@webkit.org>
1353
1354         Enable dataTransfer.items on macOS and iOS
1355         https://bugs.webkit.org/show_bug.cgi?id=177335
1356
1357         Reviewed by Sam Weinig.
1358
1359         * Shared/WebPreferencesDefinitions.h:
1360
1361 2017-09-21  Dan Bernstein  <mitz@apple.com>
1362
1363         Try to fix Apple internal builds with the iOS 11.0 SDK.
1364
1365         * Configurations/WebKit.xcconfig: Disable framework header postprocessing for iOS 11.0.
1366
1367 2017-09-21  Chris Dumez  <cdumez@apple.com>
1368
1369         Regression(r222308): new API tests are failing for !NETWORK_SESSION
1370         https://bugs.webkit.org/show_bug.cgi?id=177321
1371
1372         Reviewed by Alex Christensen.
1373
1374         When a load is redirected and then converted into a download, CFNetwork
1375         seems to call [NSURLDownloadDelegate willSendRequest:] on the download
1376         with a non-nil redirectResponse, which was unexpected.
1377
1378         To address the issue, we now ignore the willSendRequest call if the
1379         new request's URL is the same as the redirectResponse one.
1380
1381         * NetworkProcess/Downloads/mac/DownloadMac.mm:
1382         (-[WKDownloadAsDelegate download:willSendRequest:redirectResponse:]):
1383
1384 2017-09-21  Chris Dumez  <cdumez@apple.com>
1385
1386         Unreviewed, drop assertion added in r222308.
1387
1388         The assertion is hit by a couple of tests still but there is no bad effect
1389         to the vector not being empty at this point since we clear it right after.
1390
1391         * UIProcess/WebFrameProxy.cpp:
1392         (WebKit::WebFrameProxy::didStartProvisionalLoad):
1393
1394 2017-09-21  Chris Dumez  <cdumez@apple.com>
1395
1396         [WK2] Add API to get the redirect chain of a WKDownload
1397         https://bugs.webkit.org/show_bug.cgi?id=176628
1398         <rdar://problem/34338279>
1399
1400         Reviewed by Alex Christensen.
1401
1402         Re-enable assertion initially added in r222308 and later disabled in
1403         r222320. The assertion was hit because we failed to clear the redirect
1404         chain in WebFrameProxy::didFailProvisionalLoad().
1405
1406         * UIProcess/WebFrameProxy.cpp:
1407         (WebKit::WebFrameProxy::didStartProvisionalLoad):
1408         (WebKit::WebFrameProxy::didFailProvisionalLoad):
1409
1410 2017-09-21  Alex Christensen  <achristensen@webkit.org>
1411
1412         REGRESSION(r221465) WKWebViews without WebGL delegate callbacks crash when WebGL contexts are created
1413         https://bugs.webkit.org/show_bug.cgi?id=177306
1414         <rdar://problem/34351988>
1415
1416         Reviewed by Chris Dumez.
1417
1418         * UIProcess/Cocoa/NavigationState.mm:
1419         (WebKit::NavigationState::NavigationClient::webGLLoadPolicy const):
1420         (WebKit::NavigationState::NavigationClient::resolveWebGLLoadPolicy const):
1421         I forgot to early return after calling the default completion handler if there's no delegate selector.
1422
1423 2017-09-21  Chris Dumez  <cdumez@apple.com>
1424
1425         Unreviewed, temporarily disable assertion added in r222308 while I investigate.
1426
1427         * UIProcess/WebFrameProxy.cpp:
1428         (WebKit::WebFrameProxy::didStartProvisionalLoad):
1429
1430 2017-09-20  Stephan Szabo  <stephan.szabo@sony.com>
1431
1432         [Win] WTF: Add alias for process id to use in place of direct uses of pid_t
1433         https://bugs.webkit.org/show_bug.cgi?id=177017
1434
1435         Reviewed by Alex Christensen.
1436
1437         * NetworkProcess/NetworkProcessCreationParameters.h:
1438         * Shared/WebProcessCreationParameters.h:
1439         * UIProcess/API/APIProcessPoolConfiguration.h:
1440         * UIProcess/API/C/WKContext.cpp:
1441         (WKContextGetNetworkProcessIdentifier):
1442         (WKContextGetDatabaseProcessIdentifier):
1443         * UIProcess/API/C/WKContextPrivate.h:
1444         * UIProcess/API/C/WKPage.cpp:
1445         (WKPageGetProcessIdentifier):
1446         * UIProcess/API/C/WKPagePrivate.h:
1447         * UIProcess/ChildProcessProxy.h:
1448         (WebKit::ChildProcessProxy::processIdentifier const):
1449         * UIProcess/Launcher/ProcessLauncher.cpp:
1450         (WebKit::ProcessLauncher::didFinishLaunchingProcess):
1451         * UIProcess/Launcher/ProcessLauncher.h:
1452         (WebKit::ProcessLauncher::processIdentifier const):
1453         * UIProcess/ProcessAssertion.cpp:
1454         (WebKit::ProcessAssertion::ProcessAssertion):
1455         (WebKit::ProcessAndUIAssertion::ProcessAndUIAssertion):
1456         * UIProcess/ProcessAssertion.h:
1457         (WebKit::ProcessAssertion::ProcessAssertion):
1458         * UIProcess/ProcessThrottler.cpp:
1459         (WebKit::ProcessThrottler::didConnectToProcess):
1460         * UIProcess/ProcessThrottler.h:
1461         * UIProcess/WebPageProxy.cpp:
1462         (WebKit::WebPageProxy::processIdentifier const):
1463         * UIProcess/WebPageProxy.h:
1464         * UIProcess/WebProcessPool.cpp:
1465         (WebKit::WebProcessPool::networkProcessIdentifier):
1466         (WebKit::WebProcessPool::storageProcessIdentifier):
1467         * UIProcess/WebProcessPool.h:
1468
1469 2017-09-20  Chris Dumez  <cdumez@apple.com>
1470
1471         [WK2] Add API to get the redirect chain of a WKDownload
1472         https://bugs.webkit.org/show_bug.cgi?id=176628
1473         <rdar://problem/34338279>
1474
1475         Reviewed by Alex Christensen.
1476
1477         Add API to get the redirect chain of a WKDwnload. The redirect chain includes redirects
1478         that happened during initial load, before the load was converted into a download.
1479
1480         * UIProcess/API/C/WKDownload.cpp:
1481         (WKDownloadCopyRedirectChain):
1482         * UIProcess/API/C/WKDownload.h:
1483         * UIProcess/API/Cocoa/_WKDownload.h:
1484         * UIProcess/API/Cocoa/_WKDownload.mm:
1485         (-[_WKDownload originatingWebView]):
1486         (-[_WKDownload redirectChain]):
1487         * UIProcess/Downloads/DownloadProxy.cpp:
1488         (WebKit::DownloadProxy::willSendRequest):
1489         * UIProcess/Downloads/DownloadProxy.h:
1490         (WebKit::DownloadProxy::setRedirectChain):
1491         (WebKit::DownloadProxy::redirectChain const):
1492         * UIProcess/WebFrameProxy.cpp:
1493         (WebKit::WebFrameProxy::didStartProvisionalLoad):
1494         (WebKit::WebFrameProxy::didReceiveServerRedirectForProvisionalLoad):
1495         * UIProcess/WebFrameProxy.h:
1496         (WebKit::WebFrameProxy::redirectChain const):
1497         * UIProcess/WebPageProxy.cpp:
1498         (WebKit::WebPageProxy::receivedPolicyDecision):
1499
1500 2017-09-20  Alex Christensen  <achristensen@webkit.org>
1501
1502         Add infrastructure for adding custom headers to requests per website
1503         https://bugs.webkit.org/show_bug.cgi?id=177255
1504
1505         Reviewed by Geoffrey Garen.
1506
1507         * Shared/WebsitePolicies.cpp: Added.
1508         * Shared/WebsitePolicies.h:
1509         (WebKit::WebsitePolicies::encode const):
1510         (WebKit::WebsitePolicies::decode):
1511         * UIProcess/API/APIWebsitePolicies.h:
1512         * UIProcess/API/C/WKWebsitePolicies.cpp:
1513         (WKWebsitePoliciesCopyCustomHeaderFields):
1514         (WKWebsitePoliciesSetCustomHeaderFields):
1515         * UIProcess/API/C/WKWebsitePolicies.h:
1516         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
1517         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
1518         (-[_WKWebsitePolicies customHeaderFields]):
1519         (-[_WKWebsitePolicies setCustomHeaderFields:]):
1520         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1521         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1522
1523 2017-09-20  Michael Catanzaro  <mcatanzaro@igalia.com>
1524
1525         REGRESSION(r222194) [WPE] Library and executable output names broken
1526         https://bugs.webkit.org/show_bug.cgi?id=177273
1527
1528         Reviewed by Carlos Alberto Lopez Perez.
1529
1530         Move the WebKit2 output name variables to here from Source/cmake, since this is a better
1531         place and where they are set on all other ports. Update them for the changes in r222194.
1532
1533         * PlatformWPE.cmake:
1534
1535 2017-09-20  Jonathan Bedard  <jbedard@apple.com>
1536
1537         Removed nullable from UIDragItem property
1538         https://bugs.webkit.org/show_bug.cgi?id=176264
1539         <rdar://problem/31144674>
1540
1541         Unreviewed build fix
1542
1543         When a nullable annotation is used in a header file,
1544         the Objective-C compiler forces annotations on the entire
1545         file. Remove an unneeded annotation in UIKitSPI.h so that
1546         we can build in iOS 11.
1547
1548         * Platform/spi/ios/UIKitSPI.h:
1549
1550 2017-09-20  Antti Koivisto  <antti@apple.com>
1551
1552         Remove DOM and styling support for CSS Regions
1553         https://bugs.webkit.org/show_bug.cgi?id=177221
1554
1555         Reviewed by Andreas Kling.
1556
1557         * Configurations/FeatureDefines.xcconfig:
1558
1559 2017-09-19  Simon Fraser  <simon.fraser@apple.com>
1560
1561         Do more math in terms of FloatSizes and FloatPoints
1562         https://bugs.webkit.org/show_bug.cgi?id=177217
1563
1564         Reviewed by Zalan Bujtas.
1565
1566         Add operator/(const FloatSize&, const FloatSize&), GraphicsContext::translate(const FloatPoint&),
1567         FloatRect.scale(FloatSize) and AffineTransform::translate(const FloatSize&)
1568         and use them in lots of places to do math in terms of points and sizes.
1569
1570         * UIProcess/API/Cocoa/WKWebView.mm:
1571         (-[WKWebView _didCommitLayerTree:]):
1572         * UIProcess/ios/DragDropInteractionState.mm:
1573         (WebKit::createTargetedDragPreview):
1574         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
1575         (WebKit::imageForRect):
1576         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
1577         (WebKit::InjectedBundleRangeHandle::renderedImage):
1578         * WebProcess/WebPage/WebPage.cpp:
1579         (WebKit::paintSnapshotAtSize):
1580         (WebKit::WebPage::snapshotNode):
1581
1582 2017-09-19  Simon Fraser  <simon.fraser@apple.com>
1583
1584         tiled-drawing/tiled-backing-in-window.html fails on Retina displays
1585         https://bugs.webkit.org/show_bug.cgi?id=177113
1586
1587         Reviewed by Tim Horton.
1588
1589         Make m_customDeviceScaleFactor a std::optional<> instead of having the weird "0 is unset"
1590         behavior.
1591
1592         * UIProcess/WebPageProxy.cpp:
1593         (WebKit::WebPageProxy::deviceScaleFactor const):
1594         (WebKit::WebPageProxy::setCustomDeviceScaleFactor):
1595         * UIProcess/WebPageProxy.h:
1596
1597 2017-09-19  Alex Christensen  <achristensen@webkit.org>
1598
1599         Allow modern decoding of Vectors
1600         https://bugs.webkit.org/show_bug.cgi?id=177102
1601
1602         Reviewed by Andy Estes.
1603
1604         Rather than allow modern decoding of Vectors of types that only allow legacy decoding,
1605         I just made modern decoders for all types that we need to decode in Vectors.
1606
1607         * NetworkProcess/NetworkResourceLoadParameters.cpp:
1608         (WebKit::NetworkResourceLoadParameters::decode):
1609         * Platform/IPC/ArgumentCoders.cpp:
1610         (IPC::ArgumentCoder<std::chrono::system_clock::time_point>::decode):
1611         * Platform/IPC/ArgumentCoders.h:
1612         * Shared/AssistedNodeInformation.cpp:
1613         (WebKit::OptionItem::decode):
1614         * Shared/AssistedNodeInformation.h:
1615         * Shared/CallbackID.h:
1616         (WebKit::CallbackID::decode):
1617         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
1618         (IPC::ArgumentCoder<WebCore::PaymentError>::decode):
1619         (IPC::ArgumentCoder<WebCore::PaymentMethodUpdate>::decode):
1620         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest>::decode):
1621         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::LineItem>::decode):
1622         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::ShippingMethod>::decode):
1623         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::TotalAndLineItems>::decode):
1624         (IPC::ArgumentCoder<WebCore::ShippingContactUpdate>::decode):
1625         (IPC::ArgumentCoder<WebCore::ShippingMethodUpdate>::decode):
1626         * Shared/Databases/IndexedDB/WebIDBResult.cpp:
1627         (WebKit::WebIDBResult::decode):
1628         * Shared/FrameInfoData.cpp:
1629         (WebKit::FrameInfoData::decode):
1630         * Shared/Gamepad/GamepadData.cpp:
1631         (WebKit::GamepadData::decode):
1632         * Shared/Gamepad/GamepadData.h:
1633         * Shared/PlatformPopupMenuData.cpp:
1634         (WebKit::PlatformPopupMenuData::decode):
1635         * Shared/PlatformPopupMenuData.h:
1636         * Shared/Plugins/NPIdentifierData.cpp:
1637         (WebKit::NPIdentifierData::decode):
1638         * Shared/Plugins/NPIdentifierData.h:
1639         * Shared/Plugins/NPVariantData.cpp:
1640         (WebKit::NPVariantData::decode):
1641         * Shared/Plugins/NPVariantData.h:
1642         * Shared/RTCNetwork.cpp:
1643         (WebKit::RTCNetwork::IPAddress::decode):
1644         (WebKit::RTCNetwork::SocketAddress::decode):
1645         (WebKit::RTCNetwork::decode):
1646         * Shared/RTCNetwork.h:
1647         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
1648         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
1649         (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::decode):
1650         (WebKit::RemoteLayerTreeTransaction::decode):
1651         * Shared/SessionState.cpp:
1652         (WebKit::HTTPBody::Element::decode):
1653         (WebKit::FrameState::decode):
1654         (WebKit::PageState::decode):
1655         (WebKit::BackForwardListItemState::decode):
1656         (WebKit::BackForwardListState::decode):
1657         * Shared/SessionState.h:
1658         * Shared/WebCompiledContentRuleListData.cpp:
1659         (WebKit::WebCompiledContentRuleListData::decode):
1660         * Shared/WebCompiledContentRuleListData.h:
1661         * Shared/WebContextMenuItemData.cpp:
1662         (WebKit::WebContextMenuItemData::decode):
1663         * Shared/WebContextMenuItemData.h:
1664         * Shared/WebCoreArgumentCoders.cpp:
1665         (IPC::ArgumentCoder<DOMCacheEngine::CacheInfo>::decode):
1666         (IPC::ArgumentCoder<DOMCacheEngine::Record>::decode):
1667         (IPC::ArgumentCoder<FloatRect>::decode):
1668         (IPC::ArgumentCoder<FloatQuad>::decode):
1669         (IPC::ArgumentCoder<IntRect>::decode):
1670         (IPC::ArgumentCoder<RecentSearch>::decode):
1671         (IPC::ArgumentCoder<Region::Span>::decode):
1672         (IPC::ArgumentCoder<MimeClassInfo>::decode):
1673         (IPC::ArgumentCoder<PluginInfo>::decode):
1674         (IPC::ArgumentCoder<SelectionRect>::decode):
1675         (IPC::ArgumentCoder<CompositionUnderline>::decode):
1676         (IPC::ArgumentCoder<DictationAlternative>::decode):
1677         (IPC::ArgumentCoder<GrammarDetail>::decode):
1678         (IPC::ArgumentCoder<TextCheckingResult>::decode):
1679         (IPC::ArgumentCoder<BlobPart>::decode):
1680         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
1681         (IPC::ArgumentCoder<MediaConstraints>::decode):
1682         (IPC::ArgumentCoder<CaptureDevice>::decode):
1683         (IPC::ArgumentCoder<ScrollOffsetRange<float>>::decode):
1684         (IPC::ArgumentCoder<MediaSelectionOption>::decode):
1685         * Shared/WebCoreArgumentCoders.h:
1686         * Shared/WebEvent.h:
1687         * Shared/WebPageCreationParameters.cpp:
1688         (WebKit::WebPageCreationParameters::decode):
1689         * Shared/WebPlatformTouchPoint.cpp:
1690         (WebKit::WebPlatformTouchPoint::decode):
1691         * Shared/WebPopupItem.cpp:
1692         (WebKit::WebPopupItem::decode):
1693         * Shared/WebPopupItem.h:
1694         * Shared/WebUserContentControllerDataTypes.cpp:
1695         (WebKit::WebUserScriptData::decode):
1696         (WebKit::WebUserStyleSheetData::decode):
1697         (WebKit::WebScriptMessageHandlerData::decode):
1698         * Shared/WebUserContentControllerDataTypes.h:
1699         * Shared/WebsiteData/WebsiteData.cpp:
1700         (WebKit::WebsiteData::Entry::decode):
1701         * Shared/WebsiteData/WebsiteData.h:
1702         * Shared/WebsiteDataStoreParameters.cpp:
1703         (WebKit::WebsiteDataStoreParameters::decode):
1704         * Shared/ios/WebPlatformTouchPointIOS.cpp:
1705         (WebKit::WebPlatformTouchPoint::decode):
1706         * Shared/mac/WebCoreArgumentCodersMac.mm:
1707         (IPC::ArgumentCoder<KeypressCommand>::decode):
1708         * UIProcess/LegacySessionStateCodingNone.cpp:
1709         (WebKit::decodeLegacySessionState):
1710         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.h:
1711         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
1712         (WebKit::PlatformCAAnimationRemote::KeyframeValue::decode):
1713         (WebKit::PlatformCAAnimationRemote::Properties::decode):
1714
1715 2017-09-19  Ryosuke Niwa  <rniwa@webkit.org>
1716
1717         On iOS, getData can't get text set by setData during copy event
1718         https://bugs.webkit.org/show_bug.cgi?id=176980
1719         <rdar://problem/34453915>
1720
1721         Reviewed by Darin Adler.
1722
1723         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1724         (WebKit::WebPlatformStrategies::copy): Deleted.
1725         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1726
1727 2017-09-19  Alex Christensen  <achristensen@webkit.org>
1728
1729         Expose WKPageRef as a private property on WKWebView on Mac
1730         https://bugs.webkit.org/show_bug.cgi?id=177022
1731         <rdar://problem/34342762>
1732
1733         Reviewed by Andy Estes.
1734
1735         * UIProcess/API/Cocoa/WKWebView.mm:
1736         (-[WKWebView _pageRefForTransitionToWKWebView]):
1737         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1738
1739 2017-09-19  Alex Christensen  <achristensen@webkit.org>
1740
1741         Make _WKProcessPoolConfiguration.allowsCellularAccess actually work on iOS
1742         https://bugs.webkit.org/show_bug.cgi?id=177124
1743
1744         Reviewed by Andy Estes.
1745
1746         The boolean added in r213747 was getting lost in two places:
1747         1. The API::ProcessPoolConfiguration gets copied before it's used, so we need to set the bool on the copy.
1748         2. The bool was not getting copied from that ProcessPoolConfiguration to the NetworkProcessCreationParameters
1749         to be sent to the NetworkProcess to be given to the NSURLSessionConfiguration in NetworkSessionCocoa.mm.
1750
1751         These two problems were fixed and verified manually with a customized iOS app on my phone.
1752         Unfortunately, this cannot be tested well with our current test infrastructure.
1753
1754         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1755         (API::ProcessPoolConfiguration::copy):
1756         * UIProcess/WebProcessPool.cpp:
1757         (WebKit::WebProcessPool::ensureNetworkProcess):
1758
1759 2017-09-18  Michael Catanzaro  <mcatanzaro@igalia.com>
1760
1761         [CMake] Rename WebKit target to WebKitLegacy and rename WebKit2 target to WebKit
1762         https://bugs.webkit.org/show_bug.cgi?id=174558
1763
1764         Reviewed by Alex Christensen.
1765
1766         * CMakeLists.txt:
1767         * PlatformGTK.cmake:
1768         * PlatformMac.cmake:
1769         * PlatformWPE.cmake:
1770         * PlatformWin.cmake:
1771         * Shared/gtk/WebKitWaylandProtocol.xml: Renamed from Source/WebKit/Shared/gtk/WebKit2WaylandProtocol.xml.
1772         * UIProcess/gtk/WaylandCompositor.cpp:
1773         * WebProcess/gtk/WaylandCompositorDisplay.cpp:
1774
1775 2017-09-18  Andy Estes  <aestes@apple.com>
1776
1777         [Cocoa] Upstream sandbox-related WebKitSystemInterface functions
1778         https://bugs.webkit.org/show_bug.cgi?id=177047
1779
1780         Reviewed by Daniel Bates.
1781
1782         * NetworkProcess/NetworkResourceLoadParameters.cpp:
1783         (WebKit::NetworkResourceLoadParameters::encode const):
1784         * Platform/spi/mac/QuarantineSPI.h: Added.
1785         * Shared/SandboxExtension.h:
1786         (): Deleted.
1787         * Shared/mac/ChildProcessMac.mm:
1788         (WebKit::enableSandboxStyleFileQuarantine):
1789         (WebKit::ChildProcess::initializeSandbox):
1790         * Shared/mac/SandboxExtensionMac.mm:
1791         (WebKit::SandboxExtensionImpl::create):
1792         (WebKit::SandboxExtensionImpl::SandboxExtensionImpl):
1793         (WebKit::SandboxExtensionImpl::~SandboxExtensionImpl):
1794         (WebKit::SandboxExtensionImpl::consume):
1795         (WebKit::SandboxExtensionImpl::invalidate):
1796         (WebKit::SandboxExtensionImpl::getSerializedFormat):
1797         (WebKit::SandboxExtension::Handle::Handle):
1798         (WebKit::SandboxExtension::Handle::~Handle):
1799         (WebKit::SandboxExtension::Handle::encode const):
1800         (WebKit::SandboxExtension::Handle::decode):
1801         (WebKit::SandboxExtension::createHandleWithoutResolvingPath):
1802         (WebKit::SandboxExtension::createHandleForReadWriteDirectory):
1803         (WebKit::SandboxExtension::createHandleForTemporaryFile):
1804         (WebKit::SandboxExtension::createHandleForGenericExtension):
1805         (WebKit::SandboxExtension::SandboxExtension):
1806         (WebKit::SandboxExtension::~SandboxExtension):
1807         (WebKit::SandboxExtension::revoke):
1808         (WebKit::SandboxExtension::consume):
1809         (WebKit::SandboxExtension::consumePermanently):
1810         (WebKit::wkSandboxExtensionType): Deleted.
1811         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
1812         (WebKit::WebPageProxy::createSandboxExtensionsIfNeeded):
1813         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1814         (WebKit::WebProcessPool::platformInitializeWebProcess):
1815         * UIProcess/Downloads/DownloadProxy.cpp:
1816         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync):
1817         * UIProcess/Network/NetworkProcessProxy.cpp:
1818         (WebKit::NetworkProcessProxy::grantSandboxExtensionsToStorageProcessForBlobs):
1819         * UIProcess/Storage/StorageProcessProxy.cpp:
1820         (WebKit::StorageProcessProxy::getSandboxExtensionsForBlobFiles):
1821         * UIProcess/WebPageProxy.cpp:
1822         (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
1823         (WebKit::WebPageProxy::loadFile):
1824         (WebKit::WebPageProxy::didChooseFilesForOpenPanel):
1825         * UIProcess/WebProcessPool.cpp:
1826         (WebKit::WebProcessPool::createNewWebProcess):
1827         (WebKit::WebProcessPool::processDidFinishLaunching):
1828         (WebKit::WebProcessPool::resumeDownload):
1829         (WebKit::WebProcessPool::startMemorySampler):
1830         * WebKit.xcodeproj/project.pbxproj:
1831         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
1832         (WebKit::BlobRegistryProxy::registerFileBlobURL):
1833
1834 2017-09-18  Andy Estes  <aestes@apple.com>
1835
1836         [Cocoa] Upstream WKSetCrashReportApplicationSpecificInformation() from WebKitSystemInterface
1837         https://bugs.webkit.org/show_bug.cgi?id=177048
1838
1839         Reviewed by Alex Christensen.
1840
1841         * Platform/IPC/mac/ConnectionMac.mm:
1842         (IPC::Connection::sendMessage):
1843         (IPC::readFromMachPort):
1844         * Platform/cocoa/CrashReporter.h: Copied from Source/WebKit/Shared/Cocoa/ChildProcessCocoa.mm.
1845         * Platform/cocoa/CrashReporter.mm: Copied from Source/WebKit/Shared/Cocoa/ChildProcessCocoa.mm.
1846         (WebKit::setCrashReportApplicationSpecificInformation):
1847         * Platform/spi/Cocoa/CrashReporterClientSPI.h: Copied from Source/WebKit/Shared/Cocoa/ChildProcessCocoa.mm.
1848         * Shared/Cocoa/ChildProcessCocoa.mm:
1849         (WebKit::ChildProcess::didReceiveInvalidMessage):
1850         * WebKit.xcodeproj/project.pbxproj:
1851         * WebProcess/cocoa/WebProcessCocoa.mm:
1852         (WebKit::_WKSetCrashReportApplicationSpecificInformation):
1853
1854 2017-09-18  Andy Estes  <aestes@apple.com>
1855
1856         [Mac] Upstream miscellaneous WebKitSystemInterface functions
1857         https://bugs.webkit.org/show_bug.cgi?id=177029
1858
1859         Reviewed by Alex Christensen.
1860
1861         * NetworkProcess/mac/NetworkProcessMac.mm:
1862         (WebKit::NetworkProcess::initializeProcessName):
1863         * PluginProcess/mac/PluginProcessMac.mm:
1864         (WebKit::PluginProcess::initializeProcessName):
1865         * StorageProcess/mac/StorageProcessMac.mm:
1866         (WebKit::StorageProcess::initializeProcessName):
1867         * UIProcess/Cocoa/WebViewImpl.mm:
1868         (WebKit::trackingAreaOptions):
1869         (WebKit::WebViewImpl::mightBeginScrollWhileInactive):
1870         * UIProcess/mac/WebPopupMenuProxyMac.mm:
1871         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
1872         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
1873         (WebKit::NetscapePlugin::popUpContextMenu):
1874         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1875         (WebKit::PDFPlugin::handleContextMenuEvent):
1876         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
1877         (InitWebCoreSystemInterface):
1878         * WebProcess/cocoa/WebProcessCocoa.mm:
1879         (WebKit::WebProcess::initializeProcessName):
1880         (WebKit::WebProcess::updateActivePages):
1881
1882 2017-09-17  Michael Catanzaro  <mcatanzaro@igalia.com>
1883
1884         [WPE][GTK] Merge ProcessLauncher[WPE,GTK]
1885         https://bugs.webkit.org/show_bug.cgi?id=177041
1886
1887         Unreviewed fixup, I broke the size of the argv buffer when experimenting with how to respond
1888         to review comments. Not sure why this didn't blow up everything during testing.
1889
1890         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
1891         (WebKit::ProcessLauncher::launchProcess):
1892
1893 2017-09-17  Michael Catanzaro  <mcatanzaro@igalia.com>
1894
1895         [WPE][GTK] Merge ProcessLauncher[WPE,GTK]
1896         https://bugs.webkit.org/show_bug.cgi?id=177041
1897
1898         Reviewed by Carlos Garcia Campos.
1899
1900         * PlatformGTK.cmake:
1901         * PlatformWPE.cmake:
1902         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp: Renamed from Source/WebKit/UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp.
1903         (WebKit::childSetupFunction):
1904         (WebKit::ProcessLauncher::launchProcess):
1905         (WebKit::ProcessLauncher::terminateProcess):
1906         (WebKit::ProcessLauncher::platformInvalidate):
1907         * UIProcess/Launcher/wpe/ProcessLauncherWPE.cpp: Removed.
1908
1909 2017-09-16  Tim Horton  <timothy_horton@apple.com>
1910
1911         Fix the Tools build with CMake on macOS
1912         https://bugs.webkit.org/show_bug.cgi?id=177030
1913
1914         Reviewed by Geoffrey Garen.
1915
1916         * PlatformMac.cmake:
1917         Add some WebKitLegacy headers to forward (for use by the tools).
1918
1919 2017-09-15  JF Bastien  <jfbastien@apple.com>
1920
1921         WTF: use Forward.h when appropriate instead of Vector.h
1922         https://bugs.webkit.org/show_bug.cgi?id=176984
1923
1924         Reviewed by Saam Barati.
1925
1926         There's no need to include Vector.h when Forward.h will suffice. All we need is to move the template default parameters from Vector, and then the forward declaration can be used in so many new places: if a header only takes Vector by reference, rvalue reference, pointer, returns any of these, or has them as members then the header doesn't need to see the definition because the declaration will suffice.
1927
1928         * Scripts/webkit/LegacyMessages-expected.h:
1929         * Scripts/webkit/Messages-expected.h:
1930         * Shared/API/APIData.h:
1931         * UIProcess/API/APIContextMenuClient.h:
1932         * UIProcess/API/APIFormClient.h:
1933         * UIProcess/API/APIHTTPCookieStore.h:
1934         * UIProcess/API/APINotificationProvider.h:
1935         * UIProcess/API/glib/WebKitNotificationProvider.h:
1936         * UIProcess/Notifications/WebNotificationProvider.h:
1937         * UIProcess/TextCheckerCompletion.h:
1938         * UIProcess/WebCookieManagerProxy.h:
1939         * UIProcess/WebOpenPanelResultListenerProxy.h:
1940         * UIProcess/WebPasteboardProxy.h:
1941         * UIProcess/WebPopupMenuProxy.h:
1942         * UIProcess/WebTextCheckerClient.h:
1943         * WebProcess/Cookies/WebCookieManager.h:
1944         * WebProcess/Gamepad/WebGamepadProvider.h:
1945         * WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h:
1946         * WebProcess/InjectedBundle/API/APIInjectedBundlePageContextMenuClient.h:
1947         * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
1948         * WebProcess/InjectedBundle/APIInjectedBundleFormClient.h:
1949         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
1950         * WebProcess/Network/webrtc/WebRTCMonitor.h:
1951         * WebProcess/Network/webrtc/WebRTCResolver.h:
1952         * WebProcess/WebPage/DrawingArea.h:
1953         * WebProcess/WebPage/WebOpenPanelResultListener.h:
1954
1955 2017-09-15  Tim Horton  <timothy_horton@apple.com>
1956
1957         Fix the macOS CMake build
1958         https://bugs.webkit.org/show_bug.cgi?id=177015
1959
1960         Reviewed by Andy Estes.
1961
1962         * CMakeLists.txt:
1963         Add the new RemoteLayerTree directories to the header search path.
1964         Add CookieStorageUtilsCF.mm to Sources.
1965
1966         * PlatformMac.cmake:
1967         Add a few more files, and fix the generated forwarding headers include
1968         path to name "WebKit" instead of "WebKit2".
1969
1970 2017-09-15  Youenn Fablet  <youenn@apple.com>
1971
1972         Add an URL method to remove both query string and fragment identifier
1973         https://bugs.webkit.org/show_bug.cgi?id=176911
1974
1975         Reviewed by Alex Christensen.
1976
1977         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
1978         (WebKit::CacheStorage::computeKeyURL):
1979
1980 2017-09-15  Andy Estes  <aestes@apple.com>
1981
1982         [Cocoa] Upstream MediaRemote and VideoToolbox WebKitSystemInterface functions
1983         https://bugs.webkit.org/show_bug.cgi?id=176953
1984
1985         Reviewed by Eric Carlson.
1986
1987         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
1988         (InitWebCoreSystemInterface):
1989
1990 2017-09-15  Ryosuke Niwa  <rniwa@webkit.org>
1991
1992         iOS: WebKitTestRunner hits an assertion in editing/pasteboard/datatransfer-items-copy-plaintext.html
1993         https://bugs.webkit.org/show_bug.cgi?id=176968
1994
1995         Reviewed by Wenson Hsieh.
1996
1997         Don't allocate a SharedMemory of size zero (content was empty) as this would result in a crash inside
1998         a WebContent process in release builds and an assertion failure in debug builds.
1999
2000         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
2001         (WebKit::WebPasteboardProxy::readBufferFromPasteboard):
2002
2003 2017-09-14  Youenn Fablet  <youenn@apple.com>
2004
2005         Add Cache API support of records persistency
2006         https://bugs.webkit.org/show_bug.cgi?id=176845
2007
2008         Reviewed by Alex Christensen.
2009
2010         Introducing asynchronous opening of Cache objects.
2011         When opening, Cache objects will read the list of records from the disk.
2012         They keep in memory the necessary information to make any match or remove request without reading further information from the disk.
2013         Cache objects thus keep during the opening time a list of callbacks to call when being opened.
2014         Persistent storage is implemented through NetworkCache::Storage.
2015
2016         A Cache object is added a unique name so that records from a Cache cannot be mixed with records from another Cache.
2017         This unique name is stored persistenly in addition to the Cache name.
2018         This unique name is used as the key type given to the storage.
2019
2020         Request, response and responsebody data are no longer kept by the Cache object.
2021         For regular sessions, this information is kept on the disk through NetworkCache::Storage.
2022         Insertion time is also stored persistently so as to keep the ordering of the records consistent.
2023         For private browsing sessions, this information is kept in a map owned by the Caches object.
2024         RecordData is renamed to RecordInformation as it now only contains the information used to handle the different Cache actions.
2025
2026         For every record retrieval action, a ReadRecordTaskCounter is used.
2027         Its purpose is to allow retrieving the record data on the disk in parallel,
2028         and then send back the information when everything is read.
2029         In case some records cannot be correctly read, they are removed automatically at that point.
2030         The current implementation loads all information in memory including response bodies.
2031         Further improvements might consider streaming the response bodies progressively.
2032
2033         For every stored record, an AsynchronousPutTaskCounter is used.
2034         Its purpose is also to wait for all put actions to be completed before executing the completion callback.
2035         In some cases, a record needs to be overriden.
2036         In that case, as per the specification, only the data related to the response is to be modified.
2037         This requires reading the record request data on disk before actually writing the whole record again.
2038         This is implemented in updateRecordToDisk.
2039
2040         The Cache object is delegating all record writing/reading tasks to its Caches object.
2041         The Caches object is responsible to handle persistent/private sessions.
2042
2043         * NetworkProcess/cache/CacheStorageEngine.cpp:
2044         (WebKit::CacheStorage::Engine::retrieveRecords): Making sure Cache object is opened.
2045         (WebKit::CacheStorage::Engine::readCache): Ditto.
2046         (WebKit::CacheStorage::Engine::unlock): Disposing the cache without going through initializing it.
2047         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
2048         (WebKit::CacheStorage::computeKeyURL):
2049         (WebKit::CacheStorage::queryCache):
2050         (WebKit::CacheStorage::updateVaryInformation):
2051         (WebKit::CacheStorage::Cache::toRecordInformation):
2052         (WebKit::CacheStorage::Cache::Cache):
2053         (WebKit::CacheStorage::Cache::open):
2054         (WebKit::CacheStorage::Cache::finishOpening):
2055         (WebKit::CacheStorage::ReadRecordTaskCounter::create):
2056         (WebKit::CacheStorage::ReadRecordTaskCounter::~ReadRecordTaskCounter):
2057         (WebKit::CacheStorage::ReadRecordTaskCounter::appendRecord):
2058         (WebKit::CacheStorage::ReadRecordTaskCounter::ReadRecordTaskCounter):
2059         (WebKit::CacheStorage::Cache::retrieveRecord):
2060         (WebKit::CacheStorage::Cache::retrieveRecords):
2061         (WebKit::CacheStorage::Cache::addRecord):
2062         (WebKit::CacheStorage::Cache::recordsFromURL):
2063         (WebKit::CacheStorage::Cache::recordsFromURL const):
2064         (WebKit::CacheStorage::AsynchronousPutTaskCounter::create):
2065         (WebKit::CacheStorage::AsynchronousPutTaskCounter::~AsynchronousPutTaskCounter):
2066         (WebKit::CacheStorage::AsynchronousPutTaskCounter::onCompletion):
2067         (WebKit::CacheStorage::AsynchronousPutTaskCounter::setError):
2068         (WebKit::CacheStorage::Cache::put):
2069         (WebKit::CacheStorage::Cache::remove):
2070         (WebKit::CacheStorage::Cache::removeFromRecordList):
2071         (WebKit::CacheStorage::Cache::writeRecordToDisk):
2072         (WebKit::CacheStorage::Cache::updateRecordToDisk):
2073         (WebKit::CacheStorage::Cache::readRecordFromDisk):
2074         (WebKit::CacheStorage::Cache::removeRecordFromDisk):
2075         (WebKit::CacheStorage::Cache::encode):
2076         (WebKit::CacheStorage::decodeRecordHeader):
2077         (WebKit::CacheStorage::Cache::decode):
2078         (WebKit::CacheStorage::Cache::keys const):
2079         * NetworkProcess/cache/CacheStorageEngineCache.h:
2080         (WebKit::CacheStorage::Cache::isOpened const):
2081         (WebKit::CacheStorage::Cache::uniqueName const):
2082         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2083         (WebKit::CacheStorage::Caches::initialize):
2084         (WebKit::CacheStorage::Caches::open):
2085         (WebKit::CacheStorage::Caches::remove):
2086         (WebKit::CacheStorage::Caches::dispose):
2087         (WebKit::CacheStorage::encodeCacheNames):
2088         (WebKit::CacheStorage::decodeCachesNames):
2089         (WebKit::CacheStorage::Caches::readCachesFromDisk):
2090         (WebKit::CacheStorage::Caches::readRecordsList):
2091         (WebKit::CacheStorage::Caches::writeRecord):
2092         (WebKit::CacheStorage::Caches::readRecord):
2093         (WebKit::CacheStorage::Caches::removeRecord):
2094         (WebKit::CacheStorage::Caches::clearMemoryRepresentation):
2095         (WebKit::CacheStorage::Caches::salt const):
2096         * NetworkProcess/cache/CacheStorageEngineCaches.h:
2097         (WebKit::CacheStorage::Caches::shouldPersist const):
2098         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2099         (WebKit::NetworkCache::Storage::store):
2100         * NetworkProcess/cache/NetworkCacheStorage.h:
2101         (WebKit::NetworkCache::Storage::writeWithoutWaiting):
2102
2103 2017-09-14  Alex Christensen  <achristensen@webkit.org>
2104
2105         Add WKUIDelegatePrivate equivalent of WKPageUIClient's drawHeader, drawFooter, headerHeight, and footerHeight
2106         https://bugs.webkit.org/show_bug.cgi?id=176889
2107         <rdar://problem/29270035>
2108
2109         Reviewed by Andy Estes.
2110
2111         * UIProcess/API/C/WKPage.cpp:
2112         (WKPageLoadAlternateHTMLString):
2113         (WKPageLoadAlternateHTMLStringWithUserData):
2114         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
2115         (-[WKBrowsingContextController loadAlternateHTMLString:baseURL:forUnreachableURL:]):
2116         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2117         * UIProcess/API/Cocoa/WKWebView.mm:
2118         (-[WKWebView _loadAlternateHTMLString:baseURL:forUnreachableURL:]):
2119         * UIProcess/Cocoa/UIDelegate.h:
2120         * UIProcess/Cocoa/UIDelegate.mm:
2121         (WebKit::UIDelegate::setDelegate):
2122         (WebKit::UIDelegate::UIClient::headerHeight):
2123         (WebKit::UIDelegate::UIClient::footerHeight):
2124         (WebKit::UIDelegate::UIClient::drawHeader):
2125         (WebKit::UIDelegate::UIClient::drawFooter):
2126         * UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm:
2127         (-[WKReloadFrameErrorRecoveryAttempter attemptRecovery]):
2128         * UIProcess/Cocoa/WebViewImpl.mm:
2129         (WebKit::WebViewImpl::printOperationWithPrintInfo):
2130         * UIProcess/FrameLoadState.cpp:
2131         (WebKit::FrameLoadState::didStartProvisionalLoad):
2132         (WebKit::FrameLoadState::didReceiveServerRedirectForProvisionalLoad):
2133         (WebKit::FrameLoadState::didFailProvisionalLoad):
2134         (WebKit::FrameLoadState::didCommitLoad):
2135         (WebKit::FrameLoadState::didSameDocumentNotification):
2136         (WebKit::FrameLoadState::setUnreachableURL):
2137         (WebKit::FrameLoadState::FrameLoadState): Deleted.
2138         * UIProcess/FrameLoadState.h:
2139         (WebKit::FrameLoadState::url const):
2140         (WebKit::FrameLoadState::provisionalURL const):
2141         (WebKit::FrameLoadState::unreachableURL const):
2142         * UIProcess/WebFrameProxy.cpp:
2143         (WebKit::WebFrameProxy::loadURL):
2144         (WebKit::WebFrameProxy::didStartProvisionalLoad):
2145         (WebKit::WebFrameProxy::didReceiveServerRedirectForProvisionalLoad):
2146         (WebKit::WebFrameProxy::didSameDocumentNavigation):
2147         (WebKit::WebFrameProxy::setUnreachableURL):
2148         * UIProcess/WebFrameProxy.h:
2149         (WebKit::WebFrameProxy::url const):
2150         (WebKit::WebFrameProxy::provisionalURL const):
2151         (WebKit::WebFrameProxy::unreachableURL const):
2152         * UIProcess/WebPageProxy.cpp:
2153         (WebKit::WebPageProxy::loadAlternateHTMLString):
2154         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
2155         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
2156         (WebKit::WebPageProxy::didChangeProvisionalURLForFrame):
2157         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
2158         * UIProcess/WebPageProxy.h:
2159         * UIProcess/WebPageProxy.messages.in:
2160         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2161         (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad):
2162         (WebKit::WebFrameLoaderClient::dispatchDidChangeProvisionalURL):
2163         (WebKit::WebFrameLoaderClient::dispatchDidChangeLocationWithinPage):
2164         (WebKit::WebFrameLoaderClient::dispatchDidPushStateWithinPage):
2165         (WebKit::WebFrameLoaderClient::dispatchDidReplaceStateWithinPage):
2166         (WebKit::WebFrameLoaderClient::dispatchDidPopStateWithinPage):
2167         (WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad):
2168         * WebProcess/WebPage/WebPage.cpp:
2169         (WebKit::WebPage::loadURLInFrame):
2170         * WebProcess/WebPage/WebPage.h:
2171         * WebProcess/WebPage/WebPage.messages.in:
2172
2173 2017-09-14  Andy Estes  <aestes@apple.com>
2174
2175         [Mac] Upstream SpeechSynthesis-related WebKitSystemInterface functions
2176         https://bugs.webkit.org/show_bug.cgi?id=176931
2177
2178         Reviewed by Joseph Pecoraro.
2179
2180         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2181         (InitWebCoreSystemInterface):
2182
2183 2017-09-14  Ryan Haddad  <ryanhaddad@apple.com>
2184
2185         Unreviewed, rolling out r222033.
2186
2187         This change caused API test WebKit.PrintFrame to time out.
2188
2189         Reverted changeset:
2190
2191         "Add WKUIDelegatePrivate equivalent of WKPageUIClient's
2192         drawHeader, drawFooter, headerHeight, and footerHeight"
2193         https://bugs.webkit.org/show_bug.cgi?id=176889
2194         http://trac.webkit.org/changeset/222033
2195
2196 2017-09-14  Alex Christensen  <achristensen@webkit.org>
2197
2198         Add WKUIDelegatePrivate equivalent of WKPageUIClient's drawHeader, drawFooter, headerHeight, and footerHeight
2199         https://bugs.webkit.org/show_bug.cgi?id=176889
2200         <rdar://problem/29270035>
2201
2202         Reviewed by Andy Estes.
2203
2204         * UIProcess/API/C/WKPage.cpp:
2205         (WKPageLoadAlternateHTMLString):
2206         (WKPageLoadAlternateHTMLStringWithUserData):
2207         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
2208         (-[WKBrowsingContextController loadAlternateHTMLString:baseURL:forUnreachableURL:]):
2209         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2210         * UIProcess/API/Cocoa/WKWebView.mm:
2211         (-[WKWebView _loadAlternateHTMLString:baseURL:forUnreachableURL:]):
2212         * UIProcess/Cocoa/UIDelegate.h:
2213         * UIProcess/Cocoa/UIDelegate.mm:
2214         (WebKit::UIDelegate::setDelegate):
2215         (WebKit::UIDelegate::UIClient::headerHeight):
2216         (WebKit::UIDelegate::UIClient::footerHeight):
2217         (WebKit::UIDelegate::UIClient::drawHeader):
2218         (WebKit::UIDelegate::UIClient::drawFooter):
2219         * UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm:
2220         (-[WKReloadFrameErrorRecoveryAttempter attemptRecovery]):
2221         * UIProcess/Cocoa/WebViewImpl.mm:
2222         (WebKit::WebViewImpl::printOperationWithPrintInfo):
2223         * UIProcess/FrameLoadState.cpp:
2224         (WebKit::FrameLoadState::didStartProvisionalLoad):
2225         (WebKit::FrameLoadState::didReceiveServerRedirectForProvisionalLoad):
2226         (WebKit::FrameLoadState::didFailProvisionalLoad):
2227         (WebKit::FrameLoadState::didCommitLoad):
2228         (WebKit::FrameLoadState::didSameDocumentNotification):
2229         (WebKit::FrameLoadState::setUnreachableURL):
2230         (WebKit::FrameLoadState::FrameLoadState): Deleted.
2231         * UIProcess/FrameLoadState.h:
2232         (WebKit::FrameLoadState::url const):
2233         (WebKit::FrameLoadState::provisionalURL const):
2234         (WebKit::FrameLoadState::unreachableURL const):
2235         * UIProcess/WebFrameProxy.cpp:
2236         (WebKit::WebFrameProxy::loadURL):
2237         (WebKit::WebFrameProxy::didStartProvisionalLoad):
2238         (WebKit::WebFrameProxy::didReceiveServerRedirectForProvisionalLoad):
2239         (WebKit::WebFrameProxy::didSameDocumentNavigation):
2240         (WebKit::WebFrameProxy::setUnreachableURL):
2241         * UIProcess/WebFrameProxy.h:
2242         (WebKit::WebFrameProxy::url const):
2243         (WebKit::WebFrameProxy::provisionalURL const):
2244         (WebKit::WebFrameProxy::unreachableURL const):
2245         * UIProcess/WebPageProxy.cpp:
2246         (WebKit::WebPageProxy::loadAlternateHTMLString):
2247         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
2248         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
2249         (WebKit::WebPageProxy::didChangeProvisionalURLForFrame):
2250         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
2251         * UIProcess/WebPageProxy.h:
2252         * UIProcess/WebPageProxy.messages.in:
2253         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2254         (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad):
2255         (WebKit::WebFrameLoaderClient::dispatchDidChangeProvisionalURL):
2256         (WebKit::WebFrameLoaderClient::dispatchDidChangeLocationWithinPage):
2257         (WebKit::WebFrameLoaderClient::dispatchDidPushStateWithinPage):
2258         (WebKit::WebFrameLoaderClient::dispatchDidReplaceStateWithinPage):
2259         (WebKit::WebFrameLoaderClient::dispatchDidPopStateWithinPage):
2260         (WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad):
2261         * WebProcess/WebPage/WebPage.cpp:
2262         (WebKit::WebPage::loadURLInFrame):
2263         * WebProcess/WebPage/WebPage.h:
2264         * WebProcess/WebPage/WebPage.messages.in:
2265
2266 2017-09-14  Carlos Garcia Campos  <cgarcia@igalia.com>
2267
2268         [GTK][Wayland] Flickering when resizing the window
2269         https://bugs.webkit.org/show_bug.cgi?id=176774
2270
2271         Reviewed by Michael Catanzaro.
2272
2273         This regressed when we switched to always start the wayland compositor. In
2274         AcceleratedDrawingAreaProxy::waitForAndDispatchDidUpdateBackingStoreState() we check if the nested compositor is
2275         running, which is always true now (if EGL and the required extensions are available). We should check if we are
2276         in AC mode instead.
2277
2278         * UIProcess/AcceleratedDrawingAreaProxy.cpp:
2279         (WebKit::AcceleratedDrawingAreaProxy::waitForAndDispatchDidUpdateBackingStoreState):
2280
2281 2017-09-14  Yusuke Suzuki  <utatane.tea@gmail.com>
2282
2283         [JSC] Add PrivateSymbolMode::{Include,Exclude} for PropertyNameArray
2284         https://bugs.webkit.org/show_bug.cgi?id=176867
2285
2286         Reviewed by Sam Weinig.
2287
2288         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
2289         (WebKit::NPJSObject::enumerate):
2290
2291 2017-09-14  Maureen Daum  <mdaum@apple.com>
2292
2293         Introduce the option to mark an HTML element as having AutoFill available.
2294         https://bugs.webkit.org/show_bug.cgi?id=176710
2295
2296         Reviewed by Alex Christensen.
2297
2298         Introduce the option to mark an HTML element as having AutoFill available. Accessibility
2299         can use this property when deciding whether to announce that the focused field offers
2300         AutoFill.
2301
2302         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
2303         (WKBundleNodeHandleGetHTMLInputElementAutoFillAvailable):
2304         (WKBundleNodeHandleSetHTMLInputElementAutoFillAvailable):
2305         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h:
2306         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
2307         (WebKit::InjectedBundleNodeHandle::isAutoFillAvailable const):
2308         (WebKit::InjectedBundleNodeHandle::setAutoFillAvailable):
2309         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
2310
2311 2017-09-13  John Wilander  <wilander@apple.com>
2312
2313         Introduce Storage Access API (document parts) as an experimental feature
2314         https://bugs.webkit.org/show_bug.cgi?id=175759
2315         <rdar://problem/34414107>
2316
2317         Reviewed by Alex Christensen.
2318
2319         Storage Access API is an experimental feature which allows cross-origin,
2320         sandboxed iframes to request access to their first-party storage (as
2321         opposed to partitioned storage). This might be restricted to cookies or
2322         might cover all stateful mechanisms.
2323
2324         It introduces the following three developer-facing things:
2325         - A new readonly attribute, document.hasStorageAccess.
2326         - A new function, document.requestStorageAccess().
2327         - A new iframe sandbox token, allow-storage-access-by-user-activation.
2328
2329         * Shared/WebCoreArgumentCoders.cpp:
2330         (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
2331         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
2332             Storage handling of the new type of data.
2333         * Shared/WebPreferencesDefinitions.h:
2334         * UIProcess/API/C/WKPreferences.cpp:
2335         (WKPreferencesSetStorageAccessAPIEnabled):
2336         (WKPreferencesGetStorageAccessAPIEnabled):
2337         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2338         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2339             Bumped the model version from 9 to 10.
2340         * WebProcess/WebPage/WebPage.cpp:
2341         (WebKit::WebPage::updatePreferences):
2342
2343 2017-09-13  Andy Estes  <aestes@apple.com>
2344
2345         [Apple Pay] Consider phoneticName when encoding ContactFields
2346         https://bugs.webkit.org/show_bug.cgi?id=176885
2347         <rdar://problem/34176419>
2348
2349         Reviewed by Tim Horton.
2350
2351         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
2352         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::ContactFields>::encode):
2353         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::ContactFields>::decode):
2354
2355 2017-09-13  Matt Lewis  <jlewis3@apple.com>
2356
2357         Unreviewed, rolling out r221976.
2358
2359         The test introduced was flaky from point of addition.
2360
2361         Reverted changeset:
2362
2363         "Introduce Storage Access API (document parts) as an
2364         experimental feature"
2365         https://bugs.webkit.org/show_bug.cgi?id=175759
2366         http://trac.webkit.org/changeset/221976
2367
2368 2017-09-13  Youenn Fablet  <youenn@apple.com>
2369
2370         Internals clearCacheStorageMemoryRepresentation should return a Promise
2371         https://bugs.webkit.org/show_bug.cgi?id=176818
2372
2373         Reviewed by Alex Christensen.
2374
2375         Adding a completion handler to clearMemoryRepresentation.
2376
2377         * NetworkProcess/cache/CacheStorageEngine.cpp:
2378         (WebKit::CacheStorage::Engine::clearMemoryRepresentation):
2379         * NetworkProcess/cache/CacheStorageEngine.h:
2380         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
2381         (WebKit::CacheStorageEngineConnection::clearMemoryRepresentation):
2382         * NetworkProcess/cache/CacheStorageEngineConnection.h:
2383         * NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
2384         * WebProcess/Cache/WebCacheStorageConnection.cpp:
2385         (WebKit::WebCacheStorageConnection::clearMemoryRepresentation):
2386         (WebKit::WebCacheStorageConnection::clearMemoryRepresentationCompleted):
2387         * WebProcess/Cache/WebCacheStorageConnection.h:
2388         * WebProcess/Cache/WebCacheStorageConnection.messages.in:
2389
2390 2017-09-13  Andy Estes  <aestes@apple.com>
2391
2392         [CF] Upstream CFNetwork-related WebKitSystemInterface functions
2393         https://bugs.webkit.org/show_bug.cgi?id=176729
2394
2395         Reviewed by Alex Christensen.
2396
2397         * Shared/mac/WebCoreArgumentCodersMac.mm:
2398         (IPC::createSerializableRepresentation):
2399         (IPC::dictionaryValueOfType):
2400         (IPC::createArchiveList):
2401         (IPC::createCFURLRequestFromSerializableRepresentation):
2402         (IPC::createNSURLRequestFromSerializableRepresentation):
2403         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
2404         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
2405         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2406         (WebKit::WebProcessPool::legacyPlatformDefaultCacheStorageDirectory):
2407         (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
2408         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2409         (InitWebCoreSystemInterface):
2410
2411 2017-09-13  Alex Christensen  <achristensen@webkit.org>
2412
2413         Add WKUIDelegatePrivate equivalent of WKPageUIClient's setIsResizable, getWindowFrame, and setWindowFrame
2414         https://bugs.webkit.org/show_bug.cgi?id=176857
2415         <rdar://problem/29270035>
2416
2417         Reviewed by Tim Horton.
2418
2419         isResizable is unreachable code because nothing sends Messages::WebPageProxy::GetIsResizable, so I removed it.
2420
2421         * UIProcess/API/APIUIClient.h:
2422         (API::UIClient::setStatusBarIsVisible):
2423         (API::UIClient::isResizable): Deleted.
2424         * UIProcess/API/C/WKPage.cpp:
2425         (WKPageSetPageUIClient):
2426         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2427         * UIProcess/API/glib/WebKitUIClient.cpp:
2428         * UIProcess/Cocoa/UIDelegate.h:
2429         * UIProcess/Cocoa/UIDelegate.mm:
2430         (WebKit::UIDelegate::setDelegate):
2431         (WebKit::UIDelegate::UIClient::setIsResizable):
2432         (WebKit::UIDelegate::UIClient::setWindowFrame):
2433         (WebKit::UIDelegate::UIClient::windowFrame):
2434         * UIProcess/WebPageProxy.cpp:
2435         (WebKit::WebPageProxy::getIsResizable): Deleted.
2436         * UIProcess/WebPageProxy.h:
2437         * UIProcess/WebPageProxy.messages.in:
2438
2439 2017-09-13  Youenn Fablet  <youenn@apple.com>
2440
2441         Add a lambda-based map for Vectors
2442         https://bugs.webkit.org/show_bug.cgi?id=176487
2443
2444         Reviewed by Darin Adler.
2445
2446         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2447         (WebKit::CacheStorage::Caches::readCachesFromDisk):
2448
2449 2017-09-13  John Wilander  <wilander@apple.com>
2450
2451         Introduce Storage Access API (document parts) as an experimental feature
2452         https://bugs.webkit.org/show_bug.cgi?id=175759
2453         <rdar://problem/33666847>
2454
2455         Reviewed by Alex Christensen.
2456
2457         Storage Access API is an experimental feature which allows cross-origin,
2458         sandboxed iframes to request access to their first-party storage (as
2459         opposed to partitioned storage). This might be restricted to cookies or
2460         might cover all stateful mechanisms.
2461
2462         It introduces the following three developer-facing things:
2463         - A new readonly attribute, document.hasStorageAccess.
2464         - A new function, document.requestStorageAccess().
2465         - A new iframe sandbox token, allow-storage-access-by-user-activation.
2466
2467         * Shared/WebCoreArgumentCoders.cpp:
2468         (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
2469         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
2470             Storage handling of the new type of data.
2471         * Shared/WebPreferencesDefinitions.h:
2472         * UIProcess/API/C/WKPreferences.cpp:
2473         (WKPreferencesSetStorageAccessAPIEnabled):
2474         (WKPreferencesGetStorageAccessAPIEnabled):
2475         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2476         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2477             Bumped the model version from 9 to 10.
2478         * WebProcess/WebPage/WebPage.cpp:
2479         (WebKit::WebPage::updatePreferences):
2480
2481 2017-09-13  Sergio Villar Senin  <svillar@igalia.com>
2482
2483         [WebVR] Add IDLs and stubs
2484         https://bugs.webkit.org/show_bug.cgi?id=174202
2485
2486         Reviewed by Dean Jackson.
2487
2488         * Shared/WebPreferencesDefinitions.h:
2489         * WebProcess/WebPage/WebPage.cpp:
2490         (WebKit::WebPage::updatePreferences):
2491
2492 2017-09-12  Ryosuke Niwa  <rniwa@webkit.org>
2493
2494         Dragging & dropping a file creates an attachment element even when it's disabled
2495         https://bugs.webkit.org/show_bug.cgi?id=176769
2496
2497         Reviewed by Tim Horton.
2498
2499         * UIProcess/API/C/WKPreferences.cpp:
2500         (WKPreferencesSetAttachmentElementEnabled):
2501         (WKPreferencesGetAttachmentElementEnabled):
2502         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2503         * WebProcess/WebPage/WebPage.cpp:
2504         (WebKit::WebPage::updatePreferences):
2505
2506 2017-09-12  Youenn Fablet  <youenn@apple.com>
2507
2508         Introduce a RecordData for Cache to efficiently check whether it matches a corresponding request or not
2509         https://bugs.webkit.org/show_bug.cgi?id=176579
2510
2511         Reviewed by Alex Christensen.
2512
2513         Introducing RecordData that splits its stored data in mandatory data,
2514         used to check a record with a request and optional data that is
2515         necessary to build a CacheStorageEngine::Record used by WebProcess.
2516
2517         The mandatory data contains the URL, Vary header information and identifiers.
2518         Adding routines to go from a Record to RecordData and vice versa.
2519         Storing in CacheStorage::Cache RecordData instead of Record.
2520
2521         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
2522         (WebKit::CacheStorage::queryCache):
2523         (WebKit::CacheStorage::updateVaryInformation):
2524         (WebKit::CacheStorage::toRecord):
2525         (WebKit::CacheStorage::toRecordData):
2526         (WebKit::CacheStorage::Cache::retrieveRecords const):
2527         (WebKit::CacheStorage::Cache::addRecord):
2528         (WebKit::CacheStorage::Cache::recordsFromURL):
2529         (WebKit::CacheStorage::Cache::recordsFromURL const):
2530         (WebKit::CacheStorage::Cache::put):
2531         (WebKit::CacheStorage::Cache::writeRecordToDisk):
2532         (WebKit::CacheStorage::Cache::removeRecordFromDisk):
2533         * NetworkProcess/cache/CacheStorageEngineCache.h:
2534
2535 2017-09-12  Dan Bernstein  <mitz@apple.com>
2536
2537         Tried to fix the iOS 10 build after r221930.
2538
2539         * UIProcess/API/Cocoa/WKWebView.mm:
2540         (-[WKWebView _initializeWithConfiguration:]):
2541         (-[WKWebView _setDragInteractionPolicy:]):
2542
2543 2017-09-12  Dan Bernstein  <mitz@apple.com>
2544
2545         Update availability annotations to match the macOS 10.13 and iOS 11.0 GM seed SDKs
2546         https://bugs.webkit.org/show_bug.cgi?id=176793
2547
2548         Reviewed by Tim Horton.
2549
2550         Changed WK_MAC_TBA and WK_IOS_TBA to 10.13 and 11.0, respectively, in all declarations that
2551         appear in the GM seed SDKs. Additional changes and exceptions are noted below.
2552
2553         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Added missing availability annotation to
2554           -_webView:dataOwnerForDropSession: and -_webView:dataOwnerForDragSession:.
2555
2556         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Removed rednundant
2557           __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000 guards.
2558
2559         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: Added missing availability annotation to
2560           -_setResourceLoadStatisticsTestingCallback:.
2561
2562         * UIProcess/API/Cocoa/_WKFullscreenDelegate.h: Added missing availability annotation.
2563
2564         * UIProcess/API/Cocoa/_WKLinkIconParameters.h: Added availability annotation that had been
2565           missing since macOS 10.12.3 and iOS 10.3. Corrected annotation for _WKLinkIconParameters.
2566
2567         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h: Added missing TBA annotation to
2568           _resourceLoadStatisticsDirectory.
2569
2570         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h: Removed iOS
2571           availability from macOS-only declaration and vice versa.
2572
2573         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.mm:
2574         (-[WKWebProcessPlugInRangeHandle detectDataWithTypes:context:]): Removed an availability
2575           annotation from this method implementation.
2576
2577         * Shared/API/Cocoa/WKDragDestinationAction.h:
2578         * UIProcess/API/Cocoa/WKContentRuleList.h:
2579         * UIProcess/API/Cocoa/WKContentRuleListStore.h:
2580         * UIProcess/API/Cocoa/WKError.h:
2581         * UIProcess/API/Cocoa/WKFrameInfo.h:
2582         * UIProcess/API/Cocoa/WKHTTPCookieStore.h:
2583         * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
2584         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
2585         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2586         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2587         * UIProcess/API/Cocoa/WKSnapshotConfiguration.h:
2588         * UIProcess/API/Cocoa/WKURLSchemeHandler.h:
2589         * UIProcess/API/Cocoa/WKURLSchemeTask.h:
2590         * UIProcess/API/Cocoa/WKURLSchemeTaskPrivate.h:
2591         * UIProcess/API/Cocoa/WKUserContentController.h:
2592         * UIProcess/API/Cocoa/WKWebView.h:
2593         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
2594         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2595         * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h:
2596         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
2597         * UIProcess/API/Cocoa/WKWindowFeaturesPrivate.h:
2598         * UIProcess/API/Cocoa/_WKActivatedElementInfo.h:
2599         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
2600         * UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h:
2601         * UIProcess/API/Cocoa/_WKGeolocationCoreLocationProvider.h:
2602         * UIProcess/API/Cocoa/_WKGeolocationPosition.h:
2603         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
2604         * UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h:
2605         * UIProcess/API/Cocoa/_WKUserContentFilterPrivate.h:
2606         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
2607         * UIProcess/_WKWebViewPrintFormatter.h:
2608         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h:
2609         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.h:
2610         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:
2611
2612 2017-09-12  Alex Christensen  <achristensen@webkit.org>
2613
2614         Add WKUIDelegatePrivate equivalent of WKPageUIClient's runModal
2615         https://bugs.webkit.org/show_bug.cgi?id=176728
2616         <rdar://problem/29270035>
2617         
2618         Covered by a new API test.
2619
2620         Reviewed by Tim Horton.
2621
2622         * UIProcess/API/APIUIClient.h:
2623         (API::UIClient::runModal):
2624         * UIProcess/API/C/WKPage.cpp:
2625         (WKPageSetPageUIClient):
2626         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2627         * UIProcess/Cocoa/UIDelegate.h:
2628         * UIProcess/Cocoa/UIDelegate.mm:
2629         (WebKit::UIDelegate::setDelegate):
2630         (WebKit::UIDelegate::UIClient::canRunModal const):
2631         (WebKit::UIDelegate::UIClient::runModal):
2632         * UIProcess/WebPageProxy.cpp:
2633         (WebKit::WebPageProxy::runModal):
2634
2635 2017-09-12  Alex Christensen  <achristensen@webkit.org>
2636
2637         Add WKUIDelegatePrivate equivalent of WKPageUIClient's decidePolicyForNotificationPermissionRequest
2638         https://bugs.webkit.org/show_bug.cgi?id=176768
2639         <rdar://problem/29270035>
2640
2641         Reviewed by Tim Horton.
2642
2643         Covered by a new API test.
2644
2645         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2646         * UIProcess/Cocoa/UIDelegate.h:
2647         * UIProcess/Cocoa/UIDelegate.mm:
2648         (WebKit::UIDelegate::setDelegate):
2649         (WebKit::UIDelegate::UIClient::runBeforeUnloadConfirmPanel):
2650         (WebKit::UIDelegate::UIClient::exceededDatabaseQuota):
2651         (WebKit::UIDelegate::UIClient::decidePolicyForNotificationPermissionRequest):
2652         (WebKit::UIDelegate::UIClient::reachedApplicationCacheOriginQuota):
2653
2654 2017-09-11  Wenson Hsieh  <wenson_hsieh@apple.com>
2655
2656         [iOS DnD] Support DataTransfer.setDragImage when starting a drag on iOS
2657         https://bugs.webkit.org/show_bug.cgi?id=176721
2658         <rdar://problem/34373660>
2659
2660         Reviewed by Tim Horton.
2661
2662         Rename elementBounds => dragPreviewFrameInRootViewCoordinates.
2663
2664         * UIProcess/ios/DragDropInteractionState.h:
2665         * UIProcess/ios/DragDropInteractionState.mm:
2666         (WebKit::DragDropInteractionState::previewForDragItem const):
2667         (WebKit::DragDropInteractionState::stageDragItem):
2668
2669 2017-09-11  Tim Horton  <timothy_horton@apple.com>
2670
2671         REGRESSION (r221272): WKWebView gets stuck zoomed in if the web process crashes
2672         https://bugs.webkit.org/show_bug.cgi?id=176767
2673         <rdar://problem/34196874>
2674
2675         Reviewed by Dan Bernstein.
2676
2677         * UIProcess/API/Cocoa/WKWebView.mm:
2678         (-[WKWebView _processDidExit]):
2679         Reset the "last sent" layout parameters when the Web Content process exits.
2680         They're no longer "last sent", and if we short-circuit from sending them
2681         again (from under _didRelaunchProcess), we will never send the correct
2682         layout width (until it changes).
2683
2684 2017-09-11  Wenson Hsieh  <wenson_hsieh@apple.com>
2685
2686         [iOS WK2] Support tapping to add items to the current drag session in web content
2687         https://bugs.webkit.org/show_bug.cgi?id=176421
2688         <rdar://problem/31144674>
2689
2690         Reviewed by Tim Horton.
2691
2692         To request additional drag items, end the current drag in the web page and try to begin a drag at the new
2693         location. This process is transparent to the UI process, which still maintains the same UIDragSession with the
2694         old drag source.
2695
2696         As opposed to firing a new event (for instance: `adddragitem`), this approach is taken to ensure that if the
2697         page wants to preventDefault() on `dragstart`, it would also prevent the user from adding it as an additional
2698         drag item. Using the new event approach, dealing with this case would either require the page to listen for a
2699         new event and call preventDefault(), which would break compatibility with pages that only preventDefault() on
2700         `dragstart`, or it would require the default behavior of this new event to be _not_ adding a drag item, in which
2701         case this approach would require pages to adopt the new event in some form.
2702
2703         * WebProcess/WebPage/ios/WebPageIOS.mm:
2704         (WebKit::WebPage::requestAdditionalItemsForDragSession):
2705
2706 2017-09-11  Alex Christensen  <achristensen@webkit.org>
2707
2708         Clean up API::UIClient
2709         https://bugs.webkit.org/show_bug.cgi?id=176568
2710
2711         Reviewed by Brady Eidson.
2712
2713         We don't need createNewPage and createNewPageAsync.
2714         An async version can support synchronous delegate calls by just calling the completion handler synchronously.
2715
2716         * UIProcess/API/APIUIClient.h:
2717         (API::UIClient::createNewPage):
2718         (API::UIClient::createNewPageAsync): Deleted.
2719         (API::UIClient::canCreateNewPageAsync): Deleted.
2720         * UIProcess/API/C/WKPage.cpp:
2721         (WKPageSetPageUIClient):
2722         * UIProcess/API/glib/WebKitUIClient.cpp:
2723         * UIProcess/API/glib/WebKitUIClient.h:
2724         * UIProcess/Cocoa/UIDelegate.h:
2725         * UIProcess/Cocoa/UIDelegate.mm:
2726         (WebKit::UIDelegate::UIClient::createNewPage):
2727         (WebKit::UIDelegate::UIClient::createNewPageCommon): Deleted.
2728         (WebKit::UIDelegate::UIClient::canCreateNewPageAsync): Deleted.
2729         (WebKit::UIDelegate::UIClient::createNewPageAsync): Deleted.
2730         * UIProcess/WebPageProxy.cpp:
2731         (WebKit::WebPageProxy::createNewPage):
2732         * UIProcess/WebPageProxy.h:
2733
2734 2017-09-11  Alex Christensen  <achristensen@webkit.org>
2735
2736         Fix memory leak introduced in r221894.
2737         https://bugs.webkit.org/show_bug.cgi?id=176753
2738
2739         * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp:
2740         (WebKit::NotificationPermissionRequestManagerProxy::createRequest):
2741         The NotificationPermissionRequestManagerProxy keeps track of pending requests
2742         so they can be denied when invalidating the page.  We add them to a HashMap and in
2743         r221894 I removed the code that removes them from that map once the request is complete.
2744         This code adds the completed task removal back.
2745         The NotificationPermissionRequestManagerProxy and WebPageProxy have the same lifetime,
2746         so protecting the WebPageProxy (m_page) makes sure there is no use-after-free when the
2747         completion handler is called.
2748
2749 2017-09-11  Alex Christensen  <achristensen@webkit.org>
2750
2751         Make NotificationPermissionRequest work with completion handlers
2752         https://bugs.webkit.org/show_bug.cgi?id=176753
2753
2754         Reviewed by Andy Estes.
2755
2756         API::UIClient::decidePolicyForNotificationPermissionRequest should take a completion handler
2757         which it will eventually call with a bool representing whether notifications are allowed.
2758         To do this, I make NotificationPermissionRequest just a wrapper for a lambda.
2759         One subtle change in behavior is when invalidating all outstanding requests, we deny them instead
2760         of just dropping them.  This results in a deny message sent where there wasn't one before,
2761         resulting in better cleanup in NotificationPermissionRequestManager::didReceiveNotificationPermissionDecision.
2762
2763         * UIProcess/API/APIUIClient.h:
2764         (API::UIClient::decidePolicyForNotificationPermissionRequest):
2765         * UIProcess/API/C/WKPage.cpp:
2766         (WKPageSetPageUIClient):
2767         * UIProcess/Notifications/NotificationPermissionRequest.cpp: Removed.
2768         * UIProcess/Notifications/NotificationPermissionRequest.h:
2769         (WebKit::NotificationPermissionRequest::create):
2770         (WebKit::NotificationPermissionRequest::allow):
2771         (WebKit::NotificationPermissionRequest::deny):
2772         (WebKit::NotificationPermissionRequest::NotificationPermissionRequest):
2773         * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp:
2774         (WebKit::NotificationPermissionRequestManagerProxy::invalidateRequests):
2775         (WebKit::NotificationPermissionRequestManagerProxy::createRequest):
2776         (WebKit::NotificationPermissionRequestManagerProxy::didReceiveNotificationPermissionDecision): Deleted.
2777         * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.h:
2778         * UIProcess/WebPageProxy.cpp:
2779         (WebKit::WebPageProxy::requestNotificationPermission):
2780         * WebKit.xcodeproj/project.pbxproj:
2781
2782 2017-09-11  Alex Christensen  <achristensen@webkit.org>
2783
2784         Modernize and make API::UIClient more asynchronous
2785         https://bugs.webkit.org/show_bug.cgi?id=176583
2786
2787         Reviewed by Brian Burg.
2788
2789         API::UIClient calls that return values synchronously require synchronous APIs unnecessarily.
2790         Having them call completion handlers with the results instead allows us to make asynchronous
2791         APIs, and existing synchronous APIs can just call the completion handlers immediately.
2792         
2793         Unfortunately an assumption that API::UIClient::windowFrame returns synchronously had worked
2794         its way into the WebAutomationSession, which calls WebPageProxy::getWindowFrame.  Making it
2795         asynchronous required making some automation protocols asynchronous so they can send their
2796         result once they have the resulting frames from the UIClient.
2797         
2798         No change in behaviour.
2799
2800         * UIProcess/API/APIUIClient.h:
2801         (API::UIClient::setToolbarsAreVisible):
2802         (API::UIClient::menuBarIsVisible):
2803         (API::UIClient::setMenuBarIsVisible):
2804         (API::UIClient::statusBarIsVisible):
2805         (API::UIClient::setStatusBarIsVisible):
2806         (API::UIClient::isResizable):
2807         (API::UIClient::setIsResizable):
2808         (API::UIClient::setWindowFrame):
2809         (API::UIClient::windowFrame):
2810         (API::UIClient::headerHeight):
2811         (API::UIClient::footerHeight):
2812         (API::UIClient::drawHeader):
2813         (API::UIClient::drawFooter):
2814         (API::UIClient::printFrame):
2815         * UIProcess/API/C/WKPage.cpp:
2816         (WKPageSetPageUIClient):
2817         * UIProcess/Automation/Automation.json:
2818         * UIProcess/Automation/WebAutomationSession.cpp:
2819         (WebKit::WebAutomationSession::buildBrowsingContextForPage):
2820         (WebKit::WebAutomationSession::getNextContext):
2821         (WebKit::WebAutomationSession::getBrowsingContexts):
2822         (WebKit::WebAutomationSession::getBrowsingContext):
2823         (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext):
2824         (WebKit::WebAutomationSession::moveWindowOfBrowsingContext):
2825         (WebKit::WebAutomationSession::performMouseInteraction):
2826         * UIProcess/Automation/WebAutomationSession.h:
2827         * UIProcess/Cocoa/UIDelegate.h:
2828         * UIProcess/Cocoa/UIDelegate.mm:
2829         (WebKit::UIDelegate::UIClient::printFrame):
2830         * UIProcess/Cocoa/WebViewImpl.mm:
2831         (WebKit::WebViewImpl::printOperationWithPrintInfo):
2832         * UIProcess/WebPageProxy.cpp:
2833         (WebKit::WebPageProxy::runJavaScriptPrompt):
2834         (WebKit::WebPageProxy::setToolbarsAreVisible):
2835         (WebKit::WebPageProxy::setMenuBarIsVisible):
2836         (WebKit::WebPageProxy::getMenuBarIsVisible):
2837         (WebKit::WebPageProxy::setStatusBarIsVisible):
2838         (WebKit::WebPageProxy::getStatusBarIsVisible):
2839         (WebKit::WebPageProxy::setIsResizable):
2840         (WebKit::WebPageProxy::getIsResizable):
2841         (WebKit::WebPageProxy::setWindowFrame):
2842         (WebKit::WebPageProxy::getWindowFrame):
2843         (WebKit::WebPageProxy::getWindowFrameWithCompletionHandler):
2844         (WebKit::WebPageProxy::screenToRootView):
2845         (WebKit::WebPageProxy::rootViewToScreen):
2846         (WebKit::WebPageProxy::printFrame):
2847         (WebKit::WebPageProxy::headerHeight):
2848         (WebKit::WebPageProxy::footerHeight):
2849         (WebKit::WebPageProxy::drawHeader):
2850         (WebKit::WebPageProxy::drawFooter):
2851         * UIProcess/WebPageProxy.h:
2852         * UIProcess/WebPageProxy.messages.in:
2853         * UIProcess/mac/WKPrintingView.h:
2854         * UIProcess/mac/WKPrintingView.mm:
2855         (-[WKPrintingView initWithFrameProxy:view:]):
2856         (-[WKPrintingView _adjustPrintingMarginsForHeaderAndFooter]):
2857         (-[WKPrintingView drawPageBorderWithSize:]):
2858         * UIProcess/mac/WebPageProxyMac.mm:
2859         (WebKit::WebPageProxy::windowAndViewFramesChanged):
2860
2861 2017-09-11  Stephan Szabo  <stephan.szabo@sony.com>
2862
2863         [WinCairo] Add entry Web Process files for wincairo webkit
2864         https://bugs.webkit.org/show_bug.cgi?id=176570
2865
2866         Reviewed by Alex Christensen.
2867
2868         * PlatformWin.cmake:
2869         * WebProcess/EntryPoint/win/WebProcessMain.cpp: Added.
2870         * WebProcess/win/WebProcessMainWin.cpp: Added.
2871         * WebProcess/win/WebProcessMainWin.h: Added.
2872
2873 2017-09-11  Alex Christensen  <achristensen@webkit.org>
2874
2875         Add WKUIDelegatePrivate equivalent of WKPageUIClient's decidePolicyForGeolocationPermissionRequest
2876         https://bugs.webkit.org/show_bug.cgi?id=176642
2877         <rdar://problem/29270035>
2878
2879         Reviewed by Darin Adler.
2880
2881         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2882         * UIProcess/Cocoa/UIDelegate.h:
2883         * UIProcess/Cocoa/UIDelegate.mm:
2884         (WebKit::UIDelegate::setDelegate):
2885         (WebKit::UIDelegate::UIClient::runJavaScriptPrompt):
2886         (WebKit::Function<void):
2887
2888 2017-09-11  Wenson Hsieh  <wenson_hsieh@apple.com>
2889
2890         [iOS DnD] Elements in the DOM with the `draggable` attribute should be draggable
2891         https://bugs.webkit.org/show_bug.cgi?id=176664
2892         <rdar://problem/32596156>
2893
2894         Reviewed by Tim Horton.
2895
2896         Makes a simple adjustment in DragDropInteractionState::previewForDragItem to respect the drag image supplied to
2897         the UI process during a "DHTML"-defined drag (i.e. DragSourceActionDHTML).
2898
2899         Test: DataInteractionTests.CanStartDragOnDivWithDraggableAttribute
2900
2901         * UIProcess/API/Cocoa/WKWebView.mm:
2902         (-[WKWebView _simulateDataInteractionEntered:]): Deleted.
2903         (-[WKWebView _simulateDataInteractionUpdated:]): Deleted.
2904         (-[WKWebView _simulateDataInteractionPerformOperation:]): Deleted.
2905         (-[WKWebView _simulateDataInteractionEnded:]): Deleted.
2906         (-[WKWebView _simulateDataInteractionSessionDidEnd:]): Deleted.
2907         (-[WKWebView _simulateWillBeginDataInteractionWithSession:]): Deleted.
2908         (-[WKWebView _simulatedItemsForSession:]): Deleted.
2909         (-[WKWebView _simulateItemsForAddingToSession:atLocation:completion:]): Deleted.
2910         (-[WKWebView _simulatePrepareForDataInteractionSession:completion:]): Deleted.
2911
2912         Remove all -_simulate*: testing helpers on WKWebView.
2913
2914         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2915         * UIProcess/ios/DragDropInteractionState.mm:
2916         (WebKit::shouldUseDragImageToCreatePreviewForDragSource):
2917         (WebKit::shouldUseTextIndicatorToCreatePreviewForDragSource):
2918
2919         Add shouldUseDragImageToCreatePreviewForDragSource, which returns YES when dragging an image or DHTML-defined
2920         draggable element and the drag image exists. This is called from previewForDragItem when constructing the drag
2921         preview for a given UIDragItem.
2922
2923         (WebKit::DragDropInteractionState::previewForDragItem const):
2924         (WebKit::shouldUseTextIndicatorToCreatePreviewForDragAction): Deleted.
2925         * UIProcess/ios/WKContentViewInteraction.h:
2926         * UIProcess/ios/WKContentViewInteraction.mm:
2927         (-[WKContentView _simulateDataInteractionEntered:]): Deleted.
2928         (-[WKContentView _simulateDataInteractionUpdated:]): Deleted.
2929         (-[WKContentView _simulateDataInteractionEnded:]): Deleted.
2930         (-[WKContentView _simulateDataInteractionPerformOperation:]): Deleted.
2931         (-[WKContentView _simulateDataInteractionSessionDidEnd:]): Deleted.
2932         (-[WKContentView _simulateWillBeginDataInteractionWithSession:]): Deleted.
2933         (-[WKContentView _simulatedItemsForSession:]): Deleted.
2934         (-[WKContentView _simulatePrepareForDataInteractionSession:completion:]): Deleted.
2935         (-[WKContentView _simulateItemsForAddingToSession:atLocation:completion:]): Deleted.
2936
2937         Remove all -_simulate*: testing helpers on WKContentView.
2938
2939 2017-09-11  Alex Christensen  <achristensen@webkit.org>
2940
2941         Modernize BoxExtent into RectEdges
2942         https://bugs.webkit.org/show_bug.cgi?id=176437
2943
2944         Reviewed by Simon Fraser.
2945
2946         * Scripts/webkit/messages.py:
2947         (class_template_headers):
2948         * Shared/WebCoreArgumentCoders.h:
2949         * UIProcess/WebPageProxy.h:
2950         * UIProcess/WebPageProxy.messages.in:
2951         * WebProcess/WebPage/WebPage.messages.in:
2952
2953 2017-09-11  Andy Estes  <aestes@apple.com>
2954
2955         [Mac] Upstream QTKit-related WebKitSystemInterface functions
2956         https://bugs.webkit.org/show_bug.cgi?id=176472
2957
2958         Reviewed by Eric Carlson.
2959
2960         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2961         (InitWebCoreSystemInterface):
2962
2963 2017-09-11  JF Bastien  <jfbastien@apple.com>
2964
2965         cmake build fix
2966
2967         Unreviewed
2968
2969         * PlatformMac.cmake: one file was deleted, another renamed.
2970
2971 2017-09-10  Carlos Garcia Campos  <cgarcia@igalia.com>
2972
2973         REGRESSION: [GTK] Generated HTML API documentation is missing descriptions
2974         https://bugs.webkit.org/show_bug.cgi?id=176667
2975
2976         Reviewed by Michael Catanzaro.
2977
2978         Fix several typos in API documentation.
2979
2980         * UIProcess/API/glib/WebKitSettings.cpp:
2981         (webkit_settings_class_init):
2982         * UIProcess/API/glib/WebKitWebView.cpp:
2983         (webkit_web_view_class_init):
2984         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
2985         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
2986
2987 2017-09-10  Brady Eidson  <beidson@apple.com>
2988
2989         Try to avoid creating the default WKWebsiteDataStore until its actually needed.
2990         <rdar://problem/33164453> and https://bugs.webkit.org/show_bug.cgi?id=176551
2991
2992         Reviewed by Tim Horton.
2993
2994         * UIProcess/API/APIHTTPCookieStore.cpp:
2995         (API::HTTPCookieStore::cookies):
2996         (API::HTTPCookieStore::setCookie):
2997         (API::HTTPCookieStore::deleteCookie):
2998
2999         * UIProcess/API/APIWebsiteDataStore.cpp:
3000         (API::WebsiteDataStore::defaultDataStore):
3001         (API::WebsiteDataStore::defaultDataStoreExists):
3002         * UIProcess/API/APIWebsiteDataStore.h:
3003
3004         * UIProcess/API/C/WKContext.cpp:
3005         (WKContextGetWebsiteDataStore):
3006
3007         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3008         (+[WKWebsiteDataStore _defaultDataStoreExists]):
3009         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
3010
3011         * UIProcess/WebProcessPool.cpp:
3012         (WebKit::WebProcessPool::WebProcessPool):
3013         (WebKit::m_hiddenPageThrottlingTimer):
3014         (WebKit::WebProcessPool::ensureNetworkProcess):
3015         (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
3016         (WebKit::WebProcessPool::warmInitialProcess):
3017         (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
3018         (WebKit::WebProcessPool::createWebPage):
3019         (WebKit::WebProcessPool::pageAddedToProcess):
3020         * UIProcess/WebProcessPool.h:
3021
3022         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3023         (WebKit::WebsiteDataStore::isAssociatedProcessPool const):
3024
3025 2017-09-09  Mark Lam  <mark.lam@apple.com>
3026
3027         Avoid duplicate computations of ExecState::vm().
3028         https://bugs.webkit.org/show_bug.cgi?id=176647
3029
3030         Reviewed by Saam Barati.
3031
3032         * WebProcess/Plugins/Netscape/JSNPMethod.h:
3033         (WebKit::JSNPMethod::create):
3034         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
3035         (WebKit::NPJSObject::setProperty):
3036         (WebKit::NPJSObject::removeProperty):
3037         (WebKit::NPJSObject::enumerate):
3038
3039 2017-09-08  Joseph Pecoraro  <pecoraro@apple.com>
3040
3041         Fetch's Response.statusText is unexpectedly the full http status line for HTTP/2 responses
3042         https://bugs.webkit.org/show_bug.cgi?id=176479
3043
3044         Reviewed by Alex Christensen.
3045
3046         * NetworkProcess/NetworkProcess.cpp:
3047         (WebKit::NetworkProcess::initializeNetworkProcess):
3048         Initialize AtomicString statics like emptyAtom().
3049
3050 2017-09-08  Commit Queue  <commit-queue@webkit.org>
3051
3052         Unreviewed, rolling out r221773.
3053         https://bugs.webkit.org/show_bug.cgi?id=176614
3054
3055         This caused build failures. (Requested by mlewis13 on
3056         #webkit).
3057
3058         Reverted changeset:
3059
3060         "[Mac] Upstream QTKit-related WebKitSystemInterface functions"
3061         https://bugs.webkit.org/show_bug.cgi?id=176472
3062         http://trac.webkit.org/changeset/221773
3063
3064 2017-09-08  Stephan Szabo  <stephan.szabo@am.sony.com>
3065
3066         [WinCairo] Add Storage Process files for wincairo webkit
3067         https://bugs.webkit.org/show_bug.cgi?id=176567
3068
3069         Reviewed by Alex Christensen.
3070
3071         * PlatformWin.cmake:
3072         * StorageProcess/EntryPoint/win/StorageProcessMain.cpp: Added.
3073         (main):
3074         * StorageProcess/win/StorageProcessMainWin.cpp: Added.
3075         (WebKit::StorageProcessMainWin):
3076         * StorageProcess/win/StorageProcessMainWin.h: Added.
3077
3078 2017-09-08  Ryan Haddad  <ryanhaddad@apple.com>
3079
3080         Unreviewed, rolling out r221771.
3081
3082         This change caused two API tests to crash.
3083
3084         Reverted changeset:
3085
3086         "Clean up API::UIClient"
3087         https://bugs.webkit.org/show_bug.cgi?id=176568
3088         http://trac.webkit.org/changeset/221771
3089
3090 2017-09-07  Carlos Garcia Campos  <cgarcia@igalia.com>
3091
3092         [GTK][WPE] UI process crash in WebBackForwardList::restoreFromState
3093         https://bugs.webkit.org/show_bug.cgi?id=176303
3094
3095         Reviewed by Michael Catanzaro.
3096
3097         Ensure the current index provided by the session state is not out of actual item list bounds. This is a bug in
3098         the session state decoder, but WebBackForwardList::backForwardListState() is already doing the check and using
3099         the last item index instead, so it's not easy to know where the actual problem is. In any case we should
3100         still protect the decoder.
3101
3102         * UIProcess/API/glib/WebKitWebViewSessionState.cpp:
3103         (decodeSessionState):
3104
3105 2017-09-07  Andy Estes  <aestes@apple.com>
3106
3107         [Mac] Upstream QTKit-related WebKitSystemInterface functions
3108         https://bugs.webkit.org/show_bug.cgi?id=176472
3109
3110         Reviewed by Eric Carlson.
3111
3112         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
3113         (InitWebCoreSystemInterface):
3114
3115 2017-09-07  Alex Christensen  <achristensen@webkit.org>
3116
3117         Clean up API::UIClient
3118         https://bugs.webkit.org/show_bug.cgi?id=176568
3119
3120         Reviewed by Brady Eidson.
3121
3122         We don't need createNewPage and createNewPageAsync.
3123         An async version can support synchronous delegate calls by just calling the completion handler synchronously.
3124
3125         * UIProcess/API/APIUIClient.h:
3126         (API::UIClient::createNewPage):
3127         (API::UIClient::createNewPageAsync): Deleted.
3128         (API::UIClient::canCreateNewPageAsync): Deleted.
3129         * UIProcess/API/C/WKPage.cpp:
3130         (WKPageSetPageUIClient):
3131         * UIProcess/API/glib/WebKitUIClient.cpp:
3132         * UIProcess/API/glib/WebKitUIClient.h:
3133         * UIProcess/Cocoa/UIDelegate.h:
3134         * UIProcess/Cocoa/UIDelegate.mm:
3135         (WebKit::UIDelegate::UIClient::createNewPage):
3136         (WebKit::UIDelegate::UIClient::createNewPageCommon): Deleted.
3137         (WebKit::UIDelegate::UIClient::canCreateNewPageAsync): Deleted.
3138         (WebKit::UIDelegate::UIClient::createNewPageAsync): Deleted.
3139         * UIProcess/WebPageProxy.cpp:
3140         (WebKit::WebPageProxy::createNewPage):
3141         * UIProcess/WebPageProxy.h:
3142
3143 2017-09-07  Alex Christensen  <achristensen@webkit.org>
3144
3145         Make DragControllerAction an enum class
3146         https://bugs.webkit.org/show_bug.cgi?id=176565
3147
3148         Reviewed by Andy Estes.
3149
3150         * Shared/DragControllerAction.h:
3151         (): Deleted.
3152         * UIProcess/WebPageProxy.cpp:
3153         (WebKit::WebPageProxy::dragEntered):
3154         (WebKit::WebPageProxy::dragUpdated):
3155         (WebKit::WebPageProxy::dragExited):
3156         (WebKit::WebPageProxy::performDragOperation):
3157         * WebProcess/WebPage/WebPage.cpp:
3158         (WebKit::WebPage::performDragControllerAction):
3159         * WebProcess/WebPage/WebPage.h:
3160         * WebProcess/WebPage/WebPage.messages.in:
3161
3162 2017-09-07  Myles C. Maxfield  <mmaxfield@apple.com>
3163
3164         [PAL] Unify PlatformUserPreferredLanguages.h with Language.h
3165         https://bugs.webkit.org/show_bug.cgi?id=176561
3166
3167         Reviewed by Brent Fulgham.
3168
3169         * UIProcess/WebProcessPool.cpp:
3170         * WebProcess/WebProcess.cpp:
3171         (WebKit::WebProcess::userPreferredLanguagesChanged const):
3172
3173 2017-09-07  Youenn Fablet  <youenn@apple.com>
3174
3175         Remove entry from CacheStorageEngineConnection lock map when unlocking a Cache
3176         https://bugs.webkit.org/show_bug.cgi?id=176548
3177
3178         Reviewed by Alex Christensen.
3179
3180         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
3181         (WebKit::CacheStorageEngineConnection::dereference):
3182
3183 2017-09-07  Chris Dumez  <cdumez@apple.com>
3184
3185         [WK2] Add C API to retrieve the originating page of a WKDownload
3186         https://bugs.webkit.org/show_bug.cgi?id=176557
3187         <rdar://problem/34314776>
3188
3189         Reviewed by Alex Christensen.
3190
3191         Add C API to retrieve the original page of a WKDownload. This is the C API equivalent to
3192         _WKDownload.originatingWebView which already exists in ObjC. The pointer is weak so as
3193         to not keep alive the page for the duration of the download.
3194
3195         * UIProcess/API/C/WKDownload.cpp:
3196         (WKDownloadGetOriginatingPage):
3197         * UIProcess/API/C/WKDownload.h:
3198         * UIProcess/API/Cocoa/_WKDownload.mm:
3199         (-[_WKDownload originatingWebView]):
3200         * UIProcess/API/Cocoa/_WKDownloadInternal.h:
3201         * UIProcess/Downloads/DownloadProxy.cpp:
3202         (WebKit::DownloadProxy::originatingPage const):
3203         (WebKit::DownloadProxy::setOriginatingPage):
3204         * UIProcess/Downloads/DownloadProxy.h:
3205         * UIProcess/WebPageProxy.cpp:
3206         (WebKit::WebPageProxy::receivedPolicyDecision):
3207         * UIProcess/WebProcessPool.cpp:
3208         (WebKit::WebProcessPool::download):
3209         (WebKit::WebProcessPool::resumeDownload):
3210         (WebKit::WebProcessPool::createDownloadProxy):
3211         * UIProcess/WebProcessPool.h:
3212         * UIProcess/ios/PageClientImplIOS.mm:
3213         (WebKit::PageClientImpl::handleDownloadRequest):
3214         * UIProcess/mac/PageClientImplMac.mm:
3215         (WebKit::PageClientImpl::handleDownloadRequest):
3216
3217 2017-09-07  Alex Christensen  <achristensen@webkit.org>
3218
3219         Clean up Geolocation request handling
3220         https://bugs.webkit.org/show_bug.cgi?id=176562
3221
3222         Reviewed by Tim Horton.
3223
3224         Instead of passing a GeolocationPermissionRequestProxy& to each client and returning a bool if the request will be handled,
3225         pass a Function<void(bool)>&& completionHandler and return the function if it won't be handled.
3226         This allows to temporarily support our UIClient/PageClient hybrid design while moving towards a sane design.
3227
3228         * UIProcess/API/APIUIClient.h:
3229         (API::UIClient::Function<void):
3230         (API::UIClient::decidePolicyForGeolocationPermissionRequest): Deleted.
3231         * UIProcess/API/C/WKAPICast.h:
3232         * UIProcess/API/C/WKGeolocationPermissionRequest.cpp:
3233         (WKGeolocationPermissionRequestGetTypeID):
3234         * UIProcess/API/C/WKPage.cpp:
3235         (WKPageSetPageUIClient):
3236         * UIProcess/GeolocationPermissionRequestProxy.cpp:
3237         (WebKit::GeolocationPermissionRequestProxy::allow):
3238         (WebKit::GeolocationPermissionRequestProxy::deny):
3239         (WebKit::GeolocationPermissionRequestProxy::invalidate):
3240         * UIProcess/GeolocationPermissionRequestProxy.h:
3241         (WebKit::GeolocationPermissionRequest::create):
3242         (WebKit::GeolocationPermissionRequest::allow):
3243         (WebKit::GeolocationPermissionRequest::deny):
3244         (WebKit::GeolocationPermissionRequest::GeolocationPermissionRequest):
3245         * UIProcess/PageClient.h:
3246         (WebKit::PageClient::decidePolicyForGeolocationPermissionRequest): Deleted.
3247         * UIProcess/WebPageProxy.cpp:
3248         (WebKit::WebPageProxy::requestGeolocationPermissionForFrame):
3249         * UIProcess/ios/PageClientImplIOS.h:
3250         * UIProcess/ios/PageClientImplIOS.mm:
3251         (WebKit::Function<void):
3252         (WebKit::PageClientImpl::decidePolicyForGeolocationPermissionRequest): Deleted.
3253         * UIProcess/ios/WKContentView.h:
3254         * UIProcess/ios/WKGeolocationProviderIOS.h:
3255         * UIProcess/ios/WKGeolocationProviderIOS.mm:
3256         (-[WKGeolocationProviderIOS decidePolicyForGeolocationRequestFromOrigin:frame:completionHandler:view:]):
3257         (-[WKGeolocationProviderIOS geolocationAuthorizationGranted]):
3258         (-[WKGeolocationProviderIOS geolocationAuthorizationDenied]):
3259         (-[WKWebAllowDenyPolicyListener initWithCompletionHandler:]):
3260         (-[WKWebAllowDenyPolicyListener allow]):
3261         (-[WKWebAllowDenyPolicyListener deny]):
3262         (-[WKGeolocationProviderIOS decidePolicyForGeolocationRequestFromOrigin:frame:request:view:]): Deleted.
3263         (-[WKWebAllowDenyPolicyListener initWithPermissionRequestProxy:]): Deleted.
3264
3265 2017-09-07  Alex Christensen  <achristensen@webkit.org>
3266
3267         Allow modern decoding of enums and OptionSets
3268         https://bugs.webkit.org/show_bug.cgi?id=176480
3269
3270         Reviewed by Andy Estes.
3271
3272         * Platform/IPC/ArgumentCoders.h:
3273         (IPC::ArgumentCoder<OptionSet<T>>::decode):
3274         * Platform/IPC/Decoder.h:
3275         (IPC::Decoder::operator>>):
3276         * Platform/IPC/Encoder.h:
3277         * Shared/WebsitePolicies.h:
3278         (WebKit::WebsitePolicies::encode const):
3279         (WebKit::WebsitePolicies::decode):
3280
3281 2017-09-07  Frederic Wang  <fwang@igalia.com>
3282
3283          Move more code from ScrollingTreeScrollingNodeDelegateIOS to ScrollingTreeScrollingNodeDelegate
3284          https://bugs.webkit.org/show_bug.cgi?id=174130
3285
3286          Reviewed by Simon Fraser.
3287
3288          * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h: Remove some members,
3289          headers and pre-declaration that are moved into the delegate.
3290          (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollLayer): Deleted.
3291          * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: Remove some headers and
3292          WKOverflowScrollViewDelegate since they are moved into the delegate file. Also fix the
3293          comment to closing the WebKit namespace.
3294          (WebKit::ScrollingTreeOverflowScrollingNodeIOS::~ScrollingTreeOverflowScrollingNodeIOS):
3295          Remove some code moved into the delegate and call the corresponding helper function to
3296          preserve the current behavior.
3297          (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateBeforeChildren): Ditto.
3298          Note that it is only necessary to cast the parameter to a ScrollingStateTreeNode.
3299          (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateAfterChildren): Ditto.
3300          (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterAncestorChange): Ditto.
3301          (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollPosition): Ditto.
3302          (WebKit::ScrollingTreeOverflowScrollingNodeIOS::setScrollLayerPosition): Ditto.
3303          (-[WKOverflowScrollViewDelegate initWithScrollingTreeNodeDelegate:]): Deleted.
3304          (-[WKOverflowScrollViewDelegate scrollViewDidScroll:]): Deleted.
3305          (-[WKOverflowScrollViewDelegate scrollViewWillBeginDragging:]): Deleted.
3306          (-[WKOverflowScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]): Deleted.
3307          (-[WKOverflowScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]): Deleted.
3308          (-[WKOverflowScrollViewDelegate scrollViewDidEndDecelerating:]): Deleted.
3309          * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h: Import headers and members
3310          from ScrollingTreeOverflowScrollingNodeIOS. Define new helper functions for the code imported
3311          from ScrollingTreeOverflowScrollingNodeIOS. Remove the friendship with
3312          ScrollingTreeOverflowScrollingNodeIOS and only makes public the function used by that class.
3313          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollLayer): This function is moved from
3314          ScrollingTreeOverflowScrollingNodeIOS.
3315          * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm: Add headers,
3316          WKOverflowScrollViewDelegate (renamed WKScrollingNodeScrollViewDelegate) and some helper code
3317          imported from ScrollingTreeOverflowScrollingNodeIOS.
3318          (-[WKScrollingNodeScrollViewDelegate scrollViewDidScroll:]): Moved from
3319          ScrollingTreeOverflowScrollingNodeIOS.
3320          (-[WKScrollingNodeScrollViewDelegate scrollViewWillBeginDragging:]): Ditto.
3321          (-[WKScrollingNodeScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]): Ditto.
3322          (-[WKScrollingNodeScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]): Ditto.
3323          (-[WKScrollingNodeScrollViewDelegate scrollViewDidEndDecelerating:]): Ditto.
3324          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::~ScrollingTreeScrollingNodeDelegateIOS):
3325          Import code from ScrollingTreeOverflowScrollingNodeIOS.
3326          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::resetScrollViewDelegate): New helper function
3327          importing code from ScrollingTreeOverflowScrollingNodeIOS.
3328          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateBeforeChildren): Ditto.
3329          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren): Ditto.
3330          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateLayersAfterAncestorChange): Ditto.
3331          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollPosition): Ditto.
3332          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::setScrollLayerPosition): Ditto.
3333
3334 2017-09-07  Chris Dumez  <cdumez@apple.com>
3335
3336         [WK2] Notify client when downloads are redirected
3337         https://bugs.webkit.org/show_bug.cgi?id=176481
3338         <rdar://problem/34309065>
3339
3340         Reviewed by Geoffrey Garen.
3341
3342         Notify client when downloads are redirected via both ObjC and C
3343         API.
3344
3345         * NetworkProcess/Downloads/Download.cpp:
3346         (WebKit::Download::willSendRedirectedRequest):
3347         * NetworkProcess/Downloads/Download.h:
3348         * NetworkProcess/Downloads/mac/DownloadMac.mm:
3349         (-[WKDownloadAsDelegate download:willSendRequest:redirectResponse:]):
3350         * UIProcess/API/APIDownloadClient.h:
3351         (API::DownloadClient::willSendRequest):
3352         * UIProcess/API/C/WKContext.cpp:
3353         (WKContextSetDownloadClient):
3354         * UIProcess/API/C/WKContextDownloadClient.h:
3355         * UIProcess/API/Cocoa/_WKDownloadDelegate.h:
3356         * UIProcess/Cocoa/DownloadClient.h:
3357         * UIProcess/Cocoa/DownloadClient.mm:
3358         (WebKit::DownloadClient::DownloadClient):
3359         (WebKit::DownloadClient::willSendRequest):
3360         * UIProcess/Downloads/DownloadProxy.cpp:
3361         (WebKit::DownloadProxy::willSendRequest):
3362         * UIProcess/Downloads/DownloadProxy.h:
3363         * UIProcess/Downloads/DownloadProxy.messages.in:
3364
3365         * UIProcess/mac/WebContextMenuProxyMac.mm:
3366         (WebKit::WebContextMenuProxyMac::showContextMenuWithItems):
3367         Set menu proxy before calling menuFromProposedMenu() client delegate.
3368         This allows me to perform one of the menu item's action from the
3369         menuFromProposedMenu() client delegate in my API test.
3370
3371 2017-09-07  Alex Christensen  <achristensen@webkit.org>
3372
3373         Modernize Geolocation code
3374         https://bugs.webkit.org/show_bug.cgi?id=176496
3375
3376         Reviewed by Andy Estes.
3377
3378         Making the GeolocationPermissionRequestManager take a reference instead of a pointer
3379         spilled into making the other supplement constructors do the same.
3380
3381         * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.cpp:
3382         (WebKit::LegacyCustomProtocolManager::LegacyCustomProtocolManager):
3383         (WebKit::LegacyCustomProtocolManager::startLoading):
3384         (WebKit::LegacyCustomProtocolManager::stopLoading):
3385         * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.h:
3386         * NetworkProcess/NetworkProcess.h:
3387         (WebKit::NetworkProcess::addSupplement):
3388         * Shared/Authentication/AuthenticationManager.cpp:
3389         (WebKit::AuthenticationManager::AuthenticationManager):
3390         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
3391         * Shared/Authentication/AuthenticationManager.h:
3392         * UIProcess/API/APIUIClient.h:
3393         (API::UIClient::decidePolicyForGeolocationPermissionRequest):
3394         * UIProcess/API/C/WKPage.cpp:
3395         (WKPageSetPageUIClient):
3396         * UIProcess/WebPageProxy.cpp:
3397         (WebKit::WebPageProxy::requestGeolocationPermissionForFrame):
3398         * WebProcess/Cookies/WebCookieManager.cpp:
3399         (WebKit::WebCookieManager::WebCookieManager):
3400         (WebKit::WebCookieManager::getHostnamesWithCookies):
3401         (WebKit::WebCookieManager::deleteCookie):
3402         (WebKit::WebCookieManager::deleteAllCookiesModifiedSince):
3403         (WebKit::WebCookieManager::getAllCookies):
3404         (WebKit::WebCookieManager::getCookies):
3405         (WebKit::WebCookieManager::setCookie):
3406         (WebKit::WebCookieManager::setCookies):
3407         (WebKit::WebCookieManager::notifyCookiesDidChange):
3408         (WebKit::WebCookieManager::setHTTPCookieAcceptPolicy):
3409         (WebKit::WebCookieManager::getHTTPCookieAcceptPolicy):
3410         * WebProcess/Cookies/WebCookieManager.h:
3411         * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
3412         (WebKit::GeolocationPermissionRequestManager::GeolocationPermissionRequestManager):
3413         (WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation):
3414         (WebKit::GeolocationPermissionRequestManager::cancelRequestForGeolocation):
3415         * WebProcess/Geolocation/GeolocationPermissionRequestManager.h:
3416         * WebProcess/Geolocation/WebGeolocationManager.cpp:
3417         (WebKit::WebGeolocationManager::WebGeolocationManager):
3418         (WebKit::WebGeolocationManager::registerWebPage):
3419         (WebKit::WebGeolocationManager::unregisterWebPage):
3420         (WebKit::WebGeolocationManager::setEnableHighAccuracyForPage):
3421         (WebKit::WebGeolocationManager::didChangePosition):
3422         (WebKit::WebGeolocationManager::didFailToDeterminePosition):
3423         (WebKit::WebGeolocationManager::resetPermissions):
3424         * WebProcess/Geolocation/WebGeolocationManager.h:
3425         * WebProcess/MediaCache/WebMediaKeyStorageManager.h:
3426         (WebKit::WebMediaKeyStorageManager::WebMediaKeyStorageManager):
3427         * WebProcess/Notifications/WebNotificationManager.cpp:
3428         (WebKit::WebNotificationManager::WebNotificationManager):
3429         (WebKit::WebNotificationManager::show):
3430         (WebKit::WebNotificationManager::cancel):
3431         (WebKit::WebNotificationManager::clearNotifications):
3432         (WebKit::WebNotificationManager::didDestroyNotification):
3433         * WebProcess/Notifications/WebNotificationManager.h:
3434         * WebProcess/WebCoreSupport/WebGeolocationClient.cpp:
3435         (WebKit::WebGeolocationClient::requestPermission):
3436         (WebKit::WebGeolocationClient::cancelPermissionRequest):
3437         * WebProcess/WebCoreSupport/WebGeolocationClient.h:
3438         (WebKit::WebGeolocationClient::WebGeolocationClient):
3439         * WebProcess/WebPage/WebPage.cpp:
3440         (WebKit::m_cpuLimit):
3441         * WebProcess/WebProcess.h:
3442         (WebKit::WebProcess::addSupplement):
3443         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
3444         (WebKit::UserMediaCaptureManager::UserMediaCaptureManager):
3445         * WebProcess/cocoa/UserMediaCaptureManager.h:
3446
3447 2017-09-06  Alex Christensen  <achristensen@webkit.org>
3448
3449         Add WKUIDelegatePrivate equivalent of WKPageUIClient's pageDidScroll
3450         https://bugs.webkit.org/show_bug.cgi?id=176482
3451         <rdar://problem/29270035>
3452
3453         Reviewed by Tim Horton.
3454         
3455         Covered by a new API test!
3456
3457         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3458         * UIProcess/Cocoa/UIDelegate.h:
3459         * UIProcess/Cocoa/UIDelegate.mm:
3460         (WebKit::UIDelegate::setDelegate):
3461         (WebKit::UIDelegate::UIClient::pageDidScroll):
3462
3463 2017-09-06  Youenn Fablet  <youenn@apple.com>
3464
3465         NetworkProcess Cache and Caches should be cleared when the last related WebProcess Cache or CacheStorage is destroyed
3466         https://bugs.webkit.org/show_bug.cgi?id=176249
3467
3468         Reviewed by Alex Christensen.