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