faa582550353216d0f1651e3df81f15c44c46790
[WebKit.git] / Source / WebKit / ChangeLog
1 2017-12-03  Chris Dumez  <cdumez@apple.com>
2
3         Support serviceWorker.postMessage() inside service workers
4         https://bugs.webkit.org/show_bug.cgi?id=180328
5
6         Reviewed by Darin Adler.
7
8         Support serviceWorker.postMessage() inside service workers.
9
10         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
11         (WebKit::WebSWServerConnection::postMessageToServiceWorkerFromClient):
12         (WebKit::WebSWServerConnection::postMessageToServiceWorkerFromServiceWorker):
13         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
14         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
15         * WebProcess/Storage/WebSWClientConnection.cpp:
16         (WebKit::WebSWClientConnection::postMessageToServiceWorker):
17         * WebProcess/Storage/WebSWClientConnection.h:
18         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
19         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerFromClient):
20         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerFromServiceWorker):
21         * WebProcess/Storage/WebSWContextManagerConnection.h:
22         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
23
24 2017-12-03  Chris Dumez  <cdumez@apple.com>
25
26         Implement self.skipWaiting() inside service workers
27         https://bugs.webkit.org/show_bug.cgi?id=180329
28
29         Reviewed by Darin Adler.
30
31         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
32         (WebKit::WebSWServerToContextConnection::didFinishSkipWaiting):
33         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
34         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
35         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
36         (WebKit::WebSWContextManagerConnection::skipWaiting):
37         (WebKit::WebSWContextManagerConnection::didFinishSkipWaiting):
38         * WebProcess/Storage/WebSWContextManagerConnection.h:
39         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
40
41 2017-12-02  Youenn Fablet  <youenn@apple.com>
42
43         Implement https://w3c.github.io/ServiceWorker/#clients-getall
44         https://bugs.webkit.org/show_bug.cgi?id=180276
45
46         Reviewed by Chris Dumez.
47
48         Add IPC plumbery for clients.matchAll between ServiceWorker process and Storage process.
49
50         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
51         (WebKit::WebSWServerToContextConnection::matchAllCompleted):
52         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
53         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
54         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
55         (WebKit::WebSWContextManagerConnection::matchAll):
56         (WebKit::WebSWContextManagerConnection::matchAllCompleted):
57         * WebProcess/Storage/WebSWContextManagerConnection.h:
58         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
59
60 2017-12-02  Joseph Pecoraro  <pecoraro@apple.com>
61
62         Remote Web Inspector window always shows up at the default size
63         https://bugs.webkit.org/show_bug.cgi?id=180284
64         <rdar://problem/35430255>
65
66         Reviewed by Brian Burg.
67
68         * UIProcess/mac/RemoteWebInspectorProxyMac.mm:
69         (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
70         Give remote web inspector windows an autosave name so that their frame can
71         be automatically saved and restored by the system.
72
73 2017-12-02  Simon Fraser  <simon.fraser@apple.com>
74
75         Add a log channel for viewports
76         https://bugs.webkit.org/show_bug.cgi?id=180295
77
78         Reviewed by Zalan Bujtas.
79
80         Add a "Viewports" log channel to log viewport scaling information, and enhance the
81         WebKit "VisibleRects" channel to log additional data for the same reason.
82
83         * UIProcess/API/Cocoa/WKWebView.mm:
84         (-[WKWebView _didCommitLayerTree:]):
85         (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:nextValidLayerTreeTransactionID:]):
86         (-[WKWebView _dispatchSetMinimumLayoutSize:]):
87         (-[WKWebView _endAnimatedResize]):
88         (-[WKWebView _resizeWhileHidingContentWithUpdates:]):
89         * WebProcess/WebPage/WebPage.cpp:
90         (WebKit::WebPage::setFixedLayoutSize):
91         (WebKit::WebPage::mainFrameDidLayout):
92         (WebKit::WebPage::didCommitLoad):
93         * WebProcess/WebPage/ios/WebPageIOS.mm:
94         (WebKit::scaleAfterViewportWidthChange):
95         (WebKit::WebPage::setViewportConfigurationMinimumLayoutSize):
96         (WebKit::WebPage::dynamicViewportSizeUpdate):
97         (WebKit::WebPage::resetViewportDefaultConfiguration):
98         (WebKit::WebPage::viewportConfigurationChanged):
99         (WebKit::WebPage::updateVisibleContentRects):
100
101 2017-12-02  Carlos Garcia Campos  <cgarcia@igalia.com>
102
103         WebDriver: handle user prompts shown while executing scripts
104         https://bugs.webkit.org/show_bug.cgi?id=179979
105
106         Reviewed by Brian Burg.
107
108         * UIProcess/Automation/Automation.json: Add UnexpectedAlertOpen error.
109         * UIProcess/Automation/WebAutomationSession.cpp:
110         (WebKit::WebAutomationSession::willShowJavaScriptDialog): Finish pending evaluateJavaScriptFunction operations
111         with UnexpectedAlertOpen error.
112
113 2017-12-02  Wenson Hsieh  <wenson_hsieh@apple.com>
114
115         Make some minor adjustments to TouchBarMenuData and TouchBarMenuItemData
116         https://bugs.webkit.org/show_bug.cgi?id=180305
117
118         Reviewed by Joseph Pecoraro.
119
120         Mark some methods and parameters as const, use the default constructor in more places, and also remove a few
121         extraneous imported headers.
122
123         * Shared/TouchBarMenuData.cpp:
124         (WebKit::TouchBarMenuData::TouchBarMenuData):
125
126         Add a FIXME regarding the use of the 'id' attribute.
127
128         (WebKit::TouchBarMenuData::decode):
129         * Shared/TouchBarMenuData.h:
130         (WebKit::TouchBarMenuData::items const):
131         (WebKit::TouchBarMenuData::setID):
132         (WebKit::TouchBarMenuData::isPageCustomized const):
133         (WebKit::TouchBarMenuData::items): Deleted.
134         (WebKit::TouchBarMenuData::isPageCustomized): Deleted.
135         * Shared/TouchBarMenuItemData.cpp:
136         (WebKit::getItemType):
137
138         Change a helper method from a static class function to a static function in the implementation file.
139
140         (WebKit::TouchBarMenuItemData::TouchBarMenuItemData):
141         (WebKit::TouchBarMenuItemData::encode const):
142         (WebKit::TouchBarMenuItemData::decode):
143         (WebKit::TouchBarMenuItemData::getItemType): Deleted.
144         * Shared/TouchBarMenuItemData.h:
145         (WebKit::operator==):
146
147         Remove the commandName member variable, since it doesn't make sense to propagate an event handler
148         attribute from WebCore to the client layer.
149
150         * UIProcess/WebPageProxy.messages.in:
151
152 2017-12-01  Zan Dobersek  <zdobersek@igalia.com>
153
154         Unreviewed GTK+ debug build fix. Replace ASSERT_UNUSED() with UNUSED_PARAM()
155         in WebKit::WebPage methods that used to operate on HTMLMenuElement pointer
156         values (which have been converted to references).
157
158         * WebProcess/WebPage/WebPage.cpp:
159         (WebKit::WebPage::didInsertMenuElement):
160         (WebKit::WebPage::didRemoveMenuElement):
161         (WebKit::WebPage::didInsertMenuItemElement):
162         (WebKit::WebPage::didRemoveMenuItemElement):
163
164 2017-12-01  Simon Fraser  <simon.fraser@apple.com>
165
166         Reduce the number of calls to ViewportConfiguration::updateConfiguration()
167         https://bugs.webkit.org/show_bug.cgi?id=180299
168
169         Reviewed by Zalan Bujtas.
170
171         There are several calls to ViewportConfiguration::setDefaultConfiguration() during loading
172         with the same arguments. We can avoid unnecessary calls to updateConfiguration() by returning
173         early if the configuration hasn't changed.
174
175         Also move the fetching of ViewportConfiguration::xhtmlMobileParameters() from didReceiveMobileDocType()
176         into resetViewportDefaultConfiguration() where we grab all the other default configs.
177
178         * WebProcess/WebPage/WebPage.h:
179         * WebProcess/WebPage/ios/WebPageIOS.mm:
180         (WebKit::WebPage::didReceiveMobileDocType):
181         (WebKit::WebPage::resetViewportDefaultConfiguration):
182
183 2017-12-01  Aishwarya Nirmal  <anirmal@apple.com>
184
185         [Touch Bar Web API] Object representing Touch Bar Menu to send between Web and UI Processes
186         https://bugs.webkit.org/show_bug.cgi?id=179714
187
188         Reviewed by Wenson Hsieh.
189
190         These changes define the TouchBarMenuData and TouchBarMenuItemData objects which draw information
191         from touch bar HTMLMenuElement and HTMLMenuItemElement. These objects represent the contents of
192         the page-customized touch bar. Changes to the html elements representing the touch bar are sent 
193         to the UI process.
194
195         * Shared/TouchBarMenuData.cpp: Copied from Source/WebCore/html/HTMLMenuItemElement.cpp.
196         (WebKit::TouchBarMenuData::TouchBarMenuData):
197         (WebKit::TouchBarMenuData::addMenuItem):
198         (WebKit::TouchBarMenuData::removeMenuItem):
199         (WebKit::TouchBarMenuData::encode const):
200         (WebKit::TouchBarMenuData::decode):
201         * Shared/TouchBarMenuData.h: Copied from Source/WebCore/html/HTMLMenuItemElement.h.
202         (WebKit::TouchBarMenuData::items):
203         (WebKit::TouchBarMenuData::isPageCustomized):
204         (WebKit::TouchBarMenuData::setIsPageCustomized):
205         * Shared/TouchBarMenuItemData.cpp: Added.
206         (WebKit::TouchBarMenuItemData::getItemType):
207         (WebKit::TouchBarMenuItemData::TouchBarMenuItemData):
208         (WebKit::TouchBarMenuItemData::encode const):
209         (WebKit::TouchBarMenuItemData::decode):
210         * Shared/TouchBarMenuItemData.h: Added.
211         (WebKit::operator<):
212         (WebKit::operator>):
213         (WebKit::operator<=):
214         (WebKit::operator>=):
215         (WebKit::operator==):
216         (WebKit::operator!=):
217         * UIProcess/WebPageProxy.cpp:
218         (WebKit::WebPageProxy::touchBarMenuDataChanged):
219         (WebKit::WebPageProxy::touchBarMenuItemDataAdded):
220         (WebKit::WebPageProxy::touchBarMenuItemDataRemoved):
221         * UIProcess/WebPageProxy.h:
222         (WebKit::WebPageProxy::touchBarMenuData const):
223         * UIProcess/WebPageProxy.messages.in:
224         * WebKit.xcodeproj/project.pbxproj:
225         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
226         (WebKit::WebChromeClient::didInsertMenuElement):
227         (WebKit::WebChromeClient::didRemoveMenuElement):
228         (WebKit::WebChromeClient::didInsertMenuItemElement):
229         (WebKit::WebChromeClient::didRemoveMenuItemElement):
230         * WebProcess/WebCoreSupport/WebChromeClient.h:
231         * WebProcess/WebPage/WebPage.cpp:
232         (WebKit::WebPage::didInsertMenuElement):
233         (WebKit::WebPage::didRemoveMenuElement):
234         (WebKit::WebPage::didInsertMenuItemElement):
235         (WebKit::WebPage::didRemoveMenuItemElement):
236         (WebKit::WebPage::sendTouchBarMenuDataRemovedUpdate):
237         (WebKit::WebPage::sendTouchBarMenuDataAddedUpdate):
238         (WebKit::WebPage::sendTouchBarMenuItemDataAddedUpdate):
239         (WebKit::WebPage::sendTouchBarMenuItemDataRemovedUpdate):
240         * WebProcess/WebPage/WebPage.h:
241
242 2017-12-01  Daniel Bates  <dabates@apple.com>
243
244         Alternative Presentation Button: Provide a way to query for the replaced elements
245         https://bugs.webkit.org/show_bug.cgi?id=180114
246         <rdar://problem/35710539>
247
248         Reviewed by Tim Horton.
249
250         Add SPI to query for the elements that were replaced by an Alternative Presentation Button.
251
252         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
253         (-[WKWebProcessPlugInFrame elementsReplacedByAlternativePresentationButtonWithIdentifier:]): Added.
254         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFramePrivate.h:
255         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
256         (WKBundleElementsReplacedByAlternativePresentationButton): Added.
257         * WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h:
258
259 2017-12-01  Youenn Fablet  <youenn@apple.com>
260
261         Implement https://w3c.github.io/ServiceWorker/#clients-get
262         https://bugs.webkit.org/show_bug.cgi?id=180167
263
264         Reviewed by Chris Dumez.
265
266         Add IPC plumbery for clientFromId between ServiceWorker process and Storage process.
267
268         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
269         (WebKit::WebSWServerToContextConnection::clientFromIdCompleted):
270         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
271         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
272         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
273         (WebKit::WebSWContextManagerConnection::findClientByIdentifier):
274         (WebKit::WebSWContextManagerConnection::findClientByIdentifierCompleted):
275         * WebProcess/Storage/WebSWContextManagerConnection.h:
276         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
277
278 2017-12-01  Brian Burg  <bburg@apple.com>
279
280         Web Inspector: move Inspector::Protocol::Array<T> to JSON namespace
281         https://bugs.webkit.org/show_bug.cgi?id=173662
282
283         Reviewed by Joseph Pecoraro.
284
285         Adopt new type names.
286
287         * UIProcess/Automation/WebAutomationSession.cpp:
288         (WebKit::WebAutomationSession::getNextContext):
289         (WebKit::WebAutomationSession::getBrowsingContexts):
290         (WebKit::buildArrayForCookies):
291         (WebKit::WebAutomationSession::getSessionPermissions):
292         * UIProcess/Automation/WebAutomationSession.h:
293
294 2017-12-01  Wenson Hsieh  <wenson_hsieh@apple.com>
295
296         [Attachment Support] Implement SPI for clients to update a given attachment's data
297         https://bugs.webkit.org/show_bug.cgi?id=180184
298         <rdar://problem/35355731>
299
300         Reviewed by Tim Horton.
301
302         Add plumbing to the web process for setting the attachment data (and optionally, the content type and/or file
303         name) of a given attachment. See WebCore ChangeLog for more detail. Changes covered by new API tests.
304
305         * UIProcess/API/APIAttachment.cpp:
306         (API::Attachment::setDataAndContentType):
307         * UIProcess/API/APIAttachment.h:
308         * UIProcess/API/Cocoa/_WKAttachment.h:
309
310         Add nullability annotations around _WKAttachment SPI methods.
311
312         * UIProcess/API/Cocoa/_WKAttachment.mm:
313         (-[_WKAttachment setData:newContentType:newFilename:completion:]):
314         * UIProcess/WebPageProxy.cpp:
315         (WebKit::WebPageProxy::setAttachmentDataAndContentType):
316         * UIProcess/WebPageProxy.h:
317         * WebProcess/WebPage/WebPage.cpp:
318         (WebKit::WebPage::setAttachmentDataAndContentType):
319         * WebProcess/WebPage/WebPage.h:
320         * WebProcess/WebPage/WebPage.messages.in:
321
322 2017-12-01  Brady Eidson  <beidson@apple.com>
323
324         Add Internals.terminateServiceWorker, and the ability to restart service workers for postMessage.
325         https://bugs.webkit.org/show_bug.cgi?id=180170
326
327         Reviewed by Chris Dumez.
328
329         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
330         (WebKit::WebSWServerConnection::startFetch):
331         (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope):
332         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
333         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
334
335         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
336         (WebKit::WebSWServerToContextConnection::syncTerminateWorker):
337         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
338
339         * StorageProcess/StorageToWebProcessConnection.cpp:
340         (WebKit::StorageToWebProcessConnection::didReceiveSyncMessage):
341
342         * WebProcess/Storage/WebSWClientConnection.cpp:
343         (WebKit::WebSWClientConnection::syncTerminateWorker):
344         * WebProcess/Storage/WebSWClientConnection.h:
345
346         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
347         (WebKit::WebSWContextManagerConnection::terminateWorker):
348         (WebKit::WebSWContextManagerConnection::syncTerminateWorker):
349         * WebProcess/Storage/WebSWContextManagerConnection.h:
350         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
351
352         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
353         (WebKit::WebToStorageProcessConnection::didReceiveSyncMessage):
354         * WebProcess/Storage/WebToStorageProcessConnection.h:
355
356 2017-12-01  Youenn Fablet  <youenn@apple.com>
357
358         Clear WebSWClientConnection in case storage process IPC connection is closing
359         https://bugs.webkit.org/show_bug.cgi?id=180210
360
361         Reviewed by Chris Dumez.
362
363         Clear the sw connection maps when connection is closing.
364         Call related completion handlers for each connection.
365
366         * WebProcess/Storage/WebSWClientConnection.cpp:
367         (WebKit::WebSWClientConnection::connectionToServerLost):
368         * WebProcess/Storage/WebSWClientConnection.h:
369         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
370         (WebKit::WebToStorageProcessConnection::didClose):
371         (WebKit::WebToStorageProcessConnection::idbConnectionToServerForSession):
372         (WebKit::WebToStorageProcessConnection::serviceWorkerConnectionForSession):
373         * WebProcess/Storage/WebToStorageProcessConnection.h:
374
375 2017-12-01  Eric Carlson  <eric.carlson@apple.com>
376
377         [MediaStream] Use CaptureDevice instead of device ID to identify devices
378         https://bugs.webkit.org/show_bug.cgi?id=180206
379         <rdar://problem/35775758>
380
381         Reviewed by Youenn Fablet.
382
383         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
384         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
385         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
386         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
387         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
388         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
389         (WebKit::UserMediaPermissionRequestManagerProxy::grantAccess):
390         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
391         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
392         * UIProcess/UserMediaPermissionRequestProxy.cpp:
393         (WebKit::UserMediaPermissionRequestProxy::allow):
394         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
395         (WebKit::UserMediaPermissionRequestManager::userMediaAccessWasGranted):
396         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
397         * WebProcess/WebPage/WebPage.cpp:
398         (WebKit::WebPage::userMediaAccessWasGranted):
399         * WebProcess/WebPage/WebPage.h:
400         * WebProcess/WebPage/WebPage.messages.in:
401         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
402         (WebKit::UserMediaCaptureManager::createCaptureSource):
403         * WebProcess/cocoa/UserMediaCaptureManager.h:
404
405 2017-12-01  Carlos Garcia Campos  <cgarcia@igalia.com>
406
407         WebDriver: link and partial links queries don't work in xhtml documents
408         https://bugs.webkit.org/show_bug.cgi?id=180191
409
410         Reviewed by Brian Burg.
411
412         We convert the queries to use xpath, which works for html documents, but it doesn't work for xhtml. In case of
413         xhtml we would need to provide a namespace resolver and elements would need to be prefixed with 'xhtml:'. It's
414         easier to simply iterate the link elements and compare the text.
415
416         Fixes: imported/w3c/webdriver/tests/retrieval/find_element_from_element.py::test_xhtml_namespace[link text-full link text]
417                imported/w3c/webdriver/tests/retrieval/find_element_from_element.py::test_xhtml_namespace[partial link text-link text]
418                imported/w3c/webdriver/tests/retrieval/find_element_from_elements.py::test_xhtml_namespace[link text-full link text]
419                imported/w3c/webdriver/tests/retrieval/find_element_from_elements.py::test_xhtml_namespace[partial link text-link text]
420                imported/w3c/webdriver/tests/retrieval/find_element.py::test_xhtml_namespace[link text-full link text]
421                imported/w3c/webdriver/tests/retrieval/find_element.py::test_xhtml_namespace[partial link text-link text]
422                imported/w3c/webdriver/tests/retrieval/find_elements.py::test_xhtml_namespace[link text-full link text]
423                imported/w3c/webdriver/tests/retrieval/find_elements.py::test_xhtml_namespace[partial link text-link text]
424
425         * UIProcess/Automation/atoms/FindNodes.js:
426         (switch):
427         (tryToFindNode):
428
429 2017-11-30  Alex Christensen  <achristensen@webkit.org>
430
431         REGRESSION (r224791): cookies are shared between ephemeral sessions in the same process pool
432         https://bugs.webkit.org/show_bug.cgi?id=180235
433
434         Reviewed by Joseph Pecoraro.
435
436         In r224791 I assumed that uiProcessCookieStorageIdentifier would be empty in the ephemeral session initialization message.
437         This is not the case.  We did not catch this because almost all of our ephemeral session testing uses the legacyPrivateSessionID.
438         I add checks for if the SessionID is ephemeral like we already have in WebFrameNetworkingContext::ensureWebsiteDataStoreSession.
439         I also add an API test that makes sure cookies are not shared between ephemeral sessions the way they are made through the API.
440
441         * NetworkProcess/mac/RemoteNetworkingContext.mm:
442         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
443
444 2017-11-30  Stephan Szabo  <stephan.szabo@sony.com>
445
446         Make LegacyCustomProtocolManager optional for network process
447         https://bugs.webkit.org/show_bug.cgi?id=176230
448
449         Reviewed by Alex Christensen.
450
451         * CMakeLists.txt:
452         * Configurations/FeatureDefines.xcconfig:
453         * NetworkProcess/NetworkProcess.cpp:
454         (WebKit::NetworkProcess::NetworkProcess):
455         (WebKit::NetworkProcess::initializeNetworkProcess):
456         * PlatformGTK.cmake:
457         * PlatformMac.cmake:
458         * PlatformWPE.cmake:
459         * UIProcess/Network/NetworkProcessProxy.cpp:
460         (WebKit::NetworkProcessProxy::NetworkProcessProxy):
461         (WebKit::NetworkProcessProxy::didClose):
462         * UIProcess/Network/NetworkProcessProxy.h:
463         * UIProcess/WebProcessPool.cpp:
464         (WebKit::WebProcessPool::setLegacyCustomProtocolManagerClient):
465         (WebKit::WebProcessPool::registerSchemeForCustomProtocol):
466         (WebKit::WebProcessPool::unregisterSchemeForCustomProtocol):
467
468 2017-11-30  Ryan Haddad  <ryanhaddad@apple.com>
469
470         Unreviewed build fix, suppress deprecation warnings.
471
472         * Shared/mac/SandboxExtensionMac.mm:
473         (WebKit::SandboxExtensionImpl::sandboxExtensionForType):
474
475 2017-11-30  Daniel Bates  <dabates@apple.com>
476
477         Expose SPI didClickAlternativePresentationButtonWithUserInfo on iOS
478         https://bugs.webkit.org/show_bug.cgi?id=180218
479         <rdar://problem/35782555>
480
481         Reviewed by Alex Christensen.
482
483         We want to support the SPI didClickAlternativePresentationButtonWithUserInfo on Cocoa platforms.
484
485         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
486         * UIProcess/Cocoa/UIDelegate.h:
487         * UIProcess/Cocoa/UIDelegate.mm:
488         (WebKit::UIDelegate::setDelegate):
489         (WebKit::UIDelegate::UIClient::didClickAlternativePresentationButton):
490
491 2017-11-30  Joseph Pecoraro  <pecoraro@apple.com>
492
493         [Cocoa] Web Automation: _WKAutomationSessionConfiguration leak
494         https://bugs.webkit.org/show_bug.cgi?id=180222
495
496         Reviewed by Brian Burg.
497
498         * UIProcess/Cocoa/AutomationClient.mm:
499         (WebKit::AutomationClient::requestAutomationSessionWithCapabilities):
500
501 2017-11-30  Joseph Pecoraro  <pecoraro@apple.com>
502
503         Fix some NSOperationQueue leaks
504         https://bugs.webkit.org/show_bug.cgi?id=180221
505
506         Reviewed by Wenson Hsieh.
507
508         * UIProcess/Cocoa/WebViewImpl.mm:
509         (WebKit::WebViewImpl::performDragOperation):
510
511 2017-11-30  Brian Burg  <bburg@apple.com>
512
513         Web Automation: computeElementLayout does not correctly translate iframe client coordinates to main frame coordinates
514         https://bugs.webkit.org/show_bug.cgi?id=180213
515         <rdar://problem/30260141>
516
517         Reviewed by Simon Fraser.
518
519         The current implementation computes points in terms of the frame in which the element is located.
520         However, WebDriver expects coordinates to be relative to the top-level document since
521         these coordinates are used for generating click events, among other things.
522
523         To convert from frame client coordinates to main frame client coordinates, round-trip
524         both inViewCenterPoint and elementBounds to root view coordinates and back
525         to the main frame's contents/client coordinates. Then convert this to page coordinates if needed.
526
527         This progresses several tests in the Selenium Python test suite:
528
529          - event_firing_webdriver_tests.py::test_should_fire_navigation_events
530          - frame_switching_tests.py::testShouldBeAbleToClickInAFrameThatRewritesTopWindowLocation
531          - frame_switching_tests.py::testShouldBeAbleToSwitchToTheTopIfTheFrameIsDeletedFromUnderUs
532          - frame_switching_tests.py::testShouldBeAbleToSwitchToTheTopIfTheFrameIsDeletedFromUnderUsWithFrameIndex
533          - frame_switching_tests.py::testShouldBeAbleToSwitchToTheTopIfTheFrameIsDeletedFromUnderUsWithWebelement
534          - frame_switching_tests.py::testShouldNotBeAbleToDoAnythingTheFrameIsDeletedFromUnderUs
535          - position_and_size_tests.py::testShouldGetCoordinatesOfAnInvisibleElement
536
537         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
538         (WebKit::WebAutomationSessionProxy::computeElementLayout):
539         Get both the frame and main frame FrameViews and convert coordinates to the root view.
540         This is somewhat lossy as clientToDocument* deals with FloatPoints but contentsToRootView
541         deals with IntPoints. For the purposes of WebDriver, lossiness is not a problem since
542         integer values are expected anyway.
543
544         The imperative nature of the coordinate calculations is difficult to debug, so I converted
545         this function to only assign to each variable once.
546
547 2017-11-30  Alex Christensen  <achristensen@webkit.org>
548
549         WKURLSchemeHandler.request should include HTTPBody
550         https://bugs.webkit.org/show_bug.cgi?id=180220
551
552         Reviewed by Brady Eidson.
553
554         * Shared/URLSchemeTaskParameters.cpp: Added.
555         (WebKit::URLSchemeTaskParameters::encode const):
556         (WebKit::URLSchemeTaskParameters::decode):
557         * Shared/URLSchemeTaskParameters.h: Added.
558         * UIProcess/API/Cocoa/WKURLSchemeTask.mm:
559         (-[WKURLSchemeTaskImpl request]):
560         * UIProcess/WebPageProxy.cpp:
561         (WebKit::WebPageProxy::startURLSchemeTask):
562         * UIProcess/WebPageProxy.h:
563         * UIProcess/WebPageProxy.messages.in:
564         * UIProcess/WebURLSchemeHandler.cpp:
565         (WebKit::WebURLSchemeHandler::startTask):
566         * UIProcess/WebURLSchemeHandler.h:
567         * UIProcess/WebURLSchemeTask.cpp:
568         (WebKit::WebURLSchemeTask::create):
569         (WebKit::WebURLSchemeTask::WebURLSchemeTask):
570         * UIProcess/WebURLSchemeTask.h:
571         * WebKit.xcodeproj/project.pbxproj:
572         * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp:
573         (WebKit::WebURLSchemeTaskProxy::startLoading):
574
575 2017-11-30  Darin Adler  <darin@apple.com>
576
577         [Mac] remove unneeded RetainPtr use introduced in r225142
578         https://bugs.webkit.org/show_bug.cgi?id=180202
579
580         Reviewed by Tim Horton.
581
582         * WebProcess/Plugins/PDF/PDFPlugin.h: Got rid of unnecessary RetainPtr.
583         * WebProcess/Plugins/PDF/PDFPlugin.mm:
584         (WebKit::PDFPlugin::lookupTextAtLocation const): Ditto.
585         * WebProcess/WebPage/WebPage.h: Ditto.
586         * WebProcess/WebPage/mac/WebPageMac.mm:
587         (WebKit::WebPage::performDictionaryLookupAtLocation): Ditto.
588         (WebKit::WebPage::performDictionaryLookupForSelection): Ditto.
589         (WebKit::WebPage::performImmediateActionHitTestAtLocation): Ditto.
590         (WebKit::WebPage::lookupTextAtLocation): Ditto.
591
592 2017-11-30  Zan Dobersek  <zdobersek@igalia.com>
593
594         [CoordGraphics] Move CoordinatedGraphicsLayer painting behind Nicosia::PaintingEngine
595         https://bugs.webkit.org/show_bug.cgi?id=180141
596
597         Reviewed by Carlos Garcia Campos.
598
599         CompositingCoordinator must implement the paintingEngine() method now
600         that the method's been added to the CoordinatedGraphicsLayerClient
601         interface. The CompositingCoordinator manages the Nicosia::PaintingEngine
602         object through the new m_paintingEngine member variable, and returns the
603         reference to this object in the paintingEngine() method.
604
605         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
606         (WebKit::CompositingCoordinator::CompositingCoordinator):
607         (WebKit::CompositingCoordinator::paintingEngine):
608         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
609         Drop unnecessary typedefs.
610
611 2017-11-29  Wenson Hsieh  <wenson_hsieh@apple.com>
612
613         [Attachment Support] Implement SPI for clients to make an attachment element display in-place
614         https://bugs.webkit.org/show_bug.cgi?id=180153
615         <rdar://problem/35735252>
616
617         Reviewed by Tim Horton.
618
619         Add new WebKit SPI, -[_WKAttachment setDisplayOptions:completion:], and add plumbing for attachment display
620         options to the web content process. Changes covered by 4 new API tests.
621
622         * Scripts/webkit/messages.py:
623         (headers_for_type):
624         * UIProcess/API/APIAttachment.cpp:
625         (API::Attachment::setDisplayOptions):
626         * UIProcess/API/APIAttachment.h:
627         * UIProcess/API/Cocoa/WKWebView.mm:
628         (-[WKWebView _insertAttachmentWithFilename:contentType:data:options:completion:]):
629
630         Respect given display options when inserting a new attachment.
631
632         * UIProcess/API/Cocoa/_WKAttachment.h:
633         * UIProcess/API/Cocoa/_WKAttachment.mm:
634         (-[_WKAttachmentDisplayOptions coreDisplayOptions]):
635
636         Introduce a helper to convert from the Cocoa _WKAttachmentDisplayOptions object to platform-agnostic
637         AttachmentDisplayOptions.
638
639         (-[_WKAttachment setDisplayOptions:completion:]):
640         (WebKit::if): Deleted.
641         * UIProcess/API/Cocoa/_WKAttachmentInternal.h:
642         * UIProcess/WebPageProxy.cpp:
643         (WebKit::WebPageProxy::insertAttachment):
644         (WebKit::WebPageProxy::setAttachmentDisplayOptions):
645         * UIProcess/WebPageProxy.h:
646         * WebProcess/WebPage/WebPage.cpp:
647         (WebKit::WebPage::insertAttachment):
648         (WebKit::WebPage::requestAttachmentData):
649         (WebKit::WebPage::setAttachmentDisplayOptions):
650         (WebKit::WebPage::attachmentElementWithIdentifier const):
651
652         Pull common logic to retrieve an attachment element matching a given identifier out into a helper.
653
654         * WebProcess/WebPage/WebPage.h:
655         * WebProcess/WebPage/WebPage.messages.in:
656
657 2017-11-29  Brent Fulgham  <bfulgham@apple.com>
658
659         Part 2: Adopt updated NSKeyed[Un]Archiver API when available
660         https://bugs.webkit.org/show_bug.cgi?id=180127
661         <rdar://problem/35710738>
662
663         Reviewed by Simon Fraser.
664
665         The API that accepts a user-allocated NSMutableData is deprecated. Switch (for macOS 10.12 and newer)
666         to the modern API. Use the original API for macOS builds prior to 10.12.
667
668         * Shared/Cocoa/DataDetectionResult.mm:
669         (WebKit::DataDetectionResult::encode const):
670         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
671         (IPC::ArgumentCoder<WebCore::Payment>::encode):
672         (IPC::ArgumentCoder<WebCore::PaymentContact>::encode):
673         (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::encode):
674         (IPC::ArgumentCoder<WebCore::PaymentMethod>::encode):
675         * Shared/ios/InteractionInformationAtPosition.mm:
676         (WebKit::InteractionInformationAtPosition::encode const):
677         * Shared/mac/WebCoreArgumentCodersMac.mm:
678         (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData):
679         (IPC::ArgumentCoder<Credential>::encodePlatformData):
680         (IPC::ArgumentCoder<ContentFilterUnblockHandler>::encode):
681         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::encodePlatformData):
682         * Shared/mac/WebHitTestResultData.mm:
683         (WebKit::WebHitTestResultData::platformEncode const):
684         * UIProcess/API/Cocoa/WKProcessPool.mm:
685         (-[WKProcessPool _setObject:forBundleParameter:]):
686         (-[WKProcessPool _setObjectsForBundleParametersWithDictionary:]):
687         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
688         (WebKit::WebProcessPool::platformInitializeWebProcess):
689         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
690         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]):
691
692 2017-11-29  Brady Eidson  <beidson@apple.com>
693
694         When managing context startups, make ServiceWorkerJobDataIdentifier's optional.
695         https://bugs.webkit.org/show_bug.cgi?id=180166
696
697         Reviewed by Chris Dumez.
698
699         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
700
701         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
702         (WebKit::WebSWContextManagerConnection::serviceWorkerStartedWithMessage):
703         (WebKit::WebSWContextManagerConnection::didFinishInstall):
704         * WebProcess/Storage/WebSWContextManagerConnection.h:
705
706 2017-11-29  Youenn Fablet  <youenn@apple.com>
707
708         Add support for service worker generated redirections
709         https://bugs.webkit.org/show_bug.cgi?id=179498
710
711         Reviewed by Darin Adler.
712
713         Small refactoring to allow a service worker redirected fetch to follow the redirection through the service worker.
714
715         * WebProcess/Network/WebLoaderStrategy.cpp:
716         (WebKit::WebLoaderStrategy::scheduleLoad): Make use of the loader request in case a network load is needed after a service worker redirection.
717         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
718         (WebKit::ServiceWorkerClientFetch::create):
719         (WebKit::ServiceWorkerClientFetch::~ServiceWorkerClientFetch):
720         (WebKit::ServiceWorkerClientFetch::ServiceWorkerClientFetch):
721         (WebKit::ServiceWorkerClientFetch::start):
722         (WebKit::ServiceWorkerClientFetch::didReceiveResponse): Check for response.
723         Generate redirected request if needed and call loader callback to process the redirection.
724         Adding some states so that if didFinish is called before the willSendRequest callback, redirection is followed.
725         (WebKit::ServiceWorkerClientFetch::didFinish):
726         In case redirection should be followed, wait for didFinish to follow it.
727         This simplifies the model although introducing some limited latency.
728         * WebProcess/Storage/ServiceWorkerClientFetch.h:
729         * WebProcess/Storage/WebSWClientConnection.cpp:
730         (WebKit::WebSWClientConnection::startFetch):
731         * WebProcess/Storage/WebSWClientConnection.h:
732         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
733         (WebKit::WebServiceWorkerProvider::handleFetch):
734
735 2017-11-29  Youenn Fablet  <youenn@apple.com>
736
737         Add support for FetchEvent.clientId
738         https://bugs.webkit.org/show_bug.cgi?id=180052
739
740         Reviewed by Chris Dumez.
741
742         Using FetchOption persistency coders for cache API and modernizing IPC FetchOptions decoding.
743
744         * WebKit/Shared/WebCoreArgumentCoders.cpp:
745         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
746         (WebKit::CacheStorage::Cache::encode):
747         (WebKit::CacheStorage::Cache::decodeRecordHeader):
748         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
749         (WebKit::WebSWContextManagerConnection::startFetch):
750         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
751         (WebKit::WebSWContextManagerConnection::startFetch):
752
753 2017-11-29  Alex Christensen  <achristensen@webkit.org>
754
755         Make WebFrameLoaderClient more robust against null pointer dereferencing
756         https://bugs.webkit.org/show_bug.cgi?id=180157
757         <rdar://problem/34895616>
758
759         Reviewed by Tim Horton.
760
761         There has always been rare null pointer crashes in this code, but they have become more common
762         now that we are waiting for completion handlers for redirects, which makes it more likely that
763         we are hitting this code after we have detached from the core frame.
764
765         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
766         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
767         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
768         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
769         * WebProcess/WebPage/WebFrame.cpp:
770         (WebKit::WebFrame::page const):
771
772 2017-11-29  Alex Christensen  <achristensen@webkit.org>
773
774         Fix Mac CMake build.
775
776         * PlatformMac.cmake:
777
778 2017-11-29  Chris Dumez  <cdumez@apple.com>
779
780         StorageToWebProcessConnection & WebSWServerToContextConnection should use the same underlying IPC::Connection
781         https://bugs.webkit.org/show_bug.cgi?id=180147
782
783         Reviewed by Brady Eidson.
784
785         StorageToWebProcessConnection & WebSWServerToContextConnection should use the same underlying IPC::Connection.
786         Otherwise, we have with 2 IPC::Connections between the StorageProcess and the ServiceWorker (aka Context) process,
787         which makes synchronization of IPC messages difficult.
788
789         * StorageProcess/StorageProcess.cpp:
790         (WebKit::StorageProcess::createStorageToWebProcessConnection):
791         (WebKit::StorageProcess::createServerToContextConnection):
792         * StorageProcess/StorageProcess.h:
793         * StorageProcess/StorageProcess.messages.in:
794         * StorageProcess/StorageToWebProcessConnection.cpp:
795         (WebKit::StorageToWebProcessConnection::didReceiveMessage):
796         * UIProcess/ServiceWorkerProcessProxy.cpp:
797         (WebKit::ServiceWorkerProcessProxy::start):
798         * UIProcess/ServiceWorkerProcessProxy.h:
799         * UIProcess/Storage/StorageProcessProxy.cpp:
800         (WebKit::StorageProcessProxy::getStorageProcessConnection):
801         (WebKit::StorageProcessProxy::didFinishLaunching):
802         (WebKit::StorageProcessProxy::establishWorkerContextConnectionToStorageProcess):
803         * UIProcess/Storage/StorageProcessProxy.h:
804         * UIProcess/Storage/StorageProcessProxy.messages.in:
805         * UIProcess/WebProcessPool.cpp:
806         (WebKit::WebProcessPool::getStorageProcessConnection):
807         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
808         * UIProcess/WebProcessPool.h:
809         * UIProcess/WebProcessProxy.cpp:
810         (WebKit::WebProcessProxy::getStorageProcessConnection):
811         * UIProcess/WebProcessProxy.h:
812         (WebKit::WebProcessProxy::isServiceWorkerProcess const):
813         * UIProcess/WebProcessProxy.messages.in:
814         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
815         (WebKit::WebToStorageProcessConnection::didReceiveMessage):
816         * WebProcess/WebProcess.cpp:
817         (WebKit::WebProcess::didReceiveMessage):
818         (WebKit::WebProcess::establishWorkerContextConnectionToStorageProcess):
819         * WebProcess/WebProcess.h:
820         * WebProcess/WebProcess.messages.in:
821
822 2017-11-29  Chris Dumez  <cdumez@apple.com>
823
824         ensure*Connection() methods on WebProcess should return a reference
825         https://bugs.webkit.org/show_bug.cgi?id=180149
826
827         Reviewed by Alex Christensen.
828
829         ensure*Connection() methods on WebProcess should return a reference instead of not returning
830         anything. Also get rid of the non-ensure variants which called "ensure" internally and are
831         no longer needed.
832
833         * Shared/mac/CookieStorageShim.mm:
834         (WebKit::webKitCookieStorageCopyRequestHeaderFieldsForURL):
835         * WebProcess/Cache/WebCacheStorageConnection.cpp:
836         (WebKit::WebCacheStorageConnection::connection):
837         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
838         (WebKit::WebIDBConnectionToServer::messageSenderConnection):
839         (WebKit::preregisterSandboxExtensionsIfNecessary):
840         * WebProcess/Databases/WebDatabaseProvider.cpp:
841         (WebKit::WebDatabaseProvider::idbConnectionToServerForSession):
842         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
843         (WebKit::BlobRegistryProxy::registerFileBlobURL):
844         (WebKit::BlobRegistryProxy::registerBlobURL):
845         (WebKit::BlobRegistryProxy::registerBlobURLOptionallyFileBacked):
846         (WebKit::BlobRegistryProxy::unregisterBlobURL):
847         (WebKit::BlobRegistryProxy::registerBlobURLForSlice):
848         (WebKit::BlobRegistryProxy::blobSize):
849         (WebKit::BlobRegistryProxy::writeBlobsToTemporaryFiles):
850         * WebProcess/Network/NetworkProcessConnection.cpp:
851         (WebKit::NetworkProcessConnection::writeBlobsToTemporaryFiles):
852         * WebProcess/Network/WebLoaderStrategy.cpp:
853         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
854         (WebKit::WebLoaderStrategy::remove):
855         (WebKit::WebLoaderStrategy::setDefersLoading):
856         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
857         (WebKit::WebLoaderStrategy::startPingLoad):
858         (WebKit::WebLoaderStrategy::preconnectTo):
859         (WebKit::WebLoaderStrategy::storeDerivedDataToCache):
860         (WebKit::WebLoaderStrategy::setCaptureExtraNetworkLoadMetricsEnabled):
861         * WebProcess/Network/WebResourceLoader.cpp:
862         (WebKit::WebResourceLoader::messageSenderConnection):
863         * WebProcess/Network/WebSocketStream.cpp:
864         (WebKit::WebSocketStream::WebSocketStream):
865         (WebKit::WebSocketStream::messageSenderConnection):
866         * WebProcess/Network/webrtc/LibWebRTCResolver.cpp:
867         (WebKit::sendOnMainThread):
868         * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
869         (WebKit::sendOnMainThread):
870         * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
871         (WebKit::LibWebRTCSocketFactory::CreateServerTcpSocket):
872         (WebKit::LibWebRTCSocketFactory::CreateUdpSocket):
873         (WebKit::LibWebRTCSocketFactory::CreateClientTcpSocket):
874         (WebKit::LibWebRTCSocketFactory::createNewConnectionSocket):
875         * WebProcess/Network/webrtc/WebRTCMonitor.cpp:
876         (WebKit::sendOnMainThread):
877         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
878         (WebKit::WebServiceWorkerProvider::serviceWorkerConnectionForSession):
879         (WebKit::WebServiceWorkerProvider::handleFetch):
880         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
881         (WebKit::WebPlatformStrategies::cookiesForDOM):
882         (WebKit::WebPlatformStrategies::setCookiesFromDOM):
883         (WebKit::WebPlatformStrategies::cookiesEnabled):
884         (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue):
885         (WebKit::WebPlatformStrategies::getRawCookies):
886         (WebKit::WebPlatformStrategies::deleteCookie):
887         * WebProcess/WebPage/WebFrame.cpp:
888         (WebKit::WebFrame::startDownload):
889         (WebKit::WebFrame::convertMainResourceLoadToDownload):
890         * WebProcess/WebProcess.cpp:
891         (WebKit::WebProcess::ensureLegacyPrivateBrowsingSessionInNetworkProcess):
892         (WebKit::WebProcess::ensureNetworkProcessConnection):
893         (WebKit::WebProcess::ensureWebToStorageProcessConnection):
894         (WebKit::WebProcess::prefetchDNS):
895         * WebProcess/WebProcess.h:
896
897 2017-11-29  Alex Christensen  <achristensen@webkit.org>
898
899         Modernize API::SerializedScriptValue
900         https://bugs.webkit.org/show_bug.cgi?id=180115
901
902         Reviewed by Brady Eidson.
903
904         Also remove some SPI that hasn't been used anywhere since Mountain Lion.
905
906         * Shared/API/APISerializedScriptValue.h:
907         (API::SerializedScriptValue::create):
908         (API::SerializedScriptValue::internalRepresentation):
909         (API::SerializedScriptValue::SerializedScriptValue):
910         * Shared/API/c/WKSerializedScriptValue.cpp:
911         (WKSerializedScriptValueDeserialize):
912         (WKSerializedScriptValueCreateWithInternalRepresentation): Deleted.
913         (WKSerializedScriptValueGetInternalRepresentation): Deleted.
914         * Shared/API/c/WKSerializedScriptValuePrivate.h: Removed.
915         * UIProcess/API/Cocoa/WKWebView.mm:
916         (-[WKWebView _evaluateJavaScript:forceUserGesture:completionHandler:]):
917         * WebKit.xcodeproj/project.pbxproj:
918
919 2017-11-29  Michael Catanzaro  <mcatanzaro@igalia.com>
920
921         REGRESSION(r218064): [GTK] Broke entering fullscreen mode in debug builds
922         https://bugs.webkit.org/show_bug.cgi?id=180120
923
924         Reviewed by Carlos Garcia Campos.
925
926         These assertions need to be swapped. Fixes /webkit2/WebKitWebView/fullscreen in debug mode.
927
928         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
929         (webkitWebViewBaseEnterFullScreen):
930         (webkitWebViewBaseExitFullScreen):
931
932 2017-11-29  Zan Dobersek  <zdobersek@igalia.com>
933
934         [CoordGraphics] Rename CoordinatedBuffer to Nicosia::Buffer
935         https://bugs.webkit.org/show_bug.cgi?id=180135
936
937         Reviewed by Carlos Garcia Campos.
938
939         Adjust code to the CoordinatedBuffer -> Nicosia::Buffer transition.
940
941         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
942         (WebKit::CoordinatedBackingStoreTile::setBackBuffer):
943         (WebKit::CoordinatedBackingStore::updateTile):
944         * Shared/CoordinatedGraphics/CoordinatedBackingStore.h:
945         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
946         (WebKit::CoordinatedGraphicsScene::createUpdateAtlas):
947         (WebKit::CoordinatedGraphicsScene::updateImageBacking):
948         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
949         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
950         (WebKit::CompositingCoordinator::updateImageBacking):
951         (WebKit::CompositingCoordinator::createUpdateAtlas):
952         (WebKit::CompositingCoordinator::getCoordinatedBuffer):
953         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
954         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp:
955         (WebKit::UpdateAtlas::UpdateAtlas):
956         (WebKit::UpdateAtlas::getCoordinatedBuffer):
957         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h:
958
959 2017-11-28  Brent Fulgham  <bfulgham@apple.com>
960
961         Adopt updated NSKeyed[Un]Archiver API when available
962         https://bugs.webkit.org/show_bug.cgi?id=180127
963         <rdar://problem/35710738>
964
965         Reviewed by Alex Christensen.
966
967         Switch to new NSKeyed[Un]Archiver methods when available. We do not attempt
968         to adopt secure coding in places we were not under the original API.
969
970         * Platform/ios/AccessibilityIOS.mm:
971         (WebKit::newAccessibilityRemoteToken): Use secure-by-default API.
972         * Shared/Cocoa/DataDetectionResult.mm:
973         (WebKit::DataDetectionResult::encode const): Ditto.
974         (WebKit::DataDetectionResult::decode): Ditto.
975         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
976         (IPC::ArgumentCoder<WebCore::Payment>::encode): Ditto.
977         (IPC::ArgumentCoder<WebCore::Payment>::decode): Ditto.
978         (IPC::ArgumentCoder<WebCore::PaymentContact>::encode): Ditto.
979         (IPC::ArgumentCoder<WebCore::PaymentContact>::decode): Ditto.
980         (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::encode): Ditto.
981         (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::decode): Ditto.
982         (IPC::ArgumentCoder<WebCore::PaymentMethod>::encode): Ditto.
983         (IPC::ArgumentCoder<WebCore::PaymentMethod>::decode): Ditto.
984         * Shared/ios/InteractionInformationAtPosition.mm:
985         (WebKit::InteractionInformationAtPosition::encode const): Ditto.
986         (WebKit::InteractionInformationAtPosition::decode): Ditto.
987         * Shared/mac/WebCoreArgumentCodersMac.mm:
988         (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData): Ditto.
989         (IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData): Ditto.
990         (IPC::ArgumentCoder<Credential>::encodePlatformData): Ditto.
991         (IPC::ArgumentCoder<Credential>::decodePlatformData): Ditto.
992         (IPC::ArgumentCoder<ContentFilterUnblockHandler>::encode): Ditto.
993         (IPC::ArgumentCoder<ContentFilterUnblockHandler>::decode): Ditto.
994         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::encodePlatformData): Ditto.
995         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::decodePlatformData): Ditto.
996         * Shared/mac/WebHitTestResultData.mm:
997         (WebKit::WebHitTestResultData::platformEncode const): Ditto.
998         (WebKit::WebHitTestResultData::platformDecode): Ditto.
999         * UIProcess/API/Cocoa/WKProcessPool.mm:
1000         (-[WKProcessPool _setObject:forBundleParameter:]): Ditto.
1001         (-[WKProcessPool _setObjectsForBundleParametersWithDictionary:]): Ditto.
1002         * UIProcess/API/Cocoa/WKWebView.mm:
1003         (-[WKWebView _setInputDelegate:]): Ditto.
1004         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1005         (WebKit::WebProcessPool::platformInitializeWebProcess): Ditto.
1006         * UIProcess/ios/PageClientImplIOS.mm:
1007         (WebKit::PageClientImpl::startAssistingNode): Ditto.
1008         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
1009         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Ditto.
1010         * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
1011         (WebKit::InjectedBundle::initialize): Ditto.
1012         (WebKit::InjectedBundle::setBundleParameter): Ditto.
1013         (WebKit::InjectedBundle::setBundleParameters): Ditto.
1014
1015 2017-11-28  Youenn Fablet  <youenn@apple.com>
1016
1017         NetworkCache::Storage should protect itself when removing operations from its maps
1018         https://bugs.webkit.org/show_bug.cgi?id=180118
1019
1020         Reviewed by Antti Koivisto.
1021
1022         The operations can contain ref to the Storage object and removing them from the map may destroy the Storage object
1023
1024         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1025         (WebKit::NetworkCache::Storage::remove):
1026         (WebKit::NetworkCache::Storage::finishReadOperation):
1027         (WebKit::NetworkCache::Storage::finishWriteOperation):
1028         (WebKit::NetworkCache::Storage::traverse):
1029
1030 2017-11-28  Youenn Fablet  <youenn@apple.com>
1031
1032         Register Documents as ServiceWorker clients to the StorageProcess
1033         https://bugs.webkit.org/show_bug.cgi?id=180047
1034
1035         Reviewed by Brady Eidson.
1036
1037         Adding IPC to register/unregister clients to the storage process.
1038         This will be used to enable service worker termination, and implementation of Clients API.
1039
1040         WebSWServerConnection keeps a hash map of all its related clients.
1041         This allows unregistering these clients if the corresponding web process crashes.
1042
1043         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1044         (WebKit::WebSWServerConnection::~WebSWServerConnection):
1045         (WebKit::WebSWServerConnection::registerServiceWorkerClient):
1046         (WebKit::WebSWServerConnection::unregisterServiceWorkerClient):
1047         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1048         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
1049         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
1050         * WebProcess/Storage/WebSWClientConnection.cpp:
1051         (WebKit::WebSWClientConnection::registerServiceWorkerClient):
1052         (WebKit::WebSWClientConnection::unregisterServiceWorkerClient):
1053         * WebProcess/Storage/WebSWClientConnection.h:
1054
1055 2017-11-28  Said Abou-Hallawa  <sabouhallawa@apple.com>
1056
1057         [CG] PostScript images should be supported if they are sub-resource images
1058         https://bugs.webkit.org/show_bug.cgi?id=178502
1059         <rdar://problem/35102988>
1060
1061         Reviewed by Simon Fraser.
1062
1063         Make convertPostScriptDataToPDF() be as static function of PDFDocumentImage
1064         in WebCore.
1065
1066         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1067         (WebKit::PDFPlugin::convertPostScriptDataIfNeeded):
1068         (WebKit::convertPostScriptDataToPDF): Deleted.
1069
1070 2017-11-28  Alex Christensen  <achristensen@webkit.org>
1071
1072         Add SPI for adding strings directly to a _WKVisitedLinkStore
1073         https://bugs.webkit.org/show_bug.cgi?id=180100
1074
1075         Reviewed by Geoffrey Garen.
1076
1077         * UIProcess/API/Cocoa/_WKVisitedLinkStore.h:
1078         * UIProcess/API/Cocoa/_WKVisitedLinkStore.mm:
1079         (-[_WKVisitedLinkStore addVisitedLinkWithString:]):
1080         This is a performance optimization for rdar://problem/16321391
1081
1082 2017-11-28  Joseph Pecoraro  <pecoraro@apple.com>
1083
1084         REGRESSION: Web Inspector: context menu actions "Download Image" and "Open Image in New Window" don't work
1085         https://bugs.webkit.org/show_bug.cgi?id=178808
1086         <rdar://problem/35176608>
1087
1088         Reviewed by Brian Burg.
1089
1090         * UIProcess/mac/WKInspectorViewController.mm:
1091         (-[WKInspectorViewController _webView:contextMenu:forElement:]):
1092         Continue to hide the image context menu actions like we used to.
1093         Investigating making these context menus work can be done as a
1094         follow-up task.
1095
1096         * UIProcess/mac/WKWebInspectorWKWebView.mm:
1097         (-[WKWebInspectorWKWebView initWithFrame:configuration:]):
1098         Use nullptr instead of 0.
1099
1100 2017-11-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1101
1102         Move JSONValues to WTF and convert uses of InspectorValues.h to JSONValues.h
1103         https://bugs.webkit.org/show_bug.cgi?id=173793
1104
1105         Reviewed by Joseph Pecocaro.
1106
1107         Based on patch by Brian Burg.
1108
1109         * UIProcess/Automation/WebAutomationSession.cpp:
1110         (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext):
1111         (WebKit::WebAutomationSession::moveWindowOfBrowsingContext):
1112         (WebKit::WebAutomationSession::waitForNavigationToCompleteOnPage):
1113         (WebKit::WebAutomationSession::waitForNavigationToCompleteOnFrame):
1114         (WebKit::WebAutomationSession::respondToPendingPageNavigationCallbacksWithTimeout):
1115         (WebKit::WebAutomationSession::respondToPendingFrameNavigationCallbacksWithTimeout):
1116         (WebKit::WebAutomationSession::navigationOccurredForFrame):
1117         (WebKit::WebAutomationSession::documentLoadedForFrame):
1118         (WebKit::WebAutomationSession::inspectorFrontendLoaded):
1119         (WebKit::WebAutomationSession::keyboardEventsFlushedForPage):
1120         (WebKit::WebAutomationSession::evaluateJavaScriptFunction):
1121         (WebKit::WebAutomationSession::setFilesToSelectForFileUpload):
1122         (WebKit::WebAutomationSession::addSingleCookie):
1123         (WebKit::WebAutomationSession::setSessionPermissions):
1124         (WebKit::WebAutomationSession::performMouseInteraction):
1125         (WebKit::WebAutomationSession::performKeyboardInteractions):
1126         * UIProcess/Automation/WebAutomationSession.h:
1127
1128 2017-11-28  Daniel Bates  <dabates@apple.com>
1129
1130         [Cocoa] First pass at implementing alternative presentation button element
1131         https://bugs.webkit.org/show_bug.cgi?id=179785
1132         Part of <rdar://problem/34917108>
1133
1134         Reviewed by Brent Fulgham.
1135
1136         Expose SPI to substitute the alternative presentation button for one or more elements
1137         and remove the alternative presentation button. Add a private delegate callback when
1138         the alternative presentation button is clicked.
1139
1140         * UIProcess/API/APIUIClient.h:
1141         (API::UIClient::didClickAlternativePresentationButton): Added.
1142         * UIProcess/API/C/WKPageUIClient.h:
1143         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1144         * UIProcess/Cocoa/UIDelegate.h:
1145         * UIProcess/Cocoa/UIDelegate.mm:
1146         (WebKit::UIDelegate::setDelegate): Wired up delegate callback.
1147         (WebKit::UIDelegate::UIClient::didClickAlternativePresentationButton): Added.
1148         * UIProcess/WebPageProxy.cpp:
1149         (WebKit::WebPageProxy::handleAlternativePresentationButtonClick): Added.
1150         * UIProcess/WebPageProxy.h:
1151         * UIProcess/WebPageProxy.messages.in:
1152         * WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h:
1153         (API::InjectedBundle::PageUIClient::didClickAlternativePresentationButton): Added.
1154         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h:
1155         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
1156         (-[WKWebProcessPlugInFrame substituteElements:withAlternativePresentationButtonWithIdentifier:]): Added.
1157         (-[WKWebProcessPlugInFrame removeAlternativePresentationButton:]): Added.
1158         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFramePrivate.h:
1159         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
1160         (WKBundleSubstituteWithAlternativePresentationButton): Added.
1161         (WKBundleRemoveAlternativePresentationButton): Added.
1162         * WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h:
1163         * WebProcess/InjectedBundle/API/c/WKBundlePageUIClient.h:
1164         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
1165         (WebKit::InjectedBundlePageUIClient::didClickAlternativePresentationButton): Added.
1166         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
1167         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1168         (WebKit::WebChromeClient::handleAlternativePresentationButtonClick): Added.
1169         * WebProcess/WebCoreSupport/WebChromeClient.h:
1170
1171 2017-11-27  Chris Dumez  <cdumez@apple.com>
1172
1173         ASSERTION FAILED: addResult.isNewEntry WebCore::SWServerRegistration::addClientUsingRegistration(WebCore::ServiceWorkerClientIdentifier const&) + 141
1174         https://bugs.webkit.org/show_bug.cgi?id=180049
1175
1176         Reviewed by Brady Eidson.
1177
1178         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
1179         * WebProcess/Storage/WebSWClientConnection.cpp:
1180         (WebKit::WebSWClientConnection::addServiceWorkerRegistrationInServer):
1181         (WebKit::WebSWClientConnection::removeServiceWorkerRegistrationInServer):
1182         (WebKit::WebSWClientConnection::serviceWorkerStartedControllingClient):
1183         (WebKit::WebSWClientConnection::serviceWorkerStoppedControllingClient):
1184         * WebProcess/Storage/WebSWClientConnection.h:
1185
1186 2017-11-27  Jeremy Jones  <jeremyj@apple.com>
1187
1188         downcast to WebKit::FullscreenClient can sometimes fail.
1189         https://bugs.webkit.org/show_bug.cgi?id=179849
1190
1191         Reviewed by Darin Adler.
1192
1193         There are cases during teardown where fullscreenClient() has been cleared back to an API::FullscreenClient.
1194         Because those cases, WKWebView should test before downcasting to WebKit::FullscreenClient.
1195
1196         This is causing a crash when fullscreen delegate is cleared after a page is closed.
1197
1198         * UIProcess/API/Cocoa/WKWebView.mm:
1199         (-[WKWebView _setFullscreenDelegate:]):
1200         (-[WKWebView _fullscreenDelegate]):
1201
1202 2017-11-27  Chris Dumez  <cdumez@apple.com>
1203
1204         Give Document a strongly typed identifier instead of a uint64_t
1205         https://bugs.webkit.org/show_bug.cgi?id=180041
1206
1207         Reviewed by Youenn Fablet.
1208
1209         Give Document a strongly typed identifier instead of a uint64_t, for clarity.
1210
1211         * Platform/IPC/ArgumentCoders.h:
1212         * Scripts/webkit/messages.py:
1213         (forward_declarations_and_headers):
1214         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1215         (WebKit::WebSWServerConnection::notifyClientsOfControllerChange):
1216         (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope):
1217         (WebKit::WebSWServerConnection::postMessageToServiceWorkerClient):
1218         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1219         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
1220         * StorageProcess/StorageProcess.cpp:
1221         (WebKit::StorageProcess::postMessageToServiceWorkerClient):
1222         * WebProcess/Storage/WebSWClientConnection.cpp:
1223         (WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope):
1224         (WebKit::WebSWClientConnection::serviceWorkerStartedControllingClient):
1225         (WebKit::WebSWClientConnection::serviceWorkerStoppedControllingClient):
1226         (WebKit::WebSWClientConnection::postMessageToServiceWorkerClient):
1227         * WebProcess/Storage/WebSWClientConnection.h:
1228         * WebProcess/Storage/WebSWClientConnection.messages.in:
1229
1230 2017-11-27  Yacine Bandou  <yacine.bandou_ext@softathome.com>
1231
1232         [GTK][WPE] Add "enable-encrypted-media" property to WebKitWebSettings
1233         https://bugs.webkit.org/show_bug.cgi?id=18005
1234
1235         Reviewed by Michael Catanzaro.
1236
1237         EncryptedMedia is an experimental JavaScript API for playing encrypted media in HTML.
1238         This property will only work as intended if the EncryptedMedia feature is enabled at build time
1239         with the ENABLE_ENCRYPTED_MEDIA flag.
1240
1241         * UIProcess/API/glib/WebKitSettings.cpp:
1242         (webKitSettingsSetProperty):
1243         (webKitSettingsGetProperty):
1244         (webkit_settings_class_init):
1245         (webkit_settings_get_enable_encrypted_media):
1246         (webkit_settings_set_enable_encrypted_media):
1247         * UIProcess/API/gtk/WebKitSettings.h:
1248         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
1249         * UIProcess/API/wpe/WebKitSettings.h:
1250
1251 2017-11-27  Tim Horton  <timothy_horton@apple.com>
1252
1253         One too many zeroes in macOS version number in FeatureDefines
1254         https://bugs.webkit.org/show_bug.cgi?id=180011
1255
1256         Reviewed by Dan Bernstein.
1257
1258         * Configurations/FeatureDefines.xcconfig:
1259
1260 2017-11-27  Zan Dobersek  <zdobersek@igalia.com>
1261
1262         [CoordGraphics] Prettify ID value handling in UpdateAtlas and UpdateAtlas::Client
1263         https://bugs.webkit.org/show_bug.cgi?id=180038
1264
1265         Reviewed by Carlos Garcia Campos.
1266
1267         In the UpdateAtlas class, provide an ID type that aliases to uint32_t.
1268         The m_id member variable (ex-m_ID) uses this type, and it's also now
1269         used in the Client interface.
1270
1271         While poking around, the header is modified to use '#pragma once',
1272         and m_id is moved to the more logical first position among member
1273         variables.
1274
1275         The static ID variable is modified to use the new type, and renamed
1276         to s_nextID. Comment alongside the namespace scope closure is fixed
1277         to use the appropriate name.
1278
1279         createUpdateAtlas() and removeUpdateAtlas() methods in the
1280         CompositingCoordinator class are modified to use the UpdateAtlas::ID
1281         type, and the former has the second parameter changed from RefPtr<>
1282         to Ref<>.
1283
1284         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
1285         (WebKit::CompositingCoordinator::createUpdateAtlas):
1286         (WebKit::CompositingCoordinator::removeUpdateAtlas):
1287         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
1288         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp:
1289         (WebKit::UpdateAtlas::UpdateAtlas):
1290         (WebKit::UpdateAtlas::~UpdateAtlas):
1291         (WebKit::UpdateAtlas::getCoordinatedBuffer):
1292         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h:
1293
1294 2017-11-27  Zan Dobersek  <zdobersek@igalia.com>
1295
1296         [CoordGraphics] CompositingCoordinator: clean up Client vtable, GraphicsLayerClient overrides
1297         https://bugs.webkit.org/show_bug.cgi?id=180037
1298
1299         Reviewed by Carlos Garcia Campos.
1300
1301         Remove the CompositingCoordinator::Client::paintLayerContents() method since
1302         the only implementation in CoordinatedLayerTreeHost was empty.
1303
1304         Subsequently, the CompositingCoordinator::paintContents() override of the
1305         GraphicsLayerClient method can also be removed. The notifyAnimationStarted()
1306         override is empty, just like the base method, so it's removed as well.
1307
1308         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
1309         (WebKit::CompositingCoordinator::deviceScaleFactor const): Bring method up
1310         to the notifyFlushRequired() code, since both are overrides of the
1311         GraphicsLayerClient-inherited methods.
1312         (WebKit::CompositingCoordinator::pageScaleFactor const): Ditto.
1313         (WebKit::CompositingCoordinator::notifyAnimationStarted): Deleted.
1314         (WebKit::CompositingCoordinator::paintContents): Deleted.
1315         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
1316         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
1317         (WebKit::CoordinatedLayerTreeHost::paintLayerContents): Deleted.
1318         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
1319
1320 2017-11-27  Carlos Garcia Campos  <cgarcia@igalia.com>
1321
1322         REGRESSION(r223073): disk cache directory is no longer copied in ProcessPoolConfiguration::copy()
1323         https://bugs.webkit.org/show_bug.cgi?id=180031
1324
1325         Reviewed by Youenn Fablet.
1326
1327         This has caused GTK/WPE test /webkit2/WebKitWebsiteData/configuration to fail, and the wrong directory is used
1328         by the network process. I think it was removed by mistake in r223073.
1329
1330         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1331         (API::ProcessPoolConfiguration::copy): Copy m_diskCacheDirectory too.
1332
1333 2017-11-27  Adrian Perez de Castro  <aperez@igalia.com>
1334
1335         [WPE][GTK] Improve contents of pkg-config .pc files
1336         https://bugs.webkit.org/show_bug.cgi?id=180032
1337
1338         Reviewed by Carlos Garcia Campos.
1339
1340         * gtk/webkit2gtk-web-extension.pc.in: Add URL, edit Name and Description.
1341         * gtk/webkit2gtk.pc.in: Add URL, edit Name.
1342         * wpe/wpe-webkit.pc.in: Add URL, edit Name and Description.
1343
1344 2017-11-23  Darin Adler  <darin@apple.com>
1345
1346         Fix dictionary leak in lookup, convert FindOptions to OptionSet, tweak code style nearby
1347         https://bugs.webkit.org/show_bug.cgi?id=179981
1348
1349         Reviewed by Sam Weinig.
1350
1351         * WebProcess/Plugins/PDF/PDFPlugin.h: Use some references instead of pointers. Made more
1352         things final and private. Changed functions with multiple return values to use tuples
1353         instead of out arguments for clarity, especially because some were using pointers and it
1354         was ambiguous whether the pointers could be nullptr. Tweaked formatting. Moved initialization
1355         of data members into the class definition.
1356
1357         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1358         (WebKit::PDFPlugin::create): Take a reference.
1359         (WebKit::PDFPlugin::PDFPlugin): Ditto. Also moved some initialization to the class definition.
1360         (WebKit::PDFPlugin::countFindMatches): Added comment about ignored maxMatchCount argument.
1361         (WebKit::PDFPlugin::findString): Use contains instead of & to check bits in options.
1362         Simplified slightly confusing match count code that was doing some unnecessary comparisons
1363         with the maximum match count. Use auto a bit.
1364         (WebKit::coreCursor): Renamed from pdfLayerControllerCursorTypeToCursor since this is C++
1365         and overloading works based on the argument type.
1366         (WebKit::PDFPlugin::notifyCursorChanged): Updated for name change.
1367         (WebKit::PDFPlugin::lookupTextAtLocation const): Return a tuple instead of using two out
1368         arguments and use a RetainPtr so we don't leak the options dictionary.
1369
1370         * WebProcess/Plugins/PluginProxy.h: Removed unneeded include of FindOptions.h.
1371
1372         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
1373         (WebKit::WebContextMenuClient::lookUpInDictionary): Pass a reference.
1374
1375         * WebProcess/WebPage/FindController.cpp:
1376         (WebKit::core): Use |= instead of | to build up a FindOptions.
1377         (WebKit::FindController::FindController): Initialize data members in the class definition.
1378         (WebKit::pluginViewForFrame): Deleted. Callers now use WebPage::pluginViewForFrame.
1379         (WebKit::FindController::updateFindUIAfterPageScroll): Added a FIXME about some peculiar code.
1380         (WebKit::FindController::findString): Use |= rather than | to add in an option.
1381         (WebKit::FindController::hideFindUI): Use { } rather than 0 for no options.
1382         * WebProcess/WebPage/FindController.h: Moved initialization to the header. Exported the core
1383         function that converts WebKit::FindOptions to WebCore::FindOptions.
1384
1385         * WebProcess/WebPage/WebFrame.cpp:
1386         (WebKit::WebFrame::handlesPageScaleGesture const): Use WebPage::pluginViewForFrame.
1387         (WebKit::WebFrame::requiresUnifiedScaleFactor const): Use WebPage::pluginViewForFrame.
1388
1389         * WebProcess/WebPage/WebPage.cpp:
1390         (WebKit::WebPage::createPlugin): Removed unneeded local variable and UNUSED_PARAM.
1391         (WebKit::WebPage::focusedPluginViewForFrame): Use pluginViewForFrame.
1392         (WebKit::WebPage::pluginViewForFrame): Added a null check since this takes a pointer.
1393         Use is/downcast insteadof more ad hoc coding style.
1394         (WebKit::WebPage::findStringFromInjectedBundle): Call core to convert WebKit::FindOptions
1395         to WebCore::FindOptions. Before, this was accidentally relying on the bits from the two
1396         enumrations matching! The stricter type checking of OptionSet helps us catch mistakes
1397         like this.
1398
1399         * WebProcess/WebPage/WebPage.h: Updated for the above. Also flattened out nested #if
1400         statements, made forward declarations unconditional, and re-sorted them. Changed the
1401         Mac-specific lookupTextAtLocation to return a tuple (see below).
1402
1403         * WebProcess/WebPage/ios/WebPageIOS.mm:
1404         (WebKit::WebPage::performDictionaryLookupForSelection): Take a reference instead of a pointer.
1405         (WebKit::WebPage::performDictionaryLookupForRange): Ditto.
1406         (WebKit::rangeNearPositionMatchesText): Use { } rather than 0 for no options.
1407
1408         * WebProcess/WebPage/mac/WebPageMac.mm:
1409         (WebKit::WebPage::performDictionaryLookupAtLocation): Use RetainPtr<NSDictionary> to fix
1410         code that used to leak.
1411         (WebKit::WebPage::performDictionaryLookupForSelection): Ditto.
1412         (WebKit::WebPage::performDictionaryLookupOfCurrentSelection): Use a reference.
1413         (WebKit::WebPage::dictionaryPopupInfoForRange): Updated for changed argument types.
1414         (WebKit::WebPage::dictionaryPopupInfoForSelectionInPDFPlugin): Ditto.
1415         (WebKit::WebPage::performDictionaryLookupForRange): Ditto.
1416         (WebKit::WebPage::performImmediateActionHitTestAtLocation): Updated to handle the
1417         tuple result from the lookupTextAtLocation functions.
1418         (WebKit::WebPage::lookupTextAtLocation): Changed to return a tuple and use RetainPtr
1419         for the NSDictionary to help fix the leak.
1420
1421 2017-11-24  Zan Dobersek  <zdobersek@igalia.com>
1422
1423         [CoordGraphics] CoordinatedGraphicsLayer::updateContentBuffers() should always assume a non-null CoordinatedBuffer
1424         https://bugs.webkit.org/show_bug.cgi?id=179977
1425
1426         Reviewed by Carlos Garcia Campos.
1427
1428         Make CompositingCoordinator::getCoordinatedBuffer() return a Ref<CoordinatedBuffer>
1429         value. In case an UpdateAtlas with enough free area is found, its CoordinatedBuffer
1430         is dereferenced into the return value. In case a new UpdateAtlas is created, the
1431         returned CoordinatedBuffer pointer is asserted to be non-null and dereferenced.
1432
1433         The retrieved CoordinatedBuffer pointer on a newly-created UpdateAtlas should never
1434         be null since the tiles are smaller in size than the UpdateAtlas area. The assert
1435         is done in release configurations as well since the code in CoordinatedGraphicsLayer
1436         assumes the returned pointer will be non-null, so it's just a matter of where to
1437         crash first in case somehow a null value is returned.
1438
1439         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
1440         (WebKit::CompositingCoordinator::getCoordinatedBuffer):
1441         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
1442
1443 2017-11-24  Zan Dobersek  <zdobersek@igalia.com>
1444
1445         [CoordGraphics] UpdateAtlas constructor should receive an IntSize, not a dimension value
1446         https://bugs.webkit.org/show_bug.cgi?id=179976
1447
1448         Reviewed by Carlos Garcia Campos.
1449
1450         Have the UpdateAtlas constructor receive an IntSize object that specifies
1451         the desired size for the CoordinatedBuffer. Passing in a dimension doesn't
1452         really make sense since this value isn't dynamically configurable, and
1453         the only value that is passed in is already a power-of-two.
1454
1455         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
1456         (WebKit::CompositingCoordinator::getCoordinatedBuffer):
1457         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp:
1458         (WebKit::UpdateAtlas::UpdateAtlas):
1459         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h:
1460
1461 2017-11-23  Sam Weinig  <sam@webkit.org>
1462
1463         Remove unneeded ScriptController::processingUserGesture() forwarding functions
1464         https://bugs.webkit.org/show_bug.cgi?id=179954
1465
1466         Reviewed by Darin Adler.
1467
1468         Replace ScriptController::processingUserGesture() and ScriptController::processingUserGestureForMedia()
1469         with direct calls to the corresponding UserGestureIndicator functions.
1470
1471         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1472         (WebKit::InjectedBundle::isProcessingUserGesture):
1473         * WebProcess/WebPage/WebPage.cpp:
1474         (WebKit::WebPage::addResourceRequest):
1475
1476 2017-11-23  Chris Dumez  <cdumez@apple.com>
1477
1478         WebSWServerConnection should register/unregister itself with the StorageProcess
1479         https://bugs.webkit.org/show_bug.cgi?id=179965
1480
1481         Reviewed by Darin Adler.
1482
1483         WebSWServerConnection should register/unregister itself with the StorageProcess instead of relying
1484         on StorageToWebProcessConnection to do so on its behalf. This is less error-prone.
1485
1486         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1487         (WebKit::WebSWServerConnection::WebSWServerConnection):
1488         (WebKit::WebSWServerConnection::~WebSWServerConnection):
1489         * StorageProcess/StorageToWebProcessConnection.cpp:
1490         (WebKit::StorageToWebProcessConnection::~StorageToWebProcessConnection):
1491         (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
1492         (WebKit::StorageToWebProcessConnection::removeSWServerConnection):
1493
1494 2017-11-23  Darin Adler  <darin@apple.com>
1495
1496         Reduce WTF::String operations that do unnecessary Unicode operations instead of ASCII
1497         https://bugs.webkit.org/show_bug.cgi?id=179907
1498
1499         Reviewed by Sam Weinig.
1500
1501         * NetworkProcess/cache/NetworkCache.cpp:
1502         (WebKit::NetworkCache::isMediaMIMEType): Use startsWithLettersIgnoringASCIICase.
1503         * NetworkProcess/cache/NetworkCacheKey.cpp:
1504         (WebKit::NetworkCache::hashString): Use isAllASCII..
1505         * UIProcess/API/C/WKWebsitePolicies.cpp:
1506         (WKWebsitePoliciesSetCustomHeaderFields): Use startsWithLettersIgnoringASCIICase..
1507         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
1508         (-[_WKWebsitePolicies setCustomHeaderFields:]): Ditto.
1509         * UIProcess/WebPageProxy.cpp:
1510         (WebKit::WebPageProxy::savePDFToFileInDownloadsFolder): Use endsWithIgnoringASCIICase.
1511         * UIProcess/WebPreferences.cpp:
1512         (WebKit::WebPreferences::WebPreferences): Initialize m_identifier explicitly. Somehow
1513         changing the String default constructor to be "= default" led to a warning that we
1514         otherwise did not get about not initializing m_identifier. Arguably a compiler bug,
1515         but legitimately strange that the copy constructor does not copy m_identifier and so
1516         nice to be explicit about it, I guess.
1517         * UIProcess/mac/WebPageProxyMac.mm:
1518         (WebKit::WebPageProxy::savePDFToTemporaryFolderAndOpenWithNativeApplicationRaw): Use
1519         endsWithIgnoringASCIICase.
1520         (WebKit::WebPageProxy::openPDFFromTemporaryFolderWithNativeApplication): Ditto.
1521         * WebProcess/WebPage/WebPage.cpp:
1522         (WebKit::WebPage::createPlugin): Ditto.
1523         * WebProcess/WebPage/ios/WebPageIOS.mm:
1524         (WebKit::WebPage::platformEditorState const): Use isAllSpecialCharacters<isHTMLSpace>.
1525
1526 2017-11-23  Zan Dobersek  <zdobersek@igalia.com>
1527
1528         [CoordGraphics] Simplify CoordinatedGraphicsLayer's content buffer updates
1529         https://bugs.webkit.org/show_bug.cgi?id=179972
1530
1531         Reviewed by Carlos Garcia Campos.
1532
1533         In CompositingCoordinator, add the getCoordinatedBuffer() method, replacing
1534         paintToSurface(). The new method traverses the list of UpdateAtlases and
1535         returns any CoordinatedBuffer object that was free to use. If none exist,
1536         a new UpdateAtlas object is created, and its CoordinatedBuffer is returned.
1537
1538         In  UpdateAtlas, the paintOnAvailableBuffer() method is replaced with
1539         getCoordinatedBuffer(). The latter allocates the necessary area but then
1540         returns a reference to the CoordinatedBuffer buffer, along with the atlas ID
1541         and the allocated rectangle information, and does not invoke any painting
1542         operation like paintOnAvailableBuffer() did.
1543
1544         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
1545         (WebKit::CompositingCoordinator::getCoordinatedBuffer):
1546         (WebKit::CompositingCoordinator::paintToSurface): Deleted.
1547         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
1548         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp:
1549         (WebKit::UpdateAtlas::getCoordinatedBuffer):
1550         (WebKit::UpdateAtlas::paintOnAvailableBuffer): Deleted.
1551         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h:
1552
1553 2017-11-23  Zan Dobersek  <zdobersek@igalia.com>
1554
1555         [CoordGraphics] Remove relay CoordinatedBuffer::Client implementations
1556         https://bugs.webkit.org/show_bug.cgi?id=179970
1557
1558         Reviewed by Carlos Garcia Campos.
1559
1560         Drop the helper UpdateAtlasSurfaceClient class and instead directly use
1561         the CoordinatedBuffer's GraphicsContext to perform clip and translation
1562         operations based on the allocated rectangle, to pre-fill the target rect
1563         with transparent color in case the alpha channel is supported, and to
1564         then invoke CoordinatedBuffer::Client::paintToSurfaceContext() method,
1565         passing the GraphicsContext as the argument.
1566
1567         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp:
1568         (WebKit::UpdateAtlas::paintOnAvailableBuffer):
1569         (): Deleted.
1570
1571 2017-11-23  Zan Dobersek  <zdobersek@igalia.com>
1572
1573         [CoordGraphics] Replace CoordinatedSurface, ThreadSafeCoordinatedSurface with CoordinatedBuffer
1574         https://bugs.webkit.org/show_bug.cgi?id=179967
1575
1576         Reviewed by Carlos Garcia Campos.
1577
1578         Replace uses of CoordinatedSurface class with CoordinatedBuffer. The
1579         ThreadSafeCoordinatedSurface class is removed, along with the code in
1580         CoordinatedLayerTreeHost that established a CoordinatedSurface factory.
1581
1582         * PlatformGTK.cmake:
1583         * PlatformWPE.cmake:
1584         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
1585         (WebKit::CoordinatedBackingStoreTile::swapBuffers):
1586         (WebKit::CoordinatedBackingStoreTile::setBackBuffer):
1587         (WebKit::CoordinatedBackingStore::updateTile):
1588         * Shared/CoordinatedGraphics/CoordinatedBackingStore.h:
1589         Rename m_surface to m_buffer, m_surfaceOffset to m_bufferOffset.
1590         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1591         (WebKit::CoordinatedGraphicsScene::createUpdateAtlas):
1592         (WebKit::CoordinatedGraphicsScene::updateImageBacking):
1593         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
1594         * Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.cpp: Removed.
1595         * Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.h: Removed.
1596         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
1597         (WebKit::CompositingCoordinator::updateImageBacking):
1598         (WebKit::CompositingCoordinator::createUpdateAtlas):
1599         (WebKit::CompositingCoordinator::paintToSurface):
1600         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
1601         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
1602         (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
1603         (WebKit::CoordinatedLayerTreeHost::createCoordinatedSurface): Deleted.
1604         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
1605         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp:
1606         (WebKit::UpdateAtlas::UpdateAtlas):
1607         (WebKit::UpdateAtlas::~UpdateAtlas):
1608         (WebKit::UpdateAtlas::paintOnAvailableBuffer):
1609         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h:
1610         Rename m_surface to m_buffer.
1611         (WebKit::UpdateAtlas::size const):
1612         (WebKit::UpdateAtlas::supportsAlpha const):
1613
1614 2017-11-22  Ali Juma  <ajuma@chromium.org>
1615
1616         Implement VisualViewport API attributes
1617         https://bugs.webkit.org/show_bug.cgi?id=179385
1618
1619         Reviewed by Frédéric Wang.
1620
1621         Add a VisualViewportAPI experimental feature.
1622
1623         * Shared/WebPreferences.yaml:
1624
1625 2017-11-22  Tim Horton <timothy_horton@apple.com> and Michael Catanzaro <mcatanzaro@igalia.com>
1626
1627         Remove build-webkit's notion of feature flags having a default value
1628         https://bugs.webkit.org/show_bug.cgi?id=177338
1629
1630         Reviewed by Carlos Alberto Lopez Perez.
1631
1632         Use ENABLE_EXPERIMENTAL_FEATURES instead of ENABLE_DEVELOPER_MODE to enable runtime
1633         experimental features.
1634
1635         * Shared/WebPreferencesDefaultValues.h:
1636
1637 2017-11-22  Commit Queue  <commit-queue@webkit.org>
1638
1639         Unreviewed, rolling out r225093.
1640         https://bugs.webkit.org/show_bug.cgi?id=179938
1641
1642         Compilation failed on WinCairo 64-bit Release (Requested by
1643         fredw on #webkit).
1644
1645         Reverted changeset:
1646
1647         "Implement VisualViewport API attributes"
1648         https://bugs.webkit.org/show_bug.cgi?id=179385
1649         https://trac.webkit.org/changeset/225093
1650
1651 2017-11-21  Ali Juma  <ajuma@chromium.org>
1652
1653         Implement VisualViewport API attributes
1654         https://bugs.webkit.org/show_bug.cgi?id=179385
1655
1656         Reviewed by Frédéric Wang.
1657
1658         Add a VisualViewportAPI experimental feature.
1659
1660         * Shared/WebPreferences.yaml:
1661
1662 2017-11-21  Christopher Reid  <chris.reid@sony.com>
1663
1664         [PAL] Remove FileSystem's dependency on WebCoreNSStringExtras
1665         https://bugs.webkit.org/show_bug.cgi?id=179504
1666
1667         Reviewed by Darin Adler.
1668
1669         * UIProcess/Cocoa/WebViewImpl.mm:
1670         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1671         * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
1672
1673 2017-11-21  Carlos Garcia Campos  <cgarcia@igalia.com>
1674
1675         [WPE] WPEWebProcess: Couldn't find current GLX or EGL context
1676         https://bugs.webkit.org/show_bug.cgi?id=179883
1677
1678         Reviewed by Žan Doberšek.
1679
1680         I'm seeing that message quite often when running the unit tests. The problem seems to be that some tests run so
1681         fast that the web process never renders the first frame, so the context is created but never made current. I've
1682         checked with apitrace that there are calls to eglQueryContext with null display, causing a EGL_BAD_DISPLAY, but
1683         I don't know where those calls are originated. Making the context current right after it's created fixes the
1684         problem.
1685
1686         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1687         (WebKit::ThreadedCompositor::createGLContext): Always call makeContextCurrent() right after the context is created.
1688
1689 2017-11-20  Carlos Garcia Campos  <cgarcia@igalia.com>
1690
1691         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.19.2 release.
1692
1693         * gtk/NEWS: Add release notes for 2.19.2.
1694
1695 2017-11-20  Don Olmstead  <don.olmstead@sony.com>
1696
1697         Add declspec within WebKit API
1698         https://bugs.webkit.org/show_bug.cgi?id=179893
1699
1700         Reviewed by Darin Adler.
1701
1702         * Shared/API/c/WKDeclarationSpecifiers.h:
1703
1704 2017-11-20  Mario Sanchez Prada  <mario@endlessm.com>
1705
1706         [GTK] New API to add, retrieve and delete cookies via WebKitCookieManager
1707         https://bugs.webkit.org/show_bug.cgi?id=177932
1708
1709         Reviewed by Carlos Garcia Campos.
1710
1711         Added new API to WebKitCookieManager to add, retrieve and delete complete
1712         cookies into/out-of a running session, and updated documentation sections.
1713
1714         * UIProcess/API/glib/WebKitCookieManager.cpp:
1715         (webkit_cookie_manager_add_cookie): New function.
1716         (webkit_cookie_manager_add_cookie_finish): Ditto.
1717         (webkit_cookie_manager_get_cookies): Ditto.
1718         (webkit_cookie_manager_get_cookies_finish): Ditto.
1719         (webkit_cookie_manager_delete_cookie): Ditto.
1720         (webkit_cookie_manager_delete_cookie_finish): Ditto.
1721         * UIProcess/API/gtk/WebKitCookieManager.h: Added new functions.
1722         * UIProcess/API/wpe/WebKitCookieManager.h: Ditto.
1723         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Ditto.
1724
1725 2017-11-20  Carlos Garcia Campos  <cgarcia@igalia.com>
1726
1727         [WPE] webkit_web_view_new() should enable specifying wpe_view_backend object
1728         https://bugs.webkit.org/show_bug.cgi?id=178655
1729
1730         Reviewed by Michael Catanzaro.
1731
1732         Update all WebKitWebView constructors to receive a WebKitWebViewBackend as argument. It's now required to
1733         provide a backend to create a web view, but it can be NULL to use the default one. WebKitWebViewBackend is a
1734         boxed type wrapping a struct wpe_view_backend* used as construct only property of WebKitWebView. The view always
1735         takes the ownership of the WebKitWebViewBackend which owns the struct wpe_view_backend*. An optional
1736         GDestroyNotify and user data pointer can be passed to the WebKitWebViewBackend constructor to provide a custom
1737         deleter for the backend. In the C API the struct wpe_view_backend* is also mandatory now, but it can't be NULL
1738         and it's owned by the caller, not the view.
1739
1740         * PlatformWPE.cmake:
1741         * UIProcess/API/C/wpe/WKView.cpp:
1742         (WKViewCreate):
1743         * UIProcess/API/C/wpe/WKView.h:
1744         * UIProcess/API/glib/WebKitWebView.cpp:
1745         (_WebKitWebViewPrivate::~_WebKitWebViewPrivate):
1746         (webkitWebViewConstructed):
1747         (webkitWebViewSetProperty):
1748         (webkitWebViewGetProperty):
1749         (webkit_web_view_class_init):
1750         (webkitWebViewCreatePage):
1751         (webkit_web_view_get_backend):
1752         * UIProcess/API/wpe/WPEView.cpp:
1753         (WKWPE::m_backend):
1754         (WKWPE::View::~View):
1755         * UIProcess/API/wpe/WebKitWebView.h:
1756         * UIProcess/API/wpe/WebKitWebViewBackend.cpp: Added.
1757         (_WebKitWebViewBackend::_WebKitWebViewBackend):
1758         (_WebKitWebViewBackend::~_WebKitWebViewBackend):
1759         (webkitWebViewBackendRef):
1760         (webkitWebViewBackendUnref):
1761         (webkitWebViewBackendCreateDefault):
1762         (webkit_web_view_backend_new):
1763         (webkit_web_view_backend_get_wpe_backend):
1764         * UIProcess/API/wpe/WebKitWebViewBackend.h: Added.
1765         * UIProcess/API/wpe/WebKitWebViewBackendPrivate.h: Added.
1766         * UIProcess/API/wpe/WebKitWebViewWPE.cpp:
1767         (webkit_web_view_new):
1768         (webkit_web_view_new_with_context):
1769         (webkit_web_view_new_with_related_view):
1770         (webkit_web_view_new_with_settings):
1771         (webkit_web_view_new_with_user_content_manager):
1772         * UIProcess/API/wpe/webkit.h:
1773
1774 2017-11-20  Carlos Garcia Campos  <cgarcia@igalia.com>
1775
1776         [GTK][WPE] webkit_cookie_manager_delete_all_cookies doesn't delete the cookies if called before a web process is running
1777         https://bugs.webkit.org/show_bug.cgi?id=175265
1778
1779         Reviewed by Michael Catanzaro.
1780
1781         This is what happens:
1782
1783         1- We create our WebKitWebContext that creates its WebProcessPool.
1784         2- We set a persistent cookies storage.
1785         3- We ask the website data store to delete all cookies, but since website data store is a web process observer
1786            and we haven't spawned any web process yet, it creates a new WebProcessPool with the default configuration
1787            (no persistent cookies) and sends the message to delete the cookies there.
1788         4- The network process of the second process pool does nothing because it doesn't have cookies at all.
1789
1790         We need to set the primary data store of the WebProcessPool when WebKitWebContext is constructed to ensure that
1791         one is used before the web process is launched.
1792
1793         * UIProcess/API/glib/WebKitWebContext.cpp:
1794         (webkitWebContextConstructed):
1795
1796 2017-11-19  Tim Horton  <timothy_horton@apple.com>
1797
1798         Remove unused TOUCH_ICON_LOADING feature flag
1799         https://bugs.webkit.org/show_bug.cgi?id=179873
1800
1801         Reviewed by Simon Fraser.
1802
1803         * Configurations/FeatureDefines.xcconfig:
1804
1805 2017-11-19  Tim Horton  <timothy_horton@apple.com>
1806
1807         Remove unused LEGACY_VENDOR_PREFIXES feature flag
1808         https://bugs.webkit.org/show_bug.cgi?id=179872
1809
1810         Reviewed by Darin Adler.
1811
1812         * Configurations/FeatureDefines.xcconfig:
1813
1814 2017-11-18  Chris Dumez  <cdumez@apple.com>
1815
1816         ASSERTION FAILED: registration in WebCore::SWServerJobQueue::scriptContextStarted(ServiceWorkerIdentifier)
1817         https://bugs.webkit.org/show_bug.cgi?id=179846
1818
1819         Reviewed by Darin Adler.
1820
1821         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1822         (WebKit::WebSWServerConnection::rejectJobInClient):
1823         (WebKit::WebSWServerConnection::resolveRegistrationJobInClient):
1824         (WebKit::WebSWServerConnection::resolveUnregistrationJobInClient):
1825         (WebKit::WebSWServerConnection::startScriptFetchInClient):
1826         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1827         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
1828         * WebProcess/Storage/WebSWClientConnection.messages.in:
1829         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1830         (WebKit::WebSWContextManagerConnection::serviceWorkerStartedWithMessage):
1831         (WebKit::WebSWContextManagerConnection::didFinishInstall):
1832         * WebProcess/Storage/WebSWContextManagerConnection.h:
1833
1834 2017-11-18  Tim Horton  <timothy_horton@apple.com>
1835
1836         Rename some Network Capture debugging defines
1837         https://bugs.webkit.org/show_bug.cgi?id=179870
1838
1839         Reviewed by Darin Adler.
1840
1841         * NetworkProcess/capture/NetworkCaptureLogging.h:
1842         * NetworkProcess/capture/NetworkCaptureManager.cpp:
1843         (WebKit::NetworkCapture::Manager::findMatch):
1844         (WebKit::NetworkCapture::Manager::fuzzyMatchURLs):
1845         These shouldn't have WTF in their name - they have nothing to do with WTF.
1846         These shouldn't use ENABLE(), since they're not features, just debugging macros.
1847
1848 2017-11-17  Chris Dumez  <cdumez@apple.com>
1849
1850         [Service Workers] Implement "Notify Controller Change" algorithm
1851         https://bugs.webkit.org/show_bug.cgi?id=179822
1852
1853         Reviewed by Youenn Fablet.
1854
1855         * Scripts/webkit/messages.py:
1856         (class_template_headers):
1857         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1858         (WebKit::WebSWServerConnection::notifyClientsOfControllerChange):
1859         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1860         * WebProcess/Storage/WebSWClientConnection.messages.in:
1861
1862 2017-11-17  Chris Dumez  <cdumez@apple.com>
1863
1864         Use a strongly typed identifier for SWServer::Connection
1865         https://bugs.webkit.org/show_bug.cgi?id=179848
1866
1867         Reviewed by Brady Eidson.
1868
1869         Use a strongly typed identifier for SWServer::Connection, for clarity.
1870
1871         * Scripts/webkit/messages.py:
1872         (forward_declarations_and_headers):
1873         (forward_declarations_and_headers.templates):
1874         (headers_for_type):
1875         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1876         (WebKit::WebSWServerConnection::WebSWServerConnection):
1877         (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope):
1878         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1879         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
1880         * StorageProcess/StorageProcess.cpp:
1881         (WebKit::StorageProcess::didFailFetch):
1882         (WebKit::StorageProcess::didNotHandleFetch):
1883         (WebKit::StorageProcess::didReceiveFetchResponse):
1884         (WebKit::StorageProcess::didReceiveFetchData):
1885         (WebKit::StorageProcess::didReceiveFetchFormData):
1886         (WebKit::StorageProcess::didFinishFetch):
1887         * StorageProcess/StorageProcess.h:
1888         * StorageProcess/StorageProcess.messages.in:
1889         * StorageProcess/StorageToWebProcessConnection.cpp:
1890         (WebKit::StorageToWebProcessConnection::didReceiveMessage):
1891         (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
1892         (WebKit::StorageToWebProcessConnection::removeSWServerConnection):
1893         (WebKit::generateIDBConnectionToServerIdentifier):
1894         (WebKit::StorageToWebProcessConnection::establishIDBConnectionToServer):
1895         * StorageProcess/StorageToWebProcessConnection.h:
1896         * StorageProcess/StorageToWebProcessConnection.messages.in:
1897         * WebProcess/Storage/WebSWClientConnection.cpp:
1898         (WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope):
1899         * WebProcess/Storage/WebSWClientConnection.h:
1900         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1901         (WebKit::WebSWContextManagerConnection::startFetch):
1902         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerGlobalScope):
1903         * WebProcess/Storage/WebSWContextManagerConnection.h:
1904         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
1905         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
1906         (WebKit::WebServiceWorkerFetchTaskClient::WebServiceWorkerFetchTaskClient):
1907         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:
1908         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
1909         (WebKit::WebToStorageProcessConnection::didReceiveMessage):
1910         (WebKit::WebToStorageProcessConnection::serviceWorkerConnectionForSession):
1911         * WebProcess/Storage/WebToStorageProcessConnection.h:
1912
1913 2017-11-17  John Wilander  <wilander@apple.com>
1914
1915         Storage Access API: UI process should update network process about granted access
1916         https://bugs.webkit.org/show_bug.cgi?id=176943
1917         <rdar://problem/34440612>
1918
1919         Reviewed by Alex Christensen.
1920
1921         * NetworkProcess/NetworkProcess.cpp:
1922         (WebKit::NetworkProcess::updateStorageAccessForPrevalentDomains):
1923             Updates storage access on the session.
1924         * NetworkProcess/NetworkProcess.h:
1925         * NetworkProcess/NetworkProcess.messages.in:
1926         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1927         (WebKit::NetworkProcessCreationParameters::encode const):
1928         (WebKit::NetworkProcessCreationParameters::decode):
1929         * NetworkProcess/NetworkProcessCreationParameters.h:
1930         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1931         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
1932         (WebKit::NetworkProcess::setStorageAccessAPIEnabled):
1933         * UIProcess/API/C/WKCookieManager.cpp:
1934         (WKCookieManagerSetStorageAccessAPIEnabled):
1935         * UIProcess/API/C/WKCookieManager.h:
1936         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1937         (WKWebsiteDataStoreSetStatisticsHasHadNonRecentUserInteraction):
1938         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
1939         * UIProcess/API/Cocoa/WKProcessPool.mm:
1940         (-[WKProcessPool _isStorageAccessAPIEnabled]):
1941         (-[WKProcessPool _setStorageAccessAPIEnabled:]):
1942         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1943         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1944         (-[WKWebsiteDataStore _resourceLoadStatisticsSetHasHadNonRecentUserInteractionForHost:]):
1945             Test infrastructure.
1946         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
1947         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1948         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
1949         (WebKit::WebProcessPool::setStorageAccessAPIEnabled):
1950         * UIProcess/Network/NetworkProcessProxy.cpp:
1951         (WebKit::nextRequestStorageAccessContextId):
1952         (WebKit::NetworkProcessProxy::updateStorageAccessForPrevalentDomains):
1953             Sends a message to the network process to update storage access.
1954         (WebKit::NetworkProcessProxy::storageAccessRequestResult):
1955             Receives a message from the network process that storage access
1956             was updated.
1957         * UIProcess/Network/NetworkProcessProxy.h:
1958         * UIProcess/Network/NetworkProcessProxy.messages.in:
1959         * UIProcess/WebCookieManagerProxy.cpp:
1960         (WebKit::WebCookieManagerProxy::setStorageAccessAPIEnabled):
1961         * UIProcess/WebCookieManagerProxy.h:
1962         * UIProcess/WebProcessPool.h:
1963         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1964         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
1965         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
1966         (WebKit::WebResourceLoadStatisticsStore::logNonRecentUserInteraction):
1967             Test infrastructure.
1968         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
1969             Now makes the API call even if the only operation is to clear first.
1970         * UIProcess/WebResourceLoadStatisticsStore.h:
1971         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1972         (WebKit::WebsiteDataStore::updateStorageAccessForPrevalentDomainsHandler):
1973             Propagates the storage access directive to the network process proxy.
1974         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
1975         * UIProcess/WebsiteData/WebsiteDataStore.h:
1976
1977 2017-11-16  Yousuke Kimoto  <yousuke.kimoto@sony.com>
1978
1979         [WinCairo] Add network (curl) files for wincairo webkit
1980         https://bugs.webkit.org/show_bug.cgi?id=179474
1981
1982         Reviewed by Alex Christensen.
1983
1984         * Shared/curl/WebCoreArgumentCodersCurl.cpp:
1985         (IPC::ArgumentCoder<CertificateInfo>::decode): Fidex return value since currently no operation is needed for wincairo webkit.
1986         (IPC::ArgumentCoder<ResourceError>::decodePlatformData): Fidex return value since currently no operation is needed for wincairo webkit.
1987         * WebProcess/WebCoreSupport/curl/WebFrameNetworkingContext.cpp: Renamed from Source/WebKit/WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.cpp.
1988         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
1989         * WebProcess/WebCoreSupport/curl/WebFrameNetworkingContext.h: Renamed from Source/WebKit/WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.h.
1990
1991 2017-11-16  Don Olmstead  <don.olmstead@sony.com>
1992
1993         [WinCairo] Update WinCairoRequirements
1994         https://bugs.webkit.org/show_bug.cgi?id=179790
1995
1996         Reviewed by Alex Christensen.
1997
1998         * PlatformWin.cmake:
1999
2000 2017-11-16  Youenn Fablet  <youenn@apple.com>
2001
2002         Service Worker should get the body of intercepted requests
2003         https://bugs.webkit.org/show_bug.cgi?id=179776
2004
2005         Reviewed by Alex Christensen.
2006
2007         Pass a FormDataReference when starting fetch IPC.
2008         Convert this FormDataReference in a FormData and using it to set the FetchRequest body properly in Service Worker process.
2009         Forbid fetch interception when URL is not HTTP/HTTPS.
2010
2011         * Platform/IPC/FormDataReference.h:
2012         (IPC::FormDataReference::FormDataReference):
2013         (IPC::FormDataReference::takeData):
2014         (IPC::FormDataReference::encode const):
2015         (IPC::FormDataReference::decode):
2016         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2017         (WebKit::WebSWServerConnection::startFetch):
2018         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2019         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
2020         * WebProcess/Storage/WebSWClientConnection.cpp:
2021         (WebKit::WebSWClientConnection::startFetch):
2022         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2023         (WebKit::WebSWContextManagerConnection::startFetch):
2024         * WebProcess/Storage/WebSWContextManagerConnection.h:
2025         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
2026         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
2027         (WebKit::WebServiceWorkerProvider::handleFetch):
2028
2029 2017-11-16  Daniel Bates  <dabates@apple.com>
2030
2031         Add feature define for alternative presentation button element
2032         https://bugs.webkit.org/show_bug.cgi?id=179692
2033         Part of <rdar://problem/34917108>
2034
2035         Reviewed by Andy Estes.
2036
2037         Only enabled on Cocoa platforms by default.
2038
2039         * Configurations/FeatureDefines.xcconfig:
2040
2041 2017-11-16  Chris Dumez  <cdumez@apple.com>
2042
2043         [Service Worker] Implement "Try Clear Registration" algorithm
2044         https://bugs.webkit.org/show_bug.cgi?id=179791
2045
2046         Reviewed by Youenn Fablet.
2047
2048         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
2049         * WebProcess/Storage/WebSWClientConnection.cpp:
2050         (WebKit::WebSWClientConnection::serviceWorkerStartedControllingClient):
2051         (WebKit::WebSWClientConnection::serviceWorkerStoppedControllingClient):
2052         * WebProcess/Storage/WebSWClientConnection.h:
2053
2054 2017-11-16  Michael Catanzaro  <mcatanzaro@igalia.com>
2055
2056         REGRESSION(r224179): layer flush now requires sync IPC to compute undo/redo availability in EditorState
2057         https://bugs.webkit.org/show_bug.cgi?id=179797
2058
2059         Reviewed by Simon Fraser.
2060
2061         r224179 introduced a performance regression. The newly-added code in WebPage::editorState is
2062         part of a performance-critical path. (The editor state is computed and sent to the UI
2063         process during the layer flush.) Calls to Editor::canUndo and Editor::canRedo were added,
2064         but these calls are both implemented with sync IPC calls to WebPageProxy in the UI process.
2065         WebPageProxy passes them along to PageClientImpl to compute the availability of the
2066         commands.
2067
2068         That's all pointless because this code only exists for the purpose of getting editing
2069         command availability to the UI process. In the case of undo and redo, it's not needed at
2070         all. I did not realize that when writing the code. So canUndo and canRedo should be removed
2071         from EditorState. This ought to be sufficient to avoid the perf regression.
2072
2073         No changes are needed to the GTK/WPE WebKitEditorState API. The API is reimplemented using
2074         WebPageProxy::canUndoRedo instead of EditorState. There should be no changes in behavior,
2075         only performance.
2076
2077         * Shared/EditorState.cpp:
2078         (WebKit::EditorState::PostLayoutData::encode const):
2079         (WebKit::EditorState::PostLayoutData::decode):
2080         * Shared/EditorState.h:
2081         * UIProcess/API/glib/WebKitEditorState.cpp:
2082         (webkitEditorStateCreate):
2083         (webkitEditorStateChanged):
2084         * UIProcess/API/glib/WebKitEditorStatePrivate.h:
2085         * UIProcess/API/glib/WebKitWebView.cpp:
2086         (webkit_web_view_get_editor_state):
2087         * UIProcess/WebPageProxy.cpp:
2088         (WebKit::WebPageProxy::canUndo):
2089         (WebKit::WebPageProxy::canRedo):
2090         * UIProcess/WebPageProxy.h:
2091         * WebProcess/WebPage/WebPage.cpp:
2092         (WebKit::WebPage::editorState const):
2093
2094 2017-11-16  Megan Gardner  <megan_gardner@apple.com>
2095
2096         Remove allowBlockSelection as block selection is not supported anymore
2097         https://bugs.webkit.org/show_bug.cgi?id=179738
2098
2099         Reviewed by Tim Horton.
2100
2101         Remove all instances of the alloweBlockSelection flag. Blocks selection is fully disabled
2102         and thus this flag will do nothing. This was only added as a debug measure last year, and nothing
2103         ever actually used it.
2104
2105         * Shared/WebPageCreationParameters.cpp:
2106         (WebKit::WebPageCreationParameters::encode const):
2107         (WebKit::WebPageCreationParameters::decode):
2108         * Shared/WebPageCreationParameters.h:
2109         * UIProcess/API/Cocoa/WKWebView.mm:
2110         (-[WKWebView _allowsBlockSelection]): Deleted.
2111         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2112         (-[WKWebViewConfiguration init]):
2113         (-[WKWebViewConfiguration copyWithZone:]):
2114         (-[WKWebViewConfiguration _allowsBlockSelection]): Deleted.
2115         (-[WKWebViewConfiguration _setAllowsBlockSelection:]): Deleted.
2116         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2117         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2118         * UIProcess/PageClient.h:
2119         * UIProcess/WebPageProxy.cpp:
2120         (WebKit::WebPageProxy::creationParameters):
2121         * UIProcess/ios/PageClientImplIOS.h:
2122         * UIProcess/ios/PageClientImplIOS.mm:
2123         (WebKit::PageClientImpl::allowsBlockSelection): Deleted.
2124         * WebProcess/WebPage/WebPage.cpp:
2125         * WebProcess/WebPage/WebPage.h:
2126
2127 2017-11-16  Brent Fulgham  <bfulgham@apple.com>
2128
2129         Whitelist additional IOKit properties based on customer feedback
2130         https://bugs.webkit.org/show_bug.cgi?id=179782
2131         <rdar://problem/35508246>
2132
2133         Reviewed by Dean Jackson.
2134
2135         Expand the IOKit property whitelist to recognize a few more properties as valid based on review of logs
2136         from customer systems and our test infrastructure.
2137
2138         * WebProcess/com.apple.WebProcess.sb.in:
2139
2140 2017-11-15  Brady Eidson  <beidson@apple.com>
2141
2142         Implement basics of "Terminate Service Worker" algorithm.
2143         https://bugs.webkit.org/show_bug.cgi?id=179551
2144
2145         Reviewed by Chris Dumez.
2146
2147         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
2148         (WebKit::WebSWServerToContextConnection::terminateWorker):
2149         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
2150         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
2151
2152         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2153         (WebKit::WebSWContextManagerConnection::terminateWorker):
2154         (WebKit::WebSWContextManagerConnection::workerTerminated):
2155         * WebProcess/Storage/WebSWContextManagerConnection.h:
2156         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
2157
2158 2017-11-15  Brent Fulgham  <bfulgham@apple.com>
2159
2160         Remove access to 'com.apple.mediaaccessibility.public' preferences in WebContent sandbox
2161         https://bugs.webkit.org/show_bug.cgi?id=179747
2162         <rdar://problem/35367346>
2163
2164         Reviewed by Dean Jackson.
2165
2166         The 'mediaaccessibilityd' process handles access to MediaAccessibility preferences. We don't need
2167         to grant the WebContent Process sandbox access to them.
2168
2169         * WebProcess/com.apple.WebProcess.sb.in: 
2170
2171 2017-11-15  Alex Christensen  <achristensen@webkit.org>
2172
2173         Revert r224885
2174         https://bugs.webkit.org/show_bug.cgi?id=179719
2175
2176         * UIProcess/API/APIContentRuleListStore.cpp:
2177         (API::compiledToFile):
2178         r224885 was a speculative fix that did not fix anything on the bots.
2179
2180 2017-11-15  Brent Fulgham  <bfulgham@apple.com>
2181
2182         Unreviewed build fix after r224830.
2183
2184         * WebProcess/com.apple.WebProcess.sb.in: Add missing sysctl-read permissions needed
2185         to support testing on Mac Mini hardware.
2186
2187 2017-11-15  Youenn Fablet  <youenn@apple.com>
2188
2189         Add ServiceWorker to WebProcess plumbery for FormData fetch responses
2190         https://bugs.webkit.org/show_bug.cgi?id=179694
2191
2192         Reviewed by Alex Christensen.
2193
2194         Added plumbery from Service Worker up to Web Process to pass form data response bodies.
2195         A follow-up patch should read the data from Network Process and send it to the ResourceLoader.
2196
2197         * Platform/IPC/FormDataReference.h: Added.
2198         (IPC::FormDataReference::FormDataReference):
2199         (IPC::FormDataReference::takeData):
2200         (IPC::FormDataReference::encode const):
2201         (IPC::FormDataReference::decode):
2202         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2203         (WebKit::WebSWServerConnection::didReceiveFetchFormData):
2204         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2205         * StorageProcess/StorageProcess.cpp:
2206         (WebKit::StorageProcess::didReceiveFetchFormData):
2207         * StorageProcess/StorageProcess.h:
2208         * StorageProcess/StorageProcess.messages.in:
2209         * WebKit.xcodeproj/project.pbxproj:
2210         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
2211         (WebKit::ServiceWorkerClientFetch::didReceiveFormData):
2212         * WebProcess/Storage/ServiceWorkerClientFetch.h:
2213         * WebProcess/Storage/ServiceWorkerClientFetch.messages.in:
2214         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
2215         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveFormData):
2216         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:
2217
2218 2017-11-15  Alex Christensen  <achristensen@webkit.org>
2219
2220         Move a compiled WKContentRuleList to its destination before calling mmap
2221         https://bugs.webkit.org/show_bug.cgi?id=179719
2222
2223         Reviewed by Brady Eidson.
2224
2225         Right now we compile a WKContentRuleList to a temporary file, call mmap, close the file, then move it.
2226         Sometimes, especially on bots running tests, the move fails because the temporary file doesn't exist
2227         any more.  Moving the file before mmaping and closing the file might prevent this failure.
2228
2229         * UIProcess/API/APIContentRuleListStore.cpp:
2230         (API::compiledToFile):
2231
2232 2017-11-15  Chris Dumez  <cdumez@apple.com>
2233
2234         [Service Workers] Implement Client API
2235         https://bugs.webkit.org/show_bug.cgi?id=179709
2236
2237         Reviewed by Alex Christensen.
2238
2239         * Shared/WebCoreArgumentCoders.cpp:
2240         * Shared/WebCoreArgumentCoders.h:
2241         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2242         (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope):
2243         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2244         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
2245         * WebProcess/Storage/WebSWClientConnection.cpp:
2246         (WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope):
2247         * WebProcess/Storage/WebSWClientConnection.h:
2248         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2249         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerGlobalScope):
2250         * WebProcess/Storage/WebSWContextManagerConnection.h:
2251         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
2252
2253 2017-11-15  Ryan Haddad  <ryanhaddad@apple.com>
2254
2255         Unreviewed, rolling out r224863.
2256
2257         Introduced LayoutTest crashes on iOS Simulator.
2258
2259         Reverted changeset:
2260
2261         "Move JSONValues to WTF and convert uses of InspectorValues.h
2262         to JSONValues.h"
2263         https://bugs.webkit.org/show_bug.cgi?id=173793
2264         https://trac.webkit.org/changeset/224863
2265
2266 2017-11-14  Brent Fulgham  <bfulgham@apple.com>
2267
2268         Remove access to "com.apple.pbs.fetch_services" from WebContent sandbox
2269         https://bugs.webkit.org/show_bug.cgi?id=179689
2270         <rdar://problem/35369172>
2271
2272         Reviewed by Per Arne Vollan.
2273
2274         WebKit's WebContent process should not have any need to interact with the fetch_services
2275         API exposed to the system. These interactions (if needed) should be happening in the UIProcess,
2276         so we should prevent the untrusted Web Content Process from being able to connect.
2277
2278         * WebProcess/com.apple.WebProcess.sb.in:
2279
2280 2017-11-15  Michael Catanzaro  <mcatanzaro@igalia.com>
2281
2282         Remove GTK web inspector images
2283         https://bugs.webkit.org/show_bug.cgi?id=179716
2284
2285         Reviewed by Carlos Garcia Campos.
2286
2287         * InspectorGResources.cmake:
2288
2289 2017-11-15  Gabriel Ivascu  <givascu@igalia.com>
2290
2291         [GTK] Automatically adjust font size when gtk-xft-dpi changes
2292         https://bugs.webkit.org/show_bug.cgi?id=142673
2293
2294         Some follow-up fixes for the previous patch.
2295
2296         Reviewed by Carlos Garcia Campos.
2297
2298         * UIProcess/API/glib/WebKitSettings.cpp:
2299         (webKitSettingsDispose):
2300         (webKitSettingsConstructed):
2301
2302 2017-11-14  Nan Wang  <n_wang@apple.com>
2303
2304         AX: AOM: Implement AccessibleNode class and support label and role attributes
2305         https://bugs.webkit.org/show_bug.cgi?id=179494
2306
2307         Reviewed by Ryosuke Niwa.
2308
2309         * Shared/WebPreferences.yaml:
2310         * UIProcess/API/C/WKPreferences.cpp:
2311         (WKPreferencesSetAccessibilityObjectModelEnabled):
2312         (WKPreferencesGetAccessibilityObjectModelEnabled):
2313         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2314
2315 2017-11-14  Carlos Garcia Campos  <cgarcia@igalia.com>
2316
2317         Move JSONValues to WTF and convert uses of InspectorValues.h to JSONValues.h
2318         https://bugs.webkit.org/show_bug.cgi?id=173793
2319
2320         Reviewed by Brian Burg.
2321
2322         Based on patch by Brian Burg.
2323
2324         * UIProcess/Automation/WebAutomationSession.cpp:
2325         (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext):
2326         (WebKit::WebAutomationSession::moveWindowOfBrowsingContext):
2327         (WebKit::WebAutomationSession::waitForNavigationToCompleteOnPage):
2328         (WebKit::WebAutomationSession::waitForNavigationToCompleteOnFrame):
2329         (WebKit::WebAutomationSession::respondToPendingPageNavigationCallbacksWithTimeout):
2330         (WebKit::WebAutomationSession::respondToPendingFrameNavigationCallbacksWithTimeout):
2331         (WebKit::WebAutomationSession::navigationOccurredForFrame):
2332         (WebKit::WebAutomationSession::documentLoadedForFrame):
2333         (WebKit::WebAutomationSession::inspectorFrontendLoaded):
2334         (WebKit::WebAutomationSession::keyboardEventsFlushedForPage):
2335         (WebKit::WebAutomationSession::evaluateJavaScriptFunction):
2336         (WebKit::WebAutomationSession::setFilesToSelectForFileUpload):
2337         (WebKit::WebAutomationSession::addSingleCookie):
2338         (WebKit::WebAutomationSession::setSessionPermissions):
2339         (WebKit::WebAutomationSession::performMouseInteraction):
2340         (WebKit::WebAutomationSession::performKeyboardInteractions):
2341         * UIProcess/Automation/WebAutomationSession.h:
2342
2343 2017-11-14  Chris Dumez  <cdumez@apple.com>
2344
2345         [Service Workers] Implement container.getRegistrations()
2346         https://bugs.webkit.org/show_bug.cgi?id=179672
2347
2348         Reviewed by Brady Eidson.
2349
2350         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2351         (WebKit::WebSWServerConnection::getRegistrations):
2352         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2353         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
2354         * WebProcess/Storage/WebSWClientConnection.cpp:
2355         (WebKit::WebSWClientConnection::didGetRegistrations):
2356         (WebKit::WebSWClientConnection::getRegistrations):
2357         * WebProcess/Storage/WebSWClientConnection.h:
2358         * WebProcess/Storage/WebSWClientConnection.messages.in:
2359
2360 2017-11-14  Youenn Fablet  <youenn@apple.com>
2361
2362         Implement ServiceWorker handle fetch for navigation loads
2363         https://bugs.webkit.org/show_bug.cgi?id=179404
2364
2365         Reviewed by Alex Christensen and Chris Dumez.
2366
2367         Update handle fetch algorithm to support navigation requests.
2368         In case of navigation requests, set service worker response mime type to text/html if none is provided.
2369
2370         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
2371         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
2372         * WebProcess/Storage/WebSWClientConnection.cpp:
2373         (WebKit::WebSWClientConnection::startFetch):
2374         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
2375         (WebKit::shouldHandleFetch):
2376         (WebKit::WebServiceWorkerProvider::handleFetch):
2377
2378 2017-11-14  Alex Christensen  <achristensen@webkit.org>
2379
2380         Remove Cocoa CFURLConnection loading code
2381         https://bugs.webkit.org/show_bug.cgi?id=179688
2382
2383         Reviewed by Antti Koivisto.
2384
2385         * NetworkProcess/Downloads/Download.h:
2386
2387 2017-11-14  Daniel Bates  <dabates@apple.com>
2388
2389         Update comment in FeatureDefines.xcconfig to reflect location of Visual Studio property files
2390         for feature defines
2391
2392         Following r195498 and r201917 the Visual Studio property files for feature defines have
2393         moved from directory WebKitLibraries/win/tools/vsprops to directory Source/cmake/tools/vsprops.
2394         Update the comment in FeatureDefines.xcconfig to reflect the new location and names of these
2395         files.
2396
2397         * Configurations/FeatureDefines.xcconfig:
2398
2399 2017-11-14  Brent Fulgham  <bfulgham@apple.com>
2400
2401         Whitelist some IOKIt properties to avoid sandbox violations on YouTube
2402         https://bugs.webkit.org/show_bug.cgi?id=179683
2403         <rdar://problem/35415368>
2404
2405         Reviewed by Dean Jackson.
2406
2407         YouTube video playback on some hardware (and some video encodings) generates sandbox violations. Add
2408         whitelist entries for the relevant IOKit properties needed to support these activities.
2409
2410         * WebProcess/com.apple.WebProcess.sb.in:
2411
2412 2017-11-14  Daniel Bates  <dabates@apple.com>
2413
2414         Mark WebChromeClient::requestStorageAccess() as final
2415         https://bugs.webkit.org/show_bug.cgi?id=179673
2416
2417         Reviewed by Sam Weinig.
2418
2419         Mark WebChromeClient::requestStorageAccess() as final so that it overrides the virtual function
2420         in ChromeClient with the same name and hence we actually call it through a ChromeClient pointer.
2421
2422         * WebProcess/WebCoreSupport/WebChromeClient.h:
2423
2424 2017-11-14  Youenn Fablet  <youenn@apple.com>
2425
2426         WebSWClientConnection should do IPC to StorageProcess if its WebSWOriginTable is not yet initialized
2427         https://bugs.webkit.org/show_bug.cgi?id=179668
2428
2429         Reviewed by Chris Dumez.
2430
2431         There may be cases where the origin table is not initialized and we would think there is no service worker registration.
2432         In such a case, we should go to the StorageProcess.
2433         StorageProcess is now sending an IPC message back to each registered SW connection so that WebProcess will know whether its map
2434         is correctly initialized or not.
2435
2436         Renaming hasServiceWorkerRegisteredForOrigin in mayHaveServiceWorkerRegisteredForOrigin.
2437
2438         * WebProcess/Storage/WebSWClientConnection.cpp:
2439         (WebKit::WebSWClientConnection::mayHaveServiceWorkerRegisteredForOrigin const):
2440         (WebKit::WebSWClientConnection::matchRegistration):
2441         (WebKit::WebSWClientConnection::hasServiceWorkerRegisteredForOrigin const): Deleted.
2442         * WebProcess/Storage/WebSWClientConnection.h:
2443         * WebProcess/Storage/WebSWOriginTable.h:
2444         (WebKit::WebSWOriginTable::isInitialized const):
2445         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
2446         (WebKit::shouldHandleFetch):
2447
2448 2017-11-14  Brent Fulgham  <bfulgham@apple.com>
2449
2450         Consolidate sysctl-read rules in WebProcess sandbox
2451         https://bugs.webkit.org/show_bug.cgi?id=179674
2452         <rdar://problem/35367154>
2453
2454         Reviewed by Dean Jackson.
2455
2456         Consolidate the various calls to 'allow sysctl-read' imported during Bug 179548 into
2457         the main function in the sandbox profile.
2458
2459         Remove the statement to grant global sysctl-read permissions that was copied into this
2460         sandbox profile in an earlier checkin. We started blocking the blanket read permissions in
2461         macOS 10.13, and want to continue to do so.
2462         
2463         The earlier "grant global read access" in 'system.sb' apparently allowed some sysctl reads
2464         to occur before we hit the block declaration in the WebContent sandbox. Now that we are
2465         consistently blocking systcl reads from the start, we need to add whitelist entries for a
2466         few more entries to avoid creating new sandbox violations.
2467
2468         * WebProcess/com.apple.WebProcess.sb.in:
2469
2470 2017-11-14  Alex Christensen  <achristensen@webkit.org>
2471
2472         Remove WebKit CFURLConnection code
2473         https://bugs.webkit.org/show_bug.cgi?id=179645
2474
2475         Reviewed by Alexey Proskuryakov.
2476
2477         The CFURLConnection code is Windows-specific now. Nobody can use it in modern WebKit.
2478
2479         * NetworkProcess/Downloads/Download.h:
2480         * NetworkProcess/Downloads/mac/DownloadMac.mm:
2481         * NetworkProcess/NetworkLoad.h:
2482         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2483         (WebKit::serverTrustCredential):
2484         * NetworkProcess/mac/NetworkLoadMac.mm:
2485         * Shared/Authentication/AuthenticationManager.cpp:
2486         (WebKit::AuthenticationManager::useCredentialForSingleChallenge):
2487         (WebKit::AuthenticationManager::continueWithoutCredentialForSingleChallenge):
2488         (WebKit::AuthenticationManager::cancelSingleChallenge):
2489         (WebKit::AuthenticationManager::performDefaultHandlingForSingleChallenge):
2490         (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge):
2491         * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
2492         * Shared/Authentication/mac/AuthenticationManager.mac.mm:
2493         (WebKit::AuthenticationManager::tryUseCertificateInfoForChallenge):
2494         * Shared/WebProcessCreationParameters.cpp:
2495         (WebKit::WebProcessCreationParameters::encode const):
2496         (WebKit::WebProcessCreationParameters::decode):
2497         * Shared/WebProcessCreationParameters.h:
2498         * Shared/mac/WebCoreArgumentCodersMac.mm:
2499         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
2500         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
2501         * config.h:
2502
2503 2017-11-14  Alex Christensen  <achristensen@webkit.org>
2504
2505         Remove assertions added in r224791
2506         https://bugs.webkit.org/show_bug.cgi?id=178751#c10
2507
2508         * NetworkProcess/mac/RemoteNetworkingContext.mm:
2509         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
2510         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
2511         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
2512         I had added assertions that sandbox extension handle consumption succeeds.
2513         In the API test IndexedDB.StructuredCloneBackwardCompatibility we get a sandbox extension handle
2514         to give access to a directory that does not exist and consumption fails.  We want it to fail,
2515         so my optimistic addition of a success assertion was incorrect.  The test passes without it
2516         and behaves like it used to.
2517
2518 2017-11-14  Tim Horton  <timothy_horton@apple.com>
2519
2520         Don't use -[NSString stringWithFormat:] to build defaults keys
2521         https://bugs.webkit.org/show_bug.cgi?id=179680
2522
2523         Reviewed by Simon Fraser.
2524
2525         * UIProcess/mac/WebPreferencesMac.mm:
2526         (WebKit::makeKey):
2527         (WebKit::debugUserDefaultsValue):
2528         Use string concatenation instead of stringWithFormat to build
2529         preference keys. This wasn't a huge cost, but it shaves a few milliseconds
2530         off process launch.
2531
2532 2017-11-14  Alex Christensen  <achristensen@webkit.org>
2533
2534         Clean up old URL parser remnants
2535         https://bugs.webkit.org/show_bug.cgi?id=179573
2536
2537         Reviewed by Darin Adler.
2538
2539         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
2540         (WebKit::WebContextMenuClient::searchWithGoogle):
2541         Use https if we do end up searching with google.
2542
2543 2017-11-14  Antti Koivisto  <antti@apple.com>
2544
2545         Enable display:contents by default
2546         https://bugs.webkit.org/show_bug.cgi?id=179655
2547
2548         Reviewed by Sam Weinig.
2549
2550         * Shared/WebPreferences.yaml:
2551
2552         Make non-experimental and enabled.
2553
2554 2017-11-10  Brent Fulgham  <bfulgham@apple.com>
2555
2556         Consolidate mach-lookup calls in WebProcess sandbox
2557         https://bugs.webkit.org/show_bug.cgi?id=179650
2558         <rdar://problem/35367154>
2559
2560         Reviewed by Dean Jackson.
2561
2562         Consolidate the various calls to 'allow mach-lookup' imported during Bug 179548 into the main
2563         function in the sandbox profile. Remove some entries that are not needed by WebKit.
2564
2565         Remove the statement to grant global permission to perform mach-lookup for any xpc
2566         service name that was copied into this sandbox profile in Bug 179548. We started blocking
2567         this in macOS 10.13 and want to continue to do so.
2568         
2569         The earlier "grant global permission" in 'system.sb' apparently allowed some xpc lookups to occur
2570         before we hit the block declaration in the WebContent sandbox. Now that we are consistently blocking
2571         mach lookups we need to add whitelist entries for a few more services to avoid creating new
2572         sandbox violations.
2573
2574         * WebProcess/com.apple.WebProcess.sb.in:
2575
2576 2017-11-14  Tim Horton  <timothy_horton@apple.com>
2577
2578         Long pressing a phone number with spaces in it results in a link sheet instead of a data detectors sheet
2579         https://bugs.webkit.org/show_bug.cgi?id=179646
2580         <rdar://problem/35337288>
2581
2582         Reviewed by Simon Fraser.
2583
2584         * UIProcess/ios/WKActionSheetAssistant.mm:
2585         (-[WKActionSheetAssistant showImageSheet]):
2586         (-[WKActionSheetAssistant showLinkSheet]):
2587         (-[WKActionSheetAssistant showDataDetectorsSheet]):
2588         * UIProcess/ios/WKContentViewInteraction.mm:
2589         (-[WKContentView _actionForLongPressFromPositionInformation:]):
2590         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
2591         Make use of canBePresentedByDataDetectors with our WebCore URL instead
2592         of (sometimes unsucessfully) reparsing the URL with NSURL's parser.
2593         Also, avoid a few unnecessary round-trips through String when converting
2594         from URL to NSURL.
2595
2596 2017-11-14  Brent Fulgham  <bfulgham@apple.com>
2597
2598         REGRESSION(r224799): WebKit crashes on Sierra due to sandbox violation
2599         https://bugs.webkit.org/show_bug.cgi?id=179656
2600         
2601         Unreviewed build fix.
2602
2603         * WebProcess/com.apple.WebProcess.sb.in: Switch to Dan's recommended version check.
2604
2605 2017-11-13  Joseph Pecoraro  <pecoraro@apple.com>
2606
2607         Give a ServiceWorker WebContentProcess a different display name
2608         https://bugs.webkit.org/show_bug.cgi?id=179653
2609
2610         Reviewed by Brady Eidson.
2611
2612         * UIProcess/WebProcessProxy.h:
2613         * UIProcess/WebProcessProxy.cpp:
2614         (WebKit::WebProcessProxy::create):
2615         Call connect after construction so virtual methods will use subclass implementations.
2616
2617         * UIProcess/ServiceWorkerProcessProxy.h:
2618         * UIProcess/ServiceWorkerProcessProxy.cpp:
2619         (WebKit::ServiceWorkerProcessProxy::create):
2620         Copy the pattern from WebProcessProxy to ensure connect() gets called after construction.
2621
2622         (WebKit::ServiceWorkerProcessProxy::getLaunchOptions):
2623         Set a launch option to signal this is a Service Worker process.
2624
2625         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
2626         (WebKit::XPCServiceInitializerDelegate::getExtraInitializationData):
2627         * WebProcess/cocoa/WebProcessCocoa.mm:
2628         (WebKit::WebProcess::initializeProcessName):
2629         Consume the launch option to configuration the process name.
2630
2631 2017-11-13  Ryosuke Niwa  <rniwa@webkit.org>
2632
2633         REGRESSION(r224799): WebKit crashes at launch on macOS Sierra due to a sandbox violation
2634         https://bugs.webkit.org/show_bug.cgi?id=179656
2635
2636         Unreviewed. Revert r224799 on macOS Sierra.
2637
2638         * WebProcess/com.apple.WebProcess.sb.in:
2639
2640 2017-11-13  Chris Dumez  <cdumez@apple.com>
2641
2642         Send ServiceWorkerData structs to the WebProcesses instead of ServiceWorkerIdentifiers
2643         https://bugs.webkit.org/show_bug.cgi?id=179649
2644
2645         Reviewed by Brady Eidson.
2646
2647         * Shared/WebCoreArgumentCoders.h:
2648         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2649         (WebKit::WebSWServerConnection::updateRegistrationStateInClient):
2650         (WebKit::WebSWServerConnection::postMessageToServiceWorkerClient):
2651         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2652         * WebProcess/Storage/WebSWClientConnection.cpp:
2653         (WebKit::WebSWClientConnection::postMessageToServiceWorkerClient):
2654         * WebProcess/Storage/WebSWClientConnection.h:
2655         * WebProcess/Storage/WebSWClientConnection.messages.in:
2656
2657 2017-11-13  Brady Eidson  <beidson@apple.com>
2658
2659         Massive "Server-process-to-context-process" connection overhaul.
2660         https://bugs.webkit.org/show_bug.cgi?id=179554
2661
2662         Reviewed by Chris Dumez.
2663
2664         * DerivedSources.make:
2665         * WebKit.xcodeproj/project.pbxproj:
2666
2667         * Shared/WebCoreArgumentCoders.h:
2668
2669         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2670         (WebKit::WebSWServerConnection::sendToContextProcess):
2671         (WebKit::WebSWServerConnection::installServiceWorkerContext): Deleted.
2672         (WebKit::WebSWServerConnection::fireInstallEvent): Deleted.
2673         (WebKit::WebSWServerConnection::fireActivateEvent): Deleted.
2674         (WebKit::WebSWServerConnection::setContextConnection): Deleted.
2675         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2676
2677         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp: Copied from Source/WebCore/workers/service/server/SWServerWorker.cpp.
2678         (WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
2679         (WebKit::WebSWServerToContextConnection::messageSenderConnection):
2680         (WebKit::WebSWServerToContextConnection::messageSenderDestinationID):
2681         (WebKit::WebSWServerToContextConnection::connectionClosed):
2682         (WebKit::WebSWServerToContextConnection::installServiceWorkerContext):
2683         (WebKit::WebSWServerToContextConnection::fireInstallEvent):
2684         (WebKit::WebSWServerToContextConnection::fireActivateEvent):
2685         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h: Copied from Source/WebCore/workers/service/ServiceWorkerTypes.h.
2686         (WebKit::WebSWServerToContextConnection::create):
2687         (WebKit::WebSWServerToContextConnection::ipcConnection const):
2688         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in: Copied from Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.messages.in.
2689
2690         * StorageProcess/StorageProcess.cpp:
2691         (WebKit::StorageProcess::didClose):
2692         (WebKit::StorageProcess::didReceiveMessage):
2693         (WebKit::StorageProcess::globalServerToContextConnection):
2694         (WebKit::StorageProcess::createServerToContextConnection):
2695         (WebKit::StorageProcess::didGetWorkerContextProcessConnection):
2696         (WebKit::StorageProcess::workerContextProcessConnection): Deleted.
2697         (WebKit::StorageProcess::createWorkerContextProcessConnection): Deleted.
2698         (WebKit::StorageProcess::serviceWorkerContextFailedToStart): Deleted.
2699         (WebKit::StorageProcess::serviceWorkerContextStarted): Deleted.
2700         (WebKit::StorageProcess::didFinishServiceWorkerInstall): Deleted.
2701         (WebKit::StorageProcess::didFinishServiceWorkerActivation): Deleted.
2702         (WebKit::StorageProcess::setServiceWorkerHasPendingEvents): Deleted.
2703         * StorageProcess/StorageProcess.h:
2704         * StorageProcess/StorageProcess.messages.in:
2705
2706         * StorageProcess/StorageToWebProcessConnection.cpp:
2707         (WebKit::StorageToWebProcessConnection::didReceiveMessage):
2708         (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
2709         (WebKit::StorageToWebProcessConnection::workerContextProcessConnectionCreated):
2710
2711         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2712         (WebKit::WebSWContextManagerConnection::installServiceWorker):
2713         (WebKit::WebSWContextManagerConnection::serviceWorkerStartedWithMessage):
2714         (WebKit::WebSWContextManagerConnection::fireInstallEvent):
2715         (WebKit::WebSWContextManagerConnection::fireActivateEvent):
2716         (WebKit::WebSWContextManagerConnection::didFinishInstall):
2717         (WebKit::WebSWContextManagerConnection::didFinishActivation):
2718         (WebKit::WebSWContextManagerConnection::setServiceWorkerHasPendingEvents):
2719         * WebProcess/Storage/WebSWContextManagerConnection.h:
2720         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
2721
2722 2017-11-13  Brent Fulgham  <bfulgham@apple.com>
2723
2724         WebContent sandbox should not include 'system.sb'
2725         https://bugs.webkit.org/show_bug.cgi?id=179548
2726         <rdar://problem/35367154>
2727
2728         Reviewed by Darin Adler.
2729
2730         Stop including 'system.sb', and just include the portions of that sandbox that we
2731         actually use in WebContent Process. This is the first step in some further sandbox
2732         tightening.
2733
2734         * WebProcess/com.apple.WebProcess.sb.in:
2735
2736 2017-11-13  Simon Fraser  <simon.fraser@apple.com>
2737
2738         When navigating back to a page, compositing layers may not use accelerated drawing
2739         https://bugs.webkit.org/show_bug.cgi?id=178749
2740         rdar://problem/35158946
2741
2742         Reviewed by Dean Jackson.
2743
2744         Avoid assertions when a test enables accelerated drawing (which we can't support
2745         in the iOS simulator).
2746
2747         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
2748         (WebKit::RemoteLayerBackingStore::ensureBackingStore):
2749
2750 2017-11-13  Youenn Fablet  <youenn@apple.com>
2751
2752         matchRegistration does not need to go to StorageProcess if no service worker is registered
2753         https://bugs.webkit.org/show_bug.cgi?id=179480
2754
2755         Reviewed by Chris Dumez.
2756
2757         Removed origin store handling from StorageProcess since it is now handled within SWServer.
2758         Updated clearing of web site data accordingly.
2759         Optimized matchRegistration by looking at the origin store before doing any IPC.
2760         Do IPC to the StorageProcess if the origin store is not yet initialized on the WebProcess.
2761
2762         * StorageProcess/ServiceWorker/WebSWOriginStore.h:
2763         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2764         (WebKit::WebSWServerConnection::resolveRegistrationJobInClient):
2765         (WebKit::WebSWServerConnection::resolveUnregistrationJobInClient):
2766         * StorageProcess/StorageProcess.cpp:
2767         (WebKit::StorageProcess::deleteWebsiteData):
2768         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
2769         (WebKit::StorageProcess::swServerForSession):
2770         (WebKit::StorageProcess::swOriginStoreForSession):
2771         (WebKit::StorageProcess::registerSWServerConnection):
2772         (WebKit::StorageProcess::unregisterSWServerConnection):
2773         (WebKit::StorageProcess::ensureSWOriginStoreForSession): Deleted.
2774         (WebKit::StorageProcess::swOriginStoreForSession const): Deleted.
2775         * StorageProcess/StorageProcess.h:
2776         * StorageProcess/ServiceWorker/WebSWOriginStore.cpp:
2777         (WebKit::WebSWOriginStore::addToStore):
2778         (WebKit::WebSWOriginStore::removeFromStore):
2779         (WebKit::WebSWOriginStore::clearStore):
2780         (WebKit::WebSWOriginStore::add): Deleted.
2781         (WebKit::WebSWOriginStore::remove): Deleted.
2782         (WebKit::WebSWOriginStore::clear): Deleted.
2783         * StorageProcess/ServiceWorker/WebSWOriginStore.h:
2784         * WebProcess/Storage/WebSWClientConnection.cpp:
2785         (WebKit::WebSWClientConnection::matchRegistration):
2786
2787 2017-11-13  Alex Christensen  <achristensen@webkit.org>
2788
2789         Merge NetworkProcess::EnsurePrivateBrowsingSession and NetworkProcess::AddWebsiteDataStore into one message type
2790         https://bugs.webkit.org/show_bug.cgi?id=178751
2791
2792         Reviewed by Brady Eidson.
2793
2794         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2795         (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession):
2796         * NetworkProcess/NetworkProcess.cpp:
2797         (WebKit::NetworkProcess::initializeNetworkProcess):
2798         (WebKit::NetworkProcess::ensurePrivateBrowsingSession): Deleted.
2799         * NetworkProcess/NetworkProcess.h:
2800         * NetworkProcess/NetworkProcess.messages.in:
2801         * NetworkProcess/RemoteNetworkingContext.h:
2802         * NetworkProcess/mac/RemoteNetworkingContext.mm:
2803         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
2804         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession): Deleted.
2805         * Shared/WebsiteDataStoreParameters.cpp:
2806         (WebKit::WebsiteDataStoreParameters::legacyPrivateSessionParameters):
2807         * Shared/WebsiteDataStoreParameters.h:
2808         * UIProcess/WebProcessPool.cpp:
2809         (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
2810         (WebKit::WebProcessPool::createNewWebProcess):
2811         (WebKit::WebProcessPool::pageAddedToProcess):
2812         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2813         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
2814         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
2815         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
2816         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
2817         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession): Deleted.
2818         * WebProcess/WebPage/WebPage.cpp:
2819         (WebKit::WebPage::setSessionID):
2820         * WebProcess/WebProcess.cpp:
2821         (WebKit::WebProcess::ensurePrivateBrowsingSession): Deleted.
2822         * WebProcess/WebProcess.h:
2823         * WebProcess/WebProcess.messages.in:
2824
2825 2017-11-13  Alex Christensen  <achristensen@webkit.org>
2826
2827         Add logs to debug content extension test failures
2828         https://bugs.webkit.org/show_bug.cgi?id=179624
2829
2830         Reviewed by Chris Dumez.
2831
2832         * UIProcess/API/APIContentRuleListStore.cpp:
2833         (API::compiledToFile):
2834         Right now I'm seeing this log:
2835         "Rule list compilation failed: Unspecified error during compile."
2836         I need more information to debug what is failing on the bots.
2837
2838 2017-11-07  Brian Burg  <bburg@apple.com>
2839
2840         Web Automation: inViewCenterPoint should not include topContentInset when computed in viewport coordinates
2841         https://bugs.webkit.org/show_bug.cgi?id=179129
2842         <rdar://problem/35297038>
2843
2844         Reviewed by Simon Fraser.
2845
2846         When computing the in view center point per W3C specification, the top content inset
2847         is inadvertently added back in when converting to the root view coordinate system.
2848
2849         This patch reworks the protocol command so that it explicitly requests a coordinate
2850         system, with options for "Page" (root / contents), "LayoutViewport", and "VisualViewport".
2851         The latter is not implemented in this patch, since it is intended for use on iOS someday.
2852
2853         * UIProcess/Automation/Automation.json:
2854         Change usesViewport to CoordinateSystem.
2855         Add a new coordinate system enum type and use it.
2856         Fix relevant comments for Automation.computElementLayout.
2857
2858         * UIProcess/Automation/WebAutomationSession.h:
2859         * UIProcess/Automation/WebAutomationSession.cpp:
2860         (WebKit::protocolStringToCoordinateSystem):
2861         (WebKit::WebAutomationSession::computeElementLayout):
2862         Parse the requested coordinate system and send it in the message to the web process.
2863
2864         * WebKit.xcodeproj/project.pbxproj:
2865         * WebProcess/Automation/WebAutomationSessionProxy.messages.in:
2866         * WebProcess/Automation/WebAutomationSessionProxy.h:
2867         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
2868         (WebKit::WebAutomationSessionProxy::computeElementLayout):
2869         Rework the implementation. Get the element bounds and in-view center point in
2870         client coordinates and convert back to root view coordinates for CoordinateSystem::Page.
2871
2872 2017-11-08  Keith Miller  <keith_miller@apple.com>
2873
2874         Async iteration should only fetch the next method once and add feature flag
2875         https://bugs.webkit.org/show_bug.cgi?id=179451
2876
2877         Reviewed by Geoffrey Garen.
2878
2879         Add feature flag for Async iteration.
2880
2881         * Configurations/FeatureDefines.xcconfig:
2882
2883 2017-11-13  Mark Lam  <mark.lam@apple.com>
2884
2885         Add more overflow check book-keeping for MarkedArgumentBuffer.
2886         https://bugs.webkit.org/show_bug.cgi?id=179634
2887         <rdar://problem/35492517>
2888
2889         Reviewed by Saam Barati.
2890
2891         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
2892         (WebKit::NPJSObject::construct):
2893         (WebKit::NPJSObject::invoke):
2894
2895 2017-11-13  Timothy Horton  <timothy_horton@apple.com>
2896
2897         Address some post-landing review comments from r224728
2898         https://bugs.webkit.org/show_bug.cgi?id=179576
2899
2900         * Platform/IPC/mac/MachMessage.h:
2901         (IPC::MachMessage::setMessageReceiverName):
2902         (IPC::MachMessage::setMessageName):
2903         More moving!
2904
2905 2017-11-13  Tim Horton  <timothy_horton@apple.com>
2906
2907         Occasional MobileSafari crash under -[WKPDFView web_setMinimumSize:]
2908         https://bugs.webkit.org/show_bug.cgi?id=179628
2909         <rdar://problem/34773037>
2910
2911         Reviewed by Simon Fraser.
2912
2913         * UIProcess/ios/WKPDFView.mm:
2914         (-[WKPDFView _computePageAndDocumentFrames]):
2915         Similar to r223444, avoid propagating null CGRects into the view hierarchy.
2916         In this case, the null rect comes from applying margins to a rect that is 
2917         smaller than the margins. We could check for that specifically, but a
2918         more-general check for a null rect seems reasonable.
2919
2920 2017-11-13  Tim Horton  <timothy_horton@apple.com>
2921
2922         Use the real mach type instead of reinterpret_casting in MachMessage
2923         https://bugs.webkit.org/show_bug.cgi?id=179629
2924
2925         Reviewed by Dan Bernstein.
2926
2927         * Platform/IPC/mac/MachMessage.cpp:
2928         (IPC::MachMessage::header):
2929         * Platform/IPC/mac/MachMessage.h:
2930         Just use mach_msg_header_t proper, and avoid the reinterpret_cast.
2931         This also corrects the alignment of the struct on platforms where
2932         alignof(mach_msg_header_t) != alignof(uint8_t).
2933
2934 2017-11-13  Gabriel Ivascu  <givascu@igalia.com>
2935
2936         [GTK] Automatically adjust font size when gtk-xft-dpi changes
2937         https://bugs.webkit.org/show_bug.cgi?id=142673
2938
2939         Reviewed by Michael Catanzaro.
2940
2941         * UIProcess/API/glib/WebKitSettings.cpp:
2942         (webKitSettingsDispose):
2943         (webKitSettingsConstructed):
2944         (webkit_settings_class_init):
2945
2946 2017-11-13  Chris Dumez  <cdumez@apple.com>
2947
2948         Implement "Service Worker Has No Pending Events" / "Update Service Worker Extended Events Set" algorithms
2949         https://bugs.webkit.org/show_bug.cgi?id=179618
2950
2951         Reviewed by Brady Eidson.
2952
2953         * StorageProcess/StorageProcess.cpp:
2954         (WebKit::StorageProcess::setServiceWorkerHasPendingEvents):
2955         * StorageProcess/StorageProcess.h:
2956         * StorageProcess/StorageProcess.messages.in:
2957         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2958         (WebKit::WebSWContextManagerConnection::setServiceWorkerHasPendingEvents):
2959         * WebProcess/Storage/WebSWContextManagerConnection.h:
2960
2961 2017-11-13  Wenson Hsieh  <wenson_hsieh@apple.com>
2962
2963         [Attachment Support] Implement SPI for clients to request data for a given attachment
2964         https://bugs.webkit.org/show_bug.cgi?id=179586
2965         <rdar://problem/35355720>
2966
2967         Reviewed by Darin Adler.
2968
2969         Adds support in WebKit for fetching data for a given attachment element. See WebCore/ChangeLog for more details.
2970         Most of the changes here are boilerplate plumbing of -requestAttachmentData through the client layers.
2971
2972         Test coverage by augmenting existing API tests in WKAttachmentTests, and adding 3 new tests.
2973
2974         * UIProcess/API/APIAttachment.cpp:
2975         (API::Attachment::requestData):
2976         * UIProcess/API/APIAttachment.h:
2977         * UIProcess/API/Cocoa/_WKAttachment.h:
2978         * UIProcess/API/Cocoa/_WKAttachment.mm:
2979         (-[_WKAttachment requestData:]):
2980         * UIProcess/WebPageProxy.cpp:
2981         (WebKit::WebPageProxy::sharedBufferCallback):
2982
2983         Add a new IPC callback helper type, SharedBufferCallback. This is similar to the existing DataCallback, but
2984         instead of deserializing to an API::Data, we convert to a SharedBuffer instead. Additionally,
2985         SharedBufferCallback is able to draw a distinction between null data and empty data. This allows -requestData:
2986         to distinguish between cases where (for instance) the data for a given attachment is an empty blob, and when
2987         the attachment doesn't exist at all.
2988
2989         (WebKit::WebPageProxy::dataCallback):
2990         (WebKit::WebPageProxy::insertAttachment):
2991         (WebKit::WebPage::invokeSharedBufferCallback):
2992         (WebKit::WebPageProxy::requestAttachmentData):
2993         * UIProcess/WebPageProxy.h:
2994         * UIProcess/WebPageProxy.messages.in:
2995         * WebProcess/WebPage/WebPage.cpp:
2996         (WebKit::WebPage::requestAttachmentData):
2997         * WebProcess/WebPage/WebPage.h:
2998         * WebProcess/WebPage/WebPage.messages.in:
2999
3000 2017-11-12  Darin Adler  <darin@apple.com>
3001
3002         More is<> and downcast<>, less static_cast<>
3003         https://bugs.webkit.org/show_bug.cgi?id=179600
3004
3005         Reviewed by Chris Dumez.
3006
3007         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivate.cpp:
3008         (WebKit::wrap): Use is/downcast.
3009         * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
3010         (WebKit::WebEditorClient::handleKeyboardEvent): Ditto.
3011         * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp:
3012         (WebKit::WebEditorClient::handleKeyboardEvent): Ditto.
3013         * WebProcess/WebPage/WebPage.cpp:
3014         (WebKit::WebPage::handleEditingKeyboardEvent): Ditto.
3015         * WebProcess/WebPage/mac/WebPageMac.mm:
3016         (WebKit::frameForEvent): Ditto.
3017
3018 2017-11-12  Gabriel Ivascu  <givascu@igalia.com>
3019
3020         [GTK] Add functionality to handle font sizes in points
3021         https://bugs.webkit.org/show_bug.cgi?id=179285
3022
3023         Reviewed by Carlos Garcia Campos and Michael Catanzaro.
3024
3025         * UIProcess/API/glib/WebKitSettings.cpp:
3026         (webkit_settings_class_init):
3027         (webkit_settings_font_size_to_points):
3028         (webkit_settings_font_size_to_pixels):
3029         * UIProcess/API/gtk/WebKitSettings.h:
3030         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
3031
3032 2017-11-11  Tim Horton  <timothy_horton@apple.com>
3033
3034         Increase the alignment requirement of WKObject's wrapped C++ object
3035         https://bugs.webkit.org/show_bug.cgi?id=179518
3036
3037         Reviewed by Dan Bernstein.
3038
3039         * Shared/API/APIObject.h:
3040         * Shared/Cocoa/APIObject.mm:
3041         (API::allocateWKObject):
3042         (API::Object::fromWKObjectExtraSpace):
3043         (API::Object::newObject):
3044         * Shared/Cocoa/WKObject.mm:
3045         (-[WKObject dealloc]):
3046         (-[WKObject _apiObject]):
3047         * UIProcess/API/Cocoa/WKConnection.mm:
3048         (-[WKConnection dealloc]):
3049         (-[WKConnection _apiObject]):
3050         (-[WKConnection _connection]):
3051         Increase the alignment of the C++ object stored inside WKObject's extra space
3052         to 8-bytes, for platforms where some types require greater-than-pointer alignment.
3053         To achieve this, increase the size of the extra-space allocation by the difference
3054         between 8 bytes and pointer-alignment, and then align within that.
3055
3056 2017-11-11  Tim Horton  <timothy_horton@apple.com>
3057
3058         Avoid composing the message + recipient name for crash logs until a failure actually occurs
3059         https://bugs.webkit.org/show_bug.cgi?id=179576
3060
3061         Reviewed by Dan Bernstein.
3062
3063         * Platform/IPC/mac/ConnectionMac.mm:
3064         (IPC::Connection::sendMessage):
3065         (IPC::Connection::sendOutgoingMessage):
3066         * Platform/IPC/mac/MachMessage.h:
3067         (IPC::MachMessage::messageReceiverName const):
3068         (IPC::MachMessage::setMessageReceiverName):
3069         (IPC::MachMessage::messageName const):
3070         (IPC::MachMessage::setMessageName):
3071         Store the message name and receiver name separately on MachMessage,
3072         only composing them into a string if the message is unhandled. This
3073         makes the time spent composing the string in sendOutgoingMessage
3074         completely disappear. In absolute terms, it wasn't huge, but if you
3075         do enough IPC it starts to add up.
3076
3077 2017-11-10  Chris Dumez  <cdumez@apple.com>
3078
3079         [Service Workers] Implement "Try Activate" / "Activate" algorithms
3080         https://bugs.webkit.org/show_bug.cgi?id=179436
3081
3082         Reviewed by Brady Eidson.
3083
3084         Implement proper "Try Activate" / "Activate" algorithms as per:
3085         - https://w3c.github.io/ServiceWorker/#try-activate-algorithm
3086         - https://w3c.github.io/ServiceWorker/#activation-algorithm
3087
3088         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3089         (WebKit::WebSWServerConnection::fireActivateEvent):
3090         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
3091         * StorageProcess/StorageProcess.cpp:
3092         (WebKit::StorageProcess::didFinishServiceWorkerActivation):
3093         * StorageProcess/StorageProcess.h:
3094         * StorageProcess/StorageProcess.messages.in:
3095         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
3096         (WebKit::WebSWContextManagerConnection::fireActivateEvent):
3097         (WebKit::WebSWContextManagerConnection::didFinishActivation):
3098         * WebProcess/Storage/WebSWContextManagerConnection.h:
3099         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
3100
3101 2017-11-10  John Wilander  <wilander@apple.com>
3102
3103         Ignore HSTS for partitioned, cross-origin subresource requests
3104         https://bugs.webkit.org/show_bug.cgi?id=178993
3105         <rdar://problem/34962462>
3106
3107         Reviewed by Brent Fulgham.
3108
3109         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3110         (downgradeRequest):
3111             Convenience function to downgrade a request if
3112             CFNetwork as already upgraded it during
3113             canonicalization. This allows the rest of 
3114             WebKit's processing to function, such as UIR
3115             and mixed content blocking.
3116         (updateIgnoreStrictTransportSecuritySettingIfNecessary):
3117             Adds and removed the ignore request accordingly.
3118         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
3119             Now asks CFNetwork to ignore HSTS on resource loads we
3120             partition cookies for.
3121         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
3122             Now asks CFNetwork to ignore HSTS on resource loads we
3123             partition cookies for.
3124
3125 2017-11-10  Alex Christensen  <achristensen@webkit.org>
3126
3127         _WKThumbnailView initialization with WKWebView needs to call correct initWithFrame
3128         https://bugs.webkit.org/show_bug.cgi?id=179537
3129         <rdar://problem/35275219>
3130
3131         Reviewed by Darin Adler.
3132
3133         I introduced this in r223439 and made an ObjC mistake.  This is what I get for adding SPI with no tests.
3134         I fixed this by making the existing WKView/_WKThumbnailView API tests work with WKWebView.
3135
3136         * UIProcess/API/Cocoa/_WKThumbnailView.mm:
3137         (-[_WKThumbnailView initWithFrame:fromWKWebView:]):
3138
3139 2017-11-10  Carlos Garcia Campos  <cgarcia@igalia.com>
3140
3141         [GTK][WPE] Switch to use API::NavigationClient
3142         https://bugs.webkit.org/show_bug.cgi?id=178720
3143
3144         Reviewed by Alex Christensen.
3145
3146         Replace WebKitLoaderClient and WebKitPolicyClient with WebKitNavigationClient that implements
3147         API::NavigationClient.
3148
3149         * PlatformGTK.cmake:
3150         * PlatformWPE.cmake:
3151         * UIProcess/API/APINavigationAction.h: Add new constructor that receives a target frame name instead of a target
3152         frame info.
3153         * UIProcess/API/APINavigationClient.h:
3154         (API::NavigationClient::didDisplayInsecureContent): Added.
3155         (API::NavigationClient::didRunInsecureContent): Added.
3156         (API::NavigationClient::decidePolicyForNavigationResponse): Change NavigationResponse parameter to be a
3157         Ref<NavigationResponse>&& instead of a NavigationResponse&.
3158         * UIProcess/API/C/WKPage.cpp:
3159         (WKPageSetPageNavigationClient): Update NavigationResponse parameter.
3160         * UIProcess/API/glib/WebKitBackForwardList.cpp:
3161         (webkitBackForwardListChanged):
3162         * UIProcess/API/glib/WebKitBackForwardListPrivate.h:
3163         * UIProcess/API/glib/WebKitNavigationAction.cpp:
3164         (webkitNavigationActionCreate): Wrap the given API::NavigationAction.
3165         (webkit_navigation_action_get_navigation_type): Use the wrapped API::NavigationAction.
3166         (webkit_navigation_action_get_mouse_button): Ditto.
3167         (webkit_navigation_action_get_modifiers): Ditto.
3168         (webkit_navigation_action_get_request): Ditto.
3169         (webkit_navigation_action_is_user_gesture): Ditto.
3170         (webkit_navigation_action_is_redirect): Ditto.
3171         * UIProcess/API/glib/WebKitNavigationActionPrivate.h:
3172         (_WebKitNavigationAction::_WebKitNavigationAction):
3173         * UIProcess/API/glib/WebKitNavigationClient.cpp: Renamed from Source/WebKit/UIProcess/API/glib/WebKitLoaderClient.cpp.
3174         (NavigationClient::NavigationClient):
3175         (attachNavigationClientToView):
3176         * UIProcess/API/glib/WebKitNavigationClient.h: Renamed from Source/WebKit/UIProcess/API/glib/WebKitLoaderClient.h.
3177         * UIProcess/API/glib/WebKitNavigationPolicyDecision.cpp:
3178         (webkit_navigation_policy_decision_get_frame_name): Add FIXME.
3179         (webkitNavigationPolicyDecisionCreate): Get the target frame name from the API::NavigationAction.
3180         * UIProcess/API/glib/WebKitNavigationPolicyDecisionPrivate.h:
3181         * UIProcess/API/glib/WebKitPolicyClient.cpp: Removed.
3182         * UIProcess/API/glib/WebKitPolicyClient.h: Removed.
3183         * UIProcess/API/glib/WebKitPolicyDecision.cpp:
3184         (webkitPolicyDecisionSetListener): Remove the madePolicyDecision boolean member, we can null-check the listener instead.
3185         (webkit_policy_decision_use): Ensure listener is nullptr after being invoked to prevent the decision from being made
3186         more than once.
3187         (webkit_policy_decision_ignore): Ditto.
3188         (webkit_policy_decision_download): Ditto.
3189         * UIProcess/API/glib/WebKitPolicyDecisionPrivate.h:
3190         * UIProcess/API/glib/WebKitResponsePolicyDecision.cpp:
3191         (webkit_response_policy_decision_get_request): Use the wrapped API::NavigationResponse.
3192         (webkit_response_policy_decision_get_response): Ditto.
3193         (webkit_response_policy_decision_is_mime_type_supported): Ditto.
3194         (webkitResponsePolicyDecisionCreate): Wrap the given API::NavigationResponse.
3195         * UIProcess/API/glib/WebKitResponsePolicyDecisionPrivate.h:
3196         * UIProcess/API/glib/WebKitUIClient.cpp:
3197         (UIClient::createNewPage): Create the WebKitNavigationAction from a new API::NavigationAction.
3198         * UIProcess/API/glib/WebKitWebView.cpp:
3199         (webkitWebViewConstructed): Attach navigation client.
3200         * UIProcess/Cocoa/NavigationState.h: Update API::NavigationResponse parameter of decidePolicyForNavigationResponse.
3201         * UIProcess/Cocoa/NavigationState.mm:
3202         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):
3203         * UIProcess/WebPageProxy.cpp:
3204         (WebKit::WebPageProxy::didDisplayInsecureContentForFrame): Notify the navigation client if it's used.
3205         (WebKit::WebPageProxy::didRunInsecureContentForFrame): Ditto.
3206         (WebKit::WebPageProxy::decidePolicyForNewWindowAction): Use the new API::NavigationAction constructor to pass
3207         the target frame name, instead of a null target frame info.
3208         (WebKit::WebPageProxy::decidePolicyForResponse): Move the API::NavigationResponse.
3209
3210 2017-11-09  Chris Dumez  <cdumez@apple.com>
3211
3212         Unreviewed, rolling out r224661.
3213
3214         Broke build on several internal Mac/iOS bots
3215
3216         Reverted changeset:
3217
3218         "Ignore HSTS for partitioned, cross-origin subresource
3219         requests"
3220         https://bugs.webkit.org/show_bug.cgi?id=178993
3221         https://trac.webkit.org/changeset/224661
3222
3223 2017-11-09  Chris Dumez  <cdumez@apple.com>
3224
3225         ServiceWorkerRegistration objects may get recycled for different SWServerRegistration objects
3226         https://bugs.webkit.org/show_bug.cgi?id=179517
3227
3228         Reviewed by Brady Eidson.
3229
3230         * Scripts/webkit/messages.py:
3231         (forward_declarations_and_headers):
3232         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3233         (WebKit::WebSWServerConnection::updateRegistrationStateInClient):
3234         (WebKit::WebSWServerConnection::fireUpdateFoundEvent):
3235         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
3236         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
3237         * WebProcess/Storage/WebSWClientConnection.cpp:
3238         (WebKit::WebSWClientConnection::addServiceWorkerRegistrationInServer):
3239         (WebKit::WebSWClientConnection::removeServiceWorkerRegistrationInServer):
3240         * WebProcess/Storage/WebSWClientConnection.h:
3241         * WebProcess/Storage/WebSWClientConnection.messages.in:
3242
3243 2017-11-09  John Wilander  <wilander@apple.com>
3244
3245         Ignore HSTS for partitioned, cross-origin subresource requests
3246         https://bugs.webkit.org/show_bug.cgi?id=178993
3247         <rdar://problem/34962462>
3248
3249         Reviewed by Brent Fulgham.
3250
3251         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3252         (downgradeRequest):
3253             Convenience function to downgrade a request if
3254             CFNetwork as already upgraded it during
3255             canonicalization. This allows the rest of 
3256             WebKit's processing to function, such as UIR
3257             and mixed content blocking.
3258         (updateIgnoreStrictTransportSecuritySettingIfNecessary):
3259             Adds and removed the ignore request accordingly.
3260         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
3261             Now asks CFNetwork to ignore HSTS on resource loads we
3262             partition cookies for.
3263         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
3264             Now asks CFNetwork to ignore HSTS on resource loads we
3265             partition cookies for.
3266
3267 2017-11-09  Chris Dumez  <cdumez@apple.com>
3268
3269         Implement real post 'install' event steps of the Install algorithm (steps 14+)
3270         https://bugs.webkit.org/show_bug.cgi?id=179401
3271
3272         Reviewed by Brady Eidson.
3273
3274         Implement step 14+ of Install algorithm, as per:
3275         - https://w3c.github.io/ServiceWorker/#installation-algorithm
3276
3277         * Scripts/webkit/messages.py:
3278         (headers_for_type):
3279         * Shared/WebCoreArgumentCoders.h:
3280         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3281         (WebKit::WebSWServerConnection::resolveRegistrationJobInClient):
3282         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
3283         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
3284         * WebProcess/Storage/WebSWClientConnection.cpp:
3285         (WebKit::WebSWClientConnection::didResolveRegistrationPromise):
3286         * WebProcess/Storage/WebSWClientConnection.h:
3287         * WebProcess/Storage/WebSWClientConnection.messages.in:
3288
3289 2017-11-09  Megan Gardner  <megan_gardner@apple.com>
3290
3291         Clean out unused selection items from UIKitSPI
3292         https://bugs.webkit.org/show_bug.cgi?id=179459
3293
3294         Reviewed by Tim Horton.
3295
3296         Many of these should have been removed from previous commits, but they were missed.
3297         None of these enums or methods are being used by WebKit anymore, and removing them will keep things
3298         clean and allow UIKit to remove things that are not used at all by anyone anymore.
3299
3300         * Platform/spi/ios/UIKitSPI.h:
3301
3302 2017-11-09  Christopher Reid  <chris.reid@sony.com>
3303
3304         Use enum classes within FileSystem
3305         https://bugs.webkit.org/show_bug.cgi?id=175172
3306
3307         Reviewed by Darin Adler.
3308
3309         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
3310         * NetworkProcess/NetworkDataTaskBlob.cpp:
3311         * NetworkProcess/cache/NetworkCache.cpp:
3312         * NetworkProcess/capture/NetworkCaptureManager.cpp:
3313         * NetworkProcess/capture/NetworkCaptureRecorder.cpp:
3314         * Shared/WebMemorySampler.cpp:
3315         * UIProcess/API/APIContentRuleListStore.cpp:
3316         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
3317
3318 2017-11-09  Youenn Fablet  <youenn@apple.com>
3319
3320         ServiceWorkerClientFetch should create not null ResourceError
3321         https://bugs.webkit.org/show_bug.cgi?id=179485
3322
3323         Reviewed by Darin Adler.
3324
3325         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
3326         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
3327
3328 2017-11-09  Andy Estes  <aestes@apple.com>
3329
3330         [iOS] Adopt UIPreviewDataAttachmentListIsContentManaged
3331         https://bugs.webkit.org/show_bug.cgi?id=179458
3332         <rdar://problem/35034691>
3333
3334         Reviewed by Dan Bernstein.
3335
3336         * Platform/spi/ios/UIKitSPI.h:
3337         * UIProcess/ios/WKContentViewInteraction.mm:
3338         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
3339
3340 2017-11-08  Joseph Pecoraro  <pecoraro@apple.com>
3341
3342         Include a more complete block signature in public headers to avoid potential -Wstrict-prototypes warnings
3343         https://bugs.webkit.org/show_bug.cgi?id=179466
3344
3345         Reviewed by Dan Bernstein.
3346
3347         * UIProcess/API/Cocoa/WKHTTPCookieStore.h:
3348         * UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
3349         (-[WKHTTPCookieStore setCookie:completionHandler:]):
3350         (-[WKHTTPCookieStore deleteCookie:completionHandler:]):
3351
3352 2017-11-08  Jeremy Jones  <jeremyj@apple.com>
3353
3354         Make WKFullScreenWidnowController more robust against modification by the embedding app.
3355         https://bugs.webkit.org/show_bug.cgi?id=179413
3356         rdar://problem/35408061
3357
3358         Reviewed by Darin Adler.
3359
3360         Present fullscreen UViewController in a separate UIWindow to prevent interaction with the embedding app's
3361         UIViewController hierarchy.
3362
3363         Immediately tear down the fullscreen interface if the embedding app removes the WKWebView from the fullscreen window.
3364         This prevents the fullscreen interface from getting into an invalid state.
3365
3366         Preserve scrollView.zoomScale because it is not effectively preserved by the more indirect _viewScale.
3367
3368         Use a custom root view controller to allow hiding of the status bar.
3369
3370         Remove the no-longer-necessary dispatch_after calls during enter and exit fullscreen.
3371
3372         * UIProcess/API/Cocoa/WKWebView.mm:
3373         (-[WKWebView removeFromSuperview]):
3374         * UIProcess/ios/WKFullScreenWindowControllerIOS.h:
3375         * UIProcess/ios/WKFullScreenWindowControllerIOS.mm:
3376         (WebKit::WKWebViewState::applyTo):
3377         (WebKit::WKWebViewState::store):
3378         (-[_WKFullScreenViewController loadView]):
3379         (-[_WKFullscreenRootViewController prefersStatusBarHidden]):
3380         (-[WKFullScreenWindowController enterFullScreen]):
3381         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
3382         (-[WKFullScreenWindowController completedExitFullScreen]):
3383         (-[WKFullScreenWindowController exitFullscreenImmediately]):
3384         (-[WKFullScreenWindowController close]):
3385         (-[WKFullScreenWindowController webViewDidRemoveFromSuperviewWhileInFullscreen]):
3386         (-[_WKFullScreenViewController viewDidDisappear:]): Deleted.
3387
3388 2017-11-08  Jeremy Jones  <jeremyj@apple.com>
3389
3390         HTMLMediaElement should not use element fullscreen on iOS
3391         https://bugs.webkit.org/show_bug.cgi?id=179418
3392         rdar://problem/35409277
3393
3394         Reviewed by Eric Carlson.
3395
3396         Add ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN to determine if HTMLMediaElement should use element full screen or not.
3397
3398         * Configurations/FeatureDefines.xcconfig:
3399
3400 2017-11-08  Wenson Hsieh  <wenson_hsieh@apple.com>
3401
3402         [Attachment Support] Implement delegate hooks for attachment element insertion and removal
3403         https://bugs.webkit.org/show_bug.cgi?id=179016
3404         <rdar://problem/35250890>
3405
3406         Reviewed by Tim Horton.
3407
3408         See WebCore/ChangeLog for more details.
3409
3410         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3411         * UIProcess/API/Cocoa/WKWebView.mm:
3412         (-[WKWebView _didInsertAttachment:]):
3413         (-[WKWebView _didRemoveAttachment:]):
3414         * UIProcess/API/Cocoa/WKWebViewInternal.h:
3415         * UIProcess/Cocoa/PageClientImplCocoa.h:
3416         * UIProcess/Cocoa/PageClientImplCocoa.mm:
3417         (WebKit::PageClientImplCocoa::didInsertAttachment):
3418         (WebKit::PageClientImplCocoa::didRemoveAttachment):
3419         * UIProcess/PageClient.h:
3420         (WebKit::PageClient::didInsertAttachment):
3421         (WebKit::PageClient::didRemoveAttachment):
3422         * UIProcess/WebPageProxy.cpp:
3423         (WebKit::WebPageProxy::didInsertAttachment):
3424         (WebKit::WebPageProxy::didRemoveAttachment):
3425         * UIProcess/WebPageProxy.h:
3426         * UIProcess/WebPageProxy.messages.in:
3427         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
3428         (WebKit::WebEditorClient::didInsertAttachment):
3429         (WebKit::WebEditorClient::didRemoveAttachment):
3430         * WebProcess/WebCoreSupport/WebEditorClient.h:
3431
3432 2017-11-08  Carlos Garcia Campos  <cgarcia@igalia.com>
3433
3434         REGRESSION(r223773): [GTK] WebKitWebInspector bring-to-front signal is emitted right after open-window
3435         https://bugs.webkit.org/show_bug.cgi?id=179365
3436
3437         Reviewed by Michael Catanzaro.
3438
3439         In the GTK+ API, open-window already implies presenting the window to bring it to the front, so it's not
3440         expected that bring-to-front is emitted on open. This is happening since r223773 that moved common code from
3441         platform specific inspector files to the main file, but in the case of open the mac implementation was not
3442         exactly the same as the GTK+ one. This broke /webkit2/WebKitWebInspector/default and
3443         /webkit2/WebKitWebInspector/manual-attach-detach.
3444
3445         * UIProcess/WebInspectorProxy.cpp:
3446         (WebKit::WebInspectorProxy::open): Set m_isOpening for the scope of the function.
3447         * UIProcess/WebInspectorProxy.h: Add m_isOpening.
3448         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
3449         (WebKit::WebInspectorProxy::platformBringToFront): Return early if m_isOpening is true.
3450
3451 2017-11-07  Carlos Garcia Campos  <cgarcia@igalia.com>
3452
3453         REGRESSION(r224179): [GTK] Several WebViewEditor tests are failing since r224179
3454         https://bugs.webkit.org/show_bug.cgi?id=179366
3455
3456         Reviewed by Michael Catanzaro.
3457
3458         In r224179, webkit_web_view_can_execute_editing_command() was optimized to use the sync path for commands
3459         supported by the WebViewEditorState, but the state requires a redraw to be up to date. We can't know if
3460         WebViewEditorState is in sync, when webkit_web_view_can_execute_editing_command() is called, so we always need
3461         to ask the web process.
3462
3463         * UIProcess/API/glib/WebKitWebView.cpp:
3464         (webkit_web_view_can_execute_editing_command):
3465
3466 2017-11-07  Carlos Garcia Campos  <cgarcia@igalia.com>
3467
3468         [GTK][WPE] Build inspector resources using copy-user-interface-resources.pl script
3469         https://bugs.webkit.org/show_bug.cgi?id=179317
3470
3471         Reviewed by Michael Catanzaro.
3472
3473         This is the script used by Apple and it has several advantages:
3474
3475           - It allows to combine and minify most of the js and css files, which improves performance and binary size.
3476           - It removes the debug resources and assertions in production builds.
3477           - It allows to remove the test resources in production builds.
3478
3479         The patch also moves the common cmake code to generate the resources to a new file InspectorGResources.cmake included
3480         by GTK+ and WPE platform cmake files.
3481
3482         * InspectorGResources.cmake: Added.
3483         * PlatformGTK.cmake:
3484         * PlatformWPE.cmake:
3485
3486 2017-11-07  Jeremy Jones  <jeremyj@apple.com>
3487
3488         Add downcast support for FullscreenClient.
3489         https://bugs.webkit.org/show_bug.cgi?id=178824
3490
3491         Reviewed by Simon Fraser.
3492
3493         Add SPECIALIZE_TYPE_TRAITS macros for API::FullscreenClient and WebKit::Fullscreen client so 
3494         downcasts can be done safely.
3495
3496         * UIProcess/API/APIFullscreenClient.h:
3497         (API::FullscreenClient::isType const):
3498         * UIProcess/API/C/mac/WKPagePrivateMac.mm:
3499         (WKPageSetFullscreenDelegate):
3500         (WKPageGetFullscreenDelegate):
3501         * UIProcess/API/Cocoa/WKWebView.mm:
3502         (-[WKWebView _setFullscreenDelegate:]):
3503         (-[WKWebView _fullscreenDelegate]):
3504         * UIProcess/Cocoa/FullscreenClient.h:
3505         (isType):
3506         * UIProcess/Cocoa/FullscreenClient.mm:
3507
3508 2017-11-07  Brady Eidson  <beidson@apple.com>
3509
3510         Implement "UpdateWorkerState" and use it
3511         https://bugs.webkit.org/show_bug.cgi?id=179318
3512
3513         Reviewed by Chris Dumez.
3514
3515         * Scripts/webkit/messages.py:
3516         (headers_for_type):
3517         * Shared/WebCoreArgumentCoders.h:
3518  
3519        * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3520         (WebKit::WebSWServerConnection::updateWorkerStateInClient):
3521         (WebKit::WebSWServerConnection::installServiceWorkerContext):
3522         (WebKit::WebSWServerConnection::setContextConnection):
3523         (WebKit::WebSWServerConnection::updateServiceWorkerContext): Deleted.
3524         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
3525
3526         * WebProcess/Storage/WebSWClientConnection.messages.in:
3527
3528         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
3529         (WebKit::WebSWContextManagerConnection::installServiceWorker):
3530         (WebKit::WebSWContextManagerConnection::updateServiceWorker): Deleted.
3531         * WebProcess/Storage/WebSWContextManagerConnection.h:
3532         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
3533
3534 2017-11-07  Commit Queue  <commit-queue@webkit.org>
3535
3536         Unreviewed, rolling out r224512 and r224521.
3537         https://bugs.webkit.org/show_bug.cgi?id=179388
3538
3539         An API test added with this change is failing an assertion on
3540         the bots. (Requested by ryanhaddad on #webkit).
3541
3542         Reverted changesets:
3543
3544         "[Attachment Support] Implement delegate hooks for attachment
3545         element insertion and removal"
3546         https://bugs.webkit.org/show_bug.cgi?id=179016
3547         https://trac.webkit.org/changeset/224512
3548
3549         "Remove stray logging from a newly added API test"
3550         https://trac.webkit.org/changeset/224521
3551
3552 2017-11-07  Chris Dumez  <cdumez@apple.com>
3553
3554         [Service Workers] Add support for "install" event
3555         https://bugs.webkit.org/show_bug.cgi?id=179338
3556
3557         Reviewed by Youenn Fablet.
3558
3559         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3560         (WebKit::WebSWServerConnection::firePostInstallEvents):
3561         (WebKit::WebSWServerConnection::fireInstallEvent):
3562         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
3563         * StorageProcess/StorageProcess.cpp:
3564         (WebKit::StorageProcess::didFinishServiceWorkerInstall):
3565         * StorageProcess/StorageProcess.h:
3566         * StorageProcess/StorageProcess.messages.in:
3567         * WebProcess/Storage/WebSWClientConnection.messages.in:
3568         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
3569         (WebKit::WebSWContextManagerConnection::fireInstallEvent):
3570         (WebKit::WebSWContextManagerConnection::didFinishInstall):
3571         * WebProcess/Storage/WebSWContextManagerConnection.h:
3572         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
3573
3574 2017-11-07  Youenn Fablet  <youenn@apple.com>
3575
3576         Support the case of fetch events that are not responded
3577         https://bugs.webkit.org/show_bug.cgi?id=179336
3578
3579         Reviewed by Chris Dumez.
3580
3581         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
3582         (WebKit::WebServiceWorkerFetchTaskClient::didNotHandle):
3583         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:
3584
3585 2017-11-06  Alex Christensen  <achristensen@webkit.org>
3586
3587         Make ResourceLoader::willSendRequestInternal asynchronous
3588         https://bugs.webkit.org/show_bug.cgi?id=179251
3589
3590         Reviewed by Andy Estes.
3591
3592         * WebProcess/Network/WebLoaderStrategy.cpp:
3593         (WebKit::WebLoaderStrategy::loadResource):
3594         (WebKit::WebLoaderStrategy::schedulePluginStreamLoad):
3595         * WebProcess/Network/WebLoaderStrategy.h:
3596         * WebProcess/Plugins/PluginView.cpp:
3597         (WebKit::PluginView::Stream::start):
3598
3599 2017-11-06  Wenson Hsieh  <wenson_hsieh@apple.com>
3600
3601         [Attachment Support] Implement delegate hooks for attachment element insertion and removal
3602         https://bugs.webkit.org/show_bug.cgi?id=179016
3603         <rdar://problem/35250890>
3604
3605         Reviewed by Tim Horton.
3606
3607         Adds boilerplate plumbing to WebEditorClient, WebPage, and the usual machinery in the UI process to notify
3608         WebKit2 clients when attachment elements have been inserted or removed from the document. See the WebCore
3609         ChangeLog for more details about the implementation, or the Tools ChangeLog for more information about new API
3610         tests.
3611
3612         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3613         * UIProcess/API/Cocoa/WKWebView.mm:
3614         (-[WKWebView _didInsertAttachment:]):
3615         (-[WKWebView _didRemoveAttachment:]):
3616         * UIProcess/API/Cocoa/WKWebViewInternal.h:
3617         * UIProcess/Cocoa/PageClientImplCocoa.h:
3618         * UIProcess/Cocoa/PageClientImplCocoa.mm:
3619         (WebKit::PageClientImplCocoa::didInsertAttachment):
3620         (WebKit::PageClientImplCocoa::didRemoveAttachment):
3621         * UIProcess/PageClient.h:
3622         (WebKit::PageClient::didInsertAttachment):
3623         (WebKit::PageClient::didRemoveAttachment):
3624         * UIProcess/WebPageProxy.cpp:
3625         (WebKit::WebPageProxy::didInsertAttachment):
3626         (WebKit::WebPageProxy::didRemoveAttachment):
3627         * UIProcess/WebPageProxy.h:
3628         * UIProcess/WebPageProxy.messages.in:
3629         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
3630         (WebKit::WebEditorClient::didInsertAttachment):
3631         (WebKit::WebEditorClient::didRemoveAttachment):
3632         * WebProcess/WebCoreSupport/WebEditorClient.h:
3633
3634 2017-11-06  Jeremy Jones  <jeremyj@apple.com>
3635
3636         iOS element fullscreen should use a UIGestureRecognizer to detect user interaction.
3637         https://bugs.webkit.org/show_bug.cgi?id=179029
3638         rdar://problem/35307882
3639
3640         Reviewed by Simon Fraser.
3641
3642         Replace _WKTapDelegatingView with a UILongPressGestureRecognizer. When set with a duration of 0, it effectively
3643         recognizes UITouchBegin events.
3644
3645         * UIProcess/ios/WKFullScreenWindowControllerIOS.mm:
3646         (-[_WKFullScreenViewController loadView]):
3647         (-[_WKFullScreenViewController gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
3648         (-[_WKTapDelegatingView setTarget:action:]): Deleted.
3649         (-[_WKTapDelegatingView hitTest:withEvent:]): Deleted.
3650
3651 2017-11-06  Chris Dumez  <cdumez@apple.com>
3652
3653         [Service Workers] Add proper implementation for 'updatefound' event
3654         https://bugs.webkit.org/show_bug.cgi?id=179302
3655
3656         Reviewed by Brady Eidson.
3657
3658         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3659         (WebKit::WebSWServerConnection::fireUpdateFoundEvent):
3660         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
3661         * WebProcess/Storage/WebSWClientConnection.messages.in:
3662
3663 2017-11-06  Christopher Reid  <chris.reid@sony.com>
3664
3665         Use enum classes within FileSystem
3666         https://bugs.webkit.org/show_bug.cgi?id=175172
3667
3668         Reviewed by Myles C. Maxfield.
3669
3670         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
3671         * NetworkProcess/NetworkDataTaskBlob.cpp:
3672         * NetworkProcess/cache/NetworkCache.cpp:
3673         * NetworkProcess/capture/NetworkCaptureManager.cpp:
3674         * NetworkProcess/capture/NetworkCaptureRecorder.cpp:
3675         * Shared/WebMemorySampler.cpp:
3676         * UIProcess/API/APIContentRuleListStore.cpp:
3677         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
3678
3679 2017-11-06  Michael Catanzaro  <mcatanzaro@igalia.com>
3680
3681         [WPE] Properly use SYSTEM_INCLUDE_DIRECTORIES for WebKit build target
3682         https://bugs.webkit.org/show_bug.cgi?id=179097
3683
3684         Reviewed by Žan Doberšek.
3685
3686         * PlatformWPE.cmake:
3687
3688 2017-11-05  Yusuke Suzuki  <utatane.tea@gmail.com>
3689
3690         JIT call inline caches should cache calls to objects with getCallData/getConstructData traps
3691         https://bugs.webkit.org/show_bug.cgi?id=144458
3692
3693         Reviewed by Saam Barati.
3694
3695         * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
3696         (WebKit::JSNPMethod::JSNPMethod):
3697         (WebKit::JSNPMethod::getCallData): Deleted.
3698         * WebProcess/Plugins/Netscape/JSNPMethod.h:
3699         (WebKit::JSNPMethod::createStructure):
3700
3701 2017-11-04  Chris Dumez  <cdumez@apple.com>
3702
3703         REGRESSION(r223718): Leaking WebProcessPool after reconfiguration
3704         https://bugs.webkit.org/show_bug.cgi?id=179123
3705         <rdar://problem/35294685>
3706
3707         Reviewed by Geoff Garen.
3708
3709         Make sure we destroy the ServiceWorker WebProcess once all other WebProcesses
3710         go away at there is no use keeping it running at this point. Also, this prevents
3711         leaking the WebProcessPool since the WebProcessProxy holds a strong reference
3712         to the WebProcessPool.
3713
3714         * UIProcess/WebProcessPool.cpp:
3715         (WebKit::WebProcessPool::disconnectProcess):
3716
3717 2017-11-01  Darin Adler  <darin@apple.com>
3718
3719         Simplify event dispatch code and make it a bit more consistent
3720         https://bugs.webkit.org/show_bug.cgi?id=178991
3721
3722         Reviewed by Chris Dumez.
3723
3724         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.cpp:
3725         (webkit_dom_event_get_src_element): Call target instead of srcElement.
3726
3727 2017-11-04  Aishwarya Nirmal  <anirmal@apple.com>
3728
3729         [Touch Bar Web API] Add support for menuitem tag
3730         https://bugs.webkit.org/show_bug.cgi?id=179020
3731
3732         Reviewed by Ryosuke Niwa.
3733
3734         Adds in the MenuItemElementEnabled flag so that the menu item element is a runtime-
3735         enabled feature. It has a default value of false.
3736
3737         * Shared/WebPreferences.yaml:
3738         * UIProcess/API/C/WKPreferences.cpp:
3739         (WKPreferencesSetMenuItemElementEnabled):
3740         (WKPreferencesGetMenuItemElementEnabled):
3741         * UIProcess/API/C/WKPreferencesRefPrivate.h:
3742
3743 2017-11-03  Chris Dumez  <cdumez@apple.com>
3744
3745         Unreviewed, rolling out r224438.
3746
3747         Has caused assertions on the bots
3748
3749         Reverted changeset:
3750
3751         "REGRESSION(r223718): Leaking WebProcessPool after
3752         reconfiguration"
3753         https://bugs.webkit.org/show_bug.cgi?id=179123
3754         https://trac.webkit.org/changeset/224438
3755
3756 2017-11-03  Youenn Fablet  <youenn@apple.com>
3757
3758         Requests handled by Service Worker should not go through preflighting
3759         https://bugs.webkit.org/show_bug.cgi?id=179250
3760
3761         Reviewed by Alex Christensen.
3762
3763         * WebProcess/Network/WebLoaderStrategy.cpp:
3764         (WebKit::WebLoaderStrategy::scheduleLoad):
3765         * WebProcess/Storage/WebSWClientConnection.cpp:
3766         (WebKit::WebSWClientConnection::startFetch):
3767         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
3768         (WebKit::shouldHandleFetch):
3769
3770 2017-11-03  Chris Dumez  <cdumez@apple.com>
3771
3772         REGRESSION(r223718): Leaking WebProcessPool after reconfiguration
3773         https://bugs.webkit.org/show_bug.cgi?id=179123
3774         <rdar://problem/35294685>
3775
3776         Reviewed by Geoffrey Garen.
3777
3778         Make sure we destroy the ServiceWorker WebProcess once all other WebProcesses
3779         go away at there is no use keeping it running at this point. Also, this prevents
3780         leaking the WebProcessPool since the WebProcessProxy holds a strong reference
3781         to the WebProcessPool.
3782
3783         * UIProcess/WebProcessPool.cpp:
3784         (WebKit::WebProcessPool::disconnectProcess):
3785
3786 2017-11-03  Youenn Fablet  <youenn@apple.com>
3787
3788         Implement Service Worker Matching Registration algorithm
3789         https://bugs.webkit.org/show_bug.cgi?id=178882
3790
3791         Reviewed by Chris Dumez.
3792
3793         Added IPC plumbery for matchRegistration request and response.
3794         Added some limited clearing of workers and registrations.
3795
3796         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3797         (WebKit::WebSWServerConnection::matchRegistration):
3798         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
3799         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
3800         * StorageProcess/StorageProcess.cpp:
3801         (WebKit::StorageProcess::deleteWebsiteData):
3802         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
3803         * WebProcess/Storage/WebSWClientConnection.cpp:
3804         (WebKit::WebSWClientConnection::didMatchRegistration):
3805         (WebKit::WebSWClientConnection::matchRegistration):
3806         * WebProcess/Storage/WebSWClientConnection.h:
3807         * WebProcess/Storage/WebSWClientConnection.messages.in:
3808         * WebProcess/Storage/WebServiceWorkerProvider.h:
3809
3810 2017-11-03  Jeremy Jones  <jeremyj@apple.com>
3811
3812         Element fullscreen should use FloatRects instead of IntRects in beganEnterFullScreenWithInitialFrame
3813         https://bugs.webkit.org/show_bug.cgi?id=179033
3814         rdar://problem/35309279
3815         
3816         Reviewed by Darin Adler.
3817
3818         Screen coordinates are floats, so use NSRect instead of IntRect on Mac.
3819
3820         * UIProcess/mac/WKFullScreenWindowController.h:
3821         * UIProcess/mac/WKFullScreenWindowController.mm:
3822         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
3823         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
3824
3825 2017-11-03  Chris Dumez  <cdumez@apple.com>
3826
3827         Use a single identifier type to identify Service Workers
3828         https://bugs.webkit.org/show_bug.cgi?id=179192
3829
3830         Reviewed by Brady Eidson.
3831
3832         Use a single identifier type to identify Service Workers. We had both a String
3833         identifier and a uint64_t identifier for each service worker. We now consistently
3834         use a ServiceWorkerIdentifier which is a strongly typed identifier backed by a
3835         uint64_t.
3836
3837         * Scripts/webkit/messages.py:
3838         (forward_declarations_and_headers):
3839         (forward_declarations_and_headers.templates):
3840         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3841         (WebKit::WebSWServerConnection::startFetch):
3842         (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope):
3843         (WebKit::WebSWServerConnection::postMessageToServiceWorkerClient):
3844         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
3845         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
3846         * StorageProcess/StorageProcess.cpp:
3847         (WebKit::StorageProcess::serviceWorkerContextFailedToStart):
3848         (WebKit::StorageProcess::serviceWorkerContextStarted):
3849         (WebKit::StorageProcess::postMessageToServiceWorkerClient):
3850         * StorageProcess/StorageProcess.h:
3851         * StorageProcess/StorageProcess.messages.in:
3852         * WebProcess/Storage/WebSWClientConnection.cpp:
3853         (WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope):
3854         (WebKit::WebSWClientConnection::postMessageToServiceWorkerClient):
3855         * WebProcess/Storage/WebSWClientConnection.h:
3856         * WebProcess/Storage/WebSWClientConnection.messages.in:
3857         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
3858         (WebKit::WebSWContextManagerConnection::updateServiceWorker):
3859         (WebKit::WebSWContextManagerConnection::serviceWorkerStartedWithMessage):
3860         (WebKit::WebSWContextManagerConnection::startFetch):
3861         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerGlobalScope):
3862         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerClient):
3863         * WebProcess/Storage/WebSWContextManagerConnection.h:
3864         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
3865
3866 2017-11-03  Antti Koivisto  <antti@apple.com>
3867
3868         Enable display:contents by default as experimental feature
3869         https://bugs.webkit.org/show_bug.cgi?id=179239
3870         <rdar://problem/35334612>
3871
3872         Reviewed by Darin Adler.
3873
3874         We pass most of the WPT tests. What remains is mostly flexbox related edge cases.
3875
3876         * Shared/WebPreferences.yaml:
3877
3878 2017-11-03  Frederic Wang  <fwang@igalia.com>
3879
3880         Use WK_IOS_TBA instead of WK_MAC_TBA to indicate availability of private functions on iOS
3881         https://bugs.webkit.org/show_bug.cgi?id=179238
3882
3883         Reviewed by Darin Adler.
3884
3885         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3886         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
3887
3888 2017-11-02  Maciej Stachowiak  <mjs@apple.com>
3889
3890         Don't try to guess plugin MIME type from a file extension in a URL (no observable effect)
3891         https://bugs.webkit.org/show_bug.cgi?id=178333
3892
3893         Reviewed by Darin Adler.
3894
3895         * WebProcess/Plugins/PluginView.cpp:
3896         (WebKit::PluginView::pluginDidReceiveUserInteraction): loadedMIMEType --> serviceType
3897         * WebProcess/WebPage/WebPage.cpp:
3898         (WebKit::WebPage::determinePrimarySnapshottedPlugIn): ditto
3899
3900 2017-11-02  Brady Eidson  <beidson@apple.com>
3901
3902         SW: Implement "Update Registration State" algorithm (unused for now)
3903         https://bugs.webkit.org/show_bug.cgi?id=179186
3904
3905         Reviewed by Chris Dumez.
3906
3907         * Scripts/webkit/messages.py:
3908         (headers_for_type):
3909
3910         * Shared/WebCoreArgumentCoders.h:
3911
3912         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3913         (WebKit::WebSWServerConnection::updateRegistrationStateInClient):
3914         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
3915         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
3916
3917         * WebProcess/Storage/WebSWClientConnection.cpp:
3918         (WebKit::WebSWClientConnection::addServiceWorkerRegistrationInServer):
3919         (WebKit::WebSWClientConnection::removeServiceWorkerRegistrationInServer):
3920         * WebProcess/Storage/WebSWClientConnection.h:
3921         * WebProcess/Storage/WebSWClientConnection.messages.in:
3922
3923 2017-11-02  Alex Christensen  <achristensen@webkit.org>
3924
3925         Use CompletionHandlers for redirects
3926         https://bugs.webkit.org/show_bug.cgi?id=179163
3927
3928         Reviewed by Tim Horton.
3929
3930         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
3931         (WebKit::BlobDownloadClient::willSendRequestAsync):
3932         * NetworkProcess/Downloads/BlobDownloadClient.h:
3933         * NetworkProcess/NetworkDataTask.h:
3934         * NetworkProcess/NetworkLoad.cpp:
3935         (WebKit::NetworkLoad::~NetworkLoad):
3936         (WebKit::NetworkLoad::continueWillSendRequest):
3937         (WebKit::NetworkLoad::willSendRequestAsync):
3938         * NetworkProcess/NetworkLoad.h:
3939         * NetworkProcess/NetworkLoadClient.h:
3940         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3941         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
3942         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
3943         * UIProcess/API/APIDownloadClient.h:
3944         (API::DownloadClient::willSendRequest):
3945         * UIProcess/API/C/WKContext.cpp:
3946         (WKContextSetDownloadClient):
3947         * UIProcess/Cocoa/DownloadClient.h:
3948         * UIProcess/Cocoa/DownloadClient.mm:
3949         (WebKit::DownloadClient::willSendRequest):
3950         * WebProcess/Network/WebResourceLoader.cpp:
3951         (WebKit::WebResourceLoader::willSendRequest):
3952         * WebProcess/Plugins/PluginView.cpp:
3953         (WebKit::PluginView::Stream::~Stream):
3954         (WebKit::PluginView::Stream::continueLoad):
3955         (WebKit::PluginView::Stream::willSendRequest):
3956         * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp:
3957
3958 2017-11-02  Christopher Reid  <chris.reid@sony.com>
3959
3960         Add a FileSystem namespace to FileSystem.cpp
3961         https://bugs.webkit.org/show_bug.cgi?id=179063
3962
3963         Reviewed by Darin Adler.
3964
3965         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
3966         * NetworkProcess/Downloads/BlobDownloadClient.h:
3967         * NetworkProcess/NetworkDataTaskBlob.cpp:
3968         * NetworkProcess/NetworkDataTaskBlob.h:
3969         * NetworkProcess/NetworkProcess.cpp:
3970         * NetworkProcess/cache/CacheStorageEngine.cpp:
3971         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
3972         * NetworkProcess/cache/NetworkCache.cpp:
3973         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
3974         * NetworkProcess/cache/NetworkCacheData.cpp:
3975         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
3976         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
3977         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
3978         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
3979         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3980         * NetworkProcess/capture/NetworkCaptureManager.cpp:
3981         * NetworkProcess/capture/NetworkCaptureManager.h:
3982         * NetworkProcess/capture/NetworkCaptureRecorder.cpp:
3983         * NetworkProcess/capture/NetworkCaptureResource.h:
3984         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3985         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3986         * NetworkProcess/soup/NetworkProcessSoup.cpp:
3987         * Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp:
3988         * Shared/Plugins/unix/PluginSearchPath.cpp:
3989         * Shared/WebMemorySampler.cpp:
3990         * Shared/WebMemorySampler.h:
3991         * Shared/gtk/ProcessExecutablePathGtk.cpp:
3992         * Shared/ios/ChildProcessIOS.mm:
3993         * Shared/mac/ChildProcessMac.mm:
3994         * Shared/mac/SandboxExtensionMac.mm:
3995         * Shared/wpe/ProcessExecutablePathWPE.cpp:
3996         * StorageProcess/StorageProcess.cpp:
3997         * UIProcess/API/APIContentRuleListStore.cpp:
3998         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
3999         * UIProcess/API/glib/IconDatabase.cpp:
4000         * UIProcess/API/glib/WebKitFaviconDatabase.cpp:
4001         * UIProcess/API/glib/WebKitFileChooserRequest.cpp:
4002         * UIProcess/API/glib/WebKitWebContext.cpp:
4003         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
4004         * UIProcess/Automation/WebAutomationSession.cpp:
4005         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
4006         * UIProcess/Cocoa/WebViewImpl.mm:
4007         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
4008         * UIProcess/Plugins/gtk/PluginInfoCache.cpp:
4009         * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
4010         * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
4011         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
4012         * UIProcess/WebStorage/LocalStorageDatabase.cpp:
4013         * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
4014         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
4015         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
4016         * UIProcess/gtk/WebProcessPoolGtk.cpp:
4017         * UIProcess/mac/WebPageProxyMac.mm:
4018         * UIProcess/wpe/WebProcessPoolWPE.cpp:
4019         * WebProcess/InjectedBundle/API/glib/WebKitExtensionManager.cpp:
4020         * WebProcess/InjectedBundle/glib/InjectedBundleGlib.cpp:
4021         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
4022         * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
4023         * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
4024         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
4025
4026 2017-11-02  Joseph Pecoraro  <pecoraro@apple.com>
4027
4028         Make ServiceWorker a Remote Inspector debuggable target
4029         https://bugs.webkit.org/show_bug.cgi?id=179043
4030         <rdar://problem/34126008>
4031
4032         Reviewed by Brian Burg.
4033
4034         * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.h:
4035         * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm:
4036         (debuggableTypeString):
4037         Provide a way to start a Remote Web Inspector frontend for a ServiceWorker target type.
4038
4039 2017-11-02  Ryan Haddad  <ryanhaddad@apple.com>
4040
4041         Unreviewed, rolling out r224353.
4042
4043         Breaks internal builds.
4044
4045         Reverted changeset:
4046
4047         "Ignore HSTS for partitioned, cross-origin subresource
4048         requests"
4049         https://bugs.webkit.org/show_bug.cgi?id=178993
4050         https://trac.webkit.org/changeset/224353
4051
4052 2017-11-02  John Wilander  <wilander@apple.com>
4053
4054         Ignore HSTS for partitioned, cross-origin subresource requests
4055         https://bugs.webkit.org/show_bug.cgi?id=178993
4056         <rdar://problem/34962462>
4057
4058         Reviewed by Brent Fulgham and Alex Christensen.
4059
4060         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
4061         (downgradeRequest):
4062             Convenience function to downgrade a request if
4063             CFNetwork as already upgraded it during
4064             canonicalization. This allows the rest of 
4065             WebKit's processing to function, such as UIR
4066             and mixed content blocking.
4067         (updateIgnoreStrictTransportSecuritySettingIfNecessary):
4068             Adds and removed the ignore request accordingly.
4069         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
4070             Now asks CFNetwork to ignore HSTS on resource loads we
4071             partition cookies for.
4072         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
4073             Now asks CFNetwork to ignore HSTS on resource loads we
4074             partition cookies for.
4075
4076 2017-11-02  Yousuke Kimoto  <yousuke.kimoto@sony.com>
4077
4078         [WinCairo] Add IPC files for wincairo webkit
4079         https://bugs.webkit.org/show_bug.cgi?id=177919
4080
4081         Reviewed by Alex Christensen.
4082
4083         * Platform/IPC/Attachment.cpp:
4084         * Platform/IPC/Attachment.h:
4085         (IPC::Attachment::Attachment):
4086         (IPC::Attachment::handle):
4087         * Platform/IPC/Connection.h:
4088         (IPC::Connection::identifierIsNull):
4089         (IPC::Connection::sendWithReply):
4090         * Platform/IPC/win/AttachmentWin.cpp: Added.
4091         (IPC::Attachment::encode const):
4092         (IPC::getDuplicatedHandle):
4093         (IPC::Attachment::decode):
4094         * Platform/IPC/win/ConnectionWin.cpp: Added.
4095         (IPC::Connection::createServerAndClientIdentifiers):
4096         (IPC::Connection::platformInitialize):
4097         (IPC::Connection::platformInvalidate):
4098         (IPC::Connection::readEventHandler):
4099         (IPC::Connection::writeEventHandler):
4100         (IPC::Connection::open):
4101         (IPC::Connection::platformCanSendOutgoingMessages const):
4102         (IPC::Connection::sendOutgoingMessage):
4103         (IPC::Connection::willSendSyncMessage):
4104         (IPC::Connection::didReceiveSyncReply):
4105         * PlatformWin.cmake:
4106
4107 2017-11-02  Megan Gardner  <megan_gardner@apple.com>
4108
4109         Early out selection update when data is not present
4110         https://bugs.webkit.org/show_bug.cgi?id=179084
4111
4112         Reviewed by Ryosuke Niwa.
4113
4114         We should early out of a selection update when we do not have the data that is necessary to make that
4115         update. This mostly helps avoid debug asserts, but will be helpful with the selection changes that are
4116         ongoing.
4117
4118         * UIProcess/ios/WKContentViewInteraction.mm:
4119         (-[WKContentView _updateChangedSelection:]):
4120
4121 2017-11-02  Eric Carlson  <eric.carlson@apple.com>
4122
4123         [MediaStream] audioTrack.label is always empty on macOS
4124         https://bugs.webkit.org/show_bug.cgi?id=179175
4125         <rdar://problem/35315438>
4126
4127         Reviewed by Youenn Fablet.
4128
4129         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
4130         (WebKit::UserMediaCaptureManager::createCaptureSource): Pass settings.label to Source constructor.
4131
4132 2017-11-02  Frederic Wang  <fwang@igalia.com>
4133
4134         Add references to bug 179167 in FIXME comments
4135         https://bugs.webkit.org/show_bug.cgi?id=179168
4136
4137         Reviewed by Daniel Bates.
4138
4139         * Configurations/FeatureDefines.xcconfig:
4140
4141 2017-11-01  Jeremy Jones  <jeremyj@apple.com>
4142
4143         Implement WKFullscreenWindowController for iOS.
4144         https://bugs.webkit.org/show_bug.cgi?id=178924
4145         rdar://problem/34697120
4146
4147         Reviewed by Simon Fraser.
4148
4149         Plumb relevant calls through WKWebView and PageClientImplIOS.