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