1 2018-05-22 Sihui Liu <sihui_liu@apple.com>
3 [iOS] TestWebKitAPI.WebKit.WKHTTPCookieStoreWithoutProcessPool fails because cookies use different files with/without processpool
4 https://bugs.webkit.org/show_bug.cgi?id=185831
6 Reviewed by Chris Dumez.
8 Started to use uiProcessCookieStorageIdentifier for iOS: make sure cookies handled without
9 processpool would use the same storage file as when processpool exists.
11 * NetworkProcess/NetworkProcess.h:
12 * NetworkProcess/NetworkProcessCreationParameters.cpp:
13 (WebKit::NetworkProcessCreationParameters::encode const):
14 (WebKit::NetworkProcessCreationParameters::decode):
15 * NetworkProcess/NetworkProcessCreationParameters.h:
16 * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
17 (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
18 * Shared/WebProcessCreationParameters.cpp:
19 (WebKit::WebProcessCreationParameters::encode const):
20 (WebKit::WebProcessCreationParameters::decode):
21 * Shared/WebProcessCreationParameters.h:
22 * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
23 (WebKit::WebProcessPool::platformInitializeWebProcess):
24 (WebKit::WebProcessPool::platformInitializeNetworkProcess):
26 2018-05-22 Chris Dumez <cdumez@apple.com>
28 Regression(AsyncPolicyDelegates): Box.app login Window is blank
29 https://bugs.webkit.org/show_bug.cgi?id=185832
30 <rdar://problem/40307871>
32 Reviewed by Geoffrey Garen.
34 Moved WeakObjCPtr.h header from WebKit/ to wtf/ so that it can be used in
37 * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
38 * UIProcess/API/Cocoa/WKBrowsingContextControllerInternal.h:
39 * UIProcess/API/Cocoa/WKConnection.mm:
40 * UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
41 * UIProcess/API/Cocoa/WKProcessGroup.mm:
42 * UIProcess/API/Cocoa/WKProcessPool.mm:
43 * UIProcess/API/Cocoa/WKScriptMessage.mm:
44 * UIProcess/API/Cocoa/WKWebView.mm:
45 * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
46 * UIProcess/API/Cocoa/_WKAutomationSession.mm:
47 * UIProcess/API/Cocoa/_WKDownload.mm:
48 * UIProcess/API/Cocoa/_WKElementAction.mm:
49 * UIProcess/ApplicationStateTracker.h:
50 * UIProcess/Cocoa/AutomationClient.h:
51 * UIProcess/Cocoa/AutomationSessionClient.h:
52 * UIProcess/Cocoa/DiagnosticLoggingClient.h:
53 * UIProcess/Cocoa/DownloadClient.h:
54 * UIProcess/Cocoa/FindClient.h:
55 * UIProcess/Cocoa/FullscreenClient.h:
56 * UIProcess/Cocoa/IconLoadingDelegate.h:
57 * UIProcess/Cocoa/NavigationState.h:
58 * UIProcess/Cocoa/UIDelegate.h:
59 * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
60 * UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm:
61 * UIProcess/Cocoa/WebViewImpl.h:
62 * UIProcess/ios/ViewGestureControllerIOS.mm:
63 * UIProcess/ios/WKActionSheetAssistant.mm:
64 * UIProcess/ios/WKContentViewInteraction.mm:
65 * UIProcess/ios/WKPDFView.mm:
66 (-[WKPDFView web_setContentProviderData:suggestedFilename:]):
67 * UIProcess/ios/WKScrollView.mm:
68 * UIProcess/mac/WKInspectorViewController.mm:
69 * UIProcess/mac/WKInspectorWKWebView.mm:
70 * WebKit.xcodeproj/project.pbxproj:
71 * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
73 2018-05-22 Sihui Liu <sihui_liu@apple.com>
75 Conversion between SecurityOriginData and DatabaseIdentifier is asymmetric when port is null
76 https://bugs.webkit.org/show_bug.cgi?id=185715
78 Reviewed by Geoffrey Garen.
80 Add getter for origins in WKWebsiteDataRecord for testing.
82 * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
83 (-[WKWebsiteDataRecord _originsString]):
84 * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h:
87 2018-05-22 Brady Eidson <beidson@apple.com>
89 Rename the "Web content is visible" process assertion.
90 https://bugs.webkit.org/show_bug.cgi?id=185878
92 Reviewed by Chris Dumez.
94 * UIProcess/ios/ProcessAssertionIOS.mm:
95 (WebKit::ProcessAssertion::ProcessAssertion):
97 2018-05-22 Andy Estes <aestes@apple.com>
99 [Wi-Fi Assertions] Drop assertions on process suspension
100 https://bugs.webkit.org/show_bug.cgi?id=185844
101 <rdar://problem/40352319>
103 Reviewed by Daniel Bates.
105 * NetworkProcess/NetworkProcess.cpp:
106 (WebKit::NetworkProcess::actualPrepareToSuspend):
107 (WebKit::NetworkProcess::processDidResume):
108 * NetworkProcess/NetworkProcess.h:
109 * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
110 (WebKit::NetworkProcess::platformPrepareToSuspend):
111 (WebKit::NetworkProcess::platformProcessDidResume):
113 2018-05-22 Brent Fulgham <bfulgham@apple.com>
115 REGRESSION(r229093): Re-enable Network Extension support in the WebContent process (Take 2)
116 https://bugs.webkit.org/show_bug.cgi?id=185874
117 <rdar://problem/40454404>
119 Reviewed by Eric Carlson.
121 Add back a necessary XPC connection after locking down the network features in r229093.
123 * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
124 * WebProcess/com.apple.WebProcess.sb.in:
126 2018-05-22 Ryan Haddad <ryanhaddad@apple.com>
128 Unreviewed, rolling out r232052.
130 Breaks internal builds.
135 https://bugs.webkit.org/show_bug.cgi?id=185176
136 https://trac.webkit.org/changeset/232052
138 2018-05-22 Alberto Garcia <berto@igalia.com>
140 [CMake] Properly detect compiler flags, needed libs, and fallbacks for usage of 64-bit atomic operations
141 https://bugs.webkit.org/show_bug.cgi?id=182622
142 <rdar://problem/40292317>
144 Reviewed by Michael Catanzaro.
146 Move the test to determine whether we need to link against
147 libatomic to the common file WebKitCompilerFlags.cmake so it can
148 also be used for JavaScriptCore.
152 2018-05-22 Michael Catanzaro <mcatanzaro@igalia.com>
154 Unreviewed, rolling out r231843.
160 "[CMake] Properly detect compiler flags, needed libs, and
161 fallbacks for usage of 64-bit atomic operations"
162 https://bugs.webkit.org/show_bug.cgi?id=182622
163 https://trac.webkit.org/changeset/231843
165 2018-05-22 Carlos Garcia Campos <cgarcia@igalia.com>
167 Crash when loading a SVG image
168 https://bugs.webkit.org/show_bug.cgi?id=185819
170 Reviewed by Brent Fulgham.
172 This is happening in WebLoaderStrategy::scheduleLoad() when getting the value of
173 FrameLoaderClient::pageID(). SVGImage uses the empty clients for the loader, and
174 EmptyFrameLoaderClient::pageID() returns std::nullopt. The same happens with the frameID. This changed in
175 r225934, when pageID() and frameID() were changed to return std::optional, EmptyFrameLoaderClient was updated to
176 return std::nullopt instead of 0.
178 * WebProcess/Network/WebLoaderStrategy.cpp:
179 (WebKit::WebLoaderStrategy::scheduleLoad): Use value_or(0) instead of value() to get pageID and frameID from
182 2018-05-21 Yusuke Suzuki <utatane.tea@gmail.com>
185 https://bugs.webkit.org/show_bug.cgi?id=185176
187 Reviewed by JF Bastien.
189 * Configurations/Base.xcconfig:
190 * DerivedSources.make:
192 2018-05-21 Carlos Garcia Campos <cgarcia@igalia.com>
194 [GTK][Wayland] UI process crash when closing the window
195 https://bugs.webkit.org/show_bug.cgi?id=185818
197 Reviewed by Michael Catanzaro.
199 This happens when a page containing a text field is loaded but the focus remains in the url bar when the window
200 is closed. This is because we are sending a notify-in to the IM context, but the focus is still in the URL
201 bar. That confuses the wayland input method manager that tries to free the text of the web view IM context that has
202 already been deleted.
204 * UIProcess/gtk/InputMethodFilter.cpp:
205 (WebKit::InputMethodFilter::setEnabled): Only send notify-in if the view is actually focused.
207 2018-05-21 Ryosuke Niwa <rniwa@webkit.org>
209 Remove unused and no-op WKContextSetCookieStorageDirectory
210 https://bugs.webkit.org/show_bug.cgi?id=185857
212 Reviewed by Youenn Fablet.
214 Deleted C API which didn't do anything useful, and consequently not used by anyone.
216 * UIProcess/API/C/WKContext.cpp:
217 (WKContextSetCookieStorageDirectory): Deleted.
218 * UIProcess/API/C/WKContextPrivate.h:
219 * UIProcess/WebProcessPool.h:
221 2018-05-21 Chris Nardi <cnardi@chromium.org>
223 Remove dead exception in MediaList.appendMedium
224 https://bugs.webkit.org/show_bug.cgi?id=185278
226 Reviewed by Chris Dumez.
228 Remove code pertaining to an exception being thrown by appendMedium().
230 * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.cpp:
231 (webkit_dom_media_list_append_medium):
233 2018-05-21 Aditya Keerthi <akeerthi@apple.com>
235 [iOS] Click events only fire once when editing
236 https://bugs.webkit.org/show_bug.cgi?id=185777
238 Reviewed by Tim Horton.
240 gestureRecognizerShouldBegin: was returning false for the single tap gesture when a node was being
241 edited. This is an artifact of how the gesture was previously handled with the text selection assistant.
242 This condition is now removed, allowing the single tap gesture to go through and correctly propagate the
245 Also added an early return to _didGetTapHighlightForRequest: in order to prevent the tap highlight from
246 being shown when the node is already being assisted.
248 * UIProcess/ios/WKContentViewInteraction.mm:
249 (-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:]):
250 (-[WKContentView gestureRecognizerShouldBegin:]):
252 2018-05-21 Daniel Bates <dabates@apple.com>
254 REGRESSION (r231107): CSP report-only policies are ignored for beacon, importScripts, fetch(), EventSource, and XHR
255 https://bugs.webkit.org/show_bug.cgi?id=185789
256 <rdar://problem/40380175>
258 Reviewed by Andy Estes.
260 Have NetworkLoadChecker implement the ContentSecurityPolicyClient interface and support logging
261 console messages, sending CSP reports, and dispatching SecurityPolicyViolation events.
263 * NetworkProcess/NetworkConnectionToWebProcess.cpp:
264 (WebKit::NetworkConnectionToWebProcess::loadPing):
265 * NetworkProcess/NetworkLoadChecker.cpp:
266 (WebKit::NetworkLoadChecker::NetworkLoadChecker): Modified to take a reference to the NetworkConnectionToWebProcess,
267 the web page ID, the web frame ID, and the resource load identifier. These details are necessary
268 in order to implement the ContentSecurityPolicyClient interface.
269 (WebKit::NetworkLoadChecker::isAllowedByContentSecurityPolicy): Added.
270 (WebKit::NetworkLoadChecker::continueCheckingRequest): Write in terms of isAllowedByContentSecurityPolicy().
271 (WebKit::NetworkLoadChecker::contentSecurityPolicy): Pass ourself as the client so that we receive
273 (WebKit::NetworkLoadChecker::addConsoleMessage): Added.
274 (WebKit::NetworkLoadChecker::sendCSPViolationReport): Added.
275 (WebKit::NetworkLoadChecker::enqueueSecurityPolicyViolationEvent): Added.
276 * NetworkProcess/NetworkLoadChecker.h:
277 * NetworkProcess/NetworkResourceLoader.cpp:
278 (NetworkResourceLoader::enqueueSecurityPolicyViolationEvent): Added.
279 * NetworkProcess/NetworkResourceLoader.h:
280 * NetworkProcess/PingLoad.cpp:
281 (WebKit::PingLoad::PingLoad): Modified to take a reference to the NetworkConnectionToWebProcess and pass
282 this through to the NetworkLoadChecker along with the web page ID, web frame ID and resource load identifier.
283 * NetworkProcess/PingLoad.h:
284 * WebProcess/WebPage/WebPage.cpp:
285 (WebKit::WebPage::enqueueSecurityPolicyViolationEvent): Added.
286 * WebProcess/WebPage/WebPage.h:
287 * WebProcess/WebPage/WebPage.messages.in: Add message EnqueueSecurityPolicyViolationEvent.
289 2018-05-21 Brian Burg <bburg@apple.com>
291 Web Automation: always return an empty cookie list if document.cookieURL() is empty
292 https://bugs.webkit.org/show_bug.cgi?id=185838
293 <rdar://problem/37737526>
295 Reviewed by Tim Horton.
297 * WebProcess/Automation/WebAutomationSessionProxy.cpp:
298 (WebKit::WebAutomationSessionProxy::getCookiesForFrame):
299 This crashes in CFNetwork code because an empty cookie URL is not a valid input.
300 Just return an empty list since there couldn't be any cookies returned.
302 2018-05-21 Brian Burg <bburg@apple.com>
304 Web Automation: terminate the automation session if the network or storage process crashes
305 https://bugs.webkit.org/show_bug.cgi?id=185827
306 <rdar://problem/40424020>
308 Reviewed by Tim Horton.
310 If one of the processes crashes, the page may be in an undefined state and
311 automation will fail in unpredictable ways. It's better to just give up immediately.
313 * UIProcess/WebProcessPool.cpp:
314 (WebKit::WebProcessPool::networkProcessFailedToLaunch):
315 (WebKit::WebProcessPool::storageProcessCrashed):
317 2018-05-21 Sihui Liu <sihui_liu@apple.com>
319 Add a diskCacheSizeOverride accessor function on WKContextConfigurationRef
320 https://bugs.webkit.org/show_bug.cgi?id=185826
321 <rdar://problem/39732113>
323 Reviewed by Alex Christensen.
325 * UIProcess/API/C/WKContextConfigurationRef.cpp:
326 (WKContextConfigurationDiskCacheSizeOverride):
327 (WKContextConfigurationSetDiskCacheSizeOverride):
328 * UIProcess/API/C/WKContextConfigurationRef.h:
330 2018-05-21 Jer Noble <jer.noble@apple.com>
332 Complete fix for enabling modern EME by default
333 https://bugs.webkit.org/show_bug.cgi?id=185770
334 <rdar://problem/40368220>
336 Reviewed by Eric Carlson.
338 * Configurations/FeatureDefines.xcconfig:
340 2018-05-21 Sam Weinig <sam@webkit.org>
342 Modernize RenderStyleConstants.h - Part 1
343 https://bugs.webkit.org/show_bug.cgi?id=185809
345 Reviewed by Yusuke Suzuki.
347 * WebProcess/WebPage/ios/WebPageIOS.mm:
348 (WebKit::WebPage::rangeForWebSelectionAtPosition):
349 (WebKit::WebPage::getPositionInformation):
350 Update for new enum names.
352 2018-05-21 Carlos Garcia Campos <cgarcia@igalia.com>
354 Unreviewed. Update OptionsGTK.cmake and NEWS for 2.21.2 release.
356 * gtk/NEWS: Add release notes for 2.21.2.
358 2018-05-21 Carlos Garcia Campos <cgarcia@igalia.com>
360 Unreviewed, rolling out r222967.
366 "[GTK][WPE] Add API to configure and enable resource load
368 https://bugs.webkit.org/show_bug.cgi?id=177943
369 https://trac.webkit.org/changeset/222967
371 2018-05-18 Commit Queue <commit-queue@webkit.org>
373 Unreviewed, rolling out r231982.
374 https://bugs.webkit.org/show_bug.cgi?id=185793
376 Caused layout test failures (Requested by realdawei on
381 "Complete fix for enabling modern EME by default"
382 https://bugs.webkit.org/show_bug.cgi?id=185770
383 https://trac.webkit.org/changeset/231982
385 2018-05-18 Brian Burg <bburg@apple.com>
387 [Cocoa] Add missing nullability annotations to _WKAutomationSessionDelegate
388 https://bugs.webkit.org/show_bug.cgi?id=185791
389 <rdar://problem/40279891>
391 Reviewed by Tim Horton.
393 * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h: If there is no dialog shown,
394 then the delegate methods to return the dialog text may return a nil NSString.
396 2018-05-18 Youenn Fablet <youenn@apple.com>
398 NetworkLoadChecker should cancel its content extension retrieval task when being destroyed
399 https://bugs.webkit.org/show_bug.cgi?id=185661
400 <rdar://problem/39985509>
402 Reviewed by Chris Dumez.
404 Make sure that the Content Extension retrieval callback checks that NetworkLoadChecker is alive.
405 This allows stopping NetworkLoadChecker be ref counted.
406 This in turns allows NetworkResourceLoader to delete its NetworkLoadChecker when being deleted as well.
407 By doing so, we simplify the memory management of NetworkResourceLoader and NetworkLoadChecker.
409 * NetworkProcess/NetworkLoadChecker.cpp:
410 (WebKit::NetworkLoadChecker::checkRequest):
411 (WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad):
412 * NetworkProcess/NetworkLoadChecker.h:
413 (WebKit::NetworkLoadChecker::weakPtrFactory):
414 * NetworkProcess/NetworkResourceLoader.cpp:
415 * NetworkProcess/NetworkResourceLoader.h:
416 * NetworkProcess/PingLoad.cpp:
417 (WebKit::PingLoad::PingLoad):
418 * NetworkProcess/PingLoad.h:
420 2018-05-18 Per Arne Vollan <pvollan@apple.com>
422 WebProcess fails to launch
423 https://bugs.webkit.org/show_bug.cgi?id=185140
425 Reviewed by Geoffrey Garen.
427 If the NSApplication runloop is not used in the WebContent process, launchServicesCheckIn() needs to be called
428 in order for enableSandboxStyleFileQuarantine() to succeed. Determine at runtime if launchServicesCheckIn()
429 should be called by checking if the NSApplication event loop is running.
431 * WebProcess/cocoa/WebProcessCocoa.mm:
432 (WebKit::WebProcess::platformInitializeProcess):
434 2018-05-18 Jer Noble <jer.noble@apple.com>
436 Complete fix for enabling modern EME by default
437 https://bugs.webkit.org/show_bug.cgi?id=185770
438 <rdar://problem/40368220>
440 Reviewed by Eric Carlson.
442 * Configurations/FeatureDefines.xcconfig:
444 2018-05-18 Brent Fulgham <bfulgham@apple.com>
446 Convert ProcessPrivilege assertions to regular debug-only assertions
447 https://bugs.webkit.org/show_bug.cgi?id=185775
448 <rdar://problem/40372286>
450 Reviewed by Geoffrey Garen.
452 In Bug 184322 I added a number of RELEASE_ASSERT checks that certain
453 UI-only calls were not being made in the WebContent process.
455 Measurements have shown that these RELEASE_ASSERTs have regressed performance
456 by around 1% on some benchmarks, so we should convert them to normal asserts.
458 This patch changes the RELEASE_ASSERTs into ASSERTs.
460 * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
461 (WebKit::WebProcessPool::platformInitializeWebProcess):
462 * UIProcess/Cocoa/WebViewImpl.mm:
463 (WebKit::WebViewImpl::WebViewImpl):
464 (WebKit::WebViewImpl::becomeFirstResponder):
465 (WebKit::WebViewImpl::pluginFocusOrWindowFocusChanged):
466 (WebKit::WebViewImpl::validateUserInterfaceItem):
467 (WebKit::WebViewImpl::startSpeaking):
468 (WebKit::WebViewImpl::stopSpeaking):
469 (WebKit::applicationFlagsForDrag):
470 (WebKit::WebViewImpl::doneWithKeyEvent):
471 * UIProcess/Gamepad/mac/UIGamepadProviderMac.mm:
472 (WebKit::UIGamepadProvider::platformWebPageProxyForGamepadInput):
473 * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
474 (WebKit::PluginProcessProxy::enterFullscreen):
475 (WebKit::PluginProcessProxy::beginModal):
476 (WebKit::PluginProcessProxy::endModal):
477 * UIProcess/mac/DisplayLink.cpp:
478 (WebKit::DisplayLink::DisplayLink):
479 (WebKit::DisplayLink::~DisplayLink):
480 * UIProcess/mac/WebPageProxyMac.mm:
481 (WebKit::WebPageProxy::getIsSpeaking):
482 (WebKit::WebPageProxy::speak):
483 (WebKit::WebPageProxy::stopSpeaking):
484 (WebKit::WebPageProxy::startDisplayLink):
485 * UIProcess/mac/WebPopupMenuProxyMac.mm:
486 (WebKit::WebPopupMenuProxyMac::showPopupMenu):
488 2018-05-18 Eric Carlson <eric.carlson@apple.com>
490 Handle failure to extend sandbox gracefully
491 https://bugs.webkit.org/show_bug.cgi?id=185779
492 <rdar://problem/40316349>
494 Reviewed by Brent Fulgham.
496 * UIProcess/API/Cocoa/WKWebView.mm:
497 (-[WKWebView _denyNextUserMediaRequest]):
498 * UIProcess/API/Cocoa/WKWebViewPrivate.h:
500 * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
501 (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Don't append
502 the request to m_grantedRequests if it failed.
503 (WebKit::UserMediaPermissionRequestManagerProxy::grantAccess): Deny request if willCreateMediaStream
505 * UIProcess/UserMediaPermissionRequestManagerProxy.h:
507 * UIProcess/UserMediaProcessManager.cpp:
508 (WebKit::UserMediaProcessManager::willCreateMediaStream): Don't try to extend sandbox if
509 we fail to allocate all necessary handles.
510 * UIProcess/UserMediaProcessManager.h:
511 (WebKit::UserMediaProcessManager::denyNextUserMediaRequest): New, for testing.
513 2018-05-18 Antoine Quint <graouts@apple.com>
515 [Web Animations] Turn Web Animations with CSS integration on for test runners
516 https://bugs.webkit.org/show_bug.cgi?id=184819
517 <rdar://problem/39597337>
519 Unreviewed. Rolling out the patch for this bug, it caused some flaky timeouts for animation suspension tests.
521 * Shared/WebPreferences.yaml:
523 2018-05-18 Wenson Hsieh <wenson_hsieh@apple.com>
525 [Extra zoom mode] Clearing text fields should dispatch input events of type "deleteContent"
526 https://bugs.webkit.org/show_bug.cgi?id=185769
527 <rdar://problem/40368261>
529 Reviewed by Tim Horton.
531 When setting the text of the currently focused element to the empty string, just delete the text instead of
532 pretending to insert an empty string. This mimics deleting content using the delete key on macOS, and fires an
533 input event with inputType "deleteContent" instead of "insertText".
535 Test: fast/forms/extrazoom/delete-content-in-text-field.html
537 * WebProcess/WebPage/WebPage.cpp:
538 (WebKit::WebPage::setTextAsync):
540 2018-05-18 Keith Rollin <krollin@apple.com>
542 Renamed "trackNetworkActivity" to "tracksResourceLoadMilestones"
543 https://bugs.webkit.org/show_bug.cgi?id=185523
544 <rdar://problem/40136361>
546 Reviewed by Geoffrey Garen.
548 * NetworkProcess/NetworkConnectionToWebProcess.cpp:
549 (WebKit::networkActivityTrackingEnabled):
550 * NetworkProcess/NetworkProcess.cpp:
551 (WebKit::NetworkProcess::initializeNetworkProcess):
552 * NetworkProcess/NetworkProcess.h:
553 (WebKit::NetworkProcess::tracksResourceLoadMilestones const):
554 (WebKit::NetworkProcess::trackNetworkActivity const): Deleted.
555 * NetworkProcess/NetworkProcessCreationParameters.cpp:
556 (WebKit::NetworkProcessCreationParameters::encode const):
557 (WebKit::NetworkProcessCreationParameters::decode):
558 * NetworkProcess/NetworkProcessCreationParameters.h:
559 * UIProcess/API/APIProcessPoolConfiguration.cpp:
560 (API::ProcessPoolConfiguration::copy):
561 * UIProcess/API/APIProcessPoolConfiguration.h:
562 * UIProcess/API/C/WKContextConfigurationRef.cpp:
563 (WKContextConfigurationTracksResourceLoadMilestones):
564 (WKContextConfigurationSetTracksResourceLoadMilestones):
565 (WKContextConfigurationTrackNetworkActivity): Deleted.
566 (WKContextConfigurationSetTrackNetworkActivity): Deleted.
567 * UIProcess/API/C/WKContextConfigurationRef.h:
568 * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
569 * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
570 (-[_WKProcessPoolConfiguration tracksResourceLoadMilestones]):
571 (-[_WKProcessPoolConfiguration setTracksResourceLoadMilestones:]):
572 (-[_WKProcessPoolConfiguration trackNetworkActivity]): Deleted.
573 (-[_WKProcessPoolConfiguration setTrackNetworkActivity:]): Deleted.
574 * UIProcess/WebProcessPool.cpp:
575 (WebKit::WebProcessPool::ensureNetworkProcess):
577 2018-05-18 Chris Dumez <cdumez@apple.com>
579 Avoid keeping the frame alive when ref'ing a WindowProxy
580 https://bugs.webkit.org/show_bug.cgi?id=185737
581 <rdar://problem/40004666>
583 Reviewed by Sam Weinig.
585 * WebProcess/Plugins/PluginView.cpp:
586 (WebKit::PluginView::windowScriptNPObject):
588 2018-05-18 Youenn Fablet <youenn@apple.com>
590 -Wmemset-elt-size warning in LibWebRTCSocket constructor
591 https://bugs.webkit.org/show_bug.cgi?id=185555
592 <rdar://problem/40217250>
594 Reviewed by Darin Adler.
596 GetOption implementation was broken in that it was not initializing properly its array of options.
597 This patch fixes it by using an array of optional<int> which are initialized by default.
598 When no value is set, we return the error code -1.
599 In theory, we should go to NetworkProcess to get the actual value.
600 Since GetOption is not used in practice, we just do this best effort implementation of storing previously set values.
602 * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
603 (WebKit::LibWebRTCSocket::LibWebRTCSocket):
604 (WebKit::LibWebRTCSocket::GetOption):
605 * WebProcess/Network/webrtc/LibWebRTCSocket.h:
607 2018-05-18 Antoine Quint <graouts@apple.com>
609 [Web Animations] Turn Web Animations with CSS integration on for test runners
610 https://bugs.webkit.org/show_bug.cgi?id=184819
611 <rdar://problem/39597337>
615 * Shared/WebPreferences.yaml: Leave Web Animations off by default, it's up to clients
618 2018-05-18 Fujii Hironori <Hironori.Fujii@sony.com>
620 [Curl] Remove unused SystemProxyWin.cpp
621 https://bugs.webkit.org/show_bug.cgi?id=185224
623 Reviewed by Antti Koivisto.
625 SystemProxyWin is not used at the moment. Remove it.
627 * NetworkProcess/win/SystemProxyWin.cpp: Removed.
628 * NetworkProcess/win/SystemProxyWin.h: Removed.
629 * PlatformWin.cmake: Removed SystemProxyWin.cpp.
631 2018-05-17 Nan Wang <n_wang@apple.com>
633 AX: [macOS] Expose the primary screen height through AX API
634 https://bugs.webkit.org/show_bug.cgi?id=185742
636 Reviewed by Chris Fleizach.
638 * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
639 (-[WKAccessibilityWebPageObject accessibilityAttributeNames]):
640 (-[WKAccessibilityWebPageObject accessibilityAttributeValue:]):
642 2018-05-17 Alex Christensen <achristensen@webkit.org>
644 Use CompletionHandlers for DelayedReplies
645 https://bugs.webkit.org/show_bug.cgi?id=182269
647 Reviewed by Youenn Fablet.
649 DelayedReplies should be a noncopyable, non-refcountable type. They should be
650 called once and only once. This is what CompletionHandlers are for.
652 No change in behavior. Just cleaner code.
654 * NetworkProcess/NetworkConnectionToWebProcess.cpp:
655 (WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
656 * NetworkProcess/NetworkConnectionToWebProcess.h:
657 * NetworkProcess/NetworkResourceLoader.cpp:
658 (WebKit::NetworkResourceLoader::SynchronousLoadData::SynchronousLoadData):
659 (WebKit::sendReplyToSynchronousRequest):
660 (WebKit::NetworkResourceLoader::NetworkResourceLoader):
661 * NetworkProcess/NetworkResourceLoader.h:
662 * Platform/IPC/HandleMessage.h:
663 (IPC::callMemberFunctionImpl):
664 (IPC::callMemberFunction):
665 (IPC::handleMessageDelayed):
666 * PluginProcess/PluginControllerProxy.cpp:
667 (WebKit::PluginControllerProxy::setInitializationReply):
668 (WebKit::PluginControllerProxy::takeInitializationReply):
669 * PluginProcess/PluginControllerProxy.h:
670 * PluginProcess/WebProcessConnection.cpp:
671 (WebKit::WebProcessConnection::destroyPlugin):
672 (WebKit::WebProcessConnection::createPlugin):
673 (WebKit::WebProcessConnection::createPluginAsynchronously):
674 * PluginProcess/WebProcessConnection.h:
675 * Scripts/webkit/LegacyMessageReceiver-expected.cpp:
676 (Messages::WebPage::GetPluginProcessConnection::send):
677 (Messages::WebPage::TestMultipleAttributes::send):
678 (Messages::WebPage::GetPluginProcessConnection::DelayedReply::DelayedReply): Deleted.
679 (Messages::WebPage::GetPluginProcessConnection::DelayedReply::~DelayedReply): Deleted.
680 (Messages::WebPage::GetPluginProcessConnection::DelayedReply::send): Deleted.
681 (Messages::WebPage::TestMultipleAttributes::DelayedReply::DelayedReply): Deleted.
682 (Messages::WebPage::TestMultipleAttributes::DelayedReply::~DelayedReply): Deleted.
683 (Messages::WebPage::TestMultipleAttributes::DelayedReply::send): Deleted.
684 * Scripts/webkit/LegacyMessages-expected.h:
685 * Scripts/webkit/MessageReceiver-expected.cpp:
686 (Messages::WebPage::GetPluginProcessConnection::send):
687 (Messages::WebPage::TestMultipleAttributes::send):
688 (Messages::WebPage::GetPluginProcessConnection::DelayedReply::DelayedReply): Deleted.
689 (Messages::WebPage::GetPluginProcessConnection::DelayedReply::~DelayedReply): Deleted.
690 (Messages::WebPage::GetPluginProcessConnection::DelayedReply::send): Deleted.
691 (Messages::WebPage::TestMultipleAttributes::DelayedReply::DelayedReply): Deleted.
692 (Messages::WebPage::TestMultipleAttributes::DelayedReply::~DelayedReply): Deleted.
693 (Messages::WebPage::TestMultipleAttributes::DelayedReply::send): Deleted.
694 * Scripts/webkit/Messages-expected.h:
695 * Scripts/webkit/messages.py:
696 * UIProcess/Network/NetworkProcessProxy.cpp:
697 (WebKit::NetworkProcessProxy::getNetworkProcessConnection):
698 (WebKit::NetworkProcessProxy::networkProcessCrashed):
699 (WebKit::NetworkProcessProxy::networkProcessFailedToLaunch):
700 (WebKit::NetworkProcessProxy::didCreateNetworkConnectionToWebProcess):
701 * UIProcess/Network/NetworkProcessProxy.h:
702 * UIProcess/Plugins/PluginProcessManager.cpp:
703 (WebKit::PluginProcessManager::getPluginProcessConnection):
704 * UIProcess/Plugins/PluginProcessManager.h:
705 * UIProcess/Plugins/PluginProcessProxy.cpp:
706 (WebKit::PluginProcessProxy::getPluginProcessConnection):
707 (WebKit::PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch):
708 (WebKit::PluginProcessProxy::didCreateWebProcessConnection):
709 * UIProcess/Plugins/PluginProcessProxy.h:
710 * UIProcess/Storage/StorageProcessProxy.cpp:
711 (WebKit::StorageProcessProxy::getStorageProcessConnection):
712 (WebKit::StorageProcessProxy::didClose):
713 (WebKit::StorageProcessProxy::didCreateStorageToWebProcessConnection):
714 * UIProcess/Storage/StorageProcessProxy.h:
715 * UIProcess/WebPageProxy.cpp:
716 (WebKit::ExceededDatabaseQuotaRecords::createRecord):
717 (WebKit::WebPageProxy::receivedPolicyDecision):
718 (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
719 (WebKit::WebPageProxy::createNewPage):
720 (WebKit::WebPageProxy::runJavaScriptAlert):
721 (WebKit::WebPageProxy::runJavaScriptConfirm):
722 (WebKit::WebPageProxy::runJavaScriptPrompt):
723 (WebKit::WebPageProxy::webGLPolicyForURL):
724 (WebKit::WebPageProxy::resolveWebGLPolicyForURL):
725 (WebKit::WebPageProxy::getToolbarsAreVisible):
726 (WebKit::WebPageProxy::getMenuBarIsVisible):
727 (WebKit::WebPageProxy::getStatusBarIsVisible):
728 (WebKit::WebPageProxy::getWindowFrame):
729 (WebKit::WebPageProxy::screenToRootView):
730 (WebKit::WebPageProxy::rootViewToScreen):
731 (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel):
732 (WebKit::WebPageProxy::exceededDatabaseQuota):
733 (WebKit::WebPageProxy::reachedApplicationCacheOriginQuota):
734 * UIProcess/WebPageProxy.h:
735 * UIProcess/WebProcessPool.cpp:
736 (WebKit::WebProcessPool::networkProcessCrashed):
737 (WebKit::WebProcessPool::getNetworkProcessConnection):
738 (WebKit::WebProcessPool::getStorageProcessConnection):
739 * UIProcess/WebProcessPool.h:
740 * UIProcess/WebProcessProxy.cpp:
741 (WebKit::WebProcessProxy::getPluginProcessConnection):
742 (WebKit::WebProcessProxy::getNetworkProcessConnection):
743 (WebKit::WebProcessProxy::getStorageProcessConnection):
744 * UIProcess/WebProcessProxy.h:
745 * WebProcess/Storage/WebSWContextManagerConnection.cpp:
746 (WebKit::WebSWContextManagerConnection::syncTerminateWorker):
747 * WebProcess/Storage/WebSWContextManagerConnection.h:
748 * WebProcess/WebPage/WebPage.h:
749 * WebProcess/WebPage/ios/WebPageIOS.mm:
750 (WebKit::WebPage::computePagesForPrintingAndDrawToPDF):
752 2018-05-17 Jer Noble <jer.noble@apple.com>
754 CRASH in -[WKFullScreenViewController _manager]
755 https://bugs.webkit.org/show_bug.cgi?id=185745
756 <rdar://problem/39195241>
758 Reviewed by Eric Carlson.
760 Protect against WKFullScreenViewController outliving WKWebView by making its
761 _webView property weak. Additionally, add a sanity-check RetainPtr where _webView
762 is referenced multiple times within a function.
764 * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
765 * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
766 (-[WKFullScreenWindowController initWithWebView:]):
767 (-[WKFullScreenWindowController enterFullScreen]):
768 (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
769 (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
770 (-[WKFullScreenWindowController _completedExitFullScreen]):
771 (-[WKFullScreenWindowController close]):
772 (-[WKFullScreenWindowController webViewDidRemoveFromSuperviewWhileInFullscreen]):
773 (-[WKFullScreenWindowController _exitFullscreenImmediately]):
774 (-[WKFullScreenWindowController _isSecure]):
775 (-[WKFullScreenWindowController _serverTrust]):
776 (-[WKFullScreenWindowController _updateLocationInfo]):
777 (-[WKFullScreenWindowController _manager]):
778 (-[WKFullScreenWindowController _startToDismissFullscreenChanged:]):
780 2018-05-17 Brent Fulgham <bfulgham@apple.com>
782 Correct default for StorageAccess API
783 https://bugs.webkit.org/show_bug.cgi?id=185748
784 <rdar://problem/40220659>
786 Reviewed by Dean Jackson.
788 Flip the default state to 'true' so that the new "sticky" state
789 for Storage Access API and attributing user interaction for
790 Storage Access API use is applied by default.
792 * Shared/WebPreferences.yaml:
794 2018-05-17 Carlos Alberto Lopez Perez <clopez@igalia.com>
796 [WPE] Implement and enable FULLSCREEN_API
797 https://bugs.webkit.org/show_bug.cgi?id=185676
799 Reviewed by Žan Doberšek.
801 Do the initial implementation of FULLSCREEN_API for WPE and
802 enable the CMake option by default.
804 Most of the layout tests (55 of 58) are passing and the feature
805 seems to work fine on different websites that use it.
807 * UIProcess/API/wpe/PageClientImpl.cpp:
808 (WebKit::PageClientImpl::fullScreenManagerProxyClient):
809 (WebKit::PageClientImpl::closeFullScreenManager):
810 (WebKit::PageClientImpl::isFullScreen):
811 (WebKit::PageClientImpl::enterFullScreen):
812 (WebKit::PageClientImpl::exitFullScreen):
813 (WebKit::PageClientImpl::beganEnterFullScreen):
814 (WebKit::PageClientImpl::beganExitFullScreen):
815 * UIProcess/API/wpe/PageClientImpl.h:
816 * UIProcess/API/wpe/WPEView.h:
817 (WKWPE::View::isFullScreen):
818 (WKWPE::View::setFullScreen):
820 2018-05-17 Jiewen Tan <jiewen_tan@apple.com>
822 Convert CertificateInfo into Credential in UI Process instead of Networking Process
823 https://bugs.webkit.org/show_bug.cgi?id=185662
824 <rdar://problem/40275561>
826 Reviewed by Alex Christensen.
828 Right now we convert CertificateInfo into Credential in the very last stage of client certificate authentication process
829 when it reaches Networking Process. This patch moves that conversion earlier in UI Process such that we don't have to
830 pass both Credential and CertificateInfo to Networking Process.
832 CertificateInfo is only used in macOS for C API specifically. WK2 includes macOS/iOS relies on NSURLCredential/WebCore::Credential
833 solely. WK2 has already exercised the ability of using WebCore::Credential to do client certficate authentication. This patch therefore
834 takes advantage of that. It converts CertficateInfo objects into Credential objects right after WebCredential is initialized, and then merge
835 any code paths that utilizes CertficateInfo into ones that uses WebCore::Credential.
837 Covered by existing tests.
839 * Shared/Authentication/AuthenticationManager.cpp:
840 (WebKit::AuthenticationManager::useCredentialForChallenge):
841 (WebKit::AuthenticationManager::useCredentialForSingleChallenge):
842 (WebKit::AuthenticationManager::tryUseCertificateInfoForChallenge): Deleted.
843 * Shared/Authentication/AuthenticationManager.h:
844 * Shared/Authentication/AuthenticationManager.messages.in:
845 * UIProcess/Authentication/AuthenticationChallengeProxy.cpp:
846 (WebKit::AuthenticationChallengeProxy::useCredential):
847 * UIProcess/Authentication/WebCredential.cpp:
848 (WebKit::WebCredential::WebCredential):
849 (WebKit::WebCredential::certificateInfo): Deleted.
850 * UIProcess/Authentication/WebCredential.h:
851 (WebKit::WebCredential::create):
852 * UIProcess/Authentication/mac/WebCredentialMac.mm: Renamed from Source/WebKit/Shared/Authentication/mac/AuthenticationManager.mac.mm.
853 (WebKit::leafCertificate):
855 (WebKit::WebCredential::WebCredential):
856 * WebKit.xcodeproj/project.pbxproj:
858 2018-05-17 Jeremy Jones <jeremyj@apple.com>
860 Ensure valid rects for fullsceen animation.
861 https://bugs.webkit.org/show_bug.cgi?id=185736
862 rdar://problem/40320174
864 Reviewed by Jer Noble.
866 Protect against zero width and height since those can make for NANs in the animation transforms.
868 * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
869 (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
870 (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
872 2018-05-17 Jer Noble <jer.noble@apple.com>
874 Turn Modern EME API on by default and remove it as an experimental feature
875 https://bugs.webkit.org/show_bug.cgi?id=185693
876 <rdar://problem/39954396>
878 Reviewed by Eric Carlson.
880 * Shared/WebPreferences.yaml:
882 2018-05-17 Dean Jackson <dino@apple.com>
884 Safari optimized flow should be releasing viewer to prevent memory growth with subsequent launches/closes
885 https://bugs.webkit.org/show_bug.cgi?id=185722
886 <rdar://problem/40247351>
888 Reviewed by Antoine Quint.
890 I made a rookie mistake in the original patch: I was holding a strong
891 reference to "self" in a block, which was causing a retain cycle.
892 Replace that with a WeakObjCPtr.
894 * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
895 (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
897 2018-05-16 Brent Fulgham <bfulgham@apple.com>
899 REGRESSION(r229093)[macOS] Allow network-outbound for syslog use
900 https://bugs.webkit.org/show_bug.cgi?id=185703
901 <rdar://problem/39778918>
903 Reviewed by Eric Carlson.
905 In r229093 I removed the 'network-outbound' permission for syslog use.
906 Further testing has shown that this is still needed for subsystem
907 logging in our bundle loading code.
909 This patch re-enabled network-outbound for syslog.
911 * WebProcess/com.apple.WebProcess.sb.in:
913 2018-05-16 Andy VanWagoner <andy@vanwagoner.family>
915 Add support for Intl NumberFormat formatToParts
916 https://bugs.webkit.org/show_bug.cgi?id=185375
918 Reviewed by Yusuke Suzuki.
920 Add flag for NumberFormat formatToParts.
922 * Configurations/FeatureDefines.xcconfig:
924 2018-05-16 Andy Estes <aestes@apple.com>
926 [Wi-Fi Assertions] Adopt WiFiAssertionHolderAdditions
927 https://bugs.webkit.org/show_bug.cgi?id=185685
928 <rdar://problem/40136681>
930 Reviewed by Sam Weinig.
932 * NetworkProcess/cocoa/WiFiAssertionHolder.cpp:
933 (WebKit::WiFiAssertionHolder::WiFiAssertionHolder):
934 (WebKit::WiFiAssertionHolder::~WiFiAssertionHolder):
935 (WebKit::ensureWiFiManagerClient): Deleted.
937 2018-05-16 Fujii Hironori <Hironori.Fujii@sony.com>
939 [Win] Implement WebPage::handleEditingKeyboardEvent
940 https://bugs.webkit.org/show_bug.cgi?id=185327
942 Reviewed by Alexey Proskuryakov.
944 * WebProcess/WebPage/win/WebPageWin.cpp:
945 (WebKit::WebPage::handleEditingKeyboardEvent): Copied from WebKitLegacy.
947 2018-05-16 Sihui Liu <sihui_liu@apple.com>
949 Session cookies aren't reliably set when using default WKWebSiteDataStore
950 https://bugs.webkit.org/show_bug.cgi?id=185624
951 <rdar://problem/39111626>
953 Reviewed by Geoffrey Garen.
955 Session cookies of default session were set in UI Process when there was no process pool,
956 but they were not synced (or synced slowly to) Network Process. To make these cookies visible
957 as soon as they were set through API, we could manually set those cookies in Network Process
958 during its initilization.
960 * NetworkProcess/mac/RemoteNetworkingContext.mm:
961 (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
962 * UIProcess/API/APIHTTPCookieStore.cpp:
963 (API::HTTPCookieStore::cookies):
964 (API::HTTPCookieStore::setCookie):
965 (API::HTTPCookieStore::deleteCookie):
966 * UIProcess/WebProcessPool.cpp:
967 (WebKit::WebProcessPool::ensureNetworkProcess):
968 (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
969 * UIProcess/WebsiteData/WebsiteDataStore.cpp:
970 (WebKit::WebsiteDataStore::clearPendingCookies):
971 * UIProcess/WebsiteData/WebsiteDataStore.h:
973 2018-05-16 Chris Nardi <cnardi@chromium.org>
975 Remove Document#selectedStylesheetSet/preferredStylesheetSet
976 https://bugs.webkit.org/show_bug.cgi?id=185381
978 Reviewed by Darin Adler.
980 Make API methods for Document#selectedStylesheetSet/preferredStylesheetSet do nothing.
982 * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.h:
983 * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp:
984 (webkit_dom_document_set_property):
985 (webkit_dom_document_get_property):
986 (webkit_dom_document_get_preferred_stylesheet_set):
987 (webkit_dom_document_get_selected_stylesheet_set):
988 (webkit_dom_document_set_selected_stylesheet_set):
990 2018-05-16 Alberto Garcia <berto@igalia.com>
992 [CMake] Properly detect compiler flags, needed libs, and fallbacks for usage of 64-bit atomic operations
993 https://bugs.webkit.org/show_bug.cgi?id=182622
995 Reviewed by Michael Catanzaro.
997 Move the test to determine whether we need to link against
998 libatomic to the common file WebKitCompilerFlags.cmake so it can
999 also be used for JavaScriptCore.
1003 2018-05-15 Yusuke Suzuki <utatane.tea@gmail.com>
1005 [JSC] Check TypeInfo first before calling getCallData when we would like to check whether given object is a function
1006 https://bugs.webkit.org/show_bug.cgi?id=185601
1008 Reviewed by Saam Barati.
1010 * WebProcess/Plugins/Netscape/JSNPObject.h:
1012 2018-05-15 Sihui Liu <sihui_liu@apple.com>
1014 StorageManager::deleteLocalStorageOriginsModifiedSince: database files get deleted before database connections close
1015 https://bugs.webkit.org/show_bug.cgi?id=185671
1017 Reviewed by Geoffrey Garen.
1019 We should delete database files before closing databases.
1021 * UIProcess/WebStorage/LocalStorageDatabase.cpp:
1022 (WebKit::LocalStorageDatabase::updateDatabaseWithChangedItems):
1023 * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
1024 (WebKit::LocalStorageDatabaseTracker::databasesModifiedSince):
1025 (WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince): Deleted.
1026 * UIProcess/WebStorage/LocalStorageDatabaseTracker.h:
1027 * UIProcess/WebStorage/StorageManager.cpp:
1028 (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
1030 2018-05-15 Dean Jackson <dino@apple.com>
1032 Launch System Preview as the download starts, rather than waiting for a response
1033 https://bugs.webkit.org/show_bug.cgi?id=185669
1034 <rdar://problem/40278181>
1036 Reviewed by Tim Horton.
1038 We were waiting for the RequestResponse to get a MIME-type before
1039 launching the system preview. This causes an annoying delay.
1041 Instead, assume that the system preview is one of the handled
1042 mime types and launch the viewer immediately. If it gets something it
1043 didn't expect, it will show an error.
1045 * UIProcess/Cocoa/DownloadClient.mm:
1046 (WebKit::DownloadClient::didStart):
1047 (WebKit::DownloadClient::didReceiveResponse):
1048 * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
1049 (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
1050 (WebKit::SystemPreviewController::start): Small cleanup to ensure we
1051 don't try to present twice (this shouldn't happen).
1053 2018-05-15 Dean Jackson <dino@apple.com>
1055 Post-review cleanup for 185459
1056 https://bugs.webkit.org/show_bug.cgi?id=185665
1057 <rdar://problem/40276689>
1059 Reviewed by Tim Horton.
1061 Jon made some comments in 185459 that I'm addressing here.
1063 * UIProcess/Cocoa/DownloadClient.h:
1064 * UIProcess/Cocoa/DownloadClient.mm: Guard the activity token for iOS
1065 in a way that means it will still work ok on macOS.
1066 (WebKit::DownloadClient::didStart):
1067 (WebKit::DownloadClient::processDidCrash):
1068 (WebKit::DownloadClient::didFinish):
1069 (WebKit::DownloadClient::didFail):
1070 (WebKit::DownloadClient::didCancel):
1071 (WebKit::DownloadClient::takeActivityToken):
1072 (WebKit::DownloadClient::releaseActivityTokenIfNecessary):
1073 (WebKit::DownloadClient::releaseActivityToken): Deleted.
1075 * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: Add an early return.
1076 (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
1078 2018-05-15 Tadeu Zagallo <tzagallo@apple.com>
1080 Update touch event tracking types on every touch
1081 https://bugs.webkit.org/show_bug.cgi?id=184250
1082 <rdar://problem/39145092>
1084 Reviewed by Geoffrey Garen.
1086 The tracking types for touch events were only update on touchstart, which meant that event
1087 listeners added after the touchstart would always be treated as passive, even if explicitly
1088 setting passive to false.
1090 * UIProcess/WebPageProxy.cpp:
1091 (WebKit::WebPageProxy::handleTouchEventSynchronously):
1092 (WebKit::WebPageProxy::handleTouchEvent):
1094 2018-05-15 Per Arne Vollan <pvollan@apple.com>
1096 Pause display links when window is not visible.
1097 https://bugs.webkit.org/show_bug.cgi?id=185627
1098 <rdar://problem/39401106>
1100 Reviewed by Simon Fraser.
1102 Pause/resume display links created in the UI process when the window is hidden/shown.
1104 * UIProcess/WebPageProxy.cpp:
1105 (WebKit::WebPageProxy::dispatchActivityStateChange):
1106 * UIProcess/mac/DisplayLink.cpp:
1107 (WebKit::DisplayLink::pause):
1108 (WebKit::DisplayLink::resume):
1109 * UIProcess/mac/DisplayLink.h:
1111 2018-05-15 Dean Jackson <dino@apple.com>
1113 Provide UIView and UIImage for zoom transition
1114 https://bugs.webkit.org/show_bug.cgi?id=185655
1115 <rdar://problem/40267224>
1117 Reviewed by Antoine Quint.
1119 Provide a UIView* for the frameForPreviewItem to use as a source view.
1120 Also implement the transitionImageForPreviewItem delegate, even though
1121 we're returning nil.
1123 * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
1124 (-[_WKPreviewControllerDelegate previewController:frameForPreviewItem:inSourceView:]):
1125 (-[_WKPreviewControllerDelegate previewController:transitionImageForPreviewItem:contentRect:]):
1127 2018-05-15 Daniel Bates <dabates@apple.com>
1129 Fix the Apple Internal build
1131 Make a similar change to WebKit as I did for LegacyWebKit in r231777. See <rdar://problem/40237873> for more details.
1133 * UIProcess/mac/WKFullScreenWindowController.mm:
1134 (-[WKFullScreenWindowController enterFullScreen:]):
1135 (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
1136 (-[WKFullScreenWindowController exitFullScreen]):
1137 (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
1138 (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
1139 (-[WKFullScreenWindowController completeFinishExitFullScreenAnimationAfterRepaint]):
1140 (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]):
1141 (-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]):
1143 2018-05-15 Megan Gardner <megan_gardner@apple.com>
1145 Clear selections from web content with single tap
1146 https://bugs.webkit.org/show_bug.cgi?id=185634
1148 Reviewed by Tim Horton.
1150 With the switch to the single text selection assistant, we were not correctly clearing the selection when a
1151 single tap happened.
1153 * UIProcess/ios/WKContentViewInteraction.mm:
1154 (-[WKContentView _singleTapCommited:]):
1156 2018-05-15 Antoine Quint <graouts@apple.com>
1158 [Web Animations] Expose Web Animations CSS integration as an experimental feature
1159 https://bugs.webkit.org/show_bug.cgi?id=185647
1161 Reviewed by Dean Jackson.
1163 Rename the Web Animations CSS integration flag.
1165 * Shared/WebPreferences.yaml:
1166 * UIProcess/API/C/WKPreferences.cpp:
1167 (WKPreferencesSetWebAnimationsCSSIntegrationEnabled):
1168 (WKPreferencesGetWebAnimationsCSSIntegrationEnabled):
1169 (WKPreferencesSetCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled): Deleted.
1170 (WKPreferencesGetCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled): Deleted.
1171 * UIProcess/API/C/WKPreferencesRefPrivate.h:
1172 * UIProcess/API/Cocoa/WKPreferences.mm:
1173 (-[WKPreferences _setWebAnimationsCSSIntegrationEnabled:]):
1174 (-[WKPreferences _webAnimationsCSSIntegrationEnabled]):
1175 (-[WKPreferences _setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled:]): Deleted.
1176 (-[WKPreferences _cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled]): Deleted.
1177 * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1178 * WebProcess/InjectedBundle/InjectedBundle.cpp:
1179 (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1180 (WebKit::InjectedBundle::setWebAnimationsCSSIntegrationEnabled):
1181 (WebKit::InjectedBundle::setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled): Deleted.
1182 * WebProcess/InjectedBundle/InjectedBundle.h:
1184 2018-05-15 Dean Jackson <dino@apple.com>
1186 Update animation when presenting QuickLook
1187 https://bugs.webkit.org/show_bug.cgi?id=185648
1188 <rdar://problem/39652624>
1190 Reviewed by Antoine Quint.
1192 Implement the QuickLook delegate on _WKPreviewControllerDelegate that
1193 produces a zoom-like animation when the QLPreviewController appears.
1195 * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
1196 (-[_WKPreviewControllerDelegate previewController:frameForPreviewItem:inSourceView:]):
1197 * UIProcess/SystemPreviewController.h: Add a reference back to the page, so that
1198 the delegate implementation can access the presentingViewController.
1199 (WebKit::SystemPreviewController::page):
1201 2018-05-14 Dean Jackson <dino@apple.com>
1203 Download and present System Preview
1204 https://bugs.webkit.org/show_bug.cgi?id=185459
1205 <rdar://problem/40079228>
1207 Reviewed by Tim Horton.
1209 Extend DownloadClient so that it can handle the case where
1210 the download was triggered by a System Preview. In this situation
1211 the result (and progress) are piped into QuickLook via the SystemPreviewController.
1213 The DownloadProxy class is also extended to handle the destination
1214 filename and the size of the content.
1216 Lastly, SystemPreviewController is updated to have a start(), show()
1217 and cancel() interface, and no longer adjusts page navigation.
1219 * UIProcess/Cocoa/DownloadClient.h:
1220 * UIProcess/Cocoa/DownloadClient.mm: Handle the SystemPreview case, which
1221 doesn't have a download delegate, but instead needs to communicate with
1222 the SystemPreviewController, if one exists.
1223 (WebKit::DownloadClient::didStart):
1224 (WebKit::DownloadClient::didReceiveResponse):
1225 (WebKit::DownloadClient::didReceiveData):
1226 (WebKit::DownloadClient::didCreateDestination):
1227 (WebKit::DownloadClient::processDidCrash):
1228 (WebKit::DownloadClient::decideDestinationWithSuggestedFilename):
1229 (WebKit::DownloadClient::didFinish):
1230 (WebKit::DownloadClient::didFail):
1231 (WebKit::DownloadClient::didCancel):
1232 (WebKit::DownloadClient::releaseActivityToken):
1234 * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: Implement the new API.
1235 (-[_WKPreviewControllerDataSource initWithMIMEType:]):
1236 (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
1237 (-[_WKPreviewControllerDataSource setProgress:]):
1238 (-[_WKPreviewControllerDataSource finish:]):
1239 (-[_WKPreviewControllerDelegate previewControllerDidDismiss:]):
1240 (WebKit::SystemPreviewController::start):
1241 (WebKit::SystemPreviewController::updateProgress):
1242 (WebKit::SystemPreviewController::finish):
1243 (WebKit::SystemPreviewController::cancel):
1244 (-[_WKPreviewControllerDataSource initWithURL:]): Deleted.
1245 (-[_WKPreviewControllerDelegate previewControllerWillDismiss:]): Deleted.
1246 (WebKit::SystemPreviewController::canPreview const): Deleted.
1247 (WebKit::SystemPreviewController::showPreview): Deleted.
1248 * UIProcess/Downloads/DownloadProxy.h: Track the destination file by name
1249 and size. Also expose a helper to identify system preview downloads.
1250 (WebKit::DownloadProxy::destinationFilename const):
1251 (WebKit::DownloadProxy::setDestinationFilename):
1252 (WebKit::DownloadProxy::expectedContentLength const):
1253 (WebKit::DownloadProxy::setExpectedContentLength):
1254 (WebKit::DownloadProxy::bytesLoaded const):
1255 (WebKit::DownloadProxy::setBytesLoaded):
1256 (WebKit::DownloadProxy::isSystemPreviewDownload const):
1258 * UIProcess/SystemPreviewController.cpp: New API.
1259 (WebKit::SystemPreviewController::canPreview const):
1260 (WebKit::SystemPreviewController::sendPageBack): Deleted.
1261 (WebKit::SystemPreviewController::showPreview): Deleted.
1262 * UIProcess/SystemPreviewController.h:
1264 * UIProcess/WebPageProxy.cpp:
1265 (WebKit::m_configurationPreferenceValues):
1266 (WebKit::WebPageProxy::reattachToWebProcess):
1267 (WebKit::WebPageProxy::resetState):
1268 * UIProcess/WebPageProxy.h:
1270 2018-05-14 Brady Eidson <beidson@apple.com>
1272 Add an API test to guard against regressions while re-entering setDefersLoading:.
1273 <rdar://problem/37033737> and https://bugs.webkit.org/show_bug.cgi?id=185630
1275 Reviewed by Chris Dumez.
1277 * UIProcess/API/Cocoa/WKWebView.mm:
1278 (-[WKWebView _setDefersLoadingForTesting:]):
1279 * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1281 * UIProcess/WebPageProxy.cpp:
1282 (WebKit::WebPageProxy::setDefersLoadingForTesting):
1283 * UIProcess/WebPageProxy.h:
1284 * WebProcess/WebPage/WebPage.messages.in:
1286 2018-05-14 Tim Horton <timothy_horton@apple.com>
1288 Use the system font by default in extra zoom mode
1289 https://bugs.webkit.org/show_bug.cgi?id=185638
1290 <rdar://problem/40230277>
1292 Reviewed by Wenson Hsieh.
1294 * Shared/WebPreferencesDefaultValues.h:
1296 2018-05-14 Michael Catanzaro <mcatanzaro@igalia.com>
1298 Unreviewed, rolling out r231755.
1300 Change is not correct
1304 "-Wmemset-elt-size warning in LibWebRTCSocket constructor"
1305 https://bugs.webkit.org/show_bug.cgi?id=185555
1306 https://trac.webkit.org/changeset/231755
1308 2018-05-14 Wenson Hsieh <wenson_hsieh@apple.com>
1310 [Extra zoom mode] Google search results are excessively zoomed in
1311 https://bugs.webkit.org/show_bug.cgi?id=185347
1312 <rdar://problem/39999778>
1314 Reviewed by Tim Horton.
1316 Adds a new experimental feature for the "disabled-adaptations" meta tag, and adds plumbing in WebKit to
1317 propagate disabled adaptation changes to the ViewportConfiguration. The experimental feature is on by default in
1320 * Shared/WebPreferences.yaml:
1321 * Shared/WebPreferencesDefaultValues.h:
1322 * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1323 (WebKit::WebChromeClient::dispatchDisabledAdaptationsDidChange const):
1324 * WebProcess/WebCoreSupport/WebChromeClient.h:
1325 * WebProcess/WebPage/WebPage.cpp:
1326 (WebKit::WebPage::disabledAdaptationsDidChange):
1327 * WebProcess/WebPage/WebPage.h:
1329 2018-05-14 Chris Dumez <cdumez@apple.com>
1331 Overly aggressive timer throttling in service workers
1332 https://bugs.webkit.org/show_bug.cgi?id=185575
1333 <rdar://problem/40219038>
1335 Reviewed by Geoff Garen.
1337 After ~30 seconds, the system would put the service worker process in "App Nap",
1338 causing its timers to get aggressively throttled. This happens because the
1339 service worker processes are WebProcesses that have no visible WebPages.
1341 To address the issue, we now disable process suppression for all service worker
1342 processes. This causes those processes to construct a UserActivity which prevents
1345 This patch also refactors the code a bit to avoid duplication. The ProcessSuppression
1346 suppression logic in now all on ChildProcessProxy / ChildProcess.
1348 * NetworkProcess/NetworkProcess.messages.in:
1349 * PluginProcess/PluginProcess.messages.in:
1350 * Shared/ChildProcess.messages.in:
1351 * UIProcess/ChildProcessProxy.cpp:
1352 (WebKit::ChildProcessProxy::setProcessSuppressionEnabled):
1353 * UIProcess/ChildProcessProxy.h:
1354 * UIProcess/Network/NetworkProcessProxy.h:
1355 * UIProcess/Network/mac/NetworkProcessProxyMac.mm: Removed.
1356 * UIProcess/Plugins/PluginProcessProxy.h:
1357 * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
1358 * UIProcess/ServiceWorkerProcessProxy.cpp:
1359 (WebKit::ServiceWorkerProcessProxy::didFinishLaunching):
1360 * UIProcess/ServiceWorkerProcessProxy.h:
1361 * UIProcess/WebProcessProxy.h:
1362 * WebKit.xcodeproj/project.pbxproj:
1363 * WebProcess/WebProcess.messages.in:
1365 2018-05-14 Andy Estes <aestes@apple.com>
1367 [Wi-Fi Assertions] Allow clients to specify a context identifier
1368 https://bugs.webkit.org/show_bug.cgi?id=185620
1369 <rdar://problem/39915196>
1371 Reviewed by Brady Eidson.
1373 Added an SPI on _WKProcessPoolConfiguration that allows clients to specify a
1376 * NetworkProcess/NetworkProcessCreationParameters.cpp:
1377 (WebKit::NetworkProcessCreationParameters::encode const):
1378 (WebKit::NetworkProcessCreationParameters::decode):
1379 * NetworkProcess/NetworkProcessCreationParameters.h:
1380 * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1381 (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
1382 * UIProcess/API/APIProcessPoolConfiguration.cpp:
1383 (API::ProcessPoolConfiguration::copy):
1384 * UIProcess/API/APIProcessPoolConfiguration.h:
1385 * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
1386 * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
1387 (-[_WKProcessPoolConfiguration wirelessContextIdentifier]):
1388 (-[_WKProcessPoolConfiguration setWirelessContextIdentifier:]):
1389 * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1390 (WebKit::WebProcessPool::platformInitializeNetworkProcess):
1392 2018-05-11 Brian Burg <bburg@apple.com>
1394 Web Automation: Automation.getBrowsingContext returns window origin that differs from window.screenX/Y
1395 https://bugs.webkit.org/show_bug.cgi?id=185571
1396 <rdar://problem/40180785>
1398 Reviewed by Timothy Hatcher.
1400 This code path was refactored to use completion handlers. It seems that the window.screenX/Y
1401 code path converts back to user coordinates but the WebDriver code path does not. Make them
1402 consistent since that is how it is spec'd and tested.
1404 * UIProcess/WebPageProxy.cpp:
1405 (WebKit::WebPageProxy::getWindowFrameWithCallback):
1406 Convert the window frame to user coordinate space so it's the same as window.screenY.
1408 2018-05-14 Brian Burg <bburg@apple.com>
1410 WebDriver: W3C test case actions/key.py::test_lone_keyup_sends_no_events is failing
1411 https://bugs.webkit.org/show_bug.cgi?id=185577
1412 <rdar://problem/40185478>
1414 Reviewed by Timothy Hatcher.
1416 This test is failing because it expects Release Actions to not emit any
1417 events if nothing has changed from the initial state. Because the two code paths
1418 for creating empty states don't actually produce the same empty state, a difference
1419 in location was detected between the two empty states. This generates a mousemove.
1421 To fix this, unify the code that creates an empty state. For mouse input sources, always
1422 initialize the location to (0, 0) so that the mouse input source always has
1423 a location that is valid to click at.
1425 * UIProcess/Automation/SimulatedInputDispatcher.h:
1426 Extract the type enum out of the class to avoid circular definitions of
1427 SimulatedInputSource and SimulatedInputSourceState.
1429 * UIProcess/Automation/SimulatedInputDispatcher.cpp:
1430 (WebKit::SimulatedInputSourceState::emptyStateForSourceType):
1431 Take the input source type when generating an empty state. We always want location
1432 set for a mouse input source, but not set it for other input sources like keys.
1434 (WebKit::SimulatedInputKeyFrame::keyFrameToResetInputSources):
1435 (WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
1436 (WebKit::SimulatedInputSource::create):
1437 (WebKit::SimulatedInputSource::SimulatedInputSource):
1438 (WebKit::SimulatedInputSourceState::emptyState): Deleted.
1439 * UIProcess/Automation/WebAutomationSession.cpp:
1440 (WebKit::WebAutomationSession::WebAutomationSession):
1441 (WebKit::WebAutomationSession::inputSourceForType const):
1442 (WebKit::simulatedInputSourceTypeFromProtocolSourceType):
1443 (WebKit::WebAutomationSession::performInteractionSequence):
1444 * UIProcess/Automation/WebAutomationSession.h:
1446 2018-05-14 Michael Catanzaro <mcatanzaro@igalia.com>
1448 -Wmemset-elt-size warning in LibWebRTCSocket constructor
1449 https://bugs.webkit.org/show_bug.cgi?id=185555
1451 Reviewed by Youenn Fablet.
1453 Add missing multiplication.
1455 * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
1456 (WebKit::LibWebRTCSocket::LibWebRTCSocket):
1458 2018-05-14 Zan Dobersek <zdobersek@igalia.com>
1460 [GTK] REGRESSION(r231170) Build broken with Clang 5.0
1461 https://bugs.webkit.org/show_bug.cgi?id=185198
1463 Reviewed by Michael Catanzaro.
1465 * Shared/RTCNetwork.h: With std::optional forward declaration gone,
1466 explicitly include the WTF Optional.h header.
1468 2018-05-13 Dean Jackson <dino@apple.com>
1470 WebKit2_Sim-7606.1.17.4 introduced dep cycle
1471 https://bugs.webkit.org/show_bug.cgi?id=185588
1472 <rdar://problem/40196581>
1474 Reviewed by Tim Horton.
1476 Soft link AssetViewer.framework to avoid a dependency cycle.
1478 * Configurations/WebKit.xcconfig:
1479 * UIProcess/ios/WKSystemPreviewView.mm:
1480 (-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]):
1482 2018-05-11 Daniel Bates <dabates@apple.com>
1484 X-Frame-Options: SAMEORIGIN needs to check all ancestor frames
1485 https://bugs.webkit.org/show_bug.cgi?id=185567
1486 <rdar://problem/40175008>
1488 Reviewed by Brent Fulgham.
1490 Change the behavior of "X-Frame-Options: SAMEORIGIN" to ensure that all ancestors frames
1491 are same-origin with the document that delivered this header. This prevents an intermediary
1492 malicious frame from clickjacking a child frame whose document is same-origin with the top-
1493 level frame. It also makes the behavior of X-Frame-Options in WebKit more closely match
1494 the behavior of X-Frame-Options in other browsers, including Chrome and Firefox.
1496 Currently a document delivered with "X-Frame-Options: SAMEORIGIN" must only be same-origin
1497 with the top-level frame's document in order to be displayed. This prevents clickjacking by
1498 a malicious page that embeds a page delivered with "X-Frame-Options: SAMEORIGIN". However,
1499 it does not protect against clickjacking of the "X-Frame-Options: SAMEORIGIN" page (victim)
1500 if embedded by an intermediate malicious iframe, say a "rogue ad", that was embedded in a
1501 document same origin with the victim page. We should protect against such attacks.
1503 * NetworkProcess/NetworkResourceLoader.cpp:
1504 (WebKit::NetworkResourceLoader::shouldInterruptLoadForXFrameOptions):
1506 2018-05-11 Dean Jackson <dino@apple.com>
1508 WKWebViewContentProvider should know what MIME type it was created to handle
1509 https://bugs.webkit.org/show_bug.cgi?id=185574
1510 <rdar://problem/40183049>
1512 Reviewed by Tim Horton.
1514 Pass the MIME type of the downloaded asset into the WKWebViewContentProvider's
1515 init method, so it can choose to do something based on that information. The
1516 PDF and LegacyPDF views don't care because they, clearly, only handle PDF. But
1517 a WKSystemPreviewView can handle multiple types.
1519 * UIProcess/API/Cocoa/WKWebView.mm:
1520 (-[WKWebView _setHasCustomContentView:loadedMIMEType:]): Send the MIME type on
1521 to the WKWebViewContentProvider.
1522 * UIProcess/Cocoa/WKWebViewContentProvider.h: Add a new parameter to web_initWithFrame.
1523 * UIProcess/ios/WKLegacyPDFView.mm:
1524 (-[WKLegacyPDFView web_initWithFrame:webView:mimeType:]):
1525 (-[WKLegacyPDFView web_initWithFrame:webView:]): Deleted.
1526 * UIProcess/ios/WKPDFView.mm:
1527 (-[WKPDFView web_initWithFrame:webView:mimeType:]):
1528 (-[WKPDFView web_initWithFrame:webView:]): Deleted.
1529 * UIProcess/ios/WKSystemPreviewView.mm:
1530 (-[WKSystemPreviewView web_initWithFrame:webView:mimeType:]):
1531 (-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]): Actually use
1532 the MIME type to tell QuickLook what it will be getting, rather than basing it on
1534 (-[WKSystemPreviewView web_initWithFrame:webView:]): Deleted.
1536 2018-05-11 Brent Fulgham <bfulgham@apple.com>
1538 Allow the WebContent process to read global ViewBridge preferences
1539 https://bugs.webkit.org/show_bug.cgi?id=185569
1540 <rdar://problem/40164339>
1542 Reviewed by Eric Carlson.
1544 Allow reads of the global /Library/Preferences/com.apple.ViewBridge.plist preference file.
1546 * WebProcess/com.apple.WebProcess.sb.in:
1548 2018-05-11 Megan Gardner <megan_gardner@apple.com>
1550 Cleanup canPerformActionForWebView in relation to the webSelectionAssistant being removed
1551 https://bugs.webkit.org/show_bug.cgi?id=185536
1553 Reviewed by Tim Horton.
1555 The _webSelectionAssistant is now always nil, therefor many of these checks are unnecessary.
1556 Remove the check for a webSelection and clean up the logic surrounding those checks.
1558 * UIProcess/ios/WKContentViewInteraction.mm:
1559 (-[WKContentView canPerformActionForWebView:withSender:]):
1561 2018-05-11 Brady Eidson <beidson@apple.com>
1563 Followup to: Make sure history navigations reuse the existing process when necessary.
1564 https://bugs.webkit.org/show_bug.cgi?id=185532
1566 Reviewed by Andy Estes.
1568 * UIProcess/WebProcessPool.cpp:
1569 (WebKit::WebProcessPool::processForNavigationInternal): When re-using the same process,
1570 don't change the policy action.
1572 2018-05-11 Charles Vazac <cvazac@gmail.com>
1574 Runtime feature flag for Server-Timing
1575 https://bugs.webkit.org/show_bug.cgi?id=184758
1577 Reviewed by Youenn Fablet.
1579 * Shared/WebPreferences.yaml: Added ServerTimingEnabled.
1580 * UIProcess/API/C/WKPreferences.cpp:
1581 (WKPreferencesGetServerTimingEnabled):
1582 * UIProcess/API/C/WKPreferencesRefPrivate.h: WK_EXPORT for WKPreferencesSetServerTimingEnabled.
1583 * WebProcess/Storage/WebSWContextManagerConnection.cpp: Call setServerTimingEnabled.
1585 2018-05-11 Antti Koivisto <antti@apple.com>
1587 Network process should not stat() all cache files on startup to find their sizes
1588 https://bugs.webkit.org/show_bug.cgi?id=185542
1589 <rdar://problem/40092953>
1591 Reviewed by Chris Dumez.
1593 This is done to compute how much disk space a cache is using. While the operation happens
1594 in a background priority thread it is still quite a bit of work.
1596 Large bodies are saved in separate blob files so record file sizes are capped. We can avoid work by
1597 estimating their size instead of counting it exactly.
1599 * NetworkProcess/cache/NetworkCacheStorage.cpp:
1600 (WebKit::NetworkCache::estimateRecordsSize):
1601 (WebKit::NetworkCache::Storage::synchronize):
1603 Use size estimation if blob storage is in use.
1604 Remove the code that would delete empty files. Normal cache shrinking handles this.
1606 (WebKit::NetworkCache::Storage::shouldStoreBodyAsBlob):
1608 2018-05-11 Brady Eidson <beidson@apple.com>
1610 Make sure history navigations reuse the existing process when necessary.
1611 <rdar://problem/39746516> and https://bugs.webkit.org/show_bug.cgi?id=185532
1613 Reviewed by Ryosuke Niwa.
1615 If a view navigates to either a data: or blob: URL, it reuses the existing process.
1617 In such cases we need to also ensure that history navigations back will also reuse the existing process.
1619 * Shared/NavigationActionData.cpp:
1620 (WebKit::NavigationActionData::encode const):
1621 (WebKit::NavigationActionData::decode):
1622 * Shared/NavigationActionData.h:
1624 * UIProcess/API/APINavigation.h:
1625 (API::Navigation::setTargetItem):
1627 * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
1628 * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
1629 (-[_WKProcessPoolConfiguration pageCacheEnabled]):
1630 (-[_WKProcessPoolConfiguration setPageCacheEnabled:]):
1632 * UIProcess/WebPageProxy.cpp:
1633 (WebKit::WebPageProxy::receivedPolicyDecision):
1634 (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1636 * UIProcess/WebProcessPool.cpp:
1637 (WebKit::WebProcessPool::processForNavigationInternal): If the current and target back/forward items both
1638 came from the same process, then reuse the existing process.
1640 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1641 (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1643 2018-05-10 Brent Fulgham <bfulgham@apple.com>
1645 REGRESSION(r231057): Encrypted media content playback failures
1646 https://bugs.webkit.org/show_bug.cgi?id=185537
1647 <rdar://problem/40038478>
1649 Reviewed by Eric Carlson.
1651 Put access to the SecurityServer back in the sandbox so we can validate the
1652 signatures of media encoder/decoders.
1654 * WebProcess/com.apple.WebProcess.sb.in:
1656 2018-05-11 Youenn Fablet <youenn@apple.com>
1658 NetworkCORSPreflightChecker should proceed when having a ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested challenge
1659 https://bugs.webkit.org/show_bug.cgi?id=185522
1660 <rdar://problem/39987152>
1662 Reviewed by Brent Fulgham.
1664 In case of such challenge, refuse to proceed with authentication since preflight is not using credentials.
1665 Previously, we were failing right away which is not right in case preflight is the request triggering the connection.
1669 * NetworkProcess/NetworkCORSPreflightChecker.cpp:
1670 (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
1672 2018-05-10 Daniel Bates <dabates@apple.com>
1674 Use PlatformStrategies to switch between WebKit and WebKitLegacy checking of CSP frame-ancestors and X-Frame-Options
1675 https://bugs.webkit.org/show_bug.cgi?id=185412
1677 Reviewed by Ryosuke Niwa.
1679 Update code for renaming and write in terms of WebLoaderStrategy::shouldPerformSecurityChecks()
1680 instead of explicitly querying RuntimeEnabledFeatures::sharedFeatures().restrictedHTTPResponseAccess().
1682 * WebProcess/Network/WebLoaderStrategy.cpp:
1683 (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
1684 (WebKit::WebLoaderStrategy::loadResourceSynchronously):
1685 (WebKit::WebLoaderStrategy::startPingLoad):
1686 (WebKit::WebLoaderStrategy::preconnectTo):
1687 (WebKit::WebLoaderStrategy::shouldPerformSecurityChecks const):
1688 (WebKit::WebLoaderStrategy::havePerformedSecurityChecks const):
1689 (WebKit::WebLoaderStrategy::isDoingLoadingSecurityChecks const): Deleted.
1690 * WebProcess/Network/WebLoaderStrategy.h:
1691 * WebProcess/WebPage/WebPage.cpp:
1693 2018-05-10 Timothy Horton <timothy_horton@apple.com>
1695 Fix the build after r231393
1696 ​https://bugs.webkit.org/show_bug.cgi?id=185519
1697 <rdar://problem/40131741>
1699 * Configurations/WebKit.xcconfig:
1701 2018-05-10 John Wilander <wilander@apple.com>
1703 Storage Access API: Extend lifetime of cookies on successful user approval
1704 https://bugs.webkit.org/show_bug.cgi?id=185534
1705 <rdar://problem/40064547>
1707 Reviewed by Brent Fulgham.
1709 * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
1710 (WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):
1711 Picks up the experimental feature flag.
1712 * UIProcess/WebResourceLoadStatisticsStore.cpp:
1713 (WebKit::WebResourceLoadStatisticsStore::grantStorageAccessInternal):
1714 Now updates the domain's user interaction timestamp if the user was
1715 prompted for this access.
1716 * UIProcess/WebResourceLoadStatisticsStore.h:
1718 2018-05-10 Chris Dumez <cdumez@apple.com>
1720 [iOS] Release page load process assertion if the screen is locked
1721 https://bugs.webkit.org/show_bug.cgi?id=185333
1723 Reviewed by Geoff Garen.
1725 We normally take a background process assertion during page loads to allow them to complete
1726 even if the tab / app is backgrounded. We should however avoid doing so when the backgrounding
1727 is caused by the screen locking. Keeping the process assertion in this case would prevent the
1728 whole device from sleeping longer than it should, thus negatively impacting power.
1730 * UIProcess/Cocoa/NavigationState.h:
1731 * UIProcess/Cocoa/NavigationState.mm:
1732 (WebKit::NavigationState::NavigationState):
1733 (WebKit::NavigationState::releaseNetworkActivityToken):
1734 (WebKit::NavigationState::didChangeIsLoading):
1735 * UIProcess/ios/WebPageProxyIOS.mm:
1736 (WebKit::WebPageProxy::applicationDidEnterBackground):
1738 2018-05-10 Megan Gardner <megan_gardner@apple.com>
1740 Remove Unused Chinese/Japanese Reanalyze code
1741 https://bugs.webkit.org/show_bug.cgi?id=185529
1743 Reviewed by Wenson Hsieh.
1745 The code for this has actually been completely removed from UIKit. This is unreachable
1746 dead code that should be removed if just for cleanliness.
1748 * Platform/spi/ios/UIKitSPI.h:
1749 * UIProcess/API/Cocoa/WKWebViewInternal.h:
1750 * UIProcess/ios/WKContentViewInteraction.h:
1751 * UIProcess/ios/WKContentViewInteraction.mm:
1752 (-[WKContentView canPerformActionForWebView:withSender:]):
1753 (-[WKContentView _reanalyzeForWebView:]): Deleted.
1755 2018-05-10 Chris Dumez <cdumez@apple.com>
1757 [iOS] Apps that are not visible may not get suspended if they trigger page loads while in the background
1758 https://bugs.webkit.org/show_bug.cgi?id=185318
1760 Reviewed by Geoffrey Garen.
1762 Whenever there is a page load going on, we take a background process assertion to delay process
1763 suspension until this load completes. However, there is also a 3 seconds grace period after
1764 a load is complete to allow the app to trigger a new load shortly after. This grace period was
1765 introduced to support use cases where a visible app does loads in an offscreen view. However,
1766 it can be abused by apps running in the background as they could trigger new page loads while
1767 in the background to delay process suspension. This patch tightens the policy so that only
1768 apps that are currently visible get to use this grace period. Apps that are in the background
1769 get to finish their current load and will then get suspended.
1771 * UIProcess/Cocoa/NavigationState.mm:
1772 (WebKit::NavigationState::didChangeIsLoading):
1774 2018-05-10 Chris Dumez <cdumez@apple.com>
1776 'Cross-Origin-Options header implementation follow-up
1777 https://bugs.webkit.org/show_bug.cgi?id=185520
1779 Reviewed by Ryosuke Niwa.
1781 * WebProcess/WebPage/WebPage.cpp:
1782 (WebKit::WebPage::frameBecameRemote):
1784 2018-05-10 Per Arne Vollan <pvollan@apple.com>
1786 Drop-down Control borders missing.
1787 https://bugs.webkit.org/show_bug.cgi?id=185500
1788 <rdar://problem/40093461>
1790 Reviewed by Brent Fulgham.
1792 Open sandbox for reading of some files in temp folder.
1794 * WebProcess/com.apple.WebProcess.sb.in:
1796 2018-05-10 Eric Carlson <eric.carlson@apple.com>
1798 [MediaStream, iOS] Don't check authorizationStatusForMediaType when using mock capture devices
1799 https://bugs.webkit.org/show_bug.cgi?id=185516
1800 <rdar://problem/36328191>
1802 Reviewed by Youenn Fablet.
1804 * UIProcess/Cocoa/UIDelegate.mm:
1805 (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest): Don't check
1806 +[AVCaptureDevice authorizationStatusForMediaType:] when using mock capture devices.
1808 2018-05-10 Brent Fulgham <bfulgham@apple.com>
1810 REGRESSION(r230323): UIProcess needs to notify WebContent process of Accessibility setting changes
1811 https://bugs.webkit.org/show_bug.cgi?id=185515
1812 <rdar://problem/39627764>
1814 Reviewed by Chris Fleizach.
1816 The UIProcess needs to register for relevant Accessibility preference updates so that it can notify the
1817 WebContent processes that screen properties have changed.
1819 This is represented by NSWorkspaceAccessibilityDisplayOptionsDidChangeNotification.
1821 Tested manually with the Accessibility preferences pane.
1823 * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1824 (WebKit::WebProcessPool::registerNotificationObservers): Add notification observer. When the notification
1825 is received, call 'screenPropertiesStateChanged' to message the information to the WebContent processes.
1826 (WebKit::WebProcessPool::unregisterNotificationObservers): Clean up observer.
1827 * UIProcess/WebProcessPool.cpp:
1828 (WebKit::WebProcessPool::screenPropertiesStateChanged): Added helper function.
1829 * UIProcess/WebProcessPool.h:
1831 2018-05-09 Carlos Garcia Campos <cgarcia@igalia.com>
1833 WebDriver: implement advance user interactions
1834 https://bugs.webkit.org/show_bug.cgi?id=174616
1836 Reviewed by Brian Burg.
1838 Handle origin in case of mouse move transitions.
1840 * UIProcess/Automation/Automation.json: Add MouseMoveOrigin enum and pass it as parameter of InputSourceState
1841 together with optional node handle. Also pass the frame handle to performInteractionSequence command to find the
1842 node in the current browsing context.
1843 * UIProcess/Automation/SimulatedInputDispatcher.cpp:
1844 (WebKit::SimulatedInputKeyFrame::keyFrameToResetInputSources): Ensure we reset the location.
1845 (WebKit::SimulatedInputDispatcher::resolveLocation): Helper to resolve destination location based on current
1846 location and mouse move origin.
1847 (WebKit::SimulatedInputDispatcher::transitionInputSourceToState): Use resolveLocation() in mouse transitions.
1848 (WebKit::SimulatedInputDispatcher::run): Receive and save the frame ID.
1849 (WebKit::SimulatedInputDispatcher::finishDispatching): Reset the frame ID.
1850 * UIProcess/Automation/SimulatedInputDispatcher.h:
1851 * UIProcess/Automation/WebAutomationSession.cpp:
1852 (WebKit::WebAutomationSession::computeElementLayout): Use even numbers for the callback ID to not conflict with
1853 viewportInViewCenterPointOfElement() callbacks.
1854 (WebKit::WebAutomationSession::didComputeElementLayout): Handle computeElementLayout() or
1855 viewportInViewCenterPointOfElement() requests by calling the right callback depending on whether the ID is odd
1857 (WebKit::WebAutomationSession::viewportInViewCenterPointOfElement): Send ComputeElementLayout message to the
1858 WebProcess using odd numbers for the callback ID to not conflict with computeElementLayout() callbacks.
1859 (WebKit::WebAutomationSession::performInteractionSequence): Handle the mouse origin and element handle.
1860 (WebKit::WebAutomationSession::cancelInteractionSequence): Pass the frame ID to the input dispatcher.
1861 * UIProcess/Automation/WebAutomationSession.h:
1862 * UIProcess/Automation/WebAutomationSessionMacros.h:
1864 2018-05-09 Tim Horton <timothy_horton@apple.com>
1866 Remove the unused HAVE_OS_ACTIVITY
1867 https://bugs.webkit.org/show_bug.cgi?id=185501
1869 Reviewed by Wenson Hsieh.
1873 2018-05-09 Chris Dumez <cdumez@apple.com>
1875 Add initial support for 'Cross-Origin-Options' HTTP response header
1876 https://bugs.webkit.org/show_bug.cgi?id=184996
1877 <rdar://problem/39664620>
1879 Reviewed by Geoff Garen.
1881 * Shared/WebPreferences.yaml:
1882 Add this as an experimental feature, on by default.
1884 * WebProcess/WebPage/WebPage.cpp:
1885 (WebKit::WebPage::frameBecameRemote):
1886 Make sure we pass the cross-origin options from the local Window
1887 to the remote one when transitioning.
1889 2018-05-09 Wenson Hsieh <wenson_hsieh@apple.com>
1891 [Extra zoom mode] fast/viewport/extrazoom/viewport-change-min-device-width.html sometimes fails
1892 https://bugs.webkit.org/show_bug.cgi?id=185490
1893 <rdar://problem/40097629>
1895 Reviewed by Tim Horton.
1897 This test is currently flaky due to incorrect logic when computing the unobscured content rect, in the slice of
1898 time after a frame load has been committed, and before the first visible content rect update from the UI process
1899 after the frame load has been committed.
1901 * WebProcess/WebPage/ios/WebPageIOS.mm:
1902 (WebKit::WebPage::viewportConfigurationChanged):
1904 In the case where !m_hasReceivedVisibleContentRectsAfterDidCommitLoad, we try to set the unobscured content size
1905 to be the view size divided by the initial scale. However, in extra zoom mode, `ViewportConfiguration`'s
1906 `minimumLayoutSize()` is the layout size, which is larger than the size of the view by default, so dividing this
1907 by the initial scale yields a bogus value. Instead, use `viewLayoutSize()` instead.
1909 (WebKit::WebPage::updateViewportSizeForCSSViewportUnits):
1911 We also try to divide the view size by the initial scale when computing the effective viewport size for `vw` and
1912 `vh`. Additionally, fix the misleading name of a variable (largestUnobscuredRect) that stores a size.
1914 2018-05-09 Brent Fulgham <bfulgham@apple.com>
1916 Restrict unarchiving of bundle parameters to a set of known classes
1917 https://bugs.webkit.org/show_bug.cgi?id=185489
1918 <rdar://problem/21912401>
1920 Reviewed by Ryosuke Niwa.
1922 Stop accepting anything derived from NSObject, and instead only agree to unarchive objects
1923 from a set of things we actually pass as InjectedBundle parameters.
1925 * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
1926 (WebKit::InjectedBundle::setBundleParameter):
1928 2018-05-09 Richard Houle <rhoule@apple.com>
1930 [Cocoa] Some fields are not identified as [WKWebProcessPlugInNodeHandle isTextField]
1931 https://bugs.webkit.org/show_bug.cgi?id=185260
1932 <rdar://problem/39290394>
1934 INPUT element are not considered to be text fields when
1935 calling -[WKWebProcessPlugInNodeHandle isTextField]
1936 when they are of type number.
1938 Reviewed by Tim Horton.
1940 * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
1941 (WebKit::InjectedBundleNodeHandle::isTextField const):
1943 2018-05-09 Youenn Fablet <youenn@apple.com>
1945 Allow WebResourceLoader to cancel a load served from a service worker
1946 https://bugs.webkit.org/show_bug.cgi?id=185274
1948 Reviewed by Chris Dumez.
1950 Use FetchIdentifier instead of uint64_t.
1951 Add IPC support for cancelling a fetch from WebProcess to service worker process.
1952 Ask service worker process to cancel the fetch when its corresponding WebResourceLoader is cancelled.
1953 No change of behavior as once a WebResourceLoader is cancelled, any related IPC is not processed.
1954 A follow-up patch should try to cancel the FetchResponse load, meaning to either cancel the network load
1955 or to abort reading the readable stream.
1957 * Scripts/webkit/messages.py:
1958 * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1959 (WebKit::WebSWServerConnection::cancelFetch):
1960 (WebKit::WebSWServerConnection::startFetch):
1961 (WebKit::WebSWServerConnection::didReceiveFetchResponse):
1962 (WebKit::WebSWServerConnection::didReceiveFetchData):
1963 (WebKit::WebSWServerConnection::didReceiveFetchFormData):
1964 (WebKit::WebSWServerConnection::didFinishFetch):
1965 (WebKit::WebSWServerConnection::didFailFetch):
1966 (WebKit::WebSWServerConnection::didNotHandleFetch):
1967 * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1968 * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
1969 * StorageProcess/StorageProcess.cpp:
1970 (WebKit::StorageProcess::didFailFetch):
1971 (WebKit::StorageProcess::didNotHandleFetch):
1972 (WebKit::StorageProcess::didReceiveFetchResponse):
1973 (WebKit::StorageProcess::didReceiveFetchData):
1974 (WebKit::StorageProcess::didReceiveFetchFormData):
1975 (WebKit::StorageProcess::didFinishFetch):
1976 * StorageProcess/StorageProcess.h:
1977 * StorageProcess/StorageProcess.messages.in:
1978 * WebProcess/Network/WebLoaderStrategy.cpp:
1979 (WebKit::WebLoaderStrategy::remove):
1980 * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
1981 (WebKit::ServiceWorkerClientFetch::create):
1982 (WebKit::ServiceWorkerClientFetch::ServiceWorkerClientFetch):
1983 (WebKit::ServiceWorkerClientFetch::start):
1984 (WebKit::ServiceWorkerClientFetch::cancel):
1985 * WebProcess/Storage/ServiceWorkerClientFetch.h:
1986 * WebProcess/Storage/WebSWClientConnection.cpp:
1987 (WebKit::WebSWClientConnection::startFetch):
1988 (WebKit::WebSWClientConnection::cancelFetch):
1989 * WebProcess/Storage/WebSWClientConnection.h:
1990 * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1991 (WebKit::WebSWContextManagerConnection::cancelFetch):
1992 (WebKit::WebSWContextManagerConnection::startFetch):
1993 * WebProcess/Storage/WebSWContextManagerConnection.h:
1994 * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
1995 * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
1996 (WebKit::WebServiceWorkerFetchTaskClient::WebServiceWorkerFetchTaskClient):
1997 (WebKit::WebServiceWorkerFetchTaskClient::cancel):
1998 * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:
1999 * WebProcess/Storage/WebServiceWorkerProvider.cpp:
2000 (WebKit::WebServiceWorkerProvider::handleFetch):
2001 (WebKit::WebServiceWorkerProvider::cancelFetch):
2002 (WebKit::WebServiceWorkerProvider::fetchFinished):
2003 * WebProcess/Storage/WebServiceWorkerProvider.h:
2005 2018-05-09 Andy Estes <aestes@apple.com>
2007 [iOS] Consider the annotation bounds when positioning action sheets near long-pressed PDF links
2008 https://bugs.webkit.org/show_bug.cgi?id=185472
2009 <rdar://problem/39967092>
2011 Reviewed by Daniel Bates.
2013 Adopted new PDFHostViewControllerDelegate methods that include annotation rects
2014 when URLs and page indices are long-pressed. This allows us to avoid obscuring
2015 annotations when positioning action sheet popovers.
2017 We also no longer need to convert the press location into host view coordinate
2018 space, as PDFKit now does that for us.
2020 * UIProcess/ios/WKPDFView.mm:
2021 (-[WKPDFView _showActionSheetForURL:atLocation:withAnnotationRect:]):
2022 (-[WKPDFView pdfHostViewController:didLongPressURL:atLocation:withAnnotationRect:]):
2023 (-[WKPDFView pdfHostViewController:didLongPressPageIndex:atLocation:withAnnotationRect:]):
2024 (-[WKPDFView _showActionSheetForURL:atLocation:]): Deleted.
2025 (-[WKPDFView pdfHostViewController:didLongPressURL:atLocation:]): Deleted.
2026 (-[WKPDFView pdfHostViewController:didLongPressPageIndex:atLocation:]): Deleted.
2028 2018-05-09 Andy Estes <aestes@apple.com>
2030 [iOS] Tell PDFHostViewController when animated resizes begin and end
2031 https://bugs.webkit.org/show_bug.cgi?id=185477
2032 <rdar://problem/39875372>
2034 Reviewed by Anders Carlsson.
2036 * UIProcess/API/Cocoa/WKWebView.mm:
2037 (-[WKWebView _beginAnimatedResizeWithUpdates:]):
2038 (-[WKWebView _endAnimatedResize]):
2039 * UIProcess/Cocoa/WKWebViewContentProvider.h:
2040 * UIProcess/ios/WKPDFView.mm:
2041 (-[WKPDFView web_beginAnimatedResize]):
2042 (-[WKPDFView web_endAnimatedResize]):
2044 2018-05-09 Michael Catanzaro <mcatanzaro@igalia.com>
2046 Unreviewed. Update OptionsWPE.cmake and NEWS for 2.21.1 release.
2048 * wpe/NEWS: Added. Add release notes for 2.21.1.
2050 2018-05-09 Michael Catanzaro <mcatanzaro@igalia.com>
2052 [WPE] Build cleanly with GCC 8 and ICU 60
2053 https://bugs.webkit.org/show_bug.cgi?id=185462
2055 Reviewed by Carlos Alberto Lopez Perez.
2057 * Platform/IPC/glib/GSocketMonitor.cpp:
2058 (IPC::GSocketMonitor::start): Silence -Wcast-function-type warning.
2059 * Shared/API/glib/WebKitContextMenu.cpp:
2060 (webkit_context_menu_new_with_items): Ditto.
2062 2018-05-08 Sihui Liu <sihui_liu@apple.com>
2064 Adopt new async _savecookies SPI for keeping networking process active during flushing cookies
2065 https://bugs.webkit.org/show_bug.cgi?id=185261
2066 <rdar://problem/37214391>
2068 Reviewed by Chris Dumez.
2070 By adopting new async SPI _savecookies, we can keep networking process active(not suspended)
2071 until cookies are fully synced to disk with process assertion.
2073 * NetworkProcess/NetworkProcess.cpp:
2074 (WebKit::NetworkProcess::didSyncAllCookies):
2075 * NetworkProcess/NetworkProcess.h:
2076 * NetworkProcess/NetworkProcess.messages.in:
2077 * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2078 (WebKit::NetworkProcess::syncAllCookies):
2079 * UIProcess/Network/NetworkProcessProxy.cpp:
2080 (WebKit::NetworkProcessProxy::didClose):
2081 (WebKit::NetworkProcessProxy::syncAllCookies):
2082 (WebKit::NetworkProcessProxy::didSyncAllCookies):
2083 * UIProcess/Network/NetworkProcessProxy.h:
2084 * UIProcess/Network/NetworkProcessProxy.messages.in:
2085 * UIProcess/WebProcessPool.cpp:
2086 (WebKit::WebProcessPool::syncNetworkProcessCookies):
2088 2018-05-08 Per Arne Vollan <pvollan@apple.com>
2090 Set colorspace in the PDF plugin.
2091 https://bugs.webkit.org/show_bug.cgi?id=185445
2092 <rdar://problem/40030981>
2094 Reviewed by Simon Fraser.
2096 * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h:
2097 * WebProcess/Plugins/PDF/PDFPlugin.mm:
2098 (WebKit::PDFPlugin::PDFPlugin):
2100 2018-05-08 Megan Gardner <megan_gardner@apple.com>
2102 Don't clear selection until we are actually interacting with a Node.
2103 https://bugs.webkit.org/show_bug.cgi?id=185455
2105 Reviewed by Wenson Hsieh.
2107 The presence of TextInteractionAssistant should not be used as a proxy for it we are actually editing content.
2108 We need to check to see if we have an active node, and then we should clear the selection.
2110 * UIProcess/ios/WKContentViewInteraction.mm:
2111 (-[WKContentView setSelectedTextRange:]):
2113 2018-05-08 Ryan Haddad <ryanhaddad@apple.com>
2115 Unreviewed, rolling out r231486.
2117 Caused service worker LayoutTest failures on macOS Debug WK2.
2121 "Allow WebResourceLoader to cancel a load served from a
2123 https://bugs.webkit.org/show_bug.cgi?id=185274
2124 https://trac.webkit.org/changeset/231486
2126 2018-05-08 Andy Estes <aestes@apple.com>
2128 [iOS] _WKWebViewPrintFormatter should return a page count of 0 for PDF documents that do not allow printing
2129 https://bugs.webkit.org/show_bug.cgi?id=185133
2131 Reviewed by Andreas Kling.
2133 * UIProcess/ios/WKPDFView.mm:
2134 (-[WKPDFView _ensureDocumentForPrinting]):
2135 (-[WKPDFView _wk_pageCountForPrintFormatter:]):
2136 (-[WKPDFView _wk_printedDocument]):
2138 2018-05-08 Andy Estes <aestes@apple.com>
2140 [iOS] WKPDFView remains in the view hierarchy after navigating away
2141 https://bugs.webkit.org/show_bug.cgi?id=185449
2142 <rdar://problem/39693469>
2144 Reviewed by Tim Horton.
2146 WKPDFView removes the PDF host view from the view hierarchy in its -dealloc
2147 method, and relies on WKWebView releasing its last reference in
2148 -_setHasCustomContentView:loadedMIMEType: when the user navigates.
2150 However, WKWPDFView was capturing a strong reference to self in the block passed
2151 to +[PDFHostViewController createHostView:forExtensionIdentifier:], and PDFKit
2152 (actually UIKit) is retaining this block beyond its being called. This results in
2153 the PDF host view remaining as a child of the WKScrollView even after the user
2154 navigates to another page.
2156 Changed the aforementioned block to a lambda that captures a weak reference to
2157 self to prevent WKPDFView from outliving the current navigation.
2159 * UIProcess/ios/WKPDFView.mm:
2160 (-[WKPDFView retain]):
2161 (-[WKPDFView web_setContentProviderData:suggestedFilename:]):
2163 2018-05-08 John Wilander <wilander@apple.com>
2165 Storage Access API: Make user opt-in sticky
2166 https://bugs.webkit.org/show_bug.cgi?id=185454
2167 <rdar://problem/40003946>
2169 Reviewed by Alex Christensen.
2171 This patch persists the user's choice to opt-in to access under specific domains.
2172 Such storage access should age out with the accessing domain's cookies and website
2173 data. The opt-in prompt is still an experimental feature.
2175 * UIProcess/WebResourceLoadStatisticsStore.cpp:
2176 (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
2177 (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
2178 (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
2179 (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
2180 (WebKit::WebResourceLoadStatisticsStore::grantStorageAccessInternal):
2181 (WebKit::WebResourceLoadStatisticsStore::hasUserGrantedStorageAccessThroughPrompt const):
2182 (WebKit::WebResourceLoadStatisticsStore::hasHadUnexpiredRecentUserInteraction const):
2183 * UIProcess/WebResourceLoadStatisticsStore.h:
2185 2018-05-08 Daniel Bates <dabates@apple.com>
2187 Do not apply X-Frame-Options and CSP frame-ancestors to Quick Look-applicable responses in NetworkProcess
2188 https://bugs.webkit.org/show_bug.cgi?id=185442
2189 <rdar://problem/40067209>
2191 Reviewed by Andy Estes.
2193 Just as we exempt responses in WebContent process that will be handled by Quick Look from the Content
2194 Security Policy frame-ancestors directive and X-Frame-Options checking we need to do the same when
2195 such checks are performed in NetworkProcess following r231479.
2197 HTTP responses that will be previewed using Quick Look are not considered web pages and are subject
2198 to the security model for Quick Look documents. That is, they are exempt from Content Security Policy
2199 and X-Frame-Options processing.
2201 * NetworkProcess/NetworkResourceLoader.cpp:
2202 (WebKit::NetworkResourceLoader::shouldInterruptLoadForCSPFrameAncestorsOrXFrameOptions):
2204 2018-05-08 Brian Burg <bburg@apple.com>
2206 REGRESSION(r230743): Mousemove events are not coalesced properly, mousemove/drag is very laggy
2207 https://bugs.webkit.org/show_bug.cgi?id=185425
2208 <rdar://problem/39323336>
2210 Reviewed by Simon Fraser.
2212 When mousemove events come in faster than they can be processed, we should coalesce
2213 pending mousemoves that have not yet been sent to WebProcess. This has the effect of
2214 processing the most recent mousemove location, which is the old behavior that regressed.
2216 * UIProcess/WebPageProxy.cpp:
2217 (WebKit::WebPageProxy::handleMouseEvent):
2218 If there is >1 event in the mouse queue, then the first one is being processed by WebProcess
2219 and the second one is eligible for coalescing. Replace it if the last event and new event
2220 are both mousemoves.
2222 2018-05-08 Per Arne Vollan <pvollan@apple.com>
2224 The PDF context menu should not be created in the WebContent process.
2225 https://bugs.webkit.org/show_bug.cgi?id=185401
2227 Reviewed by Tim Horton.
2229 Send a sync IPC message from the WebContent process to the UI process with the necessary context
2230 menu information when the menu is requested. The NSMenu will then be created and shown in the
2231 UI process. The reply will contain the selected menu item index.
2233 * Shared/mac/PDFContextMenu.h: Added.
2234 (WebKit::PDFContextMenuItem::encode const):
2235 (WebKit::PDFContextMenuItem::decode):
2236 (WebKit::PDFContextMenu::encode const):
2237 (WebKit::PDFContextMenu::decode):
2238 * UIProcess/WebPageProxy.h:
2239 * UIProcess/WebPageProxy.messages.in:
2240 * UIProcess/mac/WebPageProxyMac.mm:
2241 (-[WKPDFMenuTarget menuItem]):
2242 (-[WKPDFMenuTarget contextMenuAction:]):
2243 (WebKit::WebPageProxy::showPDFContextMenu):
2244 * WebKit.xcodeproj/project.pbxproj:
2245 * WebProcess/Plugins/PDF/PDFPlugin.mm:
2246 (WebKit::PDFPlugin::handleContextMenuEvent):
2248 2018-05-08 Dean Jackson <dino@apple.com>
2250 System Preview links should trigger a download
2251 https://bugs.webkit.org/show_bug.cgi?id=185439
2252 <rdar://problem/40065545>
2254 Reviewed by Jon Lee.
2256 Encode the new field identifying a system preview. And
2257 if you encounter such a resource request, trigger
2260 * Shared/WebCoreArgumentCoders.cpp:
2261 (IPC::ArgumentCoder<ResourceRequest>::encode):
2262 (IPC::ArgumentCoder<ResourceRequest>::decode):
2263 * UIProcess/WebPageProxy.cpp:
2264 (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2266 2018-05-08 John Wilander <wilander@apple.com>
2268 Storage Access API: Add a request roundtrip to check whether prompting is needed
2269 https://bugs.webkit.org/show_bug.cgi?id=185368
2270 <rdar://problem/40011556>
2272 Reviewed by Alex Christensen and Youenn Fablet.
2274 This patch adds an enum WebKit::StorageAccessStatus to handle our three access
2276 - WebKit::StorageAccessStatus::CannotRequestAccess.
2277 This means the domain is blocked from cookie access.
2278 - WebKit::StorageAccessStatus::RequiresUserPrompt.
2279 This means that access has not been granted yet and a prompt is required.
2280 - WebKit::StorageAccessStatus::HasAccess.
2281 This either means that this domain does not need to ask for access,
2282 access was already granted, or access was granted now.
2284 If the call to WebResourceLoadStatisticsStore::requestStorageAccess() comes
2285 back as WebKit::StorageAccessStatus::RequiresUserPrompt, the WebPageProxy
2286 prompts the user and if the user said yes, calls a direct
2287 WebResourceLoadStatisticsStore::grantStorageAccess().
2289 Existing test cases pass because requestStorageAccessConfirm in WKPage.cpp
2290 does not have m_client.requestStorageAccessConfirm and thus returns true.
2292 * UIProcess/Network/NetworkProcessProxy.messages.in:
2293 Added a missing #endif.
2294 * UIProcess/WebPageProxy.cpp:
2295 (WebKit::WebPageProxy::requestStorageAccess):
2296 Here we now handle the various cases encoded in WebKit::StorageAccessStatus.
2297 * UIProcess/WebResourceLoadStatisticsStore.cpp:
2298 (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
2299 Now covers the optional prompt case.
2300 (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
2301 (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
2302 (WebKit::WebResourceLoadStatisticsStore::grantStorageAccessInternal):
2303 Granting access is broken out to allow WebKit::WebPageProxy to call it
2305 * UIProcess/WebResourceLoadStatisticsStore.h:
2306 * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2307 (WebKit::WebsiteDataStore::requestStorageAccess):
2308 (WebKit::WebsiteDataStore::grantStorageAccess):
2309 Piping through calls from from WebKit::WebResourceLoadStatisticsStore
2310 to WebKit::WebPageProxy.
2311 * UIProcess/WebsiteData/WebsiteDataStore.h:
2313 2018-05-08 Chris Dumez <cdumez@apple.com>
2315 Unreviewed, rolling out r231376 and r231458.
2317 Caused some API tests failures on iOS
2319 Reverted changesets:
2321 "[iOS] Apps that are not visible may not get suspended if they
2322 trigger page loads while in the background"
2323 https://bugs.webkit.org/show_bug.cgi?id=185318
2324 https://trac.webkit.org/changeset/231376
2326 "[iOS] Release page load process assertion if the screen is
2328 https://bugs.webkit.org/show_bug.cgi?id=185333
2329 https://trac.webkit.org/changeset/231458
2331 2018-05-08 Dean Jackson <dino@apple.com>
2333 Use thumbnails in System Previews
2334 https://bugs.webkit.org/show_bug.cgi?id=185397
2335 <rdar://problem/40039376>
2337 Reviewed by Jon Lee.
2339 A system preview that goes through the WKWebViewContentProvider will
2340 show a static thumbnail/snapshot of the item, rather than jumping
2341 directly to QuickLook.
2343 This means we have to link to the AssetViewer framework. That provides
2344 a ASVThumbnailView that will trigger QuickLook for us.
2346 * Configurations/WebKit.xcconfig: Link to AssetViewer.
2348 * UIProcess/ios/WKSystemPreviewView.h: Better macro use. Remove some unneeded protocols.
2349 * UIProcess/ios/WKSystemPreviewView.mm:
2350 (-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]): Update this
2351 to use an ASVThumbnailView, when on the internal SDK (because it is private).
2352 (-[WKSystemPreviewView _layoutThumbnailView]): Use the content insets to put
2353 the thumbnail in the right place.
2354 (-[WKSystemPreviewView thumbnailView:wantsToPresentPreviewController:forItem:]):
2356 (-[WKSystemPreviewView web_contentView]):
2357 (-[WKSystemPreviewView web_computedContentInsetDidChange]):
2358 (-[WKSystemPreviewView numberOfPreviewItemsInPreviewController:]): Deleted.
2359 (-[WKSystemPreviewView previewController:previewItemAtIndex:]): Deleted.
2360 (-[WKSystemPreviewView previewControllerWillDismiss:]): Deleted.
2362 2018-05-08 Youenn Fablet <youenn@apple.com>
2364 Allow WebResourceLoader to cancel a load served from a service worker
2365 https://bugs.webkit.org/show_bug.cgi?id=185274
2367 Reviewed by Chris Dumez.
2369 Use FetchIdentifier instead of uint64_t.
2370 Add IPC support for cancelling a fetch from WebProcess to service worker process.
2371 Ask service worker process to cancel the fetch when its corresponding WebResourceLoader is cancelled.
2372 No change of behavior as once a WebResourceLoader is cancelled, any related IPC is not processed.
2373 A follow-up patch should try to cancel the FetchResponse load, meaning to either cancel the network load
2374 or to abort reading the readable stream.
2376 * Scripts/webkit/messages.py:
2377 * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2378 (WebKit::WebSWServerConnection::cancelFetch):
2379 (WebKit::WebSWServerConnection::startFetch):
2380 (WebKit::WebSWServerConnection::didReceiveFetchResponse):
2381 (WebKit::WebSWServerConnection::didReceiveFetchData):
2382 (WebKit::WebSWServerConnection::didReceiveFetchFormData):
2383 (WebKit::WebSWServerConnection::didFinishFetch):
2384 (WebKit::WebSWServerConnection::didFailFetch):
2385 (WebKit::WebSWServerConnection::didNotHandleFetch):
2386 * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2387 * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
2388 * StorageProcess/StorageProcess.cpp:
2389 (WebKit::StorageProcess::didFailFetch):
2390 (WebKit::StorageProcess::didNotHandleFetch):
2391 (WebKit::StorageProcess::didReceiveFetchResponse):
2392 (WebKit::StorageProcess::didReceiveFetchData):
2393 (WebKit::StorageProcess::didReceiveFetchFormData):
2394 (WebKit::StorageProcess::didFinishFetch):
2395 * StorageProcess/StorageProcess.h:
2396 * StorageProcess/StorageProcess.messages.in:
2397 * WebProcess/Network/WebLoaderStrategy.cpp:
2398 (WebKit::WebLoaderStrategy::remove):
2399 * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
2400 (WebKit::ServiceWorkerClientFetch::create):
2401 (WebKit::ServiceWorkerClientFetch::ServiceWorkerClientFetch):
2402 (WebKit::ServiceWorkerClientFetch::start):
2403 (WebKit::ServiceWorkerClientFetch::cancel):
2404 * WebProcess/Storage/ServiceWorkerClientFetch.h:
2405 * WebProcess/Storage/WebSWClientConnection.cpp:
2406 (WebKit::WebSWClientConnection::startFetch):
2407 (WebKit::WebSWClientConnection::cancelFetch):
2408 * WebProcess/Storage/WebSWClientConnection.h:
2409 * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2410 (WebKit::WebSWContextManagerConnection::cancelFetch):
2411 (WebKit::WebSWContextManagerConnection::startFetch):
2412 * WebProcess/Storage/WebSWContextManagerConnection.h:
2413 * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
2414 * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
2415 (WebKit::WebServiceWorkerFetchTaskClient::WebServiceWorkerFetchTaskClient):
2416 (WebKit::WebServiceWorkerFetchTaskClient::cancel):
2417 * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:
2418 * WebProcess/Storage/WebServiceWorkerProvider.cpp:
2419 (WebKit::WebServiceWorkerProvider::handleFetch):
2420 (WebKit::WebServiceWorkerProvider::cancelFetch):
2421 (WebKit::WebServiceWorkerProvider::fetchFinished):
2422 * WebProcess/Storage/WebServiceWorkerProvider.h:
2424 2018-05-08 Antti Koivisto <antti@apple.com>
2426 Don't use mapped cache files in case of Class A/B protected app
2427 https://bugs.webkit.org/show_bug.cgi?id=185422
2428 <rdar://problem/34001688>
2430 Reviewed by Chris Dumez.
2432 Currently we don't use shared memory maps in these cases. This still leaves us open for crashes
2433 in the network process when the device is locked.
2435 This patch disables use of blob storage (mapped cache files) in apps that use class A/B protection.
2436 Normally we use blobs for resources > 16KB. Since use of shared memory is already disabled,
2437 the only optimization lost for these apps is body data deduplication.
2439 Any existing cache entries with blobs are ignored and deleted. New entries are created with
2440 body data inlined with the metadata.
2442 * NetworkProcess/cache/NetworkCache.cpp:
2443 (WebKit::NetworkCache::Cache::store):
2444 * NetworkProcess/cache/NetworkCache.h:
2445 (WebKit::NetworkCache::Cache::canUseSharedMemoryForBodyData const): Deleted.
2446 * NetworkProcess/cache/NetworkCacheEntry.cpp:
2447 (WebKit::NetworkCache::Entry::initializeShareableResourceHandleFromStorageRecord const):
2449 Remove the code the prevented use of shared memory in these cases. Non-mapped Data objects
2450 are never shareable.
2452 (WebKit::NetworkCache::Entry::setNeedsValidation):
2453 * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
2454 (WebKit::NetworkCache::isSafeToUseMemoryMapForPath):
2455 (WebKit::NetworkCache::canUseSharedMemoryForPath): Deleted.
2456 * NetworkProcess/cache/NetworkCacheFileSystem.h:
2457 * NetworkProcess/cache/NetworkCacheStorage.cpp:
2458 (WebKit::NetworkCache::Storage::Storage):
2459 (WebKit::NetworkCache::Storage::mayContainBlob const):
2460 (WebKit::NetworkCache::Storage::shouldStoreBodyAsBlob):
2461 (WebKit::NetworkCache::shouldStoreBodyAsBlob): Deleted.
2462 * NetworkProcess/cache/NetworkCacheStorage.h:
2463 (WebKit::NetworkCache::Storage::canUseSharedMemoryForBodyData const): Deleted.
2465 2018-05-07 Carlos Garcia Campos <cgarcia@igalia.com>
2467 Unreviewed. Add missing exit not included in r231298.
2469 * WebProcess/WebProcess.cpp:
2470 (WebKit::WebProcess::ensureWebToStorageProcessConnection):
2472 2018-05-07 Daniel Bates <dabates@apple.com>
2474 Check X-Frame-Options and CSP frame-ancestors in network process
2475 https://bugs.webkit.org/show_bug.cgi?id=185410
2476 <rdar://problem/37733934>
2478 Reviewed by Ryosuke Niwa.
2480 * NetworkProcess/NetworkResourceLoadParameters.cpp:
2481 (WebKit::NetworkResourceLoadParameters::encode const): Always encode the frame ancestor origins.
2482 (WebKit::NetworkResourceLoadParameters::decode): Always decode the frame ancestor origins.
2483 * NetworkProcess/NetworkResourceLoader.cpp:
2484 (WebKit::NetworkResourceLoader::shouldInterruptLoadForXFrameOptions): Added.
2485 (WebKit::NetworkResourceLoader::shouldInterruptLoadForCSPFrameAncestorsOrXFrameOptions): Added.
2486 (WebKit::NetworkResourceLoader::didReceiveResponse): Check if the load needs to be interrupted due
2487 to a violation of the CSP frame-ancestors directive or X-Frame-Options. If there is a violation
2489 (WebKit::NetworkResourceLoader::didRetrieveCacheEntry): Ditto.
2490 (NetworkResourceLoader::addConsoleMessage): Added.
2491 (NetworkResourceLoader::sendCSPViolationReport): Added.
2492 * NetworkProcess/NetworkResourceLoader.h:
2493 * Scripts/webkit/messages.py: Teach the generator about data types MessageLevel and MessageSource
2494 as they are both defined in file JavaScriptCore/ConsoleTypes.h as opposed to independent headers.
2495 Also tell the generator that these types should not be forward declared so that we can use these
2496 types without their JSC:: prefix in WebPage.messages.in.
2497 * WebProcess/Network/NetworkProcessConnection.cpp:
2498 (WebKit::NetworkProcessConnection::didReceiveMessage): Route WebPage messages to the appropriate
2500 * WebProcess/Network/WebLoaderStrategy.cpp:
2501 (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): Added message StopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied.
2502 * WebProcess/Network/WebResourceLoader.cpp:
2503 (WebKit::WebResourceLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied): Added.
2504 * WebProcess/Network/WebResourceLoader.h:
2505 * WebProcess/Network/WebResourceLoader.messages.in:
2506 * WebProcess/WebPage/WebFrame.cpp:
2507 (WebKit::WebFrame::addConsoleMessage):
2508 * WebProcess/WebPage/WebFrame.h:
2509 * WebProcess/WebPage/WebPage.cpp:
2510 (WebKit::WebPage::addConsoleMessage): Added.
2511 (WebKit::WebPage::sendCSPViolationReport): Added.
2512 * WebProcess/WebPage/WebPage.h:
2513 * WebProcess/WebPage/WebPage.messages.in: Add messages AddConsoleMessage and SendCSPViolationReport
2514 for adding a console message to Web Inspector and sending a CSP report, respectively.
2516 2018-05-07 Daniel Bates <dabates@apple.com>
2518 Abstract logic to log console messages and send CSP violation reports into a client
2519 https://bugs.webkit.org/show_bug.cgi?id=185393
2520 <rdar://problem/40036053>
2522 Reviewed by Brent Fulgham.
2524 For now, build a URL from the source origin associated with the NetworkResourceLoader
2525 and pass this to the ContentSecurityPolicy constructor.
2527 Additionally, make NetworkLoadChecker::contentSecurityPolicy() non-const since it returns
2528 a non-const pointer to a ContentSecurityPolicy object; => callers can mutate this object
2529 right from under NetworkLoadChecker. Making this non-const makes this clear to a reader.
2530 Also remove the mutable keyword from the definition of NetworkLoadChecker::m_contentSecurityPolicy.
2532 * NetworkProcess/NetworkLoadChecker.cpp:
2533 (WebKit::NetworkLoadChecker::contentSecurityPolicy):
2534 (WebKit::NetworkLoadChecker::contentSecurityPolicy const): Deleted.
2535 * NetworkProcess/NetworkLoadChecker.h:
2537 2018-05-07 Alex Christensen <achristensen@webkit.org>
2539 WebResourceLoadStatisticsStore::requestStorageAccess should call its completion handler on the main thread
2540 https://bugs.webkit.org/show_bug.cgi?id=185403
2542 Reviewed by Brent Fulgham.
2544 * UIProcess/WebResourceLoadStatisticsStore.cpp:
2545 (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
2547 2018-05-07 Chris Dumez <cdumez@apple.com>
2549 [iOS] Release page load process assertion if the screen is locked
2550 https://bugs.webkit.org/show_bug.cgi?id=185333
2552 Reviewed by Geoffrey Garen.
2554 We normally take a background process assertion during page loads to allow them to complete
2555 even if the tab / app is backgrounded. We should however avoid doing so when the backgrounding
2556 is caused by the screen locking. Keeping the process assertion in this case would prevent the
2557 whole device from sleeping longer than it should, thus negatively impacting power.
2559 * UIProcess/Cocoa/NavigationState.h:
2560 * UIProcess/Cocoa/NavigationState.mm:
2561 (WebKit::NavigationState::NavigationState):
2562 (WebKit::NavigationState::releaseNetworkActivityToken):
2563 (WebKit::NavigationState::didChangeIsLoading):
2564 * UIProcess/ios/WebPageProxyIOS.mm:
2565 (WebKit::WebPageProxy::applicationDidEnterBackground):
2567 2018-05-07 Brent Fulgham <bfulgham@apple.com>
2569 Add experimental feature to prompt for Storage Access API use
2570 https://bugs.webkit.org/show_bug.cgi?id=185335
2571 <rdar://problem/39994649>
2573 Reviewed by Alex Christensen and Youenn Fablet.
2575 Create a new experimental feature that gates the ability of WebKit clients to prompt the user when
2576 Storage Access API is invoked.
2578 Currently this feature doesn't have any user-visible impact.
2580 * Shared/API/APIObject.h:
2581 * Shared/API/c/WKBase.h:
2582 * Shared/WebPreferences.yaml:
2583 * UIProcess/API/APIUIClient.h:
2584 (API::UIClient::requestStorageAccessConfirm):
2585 * UIProcess/API/C/WKPage.cpp:
2586 (WebKit::RequestStorageAccessConfirmResultListener::create):
2587 (WebKit::RequestStorageAccessConfirmResultListener::~RequestStorageAccessConfirmResultListener):
2588 (WebKit::RequestStorageAccessConfirmResultListener::call):
2589 (WebKit::RequestStorageAccessConfirmResultListener::RequestStorageAccessConfirmResultListener):
2590 (WKPageRequestStorageAccessConfirmResultListenerGetTypeID):
2591 (WKPageRequestStorageAccessConfirmResultListenerCall):
2592 (WKPageSetPageUIClient):
2593 * UIProcess/API/C/WKPageUIClient.h:
2594 * UIProcess/API/Cocoa/WKPreferences.mm:
2595 (-[WKPreferences _storageAccessPromptsEnabled]):
2596 (-[WKPreferences _setStorageAccessPromptsEnabled:]):
2597 * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2598 * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2599 * UIProcess/Cocoa/UIDelegate.h:
2600 * UIProcess/Cocoa/UIDelegate.mm:
2601 (WebKit::UIDelegate::setDelegate):
2602 (WebKit::UIDelegate::UIClient::requestStorageAccessConfirm):
2603 * UIProcess/WebPageProxy.cpp:
2604 (WebKit::WebPageProxy::requestStorageAccessConfirm):
2605 * UIProcess/WebPageProxy.h:
2606 * UIProcess/WebPageProxy.messages.in:
2607 * UIProcess/WebPreferences.cpp:
2608 (WebKit::WebPreferences::update):
2609 * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2610 (WebKit::WebChromeClient::requestStorageAccess):
2612 2018-05-07 Dean Jackson <dino@apple.com>
2614 Use a dark gray for system preview bbackground
2615 https://bugs.webkit.org/show_bug.cgi?id=185391
2616 <rdar://problem/40035120>
2618 Reviewed by Eric Carlson.
2620 Throw some darker shade at this view.
2622 * UIProcess/ios/WKSystemPreviewView.mm:
2623 (-[WKSystemPreviewView web_initWithFrame:webView:]):
2625 2018-05-07 Don Olmstead <don.olmstead@sony.com>
2627 [Win] Add missing methods to WebChromeClient
2628 https://bugs.webkit.org/show_bug.cgi?id=185325
2630 Reviewed by Brent Fulgham.
2632 * WebProcess/WebCoreSupport/WebChromeClient.h:
2634 2018-05-07 Megan Gardner <megan_gardner@apple.com>
2636 Allow Web Touch events to timeout
2637 https://bugs.webkit.org/show_bug.cgi?id=185282
2639 Reviewed by Tim Horton.
2641 This is backwards, fixing.
2643 * UIProcess/WebPageProxy.cpp:
2644 (WebKit::WebPageProxy::handleTouchEventSynchronously):
2646 2018-05-07 Don Olmstead <don.olmstead@sony.com>
2648 [Win] LoggingWin is missing includes
2649 https://bugs.webkit.org/show_bug.cgi?id=185326
2651 Reviewed by Per Arne Vollan.
2653 * Platform/win/LoggingWin.cpp:
2655 2018-05-07 Daniel Bates <dabates@apple.com>
2657 CSP should be passed the referrer
2658 https://bugs.webkit.org/show_bug.cgi?id=185367
2660 Reviewed by Per Arne Vollan.
2662 Pass the referrer through NetworkLoadChecker so that it can pass it to the ContentSecurityPolicy
2663 object it instantiates.
2665 * NetworkProcess/NetworkLoadChecker.cpp:
2666 (WebKit::NetworkLoadChecker::NetworkLoadChecker):
2667 (WebKit::NetworkLoadChecker::contentSecurityPolicy const):
2668 * NetworkProcess/NetworkLoadChecker.h:
2669 (WebKit::NetworkLoadChecker::create):
2670 * NetworkProcess/NetworkResourceLoader.cpp:
2671 * NetworkProcess/PingLoad.cpp:
2672 (WebKit::PingLoad::PingLoad):
2674 2018-05-07 Daniel Bates <dabates@apple.com>
2676 Substitute CrossOriginPreflightResultCache::clear() for CrossOriginPreflightResultCache::empty()
2677 https://bugs.webkit.org/show_bug.cgi?id=185170
2679 Reviewed by Per Arne Vollan.
2681 * WebProcess/WebProcess.cpp:
2682 (WebKit::WebProcess::clearResourceCaches):
2683 (WebKit::WebProcess::deleteWebsiteData):
2685 2018-05-07 Brian Burg <bburg@apple.com>
2687 Web Inspector: opt out of process swap on navigation if a Web Inspector frontend is connected
2688 https://bugs.webkit.org/show_bug.cgi?id=184861
2689 <rdar://problem/39153768>
2691 Reviewed by Timothy Hatcher.
2693 We need to track how many frontends are attached to the web page (both local and remote).
2694 InspectorController propagates this out to WebKit via InspectorClient. This is then
2695 kept in UIProcess as a member of WebPageProxy. When making a decision whether to use a
2696 new process for a navigation, return early with "no" if any frontends are open for the
2697 page being navigated.
2699 * UIProcess/WebPageProxy.h:
2700 (WebKit::WebPageProxy::didChangeInspectorFrontendCount):
2701 (WebKit::WebPageProxy::inspectorFrontendCount const):
2702 * UIProcess/WebPageProxy.messages.in:
2703 * UIProcess/WebProcessPool.cpp:
2704 (WebKit::WebProcessPool::processForNavigation):
2705 * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
2706 (WebKit::WebInspectorClient::frontendCountChanged):
2707 * WebProcess/WebCoreSupport/WebInspectorClient.h:
2708 * WebProcess/WebPage/WebPage.cpp:
2709 (WebKit::WebPage::inspectorFrontendCountChanged):
2710 * WebProcess/WebPage/WebPage.h:
2712 2018-05-04 Tim Horton <timothy_horton@apple.com>
2714 Shift to a lower-level framework for simplifying URLs
2715 https://bugs.webkit.org/show_bug.cgi?id=185334
2717 Reviewed by Dan Bernstein.
2719 * Configurations/WebKit.xcconfig:
2720 * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
2721 (-[WKFullScreenWindowController _updateLocationInfo]):
2723 2018-05-04 Per Arne Vollan <pvollan@apple.com>
2725 Shutdown WindowServer connections after checking in with launch services
2726 https://bugs.webkit.org/show_bug.cgi?id=185082
2727 <rdar://problem/39613173>
2729 Reviewed by Brent Fulgham.
2731 When WindowServer access is blocked in the WebContent process, we should shutdown all connections
2732 after checking in with launch services.
2734 * WebProcess/cocoa/WebProcessCocoa.mm:
2735 (WebKit::WebProcess::platformInitializeProcess):
2737 2018-05-04 Don Olmstead <don.olmstead@sony.com>
2739 [Win][WebKit] Fix forwarding headers for Windows build
2740 https://bugs.webkit.org/show_bug.cgi?id=184412
2742 Reviewed by Alex Christensen.
2744 * PlatformWin.cmake:
2745 * UIProcess/API/APIAttachment.h:
2746 * UIProcess/API/APIContextMenuClient.h:
2747 * UIProcess/API/C/WKProcessTerminationReason.h:
2748 * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
2750 2018-05-04 Chris Dumez <cdumez@apple.com>
2752 [iOS] Apps that are not visible may not get suspended if they trigger page loads while in the background
2753 https://bugs.webkit.org/show_bug.cgi?id=185318
2755 Reviewed by Geoffrey Garen.
2757 Whenever there is a page load going on, we take a background process assertion to delay process
2758 suspension until this load completes. However, there is also a 3 seconds grace period after
2759 a load is complete to allow the app to trigger a new load shortly after. This grace period was
2760 introduced to support use cases where a visible app does loads in an offscreen view. However,
2761 it can be abused by apps running in the background as they could trigger new page loads while
2762 in the background to delay process suspension. This patch tightens the policy so that only
2763 apps that are currently visible get to use this grace period. Apps that are in the background
2764 get to finish their current load and will then get suspended.
2766 * UIProcess/Cocoa/NavigationState.mm:
2767 (WebKit::NavigationState::didChangeIsLoading):
2769 2018-05-04 Per Arne Vollan <pvollan@apple.com>
2771 Adjust sandbox profile for simulator.
2772 https://bugs.webkit.org/show_bug.cgi?id=185319
2774 Reviewed by Brent Fulgham.
2776 Disable Kerberos rules, as well as rules related to NSApplication initialization.
2778 * WebProcess/com.apple.WebProcess.sb.in:
2780 2018-05-04 Tim Horton <timothy_horton@apple.com>
2782 Wasted time dlopening Lookup when tearing down a WKWebView
2783 https://bugs.webkit.org/show_bug.cgi?id=185310
2784 <rdar://problem/39934085>
2786 Reviewed by Wenson Hsieh.
2788 * UIProcess/Cocoa/WebViewImpl.h:
2789 * UIProcess/Cocoa/WebViewImpl.mm:
2790 (-[WKWindowVisibilityObserver dealloc]):
2791 (-[WKWindowVisibilityObserver startObservingLookupDismissalIfNeeded]):
2792 (WebKit::WebViewImpl::prepareForDictionaryLookup):
2793 (-[WKWindowVisibilityObserver startObservingLookupDismissal]): Deleted.
2794 Avoid un-registering as a Lookup dismissal observer if we never
2795 registered in the first place, because that involves dlopening Lookup.
2797 2018-05-04 Megan Gardner <megan_gardner@apple.com>
2799 Allow Web Touch events to timeout
2800 https://bugs.webkit.org/show_bug.cgi?id=185282
2801 <rdar://problem/38728319>
2803 Reviewed by Tim Horton.
2805 Web Touch events currently never time out, which blocks the user from interacting with the UI Process at all.
2806 We should allow these events to time out so that the user can interact with the rest of the UI.
2808 * UIProcess/WebPageProxy.cpp:
2809 (WebKit::WebPageProxy::handleTouchEventSynchronously):
2811 2018-05-04 Wenson Hsieh <whsieh@berkeley.edu>
2813 REGRESSION: [ios-simulator] 3 WKWebViewAutofillTests API test failures seen with 11.3 SDK
2814 https://bugs.webkit.org/show_bug.cgi?id=184196
2815 <rdar://problem/39054481>
2817 Reviewed by Tim Horton.
2819 Remove an unnecessary call to NSClassFromString, now that trunk WebKit only supports iOS 11.3+.
2821 * UIProcess/ios/WKContentViewInteraction.mm:
2822 (-[WKContentView insertTextSuggestion:]):
2824 2018-05-04 Youenn Fablet <youenn@apple.com>
2826 NetworkProcessProxy::didReceiveAuthenticationChallenge should take an AuthenticationChallenge r-value
2827 https://bugs.webkit.org/show_bug.cgi?id=185302
2829 Reviewed by Geoffrey Garen.
2831 Pass AuthenticationChallenge as an r-value since it comes from IPC.
2832 No change of behavior.
2834 * UIProcess/Authentication/AuthenticationChallengeProxy.cpp:
2835 (WebKit::AuthenticationChallengeProxy::AuthenticationChallengeProxy):
2836 * UIProcess/Authentication/AuthenticationChallengeProxy.h:
2837 (WebKit::AuthenticationChallengeProxy::create):
2838 * UIProcess/Downloads/DownloadProxy.cpp:
2839 (WebKit::DownloadProxy::didReceiveAuthenticationChallenge):
2840 * UIProcess/Downloads/DownloadProxy.h:
2841 * UIProcess/Network/NetworkProcessProxy.cpp:
2842 (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
2843 * UIProcess/Network/NetworkProcessProxy.h:
2845 2018-05-04 Sihui Liu <sihui_liu@apple.com>
2847 Assertion failure in NetworkStorageSession::setCookie: privilege of UI process is not set
2848 https://bugs.webkit.org/show_bug.cgi?id=185262
2850 Reviewed by Chris Dumez.
2852 Fix an assertion failure by setting UI process privileges in constructor of WebsiteDataStore
2853 because UI process may use the cookie API before creating a WebView.
2855 * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2856 (WebKit::WebsiteDataStore::WebsiteDataStore):
2858 2018-05-04 Per Arne Vollan <pvollan@apple.com>
2860 Adjust sandbox rules for simulator.
2861 https://bugs.webkit.org/show_bug.cgi?id=185275
2863 Reviewed by Brent Fulgham.
2865 Enable rules related to CoreMedia for minimal simulator.
2867 * WebProcess/com.apple.WebProcess.sb.in:
2869 2018-05-04 Carlos Garcia Campos <cgarcia@igalia.com>
2871 [GTK] Epiphany (GNOME Web) says "Error downloading: Service Unavailable." when trying to download an image from discogs.com
2872 https://bugs.webkit.org/show_bug.cgi?id=174730
2874 Reviewed by Michael Catanzaro.
2876 The problem is that we don't send any User-Agent HTTP header for downloads started by WebProcessPool::download().
2878 * UIProcess/API/glib/WebKitDownload.cpp:
2879 (webkitDownloadUpdateRequest): Helper to update the cached request.
2880 (webkitDownloadStarted): Updated the cached request if we have one.
2881 (webkit_download_get_request): Use webkitDownloadUpdateRequest().
2882 * UIProcess/API/glib/WebKitDownloadClient.cpp:
2883 * UIProcess/API/glib/WebKitDownloadPrivate.h:
2884 * UIProcess/WebProcessPool.cpp:
2885 (WebKit::WebProcessPool::download): Set the User-Agent HTTP header if there isn't any.
2887 2018-05-04 Carlos Garcia Campos <cgarcia@igalia.com>
2889 [GTK] Some event tests failing after r230817
2890 https://bugs.webkit.org/show_bug.cgi?id=185072
2892 Reviewed by Michael Catanzaro.
2894 Do not send mouse move events to the WebProcess for crossing events during testing. WTR never generates crossing
2895 events and they can confuse tests.
2897 Fixes: editing/pasteboard/drag-link-with-data-transfer-adds-trusted-link-to-pasteboard.html
2898 fast/css/user-drag-none.html
2899 fast/events/context-activated-by-key-event.html
2900 fast/events/drag-selects-image.html
2901 fast/events/dropzone-005.html
2902 fast/events/mouse-click-events.html
2903 fast/events/mouse-cursor-change.html
2905 * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2906 (webkitWebViewBaseCrossingNotifyEvent):
2908 2018-05-03 Chris Dumez <cdumez@apple.com>
2910 More aggressively terminate child processes when the connection to their parent process is severed
2911 https://bugs.webkit.org/show_bug.cgi?id=177972
2912 <rdar://problem/33317607>
2914 Reviewed by Geoff Garen.
2916 More aggressively terminate child processes when the connection to their parent process is severed.
2917 Previously, we would dispatch to the main thread and then exit the process. This would sometimes
2918 cause the process to say alive for 10 seconds until our watchdog would forcefully terminate the
2919 process. This could happen in particular when the main thread is blocked on a synchronous IPC.
2921 * NetworkProcess/NetworkProcess.cpp:
2922 (WebKit::NetworkProcess::didClose): Deleted.
2923 * NetworkProcess/NetworkProcess.h:
2924 * PluginProcess/PluginProcess.cpp:
2925 (WebKit::PluginProcess::didClose): Deleted.
2926 * PluginProcess/PluginProcess.h:
2927 * Shared/ChildProcess.cpp:
2928 (WebKit::ChildProcess::didClose):
2929 (WebKit::didCloseOnConnectionWorkQueue):
2930 (WebKit::ChildProcess::terminationTimerFired):
2931 * Shared/ChildProcess.h:
2932 * StorageProcess/StorageProcess.cpp:
2933 (WebKit::StorageProcess::didClose): Deleted.
2934 * StorageProcess/StorageProcess.h:
2935 * WebProcess/WebProcess.cpp:
2936 (WebKit::WebProcess::didClose): Deleted.
2937 * WebProcess/WebProcess.h:
2939 2018-05-03 Yusuke Suzuki <utatane.tea@gmail.com>
2941 Use default std::optional if it is provided
2942 https://bugs.webkit.org/show_bug.cgi?id=185159
2944 Reviewed by Michael Catanzaro.
2946 * Shared/SandboxExtension.h:
2947 (WebKit::SandboxExtension::Handle::decode):
2948 * Shared/TouchBarMenuItemData.cpp:
2949 (WebKit::TouchBarMenuItemData::decode):
2951 2018-05-03 Justin Fan <justin_fan@apple.com>
2953 [WebGL] Add runtime flag for enabling ASTC support in WebGL
2954 https://bugs.webkit.org/show_bug.cgi?id=184840
2956 Reviewed by Myles C. Maxfield.
2958 Added runtime flag for ASTC support in WebGL, to turn on/off when extension is implemented.
2960 * Shared/WebPreferences.yaml:
2962 2018-05-03 Keith Rollin <krollin@apple.com>
2964 Unreviewed build fix after <https://trac.webkit.org/changeset/231282>.
2966 * NetworkProcess/NetworkActivityTracker.h:
2968 2018-05-03 Wenson Hsieh <wenson_hsieh@apple.com>
2970 Ads in NYTimes app are shifted downwards by the scroll view's top content inset
2971 https://bugs.webkit.org/show_bug.cgi?id=185251
2972 <rdar://problem/39062357>
2974 Reviewed by Tim Horton.
2976 The NYTimes app embeds advertisements in each article's WKWebView by adding views in the WKScrollView's view
2977 hierarchy. These views are positioned using the bounding client rects of elements in the DOM (via Element
2978 ::getBoundingClientRect). Prior to r229641, WebKit would report bounding client rects inset by the content
2979 insets of WKScrollView, which means that if a top content inset X is specified on the scroll view, an element
2980 that is flush against the top of the viewport will have a bounding client rect top of -X (when it should really
2983 To account for this, NYTimes adds the scroll view content insets back to the bounding client rect when
2984 determining the position of each advertisement which, after r229641, causes these views to be shifted downwards
2985 by an amount equal to the scroll view content inset top.
2987 This new behavior does not affect Safari, since Safari uses SPI to explicitly set obscured insets. As such, we
2988 address this by gating the scroll view content inset fix with a linked-on-or-after check.
2990 * UIProcess/API/Cocoa/WKWebView.mm:
2991 (-[WKWebView _computedObscuredInset]):
2992 * UIProcess/Cocoa/VersionChecks.h:
2994 2018-05-03 Chris Dumez <cdumez@apple.com>
2996 Load hangs if the WebProcess fails to launch
2997 https://bugs.webkit.org/show_bug.cgi?id=185225
2998 <rdar://problem/38249058>
3000 Reviewed by Geoff Garen.
3002 When a process fails to launch, ChildProcessProxy::didFinishLaunching() gets called with an
3003 invalid connection identifier. While NetworkProcessProxy::didFinishLaunching() properly deals with
3004 this situation, WebProcessProxy::didFinishLaunching() does not. As a result, we do not attempt to
3005 relaunch the process, we do not notify the client and WebPageProxy::m_isValid stays true.
3007 This patch thus updates WebProcessProxy::didFinishLaunching() to check if the connection identifier
3008 is valid and treats it as a crash. As a result, the WebPageProxies properly reset their state and
3009 the client gets notified of the crash so that it can attempt to reload.
3011 * UIProcess/API/Cocoa/WKProcessPool.mm:
3012 (-[WKProcessPool _makeNextWebProcessLaunchFailForTesting]):
3013 * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
3014 * UIProcess/Launcher/ProcessLauncher.h:
3015 * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
3016 (WebKit::ProcessLauncher::launchProcess):
3017 Add SPI to make the next WebProcess launch fail, for the purpose of API testing.
3019 * UIProcess/WebProcessPool.h:
3020 * UIProcess/WebProcessProxy.cpp:
3021 (WebKit::WebProcessProxy::getLaunchOptions):
3022 (WebKit::WebProcessProxy::didClose):
3023 (WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
3024 (WebKit::WebProcessProxy::didFinishLaunching):
3025 * UIProcess/WebProcessProxy.h:
3027 2018-05-03 Commit Queue <commit-queue@webkit.org>
3029 Unreviewed, rolling out r231223 and r231288.
3030 https://bugs.webkit.org/show_bug.cgi?id=185256
3032 The change in r231223 breaks internal builds, and r231288 is a
3033 dependent change. (Requested by ryanhaddad on #webkit).
3035 Reverted changesets:
3037 "Use default std::optional if it is provided"
3038 https://bugs.webkit.org/show_bug.cgi?id=185159
3039 https://trac.webkit.org/changeset/231223
3041 "Use pointer instead of
3042 std::optional<std::reference_wrapper<>>"
3043 https://bugs.webkit.org/show_bug.cgi?id=185186
3044 https://trac.webkit.org/changeset/231288
3046 2018-05-03 Per Arne Vollan <pvollan@apple.com>
3048 An error message is written to stderr when the WebContent process is blocking WindowServer access.
3049 https://bugs.webkit.org/show_bug.cgi?id=184701
3051 Reviewed by Brent Fulgham.
3053 Calling 'setApplicationIsDaemon(true)' instead of 'CGSSetDenyWindowServerConnections(true)' to disable
3054 access to the WindowServer in the WebContent process, will remove this error message. After this change,
3055 the url of the WebContent process is still showing up in Activity Monitor, which previously was a
3056 problem when calling 'setApplicationIsDaemon(true)'.
3058 * WebProcess/WebProcess.cpp:
3059 (WebKit::WebProcess::initializeProcess):
3060 * WebProcess/cocoa/WebProcessCocoa.mm:
3061 (WebKit::WebProcess::platformInitializeProcess):
3063 2018-05-03 Ryan Haddad <ryanhaddad@apple.com>
3065 Unreviewed, rolling out r231253.
3067 The API test added with this change is crashing on the bots.
3071 "Web Inspector: opt out of process swap on navigation if a Web
3072 Inspector frontend is connected"
3073 https://bugs.webkit.org/show_bug.cgi?id=184861
3074 https://trac.webkit.org/changeset/231253
3076 2018-05-03 Brent Fulgham <bfulgham@apple.com>
3078 Re-eneable Network Extension support in the WebContent process
3079 https://bugs.webkit.org/show_bug.cgi?id=185236
3080 <rdar://problem/39883004>
3082 Reviewed by Eric Carlson.
3084 * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
3085 * WebProcess/com.apple.WebProcess.sb.in:
3087 2018-05-03 Tim Horton <timothy_horton@apple.com>
3089 REGRESSION (r231014): Entitlements are not applied to XPC services on macOS
3090 https://bugs.webkit.org/show_bug.cgi?id=185241
3092 Reviewed by Dan Bernstein.
3094 * Configurations/BaseXPCService.xcconfig:
3095 * Configurations/WebContentService.Development.xcconfig:
3096 * Configurations/WebContentService.xcconfig:
3098 2018-05-03 Carlos Garcia Campos <cgarcia@igalia.com>
3100 REGRESSION(r222772): [GTK][WPE] WebProcess from WebKitGtk+ 2.19.9x SIGSEVs in WebKit::WebProcess::ensureNetworkProcessConnection() at Source/WebKit/WebProcess/WebProcess.cpp:1127
3101 https://bugs.webkit.org/show_bug.cgi?id=183348
3103 Reviewed by Michael Catanzaro.
3105 When connection doesn't exit in case of sync message failure, always exit in case of failing to send
3106 GetNetworkProcessConnection or GetStorageProcessConnection messages. This can happen when the WebView is created
3107 and destroyed quickly.
3109 * WebProcess/WebProcess.cpp:
3110 (WebKit::WebProcess::ensureNetworkProcessConnection):
3111 (WebKit::WebProcess::ensureWebToStorageProcessConnection):
3113 2018-05-02 Nan Wang <n_wang@apple.com>
3115 AX: Missing kAXSWebAccessibilityEventsEnabledNotification causes a crash
3116 https://bugs.webkit.org/show_bug.cgi?id=185237
3118 Reviewed by Dan Bernstein.
3120 When libAccessibility.dylib is missing, the compiler would optimize out the global
3121 notification and lead to a crash. Fixed it by using the isNullFunction check instead,
3122 since we are sure the global notification would be there when the corresponding function
3125 * UIProcess/API/Cocoa/WKWebView.mm:
3126 (-[WKWebView _initializeWithConfiguration:]):
3128 2018-05-02 Keith Rollin <krollin@apple.com>
3130 Add facility for tracking times and results of page and resource loading
3131 https://bugs.webkit.org/show_bug.cgi?id=184838
3132 <rdar://problem/36548974>
3134 Reviewed by Brent Fulgham.
3136 Add NetworkActivityTracker. The idea behind this facility is to create
3137 and destroy them around networking activity that we want to track for
3138 the purpose of measuring overall network health. They can be created
3139 around the loading of pages or individual resources, and can be
3140 arranged in a parent/child hierarchy to indicate what pages the
3141 resources are part of. The NetworkActivity tracker tracks load times
3142 and results. On Cocoa, it can be integrated with CFNetwork in order to
3143 associate WebKit activity with low-level networking activity.
3146 * Configurations/WebKit.xcconfig:
3147 * NetworkProcess/NetworkActivityTracker.cpp: Copied from Source/WebKit/NetworkProcess/NetworkLoadParameters.h.
3148 (WebKit::NetworkActivityTracker::NetworkActivityTracker):
3149 (WebKit::NetworkActivityTracker::~NetworkActivityTracker):
3150 (WebKit::NetworkActivityTracker::setParent):
3151 (WebKit::NetworkActivityTracker::start):
3152 (WebKit::NetworkActivityTracker::complete):
3153 * NetworkProcess/NetworkActivityTracker.h: Added.
3154 (WebKit::NetworkActivityTracker::getPlatformObject):
3155 * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3156 (WebKit::NetworkConnectionToWebProcess::didClose):
3157 (WebKit::NetworkConnectionToWebProcess::pageLoadCompleted):
3158 (WebKit::networkActivityTrackingEnabled):
3159 (WebKit::NetworkConnectionToWebProcess::startTrackingResourceLoad):
3160 (WebKit::NetworkConnectionToWebProcess::stopTrackingResourceLoad):
3161 (WebKit::NetworkConnectionToWebProcess::stopAllNetworkActivityTracking):
3162 (WebKit::NetworkConnectionToWebProcess::stopAllNetworkActivityTrackingForPage):
3163 (WebKit::NetworkConnectionToWebProcess::findRootNetworkActivity):
3164 (WebKit::NetworkConnectionToWebProcess::findNetworkActivityTracker):
3165 * NetworkProcess/NetworkConnectionToWebProcess.h:
3166 (WebKit::NetworkConnectionToWebProcess::ResourceNetworkActivityTracker::ResourceNetworkActivityTracker):
3167 * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
3168 * NetworkProcess/NetworkDataTask.cpp:
3169 (WebKit::NetworkDataTask::create):
3170 * NetworkProcess/NetworkLoadParameters.h:
3171 * NetworkProcess/NetworkProcess.cpp:
3172 (WebKit::NetworkProcess::initializeNetworkProcess):
3173 * NetworkProcess/NetworkProcess.h:
3174 (WebKit::NetworkProcess::trackNetworkActivity const):
3175 * NetworkProcess/NetworkProcessCreationParameters.cpp:
3176 (WebKit::NetworkProcessCreationParameters::encode const):
3177 (WebKit::NetworkProcessCreationParameters::decode):
3178 * NetworkProcess/NetworkProcessCreationParameters.h:
3179 * NetworkProcess/NetworkResourceLoader.cpp:
3180 (WebKit::NetworkResourceLoader::start):
3181 (WebKit::NetworkResourceLoader::cleanup):
3182 (WebKit::NetworkResourceLoader::abort):
3183 (WebKit::NetworkResourceLoader::didFinishLoading):
3184 (WebKit::NetworkResourceLoader::didFailLoading):
3185 (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
3186 (WebKit::NetworkResourceLoader::continueProcessingCachedEntryAfterDidReceiveResponse):
3187 * NetworkProcess/NetworkResourceLoader.h:
3188 * NetworkProcess/cocoa/NetworkActivityTrackerCocoa.mm: Added.
3189 (WebKit::NetworkActivityTracker::NetworkActivityTracker):
3190 (WebKit::NetworkActivityTracker::~NetworkActivityTracker):
3191 (WebKit::NetworkActivityTracker::setParent):
3192 (WebKit::NetworkActivityTracker::start):
3193 (WebKit::NetworkActivityTracker::complete):
3194 * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
3195 * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3196 (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
3197 * UIProcess/API/APIProcessPoolConfiguration.cpp:
3198 (API::ProcessPoolConfiguration::copy):
3199 * UIProcess/API/APIProcessPoolConfiguration.h:
3200 * UIProcess/API/C/WKContextConfigurationRef.cpp:
3201 (WKContextConfigurationTrackNetworkActivity):
3202 (WKContextConfigurationSetTrackNetworkActivity):
3203 * UIProcess/API/C/WKContextConfigurationRef.h:
3204 * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
3205 * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
3206 (-[_WKProcessPoolConfiguration trackNetworkActivity]):
3207 (-[_WKProcessPoolConfiguration setTrackNetworkActivity:]):
3208 * UIProcess/WebProcessPool.cpp:
3209 (WebKit::WebProcessPool::ensureNetworkProcess):
3210 * WebKit.xcodeproj/project.pbxproj:
3211 * WebProcess/Network/WebLoaderStrategy.cpp:
3212 (WebKit::WebLoaderStrategy::pageLoadCompleted):
3213 * WebProcess/Network/WebLoaderStrategy.h:
3215 2018-05-02 Jer Noble <jer.noble@apple.com>
3217 Open audio/video sandbox services for minimal simulator
3218 https://bugs.webkit.org/show_bug.cgi?id=185217
3219 <rdar://problem/39918909>
3221 Reviewed by Per Arne Vollan.
3223 * WebKit.xcodeproj/project.pbxproj:
3224 * WebProcess/com.apple.WebProcess.sb.in:
3226 2018-05-02 Daniel Bates <dabates@apple.com>
3228 Cleanup NetworkResourceLoader::didReceiveResponse()
3229 https://bugs.webkit.org/show_bug.cgi?id=185209
3231 Reviewed by Chris Dumez.
3233 Use early returns to make the control flow easier to read and reason about. Disregarding a
3234 From-Origin violation, NetworkResourceLoader::didReceiveResponse() only returns NetworkLoadClient::ShouldContinueDidReceiveResponse::No
3235 when the load is for a main resource and hence it must wait for the embedding client to allow
3236 the load before continuing with it. With regards to a From-Origin violation, the network
3237 process schedules to fail the load in a subsequent turn of the event loop before returning
3238 NetworkLoadClient::ShouldContinueDidReceiveResponse::No. It return NetworkLoadClient::ShouldContinueDidReceiveResponse::No
3239 solely to tell the NetworkLoadClient to defer assuming the load is allowed (because we will
3240 fail it on the next turn of the event loop).
3242 Additionally, remove all logging about the return value as we no longer have a need for
3245 * NetworkProcess/NetworkResourceLoader.cpp:
3246 (WebKit::NetworkResourceLoader::didReceiveResponse):
3248 2018-05-02 Alex Christensen <achristensen@webkit.org>
3250 Add WKWebsiteDataStorePrivate._proxyConfiguration SPI
3251 https://bugs.webkit.org/show_bug.cgi?id=185179
3253 Reviewed by Andy Estes.
3255 * NetworkProcess/NetworkSessionCreationParameters.h:
3256 (WebKit::NetworkSessionCreationParameters::encode const):
3257 (WebKit::NetworkSessionCreationParameters::decode):
3258 * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3259 (WebKit::NetworkDataTaskCocoa::applySniffingPoliciesAndBindRequestToInferfaceIfNeeded):
3260 * NetworkProcess/cocoa/NetworkSessionCocoa.h:
3261 * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3262 (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
3263 * Shared/WebsiteDataStoreParameters.cpp:
3264 (WebKit::WebsiteDataStoreParameters::privateSessionParameters):
3265 * Shared/cf/ArgumentCodersCF.cpp:
3268 * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3269 (-[WKWebsiteDataStore _setProxyConfiguration:]):
3270 (-[WKWebsiteDataStore _proxyConfiguration]):
3271 * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
3272 * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
3273 (WebKit::WebsiteDataStore::parameters):
3274 * UIProcess/WebsiteData/WebsiteDataStore.h:
3275 (WebKit::WebsiteDataStore::setProxyConfiguration):
3276 (WebKit::WebsiteDataStore::proxyConfiguration):
3278 2018-05-02 Youenn Fablet <youenn@apple.com>
3280 Use NetworkLoadChecker for navigation loads
3281 https://bugs.webkit.org/show_bug.cgi?id=184892
3282 <rdar://problem/39652686>
3284 Reviewed by Chris Dumez.
3286 Compute whether a response is same origin in no-cors case.
3287 This allows providing more precise filtering.
3288 In case of navigate loads, set the tainting to basic which will make filtering to the minimum.
3290 Pass the sourceOrigin for navigation loads as well.
3291 Enable to restrict HTTP response access for navigation load.
3293 Content Blockers are disabled for now in NetworkLoadChecker for navigation loads.
3294 They should be reenabled as a follow-up.
3296 Add a specific case to allow any redirection to about:// URLs.
3297 While this does not conform with the spec, this keeps the existing WebKit behavior.
3299 * NetworkProcess/NetworkLoadChecker.cpp:
3300 (WebKit::NetworkLoadChecker::NetworkLoadChecker):
3301 (WebKit::NetworkLoadChecker::validateResponse):
3302 (WebKit::NetworkLoadChecker::continueCheckingRequest):
3303 (WebKit::NetworkLoadChecker::doesNotNeedCORSCheck const):
3304 * NetworkProcess/NetworkResourceLoader.cpp:
3305 (WebKit::NetworkResourceLoader::sanitizeResponseIfPossible):
3306 * WebProcess/Network/WebLoaderStrategy.cpp:
3307 (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
3308 (WebKit::WebLoaderStrategy::isDoingLoadingSecurityChecks const):
3309 We only do security checks if this runtime flag is on.
3310 * WebProcess/Network/WebLoaderStrategy.h:
3312 2018-05-02 Jer Noble <jer.noble@apple.com>
3314 Make EncryptedMediaAPIEnabled an experimental feature
3315 https://bugs.webkit.org/show_bug.cgi?id=185212
3317 Reviewed by Eric Carlson.
3319 * Shared/WebPreferences.yaml:
3321 2018-05-02 Per Arne Vollan <pvollan@apple.com>
3323 Adjust sandbox profile in simulator mode.
3324 https://bugs.webkit.org/show_bug.cgi?id=185172
3325 <rdar://problem/39876860>
3327 Reviewed by Brent Fulgham.
3329 Fix some sandbox violations.
3331 * WebProcess/com.apple.WebProcess.sb.in:
3333 2018-05-02 Brian Burg <bburg@apple.com>
3335 Web Inspector: opt out of process swap on navigation if a Web Inspector frontend is connected
3336 https://bugs.webkit.org/show_bug.cgi?id=184861
3337 <rdar://problem/39153768>
3339 Reviewed by Ryosuke Niwa.
3341 We need to track how many frontends are attached to the web page (both local and remote).
3342 InspectorController propagates this out to WebKit via InspectorClient. This is then
3343 kept in UIProcess as a member of WebPageProxy. When making a decision whether to use a
3344 new process for a navigation, return early with "no" if any frontends are open for the
3345 page being navigated.
3347 * UIProcess/WebPageProxy.h:
3348 (WebKit::WebPageProxy::didChangeInspectorFrontendCount):
3349 (WebKit::WebPageProxy::inspectorFrontendCount const):
3350 * UIProcess/WebPageProxy.messages.in:
3351 * UIProcess/WebProcessPool.cpp:
3352 (WebKit::WebProcessPool::processForNavigation):
3353 * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
3354 (WebKit::WebInspectorClient::frontendCountChanged):
3355 * WebProcess/WebCoreSupport/WebInspectorClient.h:
3356 * WebProcess/WebPage/WebPage.cpp:
3357 (WebKit::WebPage::inspectorFrontendCountChanged):
3358 * WebProcess/WebPage/WebPage.h:
3360 2018-05-02 Jer Noble <jer.noble@apple.com>
3362 Adopt -destinationWindowToExitFullScreenForWindow:
3363 https://bugs.webkit.org/show_bug.cgi?id=185204
3364 <rdar://problem/22486621>
3366 Reviewed by Eric Carlson.
3368 * UIProcess/mac/WKFullScreenWindowController.mm:
3369 (-[WKFullScreenWindowController destinationWindowToExitFullScreenForWindow:]):
3371 2018-05-02 Per Arne Vollan <pvollan@apple.com>
3373 Disable Media capture rules in sandbox for simulator.
3374 https://bugs.webkit.org/show_bug.cgi?id=185206
3375 <rdar://problem/39910015>
3377 Reviewed by Eric Carlson.
3379 These rules are not relevant in this case.
3381 * WebProcess/com.apple.WebProcess.sb.in:
3383 2018-05-02 Eric Carlson <eric.carlson@apple.com>
3385 [iOS] Provide audio route information when invoking AirPlay picker
3386 https://bugs.webkit.org/show_bug.cgi?id=185199
3387 <rdar://problem/39853103>
3389 Reviewed by Jer Noble.
3391 * Scripts/webkit/messages.py:
3392 * UIProcess/PageClient.h:
3393 * UIProcess/WebPageProxy.h:
3394 * UIProcess/WebPageProxy.messages.in:
3395 * UIProcess/ios/PageClientImplIOS.h:
3396 * UIProcess/ios/PageClientImplIOS.mm:
3397 (WebKit::PageClientImpl::showPlaybackTargetPicker): Pass route sharing policy and routing context UID.
3399 * UIProcess/ios/WKContentViewInteraction.h:
3400 * UIProcess/ios/WKContentViewInteraction.mm:
3401 (-[WKContentView _showPlaybackTargetPicker:fromRect:routeSharingPolicy:routingContextUID:]): Take same.
3402 (-[WKContentView _showPlaybackTargetPicker:fromRect:]): Deleted.
3404 * UIProcess/ios/WebPageProxyIOS.mm:
3405 (WebKit::WebPageProxy::showPlaybackTargetPicker): Pass route sharing policy and routing context UID.
3407 * UIProcess/ios/forms/WKAirPlayRoutePicker.h:
3408 * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
3409 (-[WKAirPlayRoutePicker showFromView:routeSharingPolicy:routingContextUID:]): Take same.
3410 (-[WKAirPlayRoutePicker showFromView:]): Deleted.
3412 * WebProcess/WebCoreSupport/WebChromeClient.h:
3413 * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
3414 (WebKit::WebChromeClient::showPlaybackTargetPicker):
3416 2018-05-02 Jer Noble <jer.noble@apple.com>
3418 Get the WebKit.framework bundle by asking for WKWebView
3419 https://bugs.webkit.org/show_bug.cgi?id=185175
3421 Reviewed by Tim Horton.
3423 * NetworkProcess/mac/NetworkProcessMac.mm:
3424 (WebKit::NetworkProcess::initializeSandbox):
3425 * Shared/mac/ChildProcessMac.mm:
3426 (WebKit::ChildProcess::initializeSandbox):
3427 * StorageProcess/mac/StorageProcessMac.mm:
3428 (WebKit::StorageProcess::initializeSandbox):
3430 2018-05-02 Youenn Fablet <youenn@apple.com>
3432 Cannot gather srflx or relay ICE candidates on IPv6 network (ICE agent hangs?)
3433 https://bugs.webkit.org/show_bug.cgi?id=181009
3434 <rdar://problem/36144555>
3436 Reviewed by Eric Carlson.
3438 On iOS/IPv6 networks, STUN servers name resolution returns a zero IPv6 IP address.
3439 No error is raised which leads to sending STUN requests with that IP address.
3440 Once the request times out, the ICE candidate gathering finishes with host candidates only.
3442 This patch makes WebRTC DNS resolver to send only IPv4 resolved addresses.
3443 STUN is used for NAT traversal which is for IPv4 addresses.
3444 Not sending IPv6 addresses allows terminating ICE candidate gathering sooner.
3446 Manually tested on iOS with IPv4/IPv6 and IPv6 networks.
3448 * NetworkProcess/webrtc/NetworkRTCResolverCocoa.cpp:
3449 (WebKit::resolvedName):
3451 2018-05-02 Youenn Fablet <youenn@apple.com>
3453 CacheStorage::Engine should keep a list of initialization callback
3454 https://bugs.webkit.org/show_bug.cgi?id=185184
3455 <rdar://problem/38875651>
3457 Reviewed by Antti Koivisto.
3459 Keep each initialize callback in a Vector so as to compute the salt only once.
3460 Call all callbacks then in a loop.
3462 * NetworkProcess/cache/CacheStorageEngine.cpp:
3463 (WebKit::CacheStorage::Engine::~Engine):
3464 (WebKit::CacheStorage::Engine::initialize):
3465 * NetworkProcess/cache/CacheStorageEngine.h:
3467 2018-05-02 Jer Noble <jer.noble@apple.com>
3469 Pipe volume through PlaybackSessionManager/Proxy.
3470 https://bugs.webkit.org/show_bug.cgi?id=185182
3472 Reviewed by Eric Carlson.
3474 * UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
3475 * UIProcess/Cocoa/PlaybackSessionManagerProxy.messages.in:
3476 * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm: