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