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