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