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