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