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