bbb5ea6424ec7c90e4b3a97f9899be6cd26c50f1
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-04-04  Yousuke Kimoto  <yousuke.kimoto@sony.com> and Fujii Hironori  <Hironori.Fujii@sony.com>
2
3         [WinCairo] Add WebKit Shared/win files for wincairo webkit
4         https://bugs.webkit.org/show_bug.cgi?id=183044
5
6         Reviewed by Alex Christensen.
7
8         * Shared/win/ChildProcessMainWin.cpp: Added.
9
10 2018-04-04  Wenson Hsieh  <wenson_hsieh@apple.com>
11
12         [Extra zoom mode] Remove effective font size constraints when determining focus zoom scale
13         https://bugs.webkit.org/show_bug.cgi?id=184287
14         <rdar://problem/39063886>
15
16         Reviewed by Timothy Hatcher.
17
18         As it turns out, form controls on some important websites can be very wide, with a small font size, which
19         renders the approach taken in <https://trac.webkit.org/r230171> moot, since we'll just end up zooming to a scale
20         that is too large anyways. To mitigate this for now, remove the minimum font scaling threshold while we think of
21         more clever ways to account for this scenario.
22
23         * UIProcess/API/Cocoa/WKWebView.mm:
24         (-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
25
26 2018-04-04  Fujii Hironori  <Hironori.Fujii@sony.com>
27
28         [Win] WebFrameLoaderClient: 'getpid': identifier not found
29         https://bugs.webkit.org/show_bug.cgi?id=184291
30
31         Reviewed by Konstantin Tokarev.
32
33         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
34         (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad):
35         Use WTF::getCurrentProcessID() instead of getpid().
36         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Ditto.
37
38 2018-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
39
40         ASSERTION FAILED: !m_mainFrame->coreFrame()->loader().frameHasLoaded() || !m_pendingNavigationID when reloading page while a page is loading
41         https://bugs.webkit.org/show_bug.cgi?id=153210
42
43         Reviewed by Alex Christensen.
44
45         The assert happens when WebPage::reload() is called twice and the first time the reload is ignored by
46         FrameLoader because the document URL is empty. In that case the pending navigation is not reset, because
47         FrameLoader::reload() returns before creating the document loader.
48
49         * WebProcess/WebPage/WebPage.cpp:
50         (WebKit::WebPage::reload): Check if the pending navigation has been reset after calling FrameLoader::reload()
51         and reset it otherwise.
52
53 2018-04-03  Youenn Fablet  <youenn@apple.com>
54
55         Make NetworkProcess get ContentBlocker information from UIProcess
56         https://bugs.webkit.org/show_bug.cgi?id=184205
57         <rdar://problem/39146551>
58
59         Unreviewed.
60         Updated decode/encode methods to not hit null identifier assertion.
61
62         * Shared/WebPageCreationParameters.cpp:
63         (WebKit::WebPageCreationParameters::encode const):
64         (WebKit::WebPageCreationParameters::decode):
65         * Shared/WebPageGroupData.cpp:
66         (WebKit::WebPageGroupData::encode const):
67         (WebKit::WebPageGroupData::decode):
68
69 2018-04-03  Andy Estes  <aestes@apple.com>
70
71         [iOS] WKWebView shouldn't know about WKPDFView
72         https://bugs.webkit.org/show_bug.cgi?id=184283
73
74         Reviewed by Timothy Hatcher.
75
76         WKWebView shouldn't be checking if _customContentView is a particular kind of
77         class (e.g., WKPDFView). Instead, it should interact with the _customContentView
78         using the WKWebViewContentProvider protocol.
79
80         Reimplement -_isBackground, -_isDisplayingPDF, -_dataForDisplayedPDF, and
81         -_suggestedFilenameForDisplayedPDF using new WKWebViewContentProvider protocol
82         methods that WKPDFView implements.
83
84         * UIProcess/API/Cocoa/WKWebView.mm:
85         (-[WKWebView _isBackground]):
86         (-[WKWebView _isDisplayingPDF]):
87         (-[WKWebView _dataForDisplayedPDF]):
88         (-[WKWebView _suggestedFilenameForDisplayedPDF]):
89         * UIProcess/Cocoa/WKWebViewContentProvider.h:
90         * UIProcess/ios/WKPDFView.h:
91         * UIProcess/ios/WKPDFView.mm:
92         (-[WKPDFView web_dataRepresentation]):
93         (-[WKPDFView web_suggestedFilename]):
94         (-[WKPDFView web_isBackground]):
95         (-[WKPDFView suggestedFilename]): Deleted.
96         (-[WKPDFView pdfDocument]): Deleted.
97         (-[WKPDFView isBackground]): Deleted.
98
99 2018-04-03  Brent Fulgham  <bfulgham@apple.com>
100
101         Guard against keychain/certificate access outside the network process
102         https://bugs.webkit.org/show_bug.cgi?id=184214
103         <rdar://problem/38734795>
104
105         Reviewed by Youenn Fablet.
106
107         Use the ProcessPrivilege assertions to guard against accessing the Keychain from
108         a non-Networking process.
109
110         * Shared/cf/ArgumentCodersCF.cpp:
111         (IPC::encode): Assert if we access the keychain from a proces other than the Network or UI process.
112         (IPC::decode): Ditto.
113
114 2018-04-03  Youenn Fablet  <youenn@apple.com>
115
116         NetworkResourceLoader does not need to expose all redirect response headers
117         https://bugs.webkit.org/show_bug.cgi?id=184114
118         <rdar://problem/39010557>
119
120         Reviewed by Ryosuke Niwa.
121
122         WebProcess instructs NetworkProcess whether to sanitize response headers based on a runtime flag.
123         We sanitize redirection response headers in case this is not related to a navigation load.
124         Navigation loads may currently require the full response for content blockers.
125
126         * NetworkProcess/NetworkResourceLoadParameters.cpp:
127         (WebKit::NetworkResourceLoadParameters::encode const):
128         (WebKit::NetworkResourceLoadParameters::decode):
129         * NetworkProcess/NetworkResourceLoadParameters.h:
130         * NetworkProcess/NetworkResourceLoader.cpp:
131         (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
132         (WebKit::NetworkResourceLoader::sanitizeRedirectResponseIfPossible):
133         (WebKit::NetworkResourceLoader::dispatchWillSendRequestForCacheEntry):
134         * NetworkProcess/NetworkResourceLoader.h:
135         * Shared/WebPreferences.yaml:
136         * UIProcess/API/C/WKPreferences.cpp:
137         (WKPreferencesSetRestrictedHTTPResponseAccess):
138         (WKPreferencesGetRestrictedHTTPResponseAccess):
139         * UIProcess/API/C/WKPreferencesRef.h:
140         * WebProcess/Network/WebLoaderStrategy.cpp:
141         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
142         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
143         (WebKit::WebLoaderStrategy::startPingLoad):
144         (WebKit::WebLoaderStrategy::preconnectTo):
145
146 2018-04-03  Youenn Fablet  <youenn@apple.com>
147
148         Make NetworkProcess get ContentBlocker information from UIProcess
149         https://bugs.webkit.org/show_bug.cgi?id=184205
150
151         Reviewed by Alex Christensen.
152
153         Make NetworkProcess get content blockers from UIProcess directly.
154         Before that patch, WebProcess sent content blockers to NetworkProcess for each PingLoad.
155         Instead, WebProcess sends the content blocker identifier for each PingLoad and NetworkProcess fetches the content blocker once.
156
157         This is both more efficient than passing them for each PingLoad and safer in the sense
158         that a compromised WebProcess will not be able to bypass any of these.
159         In the future, NetworkProcess should get the content blocker identifier directly from the WebPageID attached to the request.
160
161         Covered by existing beacon+content blocker tests.
162
163         Did some refactoring to add a typed content blocker identifier.
164         Once NetworkProcess fetches a given content blocker, the content blocker will send any modification to NetworkProcess.
165         Introduced NetworkContentRuleListManager to handle the content blockers in NetworkProcess.
166
167         * CMakeLists.txt:
168         * DerivedSources.make:
169         * NetworkProcess/NetworkLoadChecker.cpp:
170         (WebKit::NetworkLoadChecker::checkRequest):
171         (WebKit::NetworkLoadChecker::continueCheckingRequest):
172         (WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad):
173         * NetworkProcess/NetworkLoadChecker.h:
174         (WebKit::NetworkLoadChecker::setContentExtensionController):
175         * NetworkProcess/NetworkProcess.cpp:
176         (WebKit::NetworkProcess::didReceiveMessage):
177         * NetworkProcess/NetworkProcess.h:
178         (WebKit::NetworkProcess::networkUserContentController):
179         * NetworkProcess/NetworkResourceLoadParameters.cpp:
180         (WebKit::NetworkResourceLoadParameters::encode const):
181         (WebKit::NetworkResourceLoadParameters::decode):
182         * NetworkProcess/NetworkResourceLoadParameters.h:
183         * NetworkProcess/NetworkContentRuleListManager.cpp: Added.
184         (WebKit::NetworkContentRuleListManager::contentExtensionsBackend):
185         (WebKit::NetworkContentRuleListManager::addContentRuleLists):
186         (WebKit::NetworkContentRuleListManager::removeContentRuleList):
187         (WebKit::NetworkContentRuleListManager::removeAllContentRuleLists):
188         (WebKit::NetworkContentRuleListManager::remove):
189         * NetworkProcess/NetworkContentRuleListManager.h: Added.
190         * NetworkProcess/NetworkContentRuleListManager.messages.in: Added.
191         * NetworkProcess/PingLoad.cpp:
192         * Scripts/webkit/messages.py:
193         * Shared/UserContentControllerIdentifier.h: Added.
194         * Shared/WebPageCreationParameters.cpp:
195         (WebKit::WebPageCreationParameters::decode):
196         * Shared/WebPageCreationParameters.h:
197         * Shared/WebPageGroupData.cpp:
198         (WebKit::WebPageGroupData::decode):
199         * Shared/WebPageGroupData.h:
200         * UIProcess/Network/NetworkProcessProxy.cpp:
201         (WebKit::NetworkProcessProxy::~NetworkProcessProxy):
202         (WebKit::NetworkProcessProxy::contentExtensionRules):
203         (WebKit::NetworkProcessProxy::didDestroyWebUserContentControllerProxy):
204         * UIProcess/Network/NetworkProcessProxy.h:
205         * UIProcess/Network/NetworkProcessProxy.messages.in:
206         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
207         (WebKit::WebUserContentControllerProxy::get):
208         (WebKit::WebUserContentControllerProxy::WebUserContentControllerProxy):
209         (WebKit::WebUserContentControllerProxy::~WebUserContentControllerProxy):
210         (WebKit::WebUserContentControllerProxy::addProcess):
211         (WebKit::WebUserContentControllerProxy::removeProcess):
212         (WebKit::WebUserContentControllerProxy::addUserContentWorldUse):
213         (WebKit::WebUserContentControllerProxy::removeUserContentWorldUses):
214         (WebKit::WebUserContentControllerProxy::addUserScript):
215         (WebKit::WebUserContentControllerProxy::removeUserScript):
216         (WebKit::WebUserContentControllerProxy::removeAllUserScripts):
217         (WebKit::WebUserContentControllerProxy::addUserStyleSheet):
218         (WebKit::WebUserContentControllerProxy::removeUserStyleSheet):
219         (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets):
220         (WebKit::WebUserContentControllerProxy::addUserScriptMessageHandler):
221         (WebKit::WebUserContentControllerProxy::removeUserMessageHandlerForName):
222         (WebKit::WebUserContentControllerProxy::removeAllUserMessageHandlers):
223         (WebKit::WebUserContentControllerProxy::addContentRuleList):
224         (WebKit::WebUserContentControllerProxy::removeContentRuleList):
225         (WebKit::WebUserContentControllerProxy::removeAllContentRuleLists):
226         * UIProcess/UserContent/WebUserContentControllerProxy.h:
227         (WebKit::WebUserContentControllerProxy::create):
228         (WebKit::WebUserContentControllerProxy::addNetworkProcess):
229         (WebKit::WebUserContentControllerProxy::removeNetworkProcess):
230         (WebKit::WebUserContentControllerProxy::contentExtensionRules):
231         (WebKit::WebUserContentControllerProxy::identifier const):
232         * WebKit.xcodeproj/project.pbxproj:
233         * WebProcess/Network/WebLoaderStrategy.cpp:
234         (WebKit::WebLoaderStrategy::startPingLoad):
235         * WebProcess/UserContent/WebUserContentController.cpp:
236         (WebKit::WebUserContentController::getOrCreate):
237         (WebKit::WebUserContentController::WebUserContentController):
238         (WebKit::WebUserContentController::~WebUserContentController):
239         * WebProcess/UserContent/WebUserContentController.h:
240         * WebProcess/WebPage/WebPage.h:
241         (WebKit::WebPage::userContentControllerIdentifier const):
242
243 2018-04-03  Andy Estes  <aestes@apple.com>
244
245         [Mac] Prioritize file promises over filenames during drag and drop
246         https://bugs.webkit.org/show_bug.cgi?id=184237
247         <rdar://problem/38278076>
248
249         Reviewed by Wenson Hsieh.
250
251         * UIProcess/Cocoa/WebViewImpl.mm:
252         (WebKit::WebViewImpl::performDragOperation):
253
254 2018-04-03  Brady Eidson  <beidson@apple.com>
255
256         Make SessionStorage work with process swapping.
257         https://bugs.webkit.org/show_bug.cgi?id=184270
258
259         Reviewed by Andy Estes.
260
261         Due to a minor process accounting error, WebPageProxys weren't always being reconnected with their
262         WebsiteDataStore's StorageManager when doing process swaps.
263
264         Fix that error, and SessionStorage "just works."
265
266         * UIProcess/WebPageProxy.cpp:
267         (WebKit::WebPageProxy::webProcessWillShutDown):
268         (WebKit::WebPageProxy::processDidTerminate): For NavigationSwap termination, make sure to tell the 
269           process lifetime tracker that this page was removed.
270
271         * UIProcess/WebProcessLifetimeObserver.h:
272         (WebKit::WebProcessLifetimeObserver::webPageWasInvalidated): Renamed from "webPageWasRemoved"
273         (WebKit::WebProcessLifetimeObserver::webPageWasRemoved): Deleted.
274
275         * UIProcess/WebProcessLifetimeTracker.cpp:
276         (WebKit::WebProcessLifetimeTracker::webPageLeavingWebProcess): Renamed from "webProcessWillShutDown"
277         (WebKit::WebProcessLifetimeTracker::pageWasInvalidated):
278         (WebKit::WebProcessLifetimeTracker::webProcessWillShutDown): Deleted.
279         * UIProcess/WebProcessLifetimeTracker.h:
280
281         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
282         (WebKit::WebsiteDataStore::webPageWasInvalidated):
283         (WebKit::WebsiteDataStore::webPageWasRemoved): Deleted.
284         * UIProcess/WebsiteData/WebsiteDataStore.h:
285
286 2018-04-03  Commit Queue  <commit-queue@webkit.org>
287
288         Unreviewed, rolling out r230210.
289         https://bugs.webkit.org/show_bug.cgi?id=184277
290
291         it is breaking internal bots (Requested by youenn on #webkit).
292
293         Reverted changeset:
294
295         "Make NetworkProcess get ContentBlocker information from
296         UIProcess"
297         https://bugs.webkit.org/show_bug.cgi?id=184205
298         https://trac.webkit.org/changeset/230210
299
300 2018-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>
301
302         [Extra zoom mode] Update time picker to use platform view controller
303         https://bugs.webkit.org/show_bug.cgi?id=184252
304         <rdar://problem/38804795>
305
306         Reviewed by Andy Estes.
307
308         Adjust for some small WKTimePickerViewController changes, and remove some files that we no longer need.
309
310         * UIProcess/ios/WKContentViewInteraction.mm:
311         (-[WKContentView presentViewControllerForCurrentAssistedNode]):
312         (-[WKContentView textInputController:didCommitText:]): Deleted.
313         (-[WKContentView textInputController:didCommitText:withSuggestion:]): Deleted.
314         (-[WKContentView textInputControllerDidRequestDismissal:]): Deleted.
315         * UIProcess/ios/forms/WKTextFormControlViewController.h: Removed.
316         * UIProcess/ios/forms/WKTextFormControlViewController.mm: Removed.
317         * UIProcess/ios/forms/WKTextSuggestionButton.h: Removed.
318         * UIProcess/ios/forms/WKTextSuggestionButton.mm: Removed.
319         * WebKit.xcodeproj/project.pbxproj:
320
321 2018-04-03  Ross Kirsling  <ross.kirsling@sony.com>
322
323         Xcode prepends line comments from WTF/Compiler.h to *.sb files
324         https://bugs.webkit.org/show_bug.cgi?id=184166
325
326         Reviewed by Brent Fulgham.
327
328         * DerivedSources.make:
329         Strip ;-comments from *.sb.in files before preprocessing so we can stop treating Platform.h/Compiler.h as C89.
330
331 2018-04-03  Chris Dumez  <cdumez@apple.com>
332
333         Drop MainFrame class
334         https://bugs.webkit.org/show_bug.cgi?id=184191
335
336         Reviewed by Darin Adler.
337
338         Drop MainFrame class and move contents into Page / Frame since there is a 1:1
339         relationship between the Page and the MainFrame.
340
341         This is ground work for introducing LocalFrame / RemoteFrame concepts.
342
343         * Shared/WebRenderLayer.cpp:
344         * Shared/WebRenderObject.cpp:
345         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
346         (WebKit::WebPaymentCoordinator::paymentCoordinator):
347         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
348         * WebProcess/FullScreen/WebFullScreenManager.cpp:
349         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
350         (WKBundlePageInstallPageOverlay):
351         (WKBundlePageUninstallPageOverlay):
352         (WKBundlePageInstallPageOverlayWithAnimation):
353         (WKBundlePageUninstallPageOverlayWithAnimation):
354         * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
355         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
356         * WebProcess/InjectedBundle/InjectedBundle.cpp:
357         * WebProcess/Plugins/PDF/PDFPlugin.mm:
358         * WebProcess/Plugins/PluginView.cpp:
359         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
360         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
361         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
362         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
363         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
364         (WebKit::WebInspectorClient::~WebInspectorClient):
365         (WebKit::WebInspectorClient::highlight):
366         (WebKit::WebInspectorClient::hideHighlight):
367         (WebKit::WebInspectorClient::showPaintRect):
368         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
369         * WebProcess/WebCoreSupport/WebProgressTrackerClient.cpp:
370         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
371         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
372         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
373         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
374         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
375         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
376         * WebProcess/WebPage/FindController.cpp:
377         (WebKit::FindController::updateFindUIAfterPageScroll):
378         (WebKit::FindController::hideFindUI):
379         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
380         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
381         (WebKit::RemoteLayerTreeDrawingArea::updatePreferences):
382         * WebProcess/WebPage/WKAccessibilityWebPageObjectIOS.mm:
383         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
384         * WebProcess/WebPage/WebFrame.cpp:
385         * WebProcess/WebPage/WebInspector.cpp:
386         * WebProcess/WebPage/WebInspectorFrontendAPIDispatcher.cpp:
387         * WebProcess/WebPage/WebPage.cpp:
388         (WebKit::WebPage::mainFrame const):
389         (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
390         (WebKit::WebPage::plugInIntersectsSearchRect):
391         * WebProcess/WebPage/WebPage.h:
392         * WebProcess/WebPage/atk/WebPageAccessibilityObjectAtk.cpp:
393         * WebProcess/WebPage/ios/FindControllerIOS.mm:
394         * WebProcess/WebPage/ios/WebPageIOS.mm:
395         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
396         (WebKit::TiledCoreAnimationDrawingArea::updatePreferences):
397         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
398         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
399         (-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]):
400         (-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
401         * WebProcess/WebPage/mac/WebPageMac.mm:
402         (WebKit::WebPage::performImmediateActionHitTestAtLocation):
403         (WebKit::WebPage::dataDetectorsDidPresentUI):
404         (WebKit::WebPage::dataDetectorsDidChangeUI):
405         (WebKit::WebPage::dataDetectorsDidHideUI):
406         * WebProcess/WebProcess.cpp:
407         * WebProcess/WebStorage/StorageAreaMap.cpp:
408
409 2018-04-03  Youenn Fablet  <youenn@apple.com>
410
411         Make NetworkProcess get ContentBlocker information from UIProcess
412         https://bugs.webkit.org/show_bug.cgi?id=184205
413
414         Reviewed by Alex Christensen.
415
416         Make NetworkProcess get content blockers from UIProcess directly.
417         Before that patch, WebProcess sent content blockers to NetworkProcess for each PingLoad.
418         Instead, WebProcess sends the content blocker identifier for each PingLoad and NetworkProcess fetches the content blocker once.
419
420         This is both more efficient than passing them for each PingLoad and safer in the sense
421         that a compromised WebProcess will not be able to bypass any of these.
422         In the future, NetworkProcess should get the content blocker identifier directly from the WebPageID attached to the request.
423
424         Covered by existing beacon+content blocker tests.
425
426         Did some refactoring to add a typed content blocker identifier.
427         Once NetworkProcess fetches a given content blocker, the content blocker will send any modification to NetworkProcess.
428         Introduced NetworkContentRuleListManager to handle the content blockers in NetworkProcess.
429
430         * CMakeLists.txt:
431         * DerivedSources.make:
432         * NetworkProcess/NetworkLoadChecker.cpp:
433         (WebKit::NetworkLoadChecker::checkRequest):
434         (WebKit::NetworkLoadChecker::continueCheckingRequest):
435         (WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad):
436         * NetworkProcess/NetworkLoadChecker.h:
437         (WebKit::NetworkLoadChecker::setContentExtensionController):
438         * NetworkProcess/NetworkProcess.cpp:
439         (WebKit::NetworkProcess::didReceiveMessage):
440         * NetworkProcess/NetworkProcess.h:
441         (WebKit::NetworkProcess::networkUserContentController):
442         * NetworkProcess/NetworkResourceLoadParameters.cpp:
443         (WebKit::NetworkResourceLoadParameters::encode const):
444         (WebKit::NetworkResourceLoadParameters::decode):
445         * NetworkProcess/NetworkResourceLoadParameters.h:
446         * NetworkProcess/NetworkContentRuleListManager.cpp: Added.
447         (WebKit::NetworkContentRuleListManager::contentExtensionsBackend):
448         (WebKit::NetworkContentRuleListManager::addContentRuleLists):
449         (WebKit::NetworkContentRuleListManager::removeContentRuleList):
450         (WebKit::NetworkContentRuleListManager::removeAllContentRuleLists):
451         (WebKit::NetworkContentRuleListManager::remove):
452         * NetworkProcess/NetworkContentRuleListManager.h: Added.
453         * NetworkProcess/NetworkContentRuleListManager.messages.in: Added.
454         * NetworkProcess/PingLoad.cpp:
455         * Scripts/webkit/messages.py:
456         * Shared/UserContentControllerIdentifier.h: Added.
457         * Shared/WebPageCreationParameters.cpp:
458         (WebKit::WebPageCreationParameters::decode):
459         * Shared/WebPageCreationParameters.h:
460         * Shared/WebPageGroupData.cpp:
461         (WebKit::WebPageGroupData::decode):
462         * Shared/WebPageGroupData.h:
463         * UIProcess/Network/NetworkProcessProxy.cpp:
464         (WebKit::NetworkProcessProxy::~NetworkProcessProxy):
465         (WebKit::NetworkProcessProxy::contentExtensionRules):
466         (WebKit::NetworkProcessProxy::didDestroyWebUserContentControllerProxy):
467         * UIProcess/Network/NetworkProcessProxy.h:
468         * UIProcess/Network/NetworkProcessProxy.messages.in:
469         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
470         (WebKit::WebUserContentControllerProxy::get):
471         (WebKit::WebUserContentControllerProxy::WebUserContentControllerProxy):
472         (WebKit::WebUserContentControllerProxy::~WebUserContentControllerProxy):
473         (WebKit::WebUserContentControllerProxy::addProcess):
474         (WebKit::WebUserContentControllerProxy::removeProcess):
475         (WebKit::WebUserContentControllerProxy::addUserContentWorldUse):
476         (WebKit::WebUserContentControllerProxy::removeUserContentWorldUses):
477         (WebKit::WebUserContentControllerProxy::addUserScript):
478         (WebKit::WebUserContentControllerProxy::removeUserScript):
479         (WebKit::WebUserContentControllerProxy::removeAllUserScripts):
480         (WebKit::WebUserContentControllerProxy::addUserStyleSheet):
481         (WebKit::WebUserContentControllerProxy::removeUserStyleSheet):
482         (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets):
483         (WebKit::WebUserContentControllerProxy::addUserScriptMessageHandler):
484         (WebKit::WebUserContentControllerProxy::removeUserMessageHandlerForName):
485         (WebKit::WebUserContentControllerProxy::removeAllUserMessageHandlers):
486         (WebKit::WebUserContentControllerProxy::addContentRuleList):
487         (WebKit::WebUserContentControllerProxy::removeContentRuleList):
488         (WebKit::WebUserContentControllerProxy::removeAllContentRuleLists):
489         * UIProcess/UserContent/WebUserContentControllerProxy.h:
490         (WebKit::WebUserContentControllerProxy::create):
491         (WebKit::WebUserContentControllerProxy::addNetworkProcess):
492         (WebKit::WebUserContentControllerProxy::removeNetworkProcess):
493         (WebKit::WebUserContentControllerProxy::contentExtensionRules):
494         (WebKit::WebUserContentControllerProxy::identifier const):
495         * WebKit.xcodeproj/project.pbxproj:
496         * WebProcess/Network/WebLoaderStrategy.cpp:
497         (WebKit::WebLoaderStrategy::startPingLoad):
498         * WebProcess/UserContent/WebUserContentController.cpp:
499         (WebKit::WebUserContentController::getOrCreate):
500         (WebKit::WebUserContentController::WebUserContentController):
501         (WebKit::WebUserContentController::~WebUserContentController):
502         * WebProcess/UserContent/WebUserContentController.h:
503         * WebProcess/WebPage/WebPage.h:
504         (WebKit::WebPage::userContentControllerIdentifier const):
505
506 2018-04-02  Beth Dakin  <bdakin@apple.com>
507
508         Fix the managed configurations build
509         https://bugs.webkit.org/show_bug.cgi?id=184253
510         -and corresponding-
511         rdar://problem/39078586
512
513         Reviewed by Dan Bernstein.
514
515         * UIProcess/ios/WKContentViewInteraction.mm:
516         (-[WKContentView canPerformActionForWebView:withSender:]):
517         (-[WKContentView _defineForWebView:]):
518
519 2018-04-02  Carlos Garcia Campos  <cgarcia@igalia.com>
520
521         [Enchant] Clean up TextCheckerEnchant
522         https://bugs.webkit.org/show_bug.cgi?id=184233
523
524         Reviewed by Michael Catanzaro.
525
526         Use TextCheckerEnchant as a singleton now, instead of implementing the singleton here.
527
528         * UIProcess/gtk/TextCheckerGtk.cpp:
529         (WebKit::TextChecker::checkSpellingOfString):
530         (WebKit::TextChecker::getGuessesForWord):
531         (WebKit::TextChecker::learnWord):
532         (WebKit::TextChecker::ignoreWord):
533         (WebKit::TextChecker::setSpellCheckingLanguages):
534         (WebKit::TextChecker::loadedSpellCheckingLanguages):
535         (WebKit::enchantTextChecker): Deleted.
536
537 2018-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
538
539         [GTK] NetworkProcess from WebKitGtk+ 2.19.9x SIGSEVs in NetworkStorageSession (secret search callback)
540         https://bugs.webkit.org/show_bug.cgi?id=183346
541
542         Reviewed by Michael Catanzaro.
543
544         Pass the request cancellable to NetworkStorageSession::getCredentialFromPersistentStorage().
545
546         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
547         (WebKit::NetworkDataTaskSoup::authenticate):
548
549 2018-04-02  Brady Eidson  <beidson@apple.com>
550
551         Process swapping on navigation needs to handle server redirects.
552         <rdar://problem/38690465> and https://bugs.webkit.org/show_bug.cgi?id=184142
553
554         Reviewed by Alex Christensen.
555
556         The same rules we apply to process swapping for basic navigations need to apply
557         to server redirects as well.
558
559         There's three interesting cases we need to support that are covered by new API tests:
560         1 - The initial load in a WKWebView redirects cross-origin.
561         2 - A WKWebView is showing content from a.com, we start a load to b.com, and that redirects to c.com
562         3 - A WKWebView is showing content from a.com, we start a load to a.com, that that redirects to b.com.
563
564         Supporting all 3 of these brought their own little challenges.
565
566         By teaching Navigation objects more about redirects I was able to support all 3 cases.
567
568         * UIProcess/API/APINavigation.cpp:
569         (API::Navigation::Navigation):
570         (API::Navigation::setCurrentRequest):
571         (API::Navigation::appendRedirectionURL):
572         (API::Navigation::loggingString const):
573         (API::Navigation::loggingURL const): Deleted.
574         * UIProcess/API/APINavigation.h:
575         (API::Navigation::originalRequest const):
576         (API::Navigation::currentRequest const):
577         (API::Navigation::currentRequestProcessIdentifier const):
578         (API::Navigation::setCurrentRequestIsRedirect):
579         (API::Navigation::currentRequestIsRedirect const):
580         (API::Navigation::request const): Deleted.
581
582         * UIProcess/API/Cocoa/WKNavigation.mm:
583         (-[WKNavigation _request]):
584
585         * UIProcess/WebPageProxy.cpp:
586         (WebKit::WebPageProxy::receivedPolicyDecision):
587         (WebKit::WebPageProxy::continueNavigationInNewProcess): If this continued navigation is currently in a server
588           redirect, save off a lambda to synthesize a "did receive server redirect" callback once the new WebProcess is running.
589         (WebKit::WebPageProxy::didCreateMainFrame):
590         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame): Possibly ignore this notification if it is really a
591           cross-origin redirect that is just starting back up in a new WebProcess.
592         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
593         (WebKit::WebPageProxy::didCommitLoadForFrame):
594         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
595         (WebKit::WebPageProxy::resetStateAfterProcessExited): Do not clear pageLoadState if the process is exitting for
596           a navigation swap, as we will need to pick up where we left off when the load continues in a new WebProcess.
597         * UIProcess/WebPageProxy.h:
598         * UIProcess/WebPageProxy.messages.in:
599
600         * UIProcess/WebProcessPool.cpp:
601         (WebKit::WebProcessPool::processForNavigation): If a process has never committed any provisional load, it can always
602           be used to continue a navigation.
603         * UIProcess/WebProcessPool.h:
604
605         * UIProcess/WebProcessProxy.h:
606         (WebKit::WebProcessProxy::didCommitProvisionalLoad):
607         (WebKit::WebProcessProxy::hasCommittedAnyProvisionalLoads const):
608
609         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
610         (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad):
611         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
612
613 2018-04-02  Eric Carlson  <eric.carlson@apple.com>
614
615         [Extra zoom mode] Replace video with a placeholder image during fullscreen transition
616         https://bugs.webkit.org/show_bug.cgi?id=184188
617         <rdar://problem/38940307>
618
619         Reviewed by Youenn Fablet.
620
621         * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
622         * UIProcess/Cocoa/VideoFullscreenManagerProxy.messages.in:
623         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
624         (WebKit::VideoFullscreenModelContext::willExitFullscreen):
625         (WebKit::VideoFullscreenManagerProxy::preparedToExitFullscreen):
626         (WebKit::VideoFullscreenManagerProxy::willExitFullscreen):
627         * WebProcess/cocoa/VideoFullscreenManager.h:
628         * WebProcess/cocoa/VideoFullscreenManager.messages.in:
629         * WebProcess/cocoa/VideoFullscreenManager.mm:
630         (WebKit::VideoFullscreenManager::willExitFullscreen):
631
632 2018-04-02  Brian Burg  <bburg@apple.com>
633
634         [Cocoa] Fix some internal builds that consume WebDriver atoms
635         https://bugs.webkit.org/show_bug.cgi?id=184197
636
637         Reviewed by Dan Bernstein.
638
639         * WebKit.xcodeproj/project.pbxproj:
640         Use a Run Script phase to copy WebDriver atoms to WebKit.framework
641         private headers during the installhdrs phase.
642
643 2018-04-02  Ryan Haddad  <ryanhaddad@apple.com>
644
645         Unreviewed, rolling out r230174.
646
647         Caused LayoutTests to exit early with assertion failures.
648
649         Reverted changeset:
650
651         "Process swapping on navigation needs to handle server
652         redirects."
653         https://bugs.webkit.org/show_bug.cgi?id=184142
654         https://trac.webkit.org/changeset/230174
655
656 2018-04-02  Wenson Hsieh  <wenson_hsieh@apple.com>
657
658         [Extra zoom mode] Update date picker UI to latest specifications
659         https://bugs.webkit.org/show_bug.cgi?id=184234
660         <rdar://problem/38804760>
661
662         Reviewed by Timothy Hatcher.
663
664         Rename WKTextFormControlListViewControllerDelegate to WKTextInputListViewControllerDelegate and adjust for the
665         new initializer of WKDatePickerViewController.
666
667         * UIProcess/ios/WKContentViewInteraction.mm:
668         (-[WKContentView presentViewControllerForCurrentAssistedNode]):
669
670 2018-04-02  Brady Eidson  <beidson@apple.com>
671
672         Process swapping on navigation needs to handle server redirects.
673         <rdar://problem/38690465> and https://bugs.webkit.org/show_bug.cgi?id=184142
674
675         Reviewed by Alex Christensen.
676
677         The same rules we apply to process swapping for basic navigations need to apply
678         to server redirects as well.
679
680         There's three interesting cases we need to support that are covered by new API tests:
681         1 - The initial load in a WKWebView redirects cross-origin.
682         2 - A WKWebView is showing content from a.com, we start a load to b.com, and that redirects to c.com
683         3 - A WKWebView is showing content from a.com, we start a load to a.com, that that redirects to b.com.
684
685         Supporting all 3 of these brought their own little challenges.
686
687         By teaching Navigation objects more about redirects I was able to support all 3 cases.
688
689         * UIProcess/API/APINavigation.cpp:
690         (API::Navigation::Navigation):
691         (API::Navigation::setCurrentRequest):
692         (API::Navigation::appendRedirectionURL):
693         (API::Navigation::loggingString const):
694         (API::Navigation::loggingURL const): Deleted.
695         * UIProcess/API/APINavigation.h:
696         (API::Navigation::originalRequest const):
697         (API::Navigation::currentRequest const):
698         (API::Navigation::currentRequestProcessIdentifier const):
699         (API::Navigation::setCurrentRequestIsRedirect):
700         (API::Navigation::currentRequestIsRedirect const):
701         (API::Navigation::request const): Deleted.
702
703         * UIProcess/API/Cocoa/WKNavigation.mm:
704         (-[WKNavigation _request]):
705
706         * UIProcess/WebPageProxy.cpp:
707         (WebKit::WebPageProxy::receivedPolicyDecision):
708         (WebKit::WebPageProxy::continueNavigationInNewProcess): If this continued navigation is currently in a server
709           redirect, save off a lambda to synthesize a "did receive server redirect" callback once the new WebProcess is running.
710         (WebKit::WebPageProxy::didCreateMainFrame):
711         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame): Possibly ignore this notification if it is really a
712           cross-origin redirect that is just starting back up in a new WebProcess.
713         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
714         (WebKit::WebPageProxy::didCommitLoadForFrame):
715         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
716         (WebKit::WebPageProxy::resetStateAfterProcessExited): Do not clear pageLoadState if the process is exitting for
717           a navigation swap, as we will need to pick up where we left off when the load continues in a new WebProcess.
718         * UIProcess/WebPageProxy.h:
719         * UIProcess/WebPageProxy.messages.in:
720
721         * UIProcess/WebProcessPool.cpp:
722         (WebKit::WebProcessPool::processForNavigation): If a process has never committed any provisional load, it can always
723           be used to continue a navigation.
724         * UIProcess/WebProcessPool.h:
725
726         * UIProcess/WebProcessProxy.h:
727         (WebKit::WebProcessProxy::didCommitProvisionalLoad):
728         (WebKit::WebProcessProxy::hasCommittedAnyProvisionalLoads const):
729
730         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
731         (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad):
732         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
733
734 2018-04-02  Wenson Hsieh  <wenson_hsieh@apple.com>
735
736         [Extra zoom mode] Zoom level is sometimes excessive when zooming to focused form controls
737         https://bugs.webkit.org/show_bug.cgi?id=184222
738         <rdar://problem/39063886>
739
740         Reviewed by Timothy Hatcher.
741
742         Upon interactively focusing an element, we zoom and scroll to reveal that element. The heuristics introduced in
743         <https://trac.webkit.org/r168744> work by computing a target scale, and then a point to zoom to given that
744         scale. Currently, this scale is dependent on the computed font size of the form control, such that the form
745         control would be scaled to have an effective font size of 16.
746
747         However, in extra zoom mode, applying these same heuristics (ironically) results in excessive zoom levels, since
748         scaling the font up to 16 would cause most form controls to zoom so far in that we lose context of surrounding
749         elements such as labels and other form controls; the fact that the element is highlighted by the focused form
750         control overlay makes this even more confusing, since part of the focus overlay highlight rect often ends up
751         outside the viewport.
752
753         To fix this, we make a couple of tweaks to focus rect zooming in extra zoom mode. (1) Instead of computing
754         target zoom level based on font size, try to zoom such that the focused element rect fills up most of the
755         viewport (similar to double-tap zooming). This ensures that the focused form control overlay's highlight rect
756         makes sense in most cases, with few exceptions (e.g. the element frame is larger than the viewport). (2)
757         Introduce a minimum legible font size of 11, and compute the minimium scale needed such that the form control
758         font would appear to be at least this legible font size. Then, clamp the target scale chosen by (1) to this
759         minimum scale.
760
761         One additional consideration for (1) is that naively scaling to fit the element rect to the viewport (with some
762         fixed margins) would cause the viewport scale to always change when moving focus between form controls of
763         different dimensions, even if the current scale is more or less appropriate for all the focusable elements. To
764         address this, instead of computing a single target zoom scale for an element rect, compute a range of possible
765         target zoom scales (where the minimum and maximum values depend on the margin we add around the element rect).
766         If the current scale already falls within this target scale range, then we won't bother adjusting the scale at
767         all (unless the font size is too small — see (2)). If the current scale falls outside the target scale range, we
768         then make the minimal adjustment needed to ensure that the element rect fits well within the viewport without
769         being too small.
770
771         * UIProcess/API/Cocoa/WKWebView.mm:
772         (-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
773
774         Move some logic around so that the target scale is computed after computing the visible size. Also renames some
775         constants local to this function (WKWebViewStandardFontSize, kMinimumHeightToShowContentAboveKeyboard,
776         UIWebFormAnimationDuration, CaretOffsetFromWindowEdge) such that they now share a consistent naming style.
777
778 2018-04-02  Jer Noble  <jer.noble@apple.com>
779
780         Enable Legacy EME for all WebKit & WebKitLegacy clients
781         https://bugs.webkit.org/show_bug.cgi?id=184018
782         <rdar://problem/34887387>
783
784         Reviewed by Eric Carlson.
785
786         * Shared/WebPreferences.yaml:
787         * Shared/WebPreferencesDefaultValues.h:
788
789 2018-04-02  Jer Noble  <jer.noble@apple.com>
790
791         REGRESSION (229680): Fullscreen video does not work (youtube, netflix)
792         https://bugs.webkit.org/show_bug.cgi?id=184235
793
794         Reviewed by Eric Carlson.
795
796         Enable the Fullscreen API by default.
797
798         * Shared/WebPreferences.yaml:
799         * Shared/WebPreferencesDefaultValues.h:
800
801 2018-04-02  Fujii Hironori  <Hironori.Fujii@sony.com>
802
803         [Win] MSVC can't compile WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent
804         https://bugs.webkit.org/show_bug.cgi?id=184120
805
806         Reviewed by Alex Christensen.
807
808         It seems that MSVC can't compile the code using `this` in a
809         generalized lambda capture in another lambda.
810
811         In this case, there is no need to copy `protectedThis` for the
812         inner lambda. Move `protectedThis` of the outer lambda to the
813         inner as well as `callback`.
814
815         * UIProcess/WebResourceLoadStatisticsStore.cpp:
816         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
817         Moved `protectedThis` from the outer lambda to the inner.
818
819 2018-04-02  Dan Bernstein  <mitz@apple.com>
820
821         Build fix after r230121
822
823         * Configurations/WebKit.xcconfig: Disabled framework header postprocessing when building for
824           iOS 11.*
825         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: Reverted r230159.
826
827 2018-04-02  Dan Bernstein  <mitz@apple.com>
828
829         Fixed the build when BOOL is not bool.
830         <rdar://problem/39094484>
831
832         Reviewed by Jer Noble.
833
834         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
835         (-[WKFullScreenViewController videoControlsManagerDidChange]): Removed the write-only ivar
836           _hasControlsManager, the assignment to which was causing the compiler error.
837
838 2018-04-02  Ryan Haddad  <ryanhaddad@apple.com>
839
840         Unreviewed build fix.
841
842         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: Update availability annotation.
843
844 2018-04-02  Michael Catanzaro  <mcatanzaro@igalia.com>
845
846         [GTK] DragAndDropHandler.cpp should include GUniquePtrGtk.h
847         https://bugs.webkit.org/show_bug.cgi?id=184119
848
849         Reviewed by Daniel Bates.
850
851         * UIProcess/gtk/DragAndDropHandler.cpp:
852
853 2018-04-02  Frederic Wang  <fwang@igalia.com>
854
855         Fix warnings for unused lambda captures in Source/WebKit
856         https://bugs.webkit.org/show_bug.cgi?id=173555
857
858         Reviewed by Konstantin Tokarev.
859
860         When release logs are disabled, several lambda captures are unused, causing compilation
861         failures with -Wunused-lambda-capture. This patch marks the corresponding variables as unused
862         in order to fix these warnings.
863
864         Based on initial patch by: Konstantin Tokarev  <annulen@yandex.ru>
865
866         * NetworkProcess/NetworkResourceLoader.cpp:
867         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
868         * UIProcess/Network/NetworkProcessProxy.cpp:
869         (WebKit::NetworkProcessProxy::fetchWebsiteData):
870         (WebKit::NetworkProcessProxy::deleteWebsiteData):
871         (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
872         * UIProcess/WebProcessProxy.cpp:
873         (WebKit::WebProcessProxy::fetchWebsiteData):
874         (WebKit::WebProcessProxy::deleteWebsiteData):
875         (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins):
876         * UIProcess/ios/WKContentViewInteraction.mm:
877         (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
878
879 2018-04-02  Alejandro G. Castro  <alex@igalia.com>
880
881         [GTK] Make libwebrtc backend buildable for GTK  port
882         https://bugs.webkit.org/show_bug.cgi?id=178860
883
884         Reviewed by Youenn Fablet.
885
886         * CMakeLists.txt: Add RTC network classes to the compilation and
887         the libwebrtc includes.
888         * PlatformGTK.cmake: Add the libwebrtc directory.
889         * SourcesGTK.txt: Add RTC files to the compilation.
890
891 2018-03-30  Chris Dumez  <cdumez@apple.com>
892
893         REGRESSION (r229828): Facebook login popup is blank
894         https://bugs.webkit.org/show_bug.cgi?id=184206
895         <rdar://problem/39057006>
896
897         Reviewed by Wenson Hsieh.
898
899         Add assertion to make sure we never try to do a policy check to
900         a resource response while a policy check for a navigation is
901         pending. This assertion was being hit by several of our redirection
902         tests without my fix.
903
904         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
905         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
906
907 2018-03-30  Ryan Haddad  <ryanhaddad@apple.com>
908
909         Unreviewed, rolling out r230125.
910
911         Build fix broke more builds.
912
913         Reverted changeset:
914
915         "Unreviewed build fix, remove unused lambda capture."
916         https://trac.webkit.org/changeset/230125
917
918 2018-03-30  Ryan Haddad  <ryanhaddad@apple.com>
919
920         Unreviewed build fix, remove unused lambda capture.
921
922         * NetworkProcess/NetworkResourceLoader.cpp:
923         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
924
925 2018-03-30  Wenson Hsieh  <wenson_hsieh@apple.com>
926
927         [Extra zoom mode] Adopt list view controller UI for numeric input types
928         https://bugs.webkit.org/show_bug.cgi?id=184184
929         <rdar://problem/37238916>
930
931         Reviewed by Timothy Hatcher.
932
933         Remove existing logic for presenting a number pad view controller, since number pads will now be handled as a
934         special case of general text form controls in extra zoom mode.
935
936         * UIProcess/ios/WKContentViewInteraction.h:
937         * UIProcess/ios/WKContentViewInteraction.mm:
938         (-[WKContentView presentViewControllerForCurrentAssistedNode]):
939         (-[WKContentView dismissAllInputViewControllers]):
940         (-[WKContentView _wheelChangedWithEvent:]):
941
942 2018-03-30  Dan Bernstein  <mitz@apple.com>
943
944         Update availability annotations to match the macOS 10.13.4 and iOS 11.3 GM SDKs
945         https://bugs.webkit.org/show_bug.cgi?id=184173
946
947         Reviewed by Alex Christensen.
948
949         Changed WK_MAC_TBA and WK_IOS_TBA to 10.13.4 and 11.3, respectively, in all declarations that
950         appear in the GM SDKs.
951
952         * Shared/API/Cocoa/_WKNSWindowExtras.h:
953         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
954         * UIProcess/API/Cocoa/WKOpenPanelParameters.h:
955         * UIProcess/API/Cocoa/WKOpenPanelParametersPrivate.h:
956         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
957         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
958         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
959         * UIProcess/API/Cocoa/WKViewPrivate.h:
960         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
961         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
962         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
963         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
964         * UIProcess/API/Cocoa/_WKApplicationManifest.h:
965         * UIProcess/API/Cocoa/_WKAttachment.h:
966         * UIProcess/API/Cocoa/_WKAutomationSession.h:
967         * UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.h:
968         * UIProcess/API/Cocoa/_WKDownload.h:
969         * UIProcess/API/Cocoa/_WKDownloadDelegate.h:
970         * UIProcess/API/Cocoa/_WKFocusedElementInfo.h:
971         * UIProcess/API/Cocoa/_WKFullscreenDelegate.h:
972         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
973         * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.h:
974         * UIProcess/API/Cocoa/_WKVisitedLinkStore.h:
975         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
976         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
977         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandlePrivate.h:
978         * WebProcess/InjectedBundle/API/mac/WKDOMDocument.h:
979
980 2018-03-30  Youenn Fablet  <youenn@apple.com>
981
982         NetworkLoadChecker should upgrade redirects if needed
983         https://bugs.webkit.org/show_bug.cgi?id=184098
984
985         Reviewed by Chris Dumez.
986
987         In case of redirections, upgrade URL according CSP.
988
989         * NetworkProcess/NetworkLoadChecker.cpp:
990         (WebKit::NetworkLoadChecker::checkRequest):
991         (WebKit::NetworkLoadChecker::contentSecurityPolicy const):
992
993 2018-03-30  JF Bastien  <jfbastien@apple.com>
994
995         Update messages.py codegen for String, fix tests
996         https://bugs.webkit.org/show_bug.cgi?id=184179
997         <rdar://problem/39041352>
998
999         Reviewed by Mark Lam.
1000
1001         I updated some of the code in
1002         https://trac.webkit.org/changeset/230097 and auto-magically used a
1003         script to update copyright headers... and that broke the tests
1004         which checked for a particular date. Update all of the headers.
1005
1006         Part of this change updates the code generated by messages.py
1007
1008         * Scripts/webkit/LegacyMessageReceiver-expected.cpp:
1009         * Scripts/webkit/MessageReceiver-expected.cpp:
1010         * Scripts/webkit/MessageReceiverSuperclass-expected.cpp:
1011         * Scripts/webkit/MessagesSuperclass-expected.h:
1012         * Scripts/webkit/messages.py:
1013         * Scripts/webkit/messages_unittest.py:
1014         (GeneratedFileContentsTest.assertGeneratedFileContentsEqual):
1015         generate a better error message
1016
1017 2018-03-29  JF Bastien  <jfbastien@apple.com>
1018
1019         Use Forward.h instead of forward-declaring WTF::String
1020         https://bugs.webkit.org/show_bug.cgi?id=184172
1021         <rdar://problem/39026146>
1022
1023         Reviewed by Yusuke Suzuki.
1024
1025         As part of #184164 I'm changing WTF::String, and the forward
1026         declarations are just wrong because I'm making it templated. We
1027         should use Forward.h anyways, so do that instead.
1028
1029         * Scripts/webkit/LegacyMessages-expected.h:
1030         * Scripts/webkit/Messages-expected.h:
1031         * Scripts/webkit/MessagesSuperclass-expected.h:
1032         * UIProcess/WebOpenPanelResultListenerProxy.h:
1033
1034 2018-03-29  Brian Burg  <bburg@apple.com>
1035
1036         Web Automation: clipToViewport is ignored for element screenshots
1037         https://bugs.webkit.org/show_bug.cgi?id=184158
1038         <rdar://problem/39014307>
1039
1040         Reviewed by Timothy Hatcher.
1041
1042         In §19.2 Take Element Screenshot, step 5.2 says that we should clip
1043         the element screenshot rect with the visible viewport rect. We don't
1044         do that right now even though we pass over clipToViewport.
1045
1046         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
1047         (WebKit::snapshotRectForScreenshot):
1048         Clip the rect to viewport if needed.
1049
1050         (WebKit::WebAutomationSessionProxy::takeScreenshot):
1051         This scrollIntoView is misplaced; by this point we have already done
1052         the math to figure out the screenshot rect. Move it before computing the rect.
1053
1054 2018-03-29  Brent Fulgham  <bfulgham@apple.com>
1055
1056         REGRESSION(r230035): ASSERT(MACH_PORT_VALID(m_sendPort)) hit in IPC::Connection::initializeSendSource()
1057         https://bugs.webkit.org/show_bug.cgi?id=184122
1058         <rdar://problem/39003606>
1059
1060         Reviewed by Chris Dumez.
1061
1062         One of the new assertions added in r230035 begin firing while running tests locally. This was happening
1063         because the WebInspector was attempting to open a new connection to a web process that had already
1064         terminated its mach port connection (a dead port).
1065         
1066         We should avoid opening new connections when the port we were given is already dead.
1067
1068         * Platform/IPC/Connection.h:
1069         (IPC::Connection::identifierIsValid): Added.
1070         * Platform/IPC/mac/ConnectionMac.mm:
1071         (IPC::Connection::platformInitialize): Do not perform initialization on a dead (or null) port.
1072         (IPC::Connection::open): Add some assertions that ports are in a valid state.
1073         (IPC::Connection::sendOutgoingMessage): Assert that the send port is not dead.
1074         (IPC::Connection::receiveSourceEventHandler): Assert that the receive port is valid.
1075         * UIProcess/ChildProcessProxy.cpp:
1076         (WebKit::ChildProcessProxy::didFinishLaunching): Treat a dead port as a signal that the
1077         child process failed to launch.
1078         * UIProcess/Network/NetworkProcessProxy.cpp:
1079         (WebKit::NetworkProcessProxy::didFinishLaunching): Ditto.
1080         * UIProcess/Plugins/PluginProcessProxy.cpp:
1081         (WebKit::PluginProcessProxy::didFinishLaunching): Ditto.
1082         * UIProcess/Storage/StorageProcessProxy.cpp:
1083         (WebKit::StorageProcessProxy::didFinishLaunching): Ditto.
1084         * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
1085         (WebKit::PluginProcessConnectionManager::getPluginProcessConnection): Ditto.
1086         * WebProcess/WebPage/WebInspectorUI.cpp:
1087         (WebKit::WebInspectorUI::establishConnection): Ditto.
1088         * WebProcess/WebProcess.cpp:
1089         (WebKit::WebProcess::ensureNetworkProcessConnection): Ditto.
1090         (WebKit::WebProcess::ensureWebToStorageProcessConnection): Ditto.
1091
1092 2018-03-29  Youenn Fablet  <youenn@apple.com>
1093
1094         Synchronize SecurityOrigin related scheme registries with NetworkProcess
1095         https://bugs.webkit.org/show_bug.cgi?id=184140
1096
1097         Reviewed by Chris Dumez.
1098
1099         Add syncing of scheme registries that are used by SecurityOrigin and ContentSecurityPolicy
1100         so that we can properly use them in NetworkProcess as we do in WebProcess.
1101         The registries that are not synced are:
1102         - URLSchemeAsEmptyDocument
1103         - URLSchemeDomainRelaxationForbidden
1104         - URLSchemeAsCachePartitioned
1105         - URLSchemeAsCanDisplayOnlyIfCanRequest
1106
1107         * NetworkProcess/NetworkProcess.cpp:
1108         (WebKit::NetworkProcess::initializeNetworkProcess):
1109         (WebKit::NetworkProcess::registerURLSchemeAsSecure const):
1110         (WebKit::NetworkProcess::registerURLSchemeAsBypassingContentSecurityPolicy const):
1111         (WebKit::NetworkProcess::registerURLSchemeAsLocal const):
1112         (WebKit::NetworkProcess::registerURLSchemeAsNoAccess const):
1113         (WebKit::NetworkProcess::registerURLSchemeAsDisplayIsolated const):
1114         (WebKit::NetworkProcess::registerURLSchemeAsCORSEnabled const):
1115         (WebKit::NetworkProcess::registerURLSchemeAsCanDisplayOnlyIfCanRequest const):
1116         * NetworkProcess/NetworkProcess.h:
1117         * NetworkProcess/NetworkProcess.messages.in:
1118         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1119         (WebKit::NetworkProcessCreationParameters::encode const):
1120         (WebKit::NetworkProcessCreationParameters::decode):
1121         * NetworkProcess/NetworkProcessCreationParameters.h:
1122         * UIProcess/WebProcessPool.cpp:
1123         (WebKit::WebProcessPool::ensureNetworkProcess):
1124         (WebKit::WebProcessPool::registerURLSchemeAsSecure):
1125         (WebKit::WebProcessPool::registerURLSchemeAsBypassingContentSecurityPolicy):
1126         (WebKit::WebProcessPool::registerURLSchemeAsLocal):
1127         (WebKit::WebProcessPool::registerURLSchemeAsNoAccess):
1128         (WebKit::WebProcessPool::registerURLSchemeAsDisplayIsolated):
1129         (WebKit::WebProcessPool::registerURLSchemeAsCORSEnabled):
1130         (WebKit::WebProcessPool::registerURLSchemeAsCanDisplayOnlyIfCanRequest):
1131
1132 2018-03-29  Brent Fulgham  <bfulgham@apple.com>
1133
1134         REGRESSION(r229480): ERROR: Unhandled web process message 'WebCookieManager:SetHTTPCookieAcceptPolicy'
1135         https://bugs.webkit.org/show_bug.cgi?id=184124
1136         <rdar://problem/38998971>
1137
1138         Reviewed by Chris Dumez.
1139
1140         Cookie accept policy messages were still being sent to the WebContent process after
1141         I removed cookie access in r229480. The WebContent process no longer recognizes these
1142         messages, and generates logging to that effect.
1143         
1144         This patch stops sending these unnecessary messages to the WebContent process. Only the
1145         Network process needs to receive this information.
1146
1147         * UIProcess/WebCookieManagerProxy.cpp:
1148         (WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy):
1149
1150 2018-03-29  Carlos Eduardo Ramalho  <cadubentzen@gmail.com>
1151
1152         [WPE] Floating point exception in WebEventFactory::createWebWheelEvent
1153         https://bugs.webkit.org/show_bug.cgi?id=184037
1154
1155         Reviewed by Žan Doberšek.
1156
1157         * Shared/wpe/WebEventFactory.cpp:
1158         (WebKit::WebEventFactory::createWebWheelEvent): Use std::copysign() to avoid division by 0.
1159
1160 2018-03-28  Zalan Bujtas  <zalan@apple.com>
1161
1162         Make it possible to override the screen size
1163         https://bugs.webkit.org/show_bug.cgi?id=184111
1164         <rdar://problem/38972181>
1165
1166         Reviewed by Tim Horton.
1167
1168         * Shared/WebPageCreationParameters.cpp:
1169         (WebKit::WebPageCreationParameters::encode const):
1170         (WebKit::WebPageCreationParameters::decode):
1171         * Shared/WebPageCreationParameters.h:
1172         * UIProcess/WebPageProxy.cpp:
1173         (WebKit::WebPageProxy::creationParameters):
1174         * UIProcess/WebPageProxy.h:
1175         * UIProcess/ios/WebPageProxyIOS.mm:
1176         (WebKit::WebPageProxy::overrideScreenSize):
1177         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1178         (WebKit::WebChromeClient::overrideScreenSize const):
1179         * WebProcess/WebCoreSupport/WebChromeClient.h:
1180         * WebProcess/WebPage/WebPage.cpp:
1181         * WebProcess/WebPage/WebPage.h:
1182         * WebProcess/WebPage/ios/WebPageIOS.mm:
1183         (WebKit::WebPage::overrideScreenSize const):
1184
1185 2018-03-28  Chris Dumez  <cdumez@apple.com>
1186
1187         Do process swap when opening a cross-origin URL via window.open(url, '_blank', 'noopener')
1188         https://bugs.webkit.org/show_bug.cgi?id=183962
1189         <rdar://problem/38817833>
1190
1191         Reviewed by Brady Eidson.
1192
1193         Swap WebProcess on for the initial navigation in a new Window that was opened
1194         via window.open(), when the new URL is cross-origin compared to the opener's
1195         origin. For now, we only swap process if 'noopener' property is set when calling
1196         window.open(). This is because we do not support the remote DOMWindows yet.
1197
1198         * Shared/NavigationActionData.cpp:
1199         (WebKit::NavigationActionData::encode const):
1200         (WebKit::NavigationActionData::decode):
1201         * Shared/NavigationActionData.h:
1202         * UIProcess/API/APINavigation.h:
1203         (API::Navigation::setIsCrossOriginWindowOpenNavigation):
1204         (API::Navigation::isCrossOriginWindowOpenNavigation const):
1205         (API::Navigation::setOpener):
1206         (API::Navigation::opener const):
1207         * UIProcess/WebPageProxy.cpp:
1208         (WebKit::WebPageProxy::receivedPolicyDecision):
1209         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1210         * UIProcess/WebProcessPool.cpp:
1211         (WebKit::WebProcessPool::processForNavigation):
1212         * UIProcess/WebProcessPool.h:
1213         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1214         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1215
1216 2018-03-28  Per Arne Vollan  <pvollan@apple.com>
1217
1218         Adopt WEBPROCESS_WINDOWSERVER_BLOCKING compiler guard in WebProcess.
1219         https://bugs.webkit.org/show_bug.cgi?id=183959
1220         <rdar://problem/38965719>
1221
1222         Reviewed by Brent Fulgham.
1223
1224         Use the compile guard to guard the call to CGSSetDenyWindowServerConnections.
1225
1226         * WebProcess/WebProcess.cpp:
1227         (WebKit::WebProcess::initializeProcess):
1228
1229 2018-03-28  Brent Fulgham  <bfulgham@apple.com>
1230
1231         Unreviewed build fix after r230045.
1232
1233         * UIProcess/Launcher/mac/ProcessLauncherMac.mm: Add missing include (breaks iOS).
1234
1235 2018-03-28  Brent Fulgham  <bfulgham@apple.com>
1236
1237         Protect against invalid mach ports returned by mach_port_request_notification
1238         https://bugs.webkit.org/show_bug.cgi?id=184106
1239         <rdar://problem/37865316>
1240
1241         Reviewed by Chris Dumez.
1242
1243         * Platform/IPC/Connection.h:
1244         (IPC::Connection::Identifier::Identifier): Use default initializer syntax.
1245         * Platform/IPC/mac/ConnectionMac.mm:
1246         (IPC::Connection::open): Drive-by-fix: Include formatted mach error message in logging.
1247         (IPC::Connection::receiveSourceEventHandler): Check return value from 'mach_port_request_notification'
1248         and clean up if it experienced an error.
1249         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1250         (WebKit::ProcessLauncher::launchProcess): Ditto.
1251
1252 2018-03-28  Dean Jackson  <dino@apple.com>
1253
1254         WKWebViewContentProvider shouldn't be a UIScrollViewDelegate
1255         https://bugs.webkit.org/show_bug.cgi?id=184107
1256         <rdar://problem/38967492>
1257
1258         Reviewed by Tim Horton.
1259
1260         There is no need for this class to be a UIScrollViewDelegate. Instead
1261         the protocol should have an optional method that is effectively
1262         scrollViewDidScroll.
1263
1264         * UIProcess/API/Cocoa/WKWebView.mm:
1265         (-[WKWebView scrollViewDidScroll:]): Call web_scrollViewDidScroll
1266         if it exists.
1267         * UIProcess/Cocoa/WKWebViewContentProvider.h: Remove UIScrollViewDelegate
1268         and add an optional web_scrollViewDidScroll.
1269         * UIProcess/ios/WKPDFView.mm:
1270         (-[WKPDFView web_scrollViewDidScroll:]): Renamed from scrollViewDidScroll.
1271         (-[WKPDFView scrollViewDidScroll:]): Deleted.
1272         * UIProcess/ios/WKSystemPreviewView.mm:
1273         (-[WKSystemPreviewView scrollViewDidScroll:]): Deleted.
1274
1275 2018-03-28  Wenson Hsieh  <wenson_hsieh@apple.com>
1276
1277         [Extra zoom mode] Make boosted text autosizing values switchable at runtime
1278         https://bugs.webkit.org/show_bug.cgi?id=184092
1279         <rdar://problem/38939917>
1280
1281         Reviewed by Tim Horton.
1282
1283         Add a private web view preference to switch between normal and boosted text autosizing mode. By default, we use
1284         normal text autosizing values.
1285
1286         * Shared/WebPreferences.yaml:
1287         * UIProcess/API/Cocoa/WKPreferences.mm:
1288         (-[WKPreferences _setShouldEnableTextAutosizingBoost:]):
1289         (-[WKPreferences _shouldEnableTextAutosizingBoost]):
1290         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1291
1292 2018-03-28  Brent Fulgham  <bfulgham@apple.com>
1293
1294         Avoid uninitialized mach ports
1295         https://bugs.webkit.org/show_bug.cgi?id=184090
1296         <rdar://problem/37261129>
1297
1298         Reviewed by Chris Dumez.
1299
1300         It is possible for mach_port_allocate to return an error, but we rarely check its return value. The value
1301         of the argument passed to mach_port_allocate is not guaranteed to be valid when it returns an error, so
1302         there is a potential for us to try to use invalid ports.
1303
1304         We should always check return values, and ensure that the mach port variables we seek to initialize are
1305         kept in a valid state.
1306
1307         Reviewed by Chris Dumez.
1308
1309         * NetworkProcess/NetworkProcess.cpp:
1310         (WebKit::NetworkProcess::createNetworkConnectionToWebProcess): Initialize new port to a safe default and
1311         check the return state of the allocation function.
1312         * Platform/IPC/Connection.h:
1313         * Platform/IPC/mac/ConnectionMac.mm:
1314         (IPC::Connection::open): Ditto.
1315         (IPC::Connection::initializeSendSource): Ditto.
1316         (IPC::readFromMachPort): Ditto.
1317         (IPC::Connection::receiveSourceEventHandler): Ditto.
1318         * Platform/SharedMemory.h:
1319         * Platform/cocoa/SharedMemoryCocoa.cpp:
1320         (WebKit::makeMemoryEntry): Ditto.
1321         * Platform/mac/MachUtilities.cpp:
1322         (setMachPortQueueLength): Ditto.
1323         (setMachExceptionPort): Ditto.
1324         * PluginProcess/PluginProcess.cpp:
1325         (WebKit::PluginProcess::createWebProcessConnection): Ditto.
1326         * StorageProcess/StorageProcess.cpp:
1327         (WebKit::StorageProcess::createStorageToWebProcessConnection): Ditto.
1328         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1329         (WebKit::ProcessLauncher::launchProcess): Ditto.
1330         * WebProcess/WebPage/WebInspector.cpp:
1331         (WebKit::WebInspector::openFrontendConnection): Ditto.
1332
1333 2018-03-28  Michael Catanzaro  <mcatanzaro@igalia.com>
1334
1335         Fails to build webkitgtk+ after git-svn-id: http://svn.webkit.org/repository/webkit/trunk@229877 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1336         https://bugs.webkit.org/show_bug.cgi?id=184081
1337
1338         Unreviewed, switch to use UNUSED_PARAM()
1339
1340         * UIProcess/WebPageProxy.cpp:
1341         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1342
1343 2018-03-28  Tim Horton  <timothy_horton@apple.com>
1344
1345         Make use of HAVE(CORE_ANIMATION_RENDER_SERVER) in more places
1346         https://bugs.webkit.org/show_bug.cgi?id=184072
1347         <rdar://problem/38946530>
1348
1349         Reviewed by Dan Bernstein.
1350
1351         * Platform/mac/LayerHostingContext.mm:
1352         (WebKit::LayerHostingContext::createForExternalHostingProcess):
1353         * UIProcess/mac/ViewSnapshotStore.h:
1354         * UIProcess/mac/ViewSnapshotStore.mm:
1355         (WebKit::ViewSnapshot::clearImage):
1356
1357 2018-03-28  Wenson Hsieh  <wenson_hsieh@apple.com>
1358
1359         Revert an unnecessary workaround when zooming focused form controls
1360         https://bugs.webkit.org/show_bug.cgi?id=184067
1361         <rdar://problem/38805254>
1362
1363         Reviewed by Tim Horton.
1364
1365         Reverts an unintended change introduced in r227984.
1366
1367         * UIProcess/ios/WKContentViewInteraction.mm:
1368         (-[WKContentView _displayFormNodeInputView]):
1369
1370 2018-03-28  Miguel Gomez  <magomez@igalia.com>
1371
1372         [GTK][WPE] Remove UpdateAtlas
1373         https://bugs.webkit.org/show_bug.cgi?id=184042
1374
1375         Reviewed by Žan Doberšek.
1376
1377         Remove all the code related to UpdateAtlas handling.
1378
1379         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1380         (WebKit::CoordinatedGraphicsScene::updateTilesIfNeeded):
1381         (WebKit::CoordinatedGraphicsScene::commitSceneState):
1382         (WebKit::CoordinatedGraphicsScene::purgeGLResources):
1383         (WebKit::CoordinatedGraphicsScene::syncUpdateAtlases): Deleted.
1384         (WebKit::CoordinatedGraphicsScene::createUpdateAtlas): Deleted.
1385         (WebKit::CoordinatedGraphicsScene::removeUpdateAtlas): Deleted.
1386         (WebKit::CoordinatedGraphicsScene::releaseUpdateAtlases): Deleted.
1387         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
1388         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1389         (WebKit::ThreadedCompositor::renderLayerTree):
1390         (WebKit::ThreadedCompositor::releaseUpdateAtlases): Deleted.
1391         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
1392         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1393         (WebKit::WebChromeClient::delegatedScrollRequested):
1394         (WebKit::WebChromeClient::resetUpdateAtlasForTesting): Deleted.
1395         * WebProcess/WebCoreSupport/WebChromeClient.h:
1396         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
1397         (WebKit::AcceleratedDrawingArea::resetUpdateAtlasForTesting): Deleted.
1398         * WebProcess/WebPage/AcceleratedDrawingArea.h:
1399         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
1400         (WebKit::CompositingCoordinator::CompositingCoordinator):
1401         (WebKit::CompositingCoordinator::flushPendingLayerChanges):
1402         (WebKit::CompositingCoordinator::clearPendingStateChanges):
1403         (WebKit::CompositingCoordinator::renderNextFrame):
1404         (WebKit::CompositingCoordinator::purgeBackingStores):
1405         (WebKit::CompositingCoordinator::createUpdateAtlas): Deleted.
1406         (WebKit::CompositingCoordinator::removeUpdateAtlas): Deleted.
1407         (WebKit::CompositingCoordinator::getCoordinatedBuffer): Deleted.
1408         (): Deleted.
1409         (WebKit::CompositingCoordinator::scheduleReleaseInactiveAtlases): Deleted.
1410         (WebKit::CompositingCoordinator::releaseInactiveAtlasesTimerFired): Deleted.
1411         (WebKit::CompositingCoordinator::releaseAtlases): Deleted.
1412         (WebKit::CompositingCoordinator::clearUpdateAtlases): Deleted.
1413         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
1414         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
1415         (WebKit::CoordinatedLayerTreeHost::clearUpdateAtlases): Deleted.
1416         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
1417         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
1418         (WebKit::ThreadedCoordinatedLayerTreeHost::releaseUpdateAtlases): Deleted.
1419         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
1420         * WebProcess/WebPage/DrawingArea.h:
1421         * WebProcess/WebPage/LayerTreeHost.h:
1422         (WebKit::LayerTreeHost::setIsDiscardable):
1423
1424 2018-03-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1425
1426         REGRESSION(r229998): WebDriver: MiniBrowser is crashing in a lot of tests after r229998
1427         https://bugs.webkit.org/show_bug.cgi?id=184075
1428
1429         Reviewed by Žan Doberšek.
1430
1431         This is because we are using a value after it has been moved.
1432
1433         * UIProcess/Automation/WebAutomationSession.cpp:
1434         (WebKit::WebAutomationSession::setWindowFrameOfBrowsingContext): Save a reference to page in a local variable
1435         before using it when it's also going to be moved in the lambda capture.
1436
1437 2018-03-27  Michael Catanzaro  <mcatanzaro@igalia.com>
1438
1439         Unreviewed, fix typo in variable name
1440
1441         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1442         (webkitWebViewBaseCrossingNotifyEvent):
1443
1444 2018-03-27  Per Arne Vollan  <pvollan@apple.com>
1445
1446         The layout test fast/canvas/webgl/read-pixels-test.html is timing out.
1447         https://bugs.webkit.org/show_bug.cgi?id=183923
1448         <rdar://problem/38756869>
1449
1450         Reviewed by Brent Fulgham.
1451
1452         Send OpenGL display mask to the WebContent process when the display ID is changing.
1453
1454         * UIProcess/WebPageProxy.cpp:
1455         (WebKit::WebPageProxy::windowScreenDidChange):
1456         * WebProcess/WebPage/WebPage.h:
1457         * WebProcess/WebPage/WebPage.messages.in:
1458         * WebProcess/WebPage/mac/WebPageMac.mm:
1459         (WebKit::WebPage::openGLDisplayMaskChanged):
1460
1461 2018-03-27  Youenn Fablet  <youenn@apple.com>
1462
1463         Move request checking out of PingLoad for future reuse in NetworkLoad
1464         https://bugs.webkit.org/show_bug.cgi?id=183865
1465
1466         Reviewed by Chris Dumez.
1467
1468         Introduce NetworkLoadChecker as a way to validate requests before sending them in the network process.
1469         Validation encompasses: CORS checks, CSP and Content Extensions on both main request and redirected requests if any.
1470
1471         Make PingLoad use NetworkLoadChecker. Future patch should make NetworkLoad to use it as well whenever needed.
1472
1473         Make NetworkCORSPreflightChecker takes a CompletionHandler instead of a Function.
1474         Ensure this callback is called even if preflight is not completed by returning a Canceled error.
1475
1476         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
1477         (WebKit::NetworkCORSPreflightChecker::~NetworkCORSPreflightChecker):
1478         (WebKit::NetworkCORSPreflightChecker::returnResult):
1479         (WebKit::NetworkCORSPreflightChecker::willPerformHTTPRedirection):
1480         (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
1481         (WebKit::NetworkCORSPreflightChecker::didCompleteWithError):
1482         * NetworkProcess/NetworkCORSPreflightChecker.h:
1483         * NetworkProcess/NetworkLoadChecker.cpp: Added.
1484         (WebKit::NetworkLoadChecker::NetworkLoadChecker):
1485         (WebKit::NetworkLoadChecker::check):
1486         (WebKit::NetworkLoadChecker::checkRedirection):
1487         (WebKit::NetworkLoadChecker::returnError):
1488         (WebKit::NetworkLoadChecker::checkRequest):
1489         (WebKit::NetworkLoadChecker::checkCORSRequest):
1490         (WebKit::NetworkLoadChecker::checkCORSRedirectedRequest):
1491         (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
1492         (WebKit::NetworkLoadChecker::doesNotNeedCORSCheck const):
1493         (WebKit::NetworkLoadChecker::contentSecurityPolicy const):
1494         (WebKit::NetworkLoadChecker::contentExtensionsBackend):
1495         (WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad):
1496         * NetworkProcess/NetworkLoadChecker.h: Added.
1497         (WebKit::NetworkLoadChecker::setCSPResponseHeaders):
1498         (WebKit::NetworkLoadChecker::setContentExtensionRuleLists):
1499         (WebKit::NetworkLoadChecker::url const):
1500         (WebKit::NetworkLoadChecker::storedCredentialsPolicy const):
1501         (WebKit::NetworkLoadChecker::isChecking const):
1502         (WebKit::NetworkLoadChecker::isRedirected const):
1503         * NetworkProcess/PingLoad.cpp:
1504         (WebKit::PingLoad::PingLoad):
1505         (WebKit::PingLoad::~PingLoad):
1506         (WebKit::PingLoad::willPerformHTTPRedirection):
1507         (WebKit::PingLoad::didReceiveChallenge):
1508         (WebKit::PingLoad::wasBlocked):
1509         (WebKit::PingLoad::cannotShowURL):
1510         (WebKit::PingLoad::timeoutTimerFired):
1511         (WebKit::PingLoad::currentURL const):
1512         * NetworkProcess/PingLoad.h:
1513         * WebKit.xcodeproj/project.pbxproj:
1514
1515 2018-03-27  Jiewen Tan  <jiewen_tan@apple.com>
1516
1517         [WebAuthN] Implement authenticatorGetAssertion
1518         https://bugs.webkit.org/show_bug.cgi?id=183881
1519         <rdar://problem/37258628>
1520
1521         Reviewed by Brent Fulgham.
1522
1523         * Shared/WebPreferences.yaml:
1524         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.cpp:
1525         (WebKit::WebCredentialsMessengerProxy::makeCredential):
1526         (WebKit::WebCredentialsMessengerProxy::getAssertion):
1527         (WebKit::WebCredentialsMessengerProxy::getAssertionReply):
1528         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.h:
1529         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.messages.in:
1530         * WebProcess/CredentialManagement/WebCredentialsMessenger.cpp:
1531         (WebKit::WebCredentialsMessenger::getAssertion):
1532         (WebKit::WebCredentialsMessenger::getAssertionReply):
1533         * WebProcess/CredentialManagement/WebCredentialsMessenger.messages.in:
1534
1535 2018-03-27  Chris Dumez  <cdumez@apple.com>
1536
1537         Avoid constructing SecurityOrigin objects from non-main threads
1538         https://bugs.webkit.org/show_bug.cgi?id=184024
1539
1540         Reviewed by Youenn Fablet.
1541
1542         Avoid constructing SecurityOrigin objects from non-main threads as much as possible.
1543
1544         * WebProcess/Storage/WebSWClientConnection.cpp:
1545         (WebKit::WebSWClientConnection::mayHaveServiceWorkerRegisteredForOrigin const):
1546         (WebKit::WebSWClientConnection::matchRegistration):
1547         (WebKit::WebSWClientConnection::getRegistrations):
1548         * WebProcess/Storage/WebSWClientConnection.h:
1549         * WebProcess/Storage/WebSWOriginTable.cpp:
1550         (WebKit::WebSWOriginTable::contains const):
1551         * WebProcess/Storage/WebSWOriginTable.h:
1552
1553 2018-03-27  Chris Dumez  <cdumez@apple.com>
1554
1555         Move online state detection from the WebProcess to the NetworkProcess
1556         https://bugs.webkit.org/show_bug.cgi?id=183989
1557         <rdar://problem/37093299>
1558
1559         Reviewed by Youenn Fablet.
1560
1561         Move online state detection from the WebProcess to the NetworkProcess. This avoid executing the same (expensive) code in
1562         EACH web process whenever a network interface's state changes. Now, the Network Process monitors network interfaces
1563         and determines the online state whenever an interface's state changes. If the onLine state changes, it notifies all
1564         its connected WebProcesses via IPC.
1565
1566         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1567         (WebKit::NetworkConnectionToWebProcess::setOnLineState):
1568         * NetworkProcess/NetworkConnectionToWebProcess.h:
1569         * NetworkProcess/NetworkProcess.cpp:
1570         (WebKit::NetworkProcess::NetworkProcess):
1571         (WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
1572         * WebProcess/Network/NetworkProcessConnection.cpp:
1573         (WebKit::NetworkProcessConnection::setOnLineState):
1574         * WebProcess/Network/NetworkProcessConnection.h:
1575         * WebProcess/Network/NetworkProcessConnection.messages.in:
1576         * WebProcess/Network/WebLoaderStrategy.cpp:
1577         (WebKit::WebLoaderStrategy::isOnLine const):
1578         (WebKit::WebLoaderStrategy::addOnlineStateChangeListener):
1579         (WebKit::WebLoaderStrategy::setOnLineState):
1580         * WebProcess/Network/WebLoaderStrategy.h:
1581
1582 2018-03-27  Wenson Hsieh  <wenson_hsieh@apple.com>
1583
1584         [Extra zoom mode] Add support for new focused form control overlay behaviors
1585         https://bugs.webkit.org/show_bug.cgi?id=184043
1586         <rdar://problem/38758727>
1587
1588         Reviewed by Tim Horton.
1589
1590         See below for more details.
1591
1592         * UIProcess/ios/WKContentViewInteraction.mm:
1593         (-[WKContentView _willStartScrollingOrZooming]):
1594         (-[WKContentView _didEndScrollingOrZooming]):
1595
1596         Suppress focused form control navigation while the scroll view is undergoing a scroll or zoom animation (e.g.,
1597         when moving from one focused form control to another).
1598
1599         (-[WKContentView textInputController:didCommitText:withSuggestion:]):
1600
1601         When dismissing an input view controller, allow focused form control navigation only after updating assisted
1602         node information to ensure that focus rects aren't stale as the user begins to navigate between forms.
1603
1604         (-[WKContentView rectForFocusedFormControlController:inCoordinateSpace:]):
1605         (-[WKContentView nextRectForFocusedFormControlController:inCoordinateSpace:]):
1606         (-[WKContentView previousRectForFocusedFormControlController:inCoordinateSpace:]):
1607         (-[WKContentView scrollViewForFocusedFormControlController:]):
1608         (-[WKContentView highlightedRectForFocusedFormControlController:inCoordinateSpace:]): Deleted.
1609
1610         Implement some new focused form overlay delegate hooks to vend the scroll view, as well as the rects of next and
1611         previous focusable form controls.
1612
1613 2018-03-27  Brent Fulgham  <bfulgham@apple.com>
1614
1615         Further refine cookie read/write logging
1616         https://bugs.webkit.org/show_bug.cgi?id=184044
1617         <rdar://problem/38915610>
1618
1619         Reviewed by Chris Dumez.
1620
1621         Cookie logging was passing the partition, rather than the first party, when logging, which
1622         prevented logging in cases where partitioning or blocking was active. This patch corrects
1623         these calls so that logging is generated in these cases, too.
1624
1625         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1626         (WebKit::NetworkConnectionToWebProcess::cookiesForDOM): Call log routines if needed.
1627         (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM): Ditto.
1628         * NetworkProcess/NetworkResourceLoader.cpp:
1629         (WebKit::escapeIDForJSON): Make available to use in multiple functions.
1630         (WebKit::NetworkResourceLoader::logCookieInformation const): Revise to use shared
1631         convenience functions.
1632         (WebKit::logBlockedCookieInformation): Added.
1633         (WebKit::logCookieInformationInternal): Added.
1634         (WebKit::NetworkResourceLoader::logCookieInformation): Revise to use shared
1635         convenience functions.
1636         * NetworkProcess/NetworkResourceLoader.h:
1637
1638 2018-03-27  Brian Burg  <bburg@apple.com>
1639
1640         Web Automation: support enter/exit fullscreen and hide/restore window operations
1641         https://bugs.webkit.org/show_bug.cgi?id=182837
1642         <rdar://problem/37580732>
1643
1644         Reviewed by Tim Horton.
1645
1646         The W3C specification is more explicit about when to exit fullscreen and
1647         restore the window for a browsing context. So, WebKit needs to have support
1648         for performing these operations on behalf of a driver.
1649
1650         Based on prototyping, it is sufficient to use a JavaScript atom to enter
1651         fullscreen mode. This is included in the patch as EnterFullscreen.js and
1652         can be used to implement the §10.7.5 Fullscreen Window command.
1653
1654         Other window operations cannot be peformed from JavaScript, so we need to
1655         delegate these operations to the session client (i.e., Safari).
1656         This patch adds session client callouts for restoring, minimizing, and
1657         switching to a browsing context.
1658
1659         Exiting fullscreen happens implicitly (per specification) when setting a
1660         window frame without an actual frame, or when switching/restoring/minimizing a window.
1661         If needed, a driver can call Set Window Rect in this way to unfullscreen a context.
1662         Similarly, a driver can restore a minimized window using Set Window Rect.
1663
1664         * UIProcess/API/APIAutomationSessionClient.h:
1665         (API::AutomationSessionClient::requestHideWindowOfPage):
1666         (API::AutomationSessionClient::requestRestoreWindowOfPage):
1667         (API::AutomationSessionClient::requestSwitchToPage):
1668         Add new API client methods.
1669
1670         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
1671         Add new Cocoa API delegate methods.
1672
1673         * UIProcess/Automation/Automation.json:
1674         Make the switch to browsing context command asynchronous, since this functionality
1675         is not always synchronous, and we prefer to use completion handlers in the delegates.
1676
1677         Add new protocol method for hiding the window of a browsing context.
1678         This is expected to minimize/miniaturize a window for desktop window managers.
1679
1680         * UIProcess/Automation/WebAutomationSession.h:
1681         * UIProcess/Automation/WebAutomationSession.cpp:
1682         (WebKit::WebAutomationSession::switchToBrowsingContext):
1683         Make this function asynchronous. Call out to the session client.
1684
1685         (WebKit::WebAutomationSession::setWindowFrameOfBrowsingContext):
1686         Follow the steps in the specification to restore window and exit fullscreen.
1687
1688         (WebKit::WebAutomationSession::hideWindowOfBrowsingContext):
1689         Exit fullscreen and call out to the session client.
1690
1691         (WebKit::WebAutomationSession::exitFullscreenWindowForPage):
1692         This is a little strange. Because there is no async API for exiting fullscreen
1693         from C++ code, we hook into willEnterFullScreen and didExitFullScreen and send
1694         out the response if the page exited fullscreen after we requested it to do so.
1695         Because the W3C specification mandates that drivers only process one command at
1696         a time, there will only ever be one callback installed by this method at a time.
1697
1698         (WebKit::WebAutomationSession::restoreWindowForPage):
1699         (WebKit::WebAutomationSession::hideWindowForPage):
1700         Call out to the session client.
1701
1702         (WebKit::WebAutomationSession::didEnterFullScreenForPage):
1703         (WebKit::WebAutomationSession::didExitFullScreenForPage):
1704         Add methods to be called by instrumentation hooks in WebFullScreenManagerProxy.
1705
1706         * UIProcess/Automation/atoms/EnterFullscreen.js: Added.
1707         (enterFullscreen):
1708
1709         * UIProcess/Cocoa/AutomationSessionClient.h:
1710         * UIProcess/Cocoa/AutomationSessionClient.mm:
1711         (WebKit::AutomationSessionClient::AutomationSessionClient):
1712         (WebKit::AutomationSessionClient::requestSwitchToPage):
1713         (WebKit::AutomationSessionClient::requestHideWindowOfPage):
1714         (WebKit::AutomationSessionClient::requestRestoreWindowOfPage):
1715         (WebKit::AutomationSessionClient::isShowingJavaScriptDialogOnPage):
1716         Add boilerplate to convert C++ API client to Objective-C delegate methods.
1717
1718         * UIProcess/WebFullScreenManagerProxy.cpp:
1719         (WebKit::WebFullScreenManagerProxy::didEnterFullScreen):
1720         (WebKit::WebFullScreenManagerProxy::didExitFullScreen):
1721         Notify the automation session if the page is under automation and
1722         enters or exits fullscreen.
1723
1724         * WebKit.xcodeproj/project.pbxproj:
1725         Add EnterFullscreen.js to the list of WebDriver atoms. These are copied
1726         as WebKit2 private headers and used by driver implementations.
1727
1728 2018-03-27  Eric Carlson  <eric.carlson@apple.com>
1729
1730         Make AVFoundationEnabled preference available on iOS
1731         https://bugs.webkit.org/show_bug.cgi?id=183876
1732         <rdar://problem/38726459>
1733
1734         Reviewed by Youenn Fablet.
1735
1736         * Shared/WebPreferences.yaml: Set AVFoundationEnabled with DEFAULT_AVFOUNDATION_ENABLED.
1737         * Shared/WebPreferencesDefaultValues.h:
1738
1739         * UIProcess/API/Cocoa/WKPreferences.mm:
1740         (-[WKPreferences _setAVFoundationEnabled:]): Enable for iOS.
1741         (-[WKPreferences _avFoundationEnabled]): Ditto.
1742         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1743
1744 2018-03-26  Tim Horton  <timothy_horton@apple.com>
1745
1746         Adopt WK_ALTERNATE_FRAMEWORKS_DIR in WebKit
1747         https://bugs.webkit.org/show_bug.cgi?id=184030
1748         <rdar://problem/38895281>
1749
1750         Reviewed by Dan Bernstein.
1751
1752         * Configurations/Base.xcconfig:
1753         * Configurations/BaseTarget.xcconfig:
1754         * Configurations/WebKit.xcconfig:
1755
1756 2018-03-26  Tim Horton  <timothy_horton@apple.com>
1757
1758         Add and adopt HAVE(CORE_ANIMATION_RENDER_SERVER)
1759         https://bugs.webkit.org/show_bug.cgi?id=184026
1760         <rdar://problem/38883321>
1761
1762         Reviewed by Sam Weinig.
1763
1764         * UIProcess/API/Cocoa/WKWebView.mm:
1765         (-[WKWebView _takeViewSnapshot]):
1766         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
1767
1768 2018-03-26  Wenson Hsieh  <wenson_hsieh@apple.com>
1769
1770         [Extra zoom mode] Refactor input view controller presentation and dismissal helpers
1771         https://bugs.webkit.org/show_bug.cgi?id=184020
1772         Work towards <rdar://problem/38758727>
1773
1774         Reviewed by Tim Horton.
1775
1776         We currently have separate presentation and dismissal helpers for each type of view controller corresponding to
1777         a focused element type. This is excessive, considering that all of these helpers are only invoked from one place
1778         (either -presentViewControllerForCurrentAssistedNode or -dismissAllInputViewControllers), with the exception of
1779         the focused form control overlay.
1780
1781         This refactoring allows us to then adjust the timing of first responder restoration logic, such that the focused
1782         form control view controller can receive forwarded events from the web view. See below for more detail.
1783
1784         * UIProcess/ios/WKContentViewInteraction.mm:
1785         (-[WKContentView presentFocusedFormControlViewController:]):
1786         (-[WKContentView dismissFocusedFormControlViewController:]):
1787
1788         Remove logic to restore the web view as first responder.
1789
1790         (-[WKContentView presentViewControllerForCurrentAssistedNode]):
1791         (-[WKContentView dismissAllInputViewControllers]):
1792
1793         Restore first responder after dismissing a view controller that was presented when focusing a form control, only
1794         if the web view was first responder before presentation.
1795
1796         (-[WKContentView presentDatePickerViewController:]): Deleted.
1797         (-[WKContentView dismissDatePickerViewController:]): Deleted.
1798         (-[WKContentView presentTimePickerViewController:]): Deleted.
1799         (-[WKContentView dismissTimePickerViewController:]): Deleted.
1800         (-[WKContentView presentSelectMenuViewController:]): Deleted.
1801         (-[WKContentView dismissSelectMenuViewController:]): Deleted.
1802         (-[WKContentView dismissNumberPadViewController:]): Deleted.
1803         (-[WKContentView presentNumberPadViewController:]): Deleted.
1804         (-[WKContentView presentTextInputViewController:]): Deleted.
1805         (-[WKContentView dismissTextInputViewController:]): Deleted.
1806
1807 2018-03-06  Brian Burg  <bburg@apple.com>
1808
1809         Web Automation: provide a way to ask clients for a new tab or window
1810         https://bugs.webkit.org/show_bug.cgi?id=183381
1811         <rdar://problem/38167301>
1812
1813         Reviewed by Timothy Hatcher.
1814
1815         Add support for specifying browsing context options when requesting
1816         a new browsing context from the automation session client/delegate.
1817         This is currently just used for specifying tab vs window, but could
1818         also be used for things like toggling certain browser chrome or features.
1819
1820         There is no guarantee that the client has a notion of tabs vs windows,
1821         so this option is purely advisory and should not cause the command to
1822         fail if it cannot be honored.
1823
1824         This behavior caused by specifying this option is client-specific, so no
1825         new tests are included in WebKit for this change.
1826
1827         * UIProcess/API/APIAutomationSessionClient.h:
1828         (API::AutomationSessionClient::didRequestNewPageWithOptions):
1829         (API::AutomationSessionClient::didRequestNewWindow): Deleted.
1830         Add options parameter.
1831
1832         * UIProcess/API/glib/WebKitAutomationSession.cpp:
1833         Adjust to new signature. More work is needed to plumb this information
1834         to the public API for GTK/WPE and support it in WebKitGTK driver.
1835
1836         * UIProcess/Automation/Automation.json: Add new optional parameter.
1837
1838         * UIProcess/Automation/WebAutomationSession.h:
1839         * UIProcess/Automation/WebAutomationSession.cpp:
1840         (WebKit::WebAutomationSession::createBrowsingContext):
1841         Convert the protocol option to an API option.
1842
1843         * UIProcess/Cocoa/AutomationSessionClient.h:
1844         * UIProcess/Cocoa/AutomationSessionClient.mm:
1845         (WebKit::AutomationSessionClient::AutomationSessionClient):
1846         (WebKit::toAPI):
1847         (WebKit::AutomationSessionClient::didRequestNewPageWithOptions):
1848         (WebKit::AutomationSessionClient::didRequestNewWindow): Deleted.
1849         Convert the internal option to a Cocoa SPI option and pass it along.
1850
1851         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
1852         Adjust delegate methods to include options. Clients need to adopt the new signature(s).
1853
1854 2018-03-26  Wenson Hsieh  <wenson_hsieh@apple.com>
1855
1856         [Extra zoom mode] Add plumbing for next and previous focusable element rects
1857         https://bugs.webkit.org/show_bug.cgi?id=184016
1858         Work towards <rdar://problem/38758727>
1859
1860         Reviewed by Tim Horton.
1861
1862         When building up AssistedNodeInformation, we currently compute the element rect of the current focused element,
1863         as well as flags indicating whether or not there are next or previous focusable elements. For
1864         <rdar://problem/38758727>, we additionally send the rects of the next or previous focusable elements as well.
1865
1866         * Shared/AssistedNodeInformation.cpp:
1867         (WebKit::AssistedNodeInformation::encode const):
1868         (WebKit::AssistedNodeInformation::decode):
1869
1870         IPC support for nextNodeRect and previousNodeRect.
1871
1872         * Shared/AssistedNodeInformation.h:
1873         * WebProcess/WebPage/ios/WebPageIOS.mm:
1874         (WebKit::elementRectInRootViewCoordinates):
1875
1876         Add a helper to compute an element's rect in root view coordinates. We use this to compute the rects of the
1877         current focused element as well as those of the next and previous elements, if any.
1878
1879         (WebKit::WebPage::getAssistedNodeInformation):
1880         (WebKit::hasAssistableElement): Deleted.
1881
1882         Since we need the next or previous focusable element to get its rect, we don't need this helper anymore.
1883
1884 2018-03-26  Chris Dumez  <cdumez@apple.com>
1885
1886         Use SecurityOriginData more consistently in Service Worker code
1887         https://bugs.webkit.org/show_bug.cgi?id=183969
1888
1889         Reviewed by Darin Adler.
1890
1891         Use SecurityOriginData more consistently in Service Worker code to avoid constructing
1892         SecurityOrigin objects unnecessarily.
1893
1894         * NetworkProcess/NetworkResourceLoadParameters.cpp:
1895         (WebKit::NetworkResourceLoadParameters::encode const):
1896         * Shared/API/c/WKSecurityOriginRef.cpp:
1897         (WKSecurityOriginCopyDatabaseIdentifier):
1898         * StorageProcess/ServiceWorker/WebSWOriginStore.cpp:
1899         (WebKit::WebSWOriginStore::addToStore):
1900         (WebKit::WebSWOriginStore::removeFromStore):
1901         * StorageProcess/ServiceWorker/WebSWOriginStore.h:
1902         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1903         (WebKit::WebSWServerConnection::scheduleJobInServer):
1904         (WebKit::WebSWServerConnection::registerServiceWorkerClient):
1905         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
1906         (WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
1907         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
1908         * StorageProcess/StorageProcess.cpp:
1909         (WebKit::StorageProcess::connectionToContextProcessWasClosed):
1910         (WebKit::StorageProcess::needsServerToContextConnectionForOrigin const):
1911         (WebKit::StorageProcess::createStorageToWebProcessConnection):
1912         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
1913         (WebKit::StorageProcess::serverToContextConnectionForOrigin):
1914         (WebKit::StorageProcess::createServerToContextConnection):
1915         (WebKit::StorageProcess::swContextConnectionMayNoLongerBeNeeded):
1916         * StorageProcess/StorageProcess.h:
1917         * UIProcess/API/APIFrameInfo.cpp:
1918         (API::FrameInfo::create):
1919         * UIProcess/API/C/WKApplicationCacheManager.cpp:
1920         (WKApplicationCacheManagerDeleteEntriesForOrigin):
1921         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
1922         (WKKeyValueStorageManagerDeleteEntriesForOrigin):
1923         * UIProcess/API/C/WKResourceCacheManager.cpp:
1924         (WKResourceCacheManagerClearCacheForOrigin):
1925         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1926         (WKWebsiteDataStoreRemoveFetchCacheForOrigin):
1927         (WKWebsiteDataStoreGetFetchCacheSizeForOrigin):
1928         * UIProcess/ServiceWorkerProcessProxy.cpp:
1929         (WebKit::ServiceWorkerProcessProxy::create):
1930         (WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
1931         (WebKit::ServiceWorkerProcessProxy::getLaunchOptions):
1932         * UIProcess/ServiceWorkerProcessProxy.h:
1933         * UIProcess/Storage/StorageProcessProxy.cpp:
1934         (WebKit::StorageProcessProxy::getStorageProcessConnection):
1935         * UIProcess/WebProcessPool.cpp:
1936         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
1937         (WebKit::WebProcessPool::disconnectProcess):
1938         (WebKit::WebProcessPool::updateProcessAssertions):
1939         * UIProcess/WebProcessPool.h:
1940         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1941         (WebKit::WebsiteDataStore::fetchDataAndApply):
1942         * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
1943         (WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation):
1944         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1945         (WKBundlePageCopyOriginsWithApplicationCache):
1946         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
1947         (WebKit::UserMediaPermissionRequestManager::sendUserMediaRequest):
1948         (WebKit::UserMediaPermissionRequestManager::enumerateMediaDevices):
1949         * WebProcess/Storage/WebSWClientConnection.cpp:
1950         (WebKit::WebSWClientConnection::registerServiceWorkerClient):
1951         (WebKit::WebSWClientConnection::matchRegistration):
1952         (WebKit::WebSWClientConnection::whenRegistrationReady):
1953         (WebKit::WebSWClientConnection::getRegistrations):
1954         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1955         (WebKit::WebChromeClient::exceededDatabaseQuota):
1956         (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
1957         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1958         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1959         * WebProcess/WebProcess.cpp:
1960         (WebKit::WebProcess::fetchWebsiteData):
1961         * WebProcess/WebStorage/StorageAreaImpl.cpp:
1962         (WebKit::StorageAreaImpl::securityOrigin const):
1963         * WebProcess/WebStorage/StorageAreaImpl.h:
1964         * WebProcess/WebStorage/StorageAreaMap.cpp:
1965         (WebKit::StorageAreaMap::StorageAreaMap):
1966         (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
1967         (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
1968         * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
1969         (WebKit::StorageNamespaceImpl::didDestroyStorageAreaMap):
1970
1971 2018-03-26  Brent Fulgham  <bfulgham@apple.com>
1972
1973         Warn against cookie access in the WebContent process using ProcessPrivilege assertions
1974         https://bugs.webkit.org/show_bug.cgi?id=183911
1975         <rdar://problem/38762306>
1976
1977         Reviewed by Youenn Fablet.
1978
1979         Add a set of ProcessPrivilege assertions to enforce the rule that the WebContent process
1980         should never call Cookie API directly. That should only happen in the Networking or
1981         UIProcess. 
1982
1983         * NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
1984         (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
1985         (WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy):
1986         * NetworkProcess/NetworkProcess.cpp:
1987         (WebKit::NetworkProcess::initializeNetworkProcess):
1988         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1989         (WebKit::NetworkDataTaskCocoa::applyCookieBlockingPolicy):
1990         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1991         (WebKit::NetworkProcess::setSharedHTTPCookieStorage):
1992         (WebKit::NetworkProcess::syncAllCookies):
1993         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1994         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1995         * NetworkProcess/mac/RemoteNetworkingContext.mm:
1996         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
1997         * PluginProcess/PluginProcess.cpp:
1998         (WebKit::PluginProcess::initializeProcess):
1999         * Shared/cf/CookieStorageUtilsCF.mm:
2000         (WebKit::cookieStorageFromIdentifyingData):
2001         (WebKit::identifyingDataFromCookieStorage):
2002         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2003         (WebKit::WebProcessPool::platformInitializeWebProcess):
2004         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2005         (WebKit::privateBrowsingSession):
2006         * UIProcess/WebProcessPool.cpp:
2007         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
2008         (WebKit::WebsiteDataStore::parameters):
2009         * UIProcess/mac/WebCookieManagerProxyMac.mm:
2010         (WebKit::WebCookieManagerProxy::persistHTTPCookieAcceptPolicy):
2011         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2012         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
2013         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2014         (WebKit::WebFrameLoaderClient::createNetworkingContext):
2015         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
2016         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
2017         (WebKit::WebFrameNetworkingContext::storageSession const):
2018         * WebProcess/WebProcess.cpp:
2019         (WebKit::WebProcess::initializeProcess):
2020
2021 2018-03-26  Alex Christensen  <achristensen@webkit.org>
2022
2023         Merge ResourceHandleClient::willCacheResponseAsync with ResourceHandleClient::willCacheResponse
2024         https://bugs.webkit.org/show_bug.cgi?id=183965
2025
2026         Reviewed by Chris Dumez.
2027
2028         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2029         (WebKit::WebFrameLoaderClient::willCacheResponse const):
2030         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2031
2032 2018-03-25  Carlos Garcia Campos  <cgarcia@igalia.com>
2033
2034         [GTK][WPE] Add API to convert between DOM and JSCValue
2035         https://bugs.webkit.org/show_bug.cgi?id=183448
2036
2037         Reviewed by Michael Catanzaro.
2038
2039         Add methods to get a JSCValue for a WebKitDOMObject and to create a WebKitDOMNode from a JSCValue. Deprecate
2040         most of the GTK+ DOM bindings API and move the non-deprecated parts to glib dir to be exposed by WPE too.
2041
2042         * PlatformGTK.cmake:
2043         * PlatformWPE.cmake:
2044         * SourcesGTK.txt:
2045         * SourcesWPE.txt:
2046         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
2047         * WebProcess/InjectedBundle/API/glib/DOM/DOMObjectCache.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/DOMObjectCache.cpp.
2048         * WebProcess/InjectedBundle/API/glib/DOM/DOMObjectCache.h: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/DOMObjectCache.h.
2049         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMDocument.cpp: Added.
2050         (WebKit::kit):
2051         (WebKit::core):
2052         (WebKit::wrapDocument):
2053         (webkit_dom_document_class_init):
2054         (webkit_dom_document_init):
2055         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMDocumentPrivate.h: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentPrivate.h.
2056         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMElement.cpp: Added.
2057         (WebKit::kit):
2058         (WebKit::core):
2059         (WebKit::wrapElement):
2060         (webkit_dom_element_class_init):
2061         (webkit_dom_element_init):
2062         (webkit_dom_element_html_input_element_is_user_edited):
2063         (webkit_dom_element_html_input_element_get_auto_filled):
2064         (webkit_dom_element_html_input_element_set_auto_filled):
2065         (webkit_dom_element_html_input_element_set_editing_value):
2066         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMElementPrivate.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementPrivate.h.
2067         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMNode.cpp: Added.
2068         (_WebKitDOMNodePrivate::~_WebKitDOMNodePrivate):
2069         (WebKit::kit):
2070         (WebKit::core):
2071         (WebKit::wrapNode):
2072         (webkitDOMNodeConstructor):
2073         (webkitDOMNodeFinalize):
2074         (webkit_dom_node_init):
2075         (webkit_dom_node_class_init):
2076         (webkitDOMNodeSetCoreObject):
2077         (webkitDOMNodeGetCoreObject):
2078         (webkit_dom_node_for_js_value):
2079         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMNodePrivate.h: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodePrivate.h.
2080         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMObject.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMObject.cpp.
2081         (webkitDOMObjectSetProperty):
2082         (webkit_dom_object_class_init):
2083         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMPrivate.cpp: Added.
2084         (WebKit::wrap):
2085         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMPrivate.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/DOMObjectCache.h.
2086         * WebProcess/InjectedBundle/API/glib/WebKitFrame.cpp:
2087         (webkit_frame_get_js_value_for_dom_object):
2088         (webkit_frame_get_js_value_for_dom_object_in_script_world):
2089         * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
2090         (webkit_web_page_class_init):
2091         (webkitWebPageCreate):
2092         (webkit_web_page_get_dom_document):
2093         * WebProcess/InjectedBundle/API/gtk/DOM/GObjectEventListener.cpp:
2094         (WebKit::GObjectEventListener::handleEvent):
2095         * WebProcess/InjectedBundle/API/gtk/DOM/GObjectNodeFilterCondition.cpp:
2096         * WebProcess/InjectedBundle/API/gtk/DOM/GObjectXPathNSResolver.cpp:
2097         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.cpp:
2098         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.h:
2099         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlob.cpp:
2100         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlob.h:
2101         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.cpp:
2102         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.h:
2103         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.cpp:
2104         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.h:
2105         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.cpp:
2106         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.h:
2107         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.cpp:
2108         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.h:
2109         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.cpp:
2110         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.h:
2111         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.cpp:
2112         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.h:
2113         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp:
2114         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.h:
2115         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.cpp:
2116         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.h:
2117         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp:
2118         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.h:
2119         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.cpp:
2120         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.h:
2121         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.cpp:
2122         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.h:
2123         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.cpp:
2124         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.h:
2125         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.cpp:
2126         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.h:
2127         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
2128         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.h:
2129         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp:
2130         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.h:
2131         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp:
2132         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.h:
2133         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp.
2134         (webkitDOMDocumentDOMEventTargetInit):
2135         (webkitDOMDocumentInstallProperties):
2136         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.cpp:
2137         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.h:
2138         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.h:
2139         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementGtk.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp.
2140         (webkitDOMElementDOMEventTargetInit):
2141         (webkitDOMElementInstallProperties):
2142         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.cpp:
2143         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.h:
2144         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEventTarget.cpp:
2145         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEventTarget.h:
2146         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.cpp:
2147         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.h:
2148         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.cpp:
2149         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.h:
2150         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.cpp:
2151         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.h:
2152         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.cpp:
2153         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.h:
2154         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.cpp:
2155         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.h:
2156         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.cpp:
2157         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.h:
2158         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.cpp:
2159         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.h:
2160         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.cpp:
2161         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.h:
2162         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.cpp:
2163         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.h:
2164         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.cpp:
2165         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.h:
2166         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.cpp:
2167         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.h:
2168         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.cpp:
2169         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.h:
2170         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.cpp:
2171         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.h:
2172         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.cpp:
2173         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.h:
2174         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.cpp:
2175         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.h:
2176         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp:
2177         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.h:
2178         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.cpp:
2179         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.h:
2180         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.cpp:
2181         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.h:
2182         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.cpp:
2183         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.h:
2184         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.cpp:
2185         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.h:
2186         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.cpp:
2187         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.h:
2188         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.cpp:
2189         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.h:
2190         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.cpp:
2191         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.h:
2192         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.cpp:
2193         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.h:
2194         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.cpp:
2195         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.h:
2196         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.cpp:
2197         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.h:
2198         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.cpp:
2199         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.h:
2200         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.cpp:
2201         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.h:
2202         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
2203         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.h:
2204         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.cpp:
2205         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.h:
2206         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.cpp:
2207         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.h:
2208         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.cpp:
2209         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.h:
2210         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.cpp:
2211         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.h:
2212         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.cpp:
2213         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.h:
2214         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.cpp:
2215         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.h:
2216         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.cpp:
2217         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.h:
2218         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.cpp:
2219         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.h:
2220         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.cpp:
2221         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.h:
2222         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.cpp:
2223         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.h:
2224         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.cpp:
2225         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.h:
2226         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.cpp:
2227         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.h:
2228         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.cpp:
2229         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.h:
2230         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollection.cpp:
2231         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollection.h:
2232         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.cpp:
2233         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.h:
2234         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.cpp:
2235         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.h:
2236         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.cpp:
2237         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.h:
2238         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPrivate.cpp:
2239         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.cpp:
2240         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.h:
2241         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.cpp:
2242         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.h:
2243         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
2244         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.h:
2245         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.cpp:
2246         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.h:
2247         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.cpp:
2248         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.h:
2249         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.cpp:
2250         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.h:
2251         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.cpp:
2252         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.h:
2253         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.cpp:
2254         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.h:
2255         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.cpp:
2256         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.h:
2257         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.cpp:
2258         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.h:
2259         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.cpp:
2260         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.h:
2261         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.cpp:
2262         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.h:
2263         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.cpp:
2264         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.h:
2265         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEvent.cpp:
2266         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEvent.h:
2267         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.cpp:
2268         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.h:
2269         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEvent.cpp:
2270         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEvent.h:
2271         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.cpp:
2272         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.h:
2273         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.h:
2274         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeFilter.cpp:
2275         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeFilter.h:
2276         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeGtk.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.cpp.
2277         (webkitDOMNodeDOMEventTargetInit):
2278         (webkitDOMNodeInstallProperties):
2279         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIterator.cpp:
2280         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIterator.h:
2281         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeList.cpp:
2282         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeList.h:
2283         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMObject.h:
2284         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivateGtk.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivate.cpp.
2285         (WebKit::wrapNodeGtk):
2286         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivateGtk.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivate.h.
2287         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.cpp:
2288         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.h:
2289         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.cpp:
2290         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.h:
2291         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheet.cpp:
2292         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheet.h:
2293         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetList.cpp:
2294         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetList.h:
2295         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp:
2296         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.h:
2297         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalker.cpp:
2298         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalker.h:
2299         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEvent.cpp:
2300         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEvent.h:
2301         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.cpp:
2302         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.h:
2303         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpression.cpp:
2304         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpression.h:
2305         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathNSResolver.cpp:
2306         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathNSResolver.h:
2307         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.cpp:
2308         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.h:
2309         * WebProcess/InjectedBundle/API/gtk/DOM/docs/webkitdomgtk-4.0-sections.txt:
2310         * WebProcess/InjectedBundle/API/gtk/WebKitFrame.h:
2311         * WebProcess/InjectedBundle/API/wpe/DOM/WebKitDOMDefines.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentPrivate.h.
2312         * WebProcess/InjectedBundle/API/wpe/DOM/WebKitDOMDocument.h: Added.
2313         * WebProcess/InjectedBundle/API/wpe/DOM/WebKitDOMElement.h: Added.
2314         * WebProcess/InjectedBundle/API/wpe/DOM/WebKitDOMNode.h: Added.
2315         * WebProcess/InjectedBundle/API/wpe/DOM/WebKitDOMObject.h: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMObject.h.
2316         * WebProcess/InjectedBundle/API/wpe/DOM/webkitdom.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodePrivate.h.
2317         * WebProcess/InjectedBundle/API/wpe/WebKitFrame.h:
2318         * WebProcess/InjectedBundle/API/wpe/WebKitWebHitTestResult.h: Added.
2319         * WebProcess/InjectedBundle/API/wpe/WebKitWebPage.h:
2320         * WebProcess/InjectedBundle/API/wpe/WebKitWebProcessEnumTypes.cpp.template: Added.
2321         * WebProcess/InjectedBundle/API/wpe/WebKitWebProcessEnumTypes.h.template: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMObjectPrivate.h.
2322         * WebProcess/InjectedBundle/API/wpe/webkit-web-extension.h:
2323
2324 2018-03-26  Zan Dobersek  <zdobersek@igalia.com>
2325
2326         [CoordGraphics] Clean up CoordinatedGraphicsScene construct-time initializations
2327         https://bugs.webkit.org/show_bug.cgi?id=184002
2328
2329         Reviewed by Carlos Garcia Campos.
2330
2331         Move the CoordinatedGraphicsScene constant-expression initializations
2332         from constructor to the point of declaration.
2333
2334         Default the CoordinatedGraphicsScene destructor.
2335
2336         The m_scrollPosition member variable is unused in this class, while the
2337         similarly-named m_renderedContentsScrollPosition tracks scroll position
2338         of the scene. Remove the latter and use m_scrollPosition in its place.
2339
2340         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
2341         (WebKit::CoordinatedGraphicsScene::CoordinatedGraphicsScene):
2342         (WebKit::CoordinatedGraphicsScene::adjustPositionForFixedLayers):
2343         (WebKit::CoordinatedGraphicsScene::commitSceneState):
2344         (WebKit::CoordinatedGraphicsScene::~CoordinatedGraphicsScene): Deleted.
2345         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
2346
2347 2018-03-25  Michael Catanzaro  <mcatanzaro@igalia.com>
2348
2349         [GTK] WebKitWebProcessEnumTypes.h missing from webkit-web-extension.h
2350         https://bugs.webkit.org/show_bug.cgi?id=183998
2351
2352         Reviewed by Carlos Garcia Campos.
2353
2354         * WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h:
2355
2356 2018-03-25  Carlos Garcia Campos  <cgarcia@igalia.com>
2357
2358         [GTK] Unresolved type warnings when generating gir
2359         https://bugs.webkit.org/show_bug.cgi?id=183926
2360
2361         Reviewed by Michael Catanzaro.
2362
2363         Skip deprecated functions using JSC C API from introspection.
2364
2365         * UIProcess/API/glib/WebKitJavascriptResult.cpp:
2366         * UIProcess/API/glib/WebKitWebView.cpp:
2367         * WebProcess/InjectedBundle/API/glib/WebKitFrame.cpp:
2368
2369 2018-03-25  Commit Queue  <commit-queue@webkit.org>
2370
2371         Unreviewed, rolling out r229954.
2372         https://bugs.webkit.org/show_bug.cgi?id=184000
2373
2374         Caused many layout tests to crash on Apple High Sierra,
2375         Sierra, iOS Simulator and GTK Linux Debug test bots (Requested
2376         by dydz on #webkit).
2377
2378         Reverted changeset:
2379
2380         "Use SecurityOriginData more consistently in Service Worker
2381         code"
2382         https://bugs.webkit.org/show_bug.cgi?id=183969
2383         https://trac.webkit.org/changeset/229954
2384
2385 2018-03-23  Brian Burg  <bburg@apple.com>
2386
2387         Web Automation: remove unnecessary member variable WebAutomationSession
2388         https://bugs.webkit.org/show_bug.cgi?id=183971
2389
2390         Reviewed by Timothy Hatcher.
2391
2392         The concept of the "active" browsing context is something in the WebDriver
2393         specification, but we were a bit too literal when first implementing this.
2394         There's no actual need for this on the browser side since most commands
2395         require implicitly switching to the target window passed in with the
2396         Automation command. The driver, however, still needs to track the current
2397         browsing context and current top-level browsing context.
2398
2399         For returning whether a browsing context is active,  we can just look at
2400         the page's activity state to know whether the page is active or not. For
2401         a normal browser, only one page is going to be visible and focused at a time.
2402
2403         * UIProcess/Automation/WebAutomationSession.h:
2404         * UIProcess/Automation/WebAutomationSession.cpp:
2405         (WebKit::WebAutomationSession::buildBrowsingContextForPage):
2406         Consult the page's activity state to determine whether it's active.
2407
2408         (WebKit::WebAutomationSession::createBrowsingContext):
2409         (WebKit::WebAutomationSession::closeBrowsingContext):
2410         (WebKit::WebAutomationSession::switchToBrowsingContext):
2411         (WebKit::WebAutomationSession::handleRunOpenPanel):
2412         Stop reading and writing the current browsing context handle.
2413
2414         * UIProcess/WebPageProxy.h:
2415         (WebKit::WebPageProxy::isViewFocused const):
2416         (WebKit::WebPageProxy::isViewWindowActive const):
2417         Add new accessor.
2418
2419 2018-03-25  Tim Horton  <timothy_horton@apple.com>
2420
2421         Add and adopt ENABLE(AIRPLAY_PICKER)
2422         https://bugs.webkit.org/show_bug.cgi?id=183992
2423
2424         Reviewed by Daniel Bates.
2425
2426         * UIProcess/ios/WKContentViewInteraction.h:
2427         * UIProcess/ios/WKContentViewInteraction.mm:
2428         (-[WKContentView _showPlaybackTargetPicker:fromRect:]):
2429         * UIProcess/ios/forms/WKAirPlayRoutePicker.h:
2430         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
2431
2432 2018-03-25  Tim Horton  <timothy_horton@apple.com>
2433
2434         Move WKAnimationDelegate to its own header
2435         https://bugs.webkit.org/show_bug.cgi?id=183976
2436         <rdar://problem/38822299>
2437
2438         Reviewed by Dan Bernstein.
2439
2440         * Shared/RemoteLayerTree/WKAnimationDelegate.h: Added.
2441         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
2442         * WebKit.xcodeproj/project.pbxproj:
2443         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
2444         RemoteLayerTreeHost uses a forward declaration of WKAnimationDelegate,
2445         so we're just getting lucky that an -invalidate method exists on
2446         some other object. Instead, move WKAnimationDelegate to its own
2447         header, and include it in the places we use it.
2448
2449 2018-03-24  Tim Horton  <timothy_horton@apple.com>
2450
2451         Adopt WK_PLATFORM_NAME in WebKit
2452         https://bugs.webkit.org/show_bug.cgi?id=183978
2453
2454         Reviewed by Dan Bernstein.
2455
2456         * Configurations/WebKit.xcconfig:
2457         * WebKit.xcodeproj/project.pbxproj:
2458         * mac/MigrateHeadersFromWebKitLegacy.make:
2459         * mac/postprocess-framework-headers.sh:
2460
2461 2018-03-24  Tim Horton  <timothy_horton@apple.com>
2462
2463         Ignore sandbox_init_with_parameters deprecation warnings
2464         https://bugs.webkit.org/show_bug.cgi?id=183979
2465
2466         Reviewed by Dan Bernstein.
2467
2468         * Shared/ios/ChildProcessIOS.mm:
2469         (WebKit::ChildProcess::initializeSandbox):
2470
2471 2018-03-24  Chris Dumez  <cdumez@apple.com>
2472
2473         Use SecurityOriginData more consistently in Service Worker code
2474         https://bugs.webkit.org/show_bug.cgi?id=183969
2475
2476         Reviewed by Darin Adler.
2477
2478         Use SecurityOriginData more consistently in Service Worker code to avoid constructing
2479         SecurityOrigin objects unnecessarily.
2480
2481         * NetworkProcess/NetworkResourceLoadParameters.cpp:
2482         (WebKit::NetworkResourceLoadParameters::encode const):
2483         * Shared/API/c/WKSecurityOriginRef.cpp:
2484         (WKSecurityOriginCopyDatabaseIdentifier):
2485         * StorageProcess/ServiceWorker/WebSWOriginStore.cpp:
2486         (WebKit::WebSWOriginStore::addToStore):
2487         (WebKit::WebSWOriginStore::removeFromStore):
2488         * StorageProcess/ServiceWorker/WebSWOriginStore.h:
2489         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2490         (WebKit::WebSWServerConnection::scheduleJobInServer):
2491         (WebKit::WebSWServerConnection::registerServiceWorkerClient):
2492         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
2493         (WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
2494         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
2495         * StorageProcess/StorageProcess.cpp:
2496         (WebKit::StorageProcess::connectionToContextProcessWasClosed):
2497         (WebKit::StorageProcess::needsServerToContextConnectionForOrigin const):
2498         (WebKit::StorageProcess::createStorageToWebProcessConnection):
2499         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
2500         (WebKit::StorageProcess::serverToContextConnectionForOrigin):
2501         (WebKit::StorageProcess::createServerToContextConnection):
2502         (WebKit::StorageProcess::swContextConnectionMayNoLongerBeNeeded):
2503         * StorageProcess/StorageProcess.h:
2504         * UIProcess/API/APIFrameInfo.cpp:
2505         (API::FrameInfo::create):
2506         * UIProcess/API/C/WKApplicationCacheManager.cpp:
2507         (WKApplicationCacheManagerDeleteEntriesForOrigin):
2508         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
2509         (WKKeyValueStorageManagerDeleteEntriesForOrigin):
2510         * UIProcess/API/C/WKResourceCacheManager.cpp:
2511         (WKResourceCacheManagerClearCacheForOrigin):
2512         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2513         (WKWebsiteDataStoreRemoveFetchCacheForOrigin):
2514         (WKWebsiteDataStoreGetFetchCacheSizeForOrigin):
2515         * UIProcess/ServiceWorkerProcessProxy.cpp:
2516         (WebKit::ServiceWorkerProcessProxy::create):
2517         (WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
2518         (WebKit::ServiceWorkerProcessProxy::getLaunchOptions):
2519         * UIProcess/ServiceWorkerProcessProxy.h:
2520         * UIProcess/Storage/StorageProcessProxy.cpp:
2521         (WebKit::StorageProcessProxy::getStorageProcessConnection):
2522         * UIProcess/WebProcessPool.cpp:
2523         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
2524         (WebKit::WebProcessPool::disconnectProcess):
2525         (WebKit::WebProcessPool::updateProcessAssertions):
2526         * UIProcess/WebProcessPool.h:
2527         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2528         (WebKit::WebsiteDataStore::fetchDataAndApply):
2529         * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
2530         (WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation):
2531         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2532         (WKBundlePageCopyOriginsWithApplicationCache):
2533         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
2534         (WebKit::UserMediaPermissionRequestManager::sendUserMediaRequest):
2535         (WebKit::UserMediaPermissionRequestManager::enumerateMediaDevices):
2536         * WebProcess/Storage/WebSWClientConnection.cpp:
2537         (WebKit::WebSWClientConnection::registerServiceWorkerClient):
2538         (WebKit::WebSWClientConnection::matchRegistration):
2539         (WebKit::WebSWClientConnection::whenRegistrationReady):
2540         (WebKit::WebSWClientConnection::getRegistrations):
2541         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2542         (WebKit::WebChromeClient::exceededDatabaseQuota):
2543         (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
2544         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2545         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2546         * WebProcess/WebProcess.cpp:
2547         (WebKit::WebProcess::fetchWebsiteData):
2548         * WebProcess/WebStorage/StorageAreaImpl.cpp:
2549         (WebKit::StorageAreaImpl::securityOrigin const):
2550         * WebProcess/WebStorage/StorageAreaImpl.h:
2551         * WebProcess/WebStorage/StorageAreaMap.cpp:
2552         (WebKit::StorageAreaMap::StorageAreaMap):
2553         (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
2554         (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
2555         * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
2556         (WebKit::StorageNamespaceImpl::didDestroyStorageAreaMap):
2557
2558 2018-03-24  Tim Horton  <timothy_horton@apple.com>
2559
2560         Fix the !ENABLE(MEDIA_STREAM) build
2561         https://bugs.webkit.org/show_bug.cgi?id=183977
2562
2563         Reviewed by Wenson Hsieh.
2564
2565         * UIProcess/Cocoa/UIDelegate.mm:
2566         (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
2567         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
2568         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2569         * WebProcess/cocoa/UserMediaCaptureManager.messages.in:
2570
2571 2018-03-24  Tim Horton  <timothy_horton@apple.com>
2572
2573         WKFileUploadPanel shouldn't depend on WebKitLegacy
2574         https://bugs.webkit.org/show_bug.cgi?id=183981
2575
2576         Reviewed by Wenson Hsieh.
2577
2578         * UIProcess/ios/forms/WKFileUploadPanel.mm:
2579         (-[WKFileUploadPanel _uploadItemForImageData:imageName:successBlock:failureBlock:]):
2580         Just use the underlying WebCore function instead of the
2581         unnecessary NSFileManager category method.
2582
2583 2018-03-23  Tim Horton  <timothy_horton@apple.com>
2584
2585         Fix the build with no pasteboard
2586         https://bugs.webkit.org/show_bug.cgi?id=183973
2587
2588         Reviewed by Dan Bernstein.
2589
2590         * Configurations/FeatureDefines.xcconfig:
2591
2592 2018-03-23  Megan Gardner  <megan_gardner@apple.com>
2593
2594         Enable unified text selection in select cases for gradual testing
2595         https://bugs.webkit.org/show_bug.cgi?id=183967
2596         <rdar://problem/38815328>
2597
2598         Reviewed by Tim Horton.
2599         
2600         Enable in select places for a more gradual switch, as this is a big change and we want to make sure
2601         it works before switching completely.
2602
2603         * UIProcess/ios/WKContentViewInteraction.mm:
2604         (-[WKContentView useSelectionAssistantWithGranularity:]):
2605
2606 2018-03-23  John Wilander  <wilander@apple.com>
2607
2608         Resource Load Statistics: Pick up ITP debug mode flag from defaults
2609         https://bugs.webkit.org/show_bug.cgi?id=183956
2610         <rdar://problem/38559574>
2611
2612         Reviewed by Brent Fulgham.
2613
2614         * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
2615         (WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):
2616
2617 2018-03-23  Wenson Hsieh  <wenson_hsieh@apple.com>
2618
2619         [Extra zoom mode] Adopt list view controller UI for select menus
2620         https://bugs.webkit.org/show_bug.cgi?id=183944
2621         <rdar://problem/38799062>
2622
2623         Reviewed by Tim Horton.
2624
2625         Move UIProcess/WKSelectMenuListViewController.* to UIProcess/ios/forms, where it was intended to go.
2626
2627         * UIProcess/ios/forms/WKSelectMenuListViewController.h: Renamed from Source/WebKit/UIProcess/WKSelectMenuListViewController.h.
2628         * UIProcess/ios/forms/WKSelectMenuListViewController.mm: Renamed from Source/WebKit/UIProcess/WKSelectMenuListViewController.mm.
2629         * WebKit.xcodeproj/project.pbxproj:
2630
2631 2018-03-23  Chris Dumez  <cdumez@apple.com>
2632
2633         Promptly terminate service worker processes when they are no longer needed
2634         https://bugs.webkit.org/show_bug.cgi?id=183873
2635         <rdar://problem/38676995>
2636
2637         Reviewed by Youenn Fablet.
2638
2639         The StorageProcess now keeps track of service worker clients for each security
2640         origin. When there is no longer any clients for a given security origin, the
2641         StorageProcess asks the service worker process for the given origin to terminate
2642         and severs its connection to it.
2643
2644         * Shared/Storage/StorageProcessCreationParameters.h:
2645         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
2646         (WebKit::WebSWServerToContextConnection::connectionMayNoLongerBeNeeded):
2647         (WebKit::WebSWServerToContextConnection::terminate):
2648         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
2649         * StorageProcess/StorageProcess.cpp:
2650         (WebKit::StorageProcess::connectionToContextProcessWasClosed):
2651         (WebKit::StorageProcess::needsServerToContextConnectionForOrigin const):
2652         (WebKit::StorageProcess::initializeWebsiteDataStore):
2653         (WebKit::StorageProcess::swServerForSession):
2654         (WebKit::StorageProcess::swContextConnectionMayNoLongerBeNeeded):
2655         (WebKit::StorageProcess::disableServiceWorkerProcessTerminationDelay):
2656         * StorageProcess/StorageProcess.h:
2657         * StorageProcess/StorageProcess.messages.in:
2658         * UIProcess/API/Cocoa/WKProcessPool.mm:
2659         (-[WKProcessPool _disableServiceWorkerProcessTerminationDelay]):
2660         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2661         * UIProcess/WebProcessPool.cpp:
2662         (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
2663         (WebKit::WebProcessPool::disableServiceWorkerProcessTerminationDelay):
2664         * UIProcess/WebProcessPool.h:
2665         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2666         (WebKit::WebSWContextManagerConnection::terminateProcess):
2667         * WebProcess/Storage/WebSWContextManagerConnection.h:
2668         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
2669
2670 2018-03-23  Brady Eidson  <beidson@apple.com>
2671
2672         Go to back/forward list items after a process-swapped navigation.
2673         <rdar://problem/38690544> and https://bugs.webkit.org/show_bug.cgi?id=183920
2674
2675         Reviewed by Andy Estes.
2676
2677         This takes the initial work of "process swap a normal navigation" and extends it to
2678         process swapping for back/forward item navigations.
2679
2680         * Scripts/webkit/messages.py:
2681
2682         Make sure state objects are serialized to the UI Process back/forward list items, as otherwise
2683         they will be lost in process-swap scenarios:
2684         * Shared/SessionState.cpp:
2685         (WebKit::PageState::encode const):
2686         (WebKit::PageState::decode):
2687         * Shared/SessionState.h:
2688
2689         Make a new variant of APINavigation specifically for back/forward list items.
2690         * UIProcess/API/APINavigation.cpp:
2691         (API::Navigation::Navigation):
2692         (API::Navigation::loggingURL const):
2693         * UIProcess/API/APINavigation.h:
2694         (API::Navigation::create):
2695         (API::Navigation::backForwardListItem):
2696         (API::Navigation::backForwardFrameLoadType const):
2697
2698         * UIProcess/API/C/WKPage.cpp:
2699         (WKPageGoToBackForwardListItem):
2700
2701         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
2702         (-[WKBrowsingContextController goToBackForwardListItem:]):
2703
2704         * UIProcess/API/Cocoa/WKWebView.mm:
2705         (-[WKWebView goToBackForwardListItem:]):
2706
2707         * UIProcess/WebNavigationState.cpp:
2708         (WebKit::WebNavigationState::createLoadRequestNavigation):
2709         (WebKit::WebNavigationState::createBackForwardNavigation):
2710         * UIProcess/WebNavigationState.h:
2711
2712         * UIProcess/WebPageProxy.cpp:
2713         (WebKit::WebPageProxy::reattachToWebProcessForReload):
2714         (WebKit::WebPageProxy::reattachToWebProcessWithItem):
2715         (WebKit::WebPageProxy::goForward):
2716         (WebKit::WebPageProxy::goBack):
2717         (WebKit::WebPageProxy::goToBackForwardItem):
2718         (WebKit::WebPageProxy::receivedPolicyDecision):
2719         (WebKit::WebPageProxy::continueNavigationInNewProcess): Handle back/forward navigations differently than others.
2720         (WebKit::WebPageProxy::restoreFromSessionState):
2721         * UIProcess/WebPageProxy.h:
2722
2723         * UIProcess/WebProcessProxy.cpp:
2724         (WebKit::WebProcessProxy::addOrUpdateBackForwardItem): Renamed from "addBackForwardItem" for clarity
2725         (WebKit::WebProcessProxy::addBackForwardItem): Deleted.
2726         * UIProcess/WebProcessProxy.h:
2727         * UIProcess/WebProcessProxy.messages.in:
2728
2729         * UIProcess/ios/ViewGestureControllerIOS.mm:
2730         (WebKit::ViewGestureController::endSwipeGesture):
2731
2732         * UIProcess/mac/ViewGestureControllerMac.mm:
2733         (WebKit::ViewGestureController::endSwipeGesture):
2734
2735         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
2736         (WebKit::toPageState):
2737         (WebKit::toHistoryItem):
2738
2739         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
2740         (WebKit::updateBackForwardItem):
2741
2742         * WebProcess/WebPage/WebPage.cpp:
2743         (WebKit::WebPage::goToBackForwardItem): Combined "goBack" and "goForward" with this method,
2744           passing the appropriate FrameLoadType around as needed to remember the specific type.
2745         (WebKit::WebPage::goForward): Deleted.
2746         (WebKit::WebPage::goBack): Deleted.
2747         * WebProcess/WebPage/WebPage.h:
2748         * WebProcess/WebPage/WebPage.messages.in:
2749
2750 2018-03-23  Megan Gardner  <megan_gardner@apple.com>
2751
2752         Don't use the presence of a textSelectionAssistant as a proxy for if we are in content editable.
2753         https://bugs.webkit.org/show_bug.cgi?id=183804
2754
2755         Reviewed by Tim Horton.
2756
2757         We need to stop using the presence of a textSelectionAssistant as a proxy for if we are selecting in a content editable
2758         or not. As we are planning on switching to only using a textSelectionAssistant for selection, these checks need to 
2759         be more direct in checking what we actually need to know i.e. are we selecting in a content editable.
2760
2761         * Platform/spi/ios/UIKitSPI.h:
2762         * UIProcess/ios/WKContentViewInteraction.mm:
2763         (hasAssistedNode):
2764         (-[WKContentView inputView]):
2765         (-[WKContentView _selectionClipRect]):
2766         (-[WKContentView gestureRecognizer:canBePreventedByGestureRecognizer:]):
2767         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
2768         (-[WKContentView gestureRecognizerShouldBegin:]):
2769         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
2770         (-[WKContentView webSelectionRects]):
2771         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
2772         (-[WKContentView _autofillContext]):
2773
2774 2018-03-23  Youenn Fablet  <youenn@apple.com>
2775
2776         WebProcessPool should not ask to register all clients for each service worker process creation
2777         https://bugs.webkit.org/show_bug.cgi?id=183941
2778
2779         Reviewed by Chris Dumez.
2780
2781         Call registerServiceWorkerClients when there is no service worker process.
2782         Update service worker clients to register all of them no matter the session ID.
2783
2784         * UIProcess/WebProcessPool.cpp:
2785         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
2786         * WebProcess/WebProcess.cpp:
2787         (WebKit::WebProcess::registerServiceWorkerClients):
2788         * WebProcess/WebProcess.h:
2789         * WebProcess/WebProcess.messages.in:
2790
2791 2018-03-23  Wenson Hsieh  <wenson_hsieh@apple.com>
2792
2793         [Extra zoom mode] Adopt list view controller UI for select menus
2794         https://bugs.webkit.org/show_bug.cgi?id=183944
2795         <rdar://problem/38799062>
2796
2797         Reviewed by Andy Estes.
2798
2799         Rename WKSelectMenuViewController to WKSelectMenuListViewController, and also rename the relevant
2800         WebKitAdditions harness files. See corresponding changes for more details.
2801
2802         * UIProcess/WKSelectMenuListViewController.h: Renamed from Source/WebKit/UIProcess/ios/forms/WKSelectMenuViewController.h.
2803         * UIProcess/WKSelectMenuListViewController.mm: Renamed from Source/WebKit/UIProcess/ios/forms/WKSelectMenuViewController.mm.
2804         * UIProcess/ios/WKContentViewInteraction.h:
2805         * UIProcess/ios/WKContentViewInteraction.mm:
2806         (-[WKContentView presentSelectMenuViewController:]):
2807         (-[WKContentView dismissSelectMenuViewController:]):
2808         (-[WKContentView selectMenu:didSelectItemAtIndex:]):
2809         (-[WKContentView numberOfItemsInSelectMenu:]):
2810         (-[WKContentView selectMenu:displayTextForItemAtIndex:]):
2811         (-[WKContentView selectMenu:didCheckItemAtIndex:checked:]):
2812         (-[WKContentView selectMenuUsesMultipleSelection:]):
2813         (-[WKContentView selectMenu:hasSelectedOptionAtIndex:]):
2814         (-[WKContentView _wheelChangedWithEvent:]):
2815
2816         Overriding wheel events and re-dispatching them is no longer needed after r229437, so we can just remove special
2817         handling for select menus here.
2818
2819         (-[WKContentView didCancelSelectionInSelectMenu:]): Deleted.
2820         (-[WKContentView selectMenuSupportsMultipleSelection:]): Deleted.
2821         (-[WKContentView selectMenu:hasCheckedOptionAtIndex:]): Deleted.
2822         (-[WKContentView startingIndexForSelectMenu:]): Deleted.
2823
2824         The starting index for a select menu is no longer relevant when using list view controllers for input, so we can
2825         just remove this delegate hook altogether.
2826
2827         * WebKit.xcodeproj/project.pbxproj:
2828
2829 2018-03-23  Youenn Fablet  <youenn@apple.com>
2830
2831         CacheStorage::Caches should clear m_caches when clearing its representation even though it is not yet initialized
2832         https://bugs.webkit.org/show_bug.cgi?id=183945
2833
2834         Reviewed by Chris Dumez.
2835
2836         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2837         (WebKit::CacheStorage::Caches::clearMemoryRepresentation):
2838         In case we clear Caches in the middle of the initialization, m_caches might not be empty
2839         but m_isInitialized is not yet set to true since we are computing the Caches size.
2840         Update the assertion and clear m_caches in that case.
2841
2842 2018-03-23  David Kilzer  <ddkilzer@apple.com>
2843
2844         Stop using dispatch_set_target_queue()
2845         <https://webkit.org/b/183908>
2846         <rdar://problem/33553533>
2847
2848         Reviewed by Daniel Bates.
2849
2850         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
2851         (WebKit::NetworkCache::IOChannel::IOChannel): Remove the call to
2852         dispatch_set_target_queue() since this is handled in the
2853         dispatch_io_create() call above.
2854
2855 2018-03-23  Youenn Fablet  <youenn@apple.com>
2856
2857         CacheStorage::Engine should not ref itself when hopping to a background thread
2858         https://bugs.webkit.org/show_bug.cgi?id=183925
2859         <rdar://problem/38580483>
2860
2861         Reviewed by Chris Dumez.
2862
2863         Add support for weak pointers to CacheStorage Engine.
2864         Use weak pointer when hopping to background threads.
2865         Store callbacks in CacheStorage::Engine maps to keep them being destroyed in the main thread only.
2866         Made some callbacks CompletionHandler as a bonus.
2867
2868         Made sure to use just one Engine for all private sessions.
2869
2870         * NetworkProcess/cache/CacheStorageEngine.cpp:
2871         (WebKit::CacheStorage::Engine::~Engine):
2872         (WebKit::CacheStorage::Engine::from):
2873         (WebKit::CacheStorage::Engine::initialize):
2874         (WebKit::CacheStorage::Engine::writeFile):
2875         (WebKit::CacheStorage::Engine::readFile):
2876         * NetworkProcess/cache/CacheStorageEngine.h:
2877         (WebKit::CacheStorage::Engine::weakPtrFactory):
2878
2879 2018-03-23  Ryan Haddad  <ryanhaddad@apple.com>
2880
2881         Unreviewed build fix.
2882
2883         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2884
2885 2018-03-23  Miguel Gomez  <magomez@igalia.com>
2886
2887         [GTK][WPE] Avoid software color conversion inside BitmapTextureGL
2888         https://bugs.webkit.org/show_bug.cgi?id=183892
2889
2890         Remove the UpdateContentsFlag parameter when calling BitmapTexture::updateContents().
2891
2892         Reviewed by Žan Doberšek.
2893
2894         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
2895         (WebKit::CoordinatedBackingStoreTile::swapBuffers):
2896
2897 2018-03-23  Michael Catanzaro  <mcatanzaro@igalia.com>
2898
2899         [WPE][GTK] Fix -Wswitch warnings after r229778
2900         https://bugs.webkit.org/show_bug.cgi?id=183927
2901
2902         Reviewed by Carlos Garcia Campos.
2903
2904         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
2905         (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse): Log a warning if Suspend is
2906         received as a PolicyAction
2907         * UIProcess/API/glib/WebKitNavigationClient.cpp: Ignore the ProcessSwap termination reason,
2908         which should be invisible to WebKit clients
2909
2910 2018-03-22  Chris Dumez  <cdumez@apple.com>
2911
2912         Include security origin in the service worker process name
2913         https://bugs.webkit.org/show_bug.cgi?id=183913
2914
2915         Reviewed by Youenn Fablet.
2916
2917         Include security origin in the service worker process name to facilitate debugging. This way, we
2918         can differentiate which service worker process is used for which origin in activity monitor.
2919
2920         * Shared/ChildProcess.h:
2921         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
2922         (WebKit::XPCServiceInitializerDelegate::getExtraInitializationData):
2923         * UIProcess/ServiceWorkerProcessProxy.cpp:
2924         (WebKit::ServiceWorkerProcessProxy::getLaunchOptions):
2925         * WebProcess/cocoa/WebProcessCocoa.mm:
2926         (WebKit::WebProcess::initializeProcessName):
2927
2928 2018-03-22  Michael Catanzaro  <mcatanzaro@igalia.com>
2929
2930         Unreviewed, silence unused variable warning
2931
2932         * UIProcess/WebPageProxy.cpp:
2933         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2934
2935 2018-03-22  Dan Bernstein  <mitz@apple.com>
2936
2937         WKWebView doesn’t expose its spellCheckerDocumentTag
2938         https://bugs.webkit.org/show_bug.cgi?id=183797
2939         <rdar://problem/38678089>
2940
2941         Reviewed by Tim Horton.
2942
2943         * UIProcess/API/Cocoa/WKWebView.mm:
2944         (-[WKWebView _spellCheckerDocumentTag]): Added this getter which calls through to the WebViewImpl.
2945         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared _spellCheckerDocumentTag property.
2946
2947 2018-03-22  Chris Dumez  <cdumez@apple.com>
2948
2949         Use the same SWServer for all ephemeral sessions
2950         https://bugs.webkit.org/show_bug.cgi?id=183921
2951         <rdar://problem/36873075>
2952
2953         Reviewed by Youenn Fablet.
2954
2955         Use the same SWServer for all ephemeral sessions. SWServers never go away and we create
2956         one per sessionID. When browsing doing private browsing in Safari (and other fetching
2957         favorite icons), the sessionID is ephemeral and keeps changing. This means that we kept
2958         constructing new SWServers that would never go away. Each SWServer has a thread so we
2959         would eventually hit the thread limit for the storage process.
2960
2961         * StorageProcess/StorageProcess.cpp:
2962         (WebKit::StorageProcess::swServerForSession):
2963
2964 2018-03-22  Michael Catanzaro  <mcatanzaro@igalia.com>
2965
2966         Unreviewed, fix format string warnings in service worker code
2967
2968         On Linux x86_64, uint64_t is unsigned long, not unsigned long long.
2969
2970         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2971         (WebKit::WebSWServerConnection::startFetch):
2972         (WebKit::WebSWServerConnection::didFinishFetch):
2973         (WebKit::WebSWServerConnection::didFailFetch):
2974         (WebKit::WebSWServerConnection::didNotHandleFetch):
2975
2976 2018-03-22  Daniel Bates  <dabates@apple.com>
2977
2978         Expose SchemeRegistry::registerAsCanDisplayOnlyIfCanRequest() as WebKit SPI
2979         https://bugs.webkit.org/show_bug.cgi?id=183907
2980         <rdar://problem/38759127>
2981
2982         Reviewed by Alex Christensen.
2983
2984         Adds both modern Objective-C SPI and C SPI to allow an embedding client to register a scheme
2985         whose content should be displayed/loaded if and only if it can be requested. Disregarding an
2986         app that enables universal access, by using this SPI WebKit will refuse to display cross-origin
2987         content for the registered schemes.
2988
2989         We need to add C SPI for embedding clients that have not transitioned to the modern Objective-
2990         C API/SPI.
2991
2992         * Shared/WebProcessCreationParameters.cpp:
2993         (WebKit::WebProcessCreationParameters::encode const):
2994         (WebKit::WebProcessCreationParameters::decode):
2995         * Shared/WebProcessCreationParameters.h:
2996         * UIProcess/API/C/WKContext.cpp:
2997         (WKContextRegisterURLSchemeAsCanDisplayOnlyIfCanRequest):
2998         * UIProcess/API/C/WKContextPrivate.h:
2999         * UIProcess/API/Cocoa/WKProcessPool.mm:
3000         (-[WKProcessPool _registerURLSchemeAsCanDisplayOnlyIfCanRequest:]):
3001         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
3002         * UIProcess/WebProcessPool.cpp:
3003         (WebKit::WebProcessPool::initializeNewWebProcess):
3004         (WebKit::WebProcessPool::registerURLSchemeAsCanDisplayOnlyIfCanRequest):
3005         * UIProcess/WebProcessPool.h:
3006         * WebProcess/WebProcess.cpp:
3007         (WebKit::WebProcess::initializeWebProcess):
3008         (WebKit::WebProcess::registerURLSchemeAsCanDisplayOnlyIfCanRequest const):
3009         * WebProcess/WebProcess.h:
3010         * WebProcess/WebProcess.messages.in:
3011
3012 2018-03-22  Tim Horton  <timothy_horton@apple.com>
3013
3014         Improve readability of WebCore's OTHER_LDFLAGS
3015         https://bugs.webkit.org/show_bug.cgi?id=183909
3016         <rdar://problem/38760992>
3017
3018         Reviewed by Dan Bernstein.
3019
3020         * Configurations/Base.xcconfig:
3021         * Configurations/FeatureDefines.xcconfig:
3022
3023 2018-03-22  Zan Dobersek  <zdobersek@igalia.com>
3024
3025         [TexMap] Make TextureMapperContextAttributes thread-specific
3026         https://bugs.webkit.org/show_bug.cgi?id=183895
3027
3028         Reviewed by Carlos Garcia Campos.
3029
3030         CoordinatedGraphicsScene, as an implementor of the
3031         TextureMapperPlatformLayerProxy::Compositor interface, doesn't have to
3032         implement the texmapGL() method anymore.
3033
3034         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
3035         (WebKit::CoordinatedGraphicsScene::onNewBufferAvailable):
3036         (WebKit::CoordinatedGraphicsScene::texmapGL): Deleted.
3037         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
3038
3039 2018-03-21  Frederic Wang  <fwang@igalia.com>
3040
3041         Unreviewed, update comment added in r229801.
3042
3043         * WebProcess/WebPage/ios/FindControllerIOS.mm:
3044         (WebKit::FindController::didFindString): Remove "On Mobile" and mention bug 183889.
3045
3046 2018-03-21  Chris Dumez  <cdumez@apple.com>
3047
3048         Regression(r229831): ProcessSwap.Basic API test is crashing
3049         https://bugs.webkit.org/show_bug.cgi?id=183884
3050
3051         Reviewed by Brady Eidson.
3052
3053         This code should only be called for navigation policy decisions.
3054         It used to work without this check because of an early return, which
3055         was dropped in r229831.
3056
3057         * UIProcess/WebPageProxy.cpp:
3058         (WebKit::WebPageProxy::receivedPolicyDecision):
3059
3060 2018-03-21  Wenson Hsieh  <wenson_hsieh@apple.com>
3061
3062         [Extra zoom mode] Add new SPI hooks for clients to vend an input session context view
3063         https://bugs.webkit.org/show_bug.cgi?id=183866
3064         <rdar://problem/38692256>
3065
3066         Reviewed by Tim Horton.
3067
3068         Add new SPI hooks to _WKInputDelegate allowing internal clients to provide a view that gives additional context
3069         when editing form controls, on top of the default label or placeholder text displayed by WebKit. The height
3070         delegate is invoked first, giving the client an opportunity to lay out the context view to fit the given size;
3071         the actual view is then queried.
3072
3073         If the view changes, clients may tell WebKit to reload the context view via SPI on WKFormInputSession; this call
3074         to reload is plumbed through to the currently presented list view controller (at the moment, this is only the
3075         text input list view controller).
3076
3077         * UIProcess/API/Cocoa/_WKFormInputSession.h:
3078         * UIProcess/API/Cocoa/_WKInputDelegate.h:
3079
3080         Add the new SPI hooks, described above.
3081
3082         * UIProcess/ios/WKContentViewInteraction.h:
3083         * UIProcess/ios/WKContentViewInteraction.mm:
3084         (-[WKFormInputSession reloadFocusedElementContextView]):
3085
3086         Plumb the context view reload hook through WKContentView to WKTextInputListViewController.
3087
3088         (-[WKContentView setupInteraction]):
3089         (-[WKContentView _stopAssistingNode]):
3090         (-[WKContentView reloadContextViewForPresentedListViewController]):
3091         (-[WKContentView focusedFormControllerDidUpdateSuggestions:]):
3092
3093         Slight tweak to only reload text suggestions if we are not blurring the focused element. Without this extra
3094         condition, the list view controller's inner table view would get reloaded when the form input session's text
3095         suggestions are set to nil when the list view controller is dismissed, causing a visible stutter in the
3096         dismissal animation of view controller.
3097
3098 2018-03-21  Chris Dumez  <cdumez@apple.com>
3099
3100         WebKitTestRunner crashed in com.apple.WebKit: WebKit::WebProcessPool::terminateServiceWorkerProcesses
3101         https://bugs.webkit.org/show_bug.cgi?id=183875
3102
3103         Reviewed by Brent Fulgham.
3104
3105         Protect |this| while we're iterating over m_serviceWorkerProcesses and terminating
3106         each service worker process. It is possible for the WebProcess pool to get destroyed
3107         as a result of terminating a service worker process.
3108
3109         This change is covered by layout tests that are currently crashing on the ASAN bots.
3110
3111         * UIProcess/WebProcessPool.cpp:
3112         (WebKit::WebProcessPool::terminateServiceWorkerProcesses):
3113
3114 2018-03-21  Eric Carlson  <eric.carlson@apple.com>
3115
3116         Fix typo in inactive media stream timeout default value
3117         https://bugs.webkit.org/show_bug.cgi?id=183872
3118         <rdar://problem/38723903>
3119
3120         Reviewed by Jer Noble.
3121
3122         * Shared/WebPreferences.yaml: Fix typo.
3123         * Shared/WebPreferencesDefaultValues.h: Ditto.
3124
3125 2018-03-21  Chris Dumez  <cdumez@apple.com>
3126
3127         Make policy decisions asynchronous
3128         https://bugs.webkit.org/show_bug.cgi?id=180568
3129         <rdar://problem/37131297>
3130
3131         Reviewed by Alex Christensen.
3132
3133         Get rid of synchronous IPC and synchronous code paths for policy delegates.
3134         Policy decisions are now all made asynchronously and rely on asynchronous
3135         IPC.
3136
3137         This code change is based on work by Alex Christensen.
3138
3139         * UIProcess/WebPageProxy.cpp:
3140         (WebKit::WebPageProxy::receivedPolicyDecision):
3141         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
3142         (WebKit::WebPageProxy::decidePolicyForResponse):
3143         * UIProcess/WebPageProxy.h:
3144         * UIProcess/WebPageProxy.messages.in:
3145         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3146         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
3147         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
3148
3149 2018-03-21  Chris Dumez  <cdumez@apple.com>
3150
3151         ScrollViewInsetTests.RestoreInitialContentOffsetAfterCrash API test is failing with async delegates
3152         https://bugs.webkit.org/show_bug.cgi?id=183787
3153
3154         Reviewed by Wenson Hsieh.
3155
3156         Without asynchronous policy delegates, when the client requests a navigation, we would:
3157         1. Do a synchronous navigation policy check
3158         2. If the client allows the navigation, start the provisional load
3159
3160         Starting the provisional load would freeze the layer tree until first meaningful
3161         layout via WebFrameLoaderClient::provisionalLoadStarted() -> WebPage::didStartPageTransition().
3162
3163         When constructing a WebView and then requesting a load right away. This would make sure
3164         we do not commit a layer tree for the initial about:blank page because the layer tree
3165         would be frozen until we have something meaningful to show for the following load.
3166
3167         However, with asynchronous policy delegates, we are able to do a layer tree commit
3168         during the asynchronous navigation policy check because the layer tree is not frozen
3169         yet (provisional load has not started) and the process is not stuck on synchronous
3170         IPC. When constructing a WebView and then requesting a load right away, this would
3171         allow a layer tree commit for about:blank to happen before we've even started the
3172         load. This would cause some API tests to fail on iOS.
3173
3174         To address the issue, we try and maintain pre-existing behavior by freezing the
3175         layer tree during navigation policy decision.
3176
3177         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3178         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
3179         (WebKit::WebFrameLoaderClient::didDecidePolicyForNavigationAction):
3180         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
3181         * WebProcess/WebPage/WebPage.cpp:
3182         (WebKit::WebPage::didStartNavigationPolicyCheck):
3183         (WebKit::WebPage::didCompleteNavigationPolicyCheck):
3184         * WebProcess/WebPage/WebPage.h:
3185
3186 2018-03-21  Brent Fulgham  <bfulgham@apple.com>
3187
3188         Allow the WebContent process to read ViewBridge preferences
3189         https://bugs.webkit.org/show_bug.cgi?id=183862
3190         <rdar://problem/38459456>
3191
3192         Reviewed by Eric Carlson.
3193
3194         * WebProcess/com.apple.WebProcess.sb.in:
3195
3196 2018-03-21  Frederic Wang  <fwang@igalia.com>
3197
3198         [iOS] Text highlighted by the Find UI overlaps with NBC news header on google.com
3199         https://bugs.webkit.org/show_bug.cgi?id=183658
3200
3201         Reviewed by Tim Horton.
3202
3203         On Mobile, many sites have overlay headers or footers that may overlap with the highlighted
3204         text inside a scrollable overflow node. To workaround that issue, this commit changes the
3205         behavior so that the text is revealed at the center of the overflow node.
3206
3207         * WebProcess/WebPage/ios/FindControllerIOS.mm:
3208         (WebKit::FindController::didFindString): Use alignCenterAlways instead of alignToEdgeIfNeeded.
3209
3210 2018-03-21  Carlos Garcia Campos  <cgarcia@igalia.com>
3211
3212         [GTK][WPE] JSC bindings not introspectable
3213         https://bugs.webkit.org/show_bug.cgi?id=136989
3214
3215         Reviewed by Michael Catanzaro.
3216
3217         Deprecate the functions that are not introspectable due to JSC C API in GTK+ port and remove them in WPE
3218         port. Add alternative functions using the new JSC GLib API. We no longer need to keep a global context attached
3219         to every view. We can simply create a temporary global context on demand and release it after 1 second. This
3220         also allows us to remove WebPageProxy::javascriptGlobalContext() and all the related code.
3221
3222         * PlatformGTK.cmake:
3223         * PlatformWPE.cmake:
3224         * UIProcess/API/glib/WebKitJavascriptResult.cpp:
3225         (_WebKitJavascriptResult::_WebKitJavascriptResult):
3226         (webkitJavascriptResultCreate):
3227         (webkit_javascript_result_get_global_context):
3228         (webkit_javascript_result_get_value):
3229         (webkit_javascript_result_get_js_value):
3230         * UIProcess/API/glib/WebKitJavascriptResultPrivate.h:
3231         (SharedJavascriptContext::singleton):
3232         (SharedJavascriptContext::SharedJavascriptContext):
3233         (SharedJavascriptContext::getOrCreateContext):
3234         (SharedJavascriptContext::releaseContext):
3235         * UIProcess/API/glib/WebKitUserContentManager.cpp:
3236         * UIProcess/API/glib/WebKitWebView.cpp:
3237         (webkit_web_view_get_javascript_global_context):
3238         (webkitWebViewRunJavaScriptCallback):
3239         * UIProcess/API/gtk/PageClientImpl.cpp:
3240         * UIProcess/API/gtk/PageClientImpl.h:
3241         * UIProcess/API/gtk/WebKitJavascriptResult.h:
3242         * UIProcess/API/gtk/WebKitWebView.h:
3243         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
3244         * UIProcess/API/wpe/APIViewClient.h:
3245         (API::ViewClient::handleDownloadRequest):
3246         * UIProcess/API/wpe/PageClientImpl.cpp:
3247         * UIProcess/API/wpe/PageClientImpl.h:
3248         * UIProcess/API/wpe/WPEView.cpp:
3249         * UIProcess/API/wpe/WPEView.h:
3250         * UIProcess/API/wpe/WebKitJavascriptResult.h:
3251         * UIProcess/API/wpe/WebKitWebView.h:
3252         * UIProcess/PageClient.h:
3253         * UIProcess/WebPageProxy.h:
3254         * UIProcess/gtk/WebPageProxyGtk.cpp:
3255         * UIProcess/wpe/WebPageProxyWPE.cpp:
3256         * WebProcess/InjectedBundle/API/glib/WebKitFrame.cpp:
3257         (webkit_frame_get_js_context):
3258         (webkit_frame_get_js_context_for_script_world):
3259         * WebProcess/InjectedBundle/API/gtk/WebKitFrame.h:
3260         * WebProcess/InjectedBundle/API/wpe/WebKitFrame.h:
3261
3262 2018-03-21  Carlos Garcia Campos  <cgarcia@igalia.com>
3263
3264         [GTK][WPE] Initial implementation of JavaScriptCore glib bindings
3265         https://bugs.webkit.org/show_bug.cgi?id=164061
3266
3267         Reviewed by Michael Catanzaro.
3268
3269         Set decorator and deprecation_guard options in API docs config files, since they are no longer common to all
3270         libraries.
3271
3272         * PlatformGTK.cmake:
3273
3274 2018-03-21  Zan Dobersek  <zdobersek@igalia.com>
3275
3276         [CoordGraphics] Simplify CoordinatedGraphicsScene activation
3277         https://bugs.webkit.org/show_bug.cgi?id=183772
3278
3279         Reviewed by Carlos Garcia Campos.
3280
3281         Simplify CoordinatedGraphicsScene::setActive() into a simple setter of
3282         the m_isActive member variable. We don't have to call renderNextFrame()
3283         anymore as that was only necessary to unblock CoordinatedLayerTreeHost,
3284         but that can be avoided if m_isWaitingForRenderer in that class is
3285         initialized to false.
3286
3287         CoordinatedGraphicsSceneClient::renderNextFrame() virtual method and its
3288         ThreadedCompositor implementation are removed. renderNextFrame() in the
3289         CoordinatedGraphicsScene class can also be removed, along with the
3290         unused dispatchOnMainThread() and dispatchOnClientRunLoop() methods and
3291         the associated m_clientRunLoop member variable.
3292
3293         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
3294         (WebKit::CoordinatedGraphicsScene::CoordinatedGraphicsScene):
3295         (WebKit::CoordinatedGraphicsScene::dispatchOnMainThread): Deleted.
3296         (WebKit::CoordinatedGraphicsScene::dispatchOnClientRunLoop): Deleted.
3297         (WebKit::CoordinatedGraphicsScene::renderNextFrame): Deleted.
3298         (WebKit::CoordinatedGraphicsScene::setActive): Deleted.
3299         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
3300         (WebKit::CoordinatedGraphicsSceneClient::~CoordinatedGraphicsSceneClient):
3301         (WebKit::CoordinatedGraphicsScene::setActive):
3302         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
3303         (WebKit::m_displayRefreshMonitor):
3304         (WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing):
3305         (WebKit::ThreadedCompositor::renderNextFrame): Deleted.
3306         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
3307         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
3308
3309 2018-03-21  Zan Dobersek  <zdobersek@igalia.com>
3310
3311         [TexMap] Have TextureMapperLayer::applyAnimationsRecursively() return running animation status
3312         https://bugs.webkit.org/show_bug.cgi?id=183771
3313
3314         Reviewed by Carlos Garcia Campos.
3315
3316         In CoordinatedGraphicsScene::paintToCurrentGLContext(), retrieve
3317         information about any running animation in the scene via the
3318         TextureMapperLayer::applyAnimationsRecursively() call. Use that boolean
3319         value at the end up the method, instead of again traversing the
3320         TextureMapperLayer tree to determine whether any running animations are
3321         present.
3322
3323         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
3324         (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
3325
3326 2018-03-20  Tim Horton  <timothy_horton@apple.com>
3327
3328         Enable the minimal simulator feature flag when appropriate
3329         https://bugs.webkit.org/show_bug.cgi?id=183807
3330
3331         Reviewed by Dan Bernstein.
3332
3333         * Configurations/FeatureDefines.xcconfig:
3334
3335 2018-03-19  Ryosuke Niwa  <rniwa@webkit.org>
3336
3337         Expose content attributes on _WKLinkIconParameters
3338         https://bugs.webkit.org/show_bug.cgi?id=183768
3339
3340         Reviewed by Alex Christensen.
3341
3342         Added _WKLinkIconParameters.attributes to expose content attributes of a link element
3343         which defined a favicon, touch icon, or pre-compressed touch icon.
3344
3345         * UIProcess/API/Cocoa/_WKLinkIconParameters.h:
3346         (_WKLinkIconParameters.attributes): Added.
3347         * UIProcess/API/Cocoa/_WKLinkIconParameters.mm:
3348         (_WKLinkIconParameters._attributes): Added.
3349         (-[_WKLinkIconParameters _initWithLinkIcon:]): Convert the hash map from WebCore to a NSDictionary.
3350         (-[_WKLinkIconParameters attributes]): Added.
3351
3352 2018-03-20  Wenson Hsieh  <wenson_hsieh@apple.com>
3353
3354         Add AssistedNodeInformation plumbing for form control placeholder text and label text
3355         https://bugs.webkit.org/show_bug.cgi?id=183802
3356         <rdar://problem/38686273>
3357
3358         Reviewed by Tim Horton.
3359
3360         Surfaces some additional information about the currently focused element to the input delegate in the UI process.
3361         See comments below for more details.
3362
3363         Test: WebKit.FocusedElementInfo
3364
3365         * Shared/AssistedNodeInformation.cpp:
3366         (WebKit::AssistedNodeInformation::encode const):
3367         (WebKit::AssistedNodeInformation::decode):
3368         * Shared/AssistedNodeInformation.h:
3369
3370         Add `placeholder` and `label` to AssistedNodeInformation, which capture the value of the placeholder attribute
3371         and the text of the first associated label element for the focused form control. Also add boilerplate encoder/
3372         decoder support for these members.
3373
3374         * UIProcess/API/Cocoa/_WKFocusedElementInfo.h:
3375
3376         Augment _WKFocusedElementInfo to include placeholder and label.
3377
3378         * UIProcess/ios/WKContentViewInteraction.mm:
3379         (-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:userObject:]):
3380         (-[WKFocusedElementInfo label]):
3381         (-[WKFocusedElementInfo placeholder]):
3382         * WebProcess/WebPage/ios/WebPageIOS.mm:
3383         (WebKit::WebPage::getAssistedNodeInformation):
3384
3385         For input elements and textareas, set the placeholder to the value of the placeholder attribute. For all
3386         elements with associated labels, grab the inner text of the first label that is not empty, ignoring all labels
3387         that are `display: none` (i.e. not being rendered).
3388
3389 2018-03-20  Brady Eidson  <beidson@apple.com>
3390
3391         First piece of process swapping on navigation.
3392         https://bugs.webkit.org/show_bug.cgi?id=183665
3393
3394         Reviewed by Andy Estes.
3395
3396         This patch adds the first pieces of the following feature:
3397         "When a navigation originating inside a WKWebView goes to a different origin,
3398          swap to a new WebProcess for that navigation"
3399
3400         There are significant bugs to be resolved and significant optimizations to be made.
3401         Which is why the feature is disabled by default.
3402
3403         Besides the core logic implementing the feature, this patch does a lot of related 
3404         work such as:
3405         - Removing some now-invalid ASSERTs
3406         - Adding some ASSERTs
3407         - Update various switch states to handle the new "Suspend" policy and "NavigationSwap"
3408           process termination reason
3409
3410         * NetworkProcess/NetworkDataTaskBlob.cpp:
3411         (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse):
3412
3413         * NetworkProcess/capture/NetworkDataTaskReplay.cpp:
3414         (WebKit::NetworkCapture::NetworkDataTaskReplay::didReceiveResponse):
3415
3416         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3417         (toNSURLSessionResponseDisposition):
3418
3419         * Platform/Logging.h:
3420
3421         * Shared/LoadParameters.cpp:
3422         (WebKit::LoadParameters::encode const):
3423         (WebKit::LoadParameters::decode):
3424         * Shared/LoadParameters.h:
3425
3426         * Shared/ProcessTerminationReason.h: Add "NavigationSwap" as a process termination reason.
3427
3428         * UIProcess/API/APINavigation.h:
3429
3430         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3431         (API::ProcessPoolConfiguration::copy):
3432
3433         * UIProcess/API/C/WKAPICast.h:
3434         (WebKit::toAPI):
3435
3436         * UIProcess/Cocoa/NavigationState.mm:
3437         (WebKit::wkProcessTerminationReason):
3438
3439         * UIProcess/WebFramePolicyListenerProxy.cpp:
3440         (WebKit::WebFramePolicyListenerProxy::WebFramePolicyListenerProxy):
3441         * UIProcess/WebFramePolicyListenerProxy.h:
3442         (WebKit::WebFramePolicyListenerProxy::create):
3443         (WebKit::WebFramePolicyListenerProxy::policyListenerType const):
3444
3445         * UIProcess/WebFrameProxy.cpp:
3446         (WebKit::WebFrameProxy::setUpPolicyListenerProxy):
3447         (WebKit::WebFrameProxy::activePolicyListenerProxy):
3448         * UIProcess/WebFrameProxy.h:
3449
3450         * UIProcess/WebNavigationState.cpp:
3451         (WebKit::WebNavigationState::navigation):
3452         (WebKit::WebNavigationState::takeNavigation):
3453
3454         * UIProcess/WebPageProxy.cpp:
3455         (WebKit::WebPageProxy::reattachToWebProcess):
3456         (WebKit::WebPageProxy::attachToProcessForNavigation): Pretend that the existing process 
3457           terminated using the new "NavigationSwap" reason, then manually start the next load.
3458         (WebKit::WebPageProxy::loadRequest):
3459         (WebKit::WebPageProxy::loadRequestWithNavigation):
3460         (WebKit::WebPageProxy::receivedPolicyDecision):
3461         (WebKit::WebPageProxy::continueNavigationInNewProcess):
3462         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
3463         (WebKit::WebPageProxy::decidePolicyForResponse):
3464         (WebKit::WebPageProxy::processDidTerminate):
3465         (WebKit::WebPageProxy::resetState):
3466         (WebKit::WebPageProxy::resetStateAfterProcessExited):
3467         * UIProcess/WebPageProxy.h:
3468
3469         * UIProcess/WebProcessPool.cpp:
3470         (WebKit::WebProcessPool::processForNavigation): Determine which process should be used
3471           for a proposed navigation, creating a new one if necessary.
3472         * UIProcess/WebProcessPool.h:
3473
3474         * UIProcess/WebStorage/StorageManager.cpp:
3475         (WebKit::StorageManager::SessionStorageNamespace::setAllowedConnection):
3476
3477         * WebProcess/WebPage/WebPage.cpp:
3478         (WebKit::WebPage::loadRequest):
3479
3480 2018-03-20  Youenn Fablet  <youenn@apple.com>
3481
3482         ServiceWorkerClientFetch::didReceiveData should check for m_encodedDataLength
3483         https://bugs.webkit.org/show_bug.cgi?id=183668
3484
3485         Reviewed by Chris Dumez.
3486
3487         Crash happens when releasing a RefPtr<SharedBuffer> buffer that is null.
3488         It happens because ServiceWorkerClientFetch can call m_loader->didReceiveBuffer at two different places.
3489         Either when receiving an IPC call or as part of completion handler for the response validation check.
3490         At each call site, we release the buffer to pass it to the loader and we set m_encodedLength to zero.
3491         The fix is to add the m_encodedLength check like done in the case of response validation check completion handler.
3492
3493         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
3494         (WebKit::ServiceWorkerClientFetch::didReceiveData):
3495
3496 2018-03-20  Jeff Miller  <jeffm@apple.com>
3497
3498         Expose aggressiveTileRetentionEnabled in WKPreferences SPI to match C SPI
3499         https://bugs.webkit.org/show_bug.cgi?id=183790
3500
3501         Reviewed by Alex Christensen.
3502         
3503         Expose this property on macOS only.
3504
3505         * UIProcess/API/Cocoa/WKPreferences.mm:
3506         (-[WKPreferences _setAggressiveTileRetentionEnabled:]):
3507         (-[WKPreferences _aggressiveTileRetentionEnabled]):
3508         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
3509
3510 2018-03-20  Tim Horton  <timothy_horton@apple.com>
3511
3512         Add and adopt WK_PLATFORM_NAME and adjust default feature defines
3513         https://bugs.webkit.org/show_bug.cgi?id=183758
3514         <rdar://problem/38017644>
3515
3516         Reviewed by Dan Bernstein.
3517
3518         * Configurations/FeatureDefines.xcconfig:
3519
3520 2018-03-20  Chris Dumez  <cdumez@apple.com>
3521
3522         Unreviewed, rolling out r229726 and r229763.
3523
3524         Caused some API test failures on iOS
3525
3526         Reverted changesets:
3527
3528         "Make policy decisions asynchronous"
3529         https://bugs.webkit.org/show_bug.cgi?id=180568
3530         https://trac.webkit.org/changeset/229726
3531
3532         "Rebaseline three webarchive tests for WK2 after r229726."
3533         https://bugs.webkit.org/show_bug.cgi?id=180568
3534         https://trac.webkit.org/changeset/229763
3535
3536 2018-03-20  Brent Fulgham  <bfulgham@apple.com>
3537
3538         [iOS] Grant IOKit preference access for the Home button
3539         https://bugs.webkit.org/show_bug.cgi?id=183754
3540         <rdar://problem/38179704>
3541
3542         Reviewed by Eric Carlson.
3543
3544         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
3545
3546 2018-03-20  Wenson Hsieh  <wenson_hsieh@apple.com>
3547
3548         [Extra zoom mode] Adopt updated input view controller machinery for text input
3549         https://bugs.webkit.org/show_bug.cgi?id=183765
3550         <rdar://problem/36926269>
3551
3552         Reviewed by Tim Horton.
3553
3554         Adopt new classes for extra zoomed text inputs. Massage WKTextInputViewController into WKTextInputListView-
3555         Controller and introduce WKFormControlListViewController, the eventual replacement for the base class
3556         WKTextFormControlViewController that will act as the base class of all list-view-controller-based input UI in
3557         extra zoom mode.
3558
3559         * UIProcess/ios/WKContentViewInteraction.h:
3560         * UIProcess/ios/WKContentViewInteraction.mm:
3561         (-[WKContentView presentTextInputViewController:]):
3562         (-[WKContentView dismissTextInputViewController:]):
3563         (-[WKContentView focusedFormControllerDidUpdateSuggestions:]):
3564         (-[WKContentView _wheelChangedWithEvent:]):
3565         * UIProcess/ios/forms/WKFormControlListViewController.h: Copied from Source/WebKit/UIProcess/ios/forms/WKTextInputViewController.h.
3566         * UIProcess/ios/forms/WKFormControlListViewController.mm: Renamed from Source/WebKit/UIProcess/ios/forms/WKTextInputViewController.mm.
3567         * UIProcess/ios/forms/WKTextInputListViewController.h: Copied from Source/WebKit/UIProcess/ios/forms/WKTextInputViewController.h.
3568         * UIProcess/ios/forms/WKTextInputListViewController.mm: Renamed from Source/WebKit/UIProcess/ios/forms/WKTextInputViewController.h.
3569         * WebKit.xcodeproj/project.pbxproj:
3570
3571 2018-03-19  Megan Gardner  <megan_gardner@apple.com>
3572
3573         Clear style colors when setting default appearance
3574         https://bugs.webkit.org/show_bug.cgi?id=183759
3575
3576         Reviewed by Tim Horton.
3577
3578         Colors are cached and need to be cleared and recalculated.
3579
3580         * WebProcess/WebPage/WebPage.cpp:
3581         (WebKit::WebPage::setDefaultAppearance):
3582
3583 2018-03-19  Chris Dumez  <cdumez@apple.com>
3584
3585         WKWebView.ClearAppCache is a flaky API test failure on High Sierra.
3586         https://bugs.webkit.org/show_bug.cgi?id=181546
3587         <rdar://problem/36444327>
3588
3589         Reviewed by Ryosuke Niwa.
3590
3591         in LocalStorageDatabaseTracker::deleteDatabasesModifiedSince(), add origin
3592         to originIdentifiersToDelete if we cannot determine the last modification
3593         time of the database file. This likely means the database file does not
3594         exist. However, we still needs to make sure the origin gets removed from
3595         the origins database and there may be *.wal / *.shm variants of the database
3596         that are still on disk and need to be deleted.
3597
3598         * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
3599         (WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince):
3600
3601 2018-03-19  Chris Dumez  <cdumez@apple.com>
3602
3603         Have one service worker process per security origin
3604         https://bugs.webkit.org/show_bug.cgi?id=183600
3605         <rdar://problem/35280128>
3606
3607         Reviewed by Brady Eidson.
3608
3609         Split service workers from different origins into their own processes
3610         for security reasons.
3611
3612         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3613         (WebKit::WebSWServerConnection::startFetch):
3614         (WebKit::WebSWServerConnection::postMessageToServiceWorker):
3615         (WebKit::WebSWServerConnection::scheduleJobInServer):
3616         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
3617         (WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
3618         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
3619         * StorageProcess/StorageProcess.cpp:
3620         (WebKit::StorageProcess::connectionToContextProcessFromIPCConnection):
3621         (WebKit::StorageProcess::didClose):
3622         (WebKit::StorageProcess::connectionToContextProcessWasClosed):
3623         (WebKit::StorageProcess::needsServerToContextConnectionForOrigin const):
3624         (WebKit::StorageProcess::didReceiveMessage):
3625         (WebKit::StorageProcess::createStorageToWebProcessConnection):
3626         (WebKit::StorageProcess::serverToContextConnectionForOrigin):
3627         (WebKit::StorageProcess::createServerToContextConnection):
3628         * StorageProcess/StorageProcess.h:
3629         * StorageProcess/StorageProcess.messages.in:
3630         * StorageProcess/StorageToWebProcessConnection.cpp:
3631         (WebKit::StorageToWebProcessConnection::didReceiveMessage):
3632         (WebKit::StorageToWebProcessConnection::didClose):
3633         * StorageProcess/StorageToWebProcessConnection.h:
3634         * UIProcess/API/C/WKContext.cpp:
3635         (WKContextTerminateServiceWorkerProcess):
3636         * UIProcess/API/Cocoa/WKProcessPool.mm:
3637         (-[WKProcessPool _terminateServiceWorkerProcesses]):
3638         (-[WKProcessPool _webPageContentProcessCount]):
3639         (-[WKProcessPool _serviceWorkerProcessCount]):
3640         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
3641         * UIProcess/Network/NetworkProcessProxy.cpp:
3642         (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
3643         (WebKit::NetworkProcessProxy::canAuthenticateAgainstProtectionSpace):
3644         * UIProcess/ServiceWorkerProcessProxy.cpp:
3645         (WebKit::ServiceWorkerProcessProxy::create):
3646         (WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
3647         * UIProcess/ServiceWorkerProcessProxy.h:
3648         (isType):
3649         * UIProcess/Storage/StorageProcessProxy.cpp:
3650         (WebKit::StorageProcessProxy::getStorageProcessConnection):
3651         (WebKit::StorageProcessProxy::didFinishLaunching):
3652         (WebKit::StorageProcessProxy::establishWorkerContextConnectionToStorageProcess):
3653         (WebKit::StorageProcessProxy::establishWorkerContextConnectionToStorageProcessForExplicitSession):
3654         * UIProcess/Storage/StorageProcessProxy.h:
3655         * UIProcess/Storage/StorageProcessProxy.messages.in:
3656         * UIProcess/WebProcessPool.cpp:
3657         (WebKit::WebProcessPool::getStorageProcessConnection):
3658         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
3659         (WebKit::WebProcessPool::createNewWebProcess):
3660         (WebKit::WebProcessPool::disconnectProcess):
3661         (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
3662         (WebKit::WebProcessPool::createWebPage):
3663         (WebKit::WebProcessPool::updateServiceWorkerUserAgent):
3664         (WebKit::WebProcessPool::mayHaveRegisteredServiceWorkers):
3665         (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
3666         (WebKit::WebProcessPool::terminateServiceWorkerProcesses):
3667         (WebKit::WebProcessPool::updateProcessAssertions):
3668         (WebKit::WebProcessPool::serviceWorkerProcessProxyFromPageID const):
3669         * UIProcess/WebProcessPool.h:
3670         * UIProcess/WebProcessProxy.cpp:
3671         (WebKit::WebProcessProxy::getStorageProcessConnection):
3672
3673 2018-03-19  Jiewen Tan  <jiewen_tan@apple.com>
3674
3675         Unreviewed, another quick fix for r229699
3676
3677         Restricts ENABLE_WEB_AUTHN to only macOS and iOS.
3678
3679         * Configurations/FeatureDefines.xcconfig:
3680
3681 2018-03-19  Chris Dumez  <cdumez@apple.com>
3682
3683         Make policy decisions asynchronous
3684         https://bugs.webkit.org/show_bug.cgi?id=180568
3685         <rdar://problem/37131297>
3686
3687         Reviewed by Alex Christensen.
3688
3689         Get rid of synchronous IPC and synchronous code paths for policy delegates.
3690         Policy decisions are now all made asynchronously and rely on asynchronous
3691         IPC.
3692
3693         This code change is based on work by Alex Christensen.
3694
3695         * UIProcess/WebPageProxy.cpp:
3696         (WebKit::WebPageProxy::receivedPolicyDecision):
3697         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
3698         (WebKit::WebPageProxy::decidePolicyForResponse):
3699         * UIProcess/WebPageProxy.h:
3700         * UIProcess/WebPageProxy.messages.in:
3701         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3702         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
3703         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
3704
3705 2018-03-19  Brian Burg  <bburg@apple.com>
3706
3707         Web Inspector: clean up WKWebView configuration code
3708         https://bugs.webkit.org/show_bug.cgi?id=183747
3709         <rdar://problem/38629343>
3710
3711         Reviewed by Timothy Hatcher.
3712
3713         * UIProcess/mac/WKInspectorViewController.mm:
3714         (-[WKInspectorViewController webView]): Always use system
3715         appearance for Inspector's web content.
3716
3717 2018-03-19  Eric Carlson  <eric.carlson@apple.com>
3718
3719         [Extra zoom mode] Require fullscreen for video playback
3720         https://bugs.webkit.org/show_bug.cgi?id=183742
3721         <rdar://problem/38235862>
3722
3723         Reviewed by Jer Noble.
3724
3725         * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
3726         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
3727         (-[WKVideoFullScreenViewController initWithAVPlayerViewController:]):
3728         (-[WKVideoFullScreenViewController viewDidLoad]):
3729         (-[WKVideoFullScreenViewController prefersStatusBarHidden]):
3730         (WebKit::VideoFullscreenModelContext::presentingViewController):
3731         (WebKit::VideoFullscreenModelContext::createVideoFullscreenViewController):
3732         * WebProcess/cocoa/VideoFullscreenManager.mm:
3733         (WebKit::VideoFullscreenManager::didEnterFullscreen):
3734
3735 2018-03-19  Daniel Bates  <dabates@apple.com>
3736
3737         test-webkitpy no longer runs WebKit2 tests
3738         https://bugs.webkit.org/show_bug.cgi?id=183724
3739
3740         Reviewed by Alexey Proskuryakov.
3741
3742         Fixes an issue where Python emits errors "global name reset_results is not defined" when
3743         running tests in messages_unittest.py using test-webkitpy.
3744
3745         Currently messages_unittest.py conditionally defines the global variable reset_results
3746         when run as the main program (i.e. __name__ == "__main__"). When messages_unittest.py is
3747         imported as a module as test-webkitpy does then it is not considered the main program
3748         ;=> the top-level script environment is not __main__ ;=> we do not define the global
3749         variable reset_results. Instead we should unconditionally define the global variable
3750         reset_results.
3751
3752         * Scripts/webkit/messages_unittest.py:
3753
3754 2018-03-19  Per Arne Vollan  <pvollan@apple.com>
3755
3756         When the WebContent process is blocked from accessing the WindowServer, the call CVDisplayLinkCreateWithCGDisplay will fail.
3757         https://bugs.webkit.org/show_bug.cgi?id=183604
3758         <rdar://problem/38305109>
3759
3760         Reviewed by Brent Fulgham.
3761
3762         * UIProcess/WebPageProxy.h:
3763         * UIProcess/WebPageProxy.messages.in:
3764         * UIProcess/mac/DisplayLink.cpp: Added.
3765         (WebKit::DisplayLink::DisplayLink):
3766         (WebKit::DisplayLink::~DisplayLink):
3767         (WebKit::DisplayLink::displayLinkCallback):
3768         * UIProcess/mac/DisplayLink.h: Added.
3769         * UIProcess/mac/WebPageProxyMac.mm:
3770         (WebKit::WebPageProxy::startDisplayRefreshMonitor):
3771         (WebKit::WebPageProxy::stopDisplayRefreshMonitor):
3772         * WebKit.xcodeproj/project.pbxproj:
3773         * WebProcess/WebPage/DrawingArea.cpp:
3774         (WebKit::DrawingArea::createDisplayRefreshMonitor):
3775         * WebProcess/WebPage/DrawingArea.h:
3776         * WebProcess/WebPage/DrawingArea.messages.in:
3777         * WebProcess/WebPage/mac/DrawingAreaMac.cpp: Added.
3778         (WebKit::DisplayRefreshMonitorMac::create):
3779         (WebKit::DisplayRefreshMonitorMac::DisplayRefreshMonitorMac):
3780         (WebKit::DisplayRefreshMonitorMac::~DisplayRefreshMonitorMac):
3781         (WebKit::DisplayRefreshMonitorMac::requestRefreshCallback):
3782         (WebKit::DisplayRefreshMonitorMac::displayLinkFired):
3783         (WebKit::DrawingArea::screenWasRefreshed):
3784         (WebKit::DrawingArea::createDisplayRefreshMonitor):
3785
3786 2018-03-17  Jiewen Tan  <jiewen_tan@apple.com>
3787
3788         [WebAuthN] Implement authenticatorMakeCredential
3789         https://bugs.webkit.org/show_bug.cgi?id=183527
3790         <rdar://problem/35275886>
3791
3792         Reviewed by Brent Fulgham.
3793
3794         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.cpp:
3795         (WebKit::WebCredentialsMessengerProxy::WebCredentialsMessengerProxy):
3796         (WebKit::WebCredentialsMessengerProxy::makeCredential):
3797         (WebKit::WebCredentialsMessengerProxy::getAssertion):
3798         (WebKit::WebCredentialsMessengerProxy::isUserVerifyingPlatformAuthenticatorAvailable):
3799         (WebKit::WebCredentialsMessengerProxy::exceptionReply):
3800         (WebKit::WebCredentialsMessengerProxy::makeCredentialReply):
3801         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.h:
3802         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.messages.in:
3803         * UIProcess/CredentialManagement/cocoa/WebCredentialsMessengerProxyCocoa.mm: Removed.
3804         * WebKit.xcodeproj/project.pbxproj:
3805         * WebProcess/CredentialManagement/WebCredentialsMessenger.cpp:
3806         (WebKit::WebCredentialsMessenger::makeCredential):
3807         (WebKit::WebCredentialsMessenger::makeCredentialReply):
3808         * WebProcess/CredentialManagement/WebCredentialsMessenger.h:
3809         * WebProcess/CredentialManagement/WebCredentialsMessenger.messages.in:
3810
3811 2018-03-17  Daniel Bates  <dabates@apple.com>
3812
3813         Tests fail in messages_unittest.py
3814         https://bugs.webkit.org/show_bug.cgi?id=183725
3815
3816         Partial revert of r222113. The messages generator machinery does not know when
3817         it is sufficient to emit an include for wtf/Forward.h as opposed to a concrete
3818         header.
3819
3820         * Scripts/webkit/LegacyMessages-expected.h:
3821         * Scripts/webkit/Messages-expected.h:
3822
3823 2018-03-16  Wenson Hsieh  <wenson_hsieh@apple.com>
3824
3825         Unreviewed, rolling out r229688.
3826
3827         There's a solution that doesn't require this SPI.
3828
3829         Reverted changeset:
3830
3831         "Add SPI to expose width and height anchors for WKWebView's
3832         content view"
3833         https://bugs.webkit.org/show_bug.cgi?id=183711
3834         https://trac.webkit.org/changeset/229688
3835
3836 2018-03-16  Wenson Hsieh  <wenson_hsieh@apple.com>
3837
3838         Add SPI to expose width and height anchors for WKWebView's content view
3839         https://bugs.webkit.org/show_bug.cgi?id=183711
3840         <rdar://problem/38562899>
3841
3842         Reviewed by Tim Horton.
3843
3844         Add _contentWidthAnchor and _contentHeightAnchor SPI to WKWebView for internal clients to be able to reason
3845         about the size of the content view on iOS using autolayout.
3846
3847         Test: WebKit.AutoLayoutPositionHeaderAndFooterViewsInScrollView.
3848
3849         * UIProcess/API/Cocoa/WKWebView.mm:
3850         (-[WKWebView _contentWidthAnchor]):
3851         (-[WKWebView _contentHeightAnchor]):
3852         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3853
3854 2018-03-16  Megan Gardner  <megan_gardner@apple.com>
3855
3856         Add _useSystemAppearance to WKView
3857         https://bugs.webkit.org/show_bug.cgi?id=183706
3858         <rdar://problem/38516584>
3859
3860         Reviewed by Tim Horton.
3861
3862         Plumb useSystemAppearance and other supporting functions to WKView
3863
3864         * UIProcess/API/Cocoa/WKViewPrivate.h:
3865         * UIProcess/API/Cocoa/WKWebView.mm:
3866         (-[WKWebView _initializeWithConfiguration:]):
3867         (-[WKWebView _useSystemAppearance]):
3868         (-[WKWebView _setUseSystemAppearance:]):
3869         (-[WKWebView effectiveAppearanceDidChange]):
3870         * UIProcess/API/mac/WKView.mm:
3871         (-[WKView effectiveAppearanceDidChange]):
3872         (-[WKView _setUseSystemAppearance:]):
3873         (-[WKView _useSystemAppearance]):
3874         (-[WKView _setDefaultAppearance:]):
3875         * UIProcess/Cocoa/WebViewImpl.h:
3876         * UIProcess/Cocoa/WebViewImpl.mm:
3877         (WebKit::WebViewImpl::setUseSystemAppearance):
3878         (WebKit::WebViewImpl::useSystemAppearance):
3879         (WebKit::WebViewImpl::setDefaultAppearance):
3880
3881 2018-03-16  Brent Fulgham  <bfulgham@apple.com>
3882
3883         Set a trap to catch an infrequent form-related nullptr crash
3884         https://bugs.webkit.org/show_bug.cgi?id=183704
3885         <rdar://problem/37579354>
3886
3887         Reviewed by Ryosuke Niwa.
3888
3889         Add a RELEASE_ASSERT to see if we ever encounter a nullptr WebCore frame.
3890
3891         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3892         (WebKit::WebFrameLoaderClient::dispatchWillSubmitForm):
3893
3894 2018-03-16  Jer Noble  <jer.noble@apple.com>
3895
3896         Make Fullscreen API an Experimental Feature
3897         https://bugs.webkit.org/show_bug.cgi?id=183662
3898
3899         Reviewed by Jon Lee.
3900
3901         Add the ability to have a conditional for whether an Experimental Feature is "visible", separate from
3902         whether the preference is available, for definining platform-specific Experimental Features.
3903
3904         * Scripts/GeneratePreferences.rb:
3905         * Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb:
3906         * Shared/WebPreferences.yaml:
3907
3908 2018-03-16  Megan Gardner  <megan_gardner@apple.com>
3909
3910         Ensure that style is updated when the effective appearance changes
3911         https://bugs.webkit.org/show_bug.cgi?id=183690
3912         <rdar://problem/38385900>
3913
3914         Reviewed by Tim Horton and Wenson Hsieh.
3915
3916         Respond to and respect the effective appearance changing.
3917
3918         * UIProcess/API/Cocoa/WKWebView.mm:
3919         (-[WKWebView effectiveAppearanceDidChange]):
3920         * WebProcess/WebPage/WebPage.cpp:
3921         (WebKit::WebPage::setDefaultAppearance):
3922
3923 2018-03-16  Chris Dumez  <cdumez@apple.com>
3924
3925         URLSchemeHandler.Basic API test fails with async policy delegates
3926         https://bugs.webkit.org/show_bug.cgi?id=183678
3927
3928         Reviewed by Alex Christensen.
3929
3930         The issue is that the client calls _didPerformRedirection / didReceiveResponse / didReceiveData / didFinish
3931         on the URLScheme task one after the one, synchronously. However, redirects and responses can be processed
3932         asynchronously. To address the issue, we now queue operations requested by the client if we're waiting
3933         for an async policy delegate.
3934
3935         * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp:
3936         (WebKit::WebURLSchemeTaskProxy::didPerformRedirection):
3937         (WebKit::WebURLSchemeTaskProxy::didReceiveResponse):
3938         (WebKit::WebURLSchemeTaskProxy::didReceiveData):
3939         (WebKit::WebURLSchemeTaskProxy::didComplete):
3940         (WebKit::WebURLSchemeTaskProxy::processNextPendingTask):
3941         * WebProcess/WebPage/WebURLSchemeTaskProxy.h:
3942         (WebKit::WebURLSchemeTaskProxy::queueTask):
3943
3944 2018-03-16  Claudio Saavedra  <csaavedra@igalia.com>
3945
3946         Suppress GCC warnings by using #include instead of #import
3947
3948         Unreviewed.
3949         * UIProcess/SystemPreviewController.cpp:
3950
3951 2018-03-15  Keith Rollin  <krollin@apple.com>
3952
3953         Telemetry for stalled webpage loads
3954         https://bugs.webkit.org/show_bug.cgi?id=183221
3955         <rdar://problem/36549013>
3956
3957         Reviewed by Chris Dumez.
3958
3959         Add telemetry for page loads, tracking the pages that succeed, fail,
3960         or are canceled. This information will be used to track the overall
3961         health of our page loading as time goes on.
3962
3963         * UIProcess/WebPageProxy.cpp:
3964         (WebKit::WebPageProxy::close):
3965         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
3966         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
3967         (WebKit::WebPageProxy::didFinishLoadForFrame):
3968         (WebKit::WebPageProxy::didFailLoadForFrame):
3969         (WebKit::WebPageProxy::reportPageLoadResult):
3970         * UIProcess/WebPageProxy.h:
3971         (WebKit::WebPageProxy::reportPageLoadResult):
3972
3973 2018-03-15  Wenson Hsieh  <wenson_hsieh@apple.com>
3974
3975         [iOS WK2] Hit-testing fails when specifying a large top content inset
3976         https://bugs.webkit.org/show_bug.cgi?id=183648
3977         <rdar://problem/38421894>
3978
3979         Reviewed by Tim Horton.
3980
3981         Currently, in the process of computing unobscured content rect in the UI process on iOS, we subtract away parts
3982         of the view that are obscured by insets (e.g. MobileSafari's chrome). The helper method -[WKWebView
3983         _computeContentInset] is intended to compute these obscuring insets around the view, but it takes scroll view
3984         insets into account. This means that if WKWebView's inner scroll view has content insets, we'll end up shrinking
3985         the unobscured content rect as if the insetted region obscures the viewport; this causes visible content on the
3986         page to be uninteractible, since WKWebView erroneously thinks it's obscured.
3987
3988         To address this, we rename _computeContentInset to _computeObscuredInset, and make it _not_ affected by the
3989         scroll view's content insets. From code inspection and testing, all but one of the former call sites of
3990         _computeContentInset really need the obscured inset instead (see below). The one exception, -[WKWebView
3991         _adjustedContentOffset:], takes a scroll position from the page and maps it to a content offset in the inner
3992         UIScrollView (see below for more details).
3993
3994         Tests:  ScrollViewInsetTests.InnerHeightWithLargeTopContentInset
3995                 ScrollViewInsetTests.InnerHeightWithLargeBottomContentInset
3996                 ScrollViewInsetTests.RestoreInitialContentOffsetAfterCrash
3997                 ScrollViewInsetTests.RestoreInitialContentOffsetAfterNavigation
3998
3999         * UIProcess/API/Cocoa/WKWebView.mm:
4000         (-[WKWebView _setHasCustomContentView:loadedMIMEType:]):